/*
 * Nexa Bella admin — plain CSS, no build step.
 * White editorial canvas, brand-red sidebar band, near-black text, hairline borders,
 * Space Grotesk display / Inter UI type, compact density.
 */

:root {
    --ink: #212121;
    --ink-soft: #3b3b44;
    --muted: #75758a;
    --canvas: #ffffff;
    --stone: #f4f3ef;
    --hairline: #e3e3e8;
    --border: #d9d9dd;
    --brand: #b00020;
    --brand-dark: #8a0019;
    --brand-soft: #fdecef;
    --focus: #4c6ee6;
    --success: #15803d;
    --success-soft: #e7f6ec;
    --warning: #b45309;
    --warning-soft: #fdf3e2;
    --danger: #b91c1c;
    --danger-soft: #fdecec;
    --info: #1d4ed8;
    --info-soft: #e8eefd;
    --gray-soft: #f1f1f4;
    --radius: 8px;
    --display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;
    --ui: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --sidebar-w: 15rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1rem/1.5 var(--ui); color: var(--ink); background: var(--canvas); }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
    position: sticky; top: .5rem; flex: none; width: var(--sidebar-w);
    height: calc(100dvh - 1rem); margin: .5rem 0 .5rem .5rem;
    background: var(--brand); color: #fff; border-radius: 16px;
    display: flex; flex-direction: column; overflow: hidden; z-index: 40;
}
.sidebar-brand {
    display: flex; align-items: center; gap: .6rem; height: 3.5rem; padding: 0 1rem;
    border-bottom: 1px solid rgba(255,255,255,.12); text-decoration: none;
    font: 400 1.05rem/1 var(--display); letter-spacing: .08em; color: #fff;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: 1rem; }
.nav-group-label { padding: 0 .6rem .3rem; font-size: .7rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.nav-item {
    display: flex; align-items: center; gap: .6rem; padding: .38rem .6rem; border-radius: 6px;
    color: rgba(255,255,255,.85); text-decoration: none; font-size: .92rem;
}
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.is-active { background: rgba(255,255,255,.15); color: #fff; }
.nav-item .icon { width: 1.1rem; height: 1.1rem; color: rgba(255,255,255,.6); flex: none; }
.nav-item.is-active .icon { color: #fff; }
.nav-item .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { font-size: .7rem; line-height: 1; padding: .2rem .45rem; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff; }
.nav-badge.is-danger { background: #fff; color: var(--brand); }
.nav-badge.is-warning { background: #ffd8a8; color: #7a3d00; }
.sidebar-foot { padding: .75rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }
.sidebar-foot .who { color: rgba(255,255,255,.75); margin-bottom: .4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; color: #fff; }
.sidebar-foot button:hover { text-decoration: underline; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; justify-content: space-between; height: 3.25rem; padding: 0 1rem; border-bottom: 1px solid var(--hairline); background: var(--canvas); position: sticky; top: 0; z-index: 30; }
.topbar-brand { font: 400 1rem/1 var(--display); letter-spacing: .08em; text-decoration: none; }
.sidebar-brand img { display: block; max-height: 2.2rem; max-width: 100%; object-fit: contain; }
.topbar-brand img { display: block; max-height: 1.8rem; max-width: 10rem; object-fit: contain; }
.auth-brand img { display: block; margin: 0 auto .4rem; }
.content { width: 100%; max-width: 1400px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }
.sidebar-backdrop { display: none; }

@media (max-width: 1024px) {
    .topbar { display: flex; }
    .sidebar { position: fixed; top: 0; left: 0; margin: 0; height: 100dvh; border-radius: 0; transform: translateX(-100%); transition: transform .2s ease; }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
    .content { padding: 1rem 1rem 3rem; }
}

/* ---------- Icons ---------- */
.icon { width: 1.15rem; height: 1.15rem; flex: none; vertical-align: middle; }
.icon-sm { width: .95rem; height: .95rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }

/* ---------- Page header ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.1rem; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.page-title { margin: 0; font: 400 1.65rem/1.15 var(--display); letter-spacing: -.02em; }
.page-subheading { margin: .3rem 0 0; color: var(--muted); font-size: .92rem; max-width: 60rem; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .45rem 1.05rem; border-radius: 999px; border: 1px solid var(--border);
    background: var(--canvas); color: var(--ink); font: 500 .92rem/1.2 var(--ui);
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--gray-soft); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-danger { color: var(--danger); border-color: #f1c4c4; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--gray-soft); }
.btn-sm { padding: .28rem .7rem; font-size: .82rem; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.link { color: var(--brand); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--gray-soft); color: var(--ink); }
.inline-form { display: inline; margin: 0; }

/* ---------- Cards / sections ---------- */
.card { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--radius); }
.card + .card, .card + .section, .section + .card, .section + .section, .stack > * + * { margin-top: 1rem; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--hairline); }
.card-title { margin: 0; font: 500 1rem/1.3 var(--display); }
.card-description { margin: .2rem 0 0; color: var(--muted); font-size: .85rem; }
.card-body { padding: 1rem; }
.card-footer { padding: .75rem 1rem; border-top: 1px solid var(--hairline); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.section-aside { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 1.25rem; }
.section-aside .card-title { font-size: 1rem; }
@media (max-width: 900px) { .section-aside { grid-template-columns: 1fr; } }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-full { grid-column: 1 / -1; }
.col-span-2 { grid-column: span 2; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .col-span-2 { grid-column: auto; } }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: .5rem; } .mb-4 { margin-bottom: 1rem; }
.text-muted { color: var(--muted); } .text-sm { font-size: .85rem; } .text-xs { font-size: .75rem; } .text-lg { font-size: 1.15rem; }
.text-right { text-align: right; } .text-center { text-align: center; } .font-medium { font-weight: 500; } .font-semibold { font-weight: 600; }
.text-danger { color: var(--danger); } .text-success { color: var(--success); } .text-warning { color: var(--warning); }
.nowrap { white-space: nowrap; } .w-full { width: 100%; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.display { font-family: var(--display); letter-spacing: -.02em; }
.divider { border: 0; border-top: 1px solid var(--hairline); margin: 1rem 0; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field-label { font-size: .86rem; font-weight: 500; color: var(--ink-soft); }
.field-label .req { color: var(--danger); margin-left: .1rem; }
.field-help { font-size: .8rem; color: var(--muted); }
.field-error { font-size: .8rem; color: var(--danger); }
.input, .select, .textarea {
    width: 100%; padding: .45rem .65rem; border: 1px solid var(--border); border-radius: 6px;
    background: var(--canvas); color: var(--ink); font: 400 .95rem/1.4 var(--ui);
}
.textarea { resize: vertical; min-height: 4.5rem; }
.select { appearance: auto; }
/* Multi-select: a select-sized button that opens a checkbox list (see <x-admin.select multiple>). */
.multi-select { position: relative; }
.multi-select-summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-right: 2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2375758a'%3E%3Cpath d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.17l3.71-3.94a.75.75 0 1 1 1.08 1.04l-4.25 4.5a.75.75 0 0 1-1.08 0l-4.25-4.5a.75.75 0 0 1 .02-1.06Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .55rem center; background-size: 1.1rem; }
.multi-select-summary::-webkit-details-marker { display: none; }
.multi-select-summary > span { overflow: hidden; text-overflow: ellipsis; }
.multi-select-summary.is-placeholder { color: var(--ink-soft); }
.multi-select[open] > .multi-select-summary { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(76,110,230,.15); }
.multi-select-menu { position: absolute; z-index: 25; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(22rem, 90vw); max-height: 16rem; overflow-y: auto;
    display: flex; flex-direction: column; gap: .15rem; padding: .4rem; background: var(--canvas); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.multi-select-menu .check { padding: .3rem .45rem; border-radius: 6px; white-space: nowrap; }
.multi-select-menu .check:hover { background: var(--gray-soft); }
.multi-select-group { padding: .35rem .45rem .15rem; font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(76,110,230,.15); outline: none; }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--danger); }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled { background: var(--gray-soft); color: var(--muted); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { flex: 1; min-width: 0; }
.input-addon { display: flex; align-items: center; padding: 0 .6rem; border: 1px solid var(--border); background: var(--gray-soft); color: var(--muted); font-size: .9rem; white-space: nowrap; }
.input-group .input-addon:first-child { border-right: 0; border-radius: 6px 0 0 6px; }
.input-group .input-addon:last-child { border-left: 0; border-radius: 0 6px 6px 0; }
.input-group .input-addon:first-child + .input { border-radius: 0 6px 6px 0; }
.input-group .input:not(:last-child) { border-radius: 6px 0 0 6px; }
.input-group .input-addon:first-child + .input:not(:last-child) { border-radius: 0; }
.check { display: inline-flex; align-items: flex-start; gap: .5rem; font-size: .92rem; cursor: pointer; }
.check input { margin-top: .2rem; accent-color: var(--brand); width: 1rem; height: 1rem; flex: none; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .45rem 1rem; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .92rem; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { width: 2.3rem; height: 1.3rem; border-radius: 999px; background: #d4d4da; position: relative; transition: background .15s; flex: none; }
.toggle-track::after { content: ''; position: absolute; top: .15rem; left: .15rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input:checked + .toggle-track { background: var(--brand); }
.toggle input:checked + .toggle-track::after { transform: translateX(1rem); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.form-errors { margin-bottom: 1rem; }
.file-current { display: flex; align-items: center; gap: .75rem; margin-bottom: .4rem; }
.file-current img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--hairline); }
.file-current.is-contained img { width: auto; max-width: 220px; height: 64px; object-fit: contain; padding: 8px; background: var(--stone); }
.file-current.on-dark img { background: #181818; border-color: #181818; }

/* ---------- Alerts / flash ---------- */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--radius); border: 1px solid; margin-bottom: 1rem; font-size: .92rem; }
.alert ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.alert-success { background: var(--success-soft); border-color: #bfe3cb; color: #14532d; }
.alert-danger { background: var(--danger-soft); border-color: #f3c7c7; color: #7f1d1d; }
.alert-warning { background: var(--warning-soft); border-color: #f2d8ad; color: #78350f; }
.alert-info { background: var(--info-soft); border-color: #c9d6fa; color: #1e3a8a; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 500; line-height: 1.5; white-space: nowrap; background: var(--gray-soft); color: var(--ink-soft); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--brand-soft); color: var(--brand); }

/* ---------- Tables ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; padding: .75rem 1rem; border-bottom: 1px solid var(--hairline); }
.toolbar .field { min-width: 10rem; }
.toolbar .field.grow { flex: 1; min-width: 14rem; }
.toolbar .field-label { font-size: .78rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .55rem .75rem; border-bottom: 1px solid var(--hairline); white-space: nowrap; background: #fafafb; }
.table td { padding: .55rem .75rem; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfbfc; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .actions > * { margin-left: .15rem; }
.table th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .2rem; }
.table th a:hover { color: var(--ink); }
.table th.is-sorted a { color: var(--ink); }
.table .thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--hairline); display: block; }
.table .sub { display: block; font-size: .8rem; color: var(--muted); }
.table tfoot td { font-weight: 600; background: #fafafb; border-top: 1px solid var(--hairline); }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty .icon { width: 2rem; height: 2rem; margin-bottom: .4rem; color: #b5b5c0; }
.empty-title { color: var(--ink); font-weight: 500; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem 1rem; border-top: 1px solid var(--hairline); font-size: .85rem; color: var(--muted); }
.pagination-links { display: flex; gap: .25rem; flex-wrap: wrap; }
.pagination-links a, .pagination-links span { display: inline-flex; min-width: 2rem; height: 2rem; align-items: center; justify-content: center; padding: 0 .5rem; border-radius: 6px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.pagination-links a:hover { background: var(--gray-soft); }
.pagination-links .is-current { border-color: var(--border); font-weight: 600; }
.pagination-links .is-disabled { color: #c0c0c8; }

/* ---------- Description lists ---------- */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.dl dt { font-size: .78rem; color: var(--muted); margin-bottom: .15rem; }
.dl dd { margin: 0; font-size: .95rem; word-break: break-word; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { border: 1px solid var(--hairline); border-radius: var(--radius); padding: .9rem 1rem; background: var(--canvas); }
.stat-label { font-size: .82rem; color: var(--muted); }
.stat-value { font: 400 1.7rem/1.2 var(--display); letter-spacing: -.02em; margin-top: .2rem; }
.stat-desc { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.stat-desc.is-success { color: var(--success); } .stat-desc.is-danger { color: var(--danger); } .stat-desc.is-warning { color: var(--warning); }

/* ---------- Bar charts (server-rendered) ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: .5rem; }
.bars .bar { flex: 1; min-width: 2px; background: var(--brand); border-radius: 3px 3px 0 0; position: relative; }
.bars .bar:hover { background: var(--brand-dark); }
.bars-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: .35rem; }
.hbar { display: grid; grid-template-columns: minmax(6rem, 12rem) 1fr auto; align-items: center; gap: .6rem; font-size: .88rem; padding: .25rem 0; }
.hbar-track { height: .55rem; background: var(--gray-soft); border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--brand); border-radius: 999px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--hairline); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: thin; }
.tab { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .8rem; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font: 500 .9rem/1.2 var(--ui); cursor: pointer; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.tab .icon { width: 1rem; height: 1rem; }
.tab-panel:not(.is-active) { display: none; }

/* ---------- Repeater ---------- */
.repeater-items { display: flex; flex-direction: column; gap: .6rem; }
.repeater-item { border: 1px solid var(--hairline); border-radius: var(--radius); background: #fcfcfd; }
.repeater-item-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .5rem .35rem .8rem; border-bottom: 1px solid var(--hairline); font-size: .85rem; color: var(--muted); }
.repeater-item-body { padding: .8rem; }
.repeater-compact .repeater-item-head { display: none; }
.repeater-compact .repeater-item { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; }
.repeater-compact .repeater-item-body { padding: 0; flex: 1; }
.repeater-add { margin-top: .6rem; }

/* ---------- Dialogs ---------- */
dialog.modal { border: 0; border-radius: 12px; padding: 0; width: min(36rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); }
dialog.modal.modal-lg { width: min(56rem, calc(100vw - 2rem)); }
dialog.modal.slide-over { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; border-radius: 12px 0 0 12px; }
dialog.modal::backdrop { background: rgba(15,15,20,.45); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem .6rem; }
.modal-title { margin: 0; font: 500 1.1rem/1.3 var(--display); }
.modal-body { padding: .4rem 1.1rem 1rem; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1.1rem; border-top: 1px solid var(--hairline); }

/* ---------- Help ---------- */
.help-trigger { position: relative; }
.help-trigger .dot { position: absolute; top: .3rem; right: .3rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px #fff; }
.help-section h3 { margin: 0 0 .4rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.help-section ol, .help-section ul { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .35rem; }
.help-section + .help-section { margin-top: 1.25rem; }

/* ---------- Login ---------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: var(--stone); }
.auth-card { width: 100%; max-width: 24rem; background: #fff; border: 1px solid var(--hairline); border-radius: 22px; padding: 2rem 1.75rem; }
.auth-brand { text-align: center; font: 400 1.3rem/1 var(--display); letter-spacing: .1em; color: var(--brand); margin-bottom: .4rem; }
.auth-title { text-align: center; font: 400 1.4rem/1.2 var(--display); margin: 0 0 1.5rem; letter-spacing: -.02em; }

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .page-actions, .toolbar, .pagination, .no-print { display: none !important; }
    .content { padding: 0; max-width: none; }
    .card { border: 0; }
}
