/* ============================================================
   reftrack — Partner Dashboard Stylesheet
   Design: Clean, AdSense-inspired dark sidebar layout
   ============================================================ */

/* ----- Reset & Base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:          #080d1a;
    --bg-card:     #0f1629;
    --surface:     #141b2d;
    --sidebar-bg:  #050a14;
    --sidebar-w:   240px;
    --header-h:    60px;
    --white:       #0f1629;
    --text:        #e2e8f0;
    --text-muted:  #64748b;
    --border:      rgba(255,255,255,.08);
    --primary:     #3b82f6;
    --primary-dk:  #2563eb;
    --success:     #10b981;
    --danger:      #ef4444;
    --warning:     #f59e0b;
    --card-radius: 12px;
    --shadow:      0 2px 20px rgba(0,0,0,.5);
    --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body { min-height: 100%; height: auto; }

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
}

/* Dashboard pages: subtle radial glow behind content */
body:not(.landing-page):not(.landing-v3):not(.auth-page) {
    background:
        radial-gradient(ellipse 80% 50% at 10% 0%, rgba(37,99,235,.07) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 100%, rgba(6,182,212,.05) 0%, transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    background: rgba(255,255,255,.08);
    color: #93c5fd;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

/* ----- Auth Layout ----------------------------------------- */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: fit-content; }

.auth-wrapper {
    width: 100%;
    padding: 24px 16px;
    display: flex;
    justify-content: center;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 440px;
}

.auth-card--wide { max-width: 680px; }

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin: 8px 0 4px;
}

.auth-logo p { color: var(--text-muted); font-size: 14px; }

.brand-icon {
    display: inline-block;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 20px;
    line-height: 48px;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ----- Forms ----------------------------------------------- */
.form-group { margin-bottom: 18px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ── Register form extras ── */
.form-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 18px;
    margin-top: 24px;
}
.phone-input-wrap {
    display: flex;
    gap: 8px;
}
.phone-input-wrap input[type="tel"] {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 0 !important;
}
.phone-code-select {
    flex: 0 0 auto;
    width: 112px;
    padding: 0 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    height: 42px;
    cursor: pointer;
}
[dir="rtl"] .phone-input-wrap { flex-direction: row-reverse; }

label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    transition: border-color .2s;
    outline: none;
    color-scheme: dark;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,.15);
}

small { display: block; margin-top: 4px; color: var(--text-muted); font-size: 12px; }

.field-error {
    display: none;
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

.input-with-toggle { position: relative; }
.input-with-toggle input { padding-right: 42px; }
.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    padding: 0;
}

/* ----- Buttons --------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, opacity .2s;
    text-decoration: none;
}

.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled)  { background: var(--primary-dk); text-decoration: none; }

.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled)  { background: #2f855a; text-decoration: none; }

.btn-danger   { background: var(--danger);  color: #fff; }
.btn-danger:hover:not(:disabled)   { background: #c53030; text-decoration: none; }

.btn-outline  { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover:not(:disabled)  { background: rgba(59,130,246,.12); text-decoration: none; }

.btn-full     { width: 100%; margin-top: 8px; }

.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ----- Alerts ---------------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.5;
}

.alert-success { background: rgba(16,185,129,.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }
.alert-error   { background: rgba(239,68,68,.12);  color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.alert-warning { background: rgba(245,158,11,.12); color: #fcd34d; border: 1px solid rgba(245,158,11,.3); }
.alert-info    { background: rgba(59,130,246,.12);  color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }

/* ----- Dashboard Layout ------------------------------------ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: #a0aec0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform .3s;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand .brand-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .3px;
}

.sidebar-brand .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
    line-height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%) !important;
    box-shadow: 0 0 16px rgba(37,99,235,.4);
}

.nav-links {
    list-style: none;
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: #a0aec0;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
}

.nav-links li a:hover,
.nav-links li.active a {
    background: rgba(255,255,255,.07);
    color: #fff;
}

.nav-links li.active a {
    border-left: 3px solid var(--primary);
    padding-left: 17px;
    background: rgba(59,130,246,.1);
    box-shadow: inset 0 0 20px rgba(59,130,246,.06);
}

.nav-icon { font-style: normal; width: 18px; text-align: center; }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,.06);
    font-size: 13px;
}

.ref-pill {
    display: block;
    background: rgba(255,255,255,.08);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 10px;
    color: #a0aec0;
}

.ref-pill strong { color: #fff; }

.logout-link { color: #a0aec0; font-size: 12px; }
.logout-link:hover { color: var(--danger); text-decoration: none; }

/* Main content area */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: calc(var(--header-h) + 32px) 32px 32px;
    min-width: 0;
}

/* Page header */
.page-header { margin-bottom: 28px; }
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--text); }
.page-header p  { color: var(--text-muted); margin-top: 4px; font-size: 14px; }

/* ----- Stat Cards ------------------------------------------ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 22px 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,.5), transparent);
    pointer-events: none;
}

.stat-card__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-card__sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.stat-card--primary .stat-card__value { color: var(--primary); }
.stat-card--success .stat-card__value { color: var(--success); }

/* ----- Range Tabs ------------------------------------------ */
.range-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.range-tab {
    padding: 6px 16px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: var(--surface);
    color: var(--text-muted);
    transition: all .15s;
}

.range-tab.active,
.range-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59,130,246,.12);
}

/* ----- Table ----------------------------------------------- */
.table-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    overflow: auto;
    max-width: 100vw;
    margin-bottom: 24px;
}

.table-card__header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.table-card__title { font-size: 16px; font-weight: 700; }

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    background: rgba(255,255,255,.03);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(59,130,246,.05); }

.td-right { text-align: right; }

/* ----- Badge ----------------------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.badge-success  { background: rgba(16,185,129,.15);  color: #6ee7b7; }
.badge-warning  { background: rgba(245,158,11,.15);  color: #fcd34d; }
.badge-danger   { background: rgba(239,68,68,.15);   color: #fca5a5; }
.badge-info     { background: rgba(59,130,246,.15);  color: #93c5fd; }
.badge-muted    { background: rgba(255,255,255,.07); color: var(--text-muted); }
.badge-fraud    { background: rgba(239,68,68,.15);   color: #fca5a5; }
.badge-valid    { background: rgba(16,185,129,.15);  color: #6ee7b7; }

/* ----- Copy Input ------------------------------------------ */
.copy-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.copy-group input[type="text"] {
    flex: 1;
    background: var(--surface);
    border: 1.5px solid var(--border);
    font-family: monospace;
    font-size: 13px;
}

/* ----- Date Range Picker ----------------------------------- */
.date-range-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.date-range-form .form-group { margin-bottom: 0; }
.date-range-form label { font-size: 12px; }

/* ----- Loading Spinner ------------------------------------- */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Empty State ----------------------------------------- */
.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state p { margin-top: 8px; font-size: 13px; }

/* ----- Top Header ------------------------------------------ */
.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--header-h);
    background: rgba(8,13,26,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 99;
    box-shadow: 0 1px 16px rgba(0,0,0,.3);
}

.top-header__left { flex: 1; }

.top-header__right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
    position: relative;
}
.header-btn:hover { background: rgba(255,255,255,.07); color: var(--text); text-decoration: none; }

.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle span {
    width: 16px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

.lang-btn .lang-flag { font-size: 19px; line-height: 1; }
.lang-btn .lang-label { font-size: 12px; font-weight: 600; }

.notif-btn { position: relative; }
.notif-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    line-height: 16px;
    text-align: center;
    padding: 0 3px;
}

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .5px;
    transition: opacity .15s;
    margin-left: 4px;
}
.user-avatar-btn:hover { opacity: .85; }

.user-menu { position: relative; }

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 248px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    display: none;
    z-index: 300;
    overflow: hidden;
}
.user-dropdown.open { display: block; }

.user-dropdown__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.user-dropdown__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-dropdown__name  { font-size: 14px; font-weight: 600; color: var(--text); }
.user-dropdown__email { font-size: 11px; color: var(--text-muted); margin-top: 2px; word-break: break-all; }

.user-dropdown__body { padding: 6px; }

.user-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    transition: background .12s;
}
.user-dropdown__item:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.user-dropdown__item--danger       { color: var(--danger); }
.user-dropdown__item--danger:hover { background: rgba(239,68,68,.12); }
.user-dropdown__item svg           { flex-shrink: 0; opacity: .7; }

.user-dropdown__divider { height: 1px; background: var(--border); margin: 4px 6px; }

/* ----- Notification Panel ---------------------------------- */
.notif-wrapper { position: relative; }

.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    display: none;
    flex-direction: column;
    z-index: 300;
    overflow: hidden;
    max-height: 480px;
}
.notif-panel.open { display: flex; }

.notif-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}
.notif-panel__title { font-size: 14px; font-weight: 600; color: var(--text); }
.notif-mark-all {
    font-size: 12px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
}
.notif-mark-all:hover { background: rgba(79,110,247,.1); }

.notif-panel__body { overflow-y: auto; flex: 1; }

.notif-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,.04); }
.notif-item--unread { background: rgba(59,130,246,.1); }
.notif-item--unread:hover { background: rgba(59,130,246,.15); }
.notif-item--clickable { cursor: pointer; }

.notif-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 5px;
}
.notif-item--read .notif-item__dot { background: #cbd5e0; }

.notif-item__content { flex: 1; min-width: 0; }
.notif-item__title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-item__body  { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item__link-label { font-size: 11px; color: var(--primary); margin-top: 4px; font-weight: 500; }
.notif-item__time  { font-size: 11px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; margin-top: 2px; }

/* RTL: flip panel to the left */
[dir="rtl"] .notif-panel {
    right: auto;
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(9, 17, 31, .5);
    display: none;
    z-index: 96;
}

.sidebar-overlay.open {
    display: block;
}

/* ----- Responsive ------------------------------------------ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: calc(var(--header-h) + 16px) 16px 16px;
    }

    .top-header {
        left: 0;
        padding: 0 12px;
    }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .menu-toggle {
        display: inline-flex;
    }

    .notif-panel {
        width: min(360px, calc(100vw - 24px));
        right: -6px;
    }

    .table-card {
        overflow-x: auto;
    }

    .table-card__header,
    .table-card table {
        min-width: 720px;
    }
}

/* ----- Admin Panel Specific -------------------------------- */
.admin-layout .sidebar { background: #030711; }

/* ----- Modal / Overlay shared styles ---------------------- */
.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-body { padding: 24px; }

/* ============================================================
   Light Mode — [data-theme="light"] overrides
   All overrides scoped here; dark is the default (:root).
   ============================================================ */
[data-theme="light"] {
    --bg:          #f4f6fa;
    --bg-card:     #ffffff;
    --surface:     #ffffff;
    --white:       #ffffff;
    --text:        #2d3748;
    --text-muted:  #718096;
    --border:      #e2e8f0;
    --primary:     #4f6ef7;
    --primary-dk:  #3a56d4;
    --success:     #38a169;
    --danger:      #e53e3e;
    --warning:     #d69e2e;
    --shadow:      0 2px 12px rgba(0,0,0,.08);
}

/* Body — remove dark gradient */
[data-theme="light"] body:not(.landing-page):not(.landing-v3):not(.auth-page) {
    background: var(--bg);
}

/* Code block */
[data-theme="light"] code {
    background: #edf2f7;
    color: inherit;
}

/* Inputs */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="url"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: #fff;
    color-scheme: light;
}

/* Alerts */
[data-theme="light"] .alert-success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
[data-theme="light"] .alert-error   { background: #fff5f5; color: #9b2c2c; border: 1px solid #fed7d7; }
[data-theme="light"] .alert-warning { background: #fffbeb; color: #744210; border: 1px solid #fefcbf; }
[data-theme="light"] .alert-info    { background: #ebf8ff; color: #2c5282; border: 1px solid #bee3f8; }

/* Buttons */
[data-theme="light"] .btn-outline:hover:not(:disabled) { background: #eef1fe; }

/* Range tabs */
[data-theme="light"] .range-tab              { background: #fff; }
[data-theme="light"] .range-tab.active,
[data-theme="light"] .range-tab:hover        { background: #eef1fe; }

/* Tables */
[data-theme="light"] th                      { background: #f8fafc; }
[data-theme="light"] td                      { border-bottom: 1px solid #f0f4f8; }
[data-theme="light"] tbody tr:hover          { background: #fafbff; }

/* Badges */
[data-theme="light"] .badge-success  { background: #f0fff4; color: #38a169; }
[data-theme="light"] .badge-warning  { background: #fffbeb; color: #d69e2e; }
[data-theme="light"] .badge-danger   { background: #fff5f5; color: #e53e3e; }
[data-theme="light"] .badge-info     { background: #ebf8ff; color: #2b6cb0; }
[data-theme="light"] .badge-muted    { background: #f7fafc; color: #718096; }
[data-theme="light"] .badge-fraud    { background: #fff5f5; color: #e53e3e; }
[data-theme="light"] .badge-valid    { background: #f0fff4; color: #38a169; }

/* Stat card accent line — lighter */
[data-theme="light"] .stat-card::after {
    background: linear-gradient(90deg, transparent, rgba(79,110,247,.25), transparent);
}

/* Nav active item */
[data-theme="light"] .nav-links li.active a {
    background: rgba(79,110,247,.1);
    box-shadow: none;
}

/* Top header */
[data-theme="light"] .top-header {
    background: rgba(255,255,255,.92);
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
[data-theme="light"] .header-btn:hover { background: var(--bg); }
[data-theme="light"] .menu-toggle      { background: #fff; }

/* User dropdown */
[data-theme="light"] .user-dropdown                            { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.13); }
[data-theme="light"] .user-dropdown__item:hover                { background: var(--bg); }
[data-theme="light"] .user-dropdown__item--danger:hover        { background: #fff5f5; }

/* Notification panel */
[data-theme="light"] .notif-panel                              { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.13); }
[data-theme="light"] .notif-item:hover                         { background: var(--bg); }
[data-theme="light"] .notif-item--unread                       { background: #f0f4ff; }
[data-theme="light"] .notif-item--unread:hover                 { background: #e8eeff; }

/* ============================================================
   RTL Support (Arabic and other right-to-left languages)
   Uses [dir="rtl"] attribute set on <html> by Lang::dir()
   ============================================================ */

/* Font: Cairo for Arabic — applied to ALL elements including form controls */
[dir="rtl"] body,
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select,
[dir="rtl"] button,
[dir="rtl"] .btn {
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
}

/* Sidebar: flip to right side */
[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border);
}

/* Main content: flip margin */
[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: var(--sidebar-w);
}

/* Header: flip to right side in RTL */
[dir="rtl"] .top-header {
    left: 0;
    right: var(--sidebar-w);
}

@media (max-width: 768px) {
    [dir="rtl"] .main-content {
        margin-right: 0;
    }

    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }

    [dir="rtl"] .sidebar.open {
        transform: translateX(0);
    }

    [dir="rtl"] .top-header {
        right: 0;
    }
}

/* User dropdown: open to the left in RTL */
[dir="rtl"] .user-dropdown {
    right: auto;
    left: 0;
}

/* Avatar margin flip */
[dir="rtl"] .user-avatar-btn {
    margin-left: 0;
    margin-right: 4px;
}

/* Table right-aligned columns: flip to left */
[dir="rtl"] .td-right {
    text-align: left;
}

/* Table headers that mirror td-right */
[dir="rtl"] th.td-right {
    text-align: left;
}

/* Page header text alignment */
[dir="rtl"] .page-header,
[dir="rtl"] .table-card__header {
    text-align: right;
}

/* Form labels */
[dir="rtl"] label,
[dir="rtl"] .form-group small,
[dir="rtl"] .field-error, {
    text-align: right;
    display: block;
}

/* Auth card */
[dir="rtl"] .auth-card,
[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

/* Stat cards */
[dir="rtl"] .stat-card__label,
[dir="rtl"] .stat-card__value,
[dir="rtl"] .stat-card__sub {
    text-align: right;
}

/* Nav links: RTL spacing */
[dir="rtl"] .nav-icon {
    margin-right: 0;
    margin-left: 8px;
}

/* Badges / table cells */
[dir="rtl"] td {
    text-align: right;
}
[dir="rtl"] td.td-right {
    text-align: left;
}

/* Lang switch link */
.lang-switch {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,.5);
    text-decoration: none;
    padding: 4px 0;
    transition: color .2s;
}
.lang-switch:hover {
    color: #fff;
}

/* ============================================================
   Landing Page
   ============================================================ */
.landing-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 0 0, #d7ecff 0, rgba(215, 236, 255, 0) 42%),
        radial-gradient(circle at 100% 100%, #ffe7c2 0, rgba(255, 231, 194, 0) 40%),
        #f5f8fd;
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 1px solid #dbe6f4;
    background: rgba(245, 248, 253, .9);
    backdrop-filter: blur(8px);
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: #10213f;
    text-decoration: none;
}

.landing-brand .brand-icon {
    width: 38px;
    height: 38px;
    line-height: 38px;
}

.landing-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.landing-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    color: #19325d;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent;
}

.landing-nav a:hover {
    background: #eaf1fb;
    text-decoration: none;
}

.landing-nav-cta {
    background: #1f3e73;
    color: #fff !important;
}

.landing-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 36px 24px 48px;
}

.hero {
    background:
        linear-gradient(155deg, rgba(255,255,255,.95), rgba(255,255,255,.88)),
        linear-gradient(120deg, #dfeeff, #fff1dd);
    border: 1px solid #dce8f5;
    border-radius: 24px;
    padding: 38px 34px;
    box-shadow: 0 18px 40px rgba(16, 33, 63, .09);
}

.hero-kicker {
    display: inline-block;
    background: #e8f2ff;
    color: #184b8a;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2px;
}

.hero h1 {
    margin-top: 14px;
    font-size: clamp(28px, 4.2vw, 48px);
    line-height: 1.08;
    color: #11274a;
    max-width: 900px;
}

.hero-sub {
    margin-top: 14px;
    max-width: 720px;
    color: #3f536f;
    font-size: 16px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.hero-metrics {
    margin-top: 26px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.hero-metrics div {
    background: rgba(255,255,255,.85);
    border: 1px solid #d7e6f7;
    border-radius: 12px;
    padding: 12px 14px;
}

.hero-metrics strong {
    display: block;
    color: #16345f;
    font-size: 18px;
}

.hero-metrics span {
    color: #51698b;
    font-size: 12px;
}

.landing-section {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.feature-card {
    background: #fff;
    border: 1px solid #dae6f4;
    border-radius: 16px;
    padding: 18px;
}

.feature-card h3 {
    color: #152c51;
    font-size: 19px;
    margin-bottom: 8px;
}

.feature-card p {
    color: #576e8f;
    line-height: 1.6;
}

.landing-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid #c9d8ec;
    border-radius: 10px;
    background: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.landing-menu-toggle span {
    width: 18px;
    height: 2px;
    background: #1a355f;
}

.lang-modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(6, 14, 28, .5);
    z-index: 50;
    padding: 16px;
}

.lang-modal-backdrop.open {
    display: flex;
}

.lang-modal {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 16px;
    border: 1px solid #d8e5f5;
    padding: 24px;
    box-shadow: 0 20px 36px rgba(7, 18, 35, .26);
}

.lang-modal h2 {
    font-size: 24px;
    color: #10274b;
}

.lang-modal p {
    margin-top: 8px;
    color: #4c6181;
}

.lang-options {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.lang-choice {
    width: 100%;
    text-align: left;
    border: 1px solid #ccdcf0;
    background: #f7fbff;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
}

.lang-choice span {
    display: block;
    color: #163765;
    font-size: 17px;
    font-weight: 700;
}

.lang-choice small {
    margin: 4px 0 0;
    color: #5e7597;
}

.lang-choice:hover {
    border-color: #8fb4e6;
    background: #eef6ff;
}

.lang-skip {
    margin-top: 12px;
    border: 0;
    background: transparent;
    color: #3d5480;
    cursor: pointer;
    font-size: 13px;
}

.lang-skip:hover {
    color: #1b3867;
}

[dir="rtl"] .lang-choice {
    text-align: right;
}

@media (max-width: 900px) {
    .landing-main {
        padding: 24px 14px 28px;
    }

    .hero {
        padding: 24px 18px;
    }

    .landing-section {
        grid-template-columns: 1fr;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .landing-header {
        padding: 12px 14px;
    }

    .landing-menu-toggle {
        display: inline-flex;
    }

    .landing-nav {
        position: absolute;
        top: 64px;
        left: 12px;
        right: 12px;
        display: none;
        flex-direction: column;
        background: #fff;
        border: 1px solid #d5e2f3;
        border-radius: 12px;
        padding: 10px;
        box-shadow: 0 12px 24px rgba(14, 27, 48, .14);
    }

    .landing-nav.open {
        display: flex;
    }

    .landing-nav a {
        width: 100%;
        justify-content: center;
    }
}
/* ============================================================
   Landing Page Refresh (Partners)
   ============================================================ */
.landing-page {
    min-height: 100vh;
    background:
        radial-gradient(1200px 400px at 5% 0%, rgba(42, 137, 255, .22), transparent 65%),
        radial-gradient(900px 420px at 95% 100%, rgba(255, 146, 67, .26), transparent 66%),
        linear-gradient(180deg, #f8fbff 0%, #f4f8ff 46%, #f7fbff 100%);
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 26px;
    border-bottom: 1px solid #dce8f5;
    background: rgba(247, 251, 255, .88);
    backdrop-filter: blur(10px);
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0f274b;
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
}

.landing-brand .brand-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(140deg, #0d57a8, #2e89ff);
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.landing-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0 14px;
    color: #18345f;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.landing-nav a:hover {
    background: #eaf2fd;
}

.landing-nav-cta {
    color: #fff !important;
    background: linear-gradient(135deg, #145bb0, #2a8cff);
    box-shadow: 0 8px 18px rgba(20, 91, 176, .25);
}

.landing-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid #ccddef;
    border-radius: 10px;
    background: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.landing-menu-toggle span {
    width: 18px;
    height: 2px;
    background: #1a355f;
    transition: transform .22s ease, opacity .22s ease;
}

.landing-menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.landing-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.landing-menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.landing-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 34px 22px 46px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: 14px;
    align-items: stretch;
    padding: 30px;
    border: 1px solid #dbe8f8;
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .9)),
        linear-gradient(120deg, #dff0ff, #ffe9ce);
    box-shadow: 0 16px 36px rgba(13, 27, 48, .11);
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    background: #e8f2ff;
    color: #134c93;
    font-size: 12px;
    font-weight: 700;
}

.hero h1 {
    margin-top: 12px;
    color: #102a50;
    line-height: 1.1;
    font-size: clamp(29px, 4.3vw, 50px);
}

.hero-sub {
    margin-top: 12px;
    color: #425977;
    font-size: 16px;
    line-height: 1.65;
    max-width: 720px;
}

.hero-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-panel {
    border: 1px solid #d8e5f5;
    border-radius: 16px;
    padding: 18px;
    background: rgba(255, 255, 255, .92);
}

.hero-panel h2 {
    color: #15335f;
    font-size: 20px;
}

.hero-panel ul {
    margin: 12px 0 0;
    padding-inline-start: 18px;
    color: #4f6787;
    display: grid;
    gap: 8px;
}

.hero-metrics {
    grid-column: 1 / -1;
    margin-top: 6px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-metrics div {
    border: 1px solid #d7e6f7;
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .84);
}

.hero-metrics strong {
    display: block;
    font-size: 18px;
    color: #163b6c;
}

.hero-metrics span {
    color: #557197;
    font-size: 12px;
}

.landing-section {
    margin-top: 18px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card {
    border: 1px solid #dbe8f6;
    border-radius: 16px;
    background: #fff;
    padding: 18px;
}

.feature-card h3 {
    color: #15345f;
    font-size: 18px;
    margin-bottom: 8px;
}

.feature-card p {
    color: #576f91;
    line-height: 1.6;
}

.landing-steps,
.landing-proof,
.landing-cta {
    margin-top: 18px;
    border: 1px solid #dbe8f6;
    border-radius: 18px;
    background: #fff;
    padding: 22px;
}

.landing-steps h2,
.landing-proof h2,
.landing-cta h2 {
    color: #12325d;
    font-size: clamp(24px, 3vw, 34px);
}

.steps-grid {
    margin-top: 14px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.steps-grid article {
    border: 1px solid #dce9f8;
    border-radius: 14px;
    background: #f9fcff;
    padding: 14px;
}

.steps-grid span {
    display: inline-flex;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: #eaf3ff;
    color: #174a88;
    font-weight: 700;
}

.steps-grid h3 {
    margin-top: 10px;
    color: #183862;
    font-size: 17px;
}

.steps-grid p,
.landing-proof p,
.landing-cta p {
    margin-top: 8px;
    color: #587092;
    line-height: 1.65;
}

.proof-points {
    margin-top: 14px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.proof-points div {
    border: 1px solid #dce8f7;
    border-radius: 12px;
    padding: 12px;
    background: #f7fbff;
}

.proof-points strong {
    display: block;
    color: #194272;
}

.proof-points span {
    color: #5e7799;
    font-size: 13px;
}

.landing-cta {
    text-align: center;
    background:
        radial-gradient(circle at 0% 0%, rgba(33, 131, 255, .1), transparent 42%),
        radial-gradient(circle at 100% 100%, rgba(255, 147, 63, .16), transparent 40%),
        #fff;
}

.landing-cta .btn {
    margin-top: 14px;
}

.lang-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 14, 28, .5);
}

.lang-modal-backdrop.open {
    display: flex;
}

.lang-modal {
    width: min(530px, 100%);
    border: 1px solid #d8e5f5;
    border-radius: 16px;
    background: #fff;
    padding: 22px;
    box-shadow: 0 20px 36px rgba(7, 18, 35, .26);
}

.lang-modal h2 {
    color: #10274b;
    font-size: 24px;
}

.lang-modal p {
    margin-top: 8px;
    color: #4c6181;
}

.lang-options {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.lang-choice {
    width: 100%;
    border: 1px solid #ccdcf0;
    border-radius: 12px;
    background: #f7fbff;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
}

.lang-choice span {
    display: block;
    color: #163765;
    font-size: 17px;
    font-weight: 700;
}

.lang-choice small {
    margin-top: 4px;
    color: #5e7597;
}

.lang-choice:hover {
    border-color: #8fb4e6;
    background: #eef6ff;
}

.lang-skip {
    margin-top: 12px;
    border: 0;
    background: transparent;
    color: #3d5480;
    cursor: pointer;
    font-size: 13px;
}

[dir="rtl"] .landing-nav {
    direction: rtl;
}

[dir="rtl"] .hero-panel ul {
    padding-inline-start: 0;
    padding-inline-end: 18px;
}

[dir="rtl"] .lang-choice {
    text-align: right;
}

@media (max-width: 980px) {
    .landing-main {
        padding: 24px 14px 30px;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 22px 18px;
    }

    .landing-section,
    .steps-grid,
    .proof-points,
    .hero-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .landing-header {
        padding: 12px 14px;
    }

    .landing-menu-toggle {
        display: inline-flex;
    }

    .landing-nav {
        position: absolute;
        top: 64px;
        left: 12px;
        right: 12px;
        z-index: 40;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 10px;
        border: 1px solid #d5e2f3;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 12px 24px rgba(14, 27, 48, .14);
    }

    .landing-nav.open {
        display: flex;
    }

    .landing-nav a {
        width: 100%;
        justify-content: center;
    }

    .hero h1 {
        font-size: clamp(25px, 8vw, 36px);
    }

    .landing-steps,
    .landing-proof,
    .landing-cta {
        padding: 18px 14px;
    }
}

@media (max-width: 420px) {
    .hero-actions .btn {
        width: 100%;
    }
}
/* ============================================================
   Public Site (Professional Shell)
   ============================================================ */
.landing-page {
    background:
        radial-gradient(1100px 420px at 5% 0%, rgba(22, 110, 215, .18), transparent 62%),
        radial-gradient(900px 500px at 100% 100%, rgba(255, 159, 83, .18), transparent 58%),
        #f5f8fd;
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid #dbe6f4;
    background: rgba(245, 248, 253, .92);
    backdrop-filter: blur(10px);
}

.public-header__inner {
    max-width: 1160px;
    margin: 0 auto;
    min-height: 72px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0f274b;
    text-decoration: none!important;
    font-size: 19px;
    font-weight: 800;
}

.public-brand__icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(140deg, #0d57a8, #2e89ff);
}

.public-brand__logo {
    display: block;
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}

.public-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Drawer group wrappers — flat on desktop, become drawer sections on mobile */
.pub-drawer__head   { display: none; }
.pub-drawer__links  { display: contents; }
.pub-drawer__meta   { display: contents; }
.pub-drawer__footer { display: contents; }

/* Overlay (hidden on desktop) */
.pub-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(0,0,0,.5);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
    height: 100vh;
}
.pub-overlay.open { opacity: 1; pointer-events: all; }

.public-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    color: #18345f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: .2s all;
}

.public-nav a:hover {
    background: #e9f1fd;
    color: #18345f!important;
}

.public-nav .public-nav__cta {
    color: #fff !important;
    background: linear-gradient(135deg, #145bb0, #2a8cff);
    box-shadow: 0 8px 18px rgba(20, 91, 176, .24);
    transition: .2s all;
}

/* Theme toggle button (shared across all public pages) */
.public-theme-toggle {
    width: 36px; height: 36px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: background .15s, border-color .15s, color .15s;
    flex-shrink: 0;
}
.public-theme-toggle:hover { background: #e0e7ff; border-color: #a5b4fc; color: #4338ca; }
[data-theme="dark"] .public-theme-toggle { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); color: #94a3b8; }
[data-theme="dark"] .public-theme-toggle:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #e2e8f0; }

/* Language switcher link (shared across all public pages) */
.public-nav__lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    transition: .15s all;
    white-space: nowrap;
}
.public-nav__lang:hover { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
[data-theme="dark"] .public-nav__lang { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.13); color: #94a3b8; }
[data-theme="dark"] .public-nav__lang:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #e2e8f0; }

.public-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid #ccddef;
    border-radius: 10px;
    background: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.public-menu-toggle span {
    width: 18px;
    height: 2px;
    background: #1a355f;
    transition: transform .22s ease, opacity .22s ease;
}

.public-menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.public-menu-toggle.open span:nth-child(2) { opacity: 0; }
.public-menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.public-main {
    max-width: 1160px;
    margin: 0 auto;
    padding: 28px 22px 48px;
}

.public-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
    gap: 16px;
    align-items: stretch;
    padding: 30px;
    border: 1px solid #dbe8f7;
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.95), rgba(255,255,255,.9)),
        linear-gradient(120deg, #dff0ff, #ffe9ce);
    box-shadow: 0 16px 36px rgba(13, 27, 48, .10);
}

.public-kicker {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    background: #e8f2ff;
    color: #134c93;
    font-size: 12px;
    font-weight: 700;
}

.public-hero h1 {
    margin-top: 12px;
    color: #102a50;
    line-height: 1.09;
    font-size: clamp(30px, 4.3vw, 52px);
}

.public-hero p {
    margin-top: 12px;
    color: #405878;
    font-size: 16px;
    line-height: 1.7;
}

.public-hero__actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.public-hero__card {
    border: 1px solid #d7e4f5;
    border-radius: 16px;
    padding: 18px;
    background: rgba(255,255,255,.92);
}

.public-hero__card h2 {
    color: #15345f;
    font-size: 21px;
}

.public-hero__card ul {
    margin: 12px 0 0;
    padding-inline-start: 18px;
    color: #506987;
    display: grid;
    gap: 8px;
}

.public-stat-strip {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.public-stat-strip article {
    border: 1px solid #d8e7f7;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}

.public-stat-strip strong {
    display: block;
    color: #163b6c;
    font-size: 18px;
}

.public-stat-strip span {
    color: #567194;
    font-size: 13px;
}

.public-feature-grid,
.public-steps,
.public-proof,
.public-cta,
.legal-card {
    margin-top: 18px;
    border: 1px solid #dbe8f6;
    border-radius: 18px;
    background: #fff;
    padding: 22px;
}

.public-feature-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.public-feature-grid article {
    border: 1px solid #dce9f8;
    border-radius: 14px;
    background: #f9fcff;
    padding: 14px;
}

.public-feature-grid h3,
.public-steps h2,
.public-proof h2,
.public-cta h2,
.legal-card h1 {
    color: #12325d;
}

.public-feature-grid h3 {
    font-size: 18px;
}

.public-feature-grid p,
.public-steps p,
.public-proof p,
.public-cta p,
.legal-card p {
    margin-top: 8px;
    color: #587092;
    line-height: 1.7;
}

.public-steps__grid,
.public-proof__grid {
    margin-top: 12px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.public-steps__grid article,
.public-proof__grid article {
    border: 1px solid #dce9f8;
    border-radius: 12px;
    background: #f8fbff;
    padding: 12px;
}

.public-steps__grid span {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eaf3ff;
    color: #174a88;
    font-weight: 700;
}

.public-proof__grid strong {
    display: block;
    color: #1b4474;
}

.public-proof__grid span {
    color: #5f799b;
    font-size: 13px;
}

.public-cta {
    text-align: center;
    background:
        radial-gradient(circle at 0% 0%, rgba(33, 131, 255, .1), transparent 42%),
        radial-gradient(circle at 100% 100%, rgba(255, 147, 63, .16), transparent 40%),
        #fff;
}

.public-footer {
    border-top: 1px solid #d9e6f5;
    background: #f2f7ff;
}

.public-footer__inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 28px 22px;
    display: grid;
    gap: 18px;
    grid-template-columns: 1.2fr .9fr .9fr;
}

.public-footer__brand p {
    margin-top: 10px;
    color: #5a7293;
    max-width: 420px;
}

.public-footer__col h4 {
    color: #16355f;
    font-size: 15px;
}

.public-footer__col a {
    display: block;
    margin-top: 8px;
    text-decoration: none;
    color: #4f698a;
}

.public-footer__col a:hover {
    color: #1d4f8c;
}

.public-footer__bar {
    border-top: 1px solid #dce7f4;
    padding: 12px 22px 14px;
    text-align: center;
    color: #6882a6;
}

.legal-main {
    padding-top: 18px;
}

.legal-card h1 {
    font-size: clamp(28px, 4vw, 42px);
}

.legal-card h2 {
    margin-top: 16px;
    color: #173a67;
    font-size: 20px;
}

.legal-updated {
    margin-top: 8px;
    font-size: 13px;
    color: #6a83a6;
}

[dir="rtl"] .public-hero__card ul {
    padding-inline-start: 0;
    padding-inline-end: 18px;
}

@media (max-width: 980px) {
    .public-main {
        padding: 22px 14px 30px;
    }

    .public-hero {
        grid-template-columns: 1fr;
        padding: 22px 18px;
    }

    .public-stat-strip,
    .public-feature-grid,
    .public-steps__grid,
    .public-proof__grid,
    .public-footer__inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .public-header__inner {
        min-height: 64px;
        padding: 0 14px;
    }

    .public-menu-toggle {
        display: inline-flex;
    }

    /* Slide-in drawer */
    .pub-overlay { display: block; }

    .public-nav {
        position: fixed;
        top: 0;
        height: 100vh;
        height: 100dvh;
        inset-inline-start: 0;
        width: 300px;
        max-width: 85vw;
        z-index: 200;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        border-radius: 0;
        background: #fff;
        box-shadow: 4px 0 32px rgba(0,0,0,.18);
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        overflow-y: auto;
    }
    [dir="rtl"] .public-nav {
        transform: translateX(100%);
        box-shadow: -4px 0 32px rgba(0,0,0,.18);
    }
    .public-nav.open { transform: translateX(0); }

    /* Dark mode drawer bg */
    [data-theme="dark"] .public-nav { background: #111827; }

    /* Drawer header */
    .pub-drawer__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 18px;
        border-bottom: 1px solid #e2e8f0;
        flex-shrink: 0;
    }
    [data-theme="dark"] .pub-drawer__head { border-bottom-color: rgba(255,255,255,.07); }

    /* Close button */
    .pub-drawer__close {
        width: 36px; height: 36px;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        background: transparent;
        color: #64748b;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: .2s all;
    }
    .pub-drawer__close:hover { background: #fee2e2; color: #ef4444; border-color: #fecaca; }
    [data-theme="dark"] .pub-drawer__close { border-color: rgba(255,255,255,.1); color: #94a3b8; }

    /* Nav links */
    .pub-drawer__links {
        display: flex;
        flex-direction: column;
        flex: 1;
        padding: 10px 12px;
        gap: 2px;
    }
    .pub-drawer__links a {
        display: flex;
        align-items: center;
        padding: 11px 12px;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 600;
        color: #18345f;
        height: auto;
        border: none;
        justify-content: flex-start;
    }
    [data-theme="dark"] .pub-drawer__links a { color: #e2e8f0; }
    .pub-drawer__links a:hover { background: #f1f5f9; color: #18345f !important; }
    [data-theme="dark"] .pub-drawer__links a:hover { background: rgba(255,255,255,.06); color: #fff !important; }

    /* Lang + theme row */
    .pub-drawer__meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 18px;
        border-top: 1px solid #e2e8f0;
        gap: 8px;
    }
    [data-theme="dark"] .pub-drawer__meta { border-top-color: rgba(255,255,255,.07); }

    /* Auth buttons */
    .pub-drawer__footer {
        display: flex;
        flex-direction: column;
        padding: 12px;
        gap: 8px;
        border-top: 1px solid #e2e8f0;
    }
    [data-theme="dark"] .pub-drawer__footer { border-top-color: rgba(255,255,255,.07); }
    .pub-drawer__login {
        display: block;
        text-align: center;
        padding: 11px;
        border-radius: 10px;
        font-weight: 600;
        font-size: 15px;
        color: #18345f;
        border: 1px solid #d1dff0;
        text-decoration: none;
    }
    [data-theme="dark"] .pub-drawer__login { color: #e2e8f0; border-color: rgba(255,255,255,.12); }
    .pub-drawer__footer .public-nav__cta { text-align: center; padding: 11px; display: flex; border-radius: 10px; font-size: 15px; }

    .public-hero__actions .btn {
        width: 100%;
    }
}
/* ============================================================
   Landing V2 Layout
   ============================================================ */
.landing-v2 .public-hero-v2 {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
}

.landing-v2 .hero-note {
    margin-top: 12px;
    font-size: 13px;
    color: #637e9f;
}

.landing-v2 .value-card {
    display: grid;
    align-content: start;
    gap: 10px;
}

.landing-v2 .value-card__mini {
    border: 1px dashed #c4d9f3;
    border-radius: 12px;
    background: #f6faff;
    padding: 10px 12px;
}

.landing-v2 .value-card__mini strong {
    display: block;
    color: #1a477a;
}

.landing-v2 .value-card__mini span {
    color: #5c789b;
    font-size: 12px;
}

.live-stats-board,
.payout-timeline {
    margin-top: 18px;
    border: 1px solid #dbe8f6;
    border-radius: 18px;
    background: #fff;
    padding: 22px;
}

.live-stats-board header h2,
.payout-timeline h2 {
    color: #12325d;
}

.live-stats-board header p {
    margin-top: 8px;
    color: #587092;
}

.live-stats-board__grid {
    margin-top: 14px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-stats-board__grid article {
    border: 1px solid #dce9f8;
    border-radius: 12px;
    background: #f8fbff;
    padding: 12px;
}

.live-stats-board__grid strong {
    display: block;
    color: #1b4474;
}

.live-stats-board__grid span {
    color: #5f799b;
    font-size: 13px;
}

.payout-timeline__grid {
    margin-top: 12px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payout-timeline__grid article {
    border: 1px solid #dce9f8;
    border-radius: 12px;
    background: #f8fbff;
    padding: 12px;
}

.payout-timeline__grid span {
    display: inline-flex;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #1b64bf, #2d8dff);
    font-size: 13px;
    font-weight: 700;
}

.payout-timeline__grid h3 {
    margin-top: 10px;
    color: #183862;
    font-size: 16px;
}

.payout-timeline__grid p {
    margin-top: 8px;
    color: #5f799b;
    line-height: 1.6;
}

@media (max-width: 980px) {
    .landing-v2 .public-hero-v2,
    .live-stats-board__grid,
    .payout-timeline__grid {
        grid-template-columns: 1fr;
    }
}
/* ============================================================
   Legal Pages Redesign
   ============================================================ */
.legal-main {
    padding-top: 18px;
}

.legal-hero {
    border: 1px solid #dbe8f6;
    border-radius: 20px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .92)),
        linear-gradient(120deg, #e6f2ff, #fff0dc);
    padding: 24px;
    box-shadow: 0 12px 24px rgba(13, 27, 48, .08);
}

.legal-hero h1 {
    color: #11315b;
    font-size: clamp(28px, 4vw, 42px);
}

.legal-hero > p {
    margin-top: 10px;
    color: #4e688b;
    line-height: 1.7;
    max-width: 920px;
}

.legal-layout {
    margin-top: 16px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    align-items: start;
}

.legal-toc {
    position: sticky;
    top: 88px;
    border: 1px solid #dbe8f6;
    border-radius: 16px;
    background: #fff;
    padding: 14px;
}

.legal-toc h3 {
    color: #163a66;
    font-size: 15px;
}

.legal-toc ul {
    margin-top: 10px;
    list-style: none;
    display: grid;
    gap: 8px;
}

.legal-toc a {
    display: block;
    border: 1px solid #e4edf9;
    border-radius: 10px;
    padding: 8px 10px;
    color: #3f5f86;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.45;
}

.legal-toc a:hover {
    border-color: #bcd3f2;
    background: #f6faff;
    color: #1f4f8c;
}

.legal-content {
    border: 1px solid #dbe8f6;
    border-radius: 16px;
    background: #fff;
    padding: 18px;
}

.legal-summary {
    border: 1px solid #d8e7f8;
    border-radius: 12px;
    background: #f7fbff;
    padding: 14px;
}

.legal-summary h2 {
    color: #15365f;
    font-size: 20px;
}

.legal-summary p {
    margin-top: 8px;
    color: #557194;
    line-height: 1.7;
}

.legal-section {
    margin-top: 14px;
    border-top: 1px solid #ebf1fa;
    padding-top: 14px;
}

.legal-section h2 {
    color: #173a67;
    font-size: 21px;
}

.legal-section p {
    margin-top: 8px;
    color: #4f6b8e;
    line-height: 1.78;
}

.legal-updated {
    margin-top: 12px;
    font-size: 13px;
    color: #6a83a6;
}

@media (max-width: 980px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-toc {
        position: static;
    }
}

/* ============================================================
   Landing v3 — Full redesign
   All selectors scoped under .landing-v3 or v3-* prefix.
   ============================================================ */

/* Shared tokens */
.landing-v3 {
    --v3-blue:        #1a9ef0;
    --v3-blue-dark:   #0d7cc7;
    --v3-blue-light:  #e8f4fd;
    --v3-text:        #111827;
    --v3-muted:       #6b7280;
    --v3-card-border: #e5e7eb;
    --v3-radius:      14px;
}

.v3-main { background: #fff; }

.v3-container {
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: 24px;
}

/* Buttons */
.v3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s;
    border: 2px solid transparent;
}
.v3-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.v3-btn:active { transform: none; }
.v3-btn--white { background: #fff; color: var(--v3-blue); }
.v3-btn--outline-white { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.v3-btn--outline-white:hover { background: rgba(255,255,255,.15); box-shadow: none; }
.v3-btn--primary { background: var(--v3-blue); color: #fff; }

/* Hero */
.v3-hero {
    background: linear-gradient(135deg, #1a9ef0 0%, #1565c0 100%);
    padding: 80px 0 90px;
    overflow: hidden;
    position: relative;
}
.v3-hero::before {
    content: '';
    position: absolute;
    top: -120px; right: -120px;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    pointer-events: none;
}
.v3-hero::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -80px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    pointer-events: none;
}
.v3-hero__inner { display: flex; align-items: center; gap: 60px; }
.v3-hero__content { flex: 1 1 0; color: #fff; }
.v3-kicker {
    display: inline-block;
    background: rgba(255,255,255,.2);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 18px;
}
.v3-hero__content h1 {
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: #fff;
}
.v3-hero__sub {
    font-size: 16px;
    line-height: 1.7;
    opacity: .9;
    margin-bottom: 32px;
    max-width: 480px;
}
.v3-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.v3-hero__note { font-size: 13px; opacity: .75; margin: 0; }

/* Hero step cards */
.v3-hero__steps { flex: 0 0 320px; display: flex; flex-direction: column; gap: 12px; }
.v3-step-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 12px;
    padding: 14px 18px;
    backdrop-filter: blur(6px);
    transition: background .2s;
}
.v3-step-card:hover { background: rgba(255,255,255,.22); }
.v3-step-card__icon {
    flex-shrink: 0;
    width: 42px; height: 42px;
    background: rgba(255,255,255,.25);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.v3-step-card__text { display: flex; flex-direction: column; gap: 2px; color: #fff; }
.v3-step-card__text strong { font-size: 14px; font-weight: 700; }
.v3-step-card__text span { font-size: 12px; opacity: .8; }

/* Section shared */
.v3-section { padding: 80px 0; }
.v3-section__header { text-align: center; margin-bottom: 48px; }
.v3-section__header h2 {
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 800;
    color: var(--v3-text);
    margin-bottom: 12px;
}
.v3-section__header p {
    font-size: 16px;
    color: var(--v3-muted);
    max-width: 540px;
    margin-inline: auto;
    line-height: 1.7;
}

/* Features grid */
.v3-features { background: #fff; }
.v3-features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.v3-feat-card {
    border: 1px solid var(--v3-card-border);
    border-radius: var(--v3-radius);
    padding: 28px 24px;
    transition: box-shadow .2s, border-color .2s, transform .2s;
    background: #fff;
}
.v3-feat-card:hover { box-shadow: 0 8px 28px rgba(26,158,240,.12); border-color: #b3d9f7; transform: translateY(-3px); }
.v3-feat-card__icon {
    width: 52px; height: 52px;
    background: var(--v3-blue-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-blue);
    margin-bottom: 16px;
}
.v3-feat-card h3 { font-size: 15px; font-weight: 700; color: var(--v3-text); margin-bottom: 8px; }
.v3-feat-card p { font-size: 13px; color: var(--v3-muted); line-height: 1.65; margin: 0; }

/* How it works */
.v3-how { background: #f8faff; }
.v3-how__steps { display: flex; align-items: flex-start; gap: 0; }
.v3-how__item { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 16px; }
.v3-how__circle {
    width: 72px; height: 72px;
    background: var(--v3-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 6px;
    box-shadow: 0 4px 18px rgba(26,158,240,.35);
}
.v3-how__num { font-size: 20px; font-weight: 800; color: var(--v3-blue); margin-bottom: 12px; }
.v3-how__item h3 { font-size: 15px; font-weight: 700; color: var(--v3-text); margin-bottom: 8px; }
.v3-how__item p { font-size: 13px; color: var(--v3-muted); line-height: 1.6; margin: 0; }
.v3-how__connector { flex: 0 0 40px; height: 2px; border-top: 2.5px dashed #b3d9f7; margin-top: 36px; align-self: flex-start; }

/* Stats */
.v3-stats { background: linear-gradient(135deg, #1a9ef0 0%, #1565c0 100%); padding: 64px 0; }
.v3-stats__title { text-align: center; color: #fff; font-size: clamp(20px, 2.5vw, 30px); font-weight: 800; margin-bottom: 44px; }
.v3-stats__grid { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.v3-stat {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--v3-radius);
    padding: 32px 48px;
    text-align: center;
    min-width: 200px;
    backdrop-filter: blur(6px);
}
.v3-stat strong { display: block; font-size: clamp(28px, 3vw, 40px); font-weight: 800; color: #fff; margin-bottom: 8px; }
.v3-stat span { font-size: 14px; color: rgba(255,255,255,.85); font-weight: 500; }

/* FAQ */
.v3-faq { background: #fff; }
.v3-faq__inner { max-width: 760px; }
.v3-faq__list { display: flex; flex-direction: column; gap: 12px; }
.v3-faq__item { border: 1px solid var(--v3-card-border); border-radius: var(--v3-radius); overflow: hidden; transition: border-color .2s; }
.v3-faq__item.open { border-color: #b3d9f7; }
.v3-faq__q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: start;
    font-size: 15px;
    font-weight: 600;
    color: var(--v3-text);
    transition: background .15s;
}
.v3-faq__q:hover { background: var(--v3-blue-light); }
.v3-faq__item.open .v3-faq__q { background: var(--v3-blue-light); color: var(--v3-blue); }
.v3-faq__chevron { flex-shrink: 0; color: var(--v3-muted); transition: transform .25s; }
.v3-faq__item.open .v3-faq__chevron { transform: rotate(180deg); color: var(--v3-blue); }
.v3-faq__a { padding: 0 20px 18px; }
.v3-faq__a p { font-size: 14px; color: var(--v3-muted); line-height: 1.7; margin: 0; }

/* Final CTA */
.v3-cta { background: linear-gradient(135deg, #1a9ef0 0%, #1565c0 100%); padding: 80px 0; }
.v3-cta__inner { text-align: center; }
.v3-cta h2 { font-size: clamp(24px, 3vw, 38px); font-weight: 800; color: #fff; margin-bottom: 14px; }
.v3-cta p { font-size: 16px; color: rgba(255,255,255,.85); margin-bottom: 32px; line-height: 1.7; }

/* Footer v3 */
.v3-footer { background: #0d1427; color: rgba(255,255,255,.75); }
.v3-footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-top: 56px;
    padding-bottom: 48px;
}
.v3-footer__logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    text-decoration: none;
    margin-bottom: 12px;
}
.v3-footer__logo .public-brand__icon { color: var(--v3-blue); }
.v3-footer__brand p { font-size: 13px; line-height: 1.7; color: rgba(255,255,255,.55); max-width: 280px; margin: 0; }
.v3-footer__col h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.4); margin-bottom: 16px; }
.v3-footer__col a { display: block; font-size: 14px; color: rgba(255,255,255,.7); text-decoration: none; margin-bottom: 10px; transition: color .15s; }
.v3-footer__col a:hover { color: #fff; }
.v3-footer__bar { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; }
.v3-footer__bar small { font-size: 12px; color: rgba(255,255,255,.35); }

/* RTL overrides */
[dir="rtl"] .v3-hero__inner { flex-direction: row-reverse; }
[dir="rtl"] .v3-hero__sub { margin-inline-start: 0; margin-inline-end: auto; }
[dir="rtl"] .v3-how__connector { transform: scaleX(-1); }
[dir="rtl"] .v3-faq__q { flex-direction: row-reverse; }

/* Responsive */
@media (max-width: 900px) {
    .v3-hero__inner { flex-direction: column !important; gap: 40px; }
    .v3-hero__steps { flex: none; width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .v3-features__grid { grid-template-columns: repeat(2, 1fr); }
    .v3-how__steps { flex-wrap: wrap; justify-content: center; gap: 32px; }
    .v3-how__connector { display: none; }
    .v3-how__item { flex: 0 0 calc(50% - 16px); }
    .v3-footer__inner { grid-template-columns: 1fr 1fr; }
    .v3-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
    .v3-hero { padding: 56px 0 64px; }
    .v3-hero__steps { grid-template-columns: 1fr; }
    .v3-hero__actions { flex-direction: column; }
    .v3-btn { width: 100%; justify-content: center; }
    .v3-features__grid { grid-template-columns: 1fr; }
    .v3-how__item { flex: 0 0 100%; }
    .v3-stats__grid { flex-direction: column; align-items: center; }
    .v3-stat { width: 100%; max-width: 320px; padding: 24px 32px; }
    .v3-footer__inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ============================================================
   Auth Pages — Premium Dark Theme
   Scoped to body.auth-page
   ============================================================ */

/* Full-page dark background */
body.auth-page {
    background: radial-gradient(ellipse 120% 80% at 30% -10%, rgba(37,99,235,.18) 0%, transparent 60%),
                radial-gradient(ellipse 80% 60% at 80% 110%, rgba(6,182,212,.1) 0%, transparent 60%),
                #080d1a;
    background-attachment: fixed;
}

body.auth-page .auth-wrapper {
    align-items: flex-start;
    min-height: 100vh;
    padding: 48px 16px 64px;
}

/* Card */
body.auth-page .auth-card {
    background: rgba(15, 22, 41, 0.96);
    border: 1px solid rgba(255,255,255,.09);
    color: #f1f5f9;
    position: relative;
    overflow: hidden;
}

/* Accent line at top of card */
body.auth-page .auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(80,223,250,.6), rgba(168,113,246,.4), transparent);
    pointer-events: none;
}

/* Logo area */
body.auth-page .auth-logo h1 { color: #fff; }
body.auth-page .auth-logo p  { color: rgba(255,255,255,.45); }

body.auth-page .brand-icon {
    background: linear-gradient(135deg, #50dffa 0%, #2c89e9 55%, #a871f6 100%);
    box-shadow: 0 0 28px rgba(80,223,250,.3);
    font-size: 22px;
    width: 54px;
    height: 54px;
    line-height: 54px;
}

/* Labels */
body.auth-page label {
    color: rgba(255,255,255,.65);
}

/* Inputs, selects, textarea */
body.auth-page input[type="text"],
body.auth-page input[type="email"],
body.auth-page input[type="url"],
body.auth-page input[type="password"],
body.auth-page input[type="number"],
body.auth-page input[type="tel"],
body.auth-page select,
body.auth-page textarea {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.13);
    color: #f1f5f9;
}

body.auth-page input::placeholder,
body.auth-page textarea::placeholder {
    color: rgba(255,255,255,.22);
}

body.auth-page input:focus,
body.auth-page select:focus,
body.auth-page textarea:focus {
    border-color: #2c89e9;
    background: rgba(44,137,233,.08);
    box-shadow: 0 0 0 3px rgba(44,137,233,.18);
}

body.auth-page select option {
    background: #1a2235;
    color: #f1f5f9;
}

body.auth-page small {
    color: rgba(255,255,255,.3);
}

/* Section dividers */
body.auth-page .form-section-label {
    color: rgba(255,255,255,.28);
    border-bottom-color: rgba(255,255,255,.08);
}

/* Phone code select */
body.auth-page .phone-code-select {
    background: rgba(8, 10, 22, .92) !important;
    border: 1px solid rgba(188, 165, 255, .18) !important;
    color: #fff !important;
    height: 48px !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px rgba(255, 255, 255, .035) !important;
    width: 112px !important;
    flex: 0 0 112px !important;
}

/* Password toggle */
body.auth-page .toggle-pw { color: rgba(255,255,255,.35); }
body.auth-page .toggle-pw:hover { color: rgba(255,255,255,.7); }

/* Alerts */
body.auth-page .alert-success {
    background: rgba(34,197,94,.1);
    border-color: rgba(34,197,94,.25);
    color: #86efac;
}
body.auth-page .alert-error {
    background: rgba(239,68,68,.1);
    border-color: rgba(239,68,68,.25);
    color: #fca5a5;
}

/* Field errors */
body.auth-page .field-error { color: #f87171; }

/* Submit button */
body.auth-page .btn-primary {
    background: linear-gradient(135deg, #2c89e9 0%, #a871f6 100%);
    box-shadow: 0 4px 18px rgba(80,223,250,.25);
    font-size: 15px;
    padding: 12px 20px;
    letter-spacing: .01em;
}
body.auth-page .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #50dffa 0%, #2c89e9 50%, #a871f6 100%);
    box-shadow: 0 8px 28px rgba(80,223,250,.35);
    transform: translateY(-1px);
    text-decoration: none;
}
body.auth-page .btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Footer link */
body.auth-page .auth-footer { color: rgba(255,255,255,.35); }
body.auth-page .auth-footer a { color: #50dffa; }
body.auth-page .auth-footer a:hover { color: #38ccfa; text-decoration: none; }

/* code element (ref code display) */
body.auth-page code {
    background: rgba(255,255,255,.1);
    color: #7dd3fc;
    border: 1px solid rgba(255,255,255,.15);
    font-size: 14px;
    padding: 3px 8px;
    border-radius: 6px;
}

/* ── Split layout (login page) ── */
body.auth-page .auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 880px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.07);
    box-shadow: 0 0 0 1px rgba(255,255,255,.03), 0 40px 100px rgba(0,0,0,.6);
}

body.auth-page .auth-panel {
    background: linear-gradient(160deg, #0c1633 0%, #101e40 100%);
    border-inline-end: 1px solid rgba(255,255,255,.07);
    padding: 56px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

body.auth-page .auth-panel::before {
    content: '';
    position: absolute;
    top: -120px; left: -120px;
    width: 440px; height: 440px;
    background: radial-gradient(circle, rgba(37,99,235,.22) 0%, transparent 65%);
    pointer-events: none;
}

body.auth-page .auth-panel::after {
    content: '';
    position: absolute;
    bottom: -80px; right: -80px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(6,182,212,.12) 0%, transparent 65%);
    pointer-events: none;
}

body.auth-page .auth-panel__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 52px;
    position: relative;
    z-index: 1;
}

body.auth-page .auth-panel__logo .brand-icon {
    width: 38px; height: 38px;
    font-size: 15px; line-height: 38px;
}

body.auth-page .auth-panel__logo-name {
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.02em;
}

body.auth-page .auth-panel h2 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -.025em;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

body.auth-page .auth-panel > p {
    font-size: 14px;
    color: rgba(255,255,255,.42);
    line-height: 1.7;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

body.auth-page .auth-panel__points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
}

body.auth-page .auth-panel__points li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,.55);
    line-height: 1.4;
}

body.auth-page .auth-panel__check {
    flex-shrink: 0;
    width: 20px; height: 20px;
    background: rgba(80,223,250,.12);
    border: 1px solid rgba(80,223,250,.3);
    border-radius: 50%;
    font-size: 10px;
    color: #50dffa;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.auth-page .auth-panel__form {
    background: rgba(10, 17, 36, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 52px 44px;
}

body.auth-page .auth-panel__form .auth-card {
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    max-width: 340px;
    width: 100%;
}

body.auth-page .auth-panel__form .auth-card::before { display: none; }

/* RTL: flip panel order */
[dir="rtl"] body.auth-page .auth-panel {
    border-inline-end: none;
    border-inline-start: 1px solid rgba(255,255,255,.07);
}

/* Mobile split → stack */
@media (max-width: 700px) {
    body.auth-page .auth-split {
        grid-template-columns: 1fr;
        border-radius: 16px;
    }
    body.auth-page .auth-panel { padding: 36px 28px; }
    body.auth-page .auth-panel h2 { font-size: 22px; }
    body.auth-page .auth-panel__logo { margin-bottom: 32px; }
    body.auth-page .auth-panel > p { margin-bottom: 24px; }
    body.auth-page .auth-panel__points { display: none; }
    body.auth-page .auth-panel__form { padding: 36px 28px; }
}

/* ============================================================
   Light-mode overrides — auth pages (login, register)
   ============================================================ */
[data-theme="light"] body.auth-page {
    background: radial-gradient(ellipse 120% 80% at 30% -10%, rgba(37,99,235,.08) 0%, transparent 60%),
                radial-gradient(ellipse 80% 60% at 80% 110%, rgba(6,182,212,.05) 0%, transparent 60%),
                #f1f5f9;
}

[data-theme="light"] body.auth-page .auth-card {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

[data-theme="light"] body.auth-page .auth-card::before {
    background: linear-gradient(90deg, transparent, rgba(37,99,235,.3), transparent);
}

[data-theme="light"] body.auth-page .auth-logo h1 { color: #1e293b; }
[data-theme="light"] body.auth-page .auth-logo p  { color: #64748b; }

[data-theme="light"] body.auth-page label { color: #374151; }

[data-theme="light"] body.auth-page input[type="text"],
[data-theme="light"] body.auth-page input[type="email"],
[data-theme="light"] body.auth-page input[type="url"],
[data-theme="light"] body.auth-page input[type="password"],
[data-theme="light"] body.auth-page input[type="number"],
[data-theme="light"] body.auth-page input[type="tel"],
[data-theme="light"] body.auth-page select,
[data-theme="light"] body.auth-page textarea {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

[data-theme="light"] body.auth-page input::placeholder,
[data-theme="light"] body.auth-page textarea::placeholder { color: #94a3b8; }

[data-theme="light"] body.auth-page input:focus,
[data-theme="light"] body.auth-page select:focus,
[data-theme="light"] body.auth-page textarea:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

[data-theme="light"] body.auth-page select option {
    background: #ffffff;
    color: #1e293b;
}

[data-theme="light"] body.auth-page small { color: #64748b; }

[data-theme="light"] body.auth-page .form-section-label {
    color: #94a3b8;
    border-bottom-color: #e2e8f0;
}

[data-theme="light"] body.auth-page .phone-code-select {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

[data-theme="light"] body.auth-page .toggle-pw { color: #94a3b8; }
[data-theme="light"] body.auth-page .toggle-pw:hover { color: #475569; }

[data-theme="light"] body.auth-page .alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
[data-theme="light"] body.auth-page .alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

[data-theme="light"] body.auth-page .field-error { color: #dc2626; }

[data-theme="light"] body.auth-page .auth-footer { color: #64748b; }
[data-theme="light"] body.auth-page .auth-footer a { color: #2c89e9; }
[data-theme="light"] body.auth-page .auth-footer a:hover { color: #1a6cc0; }

[data-theme="light"] body.auth-page code {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

[data-theme="light"] body.auth-page .auth-split {
    border-color: #e2e8f0;
    box-shadow: 0 4px 32px rgba(0,0,0,.08);
}

[data-theme="light"] body.auth-page .auth-panel {
    background: linear-gradient(160deg, #061830 0%, #0e2250 50%, #1c1040 100%);
    border-inline-end-color: rgba(255,255,255,.12);
}

[data-theme="light"] body.auth-page .auth-panel__form {
    background: #ffffff;
}

/* ============================================================
   Dark-mode overrides — old landing-page (privacy, terms, cookies)
   ============================================================ */
[data-theme="dark"] body.landing-page {
    background: #080d1a;
    color: #cbd5e1;
}

/* ── Public header — dark mode (all public pages) ───────────────── */
[data-theme="dark"] .public-header {
    background: rgba(8,13,26,.92);
    border-bottom-color: rgba(255,255,255,.07);
}
[data-theme="dark"] .public-brand { color: #f1f5f9; }
[data-theme="dark"] .public-nav a { color: #94a3b8; }
[data-theme="dark"] .public-nav a:hover {
    background: rgba(255,255,255,.06);
    color: #e2e8f0 !important;
}
[data-theme="dark"] .public-menu-toggle {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.12);
}
[data-theme="dark"] .public-menu-toggle span { background: #e2e8f0; }
[data-theme="dark"] .pub-drawer__head { border-bottom-color: rgba(255,255,255,.07); }
[data-theme="dark"] .pub-drawer__links a { color: #94a3b8; }
[data-theme="dark"] .pub-drawer__links a:hover { background: rgba(255,255,255,.06); color: #fff !important; }
[data-theme="dark"] .pub-drawer__meta { border-top-color: rgba(255,255,255,.07); }
[data-theme="dark"] .pub-drawer__footer { border-top-color: rgba(255,255,255,.07); }
[data-theme="dark"] .pub-drawer__login { color: #e2e8f0; border-color: rgba(255,255,255,.12); }
[data-theme="dark"] .pub-overlay { background: rgba(0,0,0,.65); }

/* Public footer */
[data-theme="dark"] body.landing-page .public-footer {
    background: #050a14;
    border-top-color: rgba(255,255,255,.07);
}
[data-theme="dark"] body.landing-page .public-footer__brand p { color: #475569; }
[data-theme="dark"] body.landing-page .public-footer__col h4 { color: #e2e8f0; }
[data-theme="dark"] body.landing-page .public-footer__col a { color: #64748b; }
[data-theme="dark"] body.landing-page .public-footer__col a:hover { color: #93c5fd; }
[data-theme="dark"] body.landing-page .public-footer__bar {
    border-top-color: rgba(255,255,255,.06);
    color: #475569;
}

/* Legal sections */
[data-theme="dark"] .legal-hero {
    background: linear-gradient(145deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 12px 24px rgba(0,0,0,.35);
}
[data-theme="dark"] .legal-hero h1 { color: #f1f5f9; }
[data-theme="dark"] .legal-hero > p { color: #94a3b8; }

[data-theme="dark"] .legal-toc {
    background: #0d1427;
    border-color: rgba(255,255,255,.07);
}
[data-theme="dark"] .legal-toc h3 { color: #e2e8f0; }
[data-theme="dark"] .legal-toc a {
    border-color: rgba(255,255,255,.07);
    color: #94a3b8;
}
[data-theme="dark"] .legal-toc a:hover {
    border-color: rgba(59,130,246,.35);
    background: rgba(59,130,246,.08);
    color: #93c5fd;
}

[data-theme="dark"] .legal-content {
    background: #0d1427;
    border-color: rgba(255,255,255,.07);
}
[data-theme="dark"] .legal-summary {
    background: rgba(59,130,246,.06);
    border-color: rgba(59,130,246,.18);
}
[data-theme="dark"] .legal-summary h2 { color: #e2e8f0; }
[data-theme="dark"] .legal-summary p { color: #94a3b8; }

[data-theme="dark"] .legal-section { border-top-color: rgba(255,255,255,.06); }
[data-theme="dark"] .legal-section h2 { color: #f1f5f9; }
[data-theme="dark"] .legal-section p { color: #94a3b8; }

[data-theme="dark"] .legal-updated { color: #64748b; }

/* Legal bullets */
.legal-bullets {
    margin: 10px 0 4px 20px;
    display: grid;
    gap: 6px;
    color: #4f6b8e;
    line-height: 1.65;
    font-size: 14px;
}
[dir="rtl"] .legal-bullets { margin-left: 0; margin-right: 20px; }
[data-theme="dark"] .legal-bullets { color: #94a3b8; }

/* Legal note box */
.legal-note {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    background: #eef6ff;
    border: 1px solid #c3ddf8;
    color: #1e4d8c;
    font-size: 13px;
    line-height: 1.65;
}
[data-theme="dark"] .legal-note {
    background: rgba(44,137,233,.07);
    border-color: rgba(44,137,233,.22);
    color: #93c5fd;
}

/* ============================================================
   Private Gaming UI — dark-only shell and shared components
   Scoped to authenticated app shells and auth pages only.
   Public landing/legal/profile pages remain outside this layer.
   ============================================================ */

body:has(.app-layout),
body.auth-page {
    --bg: #070a12;
    --bg-card: #101827;
    --surface: #141e31;
    --sidebar-bg: #060913;
    --white: #101827;
    --text: #f5f8ff;
    --text-muted: #8b9ab8;
    --border: rgba(148, 163, 184, .16);
    --primary: #37d5ff;
    --primary-dk: #18aee4;
    --success: #37f0a1;
    --warning: #f8c14f;
    --danger: #ff5f7a;
    --card-radius: 12px;
    --private-glow: 0 18px 48px rgba(0, 0, 0, .38);
    background:
        radial-gradient(circle at 18% -12%, rgba(55, 213, 255, .12), transparent 32%),
        radial-gradient(circle at 78% 0%, rgba(248, 193, 79, .08), transparent 26%),
        linear-gradient(180deg, #090d17 0%, #070a12 100%);
    color: var(--text);
    color-scheme: dark;
}

body:has(.app-layout) .theme-toggle,
body.auth-page .theme-toggle {
    display: none !important;
}

body:has(.app-layout) .app-layout {
    min-height: 100vh;
}

body:has(.app-layout) .main-content {
    background:
        radial-gradient(circle at 12% 4%, rgba(55, 213, 255, .075), transparent 28%), 
        radial-gradient(circle at 80% 40%, rgba(124, 92, 255, .08), transparent 24%), 
        transparent
}

body:has(.app-layout) .sidebar {
    background:
        linear-gradient(180deg, rgba(14, 20, 36, .98), rgba(5, 8, 18, .98)),
        radial-gradient(circle at 50% 0%, rgba(55, 213, 255, .14), transparent 36%);
    border-right: 1px solid rgba(148, 163, 184, .12);
    box-shadow: 18px 0 48px rgba(0, 0, 0, .28);
}

[dir="rtl"] body:has(.app-layout) .sidebar {
    border-right: 0;
    border-left: 1px solid rgba(148, 163, 184, .12);
    box-shadow: -18px 0 48px rgba(0, 0, 0, .28);
}

body:has(.app-layout) .sidebar-brand {
    border-bottom: 1px solid rgba(148, 163, 184, .1);
}

body:has(.app-layout) .sidebar-brand .brand-icon {
    background: linear-gradient(135deg, #37d5ff, #7c5cff) !important;
    color: #050816;
    box-shadow: 0 0 22px rgba(55, 213, 255, .28);
}

body:has(.app-layout) .sidebar-brand .brand-name {
    color: #fff;
    letter-spacing: 0;
}

body:has(.app-layout) .nav-links a {
    border: 1px solid transparent;
    border-radius: 10px;
    color: #8b9ab8;
}

body:has(.app-layout) .nav-links a:hover {
    background: rgba(55, 213, 255, .075);
    border-color: rgba(55, 213, 255, .12);
    color: #e9f7ff;
}

body:has(.app-layout) .nav-links li.active a {
    background: linear-gradient(135deg, rgba(55, 213, 255, .18), rgba(124, 92, 255, .16));
    border-color: rgba(55, 213, 255, .28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 10px 24px rgba(55, 213, 255, .08);
    color: #fff;
}

body:has(.app-layout) .nav-icon {
    color: #37d5ff;
}

body:has(.app-layout) .sidebar-footer {
    border-top-color: rgba(148, 163, 184, .1);
}

body:has(.app-layout) .ref-pill {
    background: rgba(15, 23, 42, .82);
    border: 1px solid rgba(148, 163, 184, .14);
    color: #8b9ab8;
}

body:has(.app-layout) .top-header {
    background: rgba(7, 10, 18, .78);
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    box-shadow: 0 10px 34px rgba(0, 0, 0, .22);
    backdrop-filter: blur(16px);
}

body:has(.app-layout) .header-btn,
body:has(.app-layout) .menu-toggle {
    background: rgba(16, 24, 39, .86);
    border: 1px solid rgba(148, 163, 184, .16);
    color: #cbd5e1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body:has(.app-layout) .header-btn:hover,
body:has(.app-layout) .menu-toggle:hover {
    background: rgba(55, 213, 255, .1);
    border-color: rgba(55, 213, 255, .24);
    color: #fff;
}

body:has(.app-layout) .user-avatar-btn,
body:has(.app-layout) .user-dropdown__avatar {
    background: linear-gradient(135deg, #37d5ff, #7c5cff) !important;
    color: #05101d;
    box-shadow: 0 0 22px rgba(55, 213, 255, .22);
}

body:has(.app-layout) .user-dropdown,
body:has(.app-layout) .notif-panel {
    background: rgba(12, 18, 31, .98);
    border: 1px solid rgba(148, 163, 184, .16);
    box-shadow: 0 20px 55px rgba(0, 0, 0, .45);
    border-radius: 12px;
}

body:has(.app-layout) .user-dropdown__header,
body:has(.app-layout) .notif-panel__header {
    border-bottom-color: rgba(148, 163, 184, .12);
}

body:has(.app-layout) .user-dropdown__item,
body:has(.app-layout) .notif-item {
    color: #dbe7ff;
}

body:has(.app-layout) .user-dropdown__item:hover,
body:has(.app-layout) .notif-item:hover {
    background: rgba(55, 213, 255, .08);
}

body:has(.app-layout) .page-header {
    position: relative;
    padding: 22px 24px;
    margin-bottom: 22px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background:
        radial-gradient(circle at 15% 0%, rgba(55, 213, 255, .14), transparent 30%),
        linear-gradient(135deg, rgba(16, 24, 39, .94), rgba(11, 16, 28, .92));
    box-shadow: var(--private-glow);
}

body:has(.app-layout) .page-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .045), transparent);
    pointer-events: none;
}

body:has(.app-layout) .page-header h2 {
    color: #fff;
    font-weight: 900;
}

body:has(.app-layout) .page-header p {
    color: #8b9ab8;
}

body:has(.app-layout) .stats-grid {
    gap: 16px;
}

body:has(.app-layout) .stat-card,
body:has(.app-layout) .table-card,
body:has(.app-layout) .settings-card,
body.auth-page .auth-card,
body.auth-page .auth-split {
    background:
        linear-gradient(180deg, rgba(18, 27, 45, .96), rgba(11, 16, 28, .98));
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .28);
    color: var(--text);
}

body:has(.app-layout) .stat-card {
    overflow: hidden;
}

body:has(.app-layout) .stat-card::after {
    background: linear-gradient(90deg, transparent, rgba(55, 213, 255, .5), transparent);
}

body:has(.app-layout) .stat-card__label,
body:has(.app-layout) .stat-label,
body:has(.app-layout) .settings-card__title {
    color: #8b9ab8;
    letter-spacing: .04em;
}

body:has(.app-layout) .stat-card__value,
body:has(.app-layout) .stat-value,
body:has(.app-layout) .table-card__title,
body:has(.app-layout) .settings-card__title {
    color: #fff;
}

body:has(.app-layout) .table-card__header,
body:has(.app-layout) .settings-card__title {
    background: rgba(255, 255, 255, .018);
    border-bottom-color: rgba(148, 163, 184, .12);
}

body:has(.app-layout) .range-tabs {
    gap: 6px;
}

body:has(.app-layout) .range-tab {
    background: rgba(16, 24, 39, .9);
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 10px;
    color: #8b9ab8;
}

body:has(.app-layout) .range-tab:hover,
body:has(.app-layout) .range-tab.active {
    background: rgba(55, 213, 255, .12);
    border-color: rgba(55, 213, 255, .28);
    color: #fff;
    box-shadow: 0 0 22px rgba(55, 213, 255, .08);
}

body:has(.app-layout) table {
    color: var(--text);
}

body:has(.app-layout) th {
    background: rgba(255, 255, 255, .035);
    color: #8b9ab8;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
}

body:has(.app-layout) td {
    border-bottom: 1px solid rgba(148, 163, 184, .08);
}

body:has(.app-layout) tbody tr:hover {
    background: rgba(55, 213, 255, .055);
}

body:has(.app-layout) input[type="text"],
body:has(.app-layout) input[type="email"],
body:has(.app-layout) input[type="url"],
body:has(.app-layout) input[type="password"],
body:has(.app-layout) input[type="number"],
body:has(.app-layout) input[type="date"],
body:has(.app-layout) input[type="tel"],
body:has(.app-layout) select,
body:has(.app-layout) textarea,
body.auth-page input[type="text"],
body.auth-page input[type="email"],
body.auth-page input[type="url"],
body.auth-page input[type="password"],
body.auth-page input[type="number"],
body.auth-page input[type="tel"],
body.auth-page select,
body.auth-page textarea {
    background: rgba(5, 10, 20, .82);
    border: 1px solid rgba(148, 163, 184, .16);
    color: #f5f8ff;
    border-radius: 10px;
    color-scheme: dark;
}

body:has(.app-layout) input:focus,
body:has(.app-layout) select:focus,
body:has(.app-layout) textarea:focus,
body.auth-page input:focus,
body.auth-page select:focus,
body.auth-page textarea:focus {
    border-color: rgba(55, 213, 255, .58);
    box-shadow: 0 0 0 3px rgba(55, 213, 255, .12);
    background: rgba(7, 13, 26, .96);
}

body:has(.app-layout) input::placeholder,
body:has(.app-layout) textarea::placeholder,
body.auth-page input::placeholder,
body.auth-page textarea::placeholder {
    color: #53627d;
}

body:has(.app-layout) label,
body.auth-page label {
    color: #cbd5e1;
}

body:has(.app-layout) small,
body.auth-page small {
    color: #8b9ab8;
}

body:has(.app-layout) .btn,
body.auth-page .btn {
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 800;
}

body:has(.app-layout) .btn-primary,
body.auth-page .btn-primary {
    background: linear-gradient(135deg, #37d5ff, #7c5cff);
    color: #06101d;
    box-shadow: 0 10px 24px rgba(55, 213, 255, .18);
}

body:has(.app-layout) .btn-primary:hover:not(:disabled),
body.auth-page .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #61e0ff, #8e73ff);
}

body:has(.app-layout) .btn-outline,
body.auth-page .btn-outline {
    background: rgba(16, 24, 39, .72);
    border-color: rgba(55, 213, 255, .36);
    color: #8fe9ff;
}

body:has(.app-layout) .btn-danger,
body.auth-page .btn-danger {
    background: linear-gradient(135deg, #ff5f7a, #a855f7);
}

body:has(.app-layout) .btn-success {
    background: linear-gradient(135deg, #37f0a1, #37d5ff);
    color: #06101d;
}

body:has(.app-layout) .badge {
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    font-weight: 800;
}

body:has(.app-layout) .badge-success { background: rgba(55, 240, 161, .12); color: #73ffc4; }
body:has(.app-layout) .badge-warning { background: rgba(248, 193, 79, .12); color: #ffd36f; }
body:has(.app-layout) .badge-danger  { background: rgba(255, 95, 122, .12); color: #ff8da1; }
body:has(.app-layout) .badge-info    { background: rgba(55, 213, 255, .12); color: #8fe9ff; }
body:has(.app-layout) .badge-muted   { background: rgba(148, 163, 184, .12); color: #cbd5e1; }

body:has(.app-layout) .alert,
body.auth-page .alert {
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    background: rgba(16, 24, 39, .9);
}

body:has(.app-layout) .alert-success,
body.auth-page .alert-success { color: #73ffc4; border-color: rgba(55, 240, 161, .24); }
body:has(.app-layout) .alert-error,
body.auth-page .alert-error { color: #ff8da1; border-color: rgba(255, 95, 122, .24); }
body:has(.app-layout) .alert-warning,
body.auth-page .alert-warning { color: #ffd36f; border-color: rgba(248, 193, 79, .24); }
body:has(.app-layout) .alert-info,
body.auth-page .alert-info { color: #8fe9ff; border-color: rgba(55, 213, 255, .24); }

body:has(.app-layout) .empty-state,
body:has(.app-layout) .notif-empty {
    color: #8b9ab8;
}

body:has(.app-layout) .modal-box,
body:has(.app-layout) .art-modal {
    background: #101827;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .52);
}

body:has(.app-layout) .art-modal-overlay {
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(4px);
}

body:has(.app-layout) canvas {
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .16));
}

body.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(55, 213, 255, .16), transparent 32%),
        radial-gradient(circle at 78% 10%, rgba(124, 92, 255, .12), transparent 30%),
        #070a12;
}

body.auth-page .auth-wrapper {
    background: transparent;
}

body.auth-page .auth-panel {
    background:
        radial-gradient(circle at 20% 0%, rgba(55, 213, 255, .16), transparent 35%),
        linear-gradient(160deg, #08101f 0%, #111a2f 52%, #160b2c 100%);
    border-color: rgba(148, 163, 184, .14);
}

body.auth-page .auth-panel__form {
    background: rgba(7, 10, 18, .82);
}

body.auth-page .auth-logo h1,
body.auth-page .auth-panel h2 {
    color: #fff;
}

body.auth-page .auth-logo p,
body.auth-page .auth-panel p,
body.auth-page .auth-footer,
body.auth-page .form-section-label {
    color: #8b9ab8;
}

body.auth-page .auth-footer a {
    color: #8fe9ff;
}

@media (max-width: 768px) {
    body:has(.app-layout) .sidebar {
        box-shadow: 18px 0 48px rgba(0, 0, 0, .45);
    }

    [dir="rtl"] body:has(.app-layout) .sidebar {
        box-shadow: -18px 0 48px rgba(0, 0, 0, .45);
    }
}

/* Private page cleanup for legacy inline-heavy views */
body:has(.app-layout) pre,
body:has(.app-layout) code {
    background: rgba(5, 10, 20, .86) !important;
    border: 1px solid rgba(148, 163, 184, .14);
    color: #dbeafe !important;
}

body:has(.app-layout) [style*="background:#f0fff4"],
body:has(.app-layout) [style*="background: #f0fff4"],
body:has(.app-layout) [style*="background:#fff5f5"],
body:has(.app-layout) [style*="background: #fff5f5"],
body:has(.app-layout) [style*="background:#fffbeb"],
body:has(.app-layout) [style*="background: #fffbeb"],
body:has(.app-layout) [style*="background:#f8fafc"],
body:has(.app-layout) [style*="background: #f8fafc"],
body:has(.app-layout) [style*="background:#f1f5f9"],
body:has(.app-layout) [style*="background: #f1f5f9"] {
    background: rgba(16, 24, 39, .74) !important;
    border: 1px solid rgba(148, 163, 184, .12);
    color: var(--text) !important;
}

body:has(.app-layout) [style*="background:rgba(245,158,11"],
body:has(.app-layout) [style*="background: rgba(245,158,11"],
body:has(.app-layout) [style*="background:rgba(239,68,68"],
body:has(.app-layout) [style*="background: rgba(239,68,68"],
body:has(.app-layout) [style*="background:rgba(59,130,246"],
body:has(.app-layout) [style*="background: rgba(59,130,246"] {
    background: rgba(16, 24, 39, .74) !important;
    border: 1px solid rgba(148, 163, 184, .12);
}

body:has(.app-layout) [style*="background:rgba(0,0,0"],
body:has(.app-layout) [style*="background: rgba(0,0,0"] {
    background: rgba(0, 0, 0, .72) !important;
    backdrop-filter: blur(4px);
}

body:has(.app-layout) [style*="background:var(--bg-card)"],
body:has(.app-layout) [style*="background: var(--bg-card)"],
body:has(.app-layout) [style*="background:var(--surface)"],
body:has(.app-layout) [style*="background: var(--surface)"],
body:has(.app-layout) [style*="background:var(--white)"],
body:has(.app-layout) [style*="background: var(--white)"] {
    background:
        linear-gradient(180deg, rgba(18, 27, 45, .98), rgba(11, 16, 28, .98)) !important;
    border-color: rgba(148, 163, 184, .14) !important;
    color: var(--text) !important;
}

body:has(.app-layout) .form-row {
    gap: 16px;
}

body:has(.app-layout) .field-error {
    color: #ff8da1;
}

body:has(.app-layout) .td-right,
body:has(.app-layout) .td-left {
    color: inherit;
}

body:has(.app-layout) .loading {
    border-color: rgba(55, 213, 255, .22);
    border-top-color: #37d5ff;
}

body:has(.app-layout) .pagination a,
body:has(.app-layout) .pagination button,
body:has(.app-layout) .pagination span {
    background: rgba(16, 24, 39, .78);
    border-color: rgba(148, 163, 184, .14);
    color: #cbd5e1;
}

/* Premium glass gaming refinement */
body:has(.app-layout),
body.auth-page {
    --bg: #060510;
    --bg-card: rgba(12, 11, 24, .78);
    --surface: rgba(16, 14, 32, .82);
    --sidebar-bg: rgba(8, 7, 18, .78);
    --white: rgba(12, 11, 24, .78);
    --border: rgba(188, 165, 255, .16);
    --primary: #a98cff;
    --primary-dk: #7f5dff;
    --private-glow: 0 22px 70px rgba(0, 0, 0, .42);
    background:
        radial-gradient(circle at 34% -10%, rgba(126, 58, 242, .42), transparent 22%),
        radial-gradient(circle at 74% -8%, rgba(168, 85, 247, .34), transparent 24%),
        radial-gradient(circle at 54% 8%, rgba(55, 213, 255, .08), transparent 28%),
        linear-gradient(180deg, #080417 0%, #060510 48%, #05040c 100%);
}

body:has(.app-layout)::before,
body.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,.014) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 78%, transparent);
    opacity: .28;
    z-index: -1;
}

body:has(.app-layout) .sidebar {
    margin: 20px 0 20px 20px;
    height: calc(100vh - 40px);
    border: 1px solid rgba(188, 165, 255, .14);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(10, 9, 24, .82), rgba(6, 5, 14, .88));
    box-shadow: inset 1px 0 rgba(255,255,255,.04), 0 24px 80px rgba(0,0,0,.42);
    backdrop-filter: blur(20px);
}

[dir="rtl"] body:has(.app-layout) .sidebar {
    margin: 20px 20px 20px 0;
}

body:has(.app-layout) .main-content {
    padding-top: calc(var(--header-h) + 40px);
}

body:has(.app-layout) .top-header {
    top: 20px;
    left: calc(var(--sidebar-w) + 32px);
    right: 20px;
    width: auto;
    border: 1px solid rgba(188, 165, 255, .14);
    border-radius: 18px;
    background: rgba(10, 9, 24, .62);
    box-shadow: 0 18px 60px rgba(0,0,0,.32);
    backdrop-filter: blur(22px);
}

[dir="rtl"] body:has(.app-layout) .top-header {
    right: calc(var(--sidebar-w) + 32px);
    left: 20px;
}

body:has(.app-layout) .page-header,
body:has(.app-layout) .stat-card,
body:has(.app-layout) .table-card,
body:has(.app-layout) .settings-card,
body.auth-page .auth-card,
body.auth-page .auth-split {
    background: linear-gradient(180deg, rgba(18, 16, 36, .78), rgba(9, 8, 20, .86));
    border: 1px solid rgba(188, 165, 255, .14);
    box-shadow: 0 24px 70px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.045);
    backdrop-filter: blur(18px);
}

body:has(.app-layout) .page-header {
    background:
        radial-gradient(circle at 18% 0%, rgba(169, 140, 255, .2), transparent 28%),
        linear-gradient(180deg, rgba(18, 16, 36, .78), rgba(9, 8, 20, .86));
}

body:has(.app-layout) .nav-links li.active a {
    background: linear-gradient(90deg, rgba(169, 140, 255, .22), rgba(169, 140, 255, .06));
    border-color: rgba(188, 165, 255, .22);
    box-shadow: inset 0 1px rgba(255,255,255,.05), 0 12px 32px rgba(127, 93, 255, .16);
}

body:has(.app-layout) .nav-icon,
body:has(.app-layout) .stat-card--primary .stat-card__value {
    color: #bca5ff;
}

body:has(.app-layout) .header-btn,
body:has(.app-layout) .menu-toggle,
body:has(.app-layout) .range-tab {
    background: rgba(12, 11, 24, .74);
    border-color: rgba(188, 165, 255, .16);
}

body:has(.app-layout) .range-tab.active,
body:has(.app-layout) .range-tab:hover {
    background: linear-gradient(135deg, rgba(169, 140, 255, .22), rgba(55, 213, 255, .08));
    border-color: rgba(188, 165, 255, .28);
}

body:has(.app-layout) th {
    background: rgba(255,255,255,.045);
}

body:has(.app-layout) tbody tr {
    background: rgba(255,255,255,.008);
}

body:has(.app-layout) tbody tr:hover {
    background: rgba(169, 140, 255, .07);
}

body:has(.app-layout) .btn-primary,
body.auth-page .btn-primary {
    background: linear-gradient(135deg, #bca5ff, #7f5dff);
    color: #080417;
    box-shadow: 0 12px 34px rgba(127, 93, 255, .24);
}

body:has(.app-layout) .btn-outline,
body.auth-page .btn-outline {
    border-color: rgba(188, 165, 255, .34);
    color: #d7ccff;
}

body:has(.app-layout) input[type="text"],
body:has(.app-layout) input[type="email"],
body:has(.app-layout) input[type="url"],
body:has(.app-layout) input[type="password"],
body:has(.app-layout) input[type="number"],
body:has(.app-layout) input[type="date"],
body:has(.app-layout) input[type="tel"],
body:has(.app-layout) select,
body:has(.app-layout) textarea,
body.auth-page input[type="text"],
body.auth-page input[type="email"],
body.auth-page input[type="url"],
body.auth-page input[type="password"],
body.auth-page input[type="number"],
body.auth-page input[type="tel"],
body.auth-page select,
body.auth-page textarea {
    background: rgba(6, 5, 14, .72);
    border-color: rgba(188, 165, 255, .15);
}

body:has(.app-layout) input:focus,
body:has(.app-layout) select:focus,
body:has(.app-layout) textarea:focus,
body.auth-page input:focus,
body.auth-page select:focus,
body.auth-page textarea:focus {
    border-color: rgba(188, 165, 255, .58);
    box-shadow: 0 0 0 3px rgba(169, 140, 255, .14);
}

body:has(.app-layout) .user-dropdown,
body:has(.app-layout) .notif-panel {
    background: rgba(10, 9, 24, .94);
    border-color: rgba(188, 165, 255, .16);
    backdrop-filter: blur(20px);
}

@media (max-width: 768px) {
    body:has(.app-layout) .sidebar {
        margin: 0;
        height: 100vh;
        border-radius: 0;
    }

    body:has(.app-layout) .top-header {
        top: 8px;
        left: 8px;
        right: 8px;
    }

    [dir="rtl"] body:has(.app-layout) .top-header {
        left: 8px;
        right: 8px;
    }

    body:has(.app-layout) .main-content {
        padding-top: calc(var(--header-h) + 24px);
    }
}

/* Canonical shared leaderboard component */
body:has(.app-layout) .glb-wrap {
    position: relative;
    margin: 16px 0 24px;
    padding: 34px 28px 18px;
    border: 1px solid rgba(188, 165, 255, .14);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% -18%, rgba(169, 140, 255, .16), transparent 34%),
        radial-gradient(circle at 82% 8%, rgba(55, 213, 255, .08), transparent 28%),
        linear-gradient(180deg, rgba(18, 16, 36, .82), rgba(9, 8, 20, .9));
    box-shadow: 0 24px 70px rgba(0, 0, 0, .34), inset 0 1px rgba(255, 255, 255, .045);
    backdrop-filter: blur(18px);
    overflow: hidden;
    color: #fff;
}

body:has(.app-layout) .glb-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 16% 0%, rgba(188, 165, 255, .14), transparent 28%),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, .03), transparent);
    pointer-events: none;
}

body:has(.app-layout) .glb-header {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 0 34px;
    border: 0;
    background: transparent;
    direction: inherit;
}

body:has(.app-layout) .glb-header__left {
    display: none;
}

body:has(.app-layout) .glb-tabs {
    display: flex;
    gap: 0;
    padding: 4px;
    background: rgba(5, 5, 14, .68);
    border: 1px solid rgba(188, 165, 255, .16);
    border-radius: 8px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .28);
}

body:has(.app-layout) .glb-tab {
    min-width: 92px;
    padding: 8px 18px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #cbd5e1;
    font-size: .75rem;
    font-weight: 800;
    cursor: pointer;
}

body:has(.app-layout) .glb-tab--active {
    background: linear-gradient(135deg, rgba(169, 140, 255, .24), rgba(55, 213, 255, .1));
    border: 1px solid rgba(188, 165, 255, .22);
    color: #fff;
    box-shadow: 0 0 18px rgba(127, 93, 255, .18);
}

body:has(.app-layout) .glb-podium {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1.12fr 1fr;
    align-items: end;
    gap: 38px;
    min-height: 360px;
    max-width: none;
    margin: 0;
    padding: 0 8px 12px;
    background: transparent;
    direction: ltr;
    width: 100%;
    max-width: 800px !important;
    align-self: center;
    justify-self: center;
}

body:has(.app-layout) .glb-pcard {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 210px;
    padding: 0 0 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

body:has(.app-layout) .glb-pcard:hover {
    transform: none;
}

body:has(.app-layout) .glb-pcard--1 { order: 2; min-height: 300px; }
body:has(.app-layout) .glb-pcard--2 { order: 1; min-height: 245px; }
body:has(.app-layout) .glb-pcard--3 { order: 3; min-height: 225px; }

body:has(.app-layout) .glb-stage {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 142px;
    background: linear-gradient(180deg, rgba(35, 31, 58, .96) 0%, rgba(18, 16, 36, .96) 54%, rgba(9, 8, 20, .58) 100%);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, .035), inset 0 1px rgba(255, 255, 255, .04);
}

body:has(.app-layout) .glb-pcard--1 .glb-stage {
    height: 168px;
}

body:has(.app-layout) .glb-stage::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 34px;
    height: 1px;
    background: rgba(188, 165, 255, .12);
}

body:has(.app-layout) .glb-avatar {
    position: relative;
    z-index: 2;
    width: 96px;
    height: 96px;
    margin: 0 auto 10px;
    border: 0;
    border-radius: 10px;
    background: #211f34;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .28);
}

body:has(.app-layout) .glb-pcard--1 .glb-avatar {
    width: 112px;
    height: 112px;
}

body:has(.app-layout) .glb-avatar img {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

body:has(.app-layout) .glb-pname {
    position: relative;
    z-index: 2;
    font-size: 1.05rem;
    font-weight: 900;
    color: #fff;
    text-shadow: none;
    margin: 0 0 24px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body:has(.app-layout) .glb-pcard--1 .glb-pname {
    font-size: 1.2rem;
}

body:has(.app-layout) .glb-trophy-box {
    position: relative;
    z-index: 2;
    width: 48px;
    height: 44px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    border-radius: 8px;
    background: #bca5ff;
    color: #080417;
    font-size: 1.25rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .25);
}

body:has(.app-layout) .glb-pcard--2 .glb-trophy-box,
body:has(.app-layout) .glb-pcard--3 .glb-trophy-box {
    background: #c9ced8;
}

body:has(.app-layout) .glb-prize {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 4px;
}

body:has(.app-layout) .glb-prize::before {
    content: "$";
    display: inline-block;
    margin-inline-end: 4px;
    color: #37d5ff;
    font-weight: 900;
}

body:has(.app-layout) .glb-prize-label {
    position: relative;
    z-index: 2;
    font-size: .78rem;
    color: rgba(255, 255, 255, .76);
}

body:has(.app-layout) .glb-rows {
    position: relative;
    z-index: 2;
    display: block;
    max-width: none;
    margin: 28px 0 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    direction: inherit;
}

body:has(.app-layout) .glb-rows::before {
    display: none;
}

body:has(.app-layout) .glb-table-head,
body:has(.app-layout) .glb-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1.4fr) 1fr 1fr 120px;
    align-items: center;
    gap: 14px;
}

body:has(.app-layout) .glb-table-head {
    padding: 0 16px 12px;
    color: rgba(255, 255, 255, .68);
    font-size: .76rem;
}

body:has(.app-layout) .glb-row {
    min-height: 54px;
    margin-bottom: 8px;
    padding: 8px 16px;
    border: 1px solid rgba(188, 165, 255, .1);
    border-radius: 9px;
    background: rgba(12, 11, 24, .72);
    color: #fff;
    box-shadow: none;
    direction: ltr;
}

body:has(.app-layout) .glb-row:hover {
    background: rgba(169, 140, 255, .075);
}

body:has(.app-layout) .glb-row--me {
    outline: 2px solid rgba(55, 240, 161, .72);
    outline-offset: -2px;
}

body:has(.app-layout) .glb-row-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

body:has(.app-layout) .glb-row-av {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #211f34;
    color: #fff;
    font-size: .8rem;
    font-weight: 900;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: none;
}

body:has(.app-layout) .glb-row-av img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body:has(.app-layout) .glb-row-name {
    font-size: .86rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body:has(.app-layout) .glb-muted {
    font-size: .72rem;
    color: rgba(255, 255, 255, .54);
}

body:has(.app-layout) .glb-reward {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 7px;
    background: rgba(169, 140, 255, .16);
    font-weight: 900;
}

body:has(.app-layout) .glb-reward::before {
    content: "";
    width: 13px;
    height: 13px;
    background: #37d5ff;
    clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%);
}

body:has(.app-layout) .glb-loading,
body:has(.app-layout) .glb-empty {
    grid-column: 1 / -1;
    color: rgba(255, 255, 255, .58);
    text-align: center;
    padding: 48px 0;
}

body:has(.app-layout) .glb-sep {
    height: 1px;
    background: rgba(188, 165, 255, .12);
    margin: 8px 0;
    border: 0;
}

@media (max-width: 760px) {
    body:has(.app-layout) .glb-wrap {
        padding: 24px 12px;
    }

    body:has(.app-layout) .glb-podium {
        gap: 10px;
        min-height: 280px;
    }

    body:has(.app-layout) .glb-avatar {
        width: 70px;
        height: 70px;
    }

    body:has(.app-layout) .glb-pcard--1 .glb-avatar {
        width: 82px;
        height: 82px;
    }

    body:has(.app-layout) .glb-table-head {
        display: none;
    }

    body:has(.app-layout) .glb-row {
        grid-template-columns: 42px minmax(0, 1fr) 70px;
    }

    body:has(.app-layout) .glb-row .glb-hide-sm {
        display: none;
    }
}

/* Late-loaded guard: keep page-local legacy leaderboard CSS from drifting */
body:has(.app-layout) .glb-wrap{background:radial-gradient(circle at 50% -18%,rgba(169,140,255,.16),transparent 34%),radial-gradient(circle at 82% 8%,rgba(55,213,255,.08),transparent 28%),linear-gradient(180deg,rgba(18,16,36,.82),rgba(9,8,20,.9))!important;border:1px solid rgba(188,165,255,.14)!important;border-radius:18px!important;box-shadow:0 24px 70px rgba(0,0,0,.34),inset 0 1px rgba(255,255,255,.045)!important}
body:has(.app-layout) .glb-header{justify-content:center!important;padding:0 0 34px!important;background:transparent!important;border:0!important}
body:has(.app-layout) .glb-header__left{display:none!important}
body:has(.app-layout) .glb-tabs{background:rgba(5,5,14,.68)!important;border:1px solid rgba(188,165,255,.16)!important;border-radius:8px!important}
body:has(.app-layout) .glb-tab--active{background:linear-gradient(135deg,rgba(169,140,255,.24),rgba(55,213,255,.1))!important;border:1px solid rgba(188,165,255,.22)!important;color:#fff!important}
body:has(.app-layout) .glb-podium{display:grid!important;grid-template-columns:1fr 1.12fr 1fr!important;gap:38px!important;min-height:360px!important;padding:0 8px 12px!important;background:transparent!important;direction:ltr!important}
body:has(.app-layout) .glb-pcard{display:flex!important;flex-direction:column!important;align-items:center!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important}
body:has(.app-layout) .glb-pcard--1{order:2!important;min-height:300px!important}
body:has(.app-layout) .glb-pcard--2{order:1!important;min-height:245px!important}
body:has(.app-layout) .glb-pcard--3{order:3!important;min-height:225px!important}
body:has(.app-layout) .glb-stage{background:linear-gradient(180deg,rgba(35,31,58,.96) 0%,rgba(18,16,36,.96) 54%,rgba(9,8,20,.58) 100%)!important}
body:has(.app-layout) .glb-avatar{width:96px!important;height:96px!important;border-radius:10px!important;border:0!important;background:#211f34!important}
body:has(.app-layout) .glb-pcard--1 .glb-avatar{width:112px!important;height:112px!important}
body:has(.app-layout) .glb-avatar img{position:static!important;width:100%!important;height:100%!important;object-fit:cover!important;border-radius:0!important}
body:has(.app-layout) .glb-pname{color:#fff!important;text-shadow:none!important;margin:0 0 24px!important}
body:has(.app-layout) .glb-trophy-box{background:#bca5ff!important;color:#080417!important}
body:has(.app-layout) .glb-rows{display:block!important;margin:28px 0 0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
body:has(.app-layout) .glb-table-head,body:has(.app-layout) .glb-row{display:grid!important;align-items:center!important;gap:14px!important}
body:has(.app-layout) .glb-row{background:rgba(12,11,24,.72)!important;border:1px solid rgba(188,165,255,.1)!important;border-radius:9px!important;box-shadow:none!important;color:#fff!important}
body:has(.app-layout) .glb-row:hover{background:rgba(169,140,255,.075)!important}
body:has(.app-layout) .glb-row-av{width:34px!important;height:34px!important;background:#211f34!important;border:1px solid rgba(255,255,255,.08)!important;box-shadow:none!important}
body:has(.app-layout) .glb-reward{background:rgba(169,140,255,.16)!important}

/* Performance guard: keep the private app glass look without backdrop blur repaint jitter */
body:has(.app-layout) *,
body:has(.app-layout) *::before,
body:has(.app-layout) *::after,
body.auth-page *,
body.auth-page *::before,
body.auth-page *::after {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

body:has(.app-layout) .sidebar {
    background:
        radial-gradient(circle at 18% 0%, rgba(169, 140, 255, .12), transparent 30%),
        linear-gradient(180deg, rgba(10, 9, 24, .96), rgba(6, 5, 14, .98)) !important;
}

body:has(.app-layout) .top-header,
body:has(.app-layout) .user-dropdown,
body:has(.app-layout) .notif-panel {
    background:
        linear-gradient(180deg, rgba(16, 14, 31, .98), rgba(8, 7, 18, .98)) !important;
}

body:has(.app-layout) .page-header,
body:has(.app-layout) .stat-card,
body:has(.app-layout) .table-card,
body:has(.app-layout) .settings-card,
body.auth-page .auth-card,
body.auth-page .auth-split {
    background:
        radial-gradient(circle at 12% 0%, rgba(169, 140, 255, .11), transparent 30%),
        linear-gradient(180deg, rgba(18, 16, 36, .97), rgba(9, 8, 20, .98)) !important;
}

body:has(.app-layout) .glb-wrap {
    background:
        radial-gradient(circle at 50% -18%, rgba(169, 140, 255, .16), transparent 34%),
        radial-gradient(circle at 82% 8%, rgba(55, 213, 255, .08), transparent 28%),
        linear-gradient(180deg, rgba(18, 16, 36, .98), rgba(9, 8, 20, .99)) !important;
}

/* Final private button states: readable dark hover/active treatments */
body:has(.app-layout) .range-tabs {
    align-items: center;
}

body:has(.app-layout) .range-tab,
body:has(.app-layout) .period-btn,
body:has(.app-layout) .btn-outline,
body:has(.app-layout) .btn-ghost {
    background: rgba(13, 15, 30, .86) !important;
    border-color: rgba(188, 165, 255, .22) !important;
    color: #d8ddff !important;
    box-shadow: inset 0 1px rgba(255, 255, 255, .035) !important;
}

body:has(.app-layout) .range-tab:hover:not(.active):not(:disabled),
body:has(.app-layout) .period-btn:hover:not(.active):not(:disabled),
body:has(.app-layout) .btn-outline:hover:not(:disabled),
body:has(.app-layout) .btn-ghost:hover:not(:disabled) {
    background: rgba(169, 140, 255, .14) !important;
    border-color: rgba(188, 165, 255, .38) !important;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: inset 0 1px rgba(255, 255, 255, .05), 0 0 0 1px rgba(188, 165, 255, .06) !important;
}

body:has(.app-layout) .range-tab.active,
body:has(.app-layout) .period-btn.active,
body:has(.app-layout) .btn-primary {
    background: linear-gradient(135deg, #b994ff, #8058ff) !important;
    border-color: rgba(205, 188, 255, .72) !important;
    color: #100821 !important;
    box-shadow: 0 12px 28px rgba(127, 93, 255, .26), inset 0 1px rgba(255, 255, 255, .28) !important;
}

body:has(.app-layout) .range-tab.active:hover:not(:disabled),
body:has(.app-layout) .period-btn.active:hover:not(:disabled),
body:has(.app-layout) .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #c7adff, #8c67ff) !important;
    color: #100821 !important;
    transform: translateY(-1px);
}

body:has(.app-layout) .range-tab:disabled,
body:has(.app-layout) .period-btn:disabled,
body:has(.app-layout) .btn:disabled {
    opacity: .48 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Final auth redesign: dark premium login/register/admin screens */
html body.auth-page {
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 32px 18px !important;
    color: #f7f8ff !important;
    background:
        radial-gradient(circle at 50% -22%, rgba(169, 140, 255, .26), transparent 36%),
        radial-gradient(circle at 8% 18%, rgba(55, 213, 255, .11), transparent 28%),
        radial-gradient(circle at 92% 22%, rgba(127, 93, 255, .15), transparent 30%),
        linear-gradient(180deg, #0b0a16 0%, #060611 52%, #04050c 100%) !important;
}

html body.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 72%);
}

body.auth-page .auth-wrapper {
    position: relative !important;
    z-index: 1 !important;
    width: min(100%, 980px) !important;
    margin: 0 auto !important;
}

body.auth-page .auth-split,
body.auth-page .auth-card {
    border: 1px solid rgba(188, 165, 255, .18) !important;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .54), inset 0 1px rgba(255, 255, 255, .055) !important;
}

body.auth-page .auth-split {
    display: grid !important;
    grid-template-columns: minmax(320px, .95fr) minmax(360px, 1.05fr) !important;
    min-height: 560px !important;
    overflow: hidden !important;
    border-radius: 22px !important;
    background:
        radial-gradient(circle at 70% 0%, rgba(127, 93, 255, .2), transparent 36%),
        linear-gradient(135deg, rgba(16, 14, 31, .98), rgba(8, 8, 19, .99)) !important;
}

body.auth-page .auth-panel {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 54px 46px !important;
    overflow: hidden !important;
    background:
        radial-gradient(circle at 28% 20%, rgba(55, 213, 255, .14), transparent 28%),
        linear-gradient(180deg, rgba(15, 28, 58, .88), rgba(19, 13, 48, .86)) !important;
    border-inline-start: 1px solid rgba(188, 165, 255, .12) !important;
}

body.auth-page .auth-panel::before {
    content: "";
    position: absolute;
    inset: auto -12% -32% -12%;
    height: 56%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(93, 181, 255, .18), transparent 66%);
    pointer-events: none;
}

body.auth-page .auth-panel__form {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 54px 46px !important;
    background: transparent !important;
}

body.auth-page .auth-panel__form .auth-card {
    width: 100% !important;
    max-width: 390px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.auth-page .auth-wrapper > .auth-card {
    width: min(100%, 460px) !important;
    margin: 0 auto !important;
    padding: 44px 40px !important;
    border-radius: 22px !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 91, 124, .16), transparent 28%),
        radial-gradient(circle at 18% 8%, rgba(55, 213, 255, .1), transparent 26%),
        linear-gradient(180deg, rgba(18, 16, 36, .98), rgba(8, 8, 19, .99)) !important;
}
body.auth-page .auth-wrapper > .auth-card--wide {
    width: min(100% - 32px, 720px) !important;
    padding: 44px 48px !important;
}
@media (max-width: 700px) {
    body.auth-page .auth-wrapper > .auth-card--wide {
        padding: 28px 20px !important;
    }
    body.auth-page .auth-wrapper > .auth-card--wide .form-row {
        grid-template-columns: 1fr !important;
    }
}

body.auth-page .auth-card::before,
body.auth-page .auth-split::before,
body.auth-page .auth-split::after,
body.auth-page .auth-panel::after {
    display: none !important;
}

body.auth-page .auth-logo {
    margin-bottom: 30px !important;
    text-align: center !important;
}

body.auth-page .auth-logo h1,
body.auth-page .auth-panel h2 {
    margin: 0 0 8px !important;
    color: #fff !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
}

body.auth-page .auth-logo h1 {
    font-size: 26px !important;
}

body.auth-page .auth-panel h2 {
    font-size: clamp(28px, 3vw, 38px) !important;
    line-height: 1.18 !important;
}

body.auth-page .auth-logo p,
body.auth-page .auth-panel > p,
body.auth-page .auth-footer,
body.auth-page small {
    color: #9aa6c6 !important;
}

body.auth-page .auth-panel__logo {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 42px !important;
    color: #fff !important;
    font-weight: 900 !important;
}

body.auth-page .auth-panel__logo img {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    box-shadow: 0 14px 34px rgba(55, 213, 255, .16) !important;
}

body.auth-page .auth-panel__logo-name {
    color: #fff !important;
}

body.auth-page .auth-panel__points {
    display: grid !important;
    gap: 14px !important;
    margin: 34px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

body.auth-page .auth-panel__points li {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: #cbd3ee !important;
}

body.auth-page .auth-panel__check {
    display: inline-grid !important;
    place-items: center !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 999px !important;
    color: #73ffc4 !important;
    background: rgba(55, 240, 161, .12) !important;
    border: 1px solid rgba(55, 240, 161, .24) !important;
    font-size: 12px !important;
}

body.auth-page .brand-icon {
    display: inline-grid !important;
    place-items: center !important;
    width: 56px !important;
    height: 56px !important;
    margin: 0 auto 18px !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, #ff5b7c, #8058ff) !important;
    color: #fff !important;
    box-shadow: 0 18px 42px rgba(255, 91, 124, .22) !important;
}

body.auth-page .form-group {
    margin-bottom: 18px !important;
}

body.auth-page label {
    display: block !important;
    margin-bottom: 8px !important;
    color: #cbd3ee !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

body.auth-page input[type="text"],
body.auth-page input[type="email"],
body.auth-page input[type="url"],
body.auth-page input[type="password"],
body.auth-page input[type="number"],
body.auth-page input[type="tel"],
body.auth-page select:not(.phone-code-select),
body.auth-page textarea {
    width: 100% !important;
    height: 48px !important;
    border-radius: 12px !important;
    background: rgba(8, 10, 22, .92) !important;
    border: 1px solid rgba(188, 165, 255, .18) !important;
    color: #fff !important;
    padding: 0 14px !important;
    box-shadow: inset 0 1px rgba(255, 255, 255, .035) !important;
}

body.auth-page textarea {
    min-height: 110px !important;
    height: auto !important;
    padding-block: 12px !important;
}

body.auth-page input::placeholder,
body.auth-page textarea::placeholder {
    color: #65708f !important;
}

body.auth-page input:focus,
body.auth-page select:focus,
body.auth-page textarea:focus {
    outline: none !important;
    background: rgba(10, 12, 28, .98) !important;
    border-color: rgba(188, 165, 255, .58) !important;
    box-shadow: 0 0 0 3px rgba(169, 140, 255, .14), inset 0 1px rgba(255, 255, 255, .045) !important;
}

body.auth-page .input-with-toggle {
    position: relative !important;
}

body.auth-page .input-with-toggle input {
    padding-inline-end: 44px !important;
}

body.auth-page .toggle-pw {
    position: absolute !important;
    inset-inline-end: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    border: 0 !important;
    background: transparent !important;
    color: #8f9abb !important;
    cursor: pointer !important;
}

body.auth-page .btn {
    min-height: 48px !important;
    border-radius: 12px !important;
    font-weight: 900 !important;
}

body.auth-page .btn-primary,
body.auth-page .btn-danger {
    background: linear-gradient(135deg, #b994ff, #8058ff) !important;
    border-color: rgba(205, 188, 255, .68) !important;
    color: #100821 !important;
    box-shadow: 0 16px 36px rgba(127, 93, 255, .28) !important;
}

body.auth-page .btn-danger {
    background: linear-gradient(135deg, #ff5b7c, #a758ff) !important;
    color: #fff !important;
}

body.auth-page .btn-primary:hover:not(:disabled),
body.auth-page .btn-danger:hover:not(:disabled) {
    transform: translateY(-1px) !important;
    filter: brightness(1.06) !important;
}

body.auth-page .auth-footer {
    margin: 24px 0 0 !important;
    text-align: center !important;
}

body.auth-page .auth-footer a {
    color: #55dfff !important;
    font-weight: 800 !important;
}

body.auth-page .alert {
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .045) !important;
}

/* Final private notification and user-menu popups */
body:has(.app-layout) .notif-wrapper,
body:has(.app-layout) .user-menu {
    position: relative !important;
}

body:has(.app-layout) .notif-panel,
body:has(.app-layout) .user-dropdown {
    width: min(380px, calc(100vw - 32px)) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(188, 165, 255, .18) !important;
    background:
        radial-gradient(circle at 82% 0%, rgba(169, 140, 255, .14), transparent 34%),
        linear-gradient(180deg, rgba(16, 14, 31, .99), rgba(8, 8, 19, .99)) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .58), inset 0 1px rgba(255, 255, 255, .055) !important;
    overflow: hidden !important;
    color: #f7f8ff !important;
}

body:has(.app-layout) .notif-panel {
    top: calc(100% + 12px) !important;
    right: 0 !important;
    left: auto !important;
    max-height: 520px !important;
    z-index: 500 !important;
}

[dir="rtl"] body:has(.app-layout) .notif-panel {
    right: auto !important;
    left: 0 !important;
}

body:has(.app-layout) .notif-panel__header,
body:has(.app-layout) .user-dropdown__header {
    min-height: 52px !important;
    padding: 14px 16px !important;
    background: rgba(255, 255, 255, .035) !important;
    border-bottom: 1px solid rgba(188, 165, 255, .14) !important;
}

body:has(.app-layout) .notif-panel__title,
body:has(.app-layout) .user-dropdown__name {
    color: #fff !important;
    font-weight: 900 !important;
}

body:has(.app-layout) .notif-mark-all {
    color: #bca5ff !important;
    background: rgba(188, 165, 255, .08) !important;
    border: 1px solid rgba(188, 165, 255, .14) !important;
    border-radius: 8px !important;
    padding: 5px 9px !important;
    font-weight: 800 !important;
}

body:has(.app-layout) .notif-mark-all:hover {
    color: #fff !important;
    background: rgba(188, 165, 255, .16) !important;
}

body:has(.app-layout) .notif-panel__body {
    background: transparent !important;
    max-height: 460px !important;
}

body:has(.app-layout) .notif-empty {
    color: #9aa6c6 !important;
    background: transparent !important;
}

body:has(.app-layout) .notif-item {
    display: grid !important;
    grid-template-columns: 10px minmax(0, 1fr) auto !important;
    align-items: start !important;
    gap: 10px !important;
    padding: 13px 16px !important;
    background: rgba(255, 255, 255, .018) !important;
    border-bottom: 1px solid rgba(188, 165, 255, .1) !important;
    color: #dce4ff !important;
}

body:has(.app-layout) .notif-item--unread {
    background: linear-gradient(90deg, rgba(169, 140, 255, .13), rgba(55, 213, 255, .035)) !important;
}

body:has(.app-layout) .notif-item:hover,
body:has(.app-layout) .notif-item--unread:hover {
    background: rgba(169, 140, 255, .12) !important;
}

body:has(.app-layout) .notif-item__dot {
    width: 8px !important;
    height: 8px !important;
    margin-top: 6px !important;
    background: #b994ff !important;
    box-shadow: 0 0 14px rgba(185, 148, 255, .55) !important;
}

body:has(.app-layout) .notif-item--read .notif-item__dot {
    background: #4b5674 !important;
    box-shadow: none !important;
}

body:has(.app-layout) .notif-item__title {
    color: #fff !important;
    font-weight: 850 !important;
}

body:has(.app-layout) .notif-item__body,
body:has(.app-layout) .notif-item__time,
body:has(.app-layout) .user-dropdown__email {
    color: #9aa6c6 !important;
}

body:has(.app-layout) .notif-item__link-label {
    color: #55dfff !important;
}

body:has(.app-layout) .notif-view-btn {
    color: #9aa6c6 !important;
    border-radius: 8px !important;
}

body:has(.app-layout) .notif-view-btn:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .08) !important;
}

body:has(.app-layout) .user-dropdown__body {
    padding: 8px !important;
}

body:has(.app-layout) .user-dropdown__item {
    color: #dce4ff !important;
    border-radius: 10px !important;
}

body:has(.app-layout) .user-dropdown__item:hover {
    background: rgba(169, 140, 255, .12) !important;
}

body:has(.app-layout) .user-dropdown__item--danger {
    color: #ff8da1 !important;
}

body:has(.app-layout) .user-dropdown__divider {
    background: rgba(188, 165, 255, .12) !important;
}

body:has(.app-layout) #notifViewModal {
    background: rgba(3, 4, 10, .78) !important;
}

body:has(.app-layout) #notifViewBox {
    background:
        radial-gradient(circle at 80% 0%, rgba(169, 140, 255, .12), transparent 34%),
        linear-gradient(180deg, rgba(16, 14, 31, .99), rgba(8, 8, 19, .99)) !important;
    border: 1px solid rgba(188, 165, 255, .18) !important;
    color: #f7f8ff !important;
}

body:has(.app-layout) #notifViewTitle {
    color: #fff !important;
}

body:has(.app-layout) #notifViewBody,
body:has(.app-layout) #notifViewTime,
body:has(.app-layout) #notifViewClose {
    color: #9aa6c6 !important;
}

/* Final password visibility button fix: keep it from covering the input */
body.auth-page .input-with-toggle,
body:has(.app-layout) .input-with-toggle {
    position: relative !important;
}

body.auth-page .input-with-toggle input,
body:has(.app-layout) .input-with-toggle input {
    padding-inline-end: 48px !important;
}

body.auth-page .toggle-pw,
body:has(.app-layout) .toggle-pw {
    position: absolute !important;
    top: 50% !important;
    left: auto !important;
    right: auto !important;
    inset-inline-end: 8px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    display: inline-grid !important;
    place-items: center !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
}

body.auth-page .toggle-pw:hover,
body:has(.app-layout) .toggle-pw:hover {
    background: rgba(188, 165, 255, .1) !important;
}

/* Final private mobile navigation and layout hardening */
@media (max-width: 900px) {
    html:has(body.nav-open),
    body.nav-open {
        overflow: hidden !important;
        touch-action: none;
    }

    body:has(.app-layout) .app-layout {
        display: block !important;
        min-height: 100vh !important;
    }

    body:has(.app-layout) .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: auto !important;
        width: min(86vw, 320px) !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding-top: env(safe-area-inset-top) !important;
        border-radius: 0 20px 20px 0 !important;
        border-width: 0 1px 0 0 !important;
        transform: translateX(-104%) !important;
        transition: transform .22s ease !important;
        z-index: 700 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    [dir="rtl"] body:has(.app-layout) .sidebar {
        left: auto !important;
        right: 0 !important;
        border-radius: 20px 0 0 20px !important;
        border-width: 0 0 0 1px !important;
        transform: translateX(104%) !important;
    }

    body:has(.app-layout) .sidebar.open {
        transform: translateX(0) !important;
    }

    body:has(.app-layout) .sidebar-overlay {
        position: fixed !important;
        inset: 0 !important;
        display: block !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        background: rgba(3, 4, 10, .72) !important;
        z-index: 650 !important;
        transition: opacity .18s ease, visibility .18s ease !important;
    }

    body:has(.app-layout) .sidebar-overlay.open {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    body:has(.app-layout) .sidebar-brand {
        min-height: 64px !important;
        padding: 18px 18px !important;
    }

    body:has(.app-layout) .nav-links {
        padding: 10px !important;
    }

    body:has(.app-layout) .nav-links a {
        min-height: 48px !important;
        padding: 12px 14px !important;
        border-radius: 12px !important;
        font-size: 15px !important;
    }

    body:has(.app-layout) .nav-links li.active a {
        padding-inline-start: 14px !important;
        border-left: 0 !important;
        border-right: 0 !important;
    }

    body:has(.app-layout) .sidebar-footer {
        padding: 14px 16px calc(16px + env(safe-area-inset-bottom)) !important;
    }

    body:has(.app-layout) .top-header {
        position: fixed !important;
        top: calc(8px + env(safe-area-inset-top)) !important;
        left: 8px !important;
        right: 8px !important;
        height: 58px !important;
        padding: 0 10px !important;
        border-radius: 16px !important;
        z-index: 600 !important;
    }

    [dir="rtl"] body:has(.app-layout) .top-header {
        left: 8px !important;
        right: 8px !important;
    }

    body:has(.app-layout) .top-header__left {
        flex: 0 0 auto !important;
    }

    body:has(.app-layout) .top-header__right {
        flex: 1 1 auto !important;
        justify-content: flex-end !important;
        min-width: 0 !important;
        gap: 6px !important;
    }

    [dir="rtl"] body:has(.app-layout) .top-header__right {
        justify-content: flex-end !important;
    }

    [dir="rtl"] body:has(.app-layout) .top-header__left {
        margin-inline-start: 6px !important;
    }

    [dir="ltr"] body:has(.app-layout) .top-header__left {
        margin-inline-end: 6px !important;
    }

    body:has(.app-layout) .menu-toggle,
    body:has(.app-layout) .header-btn,
    body:has(.app-layout) .user-avatar-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 12px !important;
    }

    body:has(.app-layout) .menu-toggle {
        display: inline-flex !important;
    }

    body:has(.app-layout) .main-content {
        margin: 0 !important;
        padding: calc(74px + env(safe-area-inset-top)) 12px 18px !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    body:has(.app-layout) .page-header {
        padding: 18px !important;
        margin-bottom: 16px !important;
        border-radius: 16px !important;
    }

    body:has(.app-layout) .page-header h2 {
        font-size: 20px !important;
        line-height: 1.25 !important;
    }

    body:has(.app-layout) .page-header p {
        font-size: 13px !important;
    }

    body:has(.app-layout) .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        margin-bottom: 16px !important;
    }

    body:has(.app-layout) .stat-card {
        min-width: 0 !important;
        padding: 14px !important;
        border-radius: 14px !important;
    }

    body:has(.app-layout) .stat-card__value,
    body:has(.app-layout) .stat-value {
        font-size: 22px !important;
        overflow-wrap: anywhere !important;
    }

    body:has(.app-layout) .range-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        margin: 0 0 16px !important;
        padding: 2px 0 8px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body:has(.app-layout) .range-tabs::-webkit-scrollbar {
        display: none;
    }

    body:has(.app-layout) .range-tab,
    body:has(.app-layout) .period-btn,
    body:has(.app-layout) .btn {
        min-height: 42px !important;
        white-space: nowrap !important;
    }

    body:has(.app-layout) .table-card,
    body:has(.app-layout) .settings-card {
        border-radius: 16px !important;
        overflow: hidden !important;
    }

    body:has(.app-layout) .table-card__header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 14px !important;
        min-width: 0 !important;
    }

    body:has(.app-layout) .table-card__header > * {
        max-width: 100% !important;
    }

    body:has(.app-layout) .table-card {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body:has(.app-layout) .table-card table,
    body:has(.app-layout) table {
        min-width: 680px !important;
    }

    body:has(.app-layout) th,
    body:has(.app-layout) td {
        padding: 11px 12px !important;
        font-size: 12px !important;
    }

    body:has(.app-layout) .form-row,
    body:has(.app-layout) [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    body:has(.app-layout) input,
    body:has(.app-layout) select,
    body:has(.app-layout) textarea {
        min-height: 44px !important;
        font-size: 16px !important;
    }

    body:has(.app-layout) .notif-panel,
    body:has(.app-layout) .user-dropdown {
        position: fixed !important;
        top: calc(72px + env(safe-area-inset-top)) !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-height: min(68dvh, 520px) !important;
    }

    [dir="rtl"] body:has(.app-layout) .notif-panel,
    [dir="rtl"] body:has(.app-layout) .user-dropdown {
        left: 10px !important;
        right: 10px !important;
    }

    body:has(.app-layout) .notif-item {
        grid-template-columns: 10px minmax(0, 1fr) auto !important;
        padding: 14px !important;
    }

    body:has(.app-layout) #notifViewBox {
        width: calc(100vw - 24px) !important;
        max-height: 78dvh !important;
        padding: 22px 18px 18px !important;
        border-radius: 16px !important;
    }

    body:has(.app-layout) .glb-wrap {
        margin: 14px 0 18px !important;
        padding: 20px 12px !important;
        border-radius: 16px !important;
    }

    body:has(.app-layout) .glb-podium {
        grid-template-columns: 1fr 1.08fr 1fr !important;
        align-items: end !important;
        gap: 8px !important;
        min-height: 290px !important;
        padding: 8px 0 10px !important;
        overflow: visible !important;
    }

    body:has(.app-layout) .glb-pcard,
    body:has(.app-layout) .glb-pcard--1,
    body:has(.app-layout) .glb-pcard--2,
    body:has(.app-layout) .glb-pcard--3 {
        min-width: 0 !important;
    }

    body:has(.app-layout) .glb-pcard--1 {
        order: 2 !important;
        min-height: 268px !important;
    }

    body:has(.app-layout) .glb-pcard--2 {
        order: 1 !important;
        min-height: 242px !important;
    }

    body:has(.app-layout) .glb-pcard--3 {
        order: 3 !important;
        min-height: 232px !important;
    }

    body:has(.app-layout) .glb-avatar,
    body:has(.app-layout) .glb-pcard--1 .glb-avatar {
        width: clamp(58px, 18vw, 82px) !important;
        height: clamp(58px, 18vw, 82px) !important;
    }

    body:has(.app-layout) .glb-stage {
        height: 100px !important;
        min-height: 100px !important;
        padding: 22px 4px 14px !important;
        margin-top: 0 !important;
    }

    body:has(.app-layout) .glb-pcard--1 .glb-stage {
        height: 118px !important;
        min-height: 118px !important;
        margin-top: 0 !important;
    }

    body:has(.app-layout) .glb-stage::before {
        top: 34px !important;
    }

    body:has(.app-layout) .glb-pname {
        max-width: 100% !important;
        margin-bottom: 16px !important;
        font-size: clamp(.72rem, 3vw, .86rem) !important;
    }

    body:has(.app-layout) .glb-trophy-box {
        width: 38px !important;
        height: 38px !important;
        margin-top: 8px !important;
        border-radius: 10px !important;
        font-size: 1rem !important;
    }

    body:has(.app-layout) .glb-prize {
        font-size: clamp(.92rem, 4vw, 1.12rem) !important;
    }

body:has(.app-layout) .glb-prize-label {
        font-size: .68rem !important;
    }
}

/* Final private modal cleanup, including inline-heavy article popups */
body:has(.app-layout) #artModalOverlay,
body:has(.app-layout) .art-modal-overlay,
body:has(.app-layout) [id$="Overlay"][style*="position:fixed"],
body:has(.app-layout) [id$="Overlay"][style*="position: fixed"] {
    background: rgba(3, 4, 10, .78) !important;
    padding: clamp(10px, 3vw, 24px) !important;
    align-items: center !important;
    justify-content: center !important;
}

body:has(.app-layout) #artModal,
body:has(.app-layout) .art-modal,
body:has(.app-layout) .modal-box,
body:has(.app-layout) [id$="Modal"][style*="max-height"],
body:has(.app-layout) [id$="Box"][style*="max-height"] {
    background:
        radial-gradient(circle at 82% 0%, rgba(169, 140, 255, .13), transparent 34%),
        linear-gradient(180deg, rgba(16, 14, 31, .99), rgba(8, 8, 19, .99)) !important;
    border: 1px solid rgba(188, 165, 255, .18) !important;
    border-radius: 18px !important;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .62), inset 0 1px rgba(255, 255, 255, .055) !important;
    color: #f7f8ff !important;
}

body:has(.app-layout) #artModal > div:first-child,
body:has(.app-layout) .art-modal__header,
body:has(.app-layout) .modal-header {
    min-height: 62px !important;
    padding: 16px 20px !important;
    background: rgba(255, 255, 255, .035) !important;
    border-bottom: 1px solid rgba(188, 165, 255, .14) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

body:has(.app-layout) #artModal h3,
body:has(.app-layout) .art-modal__title,
body:has(.app-layout) .modal-header h3 {
    color: #fff !important;
    font-weight: 900 !important;
}

body:has(.app-layout) #artModal button[onclick*="closeModal"],
body:has(.app-layout) .art-modal__close,
body:has(.app-layout) .modal-header button {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 12px !important;
    background: rgba(188, 165, 255, .1) !important;
    border: 1px solid rgba(188, 165, 255, .12) !important;
    color: #cbd3ee !important;
    padding: 0 !important;
}

body:has(.app-layout) #artModal button[onclick*="closeModal"]:hover,
body:has(.app-layout) .art-modal__close:hover,
body:has(.app-layout) .modal-header button:hover {
    background: rgba(188, 165, 255, .18) !important;
    color: #fff !important;
}

body:has(.app-layout) #formBody,
body:has(.app-layout) .art-modal__body,
body:has(.app-layout) .modal-body {
    background: rgba(9, 12, 26, .42) !important;
    color: #f7f8ff !important;
}

body:has(.app-layout) #formBody > .form-group,
body:has(.app-layout) #formBody > div:not(#formMsg),
body:has(.app-layout) .art-modal__body > .form-group,
body:has(.app-layout) .art-modal__body > div:not(.alert):not(.loading) {
    background: rgba(255, 255, 255, .035) !important;
    border: 1px solid rgba(188, 165, 255, .12) !important;
    border-radius: 14px !important;
    padding: 14px !important;
}

body:has(.app-layout) #formBody > div[style*="grid-template-columns"] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(140px, auto) !important;
}

body:has(.app-layout) #formBody label,
body:has(.app-layout) .art-modal__body label,
body:has(.app-layout) .form-label {
    color: #dce4ff !important;
    font-weight: 850 !important;
}

body:has(.app-layout) #formBody p,
body:has(.app-layout) .art-modal__body p {
    color: #9aa6c6 !important;
}

body:has(.app-layout) #formBody .form-control,
body:has(.app-layout) .art-modal__body .form-control {
    background: rgba(8, 10, 22, .96) !important;
    border-color: rgba(188, 165, 255, .16) !important;
    color: #fff !important;
}

body:has(.app-layout) #formBody .form-control::placeholder,
body:has(.app-layout) .art-modal__body .form-control::placeholder {
    color: #687493 !important;
}

body:has(.app-layout) #artModal > div:last-child,
body:has(.app-layout) .art-modal__footer {
    padding: 14px 20px !important;
    background: rgba(255, 255, 255, .035) !important;
    border-top: 1px solid rgba(188, 165, 255, .14) !important;
}

@media (max-width: 700px) {
    body:has(.app-layout) #artModalOverlay,
    body:has(.app-layout) .art-modal-overlay {
        align-items: flex-end !important;
        padding: 10px !important;
    }

    body:has(.app-layout) #artModal,
    body:has(.app-layout) .art-modal,
    body:has(.app-layout) .modal-box {
        width: 100% !important;
        max-width: none !important;
        max-height: calc(100dvh - 20px) !important;
        border-radius: 18px !important;
    }

    body:has(.app-layout) #formBody {
        padding: 14px !important;
        gap: 12px !important;
    }

    body:has(.app-layout) #formBody > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    body:has(.app-layout) #formBody > .form-group,
    body:has(.app-layout) #formBody > div:not(#formMsg),
    body:has(.app-layout) .art-modal__body > .form-group,
    body:has(.app-layout) .art-modal__body > div:not(.alert):not(.loading) {
        padding: 12px !important;
    }

    body:has(.app-layout) #artModal > div:last-child,
    body:has(.app-layout) .art-modal__footer {
        padding: 12px !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    body:has(.app-layout) #artModal > div:last-child > div {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
    }

    body:has(.app-layout) #artModal > div:last-child .btn,
    body:has(.app-layout) .art-modal__footer .btn {
        width: 100% !important;
    }
}

@media (max-width: 520px) {
    body:has(.app-layout) .top-header {
        height: 56px !important;
    }

    body:has(.app-layout) .main-content {
        padding-inline: 10px !important;
    }

    body:has(.app-layout) .header-btn.lang-btn {
        width: 42px !important;
        min-width: 42px !important;
        padding: 0 !important;
    }
}

@media (max-width: 820px) {
    html body.auth-page {
        align-items: flex-start !important;
        padding-top: 18px !important;
    }

    body.auth-page .auth-split {
        grid-template-columns: 1fr !important;
        min-height: 0 !important;
    }

    body.auth-page .auth-panel {
        padding: 32px 26px !important;
        text-align: center !important;
    }

    body.auth-page .auth-panel__logo {
        justify-content: center !important;
        margin-bottom: 22px !important;
    }

    body.auth-page .auth-panel__points {
        display: none !important;
    }

    body.auth-page .auth-panel__form,
    body.auth-page .auth-wrapper > .auth-card {
        padding: 28px 22px !important;
    }
}
