/* DealerMap Platform Admin — self-contained by design (code isolation from the
   customer console). Dark-only internal tool; same design tokens, own copy. */

:root {
  --bg: #000; --surface: #101014; --surface-2: #1a1a20; --surface-3: #26262e;
  --separator: #2c2c34; --text: #f2f2f7; --text-secondary: #98989e;
  --accent: #0a84ff; --danger: #ff453a; --ok: #34c759; --warn: #ffcc00;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* An author display rule (e.g. .gate{display:grid}) outranks the UA's [hidden] rule —
   without this, the gate, shell, and modal all render at once. */
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }

/* gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: min(400px, 92vw); background: var(--surface); border: 1px solid var(--separator);
  border-radius: 18px; padding: 28px; text-align: center; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 18px; font-weight: 700; }
.brand img { border-radius: 8px; }
.gate .sub { color: var(--warn); font-size: 11.5px; letter-spacing: 0.14em; margin: 8px 0 18px; }
.gate form { display: grid; gap: 7px; text-align: left; }
.gate label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.gate input { background: var(--surface-2); border: 1px solid var(--separator); border-radius: 10px;
  color: var(--text); font-size: 15px; padding: 10px 12px; outline: none; }
.gate input:focus { border-color: var(--accent); }
.gate button[type="submit"] { margin-top: 10px; background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 11px; font-size: 15px; font-weight: 600; }
.error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.foot { color: var(--text-secondary); font-size: 12.5px; margin-top: 16px; line-height: 1.5; }

/* shell */
.topbar { display: flex; align-items: center; gap: 20px; padding: 12px 20px;
  border-bottom: 1px solid var(--separator); background: var(--surface); flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10; }
.topbar .brand { font-size: 15.5px; }
.tag { background: rgba(255, 204, 0, 0.14); color: var(--warn); font-size: 10.5px;
  letter-spacing: 0.1em; font-weight: 700; border-radius: 6px; padding: 3px 8px; margin-left: 8px; }
#tabs { display: flex; gap: 4px; }
#tabs button { background: none; border: none; color: var(--text-secondary); font-size: 14px;
  font-weight: 600; padding: 8px 14px; border-radius: 9px; }
#tabs button.active { background: var(--surface-3); color: var(--text); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px;
  color: var(--text-secondary); font-size: 13px; }
.who button { background: none; border: 1px solid var(--separator); color: var(--text-secondary);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; }
main { max-width: 1100px; margin: 0 auto; padding: 26px 20px 60px; }

/* pieces */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px;
  margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--separator); border-radius: 14px;
  padding: 16px; }
.kpi strong { font-size: 26px; display: block; }
.kpi span { color: var(--text-secondary); font-size: 12.5px; }
.panel { background: var(--surface); border: 1px solid var(--separator); border-radius: 14px;
  padding: 18px; margin-bottom: 16px; }
.panel h3 { font-size: 16px; margin-bottom: 8px; }
.panel .sub { color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-secondary); font-size: 12px; letter-spacing: 0.04em;
  padding: 8px 10px; border-bottom: 1px solid var(--separator); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--separator); }
tr[data-org] { cursor: pointer; }
tr[data-org]:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.chip { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 7px; }
.chip.admin { background: rgba(10, 132, 255, 0.15); color: var(--accent); }
.chip.rep { background: rgba(152, 152, 158, 0.15); color: var(--text-secondary); }
.chip.owner { background: rgba(255, 204, 0, 0.14); color: var(--warn); }
.chip.off { background: rgba(255, 69, 58, 0.14); color: var(--danger); }
.btn { border: none; border-radius: 9px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: var(--surface-3); color: var(--text); }
.btn-danger { background: rgba(255, 69, 58, 0.16); color: var(--danger); }
select, input.f { background: var(--surface-2); border: 1px solid var(--separator);
  border-radius: 9px; color: var(--text); font-family: var(--font); font-size: 14px;
  padding: 8px 10px; outline: none; }
.skel { height: 44px; border-radius: 10px; background: var(--surface-2); margin: 10px 0;
  animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* modal + toast */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 100;
  display: grid; place-items: center; padding: 20px; }
.modal { width: min(480px, 94vw); background: var(--surface); border: 1px solid var(--separator);
  border-radius: 16px; padding: 22px; }
.modal h3 { margin-bottom: 8px; }
.modal p { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--surface-3); border: 1px solid var(--separator); border-radius: 12px;
  color: var(--text); font-size: 14px; padding: 11px 18px; z-index: 200; max-width: 90vw; }
