/* Innom admin -- shares EquipDesk's design tokens (dark by default, light on request). */

:root {
  --bg: #0a0c12; --bg2: #10131c; --bg3: #161925; --bg4: #1d2130; --bg5: #242840;
  --border: rgba(255,255,255,.06); --border2: rgba(255,255,255,.11);
  --text: #dde1f0; --text2: #8890ac; --text3: #4a5068;
  --accent: #5b6af5; --accent2: #7a87ff; --accent-bg: rgba(91,106,245,.12); --accent-border: rgba(91,106,245,.3);
  --success: #34d399; --success-bg: rgba(52,211,153,.1);
  --warning: #fbbf24; --warning-bg: rgba(251,191,36,.1);
  --danger: #f87171; --danger-bg: rgba(248,113,113,.1);
  --r: 8px; --rl: 12px; --rxl: 16px;
  --shadow: 0 24px 64px rgba(0,0,0,.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f0f2f8; --bg2: #ffffff; --bg3: #f5f7fc; --bg4: #e8ecf5; --bg5: #dde2ef;
    --border: rgba(0,0,0,.08); --border2: rgba(0,0,0,.14);
    --text: #1a1d2e; --text2: #4a5068; --text3: #8890ac;
    --success: #0f9f6e; --warning: #b7791f; --danger: #d64545;
    --shadow: 0 24px 64px rgba(20,24,60,.15);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 13px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent2); text-decoration: none; }
[hidden] { display: none !important; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.5px; margin: 0; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; letter-spacing: -.2px; }
.muted { color: var(--text2); }
.small { font-size: 12px; }
.boot { display: grid; place-items: center; min-height: 100vh; font-weight: 800; font-size: 28px; color: var(--text3); letter-spacing: -.03em; }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: var(--r);
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, box-shadow .15s;
}
.btn:hover { background: var(--accent2); box-shadow: 0 4px 16px rgba(91,106,245,.3); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-ghost { background: transparent; color: var(--text2); border-color: var(--border2); }
.btn-ghost:hover { background: var(--bg4); color: var(--text); box-shadow: none; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(248,113,113,.2); }
.btn-danger:hover { background: rgba(248,113,113,.2); box-shadow: none; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.field { margin-bottom: 14px; }
.field label, .label {
  display: block; font-size: 11px; font-weight: 600; color: var(--text3);
  margin-bottom: 5px; letter-spacing: .06em; text-transform: uppercase;
}
.field .hint { font-size: 12px; color: var(--text2); margin-top: 4px; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  width: 100%; background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--r);
  color: var(--text); font: inherit; padding: 8px 10px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,106,245,.15); }
textarea { resize: vertical; min-height: 60px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 6px 0; cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.spacer { flex: 1; }

/* ---------- login ---------- */

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--rxl); padding: 2.5rem 2rem; width: 380px; max-width: 100%; box-shadow: var(--shadow); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.03em; }
.logo i { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); position: relative; display: inline-block; }
.logo i::after { content: ""; position: absolute; left: 8px; top: 6px; width: 8px; height: 14px; background: var(--bg2); border-radius: 2px 2px 0 0; transform: skewY(-12deg); transform-origin: left bottom; }
.login-card .logo { margin-bottom: 1.5rem; }
.login-card p { color: var(--text2); margin: 4px 0 1.5rem; }
.error { color: var(--danger); font-size: 12px; min-height: 18px; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 0 8px 14px; }
.side select { margin-bottom: 10px; }
.nav-title { font-size: 10px; font-weight: 700; color: var(--text3); letter-spacing: .08em; text-transform: uppercase; padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: var(--r); color: var(--text2); font-weight: 500; }
.nav a:hover { background: var(--bg4); color: var(--text); }
.nav a.on { background: var(--accent-bg); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav .count { font-size: 11px; background: var(--bg5); color: var(--text); border-radius: 999px; padding: 0 7px; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); font-size: 12px; color: var(--text2); }

.main { padding: 26px 32px 60px; max-width: 1200px; width: 100%; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head .sub { color: var(--text2); margin-top: 2px; }

.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--rl); padding: 18px; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--rl); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }

.table-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--rl); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10px; font-weight: 700; color: var(--text3); letter-spacing: .07em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg3); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--bg3); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 40px; text-align: center; color: var(--text2); }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--bg4); color: var(--text2); white-space: nowrap; }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.warn { background: var(--warning-bg); color: var(--warning); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.acc { background: var(--accent-bg); color: var(--accent2); }

.editor-row { display: grid; gap: 8px; grid-template-columns: 1fr 1fr 1fr auto; margin-bottom: 8px; align-items: start; }
.editor-row.two { grid-template-columns: 1fr 1fr auto; }
.confirm-edit { margin-bottom: 14px; }
.confirm-edit summary { cursor: pointer; color: var(--text2); margin: -2px 0 8px; }
.confirm-edit textarea.rules { min-height: 180px; }

/* ---------- modal ---------- */

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--rxl); padding: 24px; width: 520px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.detail { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; }
.detail dt { color: var(--text3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.detail dd { margin: 0; }
.photo { width: 150px; aspect-ratio: 3/4; border-radius: var(--rl); object-fit: cover; background: var(--bg4); float: right; margin: 0 0 12px 16px; }
.pair-code { font-size: 44px; font-weight: 800; letter-spacing: .12em; text-align: center; padding: 22px; background: var(--bg3); border-radius: var(--rl); font-variant-numeric: tabular-nums; margin: 12px 0; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--bg5); color: var(--text); border: 1px solid var(--border2); padding: 10px 16px; border-radius: var(--rl); z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .main { padding: 18px 16px 40px; }
  .editor-row, .editor-row.two { grid-template-columns: 1fr; }
}

.terms-view { background: var(--bg3); border-radius: var(--rl); padding: 4px 18px 10px; max-height: 60vh; overflow-y: auto; line-height: 1.55; }
.terms-view h3 { font-size: 14px; margin: 14px 0 4px; }
.terms-view p { margin: 0 0 8px; color: var(--text2); }
.legal-view { background: var(--warning-bg); border: 1px solid rgba(251,191,36,.3); border-radius: var(--rl); padding: 10px 16px; margin-top: 14px; line-height: 1.55; }
.legal-view h3 { margin-top: 4px; }
.legal-view p { color: var(--text); }

/* ---------- EU/EØS switch ---------- */
.card.eea { border-color: var(--accent-border); }
.card.eea.eea-off { border-color: rgba(52,211,153,.35); }
.switch-row { display: flex; gap: 14px; align-items: center; cursor: pointer; }
.switch-row b { font-size: 15px; display: block; }
.eea-state { font-size: 12px; color: var(--text2); }
.eea-off .eea-state { color: var(--success); font-weight: 600; }
.switch { position: relative; flex: none; width: 46px; height: 26px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--bg5); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(91,106,245,.35); }
.eea-caption { margin: 10px 0 0 60px; color: var(--text2); font-size: 13px; line-height: 1.5; }
.notice { border-radius: var(--r); padding: 10px 12px; margin: -4px 0 12px; font-size: 13px; }
.notice.warn { background: var(--warning-bg); color: var(--warning); }
input:disabled { opacity: .5; }
