:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #667085;
  --primary: #1158d6;
  --primary-dark: #0d47af;
  --success: #12b76a;
  --warning: #f79009;
  --danger: #f04438;
  --border: #d9e2ef;
  --shadow: 0 20px 50px rgba(16, 24, 40, .10);

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; font-family: Manrope, system-ui, sans-serif; background: radial-gradient(circle at top left, #d7ecff, transparent 32%), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.badge { display: inline-flex; width: fit-content; border-radius: 999px; padding: 6px 10px; background: #dbeafe; color: #1e3a8a; font-size: 12px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, #1158d6, #0891b2); color: white; font-weight: 900; box-shadow: 0 15px 35px rgba(17, 88, 214, .35); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 14px; font-size: 14px; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) 430px; gap: 48px; align-items: center; padding: 48px clamp(24px, 7vw, 96px); }
.login-hero h1 { max-width: 760px; margin: 0; font-size: clamp(38px, 6vw, 72px); line-height: .95; letter-spacing: -.06em; }
.login-hero p:not(.eyebrow) { max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.hero-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.hero-stats span { display: grid; gap: 3px; min-width: 120px; padding: 16px; border: 1px solid rgba(255,255,255,.7); border-radius: 18px; background: rgba(255,255,255,.65); backdrop-filter: blur(12px); }
.hero-stats strong { font-size: 26px; }
.login-card { display: grid; gap: 16px; padding: 28px; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: rgba(255,255,255,.86); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.login-card h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.login-card label { display: grid; gap: 8px; color: #344054; font-weight: 700; }
.login-card input { width: 100%; border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; background: white; outline: none; }
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36,87,245,.12); }
.login-card button, .primary { border: 0; border-radius: 14px; padding: 14px 18px; background: var(--primary); color: white; font-weight: 800; box-shadow: 0 12px 25px rgba(36,87,245,.25); }
.login-card button:hover, .primary:hover { background: var(--primary-dark); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 22px; background: #0b1220; color: white; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.sidebar-brand span { display: block; margin-top: 2px; color: #98a2b3; font-size: 13px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar button { border: 0; border-radius: 14px; padding: 13px 14px; background: transparent; color: #d0d5dd; text-align: left; font-weight: 700; }
.sidebar button:hover, .sidebar button.active { background: rgba(255,255,255,.10); color: #fff; }
.sidebar-footer { margin-top: auto; display: flex; gap: 9px; align-items: center; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.08); color: #d0d5dd; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(18,183,106,.15); }
main { min-width: 0; padding: 26px; max-width: 1440px; width: 100%; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 22px; padding: 22px 24px; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; background: rgba(255,255,255,.78); box-shadow: 0 10px 30px rgba(16,24,40,.06); backdrop-filter: blur(16px); }
.topbar h2 { margin: 0; font-size: 32px; letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.ghost { border: 1px solid var(--border); border-radius: 13px; padding: 11px 14px; background: white; color: var(--text); font-weight: 800; }
.user-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 9px 12px; background: #101828; color: white; font-size: 13px; font-weight: 700; }
.alert { margin-bottom: 16px; padding: 12px 14px; border-radius: 14px; background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-3); }
.card { border: 1px solid rgba(255,255,255,.85); border-radius: var(--radius-lg); padding: var(--space-4); background: rgba(255,255,255,.86); box-shadow: 0 12px 34px rgba(16,24,40,.07); }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.metric { display: grid; gap: 10px; }
.metric label { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric strong { font-size: 31px; letter-spacing: -.04em; }
.trend { width: fit-content; border-radius: 999px; padding: 5px 9px; background: #dcfae6; color: #067647; font-size: 12px; font-weight: 800; }
.trend.warning { background: #fef0c7; color: #b54708; }
.chart { height: 220px; display: flex; align-items: end; gap: 10px; padding-top: 24px; }
.bar { flex: 1; min-height: 22px; border-radius: 12px 12px 5px 5px; background: linear-gradient(180deg, #528bff, #2457f5); }
.bar-h-38 { height: 38%; }
.bar-h-42 { height: 42%; }
.bar-h-58 { height: 58%; }
.bar-h-64 { height: 64%; }
.bar-h-72 { height: 72%; }
.bar-h-76 { height: 76%; }
.bar-h-88 { height: 88%; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 14px; }
.section-title h3 { margin: 0; font-size: 18px; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 18px; background: white; }
.table-empty { border: 1px dashed var(--border); border-radius: 14px; padding: 18px; background: #fbfdff; }
.table-toolbar, .pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; }
.table-toolbar input { max-width: 320px; width: 100%; border: 1px solid var(--border); border-radius: 13px; padding: 11px 12px; background: white; outline: none; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { border-bottom: 1px solid var(--border); padding: 13px 14px; text-align: left; font-size: 14px; }
th { background: var(--panel-soft); color: #475467; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-flex; border-radius: 999px; padding: 5px 9px; background: #eef4ff; color: #3538cd; font-size: 12px; font-weight: 800; }
.pill.success { background: #dcfae6; color: #067647; }
.pill.warning { background: #fef0c7; color: #b54708; }
.pill.danger { background: #fee4e2; color: #b42318; }
.split-list { display: grid; gap: 12px; }
.list-item { display: flex; justify-content: space-between; gap: 12px; padding: 13px; border-radius: 16px; background: var(--panel-soft); }
.list-item strong { display: block; margin-bottom: 3px; }
.form-grid { display: grid; gap: var(--space-2); }
.form-grid label { display: grid; gap: 7px; color: #344054; font-size: 13px; font-weight: 800; }
.form-grid input, .form-grid select { width: 100%; border: 1px solid var(--border); border-radius: 13px; padding: 11px 12px; background: white; outline: none; }
.form-grid input:focus, .form-grid select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36,87,245,.12); }
.stack { display: grid; gap: var(--space-3); }
.inline-note { margin-top: 14px; }

@media (max-width: 1200px) {
  .login-layout { grid-template-columns: 1fr; gap: 24px; }
  .login-hero h1 { font-size: clamp(36px, 6vw, 56px); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; overflow: visible; }
  .sidebar nav { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}

@media (max-width: 640px) {
  main { padding: 14px; }
  .topbar { padding: 16px; border-radius: 16px; }
  .topbar h2 { font-size: 26px; }
  .card { padding: 14px; border-radius: 16px; }
}
