/* ★ Chest Atelier · estilos de la tienda y de Gestión */
/* Layout: talabartería catalog. Sticky brand bar, category rail, photo-first product grid; admin is a ledger behind #admin. */
:root {
  --bg: #EDE5D3;          /* papel crudo */
  --surface: #F6F0E2;
  --ink: #3B3327;         /* cuero oscuro */
  --ink-soft: #6E6352;
  --line: #D3C7AE;        /* crema del logo */
  --brand: #494031;       /* fondo del logo */
  --brand-ink: #D3C7AE;
  --accent: #9A5B2E;      /* suela / costura */
  --ok: #4F6B3A;
  --warn: #A06A12;
  --bad: #9B3B2A;
  --f-display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --f-script: "Snell Roundhand", cursive;
  --f-body: "Karla", "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #24201A; --surface: #2E2921; --ink: #E6DCC6; --ink-soft: #B3A78F; --line: #4A4234;
  --brand: #3A3328; --brand-ink: #D3C7AE; --accent: #D08F5C; --ok: #9DBB7F; --warn: #E0AE57; --bad: #E48A73; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #24201A; --surface: #2E2921; --ink: #E6DCC6; --ink-soft: #B3A78F; --line: #4A4234;
  --brand: #3A3328; --brand-ink: #D3C7AE; --accent: #D08F5C; --ok: #9DBB7F; --warn: #E0AE57; --bad: #E48A73; color-scheme: dark }

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; padding-top: env(safe-area-inset-top, 0px) }
img { max-width: 100% }
[hidden] { display: none !important }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--f-body); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--brand) }
a { color: inherit }
button, input, select, textarea { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.wrap { max-width: 1120px; margin: 0 auto }
.star { color: var(--accent) }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; text-wrap: balance; margin: 0; line-height: 1.15 }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft) }
.num { font-variant-numeric: tabular-nums }

/* top bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--brand); color: var(--brand-ink); }
.bar .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; min-width: 0 }
.brand img { width: 42px; height: 42px; border-radius: 50%; flex: none }
.brand b { font-family: var(--f-display); font-weight: 400; font-size: 22px; letter-spacing: .02em; white-space: nowrap }
.brand small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .75 }
.bar-btn { background: transparent; border: 1px solid color-mix(in srgb, var(--brand-ink) 45%, transparent); color: var(--brand-ink); border-radius: 999px; padding: 7px 14px; cursor: pointer; text-decoration: none; font-size: 14px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center }
.bar-btn:hover { background: color-mix(in srgb, var(--brand-ink) 12%, transparent) }
.bar-btn .count { background: var(--brand-ink); color: var(--brand); border-radius: 999px; min-width: 20px; padding: 0 6px; font-size: 12px; font-weight: 700; text-align: center }

/* hero */
.hero { background: var(--brand); color: var(--brand-ink); padding-block: 28px 30px; border-bottom: 3px double color-mix(in srgb, var(--brand-ink) 40%, transparent) }
.hero .wrap { display: grid; gap: 6px }
.hero h1 { font-family: "Homemade Apple", var(--f-script); font-weight: 400; font-size: min(61px, calc((100vw - 48px) / 17.8)); line-height: 1.6; white-space: nowrap; text-wrap: nowrap }
.hero p { margin: 4px 0 0; max-width: 56ch; opacity: .85 }
.subnav { border-top: 1px solid color-mix(in srgb, var(--brand-ink) 18%, transparent) }
.subnav .wrap { display: flex; gap: 4px; overflow-x: auto }
.subnav a { padding: 9px 12px; text-decoration: none; font-size: 15px; white-space: nowrap; border-bottom: 2px solid transparent; opacity: .8 }
.subnav a:hover { opacity: 1 }
.subnav a[aria-current="page"] { border-color: var(--brand-ink); opacity: 1; font-weight: 700 }
.band { padding-block: 32px 8px }
.band .wrap { display: grid; gap: 16px; justify-items: start }
.band .wrap > * { justify-self: stretch; min-width: 0 }
.band .wrap > .btn { justify-self: start }
.band-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.band-head h2 { font-size: clamp(26px, 4vw, 36px) }
.arrow { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 300px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 8px; scrollbar-width: thin; overscroll-behavior-x: contain }
.rail > * { scroll-snap-align: start }
.rail:empty { display: none }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; padding-bottom: 40px }
.cat-card { position: relative; display: block; aspect-ratio: 4/3; max-width: 100%; border-radius: var(--r); overflow: hidden; border: 0; padding: 0; cursor: pointer; background: var(--brand); color: var(--brand-ink); text-align: left }
.cat-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease }
.cat-card:hover img { transform: scale(1.04) }
.cat-card .noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; opacity: .25 }
.cat-card .label { position: absolute; inset: auto 0 0 0; padding: 40px 14px 12px; background: linear-gradient(transparent, rgb(25 20 12 / .78)); color: #F1E9D8; display: grid; gap: 2px }
.cat-card .label b { font-family: var(--f-display); font-weight: 400; font-size: 24px; line-height: 1.1 }
.cat-card .label span { font-size: 13px; opacity: .85 }

/* categories */
.cats { scroll-margin-top: 70px; display: flex; gap: 8px; overflow-x: auto; padding-block: 18px 6px; scrollbar-width: thin }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 16px; cursor: pointer; font-size: 15px }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink) }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-block: 10px 18px }
.search { flex: 1 1 220px; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 9px 12px }
.muted { color: var(--ink-soft) }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 18px; padding-bottom: 48px }
.card { display: grid; grid-template-rows: auto 1fr; gap: 10px; cursor: pointer; text-align: left; background: none; border: 0; padding: 0 }
.ph { aspect-ratio: 4/5; max-width: 100%; width: 100%; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; position: relative; display: grid; place-items: center }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease }
.card:hover .ph img { transform: scale(1.03) }
.ph .noimg { font-family: var(--f-display); font-size: 48px; color: var(--line) }
.tag { position: absolute; left: 8px; top: 8px; background: var(--surface); color: var(--ink); border-radius: 999px; font-size: 12px; padding: 3px 10px; font-weight: 700 }
.tag.out { background: var(--ink); color: var(--bg) }
.tag.low { color: var(--warn) }
.card-meta { display: grid; gap: 2px }
.card-meta h3 { font-size: 20px }
.price { font-weight: 700; font-variant-numeric: tabular-nums }

.empty { border: 1px dashed var(--line); border-radius: var(--r); padding: 40px 20px; text-align: center; display: grid; gap: 8px; justify-items: center; margin-bottom: 48px }
.empty h2 { font-size: 26px }

/* dialog */
dialog { border: 0; padding: 0; background: var(--bg); color: var(--ink); border-radius: 10px; width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
dialog::backdrop { background: rgb(20 16 10 / .6) }
.dlg { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; padding: 20px }
.dlg > * { min-width: 0 }
.x { position: absolute; right: 10px; top: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; line-height: 1 }
.gallery { display: grid; gap: 8px }
.gallery .main { aspect-ratio: 4/5; max-width: 100%; border-radius: var(--r); overflow: hidden; background: var(--surface) }
.gallery .main img { width: 100%; height: 100%; object-fit: cover }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap }
.thumbs button { width: 58px; height: 58px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; cursor: pointer; background: var(--surface) }
.thumbs button[aria-current="true"] { border-color: var(--accent) }
.thumbs img { width: 100%; height: 100%; object-fit: cover }
.detail { display: grid; gap: 14px; align-content: start; padding-top: 8px }
.detail h2 { font-size: 34px }
.detail .price { font-size: 24px }
.feats { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px }
.feats li { display: grid; grid-template-columns: 18px 1fr; gap: 6px }
.feats li::before { content: "★"; color: var(--accent); font-size: 13px; line-height: 1.9 }
.desc { white-space: pre-line; margin: 0 }
.stockline { font-size: 14px; font-weight: 700 }
/* Talles y medidas en el detalle del producto */
.card-sizes { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.measure { display: grid; gap: 10px; padding: 14px 0 4px; border-top: 1px solid var(--line) }
.measure-h { font-size: 12px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft) }
.select-wrap { position: relative }
.select-wrap::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none }
.size-select { appearance: none; -webkit-appearance: none; width: 100%; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--ink); border-radius: 10px; padding: 12px 44px 12px 14px; cursor: pointer }
.size-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.specs { margin: 0; display: grid }
.specs > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px }
.specs > div:last-child { border-bottom: 0 }
.specs dt { color: var(--ink-soft) }
.specs dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums }
.size-note { font-size: 14px; color: var(--ink-soft); margin: 0 }
#pdSizeInfo:empty { display: none }
.size-guide summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; width: max-content }
.size-guide table { width: 100%; min-width: 0; border-collapse: collapse; margin-top: 8px; font-size: 14px }
.size-guide th, .size-guide td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top }
.size-guide th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); font-weight: 400 }
.size-guide td:first-child { font-weight: 700; white-space: nowrap }
.measure + .btn.wa { margin-top: 6px }
/* Gestión: cómo se mide la pieza */
.seg { display: flex; flex-wrap: wrap; gap: 6px }
.field .seg label { position: relative; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; font-weight: 500; background: var(--bg) }
.seg input { position: absolute; opacity: 0; pointer-events: none }
.field .seg label:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink) }
.field .seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px }
.med-box { display: grid; gap: 8px; margin-top: 4px }
.sizes-ed { display: grid; gap: 8px }
.size-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center }
.size-row.meas { grid-template-columns: 150px 1fr 40px }
.size-row .sz-del { height: 40px; border: 1px solid var(--line); background: transparent; border-radius: 10px; cursor: pointer; color: var(--ink-soft) }
.size-row .sz-del:hover { color: var(--bad); border-color: var(--bad) }
.sizes-acts { display: flex; gap: 8px; flex-wrap: wrap }
.stockline.ok { color: var(--ok) } .stockline.low { color: var(--warn) } .stockline.out { color: var(--bad) }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 11px 20px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; text-decoration: none; font-weight: 700; font-size: 15px }
.btn.ghost { background: transparent; color: var(--ink) }
.btn.small { padding: 6px 12px; font-size: 13px; font-weight: 500 }
.btn.danger { border-color: var(--bad); background: transparent; color: var(--bad) }
.btn.wa { background: #1F7A4D; border-color: #1F7A4D; color: #fff; padding: 13px 22px; font-size: 16px }
.btn.wa:hover { background: #18653F; border-color: #18653F }
.btn.wa svg { width: 20px; height: 20px; flex: none }
.wa-note { font-size: 13px; margin: -4px 0 0 }
.btn:disabled { opacity: .45; cursor: not-allowed }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }


footer { border-top: 1px solid var(--line); padding-block: 24px; font-size: 14px }
footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between }
/* Medios de pago, al pie de la tienda */
footer .wrap.pay { justify-content: flex-start; align-items: center; gap: 10px 14px; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line) }
.pay-h { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft) }
.pay-list { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0; padding: 0; list-style: none }
.pay-badge { display: inline-flex; align-items: center; gap: 10px; height: 44px }
/* Los logos se pintan con el color de la tienda: el archivo da solo la forma */
.pay-logo { display: block; background: var(--ink); -webkit-mask: var(--logo) no-repeat center / contain; mask: var(--logo) no-repeat center / contain }
.pay-logo.mp { --logo: url(fotos/pagos/mercado-pago.png); width: 114px; height: 30px }
.pay-logo.nx { --logo: url(fotos/pagos/naranja-x.png); width: 85px; height: 20px }
.pay-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: var(--accent); color: var(--surface) }

/* tienda: ordenar */
.sort { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; font-size: 14px }
.sort select { flex: 0 0 auto; width: auto; padding-right: 8px }
#categorias { scroll-margin-top: 120px }

/* Gestión: barra propia */
.bar-acts { display: flex; gap: 8px; align-items: center }
.checking { padding-block: 48px; text-align: center }

/* admin */
.admin-head { padding-block: 24px 6px; display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between }
.admin-head h1 { font-size: 34px }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; color: var(--ink-soft) }
.tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--ink); font-weight: 700 }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px }
.kpi b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 28px; font-variant-numeric: tabular-nums }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 40px }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 15px }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle }
th { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500 }
tr:last-child td { border-bottom: 0 }
td.n { text-align: right; font-variant-numeric: tabular-nums }
.mini { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; background: var(--bg); display: block }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; border: 1px solid currentColor }
.pill.ok { color: var(--ok) } .pill.low { color: var(--warn) } .pill.out { color: var(--bad) } .pill.off { color: var(--ink-soft) }
.stepper { display: inline-flex; align-items: center; gap: 4px }
.stepper button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); cursor: pointer }
.stepper b { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums }

form.pf { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-bottom: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px }
form.pf > * { min-width: 0 }
.field { display: grid; gap: 5px }
.field.full { grid-column: 1 / -1 }
.field label { font-size: 13px; font-weight: 700 }
.field .hint { font-size: 12px; color: var(--ink-soft) }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--bg); border-radius: var(--r); padding: 9px 11px; width: 100% }
.field textarea { min-height: 96px; resize: vertical }
.photos { display: flex; gap: 8px; flex-wrap: wrap }
.photo { position: relative; width: 92px; height: 92px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line) }
.photo img { width: 100%; height: 100%; object-fit: cover }
.photo .acts { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; background: rgb(0 0 0 / .55) }
.photo .acts button { border: 0; background: none; color: #fff; cursor: pointer; padding: 2px 6px; font-size: 13px }
.photo .first { position: absolute; left: 4px; top: 4px; background: var(--accent); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 999px }
.drop { width: 92px; height: 92px; border: 1px dashed var(--ink-soft); border-radius: 4px; display: grid; place-items: center; text-align: center; font-size: 12px; cursor: pointer; color: var(--ink-soft) }
.cat-list { display: grid; gap: 8px; margin-bottom: 40px; max-width: 640px }
.cat-row { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; flex-wrap: wrap }
.cat-row input { flex: 1 1 160px; min-width: 0; border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 4px }
.cat-row input:hover, .cat-row input:focus { border-color: var(--line); background: var(--bg) }
.confirm { display: inline-flex; gap: 6px; align-items: center; font-size: 13px }

/* planilla: vista tipo Excel del inventario. Con la planilla abierta, Gestión usa más ancho de pantalla. */
.gestion .bar .wrap, .gestion footer .wrap, .gestion #admin > .wrap { max-width: 1400px }
.sheet-sum { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) }
.kpi-sub { display: block; font-size: 13px; color: var(--ink-soft) }
.sheet-tools { padding-top: 0 }
.sheet-tools .search { flex: 0 1 210px }
.sheet-tools #sQ { flex: 1 1 200px }
.sheet-group { gap: 8px; font-size: 14px; cursor: pointer; white-space: nowrap }
.sheet-group input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent) }
.sheet-help { font-size: 13px; margin: -8px 0 12px }
.sheet-miss { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--warn); margin: -6px 0 14px }
.sheet-wrap { overflow: auto; max-height: min(72vh, 760px); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 40px; overscroll-behavior: contain }
table.sheet { min-width: 1000px; font-size: 14px; border-collapse: separate; border-spacing: 0 }
.sheet th, .sheet td { padding: 0; height: 38px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; vertical-align: middle }
.sheet tr > :last-child { border-right: 0 }
.sheet thead th { position: sticky; top: 0; z-index: 3; background: var(--bg) }
.sheet thead th button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 5px; width: 100%; height: 38px; padding: 0 10px; cursor: pointer; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700 }
.sheet thead th.r button { justify-content: flex-end }
.sheet thead th button:hover { color: var(--ink) }
.sheet thead th button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px }
.sheet th[aria-sort="ascending"] button::after { content: "▲"; font-size: 9px; color: var(--accent) }
.sheet th[aria-sort="descending"] button::after { content: "▼"; font-size: 9px; color: var(--accent) }
.sheet thead th.own button { color: var(--accent) }
.sheet .c-n { position: sticky; left: 0; z-index: 1; width: 40px; min-width: 40px; text-align: center; background: var(--bg); color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums }
.sheet .c-name { position: sticky; left: 40px; z-index: 1; min-width: 210px; background: var(--surface) }
.sheet thead .c-n, .sheet thead .c-name { z-index: 4; background: var(--bg) }
.sheet td.r, .sheet th.r { text-align: right }
.sheet td.ro { padding: 0 10px; background: color-mix(in srgb, var(--line) 26%, var(--surface)); font-variant-numeric: tabular-nums }
.sheet td.st { padding: 0 10px }
.sheet .neg { color: var(--bad); font-weight: 700 }
.cell { display: block; width: 100%; height: 37px; border: 0; border-radius: 0; background: transparent; padding: 0 10px; font-variant-numeric: tabular-nums; text-overflow: ellipsis }
.cell:hover { background: color-mix(in srgb, var(--bg) 70%, transparent) }
.cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--bg) }
.cell::placeholder { color: var(--ink-soft) }
select.cell { cursor: pointer; min-width: 130px }
input.cell.n { text-align: right; min-width: 70px }
.cur { display: flex; align-items: center; height: 37px; cursor: text }
.cur > span { padding-left: 10px; color: var(--ink-soft) }
.cur .cell { padding-left: 4px; text-align: right; min-width: 92px }
.sheet tr.dim .cell, .sheet tr.dim td.ro { color: var(--ink-soft) }
.sheet tr.grp td { height: 34px; padding: 0 10px; background: var(--bg); font-weight: 700; font-variant-numeric: tabular-nums }
.sheet tr.grp td.c-n { padding: 0 }
.sheet tfoot td { position: sticky; bottom: 0; z-index: 2; height: 40px; padding: 0 10px; background: var(--brand); color: var(--brand-ink); border: 0; font-weight: 700; font-variant-numeric: tabular-nums }
.sheet tfoot .c-n, .sheet tfoot .c-name { z-index: 4; background: var(--brand); color: var(--brand-ink) }
.sheet tfoot .neg { color: inherit }
.sheet-empty { text-align: center; padding: 28px !important; white-space: normal !important }
.flash { animation: flash 1.6s ease-out }
@keyframes flash { from { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--ok) 30%, transparent) } to { box-shadow: inset 0 0 0 999px transparent } }
dialog.why { width: min(440px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line) }
.why-in { padding: 20px; display: grid; gap: 14px }
dialog.why h2 { font-size: 24px }
dialog.why p { margin: 0 }
.why-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.why-opt { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); cursor: pointer }
.why-opt b { font-size: 17px }
.why-opt span { font-size: 13px; color: var(--ink-soft) }
.why-opt:hover, .why-opt:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -2px }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; z-index: 50; font-size: 14px; max-width: calc(100vw - 32px) }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 18px; font-size: 14px }

@media (max-width: 720px) {
  .dlg { grid-template-columns: 1fr; padding: 14px }
  .btn.wa { width: 100% }
  form.pf { grid-template-columns: 1fr }
  .size-row { grid-template-columns: 74px 1fr 40px }
  .size-row.meas { grid-template-columns: 112px 1fr 40px }
  .brand small { display: none }
  .brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis }
  .brand b { font-size: 19px }
}
@media (max-width: 560px) {
  .sheet .c-name { min-width: 150px }
  .sheet-sum { grid-template-columns: 1fr 1fr; gap: 10px }
  .sheet-sum .kpi { padding: 10px 12px }
  .sheet-sum .kpi b { font-size: 22px }
  .why-opts { grid-template-columns: 1fr }
}
@media (max-width: 480px) {
  .gestion .brand b { font-size: 17px }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px }
  .card-meta h3 { font-size: 17px }
}
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
  .cat-card { aspect-ratio: 1 }
  .cat-card .label b { font-size: 19px }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }
