/* NIKHY admin — black & gold */
:root {
  --bg: #0A0A0A;
  --bg-2: #101010;
  --surface: #151515;
  --surface-2: #1C1C1C;
  --surface-3: #242424;
  --line: #2A2620;
  --line-2: #3A342A;
  --text: #F5F1E8;
  --muted: #A39C8C;
  --faint: #6F6A5F;
  --gold: #E8B54A;
  --gold-2: #F5C451;
  --gold-3: #C98A22;
  --gold-soft: rgba(232, 181, 74, .12);
  --ok: #4CC38A;
  --ok-soft: rgba(76, 195, 138, .12);
  --warn: #F0B04A;
  --err: #F06A6A;
  --err-soft: rgba(240, 106, 106, .12);
  --info: #6AA8F0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Poppins", var(--font);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: .2px; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; color: var(--muted); font-weight: 500; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.gold { color: var(--gold); }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grow { flex: 1; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #0E0D0B 0%, #0A0A0A 100%);
  border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
.brand img { width: 40px; height: 40px; }
.brand .name { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: 3px;
  background: linear-gradient(180deg, #F7D27A, var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .sub { font-size: 11px; color: var(--faint); letter-spacing: 1px; text-transform: uppercase; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; text-decoration: none; position: relative;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--gold-soft); color: var(--gold); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--gold); }
.nav .badge { margin-left: auto; }
.sidebar .foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px; padding: 16px 28px;
  background: rgba(10, 10, 10, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #1A1306;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); }
.content { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1400px; width: 100%; }
.btn.menu-btn { display: none; }
.btn svg, .alert-bar svg { width: 18px; height: 18px; flex: none; }

/* ---------- Cards & KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card > .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.kpi { position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.kpi .value { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--faint); font-size: 12px; margin-top: 2px; }
.kpi.accent { border-color: var(--line-2); background: linear-gradient(160deg, rgba(232,181,74,.14), rgba(232,181,74,.02) 60%), var(--surface); }
.kpi.accent .value { color: var(--gold-2); }
.kpi.alert { border-color: rgba(240,106,106,.5); background: linear-gradient(160deg, rgba(240,106,106,.16), transparent 60%), var(--surface); }
.kpi.alert .value { color: var(--err); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
th { color: var(--faint); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; background: var(--bg-2); }
tbody tr { transition: background .12s; }
tbody tr.click { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
td .sub { display: block; color: var(--faint); font-size: 12px; }
.empty { padding: 36px; text-align: center; color: var(--faint); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--muted); border: 1px solid transparent; white-space: nowrap; }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.info { background: rgba(106,168,240,.12); color: var(--info); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(76,195,138,.18); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--gold); color: #1A1306; }
.badge.err { background: var(--err); color: #fff; }

/* ---------- Forms ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
label.field .help { color: var(--faint); font-size: 11px; }
input, select, textarea {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 12px; font: inherit; outline: none; min-width: 0; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); padding: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; cursor: pointer; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-prefix input { padding-left: 28px; }
.search { max-width: 320px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.section-title .line { flex: 1; height: 1px; background: var(--line); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--gold-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), #E39A2D); color: #1A1306; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--err); border-color: rgba(240,106,106,.4); background: transparent; }
.btn.ok { color: var(--ok); border-color: rgba(76,195,138,.4); background: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.tabs { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.tabs button.active { background: var(--surface-3); color: var(--gold); }

/* ---------- Drawer / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; justify-content: flex-end; animation: fade .15s; }
.drawer { width: min(720px, 100%); height: 100%; overflow-y: auto; background: var(--bg-2); border-left: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 18px; animation: slide .2s ease-out; }
.overlay.center { justify-content: center; align-items: center; padding: 16px; }
.modal { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.doc .thumb { height: 100px; border-radius: 8px; background: var(--surface-3) center/cover no-repeat; display: grid; place-items: center; color: var(--faint); font-size: 12px; cursor: pointer; }

/* ---------- Chart ---------- */
.chart { width: 100%; height: 220px; }
.chart .bar { fill: var(--gold); opacity: .85; }
.chart .bar2 { fill: var(--surface-3); }
.chart text { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 2 4; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Surge preview ---------- */
.surge-big { font-family: var(--font-display); font-size: 44px; font-weight: 700; color: var(--gold-2); line-height: 1; }
.factor { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rush { display: grid; grid-template-columns: 1.3fr 2fr .8fr .8fr .7fr auto auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: inline-flex; }
.days input { display: none; }
.days span { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.days input:checked + span { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-3); }

/* ---------- Toast & login ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50; padding: 12px 18px; border-radius: 12px;
  background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600; animation: fade .2s; }
.toast.err { border-color: rgba(240,106,106,.6); color: var(--err); }
.toast.ok { border-color: rgba(76,195,138,.5); color: var(--ok); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(90% 60% at 50% 0%, #1d170c 0%, var(--bg) 65%); }
.login .card { width: 100%; max-width: 400px; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; }
.login .logo { width: 84px; height: 84px; margin: 0 auto 4px; display: block; }
.login h1 { text-align: center; letter-spacing: 4px; font-size: 26px;
  background: linear-gradient(180deg, #F7D27A, var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.alert-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--err-soft); border: 1px solid rgba(240,106,106,.4); color: var(--err); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .btn.menu-btn { display: inline-flex; }
  .hide-sm { display: none; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }
  .grid.two { grid-template-columns: 1fr; }
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .value { font-size: 22px; }
  .card { padding: 14px 16px; }
  .rush { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .table-wrap { margin: 0 -20px; }
}
