/* ============================================================================
   GlobalInvest — Design System
   Premium fintech UI. Light-first, navy/blue primary, white cards, soft
   shadows, generous spacing. Tailwind (CDN) provides utilities; this file
   owns the design tokens and the reusable component layer.
   ========================================================================== */

:root {
    /* ---- Brand ---- */
    --brand-50:  #eef4ff;
    --brand-100: #d9e6ff;
    --brand-200: #b6ccff;
    --brand-300: #85a9ff;
    --brand-400: #5b83fb;
    --brand-500: #3b62f0;   /* primary */
    --brand-600: #2f4fd6;
    --brand-700: #2740ad;
    --brand-800: #1f3184;
    --brand-900: #172556;
    --navy:      #0b1437;   /* sidebars, deep surfaces */
    --navy-700:  #16204a;
    --navy-600:  #1e2c60;

    /* ---- Semantic ---- */
    --success-50: #ecfdf3; --success-500: #12b76a; --success-600: #039855; --success-700: #027a48;
    --danger-50:  #fef3f2; --danger-500:  #f04438; --danger-600:  #d92d20; --danger-700:  #b42318;
    --warning-50: #fffaeb; --warning-500: #f79009; --warning-600: #dc6803; --warning-700: #b54708;
    --purple-50:  #f4f3ff; --purple-500:  #7a5af8; --purple-600:  #6938ef; --purple-700:  #5925dc;

    /* ---- Neutrals ---- */
    --bg:        #f6f8fb;
    --surface:   #ffffff;
    --surface-2: #f9fafb;
    --border:    #e7ebf1;
    --border-strong: #d4dae4;
    --text:      #101828;
    --text-soft: #475467;
    --text-mute: #98a2b3;

    /* ---- Radius ---- */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;
    --r-full: 999px;

    /* ---- Shadow ---- */
    --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
    --shadow-sm: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
    --shadow-md: 0 4px 12px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.04);
    --shadow-lg: 0 12px 32px rgba(16,24,40,.12), 0 4px 10px rgba(16,24,40,.05);
    --shadow-brand: 0 8px 24px rgba(59,98,240,.28);

    /* ---- Layout ---- */
    --sidebar-w: 268px;
    --header-h: 72px;
    --content-max: 1440px;

    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* ---- Marketing hero band ---- */
    --hero-1: #0b1437;   /* navy — matches the app sidebar */
    --hero-2: #1e2c60;
    --hero-3: #2f4fd6;   /* brand blue */
}

@media (prefers-color-scheme: dark) {
    /* The product is deliberately light-first (per brief). Keep a soft dark
       ground only so the artifact host doesn't paint an alien background. */
    :root:not([data-theme="light"]) { color-scheme: light; }
}

* { box-sizing: border-box; min-width: 0; }

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 { font-weight: 650; letter-spacing: -0.012em; color: var(--text); margin: 0; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--brand-200); }

/* Scrollbars ---------------------------------------------------------------- */
.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }

/* ============================================================ TYPOGRAPHY === */
.display-1 { font-size: clamp(2.25rem, 4vw + 1rem, 3.75rem); line-height: 1.05; font-weight: 720; letter-spacing: -0.03em; }
.display-2 { font-size: clamp(1.75rem, 2.5vw + 1rem, 2.75rem); line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; }
.eyebrow   { font-size: .75rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); }
.lead      { font-size: 1.075rem; color: var(--text-soft); line-height: 1.6; }
.text-soft { color: var(--text-soft); }
.text-mute { color: var(--text-mute); }
.num       { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ================================================================ BUTTON === */
.btn {
    --btn-bg: var(--brand-500);
    --btn-fg: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: inherit; font-weight: 600; font-size: .9rem; line-height: 1;
    padding: .68rem 1.1rem; border-radius: var(--r-md); border: 1px solid transparent;
    background: var(--btn-bg); color: var(--btn-fg); cursor: pointer;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--brand-200); outline-offset: 1px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn .lucide { width: 1.05em; height: 1.05em; }

.btn--primary   { --btn-bg: var(--brand-500); box-shadow: var(--shadow-brand); }
.btn--primary:hover { --btn-bg: var(--brand-600); }
.btn--dark      { --btn-bg: var(--navy); box-shadow: var(--shadow-sm); }
.btn--dark:hover { --btn-bg: #060c24; }
.btn--success   { --btn-bg: var(--success-600); }
.btn--danger    { --btn-bg: var(--danger-600); }
.btn--ghost     { --btn-bg: transparent; --btn-fg: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn--ghost:hover { --btn-bg: var(--surface-2); border-color: var(--border-strong); }
.btn--subtle    { --btn-bg: var(--brand-50); --btn-fg: var(--brand-700); }
.btn--subtle:hover { --btn-bg: var(--brand-100); }
.btn--link      { --btn-bg: transparent; --btn-fg: var(--brand-600); padding: .4rem .2rem; box-shadow: none; }
.btn--link:hover { text-decoration: underline; transform: none; }

.btn--sm { padding: .48rem .8rem; font-size: .82rem; border-radius: var(--r-sm); }
.btn--lg { padding: .9rem 1.5rem; font-size: 1rem; }
.btn--block { display: flex; width: 100%; }
.btn--icon { padding: .6rem; }

.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 1.05em; height: 1.05em; border-radius: 50%;
    border: 2px solid currentColor; border-top-color: transparent;
    color: var(--btn-fg); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================== CARD === */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card--pad { padding: 1.35rem; }
.card--hover { transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.card--hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.15rem 1.35rem; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 1rem; display: flex; align-items: center; gap: .55rem; }
.card-body { padding: 1.35rem; }
.card-body--flush { padding: 0; }

/* ============================================================== STAT CARD === */
.stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 1.3rem; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: .85rem; min-width: 0;
    transition: box-shadow .2s ease, transform .2s ease;
}
.stat--hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat__icon {
    width: 42px; height: 42px; border-radius: var(--r-md);
    display: grid; place-items: center; flex: none;
}
.stat__icon .lucide { width: 20px; height: 20px; }
.stat__label { font-size: .82rem; color: var(--text-soft); font-weight: 500; }
.stat__value { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.stat__meta  { font-size: .8rem; color: var(--text-mute); display: flex; align-items: center; gap: .35rem; }
.stat__foot  { margin-top: auto; padding-top: .35rem; }

.i-blue   { background: var(--brand-50);   color: var(--brand-600); }
.i-green  { background: var(--success-50); color: var(--success-600); }
.i-purple { background: var(--purple-50);  color: var(--purple-600); }
.i-orange { background: var(--warning-50); color: var(--warning-600); }
.i-navy   { background: #eef1f8;           color: var(--navy); }

/* ================================================================= BADGE === */
.badge {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .74rem; font-weight: 600; line-height: 1;
    padding: .34rem .6rem; border-radius: var(--r-full);
    background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border);
}
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { background: var(--success-50); color: var(--success-700); border-color: transparent; }
.badge--danger  { background: var(--danger-50);  color: var(--danger-700);  border-color: transparent; }
.badge--warning { background: var(--warning-50); color: var(--warning-700); border-color: transparent; }
.badge--info    { background: var(--brand-50);   color: var(--brand-700);   border-color: transparent; }
.badge--purple  { background: var(--purple-50);  color: var(--purple-700);  border-color: transparent; }
.badge--neutral { background: #f2f4f7; color: var(--text-soft); border-color: transparent; }

/* ================================================================ AMOUNT === */
.amt-pos { color: var(--success-600); font-variant-numeric: tabular-nums; }
.amt-neg { color: var(--danger-600);  font-variant-numeric: tabular-nums; }
.trend { display: inline-flex; align-items: center; gap: .2rem; font-weight: 600; font-size: .8rem; }
.trend--up   { color: var(--success-600); }
.trend--down { color: var(--danger-600); }
.trend .lucide { width: 14px; height: 14px; }

/* ================================================================= INPUT === */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field__label { font-size: .82rem; font-weight: 600; color: var(--text); }
.field__hint  { font-size: .78rem; color: var(--text-mute); }
.field__error { font-size: .78rem; color: var(--danger-600); font-weight: 500; }

.input, .select, .textarea {
    font-family: inherit; font-size: .92rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r-md); padding: .7rem .85rem; width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
    appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-mute); }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--brand-400);
    box-shadow: 0 0 0 4px var(--brand-100);
}
.field--error .input, .field--error .select, .field--error .textarea {
    border-color: var(--danger-500); box-shadow: 0 0 0 4px var(--danger-50);
}
.textarea { min-height: 120px; resize: vertical; }
.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.4rem;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 2.5rem; }
.input-group__icon { position: absolute; left: .85rem; color: var(--text-mute); display: grid; place-items: center; }
.input-group__icon .lucide { width: 17px; height: 17px; }
.input-affix { position: absolute; right: .9rem; font-size: .85rem; color: var(--text-mute); font-weight: 600; }

/* password show/hide toggle — injected by addPasswordToggles() in assets/js/app.js */
.pw-field { position: relative; display: block; }
.input.has-pw-toggle { padding-right: 2.75rem; }
.pw-toggle {
    position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0;
    border: 0; background: transparent; color: var(--text-mute); cursor: pointer;
    border-radius: var(--r-sm); transition: color .15s ease;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 1px; }
.pw-toggle .lucide { width: 17px; height: 17px; }

.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; color: var(--text-soft); cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand-500); margin-top: 1px; flex: none; }

/* =============================================================== SEGMENTED = */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); padding: 3px; gap: 2px; }
.segmented button {
    border: 0; background: transparent; font: inherit; font-size: .8rem; font-weight: 600;
    color: var(--text-soft); padding: .38rem .78rem; border-radius: var(--r-full); cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.segmented button.is-active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-xs); }

/* ================================================================= TABLE === */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
.table thead th {
    text-align: left; font-size: .74rem; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: var(--text-mute);
    padding: .8rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2);
    white-space: nowrap;
}
.table tbody td { padding: .95rem 1.1rem; border-bottom: 1px solid var(--border); color: var(--text-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table td .primary { color: var(--text); font-weight: 600; }
.table th.num, .table td.num { text-align: right; }

.table-card { display: none; }  /* mobile card view toggled below */

/* ============================================================ PROGRESS ==== */
.progress { height: 8px; background: #eef1f6; border-radius: var(--r-full); overflow: hidden; }
.progress__bar { height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); transition: width .5s ease; }
.progress--green .progress__bar { background: linear-gradient(90deg, var(--success-500), var(--success-600)); }
.progress--purple .progress__bar { background: linear-gradient(90deg, var(--purple-500), var(--purple-600)); }
.progress--orange .progress__bar { background: linear-gradient(90deg, var(--warning-500), var(--warning-600)); }

.ring { --p: 0; --size: 116px; --stroke: 10px; width: var(--size); height: var(--size); border-radius: 50%;
    display: grid; place-items: center; position: relative;
    background: conic-gradient(var(--brand-500) calc(var(--p) * 1%), #eef1f6 0);
}
.ring::before { content: ""; position: absolute; inset: var(--stroke); border-radius: 50%; background: var(--surface); }
.ring__label { position: relative; text-align: center; }
.ring__label b { font-size: 1.4rem; font-weight: 700; display: block; }
.ring__label span { font-size: .72rem; color: var(--text-mute); }

/* ============================================================== EMPTY ===== */
.empty { text-align: center; padding: 3.5rem 1.5rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.empty__icon { width: 56px; height: 56px; border-radius: var(--r-lg); background: var(--brand-50); color: var(--brand-500); display: grid; place-items: center; margin-bottom: .35rem; }
.empty__icon .lucide { width: 26px; height: 26px; }
.empty h4 { font-size: 1rem; }
.empty p { color: var(--text-soft); font-size: .88rem; max-width: 34ch; }

/* skeleton */
.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* =============================================================== TABS ===== */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a, .tabs button {
    padding: .8rem .95rem; font-size: .86rem; font-weight: 600; color: var(--text-soft);
    border: 0; background: transparent; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.tabs a.is-active, .tabs button.is-active { color: var(--brand-700); border-bottom-color: var(--brand-500); }

/* =============================================================== ALERT ==== */
.alert { display: flex; gap: .7rem; padding: .9rem 1rem; border-radius: var(--r-md); font-size: .87rem; border: 1px solid transparent; }
.alert .lucide { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert--info    { background: var(--brand-50);   color: var(--brand-800);   border-color: var(--brand-100); }
.alert--success { background: var(--success-50); color: var(--success-700); }
.alert--warning { background: var(--warning-50); color: var(--warning-700); }
.alert--danger  { background: var(--danger-50);  color: var(--danger-700); }

/* =============================================================== TOAST ==== */
#toast-root { position: fixed; z-index: 90; top: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .6rem; width: min(360px, calc(100vw - 2rem)); }
.toast { display: flex; gap: .7rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand-500);
    border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: .85rem 1rem; font-size: .87rem; animation: toast-in .25s ease; }
.toast--success { border-left-color: var(--success-500); }
.toast--danger  { border-left-color: var(--danger-500); }
.toast--warning { border-left-color: var(--warning-500); }
.toast__close { margin-left: auto; color: var(--text-mute); background: none; border: 0; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } }

/* =============================================================== MODAL ==== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,20,55,.5); backdrop-filter: blur(3px); z-index: 80; display: grid; place-items: center; padding: 1rem; animation: fade .18s ease; }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: 90vh; overflow: auto; animation: modal-in .22s ease; }
.modal__head { padding: 1.25rem 1.4rem 0; display: flex; justify-content: space-between; align-items: flex-start; }
.modal__body { padding: 1rem 1.4rem 1.4rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ============================================================== AVATAR ==== */
.avatar { border-radius: var(--r-full); background: var(--brand-100); color: var(--brand-700); font-weight: 650;
    display: grid; place-items: center; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar--md { width: 40px; height: 40px; font-size: .82rem; }
.avatar--lg { width: 64px; height: 64px; font-size: 1.1rem; }

/* coin token */
.coin { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .68rem; flex: none; }

/* ==========================================================================
   APP SHELL  (user dashboard + admin)
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }

/* impersonation ("view as member") bar — shown only in the admin's browser */
.imp-bar {
    position: sticky; top: 0; z-index: 60;
    height: 40px;
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    padding: 0 1rem; font-size: .82rem; font-weight: 600; white-space: nowrap;
    background: var(--warning-500); color: #3d2c00;
    box-shadow: 0 1px 0 rgba(0,0,0,.12); overflow: hidden;
}
.imp-bar span { overflow: hidden; text-overflow: ellipsis; }
.imp-bar .lucide { vertical-align: -2px; }
.imp-bar .btn { --btn-bg: #3d2c00; --btn-fg: #fff; padding: .3rem .7rem; box-shadow: none; flex: none; }
.imp-bar .btn:hover { --btn-bg: #000; }
.imp-bar form { margin: 0; }
/* the sidebar + topbar are position:fixed/sticky — drop them below the 40px bar */
.shell--imp .sidebar { top: 40px; }
.shell--imp .topbar { top: 40px; }

.sidebar {
    width: var(--sidebar-w); flex: none; background: var(--navy); color: #c7d0e6;
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 50;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar__brand { display: flex; align-items: center; gap: .7rem; padding: 1.3rem 1.35rem; }
.sidebar__brand .mark { width: 38px; height: 38px; border-radius: var(--r-md); background: linear-gradient(135deg, var(--brand-400), var(--brand-600)); display: grid; place-items: center; color: #fff; flex: none; box-shadow: var(--shadow-brand); }
.sidebar__brand .brand__text b { color: #fff; font-size: 1.05rem; }
.sidebar__brand .brand__sub { color: #8b97b8; font-size: .68rem; }
.sidebar__brand .brand__img { height: 30px; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: .5rem .8rem 1.5rem; }
.nav-group { margin-top: 1.1rem; }
.nav-group__label { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6b789e; padding: 0 .75rem .4rem; }
.nav-link {
    display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: var(--r-md);
    color: #b3bed9; font-size: .875rem; font-weight: 500; margin-bottom: 2px;
    transition: background .15s ease, color .15s ease;
}
.nav-link .lucide { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-link:hover { background: var(--navy-700); color: #fff; }
.nav-link--active { background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); color: #fff; box-shadow: var(--shadow-brand); }
.nav-link--active .lucide { opacity: 1; }
.nav-link__badge { margin-left: auto; background: rgba(255,255,255,.16); color: #fff; font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: var(--r-full); }

.sidebar__promo { margin: .8rem; padding: 1.1rem; border-radius: var(--r-lg); background: linear-gradient(150deg, var(--navy-600), var(--navy-700)); border: 1px solid rgba(255,255,255,.06); }
.sidebar__promo h5 { color: #fff; font-size: .9rem; }
.sidebar__promo p { color: #97a3c4; font-size: .78rem; margin: .3rem 0 .8rem; }

.sidebar__foot { padding: .8rem; border-top: 1px solid rgba(255,255,255,.07); }

/* admin variant — cooler, denser, "operations center" */
.sidebar--admin { background: #0a0f24; }
.sidebar--admin .nav-link--active { background: linear-gradient(90deg, #1f2c60, #2f4fd6); }
.sidebar--admin .sidebar__brand .mark { background: linear-gradient(135deg, #7a5af8, #3b62f0); }

.shell__main { flex: 1; min-width: 0; max-width: 100%; margin-left: var(--sidebar-w); display: flex; flex-direction: column; overflow-x: hidden; }

.topbar {
    height: var(--header-h); background: rgba(255,255,255,.85); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
}
.topbar__search { flex: 1; max-width: 420px; position: relative; }
.topbar__search input { width: 100%; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-full); padding: .58rem .9rem .58rem 2.4rem; font-size: .86rem; }
.topbar__search input:focus { outline: none; border-color: var(--brand-300); box-shadow: 0 0 0 4px var(--brand-100); background: #fff; }
.topbar__search .lucide { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-mute); }

.icon-btn { width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--text-soft); cursor: pointer; position: relative; transition: background .15s ease; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .lucide { width: 18px; height: 18px; }
.icon-btn__dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; background: var(--danger-500); border-radius: 50%; border: 2px solid var(--surface); }

.content { padding: 1.8rem 1.5rem 3rem; max-width: var(--content-max); width: 100%; margin: 0 auto; }

.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.5rem; }
.page-head p { color: var(--text-soft); font-size: .9rem; margin-top: .2rem; }

.breadcrumb { display: flex; gap: .4rem; align-items: center; font-size: .8rem; color: var(--text-mute); margin-bottom: .4rem; }
.breadcrumb .lucide { width: 13px; height: 13px; }

/* dropdown menu */
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); min-width: 200px; padding: .4rem; z-index: 45; }
.menu a, .menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .58rem .65rem; border-radius: var(--r-sm); font-size: .85rem; color: var(--text-soft); background: none; border: 0; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); }
.menu .lucide { width: 16px; height: 16px; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: .35rem 0; }

.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 2rem)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); z-index: 45; overflow: hidden; }
.notif-item { display: flex; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.notif-item:hover { background: var(--surface-2); }
.notif-item.is-unread { background: var(--brand-50); }
.notif-item__icon { width: 34px; height: 34px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; }

/* backdrop for mobile sidebar */
.shell__scrim { position: fixed; inset: 0; background: rgba(11,20,55,.45); z-index: 45; opacity: 0; pointer-events: none; transition: opacity .25s ease; }

.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.grid-main { display: grid; grid-template-columns: 1fr 340px; gap: 1.25rem; align-items: start; }

.hstack { display: flex; align-items: center; gap: .6rem; }
.vstack { display: flex; flex-direction: column; gap: .3rem; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.mobile-nav { display: none; }

/* ==========================================================================
   PUBLIC SITE
   ========================================================================== */
.site-header {
    position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.8); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header__inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 2rem; padding: .9rem 1.5rem; }
.site-nav { display: flex; gap: .35rem; margin-left: auto; }
.site-nav a { padding: .5rem .8rem; border-radius: var(--r-md); font-size: .88rem; font-weight: 500; color: var(--text-soft); }
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a.is-active { color: var(--brand-700); }

/* mobile dropdown menu — overlays the page, never pushes content */
.site-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: var(--shadow-lg); padding: .35rem 1rem 1rem;
    max-height: calc(100dvh - 100%); overflow-y: auto; z-index: 45;
}
.site-menu > a { display: block; padding: .8rem .3rem; font-weight: 500; color: var(--text); border-bottom: 1px solid var(--border); }
.site-menu > a:last-of-type { border-bottom: 0; }
.site-menu__foot { display: flex; flex-direction: column; gap: .6rem; padding-top: .9rem; margin-top: .4rem; border-top: 1px solid var(--border); }
.site-menu__foot .lang-switch { display: inline-flex !important; align-self: flex-start; }
.site-menu__foot #langPickerMenu { max-width: 100%; }
@media (min-width: 901px) { .site-menu { display: none !important; } }

.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-400), var(--brand-600)); display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-brand); }
/* rendered by the `brand` component (assets/img/logo.* overrides the icon+text) */
.brand__img { display: block; height: 26px; width: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text b { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; color: inherit; }
.brand__sub { font-size: .62rem; font-weight: 500; color: var(--text-mute); letter-spacing: .02em; }

.section { max-width: 1200px; margin: 0 auto; padding: 5rem 1.5rem; }
.section--tight { padding: 3.5rem 1.5rem; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
.section-head p { color: var(--text-soft); margin-top: .75rem; font-size: 1rem; }

.hero { position: relative; overflow: hidden; background:
    radial-gradient(1200px 500px at 80% -10%, rgba(59,98,240,.12), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(122,90,248,.10), transparent 55%),
    var(--bg); }
.hero__inner { max-width: 1200px; margin: 0 auto; padding: 5rem 1.5rem 4rem; display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero__badge { display: inline-flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-full); padding: .4rem .8rem; font-size: .78rem; font-weight: 600; color: var(--text-soft); box-shadow: var(--shadow-xs); }
.hero h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); line-height: 1.06; letter-spacing: -0.03em; margin: 1.2rem 0; }
.hero p.lead { max-width: 46ch; }
.hero__actions { display: flex; gap: .8rem; margin-top: 1.8rem; flex-wrap: wrap; }
.hero__trust { display: flex; gap: 1.5rem; margin-top: 2.2rem; flex-wrap: wrap; }
.hero__trust div b { font-size: 1.3rem; display: block; }
.hero__trust div span { font-size: .78rem; color: var(--text-mute); }

.hero__panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 1.4rem; }

.feature { display: flex; flex-direction: column; gap: .6rem; padding: 1.5rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.feature__icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
.feature h4 { font-size: 1rem; }
.feature p { color: var(--text-soft); font-size: .89rem; }

.step { display: flex; gap: 1rem; }
.step__num { width: 40px; height: 40px; border-radius: var(--r-full); background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }

.plan-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card--featured { border-color: var(--brand-300); box-shadow: var(--shadow-lg); }
.plan-card__head { padding: 1.5rem; border-bottom: 1px solid var(--border); }
.plan-card__price { font-size: 1.8rem; font-weight: 720; letter-spacing: -.02em; }
.plan-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: .9rem; flex: 1; }
.plan-feature { display: flex; gap: .6rem; font-size: .87rem; color: var(--text-soft); }
.plan-feature .lucide { width: 17px; height: 17px; color: var(--success-600); flex: none; margin-top: 1px; }

.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { padding: 1.15rem 0; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .lucide { transition: transform .2s ease; flex: none; color: var(--text-mute); }
.faq-item[open] summary .lucide { transform: rotate(45deg); }
.faq-item p { padding: 0 0 1.2rem; color: var(--text-soft); font-size: .92rem; }

.marquee-logos { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center; justify-content: center; opacity: .7; }

/* --- rich hero (coloured band, image on the right) ----------------------- */
.hero--rich { background: linear-gradient(120deg, var(--hero-1) 0%, var(--hero-2) 42%, var(--hero-3) 100%); color: #e7ecff; }
.hero--rich::after { content: ""; position: absolute; inset: 0; background:
    radial-gradient(620px 320px at 88% 12%, rgba(133,169,255,.22), transparent 60%),
    radial-gradient(520px 280px at 4% 96%, rgba(0,0,0,.22), transparent 60%); pointer-events: none; }
.hero--rich .hero__inner { position: relative; z-index: 1; padding: 4.5rem 1.5rem; align-items: center; }
.hero--rich .eyebrow { color: #9db8ff; }
.hero--rich h1 { color: #fff; }
.hero--rich p.lead { color: #c9d6ff; }
.hero--rich .btn--primary { background: #fff; color: var(--brand-700); box-shadow: none; }
.hero--rich .btn--primary:hover { background: var(--brand-50); }
.hero--rich .btn--ghost { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
.hero--rich .btn--ghost:hover { background: rgba(255,255,255,.10); }
.hero--rich .hero__disclaimer { color: rgba(231,236,255,.6); }

.hero-visual { position: relative; }
.hero-visual__media { width: 100%; border-radius: var(--r-xl); display: block; box-shadow: var(--shadow-lg); background: rgba(255,255,255,.06); }
.hero-visual .device { max-width: 320px; margin: 0 auto; display: block; filter: drop-shadow(0 24px 48px rgba(0,0,0,.35)); }

/* floating market pills around the hero visual */
.market-pills { position: absolute; inset: 0; pointer-events: none; }
.market-pills .pill { position: absolute; display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(255,255,255,.94); color: var(--text); font-weight: 700; font-size: .78rem;
    padding: .4rem .7rem; border-radius: var(--r-full); box-shadow: var(--shadow-md); }
.market-pills .pill svg { width: 14px; height: 14px; }
.market-pills .p1 { top: 4%; right: -4%; }
.market-pills .p2 { top: 42%; left: -10%; }
.market-pills .p3 { bottom: 8%; right: 2%; }
.market-pills .p4 { bottom: 34%; left: -4%; }

/* honest "markets we display" chip row */
.market-strip { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; align-items: center; }
.market-strip span:first-child { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(234,250,244,.65); margin-right: .3rem; }
.market-strip .chip { font-size: .74rem; font-weight: 700; color: #eafaf4; border: 1px solid rgba(255,255,255,.28); border-radius: var(--r-full); padding: .25rem .65rem; }

/* --- TradingView widget shells ----------------------------------------- */
.tv-shell { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.tv-tape { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.tv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.tv-widget-min { height: 460px; }
.tv-widget-tall { height: 540px; }

/* --- Google Translate: hide ALL injected chrome; our own <select> drives it --- */
#google_translate_element { position: absolute !important; left: -9999px !important; top: -9999px !important; height: 0 !important; overflow: hidden !important; }
.goog-te-banner-frame, .skiptranslate > iframe { display: none !important; }
body { top: 0 !important; position: static !important; }
#goog-gt-tt, .goog-te-balloon-frame, .goog-tooltip { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

.lang-switch { display: inline-flex; align-items: center; gap: .35rem; }
.lang-switch > .lucide { width: 15px; height: 15px; color: var(--text-mute); flex: none; }
#langPicker {
    font: 500 .82rem/1 var(--font); color: var(--text-soft);
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full);
    padding: .4rem 1.7rem .4rem .8rem; cursor: pointer; max-width: 150px;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2398a2b3' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .6rem center;
}
#langPicker:hover { border-color: var(--border-strong); color: var(--text); }

/* --- marketing: metric strip ------------------------------------------------ */
.metric-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.metric-strip .metric { padding: 1.2rem 1rem; text-align: center; border-right: 1px solid var(--border); }
.metric-strip .metric:last-child { border-right: 0; }
.metric__value { font-size: 1.5rem; font-weight: 720; letter-spacing: -.02em; color: var(--brand-600); }
.metric__label { font-size: .74rem; color: var(--text-mute); margin-top: .2rem; }

/* --- marketing: live activity ticker -------------------------------------- */
.ticker { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.ticker__head { display: flex; align-items: center; gap: .5rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--border); font-size: .82rem; font-weight: 650; }
.ticker__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success-500); box-shadow: 0 0 0 3px var(--success-50); flex: none; }
.ticker__row { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--border); font-size: .85rem; }
.ticker__row:last-child { border-bottom: 0; }
.ticker__ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); flex: none; }
.ticker__ico .lucide { width: 15px; height: 15px; }
.ticker__row .amt { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.ticker__row .ago { color: var(--text-mute); font-size: .76rem; flex: none; }

/* --- marketing: returns calculator -------------------------------------- */
.calc { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.calc__controls { padding: 1.6rem; display: flex; flex-direction: column; gap: 1.1rem; }
.calc__result { padding: 1.6rem; background: var(--navy); color: #fff; display: flex; flex-direction: column; justify-content: center; gap: .5rem; }
.calc__result .stat__label { color: #93a0c4; }
.calc__big { font-size: 2.2rem; font-weight: 730; letter-spacing: -.02em; }
.calc__line { display: flex; justify-content: space-between; font-size: .86rem; color: #c7d0e6; padding: .3rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.calc__line b { color: #fff; }
.seg-plans { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg-plans button { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-full); padding: .4rem .9rem; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--text-soft); }
.seg-plans button.is-active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.calc input[type=range] { width: 100%; accent-color: var(--brand-500); }

/* --- marketing: comparison table ------------------------------------------- */
.compare th, .compare td { text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); font-weight: 600; }
.compare thead th { background: var(--surface-2); }
.compare .feat-yes { color: var(--success-600); }
.compare .plan-col--featured { background: var(--brand-50); }

/* --- marketing: timeline ------------------------------------------------- */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline__item { position: relative; padding-bottom: 1.8rem; }
.timeline__item::before { content: ""; position: absolute; left: -1.75rem; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand-500); }
.timeline__year { font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--brand-600); text-transform: uppercase; }
.timeline__item h4 { font-size: 1rem; margin: .15rem 0 .3rem; }
.timeline__item p { color: var(--text-soft); font-size: .89rem; }

.split-card { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; }
.split-card > div { padding: 1.6rem; }
.split-card > div + div { border-left: 1px solid var(--border); }

.cta-band { background: radial-gradient(800px 300px at 50% 0%, rgba(255,255,255,.12), transparent), var(--navy); color: #fff; border-radius: var(--r-xl); padding: 3.5rem 2rem; text-align: center; }
.cta-band h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta-band p { color: #aeb9d6; margin: .8rem auto 1.8rem; max-width: 48ch; }

.site-footer { background: var(--navy); color: #97a3c4; margin-top: 4rem; }
.site-footer__inner { max-width: 1200px; margin: 0 auto; padding: 3.5rem 1.5rem 2rem; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.site-footer h6 { color: #fff; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer a { display: block; padding: .3rem 0; font-size: .87rem; }
.site-footer a:hover { color: #fff; }
.site-footer__bar { border-top: 1px solid rgba(255,255,255,.08); padding: 1.3rem 1.5rem; max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .8rem; }

/* ==========================================================================
   AUTH
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth__aside { background: radial-gradient(700px 400px at 20% 10%, rgba(122,90,248,.25), transparent), var(--navy); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth__aside h2 { color: #fff; font-size: 1.8rem; max-width: 20ch; }
.auth__aside p { color: #aeb9d6; }
.auth__quote { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: var(--r-lg); padding: 1.3rem; }
.auth__main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.auth__card { width: min(420px, 100%); }
.auth__card h1 { font-size: 1.5rem; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1200px) {
    .site-footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
    .grid-main { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .hero__inner { grid-template-columns: 1fr; padding-top: 3rem; }
    .hero__panel { order: -1; }
    .grid-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
    :root { --sidebar-w: 260px; }
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .shell.is-open .sidebar { transform: translateX(0); }
    .shell.is-open .shell__scrim { opacity: 1; pointer-events: auto; }
    .shell__main { margin-left: 0; }
    .mobile-nav { display: flex; }
    .auth { grid-template-columns: 1fr; }
    .auth__aside { display: none; }
}
@media (max-width: 960px) {
    .metric-strip { grid-template-columns: repeat(3, 1fr); }
    .metric-strip .metric:nth-child(3) { border-right: 0; }
    .metric-strip .metric:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
    .calc, .split-card, .tv-grid { grid-template-columns: 1fr; }
    .split-card > div + div { border-left: 0; border-top: 1px solid var(--border); }
    .market-pills { display: none; }
}
@media (max-width: 900px) {
    .site-nav { display: none; }
    /* the header's own language pill hides; the mobile menu carries one instead */
    .site-header__inner .lang-switch { display: none; }
    .site-header [data-menu="mobilenav"] { display: grid !important; }
}
@media (max-width: 820px) {
    .grid-3 { grid-template-columns: 1fr; }
    .plan-grid { grid-template-columns: 1fr !important; }
    .section { padding: 3.5rem 1.25rem; }
}
@media (max-width: 560px) {
    .metric-strip { grid-template-columns: repeat(2, 1fr); }
    .metric-strip .metric { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
    .metric-strip .metric:nth-child(2n) { border-right: 0; }
    .metric__value { font-size: 1.3rem; }
}
@media (max-width: 680px) {
    .grid-stats { grid-template-columns: 1fr 1fr; gap: .8rem; }
    .content { padding: 1.25rem 1rem 5rem; }
    .topbar { padding: 0 1rem; gap: .5rem; }
    .topbar__search { display: none; }
    /* keep the language control usable in the cramped mobile topbar */
    .topbar .lang-switch > .lucide { display: none; }
    .topbar .lang-switch #langPicker { max-width: 108px; font-size: .78rem; padding: .35rem 1.5rem .35rem .6rem; }
    .topbar [data-menu="profile"] .vstack,
    .topbar [data-menu="adminprofile"] .vstack { display: none; }
    .topbar [data-menu="profile"], .topbar [data-menu="adminprofile"] { gap: .25rem; padding: .2rem; }
    .stat__value { font-size: 1.35rem; }
    .stat { padding: 1rem; }
    .page-head h1 { font-size: 1.3rem; }
    .card-header { padding: 1rem; flex-wrap: wrap; }
    .card-body, .card--pad { padding: 1rem; }
    .site-footer__inner { grid-template-columns: 1fr; }

    /* tables collapse to cards */
    .table-wrap.responsive .table { display: none; }
    .table-wrap.responsive .table-card { display: block; }
    .table-card__row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: .9rem 1rem; margin-bottom: .7rem; }
    .table-card__line { display: flex; justify-content: space-between; gap: 1rem; padding: .28rem 0; font-size: .84rem; }
    .table-card__line span:first-child { color: var(--text-mute); }

    /* bottom nav on mobile */
    .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 44; background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: .4rem .3rem calc(.4rem + env(safe-area-inset-bottom)); }
    .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .64rem; color: var(--text-mute); padding: .35rem .6rem; border-radius: var(--r-sm); }
    .bottom-nav a .lucide { width: 20px; height: 20px; }
    .bottom-nav a.is-active { color: var(--brand-600); }
}
@media (min-width: 681px) { .bottom-nav { display: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.hidden { display: none !important; }
.fade-in { animation: fade-in .3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }
