/* Back office · tema claro al estilo de los admin de comercio (ver DESIGN.md). Sin dependencias. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  /* Superficies */
  --bg: #f1f1f1;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --surface-hover: #f7f7f7;
  --surface-pressed: #ebebeb;
  --border: #e3e3e3;
  --border-strong: #cccccc;
  --border-input: #8a8a8a;
  /* Texto */
  --text: #303030;
  --text-2: #616161;
  --text-3: #8a8a8a;      /* solo iconos y decoración (3,4:1) */
  --text-placeholder: #6e6e6e;
  --link: #005bd3;
  --link-hover: #004299;
  /* Marco */
  --topbar: #1a1a1a;
  --nav: #ebebeb;
  --nav-hover: #f1f1f1;
  --nav-active: #fafafa;
  /* Estados (solo donde significan algo) */
  --ok: #0c5132;      --ok-bg: #cdfee1;
  --info: #00527c;    --info-bg: #e0f0ff;
  --warn: #5e4200;    --warn-bg: #ffeb78;
  --danger: #8e0b21;  --danger-bg: #fedad9;  --danger-solid: #c70a24;  --danger-tint: #fff1f0;
  --warn-tint: #fff8db; --warn-ink: #4f4700;  --warn-line: #ffe58a;
  --nav-icon: #4a4a4a;
  --focus: #005bd3;
  --focus-on-dark: #4b9bff;
  /* Forma */
  --radius: 12px;
  --radius-sm: 8px;
  --card-shadow: 0 0 0 1px rgba(26, 26, 26, .06), 0 1px 2px rgba(26, 26, 26, .08);
  --pop-shadow: 0 0 0 1px rgba(26, 26, 26, .08), 0 8px 24px -4px rgba(26, 26, 26, .2);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --topbar-h: 56px;
  --nav-w: 240px;
  --scroll-fade: 32px;    /* ancho del degradado en el borde de las pestañas que se desplazan */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 13px/20px var(--font);
  font-feature-settings: "cv11", "ss01";
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
::selection { background: #cce0fb; color: var(--text); }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 4px; }
.topbar :focus-visible { outline-color: var(--focus-on-dark); }
h1, h2, h3 { margin: 0 0 8px; color: var(--text); }
h1 { font-size: 20px; line-height: 24px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 14px; line-height: 20px; font-weight: 650; }
h3 { font-size: 13px; line-height: 20px; font-weight: 650; }
p { margin: 0 0 12px; }
.icon { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--text-2); }
.small { font-size: 12px; line-height: 16px; }
.mono, code { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--pop-shadow); }
.skip-link:focus { left: 8px; }
.num, .table td.num { font-variant-numeric: tabular-nums; }

/* Marco: barra superior, menú lateral, contenido ---------------------------------------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 12px 0 8px; background: var(--topbar); color: #e3e3e3;
}
.topbar .brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 650; font-size: 15px; padding: 0 8px; }
.topbar .brand:hover { text-decoration: none; color: #fff; }
.topbar .brand .mark { width: 24px; height: 24px; border-radius: 6px; background: #fff; color: var(--topbar); display: grid; place-items: center; font-size: 13px; font-weight: 750; }
.topbar .global-search { flex: 0 1 560px; margin: 0 auto; position: relative; display: none; }
.topbar .global-search .icon { position: absolute; left: 10px; top: 8px; color: #b5b5b5; }
.topbar .global-search input {
  width: 100%; height: 36px; min-height: 0; padding: 0 12px 0 34px; border-radius: var(--radius-sm);
  background: #303030; border: 1px solid #4a4a4a; color: #fff; font-size: 13px;
}
.topbar .global-search input::placeholder { color: #b5b5b5; }
.topbar .global-search input:focus { outline: 2px solid var(--focus-on-dark); outline-offset: 0; border-color: transparent; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: inherit; cursor: pointer;
}
.topbar .icon-btn:hover { background: #303030; }

/* Menú de cuenta (details/summary, sin JS) */
.account { position: relative; margin-left: auto; }
.account > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px; border-radius: var(--radius-sm); color: #e3e3e3; font-weight: 550; font-size: 13px;
}
.account > summary::-webkit-details-marker { display: none; }
.account > summary:hover, .account[open] > summary { background: #303030; }
.avatar { width: 28px; height: 28px; border-radius: 8px; background: #e3e3e3; color: var(--topbar); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.account .account-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .menu {
  position: absolute; right: 0; top: calc(100% + 6px); width: 260px; padding: 6px;
  background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--pop-shadow);
}
.account .menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.account .menu .who strong { display: block; font-weight: 650; }
.account .menu a, .account .menu button {
  all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text); font-size: 13px;
}
.account .menu a:hover, .account .menu button:hover { background: var(--surface-hover); text-decoration: none; }
.account .menu a:focus-visible, .account .menu button:focus-visible { outline: 2px solid var(--focus); }
.account .menu form { margin: 0; }
.account .menu .icon { color: var(--text-2); }

.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 30;
  width: var(--nav-w); padding: 12px 8px 16px; background: var(--nav);
  overflow-y: auto; display: flex; flex-direction: column;
  transform: translateX(-100%); visibility: hidden; transition: transform .2s cubic-bezier(.2, .8, .2, 1), visibility 0s .2s;
}
.sidebar.open { transform: none; visibility: visible; box-shadow: var(--pop-shadow); transition: transform .2s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.backdrop { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 25; background: rgba(0, 0, 0, .35); display: none; }
.backdrop.open { display: block; }
.sidebar nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px;
  border-radius: var(--radius-sm); color: var(--text); font-weight: 550; font-size: 13px;
}
.sidebar nav a .icon { color: var(--nav-icon); }
.sidebar nav a:hover { background: var(--nav-hover); text-decoration: none; color: var(--text); }
.sidebar nav a.active { background: var(--nav-active); box-shadow: 0 1px 0 rgba(0, 0, 0, .06); font-weight: 650; }
.sidebar nav a.active .icon { color: var(--text); }
.sidebar nav a.sub { padding-left: 36px; font-weight: 450; color: var(--text-2); min-height: 28px; }
.sidebar nav a.sub.active { color: var(--text); font-weight: 600; background: transparent; box-shadow: none; }
.sidebar nav a.sub:hover { color: var(--text); }
.sidebar .nav-gap { flex: 1; min-height: 24px; }
.sidebar .nav-foot { padding-top: 8px; }

.main { padding: calc(var(--topbar-h) + 16px) 16px 64px; max-width: 1248px; margin: 0 auto; }
.main.narrow-page { max-width: 848px; }

@media (min-width: 720px) {
  .topbar .global-search { display: block; }
}
@media (min-width: 1040px) {
  .topbar [data-nav-open] { display: none; }
  .sidebar { transform: none; visibility: visible; }
  .backdrop { display: none !important; }
  .content { margin-left: var(--nav-w); }
  .main { padding: calc(var(--topbar-h) + 24px) 32px 64px; }
}
@media (max-width: 719px) {
  .account .account-name { display: none; }
}

/* Encabezado de página ------------------------------------------------------------------ */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; min-height: 32px; }
.page-head h1 { margin: 0; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head h1 .count { font-size: 13px; font-weight: 450; color: var(--text-2); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-head .back {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: var(--radius-sm); color: var(--text); margin-right: -2px;
}
.page-head .back:hover { background: var(--surface-pressed); text-decoration: none; }
.help { color: var(--text-2); margin: -8px 0 16px; max-width: 72ch; }

/* Tarjetas -------------------------------------------------------------------------------- */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--card-shadow);
  padding: 16px; margin-bottom: 16px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 12px 16px 0; margin-bottom: 8px; }
.card.narrow { max-width: 480px; }
@media (max-width: 719px) { .card { border-radius: 0; margin-left: -16px; margin-right: -16px; box-shadow: 0 0 0 1px rgba(26, 26, 26, .06); } .card.narrow { max-width: none; } }

.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.grid > div > .card:last-child { margin-bottom: 0; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.grid-main > * { min-width: 0; }
@media (min-width: 1040px) { .grid-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; } }

/* Resumen de métricas: una sola tarjeta dividida, no tarjetas sueltas */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden;
}
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { display: block; padding: 12px 16px; color: var(--text); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: -1px; }
.stat:last-child { border-right: 0; }
@media (max-width: 719px) {
  .stats { border-radius: 0; margin-left: -16px; margin-right: -16px; }
  .stat:nth-child(2n) { border-right: 0; }
}
a.stat:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.stat .label { font-size: 12px; color: var(--text-2); font-weight: 550; }
.stat .value { font-size: 20px; line-height: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat.alert .value { color: var(--danger-solid); }
.stat .sub { font-size: 12px; color: var(--text-2); }
@media (min-width: 720px) { .stats.sales { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 719px) { .stats.sales .stat:last-child { grid-column: span 2; } }

/* Botones --------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 32px; padding: 6px 12px; border: 0; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong), inset 0 -1px 0 #b5b5b5;
  font: inherit; font-weight: 550; font-size: 13px; line-height: 20px; cursor: pointer;
  text-decoration: none !important; white-space: nowrap; transition: background .1s;
}
.btn:hover { background: var(--surface-hover); color: var(--text); }
.btn:active { background: var(--surface-pressed); box-shadow: inset 0 1px 2px rgba(26, 26, 26, .2); }
.btn-primary { background: #303030; color: #fff; box-shadow: inset 0 -1px 0 #000, 0 0 0 1px #1a1a1a, inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-primary:hover { background: #1a1a1a; color: #fff; }
.btn-primary:active { background: #1a1a1a; box-shadow: inset 0 2px 2px rgba(0, 0, 0, .6); }
.btn-danger { color: var(--danger-solid); }
.btn-danger:hover { background: var(--danger-tint); color: var(--danger-solid); }
.btn-danger.solid { background: var(--danger-solid); color: #fff; box-shadow: inset 0 -1px 0 #8e0b21, 0 0 0 1px #8e0b21; }
.btn-danger.solid:hover { background: #a3091e; }
.btn-quiet-danger:hover { color: var(--danger-solid); background: var(--danger-tint); }
.btn-sm { min-height: 28px; padding: 4px 8px; font-size: 12px; }
.btn-icon { min-height: 28px; width: 28px; padding: 0; }
.btn-link { box-shadow: none; background: none; color: var(--link); padding: 0; min-height: 0; font-weight: 500; }
.btn-link:hover { background: none; color: var(--link-hover); text-decoration: underline !important; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.inline-form { display: inline; margin: 0; }
.row-actions .inline-form + .inline-form { margin-left: 6px; }

/* Formularios ------------------------------------------------------------------------------ */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 450; margin-bottom: 4px; color: var(--text); }
.field label .muted { font-size: 12px; }
.field .hint { font-size: 12px; line-height: 16px; color: var(--text-2); margin-top: 4px; }
.field .hint ul { margin: 4px 0 0; padding-left: 18px; }
.field .errors { color: var(--danger-solid); font-size: 12px; line-height: 16px; margin-top: 4px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger-solid); background: var(--danger-tint); }
.field.checkbox { display: flex; align-items: flex-start; gap: 8px; }
.field.checkbox label { margin: 0; }
.field.checkbox input { margin-top: 1px; }
.field .checklist { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; }
.field .checklist label { display: inline-flex; gap: 8px; align-items: center; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=search], input[type=url], input:not([type]), select, textarea {
  width: 100%; min-height: 32px; padding: 5px 10px;
  border: 1px solid var(--border-input); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
}
input::placeholder, textarea::placeholder { color: var(--text-placeholder); }
select { appearance: none; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23616161' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m7 15 5 5 5-5M7 9l5-5 5 5'/%3E%3C/svg%3E") no-repeat right 8px center; }
textarea { min-height: 80px; resize: vertical; line-height: 20px; }
textarea.mono { font-family: var(--mono); font-size: 12px; }
input:hover, select:hover, textarea:hover { border-color: #616161; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--border-input); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: #303030; margin: 0; }
input[type=file] { font: inherit; font-size: 13px; max-width: 100%; }
@media (max-width: 719px) {
  /* 16px evita el zoom automático de iOS al enfocar */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
  input[type=search], input[type=url], input:not([type]), select, textarea { font-size: 16px; min-height: 40px; }
}
.form-grid { display: grid; gap: 0 16px; }
.form-grid > * { min-width: 0; }
.field a { overflow-wrap: anywhere; }
@media (min-width: 720px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: 1 / -1; }
}
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-top: 4px; }
.form-actions .spacer { display: none; }
.form-actions .btn-primary { order: 3; }
.form-actions .btn-danger, .form-actions > .muted { order: -1; margin-right: auto; }
.card.flush > .form-actions { padding: 12px 16px; margin: 0; border-top: 1px solid var(--border); }
.non-field-errors { background: var(--danger-bg); color: var(--danger); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 16px; }
.input-sm { min-height: 28px !important; padding: 3px 8px !important; font-size: 13px !important; }
@media (max-width: 719px) { .input-sm { min-height: 36px !important; font-size: 16px !important; } }

/* Barra de filtros (dentro o fuera de la tarjeta) */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.card .toolbar { margin: 0; padding: 8px; border-bottom: 1px solid var(--border); }
.toolbar .search { flex: 1 1 220px; position: relative; }
.toolbar .search .icon { position: absolute; left: 9px; top: 8px; color: var(--text-2); }
.toolbar .search input { padding-left: 32px; }
.toolbar select { width: auto; flex: 0 1 auto; }
.toolbar input[type=date] { width: auto; flex: 0 1 150px; }
.toolbar .date-filter { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; color: var(--text-2); font-size: .875rem; }
.toolbar .date-filter input[type=date] { flex: 0 1 150px; }
.toolbar input.price-filter { width: auto; flex: 0 1 120px; }
@media (max-width: 719px) { .toolbar .search .icon { top: 11px; } }
/* «Más filtros»: los filtros secundarios van plegados; abierto ocupa su propia fila */
.toolbar details.more-filters { flex: 0 0 auto; }
.toolbar details.more-filters[open] { flex-basis: 100%; }
.toolbar details.more-filters > summary { list-style: none; }
.toolbar details.more-filters > summary::-webkit-details-marker { display: none; }
.toolbar details.more-filters[open] > summary { box-shadow: inset 0 1px 2px rgba(26, 26, 26, .2); }
.toolbar .more-filters-body { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* Pestañas de vista (Todos / Activos / ...) dentro de una tarjeta */
.view-tabs { display: flex; gap: 4px; padding: 8px 8px 0; overflow-x: auto; scrollbar-width: none; }
.view-tabs::-webkit-scrollbar { display: none; }
.view-tabs a { padding: 6px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 550; white-space: nowrap; }
.view-tabs a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.view-tabs a.active { background: var(--surface-pressed); color: var(--text); }
.view-tabs + .toolbar { border-top: 0; }

/* Tablas ------------------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table th { font-size: 12px; font-weight: 550; color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; }
.table td.primary a { color: var(--text); font-weight: 600; }
.table td.primary a:hover { text-decoration: underline; }
.table .row-error td { background: var(--danger-tint); }
.table .cell-error { color: var(--danger-solid); font-size: 12px; }
.table .sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.table tbody tr:hover .sticky-col { background: var(--surface-hover); }
.table th.sticky-col { background: var(--surface-2); }
.stock-zero { color: var(--danger-solid); font-weight: 550; }
.table td > a:not(.btn):not(.product-cell) { color: var(--text); font-weight: 600; }
.table td > a:not(.btn):not(.product-cell):hover { text-decoration: underline; }
.table td input[type=text], .table td input[type=number], .table td input:not([type]) { max-width: 160px; }
.table td input[name$="-sku"], .table td input[name$="-barcode"] { max-width: none; }
.table td.num input, .table td input.num { margin-left: auto; display: block; text-align: right; font-variant-numeric: tabular-nums; }

/* En celular cada fila de un listado es un bloque */
@media (max-width: 719px) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
  .table.stack tbody tr:last-child { border-bottom: 0; }
  .table.stack td { border: 0; padding: 0 !important; text-align: left !important; width: auto; }
  .table.stack td[data-label]::before { content: attr(data-label) " · "; color: var(--text-2); }
  .table.stack td.primary { width: 100%; padding-bottom: 4px !important; }
  .table.stack td[data-label=Estado]::before { content: none; }
  /* Lista de pedidos (#30, M13): «#1008 · Cliente» con el total a la derecha; debajo, insignias y fecha */
  .table.stack.orders-list tr { gap: 4px 6px; }
  .table.stack.orders-list td::before { content: none; }
  .orders-list tr::after { content: ""; order: 4; flex-basis: 100%; height: 0; }
  .table.stack.orders-list td.primary { width: auto; order: 1; padding-bottom: 0 !important; }
  .table.stack.orders-list td.col-customer { order: 2; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table.stack.orders-list td.col-customer::before { content: "· "; color: var(--text-2); }
  .table.stack.orders-list td.col-total { order: 3; width: auto; margin-left: auto; text-align: right !important; font-variant-numeric: tabular-nums; }
  .table.stack.orders-list td.col-status { order: 5; }
  .table.stack.orders-list td.col-date { order: 6; color: var(--text-2); font-size: 12px; }
  .table.stack.orders-list td.col-items { display: none; }
  .table.stack.edit td { width: 100%; }
  .table.stack.edit td[data-label] { display: grid; grid-template-columns: 40% 1fr; align-items: center; gap: 8px; }
  .table.stack.edit td[data-label]::before { content: attr(data-label); }
  .table.stack.edit td input { max-width: none; text-align: left; margin: 0; }
  .table.stack.edit .sticky-col { position: static; background: transparent; }
}

.empty { text-align: center; padding: 40px 16px; color: var(--text-2); }
.empty .icon { width: 40px; height: 40px; margin-bottom: 8px; color: var(--text-3); }
.empty strong { display: block; color: var(--text); font-size: 14px; font-weight: 650; margin-bottom: 4px; }

/* Insignias y avisos ------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 12px; line-height: 16px; font-weight: 550; white-space: nowrap; background: var(--surface-pressed); color: var(--text);
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-info, .badge-accent { background: var(--info-bg); color: var(--info); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--surface-pressed); color: var(--text-2); }
.code-tag { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 8px; display: flex; gap: 8px; align-items: flex-start; background: var(--surface-pressed); }
.messages li .icon { margin-top: 1px; }
.messages .success { background: var(--ok-bg); color: var(--ok); }
.messages .error { background: var(--danger-bg); color: var(--danger); }
.messages .warning { background: var(--warn-tint); color: var(--warn-ink); }
.messages .info { background: var(--info-bg); color: var(--info); }
.callout { padding: 12px 16px; border-radius: var(--radius); background: var(--info-bg); color: #00324d; margin-bottom: 16px; }
.callout.warn { background: var(--warn-tint); color: var(--warn-ink); box-shadow: inset 0 0 0 1px var(--warn-line); }
.callout.danger { background: var(--danger-bg); color: var(--danger); }
.secret { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret code { flex: 1 1 260px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); word-break: break-all; color: var(--text); }

/* Pestañas de una página (producto) ------------------------------------------------------------ */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: -4px 0 16px; padding-bottom: 1px; border-bottom: 1px solid var(--border-strong); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 12px; color: var(--text-2); font-weight: 550; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a:hover { color: var(--text); text-decoration: none; border-bottom-color: var(--border-strong); }
.tabs a.active { color: var(--text); border-bottom-color: #303030; }
.tabs .count { font-weight: 450; color: var(--text-2); font-size: 12px; }

/* Degradado en el borde con más pestañas: lo ponen app.js (solo si hay desborde) y su clase por lado. */
.is-overflowing {
  -webkit-mask-image: linear-gradient(to right, transparent, black var(--fade-start, 0px), black calc(100% - var(--fade-end, 0px)), transparent);
  mask-image: linear-gradient(to right, transparent, black var(--fade-start, 0px), black calc(100% - var(--fade-end, 0px)), transparent);
}
.is-overflowing.fade-start { --fade-start: var(--scroll-fade); }
.is-overflowing.fade-end { --fade-end: var(--scroll-fade); }

/* Miniaturas e imágenes ------------------------------------------------------------------------ */
.thumb {
  width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); flex-shrink: 0;
}
img.thumb { border: 1px solid var(--border); box-shadow: none; }
.product-cell { display: flex; align-items: center; gap: 12px; color: var(--text); }
.product-cell:hover { text-decoration: none; }
.product-cell:hover .name { text-decoration: underline; }
.product-cell .name { font-weight: 600; color: var(--text); }
.product-cell .code { font-size: 12px; color: var(--text-2); }

.image-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.image-card { border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; box-shadow: inset 0 0 0 1px var(--border); }
.image-card .pic { aspect-ratio: 1; background: var(--surface-2); position: relative; border-bottom: 1px solid var(--border); }
.image-card .pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.image-card .pic .badge { position: absolute; top: 8px; left: 8px; background: var(--surface); box-shadow: var(--card-shadow); }
.image-card .body { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.image-card .tools { display: flex; gap: 4px; justify-content: space-between; }
.image-card .variant-checks { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.image-card .variant-checks label { display: flex; gap: 6px; align-items: center; }
.image-help { margin: 0 0 12px; max-width: 70ch; }
.image-card .pic a { display: block; height: 100%; touch-action: none; user-select: none; -webkit-touch-callout: none; cursor: grab; }  /* touch-action: el dedo arrastra en vez de hacer scroll */
.image-card.dragging { opacity: .6; box-shadow: 0 0 0 2px var(--focus); }
.image-card.dragging .pic a { cursor: grabbing; }
.image-card .pic .pos { position: absolute; bottom: 8px; left: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--topbar); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.image-card .pic .badge[hidden] { display: none; }
.image-card .meta { margin-bottom: -2px; }
.alt-field label { display: block; font-size: 12px; font-weight: 550; margin-bottom: 4px; }
.alt-field .input-sm { width: 100%; }
.alt-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; min-height: 20px; }
.alt-foot .count { margin-left: auto; }
.alt-foot .badge[hidden] { display: none; }
.variant-assign { border-top: 1px solid var(--border); padding-top: 8px; font-size: 12px; }
.variant-assign summary { cursor: pointer; font-weight: 550; color: var(--text); }
.variant-assign .assign-body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.variant-assign .assign-body p { margin: 0; }
.variant-assign .value-row { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.variant-assign .chip-check { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 12px; background: var(--surface-pressed); }
.variant-assign .chip-check[hidden] { display: none; }
.variant-assign .variant-checks { max-height: 160px; overflow-y: auto; }
dialog.lightbox { border: 0; padding: 12px; border-radius: var(--radius); box-shadow: var(--pop-shadow); max-width: min(92vw, 1000px); background: var(--surface); }
dialog.lightbox::backdrop { background: rgba(26, 26, 26, .6); }
dialog.lightbox img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto 8px; }
dialog.lightbox form { text-align: right; }
.media-grid { display: grid; gap: 8px; grid-template-columns: repeat(4, 1fr); }
.media-tile { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-2); font-weight: 600; }
.media-tile.main { grid-column: span 2; grid-row: span 2; }
.media-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.media-tile .badge { position: absolute; top: 8px; left: 8px; background: var(--surface); box-shadow: var(--card-shadow); }
.media-tile:hover { text-decoration: none; }
.dropzone.media-add { aspect-ratio: 1; padding: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; }
.media-note { margin: 12px 0 0; }
@media (max-width: 719px) {
  .image-grid { grid-template-columns: 1fr; }
  .image-card { flex-direction: row; }
  .image-card .pic { width: 110px; flex: none; aspect-ratio: auto; min-height: 110px; border-bottom: 0; border-right: 1px solid var(--border); }
  .image-card .body { min-width: 0; }
  .media-grid { grid-template-columns: repeat(3, 1fr); }
}
.dropzone {
  border: 1px dashed var(--border-input); border-radius: var(--radius); padding: 24px 16px; text-align: center;
  color: var(--text-2); cursor: pointer; transition: background .15s, border-color .15s; display: block; background: var(--surface);
}
.dropzone.drag, .dropzone:hover { border-color: var(--focus); background: #f4f8ff; }
.dropzone { position: relative; }
.dropzone input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.dropzone strong { color: var(--text); font-weight: 600; }
.dropzone .btn { margin-bottom: 6px; pointer-events: none; }

/* Opciones de variante ------------------------------------------------------------------------- */
.option-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.option-row:first-of-type { padding-top: 0; }
.option-row:last-child { border-bottom: 0; }
.option-row .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 8px; border-radius: var(--radius-sm); background: var(--surface-pressed); font-size: 12px; font-weight: 550; }
.chip button { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; position: relative; min-width: 24px; min-height: 24px; padding: 5px; border-radius: 4px; color: var(--text-2); }
/* Área de toque de 32 px en pantallas táctiles, sin agrandar el chip. */
@media (pointer: coarse), (max-width: 719px) { .chip button::after { content: ""; position: absolute; inset: -4px; } }
.chip button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.chip button:hover { color: var(--danger-solid); background: var(--danger-bg); }
.chip-color { width: 12px; height: 12px; margin-right: 4px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); box-sizing: border-box; }
.value-colors { margin-top: 8px; font-size: 13px; }
.value-colors summary { cursor: pointer; color: var(--text-2); }
.color-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0; }
.color-row input { width: 110px; }
.add-values { display: flex; gap: 6px; margin-top: 8px; }
.add-values input { flex: 1; }
.add-values-help { margin: 4px 0 0; }

/* Guía de primeros pasos (inicio) ----------------------------------------------------------------- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px dashed var(--border-input); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checklist .done .dot { background: #303030; border: 0; color: #fff; }
.checklist .done a { color: var(--text-2); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-pressed); overflow: hidden; margin: 6px 0 8px; }
.progress span { display: block; height: 100%; background: #303030; border-radius: 3px; }

/* Paginación ------------------------------------------------------------------------------------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; color: var(--text-2); flex-wrap: wrap; border-top: 1px solid var(--border); background: var(--surface-2); }
.pagination .pages { display: flex; gap: 6px; }

/* Entrar y elegir tienda ---------------------------------------------------------------------------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .form-grid, .narrow .form-grid { grid-template-columns: 1fr; }
.auth-card .brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.auth-card .brand .mark { width: 28px; height: 28px; border-radius: 7px; background: #1a1a1a; color: #fff; display: grid; place-items: center; font-size: 14px; }
.auth-card .sub { text-align: center; color: var(--text-2); margin-bottom: 20px; }
.auth-card .card { padding: 20px; }
@media (max-width: 719px) { .auth-card .card { margin: 0; border-radius: var(--radius); } }
.auth-card .btn-primary { min-height: 36px; }
.tenant-pick { display: flex; flex-direction: column; gap: 8px; }
.tenant-pick button { width: 100%; justify-content: space-between; min-height: 48px; padding: 8px 12px; }

/* Barra fija para guardar en tablas largas ------------------------------------------------------------ */
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border); }

/* Barras de desplazamiento del propio sistema */
* { scrollbar-color: #c4c4c4 transparent; scrollbar-width: thin; }

/* Pedidos ------------------------------------------------------------------------------------------- */
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--border); }
.card-actions > .muted { margin-right: auto; align-self: center; }
.summary-row { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); }
.summary-row > div { padding: 8px 16px 12px; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.summary-row > div:last-child { border-right: 0; }
.summary-row strong { font-size: 16px; line-height: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.head-meta { width: 100%; color: var(--text-2); margin-top: -4px; }
.order-badges { display: inline-flex; gap: 6px; }

/* Totales del pedido */
.totals { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.totals td { padding: 4px 0; vertical-align: top; }
.totals td:last-child { text-align: right; white-space: nowrap; }
.totals .muted-cell { color: var(--text-2); padding-left: 12px; }
.totals tr.total td { font-weight: 650; padding-top: 8px; border-top: 1px solid var(--border); }
.totals tr.refund td { color: var(--text-2); }

/* Acción que despliega un formulario corto (pagar, enviar, cancelar) */
details.more-actions > summary { cursor: pointer; font-weight: 600; }
details.more-actions[open] > summary { margin-bottom: 12px; }
details.action { position: relative; }
details.action > summary { list-style: none; }
details.action > summary::-webkit-details-marker { display: none; }
details.action[open] > summary { box-shadow: inset 0 1px 2px rgba(26, 26, 26, .2); }
details.action > .pop {
  margin-top: 8px; padding: 12px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--pop-shadow); width: min(320px, calc(100vw - 32px));
}
@media (min-width: 720px) { details.action > .pop { position: absolute; right: 0; z-index: 20; } }
/* Dentro de una tarjeta que recorta (overflow: hidden) el formulario va en el flujo, no flotando */
.card-actions details.action > .pop { position: static; }
details.action > .pop .field:last-of-type { margin-bottom: 12px; }
details.action > .pop .form-actions { margin: 0; }

/* Direcciones y datos de contacto */
.kv h3 { font-size: 12px; color: var(--text-2); font-weight: 550; margin: 16px 0 4px; }
.kv h3:first-child { margin-top: 0; }
.kv p { margin: 0; }
.line-meta { font-size: 12px; color: var(--text-2); }

/* Historial */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--border-input); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.comment::before { background: var(--surface); box-shadow: inset 0 0 0 2px #303030; }
.timeline .when { display: block; font-size: 12px; color: var(--text-2); }
.comment-form { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 16px; }
.comment-form textarea { flex: 1; min-height: 36px; }

/* Renglones del pedido nuevo */
.lines-edit td.sku-cell { min-width: 220px; }
.line-modifiers { border: 0; margin: 8px 0 0; padding: 0; min-width: 0; }
.line-modifiers legend { font-size: 12px; font-weight: 600; padding: 0; }
.line-modifiers label.check { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; }
.line-modifiers input { width: auto !important; min-height: 0; }
.lines-edit td.sku-cell input { max-width: none !important; }
.lines-edit td.num input { max-width: 110px !important; }
.lines-edit .unit-input { max-width: 90px !important; text-transform: uppercase; }
@media (max-width: 1039px) { .grid-main > .side-first { order: -1; } }
/* Pedido nuevo: debajo de 1040 px solo la tarjeta Cliente va antes de Productos; Inventario y Notas quedan al final. */
@media (max-width: 1039px) {
  .grid-main > .side-split { display: contents; }
  .side-split > .card:first-child { order: -1; }
  .side-split > .card:not(:first-child) { order: 1; }
}
details.box-help { padding: 0 16px 8px; }
details.box-help > summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
@media (max-width: 719px) { .lines-edit td.right { width: auto !important; margin-left: auto; } }

/* Menú corto (exportar) y herramientas por fila */
details.action > .menu-pop { width: 200px; padding: 6px; display: flex; flex-direction: column; }
details.action > .menu-pop a { padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); }
details.action > .menu-pop a:hover { background: var(--surface-hover); text-decoration: none; }
.row-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.collection-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--surface-2); }
.translation-row .original { font-size: 12px; color: var(--text-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 6px; }

/* Apps */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.app-card { display: flex; gap: 14px; align-items: flex-start; color: var(--text); margin: 0; }
.app-card:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--border-strong), 0 2px 6px rgba(26, 26, 26, .08); color: var(--text); }
.app-icon { width: 44px; height: 44px; border-radius: 10px; background: #303030; color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.app-body { display: flex; flex-direction: column; gap: 2px; }
.app-meta { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.notices { margin-bottom: 16px; }
.notice { display: flex; gap: 12px; align-items: flex-start; }
.notice .grow { flex: 1; }
.scope-list { margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.5; }
.pay-list-title { margin: 16px 0 6px; font-size: 14px; }
.pay-list { list-style: none; margin: 0; padding: 0; }
.pay-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.pay-list li > span:first-child { display: flex; flex-direction: column; }
.pay-list li.review { background: var(--warn-tint); padding: 8px; border-radius: var(--radius); }
.pay-list .refund-list, .pay-list details.action { flex-basis: 100%; }
.table tr.child-line td.primary { padding-left: 28px; }

/* Aviso de pedido nuevo (#57) */
.order-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.order-toast { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.order-toast > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.order-toast span { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-toggle[aria-pressed="true"] { background: var(--ok-bg); color: var(--ok); }
.topbar .sound-toggle { margin-left: auto; }
.topbar .sound-toggle + .account { margin-left: 0; }

/* Diseño de la tienda en línea (#79) */
.design-layout { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .design-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } .design-preview-card { position: sticky; top: 16px; } }
.design-themes { margin: -4px 0 16px; padding-left: 18px; }
.design-preview { --brand: #1a1a1a; --on-brand: #ffffff; --accent: #0b6b3a; --on-accent: #ffffff; --font: inherit; font-family: var(--font); border: 1px solid var(--border); border-radius: 8px; padding: 16px; background: var(--canvas, #fff); color: var(--on-canvas, #1a1a1a); }
.design-preview .dp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.design-preview .dp-logo { font-weight: 750; font-size: 18px; }
.design-preview .dp-logo-img { height: 48px; width: auto; max-width: 160px; object-fit: contain; }
.design-preview .dp-count { min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.design-preview .dp-text { margin: 0 0 12px; }
.design-preview .dp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.design-preview .dp-btn { background: var(--brand); border: 1px solid var(--brand); color: var(--on-brand); border-radius: 999px; padding: 10px 18px; font: 600 14px var(--font); }
.design-preview .dp-pill { background: var(--brand); color: var(--on-brand); border-radius: 999px; padding: 6px 14px; font-weight: 550; }
.design-preview .dp-title { margin-top: 16px; font-size: 16px; font-weight: 650; }
.design-preview .dp-title::after { content: ""; display: block; width: 40px; height: 3px; margin-top: 6px; background: var(--accent); }

/* Precios del producto: pestañas por lista y «Aplicar a todas» (#27) ------------------------ */
.list-tabs { display: none; }
.list-tabs-on .list-tabs { display: flex; }
.list-tabs-on .price-list-card:not(.is-current) { display: none; }
.list-tab { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 8px 12px; min-height: 44px; color: var(--text-2); font: inherit; font-weight: 550; white-space: nowrap; cursor: pointer; }
.list-tab.active { color: var(--text); border-bottom-color: var(--text); }
.apply-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.apply-all .input-sm { width: 120px; }
.save-bar .muted { margin-right: auto; align-self: center; }
@media (max-width: 719px) {
  .apply-all .input-sm { flex: 1 1 90px; width: auto; min-width: 0; }
  .save-bar { flex-wrap: wrap; }
  .save-bar .muted { flex: 1 1 100%; margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar.open, .btn, .dropzone { transition: none; }
}

/* #167: pulido */
.row-slot { display: inline-block; width: 66px; }
.variant-of { display: inline-block; padding-left: 12px; font-weight: 550; }
.save-bar .btn-delete { margin-right: auto; }
.save-bar .btn-delete ~ .muted { margin-right: 0; }
@media (max-width: 719px) { .row-slot { display: none; } .save-bar .btn-delete { margin-right: 0; } }
.grid-2 { align-items: start; }
.row-tools-nowrap { flex-wrap: nowrap; }
.card.flush > .callout { margin: 0 16px 12px; }

/* Ficha del producto en una página (#170) ------------------------------------------------------------
   Tarjetas con título a la izquierda y acciones a la derecha, separadas en secciones; un solo ritmo de 16 px. */
.product-main, .product-main > section, .product-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.product-main .card, .product-side .card { margin-bottom: 0; }
.product-main .list-tabs { margin: 0; }
.product-main [id], .product-side [id] { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.card-head h2 .count {
  display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 11px; vertical-align: middle;
  background: var(--surface-pressed); color: var(--text-2); font-size: 12px; font-weight: 600; line-height: 22px; text-align: center;
}
.card-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.product-main .card.flush > .card-head { padding: 16px 16px 0; margin-bottom: 12px; }
.card-section { padding: 16px; border-top: 1px solid var(--border); }
.card-head + .card-section, .card-head + form > .card-section:first-child { padding-top: 0; border-top: 0; }
.card-section.edge { padding-left: 0; padding-right: 0; padding-bottom: 0; }
.card-section h3 { margin: 0 0 8px; font-size: 13px; font-weight: 650; }
.card-section h3.spaced { margin-top: 16px; }
.card-section > .empty { padding: 24px 16px; }
.card-desc { margin: 0 0 12px; max-width: 72ch; }
.card-section > .card-desc:last-child { margin-bottom: 0; }
.card-note { margin: 0; padding: 0 16px 12px; }
.card.flush form > .callout, .card.flush form > .non-field-errors { margin: 0 16px 12px; }
.dropzone.compact { padding: 12px; }
.image-grid + .dropzone { margin-top: 12px; }
.disclosures { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.disclosure { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.disclosure > summary { display: flex; align-items: center; gap: 6px; padding: 8px 12px; cursor: pointer; font-weight: 550; }
.disclosure[open] > summary { border-bottom: 1px solid var(--border); }
.disclosure > form { padding: 12px; }
.col-xs { min-width: 96px; }
.col-sm { min-width: 130px; }
.col-md { min-width: 150px; }
.col-lg { min-width: 200px; }

/* Ficha de variante y lista de variantes (#170, E2) */
.variant-link { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.variant-link:hover strong { text-decoration: underline; }
.thumb { width: 40px; height: 40px; border-radius: var(--radius); object-fit: cover; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); flex: none; }
.thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
.variant-nav-list { list-style: none; margin: 0; padding: 0 0 8px; max-height: 420px; overflow-y: auto; }
.variant-nav-list a, .variant-nav-list .current { display: flex; justify-content: space-between; gap: 8px; padding: 8px 16px; color: inherit; text-decoration: none; }
.variant-nav-list a:hover { background: var(--surface-pressed); }
.variant-nav-list .current { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--text); }
.check-row { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.image-warning { margin: 0; }
.reasons { margin: 0; padding-left: 18px; }
.variant-images { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(110px, 120px)); margin-top: 8px; }
.variant-image { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.variant-image .pic { width: 100%; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.variant-image .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.variant-image .body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
