:root{
  --bg:#f4f6fb;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e7eaf0;
  --primary:#6d4aff;
  --primary-2:#8b5cf6;
  --sidebar:#0e1220;
  --sidebar-soft:#171c2e;
  --green:#16a34a;
  --blue:#2563eb;
  --amber:#d97706;
  --red:#dc2626;
  --purple:#7c3aed;
  --shadow:0 12px 35px rgba(15,23,42,.06);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}
a{color:inherit;text-decoration:none}
button,input{font:inherit}
button{cursor:pointer}
.app-shell{min-height:100vh;background:var(--bg)}

.sidebar{
  position:fixed;left:0;top:0;bottom:0;width:260px;
  background:linear-gradient(180deg,#0c1020,#11162a);
  color:#d9deeb;padding:24px 18px;z-index:40;
  display:flex;flex-direction:column;
}
.brand-wrap{display:flex;align-items:center;gap:12px;padding:2px 8px 24px}
.brand-mark{
  width:42px;height:42px;border-radius:14px;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--primary),#9f7aea);
  color:#fff;font-weight:900;font-size:20px;box-shadow:0 8px 24px rgba(109,74,255,.35)
}
.brand-title{color:#fff;font-weight:900;letter-spacing:.02em;font-size:15px}
.brand-title span{color:#a78bfa}
.brand-subtitle{font-size:10px;color:#8891a7;margin-top:3px}
.side-nav{display:flex;flex-direction:column;gap:6px}
.side-nav a{
  min-height:44px;display:flex;align-items:center;gap:12px;padding:0 12px;
  border-radius:12px;color:#aeb7cb;font-weight:650;font-size:14px;
  transition:.18s ease
}
.side-nav a:hover,.side-nav a.active{background:rgba(255,255,255,.08);color:#fff}
.nav-icon{width:22px;text-align:center;font-size:16px;opacity:.95}
.soon{margin-left:auto;font-size:9px;padding:4px 6px;border-radius:999px;background:rgba(255,255,255,.08);color:#9da6bc}
.sidebar-footer{margin-top:auto}
.trial-card{
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.05);
  border-radius:16px;padding:14px;margin-bottom:10px
}
.trial-card strong{display:block;color:#fff;font-size:13px;margin:3px 0}
.trial-card span{font-size:10px;color:#9099ad}
.trial-label{font-size:9px;color:#a78bfa;font-weight:900;letter-spacing:.12em}
.logout-link{display:block;padding:10px 12px;color:#aeb7cb;font-size:13px}

.content-shell{margin-left:260px;min-height:100vh}
.topbar{
  height:72px;background:rgba(255,255,255,.92);backdrop-filter:blur(16px);
  border-bottom:1px solid var(--line);display:flex;align-items:center;
  justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:25
}
.menu-btn{display:none;border:0;background:transparent;font-size:22px}
.search-wrap{position:relative;width:min(460px,48vw)}
.search-wrap input{
  width:100%;height:42px;border:1px solid var(--line);background:#f8fafc;
  border-radius:12px;padding:0 14px 0 40px;outline:none;color:var(--text)
}
.search-wrap input:focus{border-color:#c8b9ff;box-shadow:0 0 0 4px rgba(109,74,255,.08)}
.search-icon{position:absolute;left:14px;top:9px;color:#9aa2b1;font-size:20px}
.topbar-actions{display:flex;align-items:center;gap:12px}
.icon-btn{
  width:40px;height:40px;border:1px solid var(--line);background:#fff;border-radius:12px
}
.profile-chip{display:flex;align-items:center;gap:10px}
.avatar{
  width:38px;height:38px;border-radius:12px;background:#efeafd;color:var(--primary);
  display:grid;place-items:center;font-weight:900
}
.profile-meta{display:flex;flex-direction:column;line-height:1.15}
.profile-meta strong{font-size:13px}
.profile-meta span{font-size:10px;color:var(--muted);margin-top:4px}

.app-main{padding:28px 30px 38px;max-width:1600px;margin:0 auto}
.welcome-row{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:22px}
.welcome-row h1{margin:6px 0 4px;font-size:34px;letter-spacing:-.03em}
.welcome-row p{margin:0;color:var(--muted)}
.eyebrow{font-size:10px;font-weight:900;letter-spacing:.14em;text-transform:uppercase;color:var(--primary)}
.btn{
  display:inline-flex;align-items:center;justify-content:center;border-radius:12px;
  padding:11px 16px;border:1px solid transparent;font-weight:800;font-size:13px
}
.btn-large{padding:13px 18px}
.btn-primary{background:linear-gradient(135deg,var(--primary),var(--primary-2));color:#fff;box-shadow:0 10px 24px rgba(109,74,255,.2)}
.btn-primary:hover{filter:brightness(.98)}

.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}
.stat-card{
  background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px;
  display:flex;gap:14px;align-items:center;box-shadow:var(--shadow)
}
.stat-icon{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;font-weight:900;font-size:18px}
.stat-icon.purple{background:#f1ecff;color:var(--purple)}
.stat-icon.green{background:#eaf8ee;color:var(--green)}
.stat-icon.blue{background:#eaf2ff;color:var(--blue)}
.stat-icon.amber{background:#fff4df;color:var(--amber)}
.stat-card span{display:block;font-size:12px;color:var(--muted);margin-bottom:2px}
.stat-card strong{display:block;font-size:28px;letter-spacing:-.04em}
.stat-card small{display:block;font-size:10px;color:#9aa2b1;margin-top:2px}

.dashboard-grid{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px}
.panel{background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow)}
.orders-panel{padding:20px}
.panel-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.panel-header.compact{margin-bottom:8px}
.panel-header h2{margin:4px 0 0;font-size:18px;letter-spacing:-.02em}
.text-link{font-size:12px;font-weight:800;color:var(--primary)}
.table-wrap{overflow:auto}
.orders-table{width:100%;border-collapse:collapse}
.orders-table th{
  text-align:left;padding:12px 10px;border-bottom:1px solid var(--line);
  font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#8d95a6
}
.orders-table td{padding:14px 10px;border-bottom:1px solid #f0f2f6;vertical-align:middle}
.orders-table tr:last-child td{border-bottom:0}
.folio{font-weight:900;font-size:12px;color:#252a35}
.table-main{font-size:12px;font-weight:750}
.table-sub{font-size:10px;color:#9aa2b1;margin-top:3px}
.amount{font-weight:900;font-size:12px}
.status-badge{display:inline-flex;align-items:center;padding:6px 9px;border-radius:999px;font-size:9px;font-weight:900;white-space:nowrap}
.status-neutral{background:#eef1f5;color:#596273}
.status-blue{background:#eaf2ff;color:#2563eb}
.status-amber{background:#fff5df;color:#b96800}
.status-purple{background:#f1ecff;color:#6d28d9}
.status-orange{background:#fff0e4;color:#c2410c}
.status-green{background:#e9f8ee;color:#15803d}
.status-dark{background:#e8ebf0;color:#374151}
.status-red{background:#ffecec;color:#b91c1c}

.right-column{display:flex;flex-direction:column;gap:16px}
.alert-panel,.quick-panel,.genesis-card{padding:18px}
.alert-list{display:flex;flex-direction:column}
.alert-item{display:flex;gap:10px;padding:12px 0;border-bottom:1px solid #f0f2f6}
.alert-item:last-child{border-bottom:0}
.alert-dot{width:9px;height:9px;border-radius:50%;margin-top:5px;flex:0 0 auto}
.alert-dot.green{background:var(--green)}.alert-dot.amber{background:var(--amber)}.alert-dot.red{background:var(--red)}
.alert-item strong{display:block;font-size:12px}
.alert-item span{font-size:10px;color:var(--muted)}

.quick-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.quick-grid a{
  min-height:74px;border:1px solid var(--line);border-radius:14px;padding:12px;
  display:flex;flex-direction:column;justify-content:center;gap:6px;font-size:11px;font-weight:800
}
.quick-grid a:hover{border-color:#cbbcff;background:#faf8ff}
.quick-grid a span{font-size:20px;color:var(--primary)}

.genesis-card{
  background:linear-gradient(145deg,#151a2d,#0f1323);
  color:#fff;border-color:transparent
}
.genesis-card h3{font-size:18px;margin:10px 0 8px}
.genesis-card p{font-size:11px;line-height:1.55;color:#adb5c8;margin:0}
.genesis-badge{display:inline-flex;padding:5px 8px;border-radius:999px;background:rgba(167,139,250,.14);color:#c4b5fd;font-size:9px;font-weight:900;letter-spacing:.12em}
.progress-row{margin-top:16px}
.progress-bar{height:7px;border-radius:999px;background:rgba(255,255,255,.09);overflow:hidden}
.progress-bar span{display:block;height:100%;background:linear-gradient(90deg,#7c3aed,#a78bfa);border-radius:999px}
.progress-row small{display:block;color:#7f889d;font-size:9px;margin-top:7px}

.empty-state{min-height:240px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--muted);gap:7px}
.empty-state strong{color:var(--text)}
.empty-state .btn{margin-top:8px}
.empty-icon{width:44px;height:44px;border-radius:14px;background:#f1ecff;color:var(--primary);display:grid;place-items:center;font-size:22px}

.toast{
  position:fixed;right:24px;bottom:24px;z-index:90;
  background:#111827;color:#fff;padding:12px 16px;border-radius:12px;
  font-size:12px;box-shadow:0 16px 40px rgba(0,0,0,.2);
  opacity:0;transform:translateY(10px);pointer-events:none;transition:.2s
}
.toast.show{opacity:1;transform:translateY(0)}

@media(max-width:1180px){
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .dashboard-grid{grid-template-columns:1fr}
  .right-column{display:grid;grid-template-columns:repeat(3,1fr)}
}

@media(max-width:860px){
  .sidebar{transform:translateX(-100%);transition:.2s}
  .sidebar.open{transform:translateX(0)}
  .content-shell{margin-left:0}
  .menu-btn{display:block}
  .topbar{padding:0 16px}
  .search-wrap{width:44vw}
  .profile-meta{display:none}
  .app-main{padding:22px 16px 30px}
  .welcome-row{align-items:flex-start;flex-direction:column}
  .welcome-row h1{font-size:28px}
  .right-column{grid-template-columns:1fr}
}

@media(max-width:560px){
  .stats-grid{grid-template-columns:1fr}
  .search-wrap{display:none}
  .btn-large{width:100%}
  .welcome-row{gap:14px}
  .app-main{padding:18px 12px 24px}
  .orders-panel{padding:14px}
}
