:root {
    --bg: #F4F7F6;
    --surface: #FFFFFF;
    --primary: #0F766E;
    --primary-ink: #FFFFFF;
    --ink: #0F1F1D;
    --muted: #4B5563;
    --line: #DCE3E1;
    --danger: #B91C1C;
    --warn-bg: #FEF3C7;
    --warn-ink: #92400E;
    --ok-bg: #E0F2EF;
    --ok-ink: #115E59;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Rubik", "Segoe UI", Arial, sans-serif; font-size: 15px; }
h1 { font-size: 26px; margin: 0 0 18px; }
h1:focus { outline: none; }
h2 { font-size: 18px; margin: 24px 0 10px; }
a { color: var(--primary); }

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; max-width: 250px; background: var(--ink); color: #E6EFED; padding: 22px 14px; display: flex; flex-direction: column; gap: 2px; }
.side .brand { font-size: 19px; font-weight: 700; color: #fff; padding: 0 10px 16px; }
.side a { color: #E6EFED; text-decoration: none; padding: 9px 10px; border-radius: 8px; }
.side a.active { background: var(--primary); color: #fff; font-weight: 500; }
.side .spacer { flex: 1; }
.side .who { padding: 8px 10px; color: #B6C4C1; font-size: 13px; }
.content { flex: 999 1 560px; min-width: 0; padding: 26px 30px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.card { background: var(--surface); border-radius: 12px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.08); text-decoration: none; color: inherit; display: block; }
.card .num { font-size: 30px; font-weight: 700; }
.card .lbl { color: var(--muted); font-size: 14px; }

.panel { background: var(--surface); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.08); margin-bottom: 16px; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
table { width: 100%; border-collapse: collapse; text-align: right; }
th { background: #EEF3F2; font-weight: 500; padding: 10px 14px; white-space: nowrap; }
td { padding: 10px 14px; border-top: 1px solid #E5E7EB; vertical-align: top; }

.chip { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #F3F4F6; color: #374151; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.bad { background: #FEE2E2; color: var(--danger); }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

button, .btn { font: inherit; border-radius: 8px; padding: 8px 14px; border: 0; cursor: pointer; background: var(--primary); color: var(--primary-ink); }
button.secondary { background: transparent; color: var(--ink); border: 1px solid #9CA3AF; }
button.danger { background: var(--danger); color: #fff; }
button.link { background: none; color: #B6C4C1; padding: 8px 10px; text-align: right; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #C9D1CF; border-radius: 8px; background: #fff; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.alert { padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); margin: 10px 0; }

.login { max-width: 380px; margin: 12vh auto; background: var(--surface); border-radius: 16px; padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 14px; }

#blazor-error-ui { background: var(--warn-bg); bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; left: .75rem; top: .5rem; }

/* Dev console (development only) */
.dev-h2 { margin-top: 0; }
.dev-clock { font-size: 22px; font-weight: 700; }
.dev-note { font-size: 13px; margin: 10px 0 0; }
.dev-result { background: var(--ok-bg); color: var(--ok-ink); }
.dev-actions { white-space: nowrap; }
.dev-actions button + button { margin-inline-start: 6px; }
.dev-filters { margin-bottom: 10px; align-items: center; }
.dev-filters .spacer { flex: 1; }
.dev-detail { white-space: pre-line; overflow-wrap: anywhere; max-width: 560px; }
.dev-users { max-height: 420px; overflow-y: auto; }
