:root {
  --adm-bg: #070a12;
  --adm-side: #0b101d;
  --adm-card: #101728;
  --adm-card-2: #161f35;
  --adm-border: rgba(148, 163, 184, 0.14);
  --adm-text: #f1f5f9;
  --adm-muted: #94a3b8;
  --adm-indigo: #6366f1;
  --adm-indigo-h: #4f46e5;
  --adm-cyan: #38bdf8;
  --adm-emerald: #10b981;
  --adm-amber: #f59e0b;
  --adm-danger: #ef4444;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: radial-gradient(circle at top right, #171e38 0%, var(--adm-bg) 52%);
  color: var(--adm-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  font-size: 14px;
}

.hidden { display: none !important; }
.adm-muted { color: var(--adm-muted); font-size: 0.82rem; margin: 2px 0 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }
.num { font-variant-numeric: tabular-nums; }

.btn-adm {
  border: none; border-radius: 10px; padding: 9px 14px;
  font-family: inherit; font-weight: 600; font-size: 0.84rem;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; transition: background 0.14s ease, transform 0.1s ease;
}
.btn-adm:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 11px; font-size: 0.78rem; }
.btn-xs { padding: 4px 9px; font-size: 0.74rem; border-radius: 7px; }
.btn-indigo { background: linear-gradient(135deg, var(--adm-indigo), var(--adm-indigo-h)); color: #fff; }
.btn-indigo:hover { filter: brightness(1.08); }
.btn-emerald { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.45); }
.btn-danger { background: rgba(239, 68, 68, 0.16); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--adm-text); border: 1px solid var(--adm-border); }

.adm-icon-btn {
  background: rgba(255,255,255,0.06); border: 1px solid var(--adm-border); color: var(--adm-text);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 1rem;
  display: inline-grid; place-items: center;
}

label { display: flex; flex-direction: column; gap: 5px; font-size: 0.8rem; color: #cbd5e1; font-weight: 500; }
input, select, .adm-input {
  background: var(--adm-card-2); border: 1px solid var(--adm-border); color: var(--adm-text);
  padding: 9px 11px; border-radius: 9px; font-family: inherit; font-size: 0.86rem;
}
input:focus, select:focus { outline: 2px solid var(--adm-indigo); border-color: transparent; }
.adm-input.sm { min-width: 170px; }
.adm-stack { display: flex; flex-direction: column; gap: 12px; }

.adm-toast {
  position: fixed; top: 16px; right: 16px; z-index: 400;
  background: #1e293b; border: 1px solid var(--adm-indigo); color: #fff;
  padding: 11px 16px; border-radius: 11px; box-shadow: 0 14px 34px rgba(0,0,0,0.55);
  max-width: 360px; font-size: 0.86rem; font-weight: 500;
}
.adm-toast.error { border-color: var(--adm-danger); }

.adm-gate { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.adm-gate-card {
  width: 100%; max-width: 420px; background: var(--adm-card); border: 1px solid var(--adm-border);
  border-radius: 20px; padding: 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.adm-gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.adm-gate-brand h1 { margin: 0; font-size: 1.25rem; font-weight: 800; }
.adm-gate-brand p { margin: 2px 0 0; font-size: 0.78rem; color: var(--adm-muted); }
.adm-logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem;
  background: linear-gradient(135deg, var(--adm-indigo), var(--adm-cyan));
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}
.adm-logo.sm { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 10px; }
.adm-denied {
  margin-top: 14px; padding: 12px; border-radius: 12px;
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca; font-size: 0.84rem;
}
.adm-denied p { margin: 0 0 10px; }
.adm-gate-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--adm-border);
  display: flex; justify-content: space-between; align-items: center; font-size: 0.76rem; color: var(--adm-muted);
}
.adm-back-link { color: var(--adm-cyan); text-decoration: none; font-weight: 600; }

.adm-shell { display: flex; min-height: 100vh; }
.adm-sidebar {
  width: 256px; flex-shrink: 0; background: var(--adm-side); border-right: 1px solid var(--adm-border);
  display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh;
}
.adm-side-head {
  display: flex; align-items: center; gap: 10px; padding: 4px 6px 16px;
  border-bottom: 1px solid var(--adm-border); margin-bottom: 14px;
}
.adm-side-title { font-weight: 800; font-size: 1rem; }
.adm-side-sub { font-size: 0.64rem; letter-spacing: 0.08em; color: var(--adm-cyan); font-weight: 700; }
.adm-nav-group { margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.adm-nav-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em; color: #64748b; padding: 0 10px 4px; }
.adm-nav-item {
  width: 100%; border: none; background: transparent; color: var(--adm-muted);
  padding: 9px 11px; border-radius: 10px; cursor: pointer; font-family: inherit;
  font-size: 0.86rem; font-weight: 600; display: flex; align-items: center; gap: 10px; text-align: left;
}
.adm-nav-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--adm-text); }
.adm-nav-item.active {
  background: rgba(99, 102, 241, 0.18); color: #c7d2fe; border: 1px solid rgba(99, 102, 241, 0.35);
}
.adm-count-pill {
  margin-left: auto; background: var(--adm-amber); color: #271502;
  font-size: 0.7rem; font-weight: 800; padding: 1px 7px; border-radius: 999px;
}
.adm-side-foot {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--adm-border);
  display: flex; flex-direction: column; gap: 10px;
}
.adm-operator strong { display: block; font-size: 0.84rem; }
.adm-operator span { display: block; font-size: 0.74rem; color: var(--adm-muted); overflow: hidden; text-overflow: ellipsis; }
.adm-side-actions { display: flex; gap: 8px; }

.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-topbar {
  padding: 14px 22px; border-bottom: 1px solid var(--adm-border);
  background: rgba(11, 16, 29, 0.75); backdrop-filter: blur(10px);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40;
}
.adm-top-left { display: flex; align-items: center; gap: 12px; }
.adm-top-left h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.adm-top-right { display: flex; align-items: center; gap: 10px; }
.adm-utc-pill {
  background: var(--adm-card-2); border: 1px solid var(--adm-border);
  padding: 6px 10px; border-radius: 999px; font-size: 0.76rem; color: #cbd5e1; font-variant-numeric: tabular-nums;
}
.adm-content { padding: 20px 22px 44px; max-width: 1380px; width: 100%; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-card { background: var(--adm-card); border: 1px solid var(--adm-border); border-radius: 15px; padding: 14px 16px; }
.kpi-card span { display: block; font-size: 0.75rem; color: var(--adm-muted); font-weight: 600; }
.kpi-card strong { display: block; font-size: 1.45rem; font-weight: 800; margin: 5px 0 3px; font-variant-numeric: tabular-nums; }
.kpi-card small { font-size: 0.72rem; color: var(--adm-muted); }
.kpi-card.indigo strong { color: #a5b4fc; }
.kpi-card.emerald strong { color: #34d399; }
.kpi-card.amber strong { color: #fbbf24; }
.kpi-card.cyan strong { color: #38bdf8; }

.adm-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; }
.adm-card { background: var(--adm-card); border: 1px solid var(--adm-border); border-radius: 16px; padding: 16px; }
.adm-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.adm-card-head h3 { margin: 0; font-size: 0.98rem; font-weight: 700; }
.adm-tag {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 999px;
  background: rgba(56, 189, 248, 0.14); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.25);
}
.adm-list { display: flex; flex-direction: column; gap: 8px; }
.adm-list-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px; background: var(--adm-card-2); border: 1px solid var(--adm-border);
}

.adm-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-toolbar input[type="search"] { flex: 1; min-width: 220px; }
.adm-subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-subtab {
  background: var(--adm-card); border: 1px solid var(--adm-border); color: var(--adm-muted);
  padding: 8px 14px; border-radius: 10px; font-family: inherit; font-weight: 600; font-size: 0.82rem; cursor: pointer;
}
.adm-subtab.active { background: var(--adm-indigo); color: #fff; border-color: var(--adm-indigo); }

.adm-table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.adm-table th {
  text-align: left; padding: 9px 10px; color: var(--adm-muted); font-weight: 600;
  border-bottom: 1px solid var(--adm-border); white-space: nowrap; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.adm-table td { padding: 10px; border-bottom: 1px solid rgba(148, 163, 184, 0.08); vertical-align: middle; }
.adm-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.st-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
.st-ok { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
.st-warn { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.st-bad { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.st-info { background: rgba(99, 102, 241, 0.2); color: #c7d2fe; }
.st-muted { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }

.adm-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.adm-sublabel { font-size: 0.78rem; color: var(--adm-muted); font-weight: 600; margin: 12px 0 6px; }
.adm-mult-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.adm-save-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--adm-card); border: 1px solid rgba(99, 102, 241, 0.35); padding: 14px 16px; border-radius: 14px;
}
.adm-kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.adm-modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(4, 6, 12, 0.8); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px;
}
.adm-modal-card { width: 100%; max-width: 460px; background: var(--adm-card); border: 1px solid var(--adm-border); border-radius: 18px; padding: 18px; }
.adm-pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.adm-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.mobile-only { display: none; }
@media (max-width: 860px) {
  .mobile-only { display: inline-grid; }
  .adm-sidebar { position: fixed; left: -270px; top: 0; bottom: 0; z-index: 200; transition: left 0.2s ease; }
  .adm-sidebar.open { left: 0; box-shadow: 20px 0 50px rgba(0, 0, 0, 0.7); }
  .adm-content { padding: 14px; }
  .adm-topbar { padding: 12px 14px; }
  .adm-mult-grid { grid-template-columns: repeat(2, 1fr); }
}
