:root {
  color-scheme: dark;
  --bg: #060816;
  --panel: #10172a;
  --border: #273449;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #6d28d9;
  --accent2: #0891b2;
  --good: #22c55e;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg), #111827);
  color: var(--text);
  min-height: 100vh;
}

.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.card { max-width: 560px; padding: 32px; text-align: center; background: rgba(16,23,42,0.95); border: 1px solid var(--border); border-radius: 24px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 270px; background: #090d18; border-right: 1px solid var(--border); padding: 24px 16px; display: flex; flex-direction: column; gap: 20px; }
.brand h2 { margin: 0; font-size: 1.2rem; }
.brand p { margin: 4px 0 0; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 8px; }
.nav-item { text-align: left; padding: 12px 14px; border-radius: 12px; background: transparent; color: var(--text); border: 1px solid transparent; cursor: pointer; transition: all .2s ease; }
.nav-item:hover { background: rgba(109,40,217,0.2); border-color: var(--border); transform: translateX(3px); }
.nav-item.active { background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 6px 18px rgba(109,40,217,0.25); }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.sidebar-card { padding: 12px; border-radius: 12px; background: rgba(16,23,42,0.95); border: 1px solid var(--border); }
.small-label { margin: 0 0 4px; font-size: .75rem; color: var(--muted); text-transform: uppercase; }

.dashboard-main { flex: 1; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.searchbar input { padding: 9px 12px; border-radius: 999px; border: 1px solid var(--border); background: #111827; color: var(--text); width: 220px; }
.user-badge { background: #1f2937; padding: 8px 12px; border-radius: 999px; color: var(--muted); }

.panel { background: rgba(16,23,42,0.95); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.08); color: var(--text); border-radius: 999px; padding: 5px 10px; font-size: .8rem; }
.pill.good { background: rgba(34,197,94,0.18); color: var(--good); }
.pill.warn { background: rgba(245,158,11,0.16); color: var(--warn); }

.grid, .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 12px; }
.action-card { padding: 16px; border-radius: 14px; background: linear-gradient(135deg, #111827, #1f2937); border: 1px solid var(--border); }
.action-card h3 { margin: 0 0 8px; }
.action-card p { margin: 0 0 10px; color: var(--muted); }

.stat-card h3 { margin: 0 0 8px; color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; }
.stat-card p { margin: 0; font-size: 1.25rem; font-weight: 700; }

.btn { display: inline-block; padding: 10px 14px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #8b5cf6); color: white; text-decoration: none; font-weight: 700; border: none; cursor: pointer; transition: transform .15s ease, opacity .15s ease; box-shadow: 0 8px 20px rgba(109,40,217,0.25); }
.btn:hover { transform: translateY(-1px); opacity: .95; }
.btn.small { padding: 8px 12px; font-size: .9rem; }
.btn.secondary { background: #4c1d95; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.select, .textarea, .input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: #111827; color: var(--text); margin-top: 8px; }
.select:focus, .textarea:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(109,40,217,0.2); }

.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.list li { padding: 12px 14px; background: linear-gradient(135deg, #111827, #1f2937); border-radius: 12px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.activity-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.activity-list li { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; background: #111827; border: 1px solid var(--border); border-radius: 12px; }
.activity-list span { color: var(--muted); font-size: .95rem; }

.mini-section { margin-top: 16px; }
.notice { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(8,145,178,0.16); color: #bae6fd; border: 1px solid rgba(8,145,178,0.3); }
.sub-panel { margin-bottom: 0; }
.muted-box { margin-top: 12px; padding: 12px; border-radius: 12px; background: rgba(109,40,217,0.12); color: var(--muted); border: 1px solid rgba(109,40,217,0.18); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--muted); font-size: .85rem; text-transform: uppercase; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 1000; }
.modal { width: min(540px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.icon-btn { background: transparent; color: var(--text); border: none; cursor: pointer; font-size: 1.1rem; }
.toast-container { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1100; }
.toast { padding: 12px 14px; border-radius: 12px; background: #111827; border: 1px solid var(--border); color: var(--text); min-width: 240px; }
.hidden { display: none; }

@media (max-width: 900px) { .app-shell { flex-direction: column; } .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); } .topbar { flex-direction: column; align-items: flex-start; } .searchbar input { width: 100%; } }
