/* ============================================================
   MetaPhoenix Admin Panel
   Navy Slate + Gold · RTL · Modern Dark
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
    font-family: 'Estedad';
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/Estedad-Bold.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
    /* Brand */
    --gold:        #D4AF37;
    --gold-light:  #F0D264;
    --gold-dark:   #B8942E;

    /* Backgrounds — layered, NOT black */
    --bg-page:     #0F1A2B;
    --bg-card:     #1A2740;
    --bg-input:    #0A1420;
    --bg-elevated: #243352;

    /* Sidebar — independent, always deep */
    --sb-start:  #0D1828;
    --sb-end:    #060D18;
    --sb-border: rgba(212, 175, 55, 0.12);
    --sb-text:      #C4D0E0;
    --sb-strong:    #F1F5F9;
    --sb-muted:     #7A8BA0;
    --sb-hover:     rgba(212, 175, 55, 0.07);
    --sb-active-bg: rgba(212, 175, 55, 0.15);
    --sb-active-tx: #F0D264;

    /* Text — high contrast everywhere */
    --text-primary:   #F1F5F9;
    --text-secondary: #C4D0E0;
    --text-muted:     #8B9CB3;
    --text-on-gold:   #0A1420;
    --text-third:     #E2E8F0; 

    /* Borders */
    --border:        rgba(148, 163, 184, 0.15);
    --border-strong: rgba(212, 175, 55, 0.4);
    --border-gold:   rgba(212, 175, 55, 0.25);

    /* Feedback */
    --success: #34D399;
    --danger:  #F87171;
    --warning: #FBBF24;
    --info:    #60A5FA;

    /* Shadows */
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.3);
    --shadow-md:   0 10px 30px -8px rgba(0,0,0,0.5);
    --shadow-gold: 0 10px 30px -8px rgba(212,175,55,0.25);

    /* Layout */
    --sidebar-width: 270px;
    --radius-sm: 10px;
    --radius:    14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --transition: 0.22s cubic-bezier(.4,0,.2,1);
    --font: 'Estedad';
}

/* ============================================================
   Light Theme — همه توکن‌ها override می‌شن
   سایدبار عمداً تیره می‌مونه (Stripe/Linear style)
   ============================================================ */
[data-theme="light"] {
    --bg-page:     #EEF1F6;
    --bg-card:     #FFFFFF;
    --bg-input:    #F5F7FA;
    --bg-elevated: #E2E8F0;

    --text-primary:   #0F172A;
    --text-secondary: #475569;
    --text-muted:     #64748B;
    --text-on-gold:   #0A1420;
    --text-third:     #1A2740; 

    --border:        rgba(15, 23, 42, 0.10);
    --border-strong: rgba(212, 175, 55, 0.55);
    --border-gold:   rgba(212, 175, 55, 0.35);

    --shadow-sm:   0 1px 3px rgba(15,23,42,0.08);
    --shadow-md:   0 10px 30px -8px rgba(15,23,42,0.15);
    --shadow-gold: 0 10px 30px -8px rgba(212,175,55,0.3);
}

[data-theme="light"] .particles-bg {
    background:
        radial-gradient(ellipse 60% 40% at 90% 10%, rgba(212,175,55,0.08), transparent 60%),
        radial-gradient(ellipse 50% 40% at 10% 90%, rgba(65,90,119,0.08), transparent 60%);
}

/* page-header در تم روشن (جلوگیری از رنگ ثابت navy) */
[data-theme="light"] .page-header {
    background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(255,255,255,0.6));
}

/* stat-card highlight */
[data-theme="light"] .stat-card.highlight {
    background: linear-gradient(135deg, rgba(212,175,55,0.15), #FFFFFF);
}

/* جدول: هدر کمی پررنگ‌تر */
[data-theme="light"] .data-table thead {
    background: rgba(212,175,55,0.08);
}

/* فرم‌ها */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    background: #FFFFFF;
}

/* اسکرول‌بار */
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(13,27,42,0.2);
}


/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: var(--font);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(212,175,55,0.35); color: #F1F5F9; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(212,175,55,0.25);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
button, input, select, textarea { font-family: inherit; }

/* ---------- Ambient background ---------- */
.particles-bg {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(ellipse 60% 40% at 90% 10%, rgba(212,175,55,0.07), transparent 60%),
        radial-gradient(ellipse 50% 40% at 10% 90%, rgba(65,90,119,0.15), transparent 60%);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.dash-sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sb-start) 0%, var(--sb-end) 100%);
    border-left: 1px solid var(--sb-border);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.4);
    transition: transform var(--transition);
    overflow: hidden;
}

/* ── Brand ── */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 20px;
    border-bottom: 1px solid var(--sb-border);
    flex-shrink: 0;
}
.sidebar-brand-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-gold);
    font-size: 1.4rem;
    box-shadow: 0 8px 20px -6px rgba(212,175,55,0.5);
    flex-shrink: 0;
}
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}
.sidebar-brand-name {
    font-size: 1rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
    white-space: nowrap;
}
.sidebar-brand-sub {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--sb-muted);
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ── Profile card ── */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 14px;
    padding: 14px;
    background: rgba(212,175,55,0.05);
    border: 1px solid var(--sb-border);
    border-radius: var(--radius);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.sidebar-profile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212,175,55,0.10), transparent 60%);
    pointer-events: none;
}
.profile-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    color: var(--text-on-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.15rem;
    position: relative;
    flex-shrink: 0;
    border: 2px solid var(--sb-start);
    box-shadow: 0 0 0 2px var(--gold);
    overflow: hidden;
}
.profile-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.profile-status {
    position: absolute;
    bottom: 0; left: 0;
    width: 12px; height: 12px;
    background: var(--success);
    border: 2.5px solid var(--sb-start);
    border-radius: 50%;
}
.profile-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.profile-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--sb-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.profile-role {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--gold-light);
    background: rgba(212,175,55,0.15);
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 4px;
    align-self: flex-start;
    letter-spacing: 0.2px;
}

/* ── Nav scroll area ── */
.sidebar-nav-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0 14px;
}
.sidebar-nav-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(212,175,55,0.2);
    border-radius: 4px;
}

.sidebar-nav-group {
    padding: 8px 0;
}
.sidebar-nav-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--sb-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 22px 6px;
}
.sidebar-nav-list {
    list-style: none;
    padding: 0 12px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-nav-list a {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--sb-text);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.sidebar-nav-list a i {
    font-size: 1.25rem;
    color: var(--gold);
    opacity: 0.85;
    justify-self: center;
}

.sidebar-nav-list a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-badge {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: var(--text-on-gold);
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1.4;
    box-shadow: 0 3px 10px -3px rgba(212,175,55,0.6);
    justify-self: end;
}

.sidebar-nav-list a small {
    font-size: 0.65rem;
    opacity: 0.6;
    font-weight: 600;
    justify-self: end;
    white-space: nowrap;
}
.sidebar-nav-list a:hover {
    background: var(--sb-hover);
    color: var(--sb-strong);
}
.sidebar-nav-list a:hover i { opacity: 1; }

.sidebar-nav-list a.active {
    background: var(--sb-active-bg);
    color: var(--sb-active-tx);
    font-weight: 800;
}
.sidebar-nav-list a.active i {
    color: var(--sb-active-tx);
    opacity: 1;
}
.sidebar-nav-list a.active::before {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px rgba(212,175,55,0.6);
}

.nav-badge {
    margin-right: auto;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: var(--text-on-gold);
    padding: 1px 9px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 3px 10px -3px rgba(212,175,55,0.6);
}
.sidebar-nav-list a.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.sidebar-nav-list a.disabled:hover {
    background: transparent;
    color: var(--sb-text);
}
.sidebar-nav-list a small {
    font-size: 0.68rem;
    opacity: 0.7;
    margin-right: auto;
    font-weight: 600;
}

/* ── Sidebar footer (logout) ── */
.sidebar-footer {
    padding: 12px 14px 16px;
    border-top: 1px solid var(--sb-border);
    flex-shrink: 0;
}
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.2);
    color: #FCA5A5;
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
    transition: var(--transition);
    justify-content: center;
}
.sidebar-logout:hover {
    background: rgba(248,113,113,0.15);
    border-color: #F87171;
    color: #FCA5A5;
    transform: translateY(-1px);
}
.sidebar-logout i { font-size: 1.15rem; }

/* ============================================================
   MAIN
   ============================================================ */
.dash-layout { min-height: 100vh; position: relative; z-index: 1; }
.dash-main {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    transition: margin var(--transition);
}
.dashboard-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 28px 40px;
}

/* ---------- Topbar ---------- */
.dash-topbar { margin-bottom: 22px; }
.dash-topbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.sidebar-toggle {
    display: none;
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--gold);
    font-size: 1.3rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}
.sidebar-toggle:hover { border-color: var(--gold); }

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border-radius: 50px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.user-chip .user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    color: var(--text-on-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    flex-shrink: 0;
}
.user-chip .info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}
.user-chip .info .name {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-chip .info .meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    gap: 4px;
    align-items: center;
}
.user-chip .info .meta .role {
    color: var(--gold);
    font-weight: 800;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.btn-topbar,
.btn-logout-topbar {
    width: 40px; height: 40px;
    border-radius: 12px;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
}
.btn-topbar:hover {
    color: var(--gold);
    border-color: var(--gold);
}
.btn-logout-topbar {
    background: rgba(248,113,113,0.1);
    border-color: rgba(248,113,113,0.3);
    color: #F87171;
}
.btn-logout-topbar:hover {
    background: rgba(248,113,113,0.2);
    border-color: #F87171;
    color: #F87171;
}

/* ---------- Page header ---------- */
.page-header {
    background: linear-gradient(135deg, rgba(212,175,55,0.10), var(--bg-card));
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h1 {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-header h1 i { color: var(--gold); font-size: 1.5rem; }
.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}
.page-header .badge-pill {
    padding: 8px 18px;
    border-radius: 100px;
    background: rgba(16, 0, 39, 0.7);
    color: var(--gold-light);
    font-weight: 800;
    font-size: 0.9rem;
    white-space: nowrap;
    border: 1px solid var(--border-gold);
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--transition);
}
.card:hover { border-color: var(--border-gold); }
.card-title {
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.card-title i { color: var(--gold); font-size: 1.2rem; }

/* ---------- Stat cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}
.stat-card .stat-icon {
    font-size: 1.8rem;
    color: var(--gold);
    opacity: 0.85;
    margin-bottom: 10px;
    display: block;
}
.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
    direction: ltr;
    text-align: right;
}
.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 600;
}
.stat-card.highlight {
    border-color: var(--border-strong);
    background: linear-gradient(135deg, rgba(212,175,55,0.12), var(--bg-card));
}
.stat-card.highlight .stat-number {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card.warning { border-color: rgba(251,191,36,0.5); }
.stat-card.warning .stat-icon,
.stat-card.warning .stat-number { color: var(--warning); }
.stat-card .stat-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--gold);
}
.stat-card .stat-link:hover { text-decoration: underline; }

/* ---------- Tables ---------- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table thead { background: rgba(212,175,55,0.05); }
.data-table th {
    padding: 13px 14px;
    text-align: right;
    font-weight: 800;
    color: var(--text-secondary);
    font-size: 0.78rem;
    border-bottom: 1px solid var(--border-gold);
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: rgba(212,175,55,0.04); }

.data-table .cell-user {
    font-weight: 800;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
    font-size: 0.88rem;
}
.data-table .cell-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    direction: ltr;
    text-align: right;
}
.data-table .cell-money {
    color: var(--gold-light);
    font-weight: 800;
    direction: ltr;
    text-align: right;
}
.data-table .cell-actions { text-align: center; white-space: nowrap; }

/* ---------- Status badges ---------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}
.status-pending   { background: rgba(16, 0, 39, 0.7); color: #FCD34D; }
.status-active    { background: rgba(52,211,153,0.18); color: #6EE7B7; }
.status-cancelled { background: rgba(248,113,113,0.18); color: #FCA5A5; }
.status-completed { background: rgba(52,211,153,0.18); color: #6EE7B7; }
.status-expired   { background: rgba(148,163,184,0.18); color: #CBD5E1; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover {
    border-color: var(--border-gold);
    transform: translateY(-1px);
    color: var(--text-primary);
    background: var(--bg-elevated);
}
.btn-primary {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: var(--text-on-gold);
    border-color: transparent;
    font-weight: 800;
}
.btn-primary:hover {
    box-shadow: var(--shadow-gold);
    color: var(--text-on-gold);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
}
.btn-success {
    background: linear-gradient(135deg, #34D399, #10b981);
    color: #fff;
    border-color: transparent;
    font-weight: 800;
}
.btn-success:hover {
    box-shadow: 0 10px 30px -8px rgba(52,211,153,0.5);
    color: #fff;
    background: linear-gradient(135deg, #34D399, #10b981);
}
.btn-danger {
    background: linear-gradient(135deg, #f87171, #dc2626);
    color: #fff;
    border-color: transparent;
    font-weight: 800;
}
.btn-danger:hover {
    box-shadow: 0 10px 30px -8px rgba(239,68,68,0.5);
    color: #fff;
    background: linear-gradient(135deg, #f87171, #dc2626);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-gold);
}
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 14px 26px; font-size: 0.95rem; }

/* ---------- Forms ---------- */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
    margin-bottom: 16px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 160px;
}
.form-group.flex-auto { flex: 0 0 auto; min-width: auto; }
.form-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 700;
}
.form-control,
.form-select {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.87rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.15);
    background: var(--bg-elevated);
}
.form-control::placeholder { color: var(--text-muted); }
.form-select option { background: var(--bg-input); color: var(--text-primary); }

/* ---------- Alerts ---------- */
.alert {
    padding: 13px 18px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid transparent;
    font-weight: 600;
}
.alert i { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.alert-success {
    background: rgba(52,211,153,0.12);
    border-color: rgba(52,211,153,0.4);
    color: #6EE7B7;
}
.alert-danger {
    background: rgba(248,113,113,0.12);
    border-color: rgba(248,113,113,0.4);
    color: #FCA5A5;
}
.alert-warning {
    background: rgba(16, 0, 39, 0.7);
    border-color: rgba(251,191,36,0.4);
    color: #FCD34D;
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3.5rem;
    color: var(--gold);
    opacity: 0.5;
    display: block;
    margin-bottom: 16px;
}
.empty-state p { margin: 0; font-size: 0.9rem; }

/* ---------- Info grid ---------- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.info-item {
    background: var(--bg-input);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.info-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 700;
}
.info-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
    word-break: break-word;
}
.info-value.gold { color: var(--gold-light); }
.info-value.ltr {
    direction: ltr;
    text-align: right;
}

/* ---------- Chain ---------- */
.chain { display: flex; flex-direction: column; gap: 8px; }
.chain-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}
.chain-row > i { color: var(--gold); font-size: 1.2rem; flex-shrink: 0; }
.chain-user { flex: 1; min-width: 140px; }
.chain-user .name {
    font-weight: 800;
    font-size: 0.86rem;
    color: var(--text-primary);
}
.chain-user .meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    direction: ltr;
    text-align: right;
    margin-top: 2px;
}
.chain-badge {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
}
.chain-badge.ok   { background: rgba(52,211,153,0.18); color: #6EE7B7; }
.chain-badge.no   { background: rgba(248,113,113,0.18); color: #FCA5A5; }
.chain-badge.none { background: rgba(148,163,184,0.18); color: #CBD5E1; }

/* ---------- Backdrop ---------- */
.custom-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 13, 24, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}
.custom-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991px) {
    .dash-sidebar {
        transform: translateX(100%);
        visibility: hidden;
    }
    .dash-sidebar.show {
        transform: translateX(0);
        visibility: visible;
    }
    .dash-main { margin-right: 0; }
    .sidebar-toggle { display: flex; }
    .dashboard-wrapper { padding: 16px; }
    .dash-topbar-header { padding: 10px 14px; }
}

@media (max-width: 640px) {
    .user-chip .info .name { font-size: 0.8rem; }
    .user-chip .info .meta { font-size: 0.65rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .form-group { min-width: 100%; }
    .page-header { padding: 16px 18px; }
    .page-header h1 { font-size: 1.05rem; }
    .data-table th,
    .data-table td { padding: 10px 8px; font-size: 0.78rem; }
    .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .user-chip { padding: 4px; }
    .user-chip .info { display: none; }
    .user-chip .user-avatar { width: 34px; height: 34px; }
    .chain-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}