:root {
    --charcoal: #2C2F33;
    --charcoal-2: #36393F;
    --lavender: #8A73B4;
    --lavender-2: #9B86C2;
    --ink: #2B2D31;
    --muted: #7E8087;
    --faint: #A3A5AB;
    --bg: #F3F4F6;
    --surface: #FFFFFF;
    --surface-2: #F8F8FA;
    --line: #E4E5E9;
    --danger: #B3261E;
    --danger-soft: #FDECEA;
    --ok: #1C7650;
    --ok-soft: #E4F4EC;
    --warn: #8A6512;
    --warn-soft: #FBF3E1;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(35, 30, 50, .05);
    --heading: 'Unbounded', system-ui, sans-serif;
    --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
    --primary: var(--lavender);
    --primary-hover: #7A63A6;
    --on-primary: #fff;
    --sidebar: var(--charcoal);
    --sidebar-line: transparent;
    --kpi-icon: var(--lavender);
    --bar: color-mix(in srgb, var(--lavender) 40%, var(--surface));
    --danger-solid-ink: #fff;
    --cal-up-bg: rgba(138, 115, 180, .12);
    --cal-up-line: var(--lavender);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ink: #FCFCFF;
        --muted: #909090;
        --faint: #6B6E74;
        --bg: #2C2F33;
        --surface: #252525;
        --surface-2: #292B2F;
        --line: #3A3D42;
        --danger: #FF8A85;
        --danger-soft: #3A1D1D;
        --ok: #5CC08F;
        --ok-soft: #1D3328;
        --warn: #E3A94F;
        --warn-soft: #3A2F1C;
        --shadow: none;
        --primary: var(--lavender);
        --primary-hover: var(--lavender-2);
        --on-primary: #fff;
        --sidebar: #202225;
        --sidebar-line: #3A3D42;
        --kpi-icon: #B3A2D6;
        --bar: color-mix(in srgb, var(--lavender) 40%, var(--surface));
        --danger-solid-ink: #3A1D1D;
        --cal-up-bg: rgba(138, 115, 180, .18);
        --cal-up-line: #B3A2D6;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --ink: #FCFCFF;
    --muted: #909090;
    --faint: #6B6E74;
    --bg: #2C2F33;
    --surface: #252525;
    --surface-2: #292B2F;
    --line: #3A3D42;
    --danger: #FF8A85;
    --danger-soft: #3A1D1D;
    --ok: #5CC08F;
    --ok-soft: #1D3328;
    --warn: #E3A94F;
    --warn-soft: #3A2F1C;
    --shadow: none;
    --primary: var(--lavender);
    --primary-hover: var(--lavender-2);
    --on-primary: #fff;
    --sidebar: #202225;
    --sidebar-line: #3A3D42;
    --kpi-icon: #B3A2D6;
    --bar: color-mix(in srgb, var(--lavender) 40%, var(--surface));
    --danger-solid-ink: #3A1D1D;
    --cal-up-bg: rgba(138, 115, 180, .18);
    --cal-up-line: #B3A2D6;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-family: var(--heading); font-weight: 600; font-size: 22px; line-height: 1.25; }
h2 { font-size: 15px; }
a { color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }

.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 24px;
    padding: 20px 14px; background: var(--sidebar); color: #fff; border-right: 1px solid var(--sidebar-line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; font-family: var(--heading); font-weight: 600; font-size: 17px; color: #fff; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--lavender); color: #fff; }
.brand-mark svg.i { width: 17px; height: 17px; stroke-width: 2.2; }
.brand small { margin-left: auto; font: 600 11px var(--body); letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }

.menu { display: flex; flex-direction: column; gap: 2px; }
.menu-label { padding: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .4); }
.menu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255, 255, 255, .72); text-decoration: none; font-weight: 600; }
.menu a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.menu a.active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--lavender); }
.menu a > [data-live] { margin-left: auto; }
.menu a .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.theme-switch button { display: grid; place-items: center; height: 30px; border: 0; border-radius: 8px; background: transparent; color: rgba(255, 255, 255, .6); cursor: pointer; }
.theme-switch button:hover { color: #fff; }
.theme-switch button[aria-pressed="true"] { background: rgba(255, 255, 255, .14); color: #fff; }
.theme-switch svg.i { width: 16px; height: 16px; }

.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.me .who { min-width: 0; flex: 1; }
.me .who strong, .me .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { font-size: 12px; color: rgba(255, 255, 255, .55); }
.me form { margin: 0; }
.me button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: rgba(255, 255, 255, .7); cursor: pointer; }
.me button:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.main { min-width: 0; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 32px; border-bottom: 1px solid var(--line); background: var(--surface); }
.header .crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.header .crumbs a { text-decoration: none; }
.header .crumbs a:hover { color: var(--ink); }
.content { padding: 28px 32px 56px; }

body.is-loading .main { opacity: .55; transition: opacity .15s .1s; pointer-events: none; }
body.is-loading::before { content: ''; position: fixed; z-index: 10; top: 0; left: 0; height: 3px; width: 100%; background: linear-gradient(90deg, transparent, var(--lavender), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: loading 1s linear infinite; }
@keyframes loading { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) { body.is-loading::before { animation: none; background: var(--lavender); } }

.grid { display: grid; gap: 20px; }
.grid-kpi { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-kpi.grid-kpi-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content > * + * { margin-top: 20px; }
.stack > * + * { margin-top: 20px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head a { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.card-head a:hover { color: var(--ink); }
.card-body { padding: 20px; }

.kpi { padding: 18px 20px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 600; font-size: 13px; }
.kpi-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--kpi-icon); border: 1px solid var(--line); }
.kpi-value { margin-top: 10px; font-family: var(--heading); font-weight: 600; font-size: 28px; line-height: 1.1; }
.kpi-foot { margin-top: 6px; font-size: 12px; color: var(--muted); }
.kpi-foot .up { color: var(--ok); font-weight: 700; }

.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 6px; height: 180px; padding-top: 8px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bar-fill { width: 100%; max-width: 30px; min-height: 3px; border-radius: 6px 6px 3px 3px; background: var(--bar); }
.bar-fill.zero { background: var(--line); }
.bar:last-child .bar-fill:not(.zero) { background: var(--lavender); }
.bar-value { font-size: 11px; font-weight: 700; color: var(--muted); }
.bar-label { font-size: 11px; color: var(--faint); white-space: nowrap; }

.meter { display: grid; gap: 14px; }
.meter-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 36px; align-items: center; gap: 12px; font-weight: 600; }
.meter-track { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: var(--lavender); }
.meter-row:nth-child(2) .meter-fill { background: var(--bar); }
.meter-row span:last-child { text-align: right; color: var(--muted); }

.split { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.split div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.split strong { display: block; font-size: 18px; }
.split span { font-size: 12px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 10px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
th.right, td.right { text-align: right; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

.person { display: flex; align-items: center; gap: 12px; min-width: 200px; text-decoration: none; }
.avatar {
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--primary); color: var(--on-primary); font-size: 13px; font-weight: 700; line-height: 1;
}
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.accent { background: var(--lavender); color: #fff; }
img.avatar { object-fit: cover; background: var(--surface-2); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.photo-tile { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.photo-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-tile figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; }
.person-text { min-width: 0; }
.person-text strong { display: block; font-weight: 700; }
.person-text small { display: block; color: var(--muted); font-size: 13px; }
a.person:hover strong { text-decoration: underline; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge + .badge { margin-left: 4px; }
.badge-administrator { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.badge-owner { background: var(--lavender); border-color: var(--lavender); color: #fff; }
.badge-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.badge-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.badge-off { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.actions form { margin: 0; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 9px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabs a:hover { background: var(--surface-2); color: var(--ink); }
.tabs a.active { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.tabs a span { font-size: 12px; color: var(--faint); }
.search { position: relative; width: 280px; max-width: 100%; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search .input { padding-left: 36px; height: 38px; }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters select.input { width: auto; max-width: 220px; height: 38px; }
.toolbar h2 { margin-right: auto; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tiles div { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.tiles div > span { display: block; font-size: 12px; color: var(--muted); }
.tiles strong { display: block; font-size: 17px; margin-top: 2px; }
.tiles small { display: block; font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.buttons form { margin: 0; }
.rpc { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.reply { margin-top: 18px; }
.reply-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
pre.code { margin: 10px 0 0; padding: 12px 14px; max-height: 360px; overflow: auto; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font: 12px/1.5 var(--mono); white-space: pre; }
details.raw { margin-top: 16px; }
td details.raw, dd details.raw { margin: 0; }
details.raw summary { cursor: pointer; color: var(--muted); font-weight: 600; }
td details.raw summary, dd details.raw summary { color: inherit; font-weight: 400; }
details.log-line > .mono { margin-top: 8px; color: var(--muted); font-size: 12px; }

[data-region].is-loading { opacity: .6; transition: opacity .15s; }
@keyframes live-new { from { background: rgba(212, 164, 55, .18); } to { background: transparent; } }
tr.is-new > td { animation: live-new 2.5s ease-out; }
@media (prefers-reduced-motion: reduce) { tr.is-new > td { animation: none; } }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.input, select.input {
    width: 100%; height: 42px; padding: 0 12px;
    font: inherit; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.input:focus { outline: 2px solid var(--lavender); outline-offset: 0; border-color: transparent; }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.input.code { height: 58px; text-align: center; font: 700 26px var(--mono); letter-spacing: .4em; }
.error { color: var(--danger); font-size: 13px; margin-top: 6px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.input-settings { align-items: start; gap: 16px; }
.input-settings .field { margin-bottom: 0; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.check + .check { margin-top: 8px; }
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--primary); }
.check strong { display: block; }
.check small { display: block; color: var(--muted); }
.check:has(input:checked) { border-color: var(--lavender); background: var(--surface-2); }

.invite-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 150px auto; gap: 12px; align-items: end; }
.invite-row .field { margin: 0; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px;
    font: 700 14px var(--body); cursor: pointer; text-decoration: none; white-space: nowrap;
    background: var(--primary); color: var(--on-primary);
}
.btn:hover { background: var(--primary-hover); }
.btn svg.i { width: 16px; height: 16px; }
.btn-accent { background: var(--lavender); color: #fff; }
.btn-accent:hover { background: var(--lavender-2); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--line); }
.btn-danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn-danger-solid { background: var(--danger); color: var(--danger-solid-ink); }
.btn-danger-solid:hover { background: #99201A; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled] { opacity: .45; pointer-events: none; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; cursor: pointer; }

.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--danger-soft); color: var(--danger); }

.toasts { position: fixed; top: 20px; right: 20px; z-index: 50; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 10px; padding: 14px 44px 16px 18px; border-radius: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(16, 40, 42, .16); font-weight: 600; line-height: 1.4; animation: toast-in .22s ease-out; }
.toast > svg { flex: none; margin-top: 1px; }
.toast-ok > svg { color: var(--ok); }
.toast-error > svg { color: var(--danger); }
.toast::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ok); }
.toast-error::before { background: var(--danger); }
.toast::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ok); opacity: .35; transform-origin: left; animation: toast-time var(--toast-for, 0s) linear forwards; }
.toast-error::after { background: var(--danger); }
.toast.is-paused::after { animation-play-state: paused; }
.toast.is-leaving { animation: toast-out .2s ease-in forwards; }
.toast-close { position: absolute; top: 9px; right: 9px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.toast-close:hover { background: var(--surface-2); color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes toast-time { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
    .toast, .toast.is-leaving { animation: none; }
    .toast::after { display: none; }
}

.week-nav { display: flex; align-items: center; gap: 6px; }
.week-nav strong { min-width: 150px; text-align: center; font-size: 14px; }
.cal-scroll { position: relative; max-height: 560px; overflow: auto; border-bottom: 1px solid var(--line); }
.cal { display: grid; grid-template-columns: 56px repeat(7, minmax(96px, 1fr)); min-width: 760px; }
.cal-corner, .cal-day-head { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-day-head { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 10px 4px; border-left: 1px solid var(--line); }
.cal-day-head span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.cal-day-head strong { font-size: 16px; }
.cal-day-head.is-today strong { color: var(--lavender); }
.cal { --row: 32px; }
.cal-hours div { height: var(--row); padding: 4px 8px 0; font-size: 11px; line-height: 1; color: var(--faint); text-align: right; }
.cal-day { position: relative; height: calc(var(--rows, 24) * var(--row)); border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% var(--row); }
.cal-day.is-today { background-color: rgba(212, 164, 55, .05); }
.cal-closed { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, transparent 6px 12px); pointer-events: none; }
.hours { display: grid; gap: 6px; margin-top: 8px; }
.field:has(input[name=always_open]:checked) .hours { display: none; }
.hours-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.hours-row span { text-transform: capitalize; font-size: 13px; }
.hours-row .error { grid-column: 2 / -1; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 1; }
.cal-event { position: absolute; left: 3px; right: 3px; overflow: hidden; padding: 3px 6px; border-radius: 6px; font-size: 11px; line-height: 1.3; border-left: 3px solid; }
.cal-event strong, .cal-event span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-upcoming { background: var(--cal-up-bg); border-color: var(--cal-up-line); color: var(--ink); }
.cal-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.cal-past { background: var(--surface-2); border-color: var(--faint); color: var(--muted); }

pre.code.log-text { margin: 0; height: calc(100vh - 290px); min-height: 240px; max-height: none; white-space: pre-wrap; word-break: break-word; user-select: text; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }

.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.profile .actions { margin-left: auto; }
.facts { display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.danger-zone .card-body { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.stage {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 16px; position: relative; overflow: hidden; background: var(--charcoal);
}
.stage::before {
    content: ''; position: absolute; width: 720px; height: 720px; top: -300px; right: -300px; border-radius: 50%;
    background: repeating-radial-gradient(circle, transparent 0 70px, rgba(255, 255, 255, .06) 70px 71px);
    pointer-events: none;
}
.stage::after {
    content: ''; position: absolute; width: 432px; height: 432px; top: -156px; right: -156px; border-radius: 50%;
    border: 1.5px solid rgba(212, 164, 55, .4); pointer-events: none;
}
.stage .brand { position: relative; margin-bottom: 28px; }
.panel { position: relative; width: 100%; max-width: 420px; padding: 32px 28px; border-radius: 22px; background: var(--surface); }
.panel h1 { margin-bottom: 6px; }
.panel .lead { margin: 0 0 24px; color: var(--muted); }
.panel .foot { margin-top: 18px; text-align: center; color: var(--muted); }
.panel .foot form { display: inline; }
.status-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px; background: var(--ok-soft); color: var(--ok); }
.status-icon.off { background: var(--danger-soft); color: var(--danger); }
.status-icon svg.i { width: 24px; height: 24px; stroke-width: 2.4; }

@media (max-width: 1100px) {
    .grid-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-2, .grid-halves { grid-template-columns: minmax(0, 1fr); }
    .invite-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
    .shell { grid-template-columns: 1fr; align-content: start; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; }
    .menu { flex-direction: row; flex: 1; order: 3; width: 100%; overflow-x: auto; }
    .menu-label { display: none; }
    .menu a { padding: 8px 12px; white-space: nowrap; }
    .menu a.active { box-shadow: inset 0 -2px 0 var(--lavender); }
    .me { margin: 0 0 0 auto; padding: 4px 4px 4px 10px; background: transparent; }
    .me .who { display: none; }
    .menu { scrollbar-width: none; }
    .header { padding: 18px 16px; }
    .content { padding: 20px 16px 48px; }
    .form-grid, .invite-row { grid-template-columns: 1fr; }
    .danger-zone .card-body { flex-direction: column; align-items: flex-start; }
    .search { width: 100%; }
    .filters, .filters select.input { width: 100%; max-width: none; }
    .tiles { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
    .grid-kpi { grid-template-columns: 1fr 1fr; gap: 12px; }
    .kpi { padding: 14px; }
    .kpi-value { font-size: 22px; }
    .panel { padding: 26px 20px; }
    th, td { padding-left: 14px; padding-right: 14px; }
}
.panel h1 + form { margin-top: 22px; }
.panel .alert { margin-bottom: 16px; }
