/* Xiwio Pulse Control Panel — staff panel. Same palette as the Pulse customer dashboard. */
:root {
    --y: #F7D93C; --y-hi: #FFE35A; --k: #141410;
    --bg: #F4F3EE; --surface: #FFFFFF; --soft: #F4F3EE; --text: #151513; --muted: #6B6A63;
    --border: #ECEBE5; --ring: rgba(20,20,15,.06); --header: #0E0E0C;
    --shadow: 0 1px 2px rgba(20,20,15,.04), 0 12px 32px -20px rgba(20,20,15,.18);
    --ok: #1F8A4C; --okbg: #E6F4EC; --wa: #5E4900; --wabg: #FFF4C2; --al: #9E3413; --albg: #FDE7E0;
    --danger: #E5532D; --warn: #FF8A3D; --radius: 18px;
    /* old names */
    --primary: var(--y); --primary-dk: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration-color: rgba(20,20,15,.3); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--y); }
code { font: 500 0.86em 'JetBrains Mono', ui-monospace, Menlo, monospace; background: var(--soft); padding: 1px 6px; border-radius: 5px; overflow-wrap: anywhere; }

header.top {
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    background: var(--header); color: #fff; padding: 14px 28px;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.06);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; }
.brand img { height: 24px; width: auto; display: block; }
.brand-word { font: 700 20px/1 'Inter Tight', Inter, sans-serif; letter-spacing: -.02em; }
.brand .prod { font: 600 11px 'Inter Tight', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #0E0E0C; background: var(--y); padding: 4px 8px; border-radius: 7px; }
.brand .sub { font: 500 14px Inter; color: #A9A8A0; }
header nav { display: flex; gap: 4px; flex-wrap: wrap; }
header nav a { color: #A9A8A0; text-decoration: none; padding: 8px 14px; border-radius: 11px; font-weight: 500; transition: background .2s, color .2s; }
header nav a:hover { color: #fff; }
header nav a.active { background: #1F1F1C; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.07), inset 0 -2px 0 var(--y); }
.who { margin-left: auto; color: #A9A8A0; font-size: 0.9rem; }
.who a { color: #fff; text-decoration: none; }
.who a:hover { color: var(--y); }

main { max-width: 1400px; margin: 0 auto; padding: 32px 28px; }
footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 24px; }
h1 { font: 700 30px/1.1 'Inter Tight', Inter, sans-serif; letter-spacing: -.025em; margin: 0 0 8px; }
h2 { font: 600 17px 'Inter Tight', Inter, sans-serif; letter-spacing: -.01em; margin: 0 0 14px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.nowrap { white-space: nowrap; }
.warn-text { color: #A35A00; }
.crit-text { color: var(--danger); font-weight: 600; }

.card { background: var(--surface); border: 0; border-radius: 22px; padding: 24px; margin-bottom: 20px; box-shadow: 0 0 0 1px var(--ring), var(--shadow); }
.card.narrow { max-width: 440px; margin: 48px auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; align-items: start; }

label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 14px; }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: 3px; }
input, select, textarea {
    display: block; width: 100%; margin-top: 6px; min-height: 42px; padding: 9px 13px;
    border: 0; border-radius: 12px; font: 400 15px Inter, sans-serif; color: var(--text);
    background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); outline: none;
    transition: box-shadow .2s;
}
input:focus, select:focus, textarea:focus { box-shadow: inset 0 0 0 1.5px var(--text), 0 0 0 4px rgba(247,217,60,.35); }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--k); box-shadow: none; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin: 0; }
label.check.top { align-items: flex-start; font-weight: 600; }
label.check.top input { margin-top: 4px; }
fieldset { border: 0; background: var(--soft); border-radius: 16px; margin: 4px 0 16px; padding: 14px 16px 2px; }
legend { font-weight: 600; font-size: 0.86rem; padding: 0 0 6px; }
form.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline input { width: auto; margin: 0; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
    border-radius: 13px; border: 0; background: var(--surface); color: var(--text); font: 600 14px Inter, sans-serif;
    cursor: pointer; text-decoration: none; box-shadow: 0 0 0 1px var(--ring), 0 1px 2px rgba(0,0,0,.06);
    transition: background .2s, transform .15s;
}
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--y); color: var(--k); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 8px 18px -10px rgba(190,150,0,.8); }
.btn.primary:hover { background: var(--y-hi); }
.btn.danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 0.82rem; border-radius: 10px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; border: 0; }
.flash-ok  { background: var(--okbg); color: var(--ok); }
.flash-err { background: var(--albg); color: var(--al); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 0; border-radius: 22px; margin-bottom: 20px; padding: 6px 12px; box-shadow: 0 0 0 1px var(--ring), var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th { text-align: left; font: 500 12px Inter, sans-serif; color: var(--muted); background: transparent; padding: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:hover td { background: var(--soft); }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.actions form { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
table.data td.actions input { width: 150px; margin: 0; min-height: 32px; padding: 4px 10px; }
.bar { height: 6px; background: var(--border); border-radius: 999px; margin-top: 6px; overflow: hidden; min-width: 70px; }
.bar i { display: block; height: 100%; background: var(--y); border-radius: 999px; }
.bar i.warn { background: var(--warn); }
.bar i.crit { background: var(--danger); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 500; padding: 3px 10px 3px 8px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok    { background: var(--okbg); color: var(--ok); }
.pill-warn  { background: var(--wabg); color: var(--wa); }
.pill-crit  { background: var(--albg); color: var(--al); }
.pill-muted { background: var(--border); color: #55544E; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; font-size: 0.9rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
pre.env { background: #121211; color: #E8E7E0; padding: 16px 18px; border-radius: 14px; overflow-x: auto; font: 500 0.84rem/1.6 'JetBrains Mono', ui-monospace, monospace; }
.qr { display: flex; justify-content: center; margin: 16px 0; }
.key { font-size: 1rem; letter-spacing: 0.05em; }
