:root {
  --bg: #0b1220;
  --surface: #121a2b;
  --surface-2: #172135;
  --border: #24324a;
  --text: #e7ecf5;
  --muted: #9ba7bc;
  --accent: #4f8cff;
  --accent-2: #6ad0ff;
  --success: #1f9d64;
  --danger: #d1495b;
  --warning: #f4a261;
  --shadow: 0 12px 32px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #07101d 0%, #0d1627 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: rgba(9, 15, 29, .9);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display:flex; gap:14px; align-items:center; margin-bottom: 24px; }
.logo {
  width: 44px; height: 44px; border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; font-weight: 800;
}
.brand span { display:block; color:var(--muted); font-size:.88rem; margin-top:3px; }
.sidebar nav { display:flex; flex-direction:column; gap:8px; }
.sidebar nav a {
  padding: 12px 14px; border-radius: 14px; color: var(--muted);
}
.sidebar nav a:hover { background: var(--surface); color: var(--text); }
.main-content { padding: 24px; }
.topbar { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom: 20px; gap:16px; }
.topbar h1 { margin:0 0 6px; font-size: 2rem; }
.topbar p { margin:0; color: var(--muted); }
.user-pill {
  padding: 10px 14px; border-radius: 999px; background: var(--surface);
  border:1px solid var(--border); color: var(--muted);
}
.switcher { margin-bottom: 18px; display:grid; gap:8px; }
.switcher select, .switcher button { width:100%; }
.card {
  background: rgba(18, 26, 43, .95);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h2 { margin-top:0; font-size:1.1rem; }
.grid.cards { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom: 18px; }
.grid.two { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
.stat span { color: var(--muted); font-size:.9rem; }
.stat strong { display:block; margin-top:10px; font-size: 1.8rem; }
button, .btn {
  border: none;
  background: linear-gradient(135deg, var(--accent), #6ea7ff);
  color: white;
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  display:inline-flex; align-items:center; justify-content:center;
}
button.small, .btn.small { padding: 8px 10px; font-size:.85rem; border-radius: 12px; }
button.danger { background: linear-gradient(135deg, var(--danger), #ef6f82); }
.btn.secondary { background: var(--surface-2); color: var(--text); border:1px solid var(--border); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
form { display:grid; gap:12px; }
.grid-form { display:grid; grid-template-columns: repeat(2,1fr); gap:14px; }
.grid-form .full { grid-column: 1 / -1; }
label { display:grid; gap:8px; font-size:.92rem; color:var(--muted); }
input, select, textarea {
  width:100%; padding: 12px 14px; border-radius: 14px; border:1px solid var(--border);
  background: #0d1526; color: var(--text);
}
textarea { min-height: 100px; resize: vertical; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; }
th, td { padding: 12px; border-bottom:1px solid var(--border); text-align:left; vertical-align: top; }
th { color:var(--muted); font-weight:600; }
.flash {
  margin-bottom: 16px; padding: 12px 16px; border-radius: 14px;
  border:1px solid var(--border); background: var(--surface);
}
.flash.success { border-color: rgba(31,157,100,.4); }
.flash.error { border-color: rgba(209,73,91,.4); }
.auth-wrap { min-height: 80vh; display:grid; place-items:center; }
.auth-card {
  width:min(500px, 100%); background: rgba(18,26,43,.96); border:1px solid var(--border);
  border-radius: 24px; padding: 26px; box-shadow: var(--shadow);
}
.demo-box { margin-top: 16px; padding: 14px; border-radius: 16px; background: #0d1526; color: var(--muted); }
.actions, .inline-actions { display:flex; flex-wrap:wrap; gap:10px; }
.clean { margin:0; padding-left: 20px; color: var(--muted); }
@media (max-width: 1100px) {
  .grid.cards { grid-template-columns: repeat(2,1fr); }
  .grid.two, .grid-form { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position:relative; height:auto; }
}
