/* Faurigo console — shared design system.
   Buildless: hand-written CSS served straight from public/. Both the admin and
   shop consoles style themselves with these tokens and components; do not inline
   hex colours per page.

   Shell: dark sidebar + light content. Rules of the system:
   - numbers and labels wear text tokens (--text / --muted), never brand/status colour
   - status is carried by a .pill-* (with text), never by colour alone
   - borders, grids and dividers stay recessive */

:root {
    /* surfaces */
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    /* text */
    --text: #111827;
    --text-2: #374151;
    --muted: #6b7280;
    --subtle: #9ca3af;

    /* brand (used sparingly: active nav, primary buttons, focus rings) */
    --brand: #ff5a1f;
    --brand-dark: #e2450f;
    --brand-tint: #fff1ea;
    --ring: rgba(255, 90, 31, .22);

    /* status */
    --ok: #12805c;
    --ok-tint: #e7f6ef;
    --warn: #b45309;
    --warn-tint: #fef3e2;
    --danger: #b42318;
    --danger-tint: #fdecea;
    --info: #1d4ed8;
    --info-tint: #eaf0fe;

    /* sidebar */
    --side-bg: #111827;
    --side-bg-2: #0f172a;
    --side-border: rgba(255, 255, 255, .08);
    --side-text: #cbd5e1;
    --side-muted: #64748b;
    --side-hover: rgba(255, 255, 255, .06);
    --side-active: rgba(255, 90, 31, .16);
    --side-w: 248px;

    /* shape */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 6px rgba(16, 24, 40, .05);
    --shadow-lg: 0 4px 8px rgba(16, 24, 40, .04), 0 18px 40px rgba(16, 24, 40, .10);

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.005em; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 12px; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.err { color: var(--danger); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- app shell ------------------------------------------------------------*/
.app-shell {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky; top: 0; align-self: start;
    height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column;
    padding: 18px 12px 14px;
    background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
    color: var(--side-text);
    border-right: 1px solid var(--side-border);
}
.sidebar a:hover { text-decoration: none; }
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 10px 18px;
    font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: #fff;
}
.sidebar-brand::before {
    content: ""; width: 10px; height: 10px; border-radius: 3px;
    background: var(--brand); flex: none;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-section {
    padding: 16px 10px 6px;
    font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--side-muted);
}
.sidebar-section:first-child { padding-top: 4px; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    color: var(--side-text); font-weight: 500; font-size: 14px;
    transition: background .12s, color .12s;
}
.sidebar-link:hover { background: var(--side-hover); color: #fff; }
.sidebar-link.active {
    background: var(--side-active); color: #fff; font-weight: 600;
    box-shadow: inset 2px 0 0 var(--brand);
}
.sidebar-link:focus-visible { outline-offset: -2px; }
.sidebar-foot {
    margin-top: 16px; padding: 14px 10px 0;
    border-top: 1px solid var(--side-border);
    display: flex; flex-direction: column; gap: 10px;
}
.sidebar-user { min-width: 0; }
.sidebar-user-name { color: #fff; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-email { color: var(--side-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-foot form { margin: 0; }
.sidebar .chip, .sidebar .badge {
    background: rgba(255, 255, 255, .07); border-color: var(--side-border); color: var(--side-text);
}
.sidebar .btn-ghost { color: var(--side-text); padding-left: 8px; padding-right: 8px; }
.sidebar .btn-ghost:hover { background: var(--side-hover); color: #fff; }

.main { min-width: 0; padding: 28px 32px 64px; }
.main > .page-inner { max-width: 1280px; margin: 0 auto; }

/* slim top strip: only shown on mobile, carries the drawer toggle */
.main-top { display: none; }
.nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 0;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
    .app-shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
        width: min(var(--side-w), 84vw); height: auto;
        transform: translateX(-100%); visibility: hidden;
        transition: transform .2s ease, visibility .2s;
        box-shadow: var(--shadow-lg);
    }
    body.sidebar-open .sidebar { transform: none; visibility: visible; }
    body.sidebar-open { overflow: hidden; }
    .sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 40;
        background: rgba(15, 23, 42, .5);
        opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .main { padding: 0 16px 48px; }
    .main-top {
        display: flex; align-items: center; gap: 12px;
        position: sticky; top: 0; z-index: 30;
        margin: 0 -16px 20px; padding: 10px 16px;
        background: rgba(247, 248, 250, .92); backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--border);
    }
    .main-top-brand { font-weight: 700; font-size: 16px; color: var(--text); }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar, .sidebar-backdrop { transition: none; }
}

/* ---- page (guest pages, and legacy wrapper) --------------------------------*/
.page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }

.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-header h1 { margin: 0; }
.page-header p { margin: 4px 0 0; color: var(--muted); }
.page-header > :last-child:not(:first-child) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* legacy header — same job as .page-header */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-head p { margin: 4px 0 0; }

/* Fallback for views still using the old in-page module nav: the module links
   now live in the sidebar, so the split collapses to one column and the subnav
   becomes a horizontal pill tab bar. */
.layout-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.subnav {
    display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px;
    padding: 4px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 999px;
    width: fit-content; max-width: 100%;
}
.subnav a {
    padding: 6px 14px; border-radius: 999px;
    color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap;
}
.subnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.subnav a.active { background: var(--brand-tint); color: var(--brand-dark); font-weight: 600; }

/* ---- cards ----------------------------------------------------------------*/
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.grid > .card + .card, .kpi-grid > .card + .card { margin-top: 0; }
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; gap: 12px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 0; line-height: 1.35; }

.grid { display: grid; gap: 16px; }
.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)); }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* ---- KPI tiles ------------------------------------------------------------*/
.kpi-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 24px;
}
.kpi, .stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.kpi-label, .stat .l {
    font-size: 12px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase;
    color: var(--muted);
}
.kpi-value, .stat .n {
    font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em;
    color: var(--text); font-variant-numeric: tabular-nums;
}
.stat .l { order: -1; }
.kpi-delta { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.up::before { content: "\25B2\00a0"; font-size: 9px; }
.kpi-delta.down::before { content: "\25BC\00a0"; font-size: 9px; }

/* ---- tables ---------------------------------------------------------------*/
.table-wrap {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto;
}
.card > .table-wrap { box-shadow: none; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; }
table.data th, table.data td {
    text-align: left; padding: 13px 16px;
    border-bottom: 1px solid var(--border); vertical-align: middle;
}
table.data th {
    position: sticky; top: 0; z-index: 1;
    background: var(--surface-2);
    padding-top: 10px; padding-bottom: 10px;
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); white-space: nowrap;
}
table.data td { color: var(--text-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data th.right, table.data td.right { text-align: right; }

/* ---- badges / pills / chips ----------------------------------------------*/
.badge, .chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 6px;
    font-size: 12px; font-weight: 500; line-height: 1.5;
    background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
    white-space: nowrap;
}
.badge { border-radius: 999px; font-weight: 600; color: var(--muted); }
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap;
    background: var(--surface-2); color: var(--muted);
}
.pill-ok { background: var(--ok-tint); color: var(--ok); }
.pill-warn { background: var(--warn-tint); color: var(--warn); }
.pill-danger { background: var(--danger-tint); color: var(--danger); }
.pill-info { background: var(--info-tint); color: var(--info); }
.pill-muted { background: #f1f3f5; color: var(--muted); }

/* ---- buttons --------------------------------------------------------------*/
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px;
    cursor: pointer; font-family: inherit; line-height: 1.15; white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: rgba(17, 24, 39, .05); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #9a1c13; border-color: #9a1c13; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0e6a4c; border-color: #0e6a4c; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row form { margin: 0; }

/* ---- forms ----------------------------------------------------------------*/
.stack { display: flex; flex-direction: column; gap: 14px; }
label > span { display: block; font-weight: 500; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], input[type=search], input[type=time], input[type=url],
input[type=date], select, textarea {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14px; line-height: 1.4;
    background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--subtle); }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring);
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
/* File picker: a dashed drop-style box whose "Choose file" button matches .btn. */
input[type=file] {
    width: 100%; max-width: 100%; padding: 6px;
    border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--muted);
    font-family: inherit; font-size: 13px; cursor: pointer;
    transition: border-color .12s, background .12s;
}
input[type=file]:hover { border-color: var(--brand); background: var(--brand-tint); }
input[type=file]:focus { box-shadow: none; }
input[type=file]:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
input[type=file]::file-selector-button {
    margin-right: 12px; padding: 7px 14px;
    border: 1px solid var(--brand); border-radius: var(--radius-sm);
    background: var(--brand); color: #fff;
    font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1.15;
    cursor: pointer; box-shadow: var(--shadow-sm);
    transition: background .12s, border-color .12s;
}
input[type=file]::file-selector-button:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
/* Photo picker ([data-photo-picker], shop/_photo_picker): a click / drop zone with a
   preview. The real file input covers the zone (transparent) so a click, a tap or
   Enter/Space on it opens the chooser. Until app.js marks it .is-ready, only the
   plain input above shows. */
.photo-picker:not(.is-ready) .photo-drop > :not(input) { display: none; }
.photo-picker.is-ready .photo-drop {
    position: relative; display: flex; align-items: center; gap: 14px;
    padding: 12px; min-height: 88px;
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface-2);
    transition: border-color .12s, background .12s, box-shadow .12s;
}
.photo-picker.is-ready .photo-drop:hover,
.photo-picker.is-dragover .photo-drop { border-color: var(--brand); background: var(--brand-tint); }
.photo-picker.is-ready .photo-drop:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.photo-picker.has-photo .photo-drop { border-style: solid; background: var(--surface); }
.photo-picker.is-ready .photo-drop input[type=file] {
    position: absolute; inset: 0; width: 100%; height: 100%;
    margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer;
}
.photo-thumb {
    flex: none; display: grid; place-items: center; overflow: hidden;
    width: 64px; height: 64px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb img[hidden], .photo-picker.has-photo .photo-thumb svg { display: none; }
.photo-picker.is-removing .photo-thumb img { opacity: .35; filter: grayscale(1); }
.photo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.photo-text strong { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-text span { font-size: 12px; color: var(--muted); }
.photo-choose { flex: none; pointer-events: none; }
.photo-picker.is-dragover .photo-choose, .photo-drop:hover .photo-choose { border-color: var(--brand); color: var(--brand-dark); }
.photo-clear { position: relative; z-index: 1; flex: none; color: var(--muted); }
.photo-clear:hover { color: var(--danger); }
.photo-clear[hidden], .photo-check[hidden] { display: none; }
.photo-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.photo-check > span { display: inline; margin: 0; font-weight: 500; }
.photo-error { margin: 8px 0 0; font-size: 13px; font-weight: 500; color: var(--danger); }
.photo-error[hidden] { display: none; }
@media (max-width: 420px) { .photo-choose { display: none; } .photo-thumb { width: 56px; height: 56px; } }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: minmax(0, 1fr); } }

/* ---- flash ----------------------------------------------------------------*/
.flash {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 18px;
    font-weight: 500; border: 1px solid transparent;
}
.flash[hidden] { display: none; }
.flash::before { font-weight: 700; flex: none; }
.flash-success { background: var(--ok-tint); color: var(--ok); border-color: rgba(18, 128, 92, .18); }
.flash-success::before { content: "\2713"; }
.flash-error { background: var(--danger-tint); color: var(--danger); border-color: rgba(180, 35, 24, .18); }
.flash-error::before { content: "!"; }

/* ---- auth screen ----------------------------------------------------------*/
body.guest {
    background:
        radial-gradient(900px 520px at 50% -8%, rgba(255, 90, 31, .13), transparent 62%),
        radial-gradient(700px 480px at 92% 105%, rgba(29, 78, 216, .07), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}
body.guest .page { max-width: none; padding: 0; }
.auth-wrap {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 18px; padding: 24px;
}
.auth-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: var(--shadow-lg);
    padding: 40px 36px 32px; width: 100%; max-width: 400px;
}
.auth-card h1 { font-size: 20px; }
.auth-card h1 + .muted { margin-bottom: 22px; }
.auth-card .btn-primary { padding-top: 11px; padding-bottom: 11px; }
.auth-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 20px; letter-spacing: -.01em; color: var(--text);
    margin-bottom: 26px;
}
.auth-brand::before {
    content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--brand); flex: none;
}
.auth-foot { font-size: 12px; text-align: center; margin: 0; }
.auth-alt { text-align: center; margin: 20px 0 0; font-size: 13px; }
/* "or" divider between sign-in methods */
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-google { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.auth-google .flash { width: 100%; margin-bottom: 0; }
@media (max-width: 480px) { .auth-card { padding: 28px 22px 24px; } }

/* ---- misc -----------------------------------------------------------------*/
.empty-state {
    text-align: center; padding: 56px 24px; max-width: 520px; margin: 0 auto;
    color: var(--muted);
}
.empty-state h1, .empty-state h2, .empty-state h3 { color: var(--text); margin-bottom: 8px; }
.empty-state p { margin-bottom: 18px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { margin-left: auto; }
.toolbar form { margin: 0; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }


/* ---------- Popups (native <dialog class="modal">) ---------- */
dialog.modal {
    border: 1px solid var(--border); border-radius: var(--radius); padding: 0;
    width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
    background: var(--surface); color: var(--text);
    box-shadow: 0 24px 64px rgba(17, 24, 39, .28);
}
dialog.modal::backdrop { background: rgba(17, 24, 39, .5); }
dialog.modal[open] { display: flex; flex-direction: column; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
    border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer;
    color: var(--muted); padding: 2px 6px; border-radius: 6px;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}
