/* ZIMRA Switch console. Plain, dense and readable: a tool used all day by operations staff. */
:root {
  --ink: #0f172a; --muted: #64748b; --line: #e2e8f0; --bg: #f8fafc; --card: #ffffff;
  --accent: #0f766e; --accent-ink: #ffffff; --danger: #b91c1c; --warn: #b45309; --ok: #15803d;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); }
h1 { font-size: 20px; margin: 0 0 16px; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 13px; }

.bar { display: flex; justify-content: space-between; align-items: center; height: 52px; padding: 0 20px;
       background: var(--ink); color: #fff; }
.brand { color: #fff; font-weight: 600; text-decoration: none; font-size: 15px; }
.brand span { font-weight: 400; opacity: .7; }
.me { display: flex; gap: 16px; align-items: center; font-size: 13px; }
.me form { margin: 0; }
.me .link { color: #cbd5e1; }

.frame { display: grid; grid-template-columns: 200px 1fr; min-height: calc(100vh - 52px); }
.side { border-right: 1px solid var(--line); background: var(--card); padding: 16px 8px; }
.side a { display: block; padding: 7px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.side a.on, .side a:hover { background: #ecfdf5; color: var(--accent); }
main { padding: 24px 28px; max-width: 1200px; }

.lone { max-width: 440px; margin: 64px auto; padding: 0 16px; }
.lone-brand { color: var(--ink); text-align: center; font-size: 18px; }
.lone-brand span { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.card.wide { max-width: 520px; }
label { display: block; margin: 0 0 14px; font-weight: 500; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #cbd5e1;
                border-radius: 6px; font: inherit; background: #fff; }
.inline select { display: inline-block; width: auto; margin: 0; padding: 4px 6px; }
button, .button { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0;
                  border-radius: 6px; padding: 8px 16px; font: inherit; font-weight: 500; cursor: pointer;
                  text-decoration: none; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; }
button.danger, .danger { color: var(--danger); }

.head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.head h1 { margin: 0; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line);
        border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8fafc; }
tr:last-child td { border-bottom: 0; }
td.actions form + form { margin-left: 12px; }
form.inline { display: inline; margin: 0; }

.notice { background: #ecfdf5; border: 1px solid #a7f3d0; padding: 10px 14px; border-radius: 8px; }
.error { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); padding: 10px 14px; border-radius: 8px; }
.empty { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: #f1f5f9;
       color: var(--muted); margin-left: 4px; }
.tag.warn { background: #fffbeb; color: var(--warn); }
.status.active { color: var(--ok); }
.status.disabled { color: var(--muted); }
.pager { display: flex; gap: 16px; justify-content: center; margin-top: 14px; color: var(--muted); }
.enrol { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.qr { display: flex; justify-content: center; margin: 8px 0; }

@media (max-width: 760px) {
  .frame { grid-template-columns: 1fr; }
  .side { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 16px; }
}

/* --- WP9b: dashboard tiles, tabs, chips, client finder --- */
h2 { font-size: 16px; margin: 24px 0 10px; }
.switcher { flex: 1; max-width: 360px; margin: 0 24px; }
.switcher input { margin: 0; padding: 6px 10px; background: #1e293b; border-color: #334155; color: #fff; }
.switcher input::placeholder { color: #94a3b8; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
        display: flex; flex-direction: column; gap: 2px; border-left: 4px solid #cbd5e1; }
.tile span { font-size: 12px; color: var(--muted); }
.tile strong { font-size: 26px; font-weight: 600; }
.tile small { font-size: 12px; color: var(--muted); }
.tile.amber { border-left-color: #f59e0b; }
.tile.red { border-left-color: var(--danger); }
.chip { display: inline-block; font-size: 12px; line-height: 18px; padding: 0 8px; border-radius: 99px;
        font-weight: 500; white-space: nowrap; vertical-align: middle; }
.chip.green { background: #dcfce7; color: #166534; }
.chip.amber { background: #fef3c7; color: #92400e; }
.chip.red { background: #fee2e2; color: #991b1b; }
.chip.grey { background: #e2e8f0; color: #475569; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; max-width: 480px; }
.filters input { margin: 0; }
.facts { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; background: var(--card);
         border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin: 0 0 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
.spaced { margin-top: 20px; }
.danger-zone { border-color: #fecaca; margin-top: 16px; }
.danger-zone h2 { margin-top: 0; }
button.danger-button { background: var(--danger); }
.secret { display: inline-block; word-break: break-all; font-size: 14px; padding: 6px 8px; }
td.details { font-size: 12px; color: var(--muted); max-width: 520px; word-break: break-word; }
@media (max-width: 760px) {
  .switcher { display: none; }
  .facts { grid-template-columns: 1fr; }
}

/* --- WP9c: device page (A6) and add-device wizard (A5) --- */
.sub { color: var(--muted); margin: -6px 0 16px; }
h2.first { margin-top: 0; }
button.secondary, .button.secondary { background: #fff; color: var(--accent); border: 1px solid #99f6e4; }
.actions-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.panels.two { grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr); align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.panel h2 { margin: 0 0 10px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.stack { margin-top: 12px; }
div.error { margin-bottom: 16px; }
.stack label { margin-bottom: 8px; }
code.wrap { word-break: break-all; }
.stopped { border-color: #fecaca; margin-bottom: 16px; }
.stopped h2 { margin-top: 0; color: var(--danger); }
table.compact th, table.compact td { padding: 5px 8px; font-size: 13px; }
.facts.tight { grid-template-columns: 120px 1fr; }
label.tick { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.tick input { display: inline-block; width: auto; margin: 0; }
fieldset.mappings { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; }
fieldset.mappings legend { font-weight: 600; padding: 0 4px; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px;
            background: #f1f5f9; color: var(--muted); font-size: 13px; }
.steps li span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 99px;
                 background: #e2e8f0; font-weight: 600; font-size: 12px; }
.steps li.on { background: #ecfdf5; color: var(--accent); font-weight: 500; }
.steps li.on span { background: var(--accent); color: #fff; }
.steps li.done span { background: #a7f3d0; color: #065f46; }
@media (max-width: 760px) {
  .panels.two { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}

/* --- WP9d: operations screens (A7 to A14) --- */
.filterbar { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px;
             align-items: end; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
             padding: 12px 14px; margin: 0 0 14px; }
.filterbar label { margin: 0; font-size: 13px; }
.filterbar input, .filterbar select { padding: 6px 8px; }
.filterbar label.tick { align-self: center; }
.filter-actions { display: flex; gap: 10px; align-items: center; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
pre.json { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow-x: auto;
           font-size: 12px; line-height: 1.45; margin: 0 0 12px; white-space: pre-wrap; word-break: break-word; }
.kv pre.json { margin: 0; }
details { margin: 0 0 12px; }
details summary { cursor: pointer; color: var(--accent); margin-bottom: 8px; }
ul.plain { list-style: none; padding: 0; margin: 8px 0 0; }
ul.plain li { margin-bottom: 6px; }
h3 { font-size: 14px; margin: 14px 0 6px; }
.runbook { background: #eff6ff; border: 1px solid #bfdbfe; padding: 10px 14px; border-radius: 8px; }
