/* UniShop · panel de administración. Tokens en :root, modo oscuro automático. */
:root {
  --bg: #f3f4f2;
  --surface: #ffffff;
  --surface-2: #f8f9f7;
  --ink: #18201c;
  --ink-2: #414b46;
  --muted: #68726d;
  --border: #e1e4e0;
  --border-strong: #c9cfca;
  --primary: #18201c;
  --primary-ink: #ffffff;
  --brand: #d4572e;
  --focus: #2b62c9;
  --success: #17724f; --success-bg: #e2f3ea;
  --warning: #8a5a0b; --warning-bg: #fbefd2;
  --danger: #b3301f; --danger-bg: #fbe6e2;
  --info: #23508f; --info-bg: #e3edfa;
  --neutral-bg: #eceeeb;
  --shadow: 0 1px 2px rgb(24 32 28 / .06), 0 1px 0 rgb(24 32 28 / .03);
  --shadow-lg: 0 18px 50px rgb(24 32 28 / .18);
  --r: 10px; --r-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: "Outfit", var(--font);
  --sidebar-w: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1211; --surface: #181c1a; --surface-2: #1e2321; --ink: #edf0ee; --ink-2: #c5cbc7; --muted: #929c97;
    --border: #2a302d; --border-strong: #3b433f; --primary: #edf0ee; --primary-ink: #131715; --brand: #f07a4f; --focus: #7aa7f5;
    --success: #6fd3a5; --success-bg: #12301f; --warning: #f0c060; --warning-bg: #33280d; --danger: #f59a8b; --danger-bg: #3a1712;
    --info: #9cc0f5; --info-bg: #14263f; --neutral-bg: #262b29;
    --shadow: 0 1px 2px rgb(0 0 0 / .4); --shadow-lg: 0 18px 50px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.015em; margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 600; } h2 { font-size: 15px; font-weight: 600; } h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; } a { color: inherit; }
img { max-width: 100%; display: block; }
.icon { flex: none; vertical-align: middle; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; border-right: 1px solid var(--border); background: var(--surface-2); overflow-y: auto; }
.brand { font: 600 21px/1 var(--font-display); letter-spacing: -.03em; text-decoration: none; padding: 4px 8px; }
.brand-mark { color: var(--muted); } .brand-cursor { color: var(--brand); }
.shop-switch { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.shop-avatar { width: 34px; height: 34px; border-radius: 8px; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font: 600 15px var(--font-display); flex: none; }
.shop-meta { min-width: 0; display: grid; } .shop-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.shop-meta a { font-size: 12.5px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; } .shop-meta a:hover { color: var(--ink); }
.nav { display: grid; gap: 2px; align-content: start; flex: 1; }
.nav-section { margin: 14px 10px 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav-item:hover { background: var(--neutral-bg); color: var(--ink); }
.nav-item.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav-badge { margin-left: auto; background: var(--neutral-bg); border-radius: 99px; padding: 0 8px; font-size: 12px; font-weight: 600; }
.nav-children { display: grid; gap: 1px; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid var(--border); }
.nav-child { padding: 5px 10px; border-radius: 6px; text-decoration: none; color: var(--muted); font-size: 13.5px; }
.nav-child:hover, .nav-child.active { color: var(--ink); background: var(--neutral-bg); }
.sidebar-foot { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 0 10px; }
.user-name { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; } .user-name:hover { color: var(--ink); text-decoration: underline; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; gap: 10px; align-items: center; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.global-search { display: flex; align-items: center; gap: 8px; width: min(520px, 100%); padding: 0 12px; height: 36px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--muted); }
.global-search input { border: 0; background: none; outline: none; flex: 1; font: inherit; color: var(--ink); min-width: 0; padding: 0; }
.global-search:focus-within { border-color: var(--focus); }
.btn.menu-toggle { display: none; }
.content { padding: 24px 28px 64px; width: 100%; margin: 0 auto; }
.content-narrow { max-width: 760px; } .content-wide { max-width: 1120px; } .content-full { max-width: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.page-title h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); flex: none; }
.back:hover { border-color: var(--border-strong); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px 0; }
.card-head p { font-size: 13px; margin-top: 2px; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px 18px 18px; }
.card-flush > .card-body { padding: 0; } .card-flush > .card-head { padding-bottom: 12px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.card-body > * + * { margin-top: 14px; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.two-col > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card + .card, .grid-3 > .card + .card { margin-top: 0; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.section-title { font: 600 13px var(--font); color: var(--muted); margin: 0 0 8px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid transparent; font: 500 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); } .btn-primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--surface)); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); } .btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); } .btn-danger:hover { background: var(--danger-bg); }
.btn-plain { background: none; color: var(--ink-2); } .btn-plain:hover { background: var(--neutral-bg); color: var(--ink); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; } .btn-icon { width: 36px; padding: 0; } .btn-sm.btn-icon { width: 30px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline-flex; margin: 0; }
.link { color: var(--info); text-decoration: none; font-weight: 500; } .link:hover { text-decoration: underline; }
.link-plain { text-decoration: none; font-weight: 500; } .link-plain:hover { text-decoration: underline; }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 500; font-size: 13.5px; }
input[type=text], input[type=email], input[type=number], input[type=url], input[type=password], input[type=search], input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; min-height: 36px; padding: 7px 11px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; }
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%2368726d'%3E%3Cpath d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); }
.help { font-size: 12.5px; color: var(--muted); } .field-error { font-size: 12.5px; color: var(--danger); }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-radius: 0; min-width: 0; } .input-group > :first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); } .input-group > :last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.affix { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); font-size: 13px; }
.input-group .affix:first-child { border-right: 0; } .input-group .affix:last-child { border-left: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: start; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.check label { font-weight: 400; } .check .help { display: block; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; } legend { font-weight: 500; font-size: 13.5px; padding: 0; margin-bottom: 8px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.save-bar { position: sticky; bottom: 0; z-index: 15; display: flex; justify-content: flex-end; gap: 8px; align-items: center; padding: 12px 0; margin-top: 18px; background: linear-gradient(to top, var(--bg) 70%, transparent); }

.richtext { border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.rt-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rt-toolbar button { width: 30px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; }
.rt-toolbar button:hover { background: var(--neutral-bg); color: var(--ink); } .rt-source-btn { margin-left: auto; }
.rt-area { padding: 12px 14px; outline: none; line-height: 1.6; overflow-wrap: anywhere; }
.rt-area > :first-child { margin-top: 0; } .rt-area p, .rt-area ul, .rt-area ol { margin: 0 0 10px; } .rt-area h2 { font-size: 18px; margin: 14px 0 8px; } .rt-area h3 { font-size: 15px; margin: 12px 0 6px; } .rt-area a { color: var(--info); }
.rt-source { border: 0 !important; border-radius: 0 !important; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.image-field { display: flex; gap: 12px; align-items: flex-start; }
.image-preview { width: 76px; height: 76px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); overflow: hidden; flex: none; background: var(--surface-2); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-controls { flex: 1; display: grid; gap: 8px; min-width: 0; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; } .table tbody tr:hover td { background: var(--surface-2); }
.table th:first-child, .table td:first-child { padding-left: 18px; } .table th:last-child, .table td:last-child { padding-right: 18px; }
.t-right { text-align: right !important; } .t-center { text-align: center !important; } .t-narrow { width: 1%; }
.table input[type=text], .table input[type=number] { min-height: 32px; padding: 5px 9px; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; } .cell-main strong { font-weight: 500; } .cell-main a { text-decoration: none; } .cell-main a:hover { text-decoration: underline; }
.thumb { width: 40px; height: 40px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 14px; }
.search-bar { display: flex; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: center; }
.search-bar select { width: auto; } .search-input { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--muted); background: var(--surface); }
.search-input input { border: 0; padding: 0; min-height: 34px; outline: none !important; background: none; } .search-input:focus-within { border-color: var(--focus); }
.tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--ink); } .tabs a.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab-count { background: var(--neutral-bg); border-radius: 99px; padding: 0 7px; font-size: 12px; }
.bulk-bar { display: flex; gap: 8px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }

/* ---------- Insignias, avisos ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.badge-neutral { background: var(--neutral-bg); color: var(--ink-2); } .badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); } .badge-danger { background: var(--danger-bg); color: var(--danger); } .badge-info { background: var(--info-bg); color: var(--info); }
.flash, .notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); margin-bottom: 16px; border: 1px solid transparent; }
.flash-success, .notice-success { background: var(--success-bg); color: var(--success); } .flash-error, .notice-danger { background: var(--danger-bg); color: var(--danger); }
.notice-info { background: var(--info-bg); color: var(--info); } .notice-warning { background: var(--warning-bg); color: var(--warning); }
.notice .icon, .flash .icon { margin-top: 1px; } .notice a { font-weight: 500; }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 48px 24px; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 16px; } .empty p { max-width: 44ch; } .empty .btn { margin-top: 8px; }

/* ---------- Datos ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; }
.stat { display: grid; gap: 3px; padding: 16px 18px; border-right: 1px solid var(--border); } .stats .stat:last-child { border-right: 0; }
.stat-label { color: var(--muted); font-size: 13px; } .stat-value { font: 600 24px/1.2 var(--font-display); letter-spacing: -.02em; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 2px; font: 600 12.5px var(--font); letter-spacing: 0; } .delta.up { color: var(--success); } .delta.down { color: var(--danger); }
.dl { display: grid; gap: 10px; margin: 0; } .dl dt { font-size: 12.5px; color: var(--muted); } .dl dd { margin: 0; overflow-wrap: anywhere; }
.summary { display: grid; gap: 7px; } .summary > div { display: flex; justify-content: space-between; gap: 16px; } .summary .total { font-weight: 600; font-size: 15px; padding-top: 9px; border-top: 1px solid var(--border); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; align-items: start; }
.timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); margin-top: 6px; }
.timeline time { display: block; font-size: 12.5px; color: var(--muted); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font: 11px var(--font); }
.chart .grid { stroke: var(--border); stroke-width: 1; } .chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: color-mix(in srgb, var(--ink) 7%, transparent); } .chart .bar { fill: var(--ink); } .chart .bar-2 { fill: var(--border-strong); }
.chart .hit { fill: transparent; } .chart .hit:hover + .dot { opacity: 1; } .chart .dot { fill: var(--brand); opacity: 0; pointer-events: none; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.rank .rank-name { display: flex; gap: 10px; align-items: center; min-width: 0; } .rank .rank-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .rank-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--ink); min-width: 2px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; }
.checklist li a:hover { background: var(--surface-2); } .checklist .done { color: var(--muted); } .checklist .done .icon { color: var(--success); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.media-item { position: relative; aspect-ratio: 1; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.media-item img { width: 100%; height: 100%; object-fit: cover; } .media-item .media-actions { position: absolute; inset: auto 4px 4px auto; display: flex; gap: 4px; }
.media-item .btn { background: var(--surface); border-color: var(--border); }
.dropzone { display: grid; place-items: center; gap: 6px; padding: 22px; border: 1px dashed var(--border-strong); border-radius: var(--r); color: var(--muted); text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.over { background: var(--surface-2); border-color: var(--focus); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--neutral-bg); font-size: 13px; }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); display: grid; }
.code-box { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); font-family: ui-monospace, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
.settings-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.settings-nav a { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); text-decoration: none; box-shadow: var(--shadow); }
.settings-nav a:hover { border-color: var(--border-strong); } .settings-nav strong { display: block; font-weight: 600; } .settings-nav span { color: var(--muted); font-size: 13px; }
.repeat-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.repeat-row + .repeat-row { margin-top: 8px; }

/* ---------- Diálogos ---------- */
.dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgb(10 14 12 / .45); }
.dialog > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dialog-body { padding: 18px; } .dialog-body > * + * { margin-top: 14px; }

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .btn.menu-toggle { display: inline-flex; }
  .topbar { padding: 10px 14px; } .content { padding: 18px 14px 56px; }
  .two-col, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
