/* P153 admin panel. One stylesheet, no build step, no external fonts. */

:root {
    --bg: #14161a;
    --bg-raised: #1c1f25;
    --bg-input: #101216;
    --border: #2a2f38;
    --text: #e6e8ec;
    --text-muted: #8b93a1;
    --accent: #5b9dff;
    --good: #3ecf8e;
    --warn: #e8b23a;
    --bad: #f2585b;
    --radius: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

code, pre, .mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ------------------------------------------------------------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px 20px;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
}

.brand { font-weight: 600; color: var(--text); }

.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }

.topbar nav a {
    padding: 6px 10px;
    border-radius: var(--radius);
    color: var(--text-muted);
    white-space: nowrap;
}
.topbar nav a:hover { background: rgba(255, 255, 255, .05); color: var(--text); text-decoration: none; }
.topbar nav a.active { background: rgba(91, 157, 255, .14); color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.pill {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--warn);
    color: #1a1206;
    font-size: 11px;
    font-weight: 700;
}

.mode-chip {
    padding: 3px 9px;
    border: 1px solid var(--good);
    border-radius: 12px;
    color: var(--good);
    font-size: 12px;
    cursor: help;
}
.mode-chip.warn { border-color: var(--warn); color: var(--warn); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 48px; }

footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px 32px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 12px;
}

/* ---- Typography --------------------------------------------------------- */

h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 28px 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
h3 { font-size: 14px; margin: 0 0 8px; }

.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.lead { color: var(--text-muted); margin: 0 0 20px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---- Cards and stats ---------------------------------------------------- */

.card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.card.auth { width: 100%; max-width: 380px; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stat { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .value { font-size: 26px; font-weight: 600; line-height: 1.1; }
.stat .label { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.stat.attention { border-color: var(--warn); }
.stat.attention .value { color: var(--warn); }

/* ---- Tables ------------------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }

th {
    background: var(--bg-raised);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }

td.mono, th.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.empty { padding: 28px; text-align: center; color: var(--text-muted); }

/* ---- Badges ------------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(255, 255, 255, .07);
    color: var(--text-muted);
}
.badge-good { background: rgba(62, 207, 142, .15); color: var(--good); }
.badge-warn { background: rgba(232, 178, 58, .15); color: var(--warn); }
.badge-bad { background: rgba(242, 88, 91, .15); color: var(--bad); }
.badge-muted { background: rgba(255, 255, 255, .05); color: var(--text-muted); }

/* ---- Forms and buttons -------------------------------------------------- */

label { display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 12px; }
label span.req { color: var(--bad); }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font: inherit;
}

textarea { min-height: 90px; resize: vertical; }

input:focus, select:focus, textarea:focus { outline: 2px solid rgba(91, 157, 255, .4); outline-offset: 0; border-color: var(--accent); }

button, .btn {
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #262b33;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
button:hover, .btn:hover { background: #2f3540; text-decoration: none; }

button.primary { background: var(--accent); border-color: var(--accent); color: #08101f; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.good { border-color: var(--good); color: var(--good); }
button.danger { border-color: var(--bad); color: var(--bad); }
button.small, .btn.small { padding: 4px 9px; font-size: 12px; }

button.link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
}
button.link:hover { text-decoration: underline; background: none; }

form.inline { display: inline; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters a {
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 12px;
}
.filters a.active { border-color: var(--accent); color: var(--accent); background: rgba(91, 157, 255, .1); }

.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---- Flash and callouts ------------------------------------------------- */

.flash {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    border: 1px solid var(--border);
}
.flash-ok { border-color: var(--good); background: rgba(62, 207, 142, .1); }
.flash-error { border-color: var(--bad); background: rgba(242, 88, 91, .1); }
.flash-info { border-color: var(--accent); background: rgba(91, 157, 255, .1); }
.flash-warn { border-color: var(--warn); background: rgba(232, 178, 58, .1); }

.callout {
    border-left: 3px solid var(--accent);
    background: rgba(91, 157, 255, .07);
    padding: 12px 14px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 16px;
    font-size: 13px;
}
.callout.warn { border-left-color: var(--warn); background: rgba(232, 178, 58, .07); }
.callout.bad { border-left-color: var(--bad); background: rgba(242, 88, 91, .07); }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---- Chart -------------------------------------------------------------- */

.chart { width: 100%; height: 110px; display: block; }
.chart .bar { fill: var(--accent); opacity: .75; }
.chart .bar:hover { opacity: 1; }
.chart .axis { fill: var(--text-muted); font-size: 9px; }

/* ---- Misc --------------------------------------------------------------- */

pre.blob {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    overflow-x: auto;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.kv dt { color: var(--text-muted); font-size: 12px; }
dl.kv dd { margin: 0; }

.split { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* ---- Implement wizard --------------------------------------------------- */

a.card-link {
    display: block;
    color: inherit;
    transition: border-color .15s ease, background .15s ease;
}
a.card-link:hover {
    text-decoration: none;
    border-color: var(--accent);
    background: rgba(91, 157, 255, .06);
}
a.card-link.suggest { border-color: rgba(62, 207, 142, .45); }

.choice-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 16px;
}

.wizard-progress {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
}
.wizard-progress li {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 12px;
}
.wizard-progress li.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(91, 157, 255, .1);
}
.wizard-progress li.done { color: var(--good); border-color: rgba(62, 207, 142, .35); }

.wizard-steps { list-style: none; padding: 0; margin: 0 0 20px; counter-reset: none; }
.wizard-step { margin-bottom: 12px; }
.wizard-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.wizard-step-head h3 { margin: 0; }
.wizard-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(91, 157, 255, .15);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

label.check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 13px;
}
label.check input { margin-top: 3px; width: auto; }

.tip-list {
    margin: 0 0 16px;
    padding-left: 18px;
    color: var(--text-muted);
    font-size: 13px;
}
.tip-list li { margin-bottom: 4px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
