:root {
  --bg: #0f172a;
  --panel: #111827;
  --surface: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-soft: #dbeafe;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 8px 24px rgba(2, 6, 23, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Segoe UI, Arial, sans-serif; color: var(--text); background: #f1f5f9; }
a { color: var(--brand); text-decoration: none; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; background: var(--bg); color: #cbd5e1; padding: 16px 12px; position: sticky; top: 0; height: 100vh;
}
.brand { color: #fff; font-weight: 700; font-size: 18px; margin-bottom: 20px; display: block; }
.nav { display: grid; gap: 6px; }
.nav a { color: #cbd5e1; padding: 10px 12px; border-radius: 8px; display: block; }
.nav a.active, .nav a:hover { background: #1e293b; color: #fff; }
.main { flex: 1; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 20px; display: flex; justify-content: space-between; align-items: center;
}
.content { padding: 20px; }
.page-title { margin: 0 0 14px; font-size: 24px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 12px; margin-bottom: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.card strong { font-size: 24px; display: block; margin-top: 6px; }

.toolbar, .subcards, .detail { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 14px; box-shadow: var(--shadow); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar input, .toolbar select, .toolbar button, form input, form button, textarea {
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 10px; background: #fff;
}
.toolbar button, .btn-link, form button { background: var(--brand); color: #fff; border-color: var(--brand); cursor: pointer; }
.btn-link { display: inline-block; border-radius: 8px; padding: 9px 10px; }
.toolbar label { font-size: 13px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { padding: 10px; border-bottom: 1px solid #edf2f7; text-align: left; font-size: 14px; }
th { background: #f8fafc; font-weight: 700; color: #334155; }
tr:hover { background: #f8fbff; }

.chart { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 4px; height: 180px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #f8fafc; }
.bar { background: linear-gradient(180deg, #60a5fa, #2563eb); min-height: 2px; border-radius: 4px 4px 0 0; }

.hidden { display: none; }
.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; border-radius: 8px; padding: 8px; margin-bottom: 8px; }

.login-wrap {
  max-width: 420px; margin: 90px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; box-shadow: var(--shadow);
}
.login-wrap form { display: grid; gap: 10px; }
code { background: var(--brand-soft); color: #1e3a8a; padding: 2px 6px; border-radius: 6px; }

@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; height: auto; position: static; }
}
