:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
}

body {
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(37, 99, 235, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(14, 165, 233, 0.06), transparent),
        #f1f5f9;
    min-height: 100vh;
    color: var(--ink);
}

/* Navbar — admin + merchant (high contrast white on blue) */
.navbar.bg-primary,
.app-navbar {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #2563eb 100%) !important;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.25);
    padding: 0.75rem 0;
}

.app-navbar .navbar-brand,
.app-navbar .navbar-brand:hover,
.app-navbar .navbar-brand:focus,
.app-navbar .navbar-brand:visited {
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    color: #ffffff !important;
}

.app-navbar .nav-link,
.app-navbar .app-nav-link,
.app-navbar a.nav-link,
.app-navbar button.nav-link,
.app-navbar .navbar-nav .nav-link,
.app-navbar form .nav-link,
.app-navbar form button.nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 0.85rem !important;
    border-radius: 8px;
    margin-left: 0.15rem;
    color: #ffffff !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #ffffff;
    transition: background 0.2s, color 0.2s;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus,
.app-navbar .app-nav-link:hover,
.app-navbar .app-nav-link:focus,
.app-navbar a.nav-link:hover,
.app-navbar button.nav-link:hover,
.app-navbar form .nav-link:hover,
.app-navbar form button.nav-link:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}

.app-navbar .nav-link.active,
.app-navbar .app-nav-link.active {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}

.app-navbar form .nav-link,
.app-navbar form button.nav-link {
    cursor: pointer;
}

.app-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.75) !important;
}

.app-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.app-navbar .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.auth-card {
    max-width: 420px;
    margin: 4rem auto;
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.stat-card {
    border: none;
    border-radius: 12px;
    transition: transform .2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.badge-pending { background: #f59e0b; }
.badge-completed { background: #10b981; }
.badge-failed { background: #ef4444; }

.api-key-box {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: monospace;
    font-size: .85rem;
    word-break: break-all;
}

pre.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    font-size: .85rem;
    overflow-x: auto;
}

.sidebar-admin {
    min-height: calc(100vh - 56px);
    background: #1e293b;
}

.sidebar-admin .nav-link {
    color: #94a3b8;
    border-radius: 8px;
    margin-bottom: 4px;
}

.sidebar-admin .nav-link:hover,
.sidebar-admin .nav-link.active {
    background: #334155;
    color: #fff;
}

.table-transactions {
    font-size: .9rem;
}

.hero-landing {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    padding: 3rem 0;
    border-radius: 0 0 24px 24px;
    margin-bottom: 2rem;
}

.dashboard-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 45%, #6366f1 100%);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.2);
}

.merchant-hero {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #6366f1 100%);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.2);
}

.dashboard-hero-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

.dashboard-hero-stat {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
}

.stat-card-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.stat-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-blue .stat-card-icon { background: #dbeafe; color: #2563eb; }
.stat-green .stat-card-icon { background: #d1fae5; color: #059669; }
.stat-amber .stat-card-icon { background: #fef3c7; color: #d97706; }
.stat-purple .stat-card-icon { background: #ede9fe; color: #7c3aed; }

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.stat-card-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.dashboard-panel {
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.dashboard-panel .card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
}

.dashboard-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: #94a3b8;
}

.dashboard-empty i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.progress-modern {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
}

.progress-modern .progress-bar {
    border-radius: 4px;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 1.5rem;
    color: #2563eb;
}

.quick-action-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

.quick-action-btn small {
    font-size: 0.75rem;
    color: #94a3b8;
}

.page-header-modern {
    padding: 0.25rem 0;
}

.page-header-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 600;
}

.page-header-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
}

.page-header-badge {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid #bfdbfe;
}

.page-header-badge-success {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.provider-slug {
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: ui-monospace, monospace;
    background: #f1f5f9;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
}

.provider-url {
    color: #475569;
    font-size: 0.9rem;
}

.provider-url:hover {
    color: #2563eb;
}

.provider-row-active {
    background: rgba(16, 185, 129, 0.04);
}

.provider-row-active:hover {
    background: rgba(16, 185, 129, 0.08) !important;
}

.settings-icon-lg {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.user-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
}

.user-website {
    color: #475569;
    font-size: 0.9rem;
}

.user-website:hover {
    color: #2563eb;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
}

.status-active { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.status-inactive { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }

.search-box {
    position: relative;
    min-width: 220px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.search-box input {
    padding-left: 2.25rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.search-box input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-modern {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
}

.payment-filter {
    min-width: 140px;
    border-radius: 10px;
    border-color: #e2e8f0;
}

.tx-reference {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: #475569;
    background: #f8fafc;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.payment-amount {
    font-weight: 600;
    color: #0f172a;
}

.payment-phone {
    font-size: 0.9rem;
    color: #475569;
}

.status-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.status-badge-completed {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.status-badge-pending {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.status-badge-failed {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.status-badge-default {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.user-filters {
    padding-top: 0.25rem;
    border-top: 1px solid #f1f5f9;
}

.user-list-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    overflow: hidden;
}

.user-table th {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #64748b;
    font-weight: 600;
}

.user-table td {
    vertical-align: middle;
    padding: 1rem .75rem;
}

.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
}

.modal-footer-sticky {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.06);
}

.modal-dialog-scrollable .modal-body {
    max-height: min(70vh, 560px);
}

@media (max-width: 575.98px) {
    .modal-fullscreen-sm-down .modal-body {
        max-height: none;
    }

    .modal-fullscreen-sm-down .modal-footer-sticky {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }
}

.settings-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.settings-card .card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.settings-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.settings-info-card {
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.settings-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #fffbeb;
    border-radius: 8px;
    border: 1px solid #fef3c7;
}

.table-success-subtle {
    background-color: #f0fdf4 !important;
}

.font-monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
}

/* API Documentation */
.docs-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 40%, #4338ca 100%);
    color: white;
    padding: 2rem 1.75rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.25);
}

.docs-hero-meta {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.docs-meta-item + .docs-meta-item {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.docs-meta-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.docs-meta-value {
    font-size: 0.8rem;
    color: #e2e8f0;
    word-break: break-all;
}

.docs-provider-badge {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.docs-sidebar {
    position: sticky;
    top: 1rem;
}

.docs-sidebar-inner {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
}

.docs-sidebar-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.docs-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 0.15rem;
}

.docs-nav-link:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.docs-nav-link.active,
.docs-nav-link:focus {
    background: #eff6ff;
    color: #1d4ed8;
}

.docs-nav-link i {
    font-size: 0.95rem;
    opacity: 0.7;
}

.docs-flow {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.docs-flow-step {
    flex: 1;
    min-width: 120px;
    text-align: center;
    position: relative;
}

.docs-flow-num {
    position: absolute;
    top: -4px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-flow-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.65rem;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.docs-flow-text {
    font-size: 0.8rem;
    color: #475569;
    margin: 0;
    line-height: 1.4;
}

.docs-flow-arrow {
    color: #cbd5e1;
    padding-top: 1.1rem;
    flex-shrink: 0;
}

.docs-provider-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.docs-provider-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.docs-provider-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.docs-provider-zenopay .docs-provider-card-icon { background: #dbeafe; color: #2563eb; }
.docs-provider-snippe .docs-provider-card-icon { background: #fef3c7; color: #d97706; }
.docs-provider-biasharapay .docs-provider-card-icon { background: #d1fae5; color: #059669; }

.docs-ext-link {
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #2563eb;
}

.docs-ext-link:hover {
    text-decoration: underline;
}

.docs-provider-callout {
    border-left: 4px solid #e2e8f0;
}

.docs-callout-warning { border-left-color: #f59e0b; }
.docs-callout-primary { border-left-color: #2563eb; }
.docs-callout-success { border-left-color: #10b981; }

.docs-spec-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.docs-spec-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.docs-spec-key {
    font-weight: 600;
    color: #64748b;
    min-width: 110px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.docs-link-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.docs-endpoint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.docs-method {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.docs-method-post {
    background: #dcfce7;
    color: #166534;
}

.docs-method-get {
    background: #dbeafe;
    color: #1e40af;
}

.docs-endpoint-path {
    font-size: 0.85rem;
    color: #334155;
    word-break: break-all;
}

.docs-code-block {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #334155;
}

.docs-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid #334155;
}

.docs-code-lang {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    font-weight: 600;
}

.docs-copy-btn {
    background: transparent;
    border: 1px solid #475569;
    color: #cbd5e1;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.docs-copy-btn:hover {
    background: #334155;
    color: #fff;
}

.docs-copy-btn.docs-copy-done {
    background: #059669;
    border-color: #059669;
    color: #fff;
}

.docs-code-body {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.15rem;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    overflow-x: auto;
    border: none;
    border-radius: 0;
}

@media (max-width: 991.98px) {
    .docs-sidebar {
        position: static;
    }

    .docs-sidebar-inner {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        padding: 1rem;
    }

    .docs-sidebar-title {
        width: 100%;
    }

    .docs-nav-link {
        margin-bottom: 0;
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }

    .docs-flow-arrow {
        display: none;
    }

    .docs-flow {
        flex-direction: column;
        align-items: stretch;
    }

    .docs-flow-step {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        text-align: left;
        min-width: auto;
    }

    .docs-flow-icon {
        margin: 0;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .docs-flow-num {
        top: auto;
        right: auto;
        left: 36px;
        bottom: -2px;
    }

    .navbar .nav-link,
    .app-navbar .nav-link,
    .app-navbar .app-nav-link {
        margin-left: 0;
        padding: 0.65rem 0.75rem !important;
        color: #ffffff !important;
    }

    .page-header-title {
        font-size: 1.35rem;
    }

    .stat-card-value {
        font-size: 1.4rem;
    }

    .dashboard-hero {
        padding: 1.25rem !important;
    }

    .auth-card {
        margin: 1.5rem auto;
        max-width: 100%;
    }

    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }

    .search-box {
        width: 100%;
        max-width: 100%;
    }

    .table-responsive {
        margin: 0;
        -webkit-overflow-scrolling: touch;
    }

    .user-table th,
    .user-table td {
        white-space: nowrap;
        font-size: 0.85rem;
    }
}

@media (max-width: 575.98px) {
    main.container {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .stat-card-modern {
        padding: 0.9rem 1rem;
    }

    .dashboard-hero-stat {
        margin-top: 0.75rem;
    }

    .page-header-badge {
        width: 100%;
        text-align: center;
    }

    .btn-modern {
        width: 100%;
    }

    .provider-url {
        max-width: 140px;
        display: inline-block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }
}

/* Period filter */
.period-filter-bar {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.period-filter-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.period-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}

.period-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.period-chip:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.period-chip.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.period-status {
    width: auto;
    min-width: 140px;
    border-radius: 10px;
    border-color: #e2e8f0;
}

.period-custom-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.period-custom-fields .form-control {
    width: auto;
    border-radius: 10px;
}

.period-filter-meta {
    margin-top: 0.65rem;
    font-size: 0.8rem;
    color: #64748b;
}

@media (max-width: 575.98px) {
    .period-filter-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .period-status {
        width: 100%;
    }

    .period-custom-fields .form-control {
        flex: 1;
        min-width: 0;
    }
}

/* ========== Public API Docs ========== */
.docs-public-body {
    background: #f4f7f8;
}

.docs-public-wrap {
    max-width: none !important;
    width: 100%;
}

.docs-public {
    --docs-ink: #0c1f2e;
    --docs-muted: #5a6f7c;
    --docs-teal: #0f766e;
    --docs-teal-deep: #115e59;
    --docs-sky: #e8f4f2;
    --docs-line: #d5e3e0;
    --docs-code-bg: #0c1f2e;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--docs-ink);
    min-height: 100vh;
}

.docs-public h1,
.docs-public h2,
.docs-brand-name,
.docs-hero-brand,
.docs-hero-title,
.docs-rule-num {
    font-family: Syne, "Segoe UI", sans-serif;
}

.docs-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(244, 247, 248, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--docs-line);
}

.docs-topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.docs-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--docs-ink);
}

.docs-brand-mark {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--docs-teal);
    color: #fff;
    font-size: 1rem;
}

.docs-brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.docs-top-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1rem;
}

.docs-top-links a {
    color: var(--docs-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.docs-top-links a:hover {
    color: var(--docs-teal);
}

.docs-top-cta {
    background: var(--docs-ink) !important;
    color: #fff !important;
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
}

.docs-top-cta:hover {
    background: var(--docs-teal) !important;
    color: #fff !important;
}

.docs-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--docs-line);
}

.docs-hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, rgba(15, 118, 110, 0.14) 0%, transparent 42%),
        linear-gradient(200deg, #0c1f2e 0%, #134e4a 48%, #0f766e 100%);
    animation: docsHeroShift 14s ease-in-out infinite alternate;
}

.docs-hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.12) 0 2px, transparent 3px),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.1) 0 1.5px, transparent 3px),
        linear-gradient(90deg, transparent 0, transparent 48%, rgba(255,255,255,0.06) 50%, transparent 52%);
    background-size: 48px 48px, 36px 36px, 120px 100%;
    opacity: 0.55;
    animation: docsGridDrift 22s linear infinite;
}

@keyframes docsHeroShift {
    from { filter: saturate(1); transform: scale(1); }
    to { filter: saturate(1.08); transform: scale(1.03); }
}

@keyframes docsGridDrift {
    from { background-position: 0 0, 0 0, 0 0; }
    to { background-position: 48px 24px, -36px 18px, 60px 0; }
}

.docs-hero-inner {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 3.5rem 1.25rem 3.75rem;
    color: #fff;
}

.docs-hero-brand {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
    opacity: 0.9;
    animation: docsFadeUp 0.7s ease both;
}

.docs-hero-title {
    font-size: clamp(2rem, 4.5vw, 3.15rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.08;
    max-width: 14ch;
    margin-bottom: 1rem;
    animation: docsFadeUp 0.75s ease 0.08s both;
}

.docs-hero-lead {
    max-width: 36rem;
    font-size: 1.1rem;
    line-height: 1.55;
    opacity: 0.88;
    margin-bottom: 1.75rem;
    animation: docsFadeUp 0.75s ease 0.16s both;
}

.docs-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    animation: docsFadeUp 0.75s ease 0.24s both;
}

@keyframes docsFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.docs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.25rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.docs-btn:hover {
    transform: translateY(-1px);
}

.docs-btn-primary {
    background: #fff;
    color: var(--docs-ink);
}

.docs-btn-primary:hover {
    background: #e8f4f2;
    color: var(--docs-ink);
}

.docs-btn-ghost {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
}

.docs-btn-ghost:hover {
    border-color: #fff;
    color: #fff;
}

.docs-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.docs-toc {
    position: sticky;
    top: 5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.docs-toc-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--docs-muted);
    margin-bottom: 0.5rem;
}

.docs-toc-link {
    color: var(--docs-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    border-left: 2px solid transparent;
}

.docs-toc-link:hover,
.docs-toc-link.is-active {
    color: var(--docs-teal-deep);
    background: var(--docs-sky);
    border-left-color: var(--docs-teal);
}

.docs-content {
    min-width: 0;
}

.docs-section {
    margin-bottom: 2.75rem;
    scroll-margin-top: 5.5rem;
}

.docs-section h2 {
    font-size: 1.55rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    margin-bottom: 0.65rem;
}

.docs-section > p {
    color: var(--docs-muted);
    margin-bottom: 1rem;
    line-height: 1.55;
}

.docs-muted {
    color: var(--docs-muted);
    font-size: 0.95rem;
}

.docs-path {
    font-size: 0.88rem;
    word-break: break-all;
    color: var(--docs-ink);
}

.docs-method {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.docs-method-post {
    background: #ccfbf1;
    color: #0f766e;
}

.docs-method-get {
    background: #e0f2fe;
    color: #0369a1;
}

.docs-code {
    background: var(--docs-code-bg);
    border-radius: 12px;
    overflow: hidden;
    margin: 1rem 0;
    box-shadow: 0 12px 32px rgba(12, 31, 46, 0.12);
}

.docs-code-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.docs-copy {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    cursor: pointer;
}

.docs-copy:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.docs-code pre {
    margin: 0;
    padding: 1rem 1.1rem;
    overflow-x: auto;
}

.docs-code code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.84rem;
    line-height: 1.55;
    color: #e2e8f0;
    white-space: pre;
}

.docs-notes {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.docs-notes li {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--docs-line);
    color: var(--docs-muted);
    font-size: 0.95rem;
}

.docs-notes li:last-child {
    border-bottom: none;
}

.docs-notes code {
    background: var(--docs-sky);
    color: var(--docs-teal-deep);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.docs-rules {
    display: grid;
    gap: 0.85rem;
}

.docs-rule {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.1rem 1.15rem;
    background: #fff;
    border: 1px solid var(--docs-line);
    border-radius: 12px;
}

.docs-rule-num {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--docs-teal);
    line-height: 1;
}

.docs-rule strong {
    display: block;
    margin-bottom: 0.25rem;
}

.docs-rule p {
    margin: 0;
    color: var(--docs-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.docs-footer {
    border-top: 1px solid var(--docs-line);
    padding: 1.5rem 1.25rem 2.5rem;
    text-align: center;
    color: var(--docs-muted);
    font-size: 0.9rem;
}

.docs-footer a {
    color: var(--docs-teal-deep);
    font-weight: 600;
    text-decoration: none;
}

.docs-footer-sep {
    margin: 0 0.4rem;
    opacity: 0.5;
}

@media (max-width: 900px) {
    .docs-body {
        grid-template-columns: 1fr;
    }

    .docs-toc {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--docs-line);
    }

    .docs-toc-label {
        width: 100%;
    }

    .docs-toc-link {
        border-left: none;
        background: #fff;
        border: 1px solid var(--docs-line);
    }

    .docs-toc-link.is-active {
        border-color: var(--docs-teal);
    }

    .docs-hero-inner {
        padding-top: 2.5rem;
        padding-bottom: 2.75rem;
    }

    .docs-top-links a:not(.docs-top-cta) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .docs-hero-bg,
    .docs-hero-bg::after,
    .docs-hero-brand,
    .docs-hero-title,
    .docs-hero-lead,
    .docs-hero-actions {
        animation: none !important;
    }
}
