/* ============================================================================
   ADIOX COPIER — brand layer
   ----------------------------------------------------------------------------
   Violet / pink / amber on a deep navy-violet ground.
       Primary  #8b5cf6   Deep  #6d28d9   Light  #a78bfa / #c4b5fd
       Accent   #ec4899   Warm  #ff914d
       Ground   #080912   Card  #0f1320 -> #13162a
   Type: Manrope (headings) · Inter (body) · IBM Plex Mono (code, IDs).

   Linked by _Layout (just before light-theme.css), _AuthLayout and
   _AdminLayout, after their own stylesheets. Dark-only rules are scoped to
   :root:not([data-theme="light"]) so light-theme.css stays in charge of light;
   the few light rules here are the brand moments light-theme.css has no
   opinion on (gradient pill, wordmark, scrollbar).
   Green (--fn-pos) stays reserved for money/status meaning — never chrome.
   ============================================================================ */

:root {
    --tcs-violet:       #8b5cf6;
    --tcs-violet-deep:  #6d28d9;
    --tcs-violet-light: #a78bfa;
    --tcs-violet-pale:  #c4b5fd;
    --tcs-pink:         #ec4899;
    --tcs-amber:        #ff914d;

    /* Brand sweep — logo, wordmark, accent lines, progress */
    --tcs-grad:      linear-gradient(90deg, #7b4dff 0%, #c471ed 55%, #ff914d 100%);
    /* Fills that carry white text stop at pink: amber is too light for it */
    --tcs-grad-btn:  linear-gradient(118deg, #7b4dff 0%, #8b5cf6 38%, #a855f7 68%, #ec4899 100%);
    --tcs-grad-pill: linear-gradient(118deg, #4f46e5 0%, #7c3aed 34%, #a855f7 62%, #ec4899 100%);
    --tcs-grad-soft: linear-gradient(135deg, #8b5cf6, #ec4899);

    --font-heading: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono:    'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --bs-font-monospace: var(--font-mono);
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.modal-title, .card-title, .offcanvas-title,
.dashboard-heading, .auth-title, .brand-wordmark, .brand-word {
    font-family: var(--font-heading) !important;
    letter-spacing: -0.01em;
}
.brand-wordmark, .brand-word { letter-spacing: 0.04em; }
code, kbd, pre, samp, .font-monospace { font-family: var(--font-mono) !important; }

/* ── Brand wordmark ("ADIOX COPIER") ─────────────────────────────────────────
   ADIOX is the Adiox logo artwork (adiox-wordmark.svg: adiox-logo.svg with
   its empty margin cropped), COPIER is text beside it. The image sits on the
   text baseline, so .74em matches the cap height of the uppercase label. */
.brand-adiox {
    height: .74em;
    width: auto;
    display: inline-block;
    flex-shrink: 0;
}
/* Both wordmark rows (topbar/auth .brand-wordmark, admin .brand-word) align on
   the text baseline: a flex item image's baseline is its bottom edge, so ADIOX
   sits on the same line as COPIER. Admin's own rule left align-items at
   stretch, which pinned the image to the top of the row. */
.brand-wordmark,
.admin-topbar .brand-word {
    display: inline-flex;
    align-items: baseline;
}
.brand-copier {
    background: var(--tcs-grad) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* Phones: tighten the wordmark. site.css drops it below 340px and
   ellipsizes it above that. */
@media (max-width: 575.98px) {
    .topbar-brand .brand-wordmark { font-size: .8rem; gap: .28em; }
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar-thumb { background: rgba(139,92,246,.40); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,.65); }
::selection { background: rgba(139,92,246,.32); }

/* ═══ DARK ══════════════════════════════════════════════════════════════════ */

:root:not([data-theme="light"]) body {
    background-color: #080912 !important;
}

/* Topbar — glass with a brand sweep along the bottom edge */
:root:not([data-theme="light"]) .topbar {
    background: rgba(8,9,18,.96) !important;
    border-bottom: 1px solid rgba(139,92,246,.14) !important;
    box-shadow: 0 1px 28px rgba(0,0,0,.70), 0 0 50px rgba(139,92,246,.05) !important;
}
.topbar::after,
.admin-topbar::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--tcs-grad) !important;
    opacity: .55;
    pointer-events: none;
}
:root[data-theme="light"] .topbar::after { opacity: .35; }
:root:not([data-theme="light"]) .topbar-wallet-glass {
    background: rgba(139,92,246,.08) !important;
    border-color: rgba(139,92,246,.25) !important;
    color: #e9d5ff !important;
    text-shadow: none !important;
}

/* Sidebar */
:root:not([data-theme="light"]) .sidebar {
    background: rgba(8,9,18,.98) !important;
    border-right: 1px solid rgba(139,92,246,.12) !important;
}
:root:not([data-theme="light"]) .sidebar .sidebar-link:hover:not(.active) {
    color: #c4b5fd !important;
    background-color: rgba(139,92,246,.08) !important;
}
:root:not([data-theme="light"]) .sidebar .sidebar-sublink.active {
    color: #c4b5fd !important;
    text-shadow: none !important;
}
:root:not([data-theme="light"]) .sidebar .sidebar-sublink:hover {
    color: #c4b5fd !important;
    background-color: rgba(139,92,246,.08) !important;
}
:root:not([data-theme="light"]) .sidebar-footer {
    border-top-color: rgba(139,92,246,.12) !important;
}

/* Active section — gradient pill with a slow sheen (both themes: it is the
   brand's signature, and white on it clears AA either way). */
.sidebar .sidebar-link.active,
:root[data-theme="light"] .sidebar .sidebar-link.active,
.admin-sidebar .nav-link.active {
    position: relative;
    overflow: hidden;
    color: #fff !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    border-radius: 12px !important;
    background: var(--tcs-grad-pill) !important;
    box-shadow:
        0 10px 30px -8px rgba(124,58,237,.55),
        0 6px 18px -10px rgba(236,72,153,.45),
        inset 0 1px 0 rgba(255,255,255,.40) !important;
}
:root[data-theme="light"] .sidebar .sidebar-link.active:hover {
    color: #fff !important;
    background: var(--tcs-grad-pill) !important;
    filter: brightness(1.05);
}
.sidebar .sidebar-link.active .sidebar-icon,
.sidebar .sidebar-link.active .sidebar-caret,
:root[data-theme="light"] .sidebar .sidebar-link.active .sidebar-icon,
:root[data-theme="light"] .sidebar .sidebar-link.active .sidebar-caret,
.admin-sidebar .nav-link.active .nav-icon {
    color: #fff !important;
    opacity: 1 !important;
    position: relative;
    z-index: 1;
}
.sidebar .sidebar-link.active > *,
.admin-sidebar .nav-link.active > * { position: relative; z-index: 1; }
.admin-sidebar .nav-link.active::before { display: none; }
.sidebar .sidebar-link.active::after,
.admin-sidebar .nav-link.active::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.28) 48%, transparent 64%);
    background-size: 250% 100%;
    animation: tcsSheen 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes tcsSheen {
    0%, 14%   { background-position: 135% 0; }
    62%, 100% { background-position: -45% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar .sidebar-link.active::after,
    .admin-sidebar .nav-link.active::after { animation: none; }
}

/* Light sub-page marker: pink leaf under the violet section (was blue). */
:root[data-theme="light"] .sidebar .sidebar-sublink.active {
    color: #be185d !important;
    background-color: #fdf2f8 !important;
}
:root[data-theme="light"] .sidebar .sidebar-sublink.active .bi { color: #db2777 !important; }
:root[data-theme="light"] .sidebar .sidebar-sublink.active:hover {
    color: #9d174d !important;
    background-color: #fce7f3 !important;
}

/* Primary buttons — brand gradient, white label */
:root:not([data-theme="light"]) .btn-primary,
:root:not([data-theme="light"]) .btn-fn-primary,
:root:not([data-theme="light"]) .btn-glow-primary {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    background-image: var(--tcs-grad-btn) !important;
    background-color: #8b5cf6 !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 4px 18px rgba(139,92,246,.35) !important;
}
:root:not([data-theme="light"]) .btn-primary:hover,
:root:not([data-theme="light"]) .btn-fn-primary:hover,
:root:not([data-theme="light"]) .btn-glow-primary:hover {
    color: #fff !important;
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 8px 28px rgba(139,92,246,.45), 0 0 18px rgba(236,72,153,.18) !important;
}
/* Light keeps light-theme.css's solid deep-violet buttons (--lt-primary). */

/* Progress + badges */
.progress-bar {
    background-image: var(--tcs-grad-soft);
}
.badge.bg-primary, .badge.text-bg-primary { background: var(--tcs-grad-soft) !important; color: #fff !important; }

/* Cards and panels — navy-violet glass, violet edge on hover */
:root:not([data-theme="light"]) .card {
    border-color: rgba(255,255,255,.07);
}
:root:not([data-theme="light"]) .glass-card:hover,
:root:not([data-theme="light"]) .stat-card:hover {
    border-color: rgba(139,92,246,.32) !important;
    box-shadow: 0 18px 52px rgba(0,0,0,.62), 0 0 26px rgba(139,92,246,.12),
                inset 0 1px 0 rgba(255,255,255,.08) !important;
}

/* KPI tiles — the four-hue rhythm: violet, pink, amber, sky */
:root:not([data-theme="light"]) .kpi:nth-child(4n+1),
:root:not([data-theme="light"]) .row > :nth-child(4n+1) > .stat-card { border-top: 2px solid rgba(139,92,246,.55) !important; }
:root:not([data-theme="light"]) .kpi:nth-child(4n+2),
:root:not([data-theme="light"]) .row > :nth-child(4n+2) > .stat-card { border-top: 2px solid rgba(236,72,153,.50) !important; }
:root:not([data-theme="light"]) .kpi:nth-child(4n+3),
:root:not([data-theme="light"]) .row > :nth-child(4n+3) > .stat-card { border-top: 2px solid rgba(255,145,77,.50) !important; }
:root:not([data-theme="light"]) .kpi:nth-child(4n+4),
:root:not([data-theme="light"]) .row > :nth-child(4n+4) > .stat-card { border-top: 2px solid rgba(56,189,248,.50) !important; }

/* Page headings — brand sweep */
:root:not([data-theme="light"]) .dashboard-heading,
:root:not([data-theme="light"]) .tg-page-title,
:root:not([data-theme="light"]) .ea-page-title,
:root:not([data-theme="light"]) .plans-title,
:root:not([data-theme="light"]) .masters-header-title,
.text-gradient {
    background: var(--tcs-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tables, tabs, accordions, modals, dropdowns */
:root:not([data-theme="light"]) .table > thead {
    background: linear-gradient(135deg, rgba(139,92,246,.14), rgba(109,40,217,.10));
}
:root:not([data-theme="light"]) .nav-tabs .nav-link.active,
:root:not([data-theme="light"]) .glass-tabs .nav-link.active {
    color: #c4b5fd !important;
    border-bottom-color: #8b5cf6 !important;
}
:root:not([data-theme="light"]) .nav-pills .nav-link.active {
    background: var(--tcs-grad-btn) !important;
    color: #fff !important;
}
:root:not([data-theme="light"]) .accordion-button:not(.collapsed) {
    background: rgba(139,92,246,.10);
    color: #c4b5fd;
}
:root:not([data-theme="light"]) .modal-content {
    border-color: rgba(139,92,246,.22) !important;
    box-shadow: 0 30px 90px -18px rgba(0,0,0,.8), 0 0 46px rgba(139,92,246,.12) !important;
}
:root:not([data-theme="light"]) .dropdown-menu {
    border-color: rgba(139,92,246,.18);
}
:root:not([data-theme="light"]) .dropdown-item:hover,
:root:not([data-theme="light"]) .dropdown-item:focus {
    background: rgba(139,92,246,.12);
    color: #e9d5ff;
}
:root:not([data-theme="light"]) .page-item.active .page-link {
    background: var(--tcs-grad-btn) !important;
    border-color: transparent !important;
    color: #fff !important;
}

/* Spinners */
.spinner-border.text-primary { color: var(--tcs-violet) !important; }
