/* QuotaIsland server panel: system fonts only, light and dark themes from the OS, no script. */
:root {
    color-scheme: light dark;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #1b1f24;
    --muted: #5d6671;
    --border: #d9dee4;
    --accent: #3b5bdb;
    --accent-text: #ffffff;
    --ok-bg: #e6f4ea;
    --ok-text: #1e6b34;
    --warn-bg: #fff4d6;
    --warn-text: #7a5300;
    --error-bg: #fde8e8;
    --error-text: #a11d1d;
    --danger: #c92a2a;
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111418;
        --surface: #1a1f25;
        --text: #e6e9ed;
        --muted: #9aa4af;
        --border: #2c333b;
        --accent: #7b93ff;
        --accent-text: #0d1117;
        --ok-bg: #173323;
        --ok-text: #8fd8a8;
        --warn-bg: #3a2e0f;
        --warn-text: #f2cc6b;
        --error-bg: #3d1818;
        --error-text: #ffaaaa;
        --danger: #ff6b6b;
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
}

a { color: var(--accent); }

header.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 650;
    color: var(--text);
    text-decoration: none;
}

.brand small { font-weight: 400; color: var(--muted); }

.logo {
    width: 22px;
    height: 12px;
    border-radius: 6px;
    background: var(--text);
}

header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }

main { margin: 0 auto; padding: 24px 16px 48px; }
main.wide { max-width: 1100px; }
main.narrow { max-width: 460px; }

footer { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }

h1 { font-size: 26px; margin: 8px 0 12px; }
h2 { font-size: 19px; margin: 32px 0 8px; }
h3 { font-size: 16px; margin: 0; }
h4 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }

section + section { margin-top: 12px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.nowrap { white-space: nowrap; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
.empty { padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.alert { padding: 10px 14px; border-radius: var(--radius); margin: 12px 0; }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); }
.alert.error { background: var(--error-bg); color: var(--error-text); }

.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--border);
    color: var(--text);
    white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }

form.stack { display: flex; flex-direction: column; gap: 12px; }
form.inline { display: inline; margin: 0; }
.narrow-form { max-width: 420px; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 550; font-size: 14px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }

input[type="email"], input[type="password"], input:not([type]), input[type="text"] {
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button {
    font: inherit;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-text);
    cursor: pointer;
    align-self: flex-start;
}
button.secondary { background: transparent; color: var(--accent); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.link { background: none; border: none; padding: 0; color: var(--accent); font-weight: 400; text-decoration: underline; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { border: 1px solid var(--danger); border-radius: var(--radius); padding: 16px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: none; }
thead th { font-size: 13px; color: var(--muted); font-weight: 600; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

.stats { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stats li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stats .value { display: block; font-size: 26px; font-weight: 650; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .label { font-weight: 400; color: var(--muted); }
.card p { margin: 4px 0; }

table.windows th, table.windows td { padding: 6px 4px; border: none; }
table.windows th { font-weight: 500; }
td.meter { width: 26%; }
meter { width: 100%; height: 10px; }

ul.sessions, ul.models { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.state { display: inline-block; min-width: 7em; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--border); text-align: center; }
.state-running { background: var(--ok-bg); color: var(--ok-text); }
.state-waitingforapproval, .state-waitingforinput { background: var(--warn-bg); color: var(--warn-text); }
.state-failed { background: var(--error-bg); color: var(--error-text); }

.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 16px 0; }

@media (max-width: 600px) {
    header.top { padding: 10px 16px; }
    .cards { grid-template-columns: 1fr; }
    td.meter { width: 30%; }
}
