/* ══════════════════════════════════════════════
   Leadixy — Admin / Client Dashboard CSS
   ══════════════════════════════════════════════ */
:root {
  /* ── Platinum × Violet × Gold — Premium Light Theme ── */
  --primary:       #6D28D9;
  --primary-light: #8B5CF6;
  --primary-dark:  #5B21B6;
  --accent:        #D4AF37;
  --dark:          #F4F3FB;           /* base page bg */
  --dark-2:        #FFFFFF;           /* sidebar, cards */
  --dark-3:        #EBE9F8;           /* inputs, table rows */
  --surface:       #F4F3FB;
  --surface-raised:#FFFFFF;
  --surface-sunken:#EBE9F8;
  --input-bg:      #EBE9F8;
  --white:         #1E1B4B;           /* headings — deep indigo */
  --text:          #3B3165;
  --text-muted:    #7C6FAB;
  --border:        rgba(109,40,217,0.12);
  --success:       #16a34a;
  --warning:       #d97706;
  --danger:        #dc2626;
  --info:          #2563eb;
  --radius:        10px;
  --radius-lg:     16px;
  --sidebar-w:     240px;
  --topbar-h:      60px;
  --font-head:     'Syne', sans-serif;
  --font-body:     'Inter', sans-serif;
  --transition:    0.2s ease;
}

/* ── Light theme override — premium, eye-catching ─────────────
   Soft violet-tinted off-white canvas, crisp white card surfaces,
   ink-navy text for crispness, and a refined elevation shadow so
   cards lift off the page instead of looking flat. */
[data-theme="light"] {
  /* Platinum Violet×Gold — exact preset values */
  --dark:          #F4F3FB;
  --dark-2:        #FFFFFF;
  --dark-3:        #EBE9F8;
  --surface:       #F4F3FB;
  --surface-raised:#FFFFFF;
  --surface-sunken:#EBE9F8;
  --input-bg:      #EBE9F8;
  --white:         #1E1B4B;
  --text:          #3B3165;
  --text-muted:    #7C6FAB;
  --border:        rgba(109,40,217,0.12);
  --card-shadow:   0 1px 3px rgba(109,40,217,0.06), 0 8px 24px rgba(109,40,217,0.09);
}
:root { --card-shadow: none; }
[data-theme="light"] .card,
[data-theme="light"] .stat-card,
[data-theme="light"] .sidebar,
[data-theme="light"] .topbar,
[data-theme="light"] .preset-card {
  box-shadow: var(--card-shadow);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font-body); background: var(--dark); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
h1,h2,h3,h4 { font-family: var(--font-head); color: var(--white); }

/* ── Layout ────────────────────────────────── */
.admin-wrapper { display: flex; min-height: 100vh; }
.main-content  { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-left: var(--sidebar-w); }
.page-content  { flex: 1; padding: 28px 28px 48px; }

/* ── Sidebar ───────────────────────────────── */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: var(--dark-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 300; overflow-y: auto; }
.sidebar-logo { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.sidebar-logo-text { font-family: var(--font-head); font-size: 20px; font-weight: 800; color: var(--white); }
.sidebar-logo-text span { color: var(--primary); }
.sidebar-badge { font-size: 9px; font-weight: 800; letter-spacing: .1em; background: var(--primary); color: #fff; padding: 2px 7px; border-radius: 100px; }
.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section { margin-bottom: 20px; }
.nav-section-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); padding: 0 8px; margin-bottom: 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); font-size: 13.5px; font-weight: 500; color: var(--text-muted); transition: var(--transition); margin-bottom: 2px; }
.nav-item:hover { background: var(--dark-3); color: var(--white); }
.nav-item.active { background: rgba(232,69,10,0.15); color: var(--primary); font-weight: 600; }
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-badge { margin-left: auto; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 100px; }
.nav-badge.yellow { background: var(--warning); }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 36px; height: 36px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 800; color: #fff; font-size: 13px; flex-shrink: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--white); }
.sidebar-user-role { font-size: 11px; color: var(--text-muted); }

/* ── Topbar ────────────────────────────────── */
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--border); background: var(--dark-2); position: sticky; top: 0; z-index: 200; }
.topbar-title { flex: 1; font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--white); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn { width: 36px; height: 36px; background: var(--dark-3); border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; transition: var(--transition); position: relative; cursor: pointer; }
.topbar-btn:hover { color: var(--white); border-color: rgba(109,40,217,0.15); }
.sidebar-toggle { width: 36px; height: 36px; display: none; align-items: center; justify-content: center; background: var(--dark-3); border: 1px solid var(--border); border-radius: var(--radius); color: var(--white); font-size: 16px; }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; background: var(--danger); border-radius: 50%; border: 2px solid var(--dark-2); }

/* ── Cards ─────────────────────────────────── */
.card { background: var(--dark-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.card-title  { font-size: 16px; font-weight: 700; color: var(--white); font-family: var(--font-head); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Stat cards ────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--dark-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; position: relative; }
.stat-card-icon { width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 14px; }
.stat-card-icon.orange { background: rgba(232,69,10,0.15); color: var(--primary); }
.stat-card-icon.blue   { background: rgba(59,130,246,0.15); color: #3b82f6; }
.stat-card-icon.green  { background: rgba(34,197,94,0.15); color: #22c55e; }
.stat-card-icon.yellow { background: rgba(245,158,11,0.15); color: #f59e0b; }
.stat-card-value { font-family: var(--font-head); font-size: 26px; font-weight: 800; color: var(--white); }
.stat-card-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-card-change { font-size: 12px; margin-top: 8px; }
.stat-card-change.up { color: #22c55e; }

/* ── Tables ────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(109,40,217,0.05); }
td { padding: 12px 14px; vertical-align: middle; }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }
.text-white { color: var(--white) !important; }
.text-muted  { color: var(--text-muted); }
.text-primary{ color: var(--primary); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ── Badges ────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 700; }
.badge-success { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-danger  { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-info    { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-muted   { background: rgba(109,40,217,0.07); color: var(--text-muted); }

/* ── Buttons ───────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius); font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid transparent; transition: var(--transition); }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--dark-3); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { color: var(--white); border-color: rgba(109,40,217,0.18); }
.btn-danger    { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.25); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ── Forms ─────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label  { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 7px; }
.form-control { display: block; width: 100%; background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; color: var(--white); font-size: 13.5px; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,69,10,0.15); }
.form-control:disabled { opacity: .5; cursor: not-allowed; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control option { background: var(--dark-3); }

/* ── Filter bar ────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.filter-search { display: flex; align-items: center; gap: 8px; background: var(--dark-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 14px; flex: 1; min-width: 200px; }
.filter-search i { color: var(--text-muted); font-size: 13px; }
.filter-search input { background: none; border: none; color: var(--white); font-size: 13px; width: 100%; }
.filter-search input::placeholder { color: var(--text-muted); }
.filter-search input:focus { outline: none; }
.filter-select { background: var(--dark-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 14px; color: var(--text); font-size: 13px; cursor: pointer; }

/* ── Alerts ────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: #22c55e; }
.alert-error   { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #ef4444; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); color: #f59e0b; }
.alert-info    { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.2); color: #3b82f6; }

/* ── Auth pages ────────────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(232,69,10,0.12) 0%, transparent 70%); }
.auth-box { background: var(--dark-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 400px; }
.auth-box-logo { font-family: var(--font-head); font-size: 24px; font-weight: 800; color: var(--white); margin-bottom: 24px; text-align: center; }
.auth-box-logo span { color: var(--primary); }
.auth-box h1 { font-size: 22px; margin-bottom: 6px; text-align: center; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.auth-demo-box { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); border-radius: var(--radius); padding: 10px 14px; font-size: 12px; color: var(--text-muted); margin-top: 18px; text-align: center; }
.auth-box-foot { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 16px; }
.auth-box-foot a { color: var(--primary); }
.auth-box .btn { width: 100%; justify-content: center; margin-top: 4px; padding: 12px; }

/* ── Grid helpers ──────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-cols-60-40 { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; }

/* ── Empty state ───────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 40px; color: var(--text-muted); opacity: .3; margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; color: var(--text-muted); margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: var(--text-muted); }

/* ── Pagination ────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 20px 0 0; flex-wrap: wrap; }
.pagination .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Sidebar overlay (mobile) ──────────────── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(30,27,75,0.5); z-index: 299; }

/* ── Chart canvas ──────────────────────────── */
canvas { max-height: 260px; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .grid-cols-60-40 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-content { padding: 20px 16px 40px; }
}

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