/* Sadala's Mara – Gestión de producción
   Estética unificada con Holded (valores medidos en app.holded.com el 18/10/2026): letra Roboto, menú
   lateral gris claro, área de trabajo blanca, botones azules #2164D9 de 36 px con esquinas de 4 px,
   tarjetas blancas con borde gris fino y pestañas en forma de selector. Roboto (Apache 2.0) va incluida
   en /static/fonts/ui. «Mara» mantiene el marrón del logotipo. */
@font-face { font-family: "Roboto UI"; src: url("/static/fonts/ui/roboto-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; 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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #ffffff;          /* área de trabajo (blanca, como Holded) */
  --frame: #f3f4f6;       /* menú lateral y marco */
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #1f2937;
  --ink-strong: #111827;
  --ink-2: #4b5563;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #f3f4f6;
  --line-strong: #d1d5db;
  --accent: #2164d9;      /* azul de los botones de Holded */
  --accent-hover: #1a53b8;
  --accent-ink: #ffffff;
  --accent-soft: #ebf2ff;
  --olive: #4b5563;
  --olive-soft: #f3f4f6;
  --brand: #a9571d;       /* marrón del logotipo («Mara») */
  --brand-light: #e39a4b;
  --sun: #2164d9;
  --side: #f3f4f6;
  --side-2: #e8e9ed;      /* opción activa del menú */
  --side-ink: rgba(0, 0, 0, .87);
  --success: #15803d;
  --success-soft: #e7f6ec;
  --warning: #a16207;
  --warning-soft: #fef6e0;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --info: #2164d9;
  --info-soft: #ebf2ff;
  --s1: #e0a020; --s2: #2164d9; --s3: #7c3aed; --s4: #ea6a3d; --s5: #0e9f9f; --s6: #15803d;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-lg: 0 1px 2px rgba(17, 24, 39, .04), 0 10px 28px -10px rgba(17, 24, 39, .12);
  --side-w: 240px;
  --side-mini: 60px;
  --font: "Roboto UI", Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: var(--font);
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: 0; color: var(--ink-strong); }
h2 { font-size: 1rem; font-weight: 500; }
h3 { font-size: .93rem; font-weight: 500; }
p { margin: 0 0 .5rem; }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: .85em; background: var(--line-2); padding: .1em .35em; border-radius: 4px; }
.icon { flex: none; vertical-align: middle; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small, small { font-size: .8rem; }
.block { display: block; }
.pre { white-space: pre-line; }
.strike { text-decoration: line-through; }
.center { text-align: center; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.danger-text { color: var(--danger); }
.warn-text { color: var(--warning); }
.pad { padding: .85rem 1rem; }
.pad-top { padding-top: .85rem; }
.subhead { margin: .9rem 0 .45rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ------------------------------------------------------------------ Estructura */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; padding: .8rem .6rem; z-index: 40;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink-strong); background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(17, 24, 39, .06); margin: 0 0 .9rem; padding: .45rem .5rem; text-decoration: none !important; min-width: 0; }
.brand-logo { width: 34px; height: 34px; border-radius: 50%; flex: none; background: #fff; }
.brand-text { display: flex; flex-direction: column; font-size: .95rem; font-weight: 500; line-height: 1.15; min-width: 0; white-space: nowrap; }
.brand-text b { font-weight: 700; color: var(--brand); }
.brand-text small { font-size: .66rem; font-weight: 400; color: var(--muted); margin-top: .15rem; white-space: normal; line-height: 1.25; }
.nav-collapse { position: absolute; top: .95rem; right: -13px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-lg); z-index: 2; padding: 0; }
.nav-collapse:hover { color: var(--accent); border-color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav a { display: flex; align-items: center; gap: .65rem; min-height: 32px; padding: 6px 8px; border-radius: 4px; color: var(--side-ink); font-weight: 400; font-size: 14px; text-decoration: none; white-space: nowrap; overflow: hidden; }
.nav a .icon { width: 16px; height: 16px; color: var(--ink-2); }
.nav a:hover { background: var(--side-2); color: var(--side-ink); }
.nav a.active { background: var(--side-2); color: var(--side-ink); font-weight: 500; }
.nav a.active .icon { color: var(--ink-strong); }
.help-link { display: flex; align-items: center; gap: .65rem; min-height: 32px; padding: 6px 8px; margin-bottom: .5rem; border-radius: 4px; color: var(--accent); font-weight: 500; font-size: 14px; text-decoration: none !important; white-space: nowrap; overflow: hidden; }
.help-link .icon { width: 16px; height: 16px; }
.help-link:hover { background: var(--side-2); }
.sidebar-user { display: flex; align-items: center; gap: .55rem; padding: .6rem .3rem 0; border-top: 1px solid var(--line); min-width: 0; }
.avatar { width: 28px; height: 28px; border-radius: 4px; background: var(--ink-strong); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .74rem; flex: none; }
.who { display: flex; flex-direction: column; min-width: 0; flex: 1; color: var(--ink); text-decoration: none !important; }
.who strong { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 0; color: inherit; padding: .35rem; border-radius: 6px; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: rgba(127, 127, 127, .15); }
.main { margin-left: var(--side-w); padding: 1.25rem 2rem 3rem; min-height: 100vh; background: var(--bg); border-left: 1px solid var(--line); }
.nav-anim .sidebar { transition: width .18s ease; }
.nav-anim .main { transition: margin-left .18s ease; }
.topbar, .nav-toggle, .nav-backdrop { display: none; }

/* Menú plegado: solo iconos (el nombre sale al pasar el ratón, por el atributo title) */
@media (min-width: 901px) {
  .nav-mini .sidebar { width: var(--side-mini); padding-left: .5rem; padding-right: .5rem; }
  .nav-mini .main { margin-left: var(--side-mini); max-width: none; }
  .nav-mini .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-mini .brand-logo { width: 30px; height: 30px; }
  .nav-mini .brand-text, .nav-mini .nav a span, .nav-mini .who { display: none; }
  .nav-mini .nav a, .nav-mini .help-link { justify-content: center; padding: .55rem 0; }
  .nav-mini .help-link span { display: none; }
  .nav-mini .sidebar-user { flex-direction: column; padding-left: 0; padding-right: 0; }
  .nav-mini .nav-collapse svg { transform: scaleX(-1); }
}

@media (max-width: 900px) {
  .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; background: var(--surface); color: var(--ink); padding: .45rem .7rem; border-bottom: 1px solid var(--line); }
  .topbar-menu, .topbar-qr { color: var(--ink); padding: .35rem; display: grid; cursor: pointer; }
  .topbar-brand { color: var(--ink-strong); font-size: 1rem; font-weight: 500; display: inline-flex; gap: .5rem; align-items: center; text-decoration: none !important; }
  .topbar-brand img { border-radius: 50%; background: #fff; width: 28px; height: 28px; }
  .topbar-brand span { font-weight: 700; color: var(--brand); }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .nav-collapse { display: none !important; }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
  .main { margin-left: 0; padding: .85rem .85rem 3rem; border-left: 0; }
  h1 { font-size: 1.25rem; }
}

/* ------------------------------------------------------------------ Cabecera de página */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; }
.page-header .subtitle { color: var(--muted); margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; font-size: .86rem; }
.page-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .22rem .7rem .22rem .5rem; margin-bottom: .5rem; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s; }
.back-link .icon { width: 15px; height: 15px; }
.back-link:hover, .back-link:focus-visible { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.eyebrow { font-size: .8rem; color: var(--muted); margin-bottom: .15rem; }
.eyebrow a { color: var(--ink-2); }

/* ------------------------------------------------------------------ Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 36px; padding: 7px 12px; border-radius: 4px; border: 1px solid transparent; font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none !important; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: #9ca3af; background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f0c2bf; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-lg { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.btn-xl { padding: .75rem 1rem; font-size: .98rem; width: 100%; justify-content: flex-start; text-align: left; border-radius: 8px; font-weight: 600; }
.btn-xl span { display: flex; flex-direction: column; }
.btn-xl small { font-weight: 400; opacity: .9; font-size: .78rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.inline-form { display: inline; }
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.row-actions.end { justify-content: flex-end; }
td.row-actions { display: table-cell; white-space: nowrap; }
td.row-actions > * { margin: 0 .3rem .2rem 0; vertical-align: middle; }
.stack > .btn, .stack > .row-actions, .upload-box > .btn, .alert form .btn { align-self: flex-start; }
.image-actions { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: .85rem; min-width: 0; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem 1rem; min-height: 44px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-actions { display: flex; gap: .4rem; align-items: center; }
.card-body { padding: .85rem 1rem; }
.card.flush > .card-body { padding: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .85rem; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 .85rem; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .grid-2, .grid-2.wide-left, .grid-3 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ Mensajes */
.flash, .alert { display: flex; gap: .65rem; align-items: flex-start; padding: .6rem .85rem; border-radius: var(--radius); margin-bottom: .85rem; border: 1px solid; font-size: .86rem; }
.flash { box-shadow: var(--shadow); }
.flash-success, .alert-success { background: var(--success-soft); border-color: #bfe0cc; color: #1f5c39; }
.flash-error, .alert-error { background: var(--danger-soft); border-color: #f3c4bf; color: #8a1c13; }
.alert-warning { background: var(--warning-soft); border-color: #f0d9ad; color: #7a4d06; }
.alert-info { background: var(--info-soft); border-color: #c8daf3; color: #1f4479; }
.alert ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.alert p { margin: .25rem 0 .5rem; }
.alert form { margin-top: .5rem; }
.alert .icon { margin-top: 2px; }

/* ------------------------------------------------------------------ Distintivos */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge-neutral { background: var(--line-2); color: var(--ink-2); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.step-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; padding: .15rem .6rem .15rem .2rem; border-radius: 999px; background: var(--line-2); white-space: nowrap; }
.step-badge b { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; color: #fff; font-size: .72rem; }
.step-badge.step-done { color: var(--success); background: var(--success-soft); padding-left: .55rem; }
.step-1 b, .step-1 .board-n, .current-step-n.step-1 { background: var(--s1); }
.step-2 b, .step-2 .board-n, .current-step-n.step-2 { background: var(--s2); }
.step-3 b, .step-3 .board-n, .current-step-n.step-3 { background: var(--s3); }
.step-4 b, .step-4 .board-n, .current-step-n.step-4 { background: var(--s4); }
.step-5 b, .step-5 .board-n, .current-step-n.step-5 { background: var(--s5); }
.step-6 b, .step-6 .board-n, .current-step-n.step-6 { background: var(--s6); }
.current-step-n.step-done { background: var(--success); }

/* Barra de pasos */
.stepper { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 .85rem; padding: .65rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; font-size: .76rem; color: var(--muted); }
.stepper li::before { content: ""; position: absolute; top: 12px; left: -50%; right: 50%; height: 2px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper .dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-weight: 600; font-size: .74rem; color: var(--muted); }
.stepper li.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.stepper li.done::before, .stepper li.current::before { background: var(--success); }
.stepper li.current .dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper li.current { color: var(--ink); font-weight: 600; }
@media (max-width: 700px) { .stepper .lbl { display: none; } .stepper li.current .lbl { display: block; position: absolute; top: 34px; width: 120px; } .stepper { padding-bottom: 2rem; } }

/* ------------------------------------------------------------------ Pestañas */
.tabs { display: flex; gap: 2px; align-items: center; width: fit-content; max-width: 100%; margin: .3rem 0 1rem; padding: 4px; background: var(--line-2); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: .45rem; min-height: 32px; padding: 6px 16px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.tabs a svg { opacity: .8; flex: none; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 24, 39, .06), 0 1px 3px rgba(17, 24, 39, .1); }
.tabs a.active svg { opacity: 1; color: var(--accent); }
.tabs .count { display: inline-block; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--line); color: var(--ink-2); font-size: 12px; line-height: 1.35rem; text-align: center; }
.tabs a.active .count { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------------ Tablas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .5rem .8rem; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: .5rem .8rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.compact td, .table.compact th { padding: .45rem .7rem; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f7f9fc; }
tr.superseded td { color: var(--muted); background: var(--surface-2); }
.phone { white-space: nowrap; }

/* ------------------------------------------------------------------ Formularios */
.stack { display: flex; flex-direction: column; gap: .7rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem .9rem; }
.form-grid.narrow { max-width: 420px; grid-template-columns: 1fr; }
.span-2 { grid-column: span 2; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field label, .segmented legend { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.req { color: var(--accent); margin-left: .15rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 10px; min-height: 36px; width: 100%; min-width: 0; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=file] { padding: .3rem; background: var(--surface-2); }
input:disabled, select:disabled { background: var(--line-2); color: var(--muted); }
textarea { resize: vertical; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .8rem; margin: 0; }
.hint { color: var(--muted); font-size: .76rem; margin: 0; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .86rem; cursor: pointer; }
.check.small { font-size: .8rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: .7rem 0 .4rem; z-index: 5; }
.radio-cards { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 800px) { .radio-cards { grid-template-columns: 1fr; } }
.radio-card { display: flex; gap: .55rem; align-items: flex-start; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface-2); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.radio-card span { display: flex; flex-direction: column; gap: .2rem; }
.radio-card small { color: var(--muted); }
.segmented { border: 0; padding: 0; margin: 0 0 .5rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.segmented legend { margin-bottom: .35rem; padding: 0; }
.segmented label { flex: 1 1 160px; }
.segmented label span { display: flex; gap: .4rem; align-items: center; justify-content: center; padding: .45rem .6rem; border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; font-weight: 500; font-size: .84rem; background: var(--surface); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.delivery-fields .agency-only { margin-bottom: .2rem; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.filters select { width: auto; }
.search-box { position: relative; flex: 1 1 280px; }
.search-box .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 2.2rem; }
.link-muted { color: var(--muted); font-size: .85rem; }

/* ------------------------------------------------------------------ Listas, definiciones, vacíos */
.dl { display: grid; gap: 0; margin: 0; }
.dl > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 1rem; padding: .38rem 0; border-bottom: 1px solid var(--line-2); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); font-size: .8rem; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .dl > div { grid-template-columns: 1fr; gap: .1rem; } }
.empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2.2rem 1rem; color: var(--muted); text-align: center; }
.empty p { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
.list > li > a, .list-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem 1rem; color: inherit; text-decoration: none; }
.list > li > a:hover { background: #f7f9fc; }
.list-main { display: flex; flex-direction: column; min-width: 0; gap: .1rem; }
.list-main small { color: var(--muted); }
.list-side { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; text-align: right; }
.list.compact .list-row { padding: .45rem 1rem; }
.list.big > li > a { padding: .8rem 1rem; }
.card:not(.flush) > .card-body > .list { margin: -.85rem -1rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .8rem; padding: .55rem 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 1.3rem; bottom: -.55rem; width: 2px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline p { margin: .1rem 0; font-size: .88rem; }
.timeline small { color: var(--muted); }
.tl-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: .35rem; background: var(--info); z-index: 1; }
.action-avance { background: var(--s2); }
.action-retroceso { background: var(--danger); }
.action-entrega { background: var(--success); }
.action-alta { background: var(--muted); }
.action-reapertura { background: var(--warning); }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: .55rem 1rem; border-top: 1px solid var(--line-2); font-size: .82rem; color: var(--muted); }
.pagination a { display: inline-flex; gap: .3rem; align-items: center; }
.danger-zone { margin-top: 2rem; padding-top: 1rem; border-top: 1px dashed var(--line); display: flex; justify-content: flex-end; }
.details { margin-top: .75rem; }
.details > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: .4rem; align-items: center; padding: .35rem 0; list-style: none; }
.details > summary::-webkit-details-marker { display: none; }
.details > summary::before { content: "▸"; color: var(--muted); }
.details[open] > summary::before { content: "▾"; }
.details[open] > summary { margin-bottom: .6rem; }
.details.inline { display: inline-block; margin: 0; }
.details.inline[open] { display: block; margin-top: .4rem; }

/* ------------------------------------------------------------------ Inicio */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; margin-bottom: .85rem; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile { display: flex; flex-direction: column; gap: .1rem; padding: .75rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.tile-icon { color: var(--accent); }
.tile-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile-label { color: var(--muted); font-size: .84rem; }
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1.1rem; }
@media (max-width: 800px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pipeline-label { overflow-wrap: anywhere; } }
.pipeline-step { display: flex; align-items: center; gap: .55rem; padding: .7rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none !important; border-top: 3px solid; }
.pipeline-step.step-1 { border-top-color: var(--s1); } .pipeline-step.step-2 { border-top-color: var(--s2); } .pipeline-step.step-3 { border-top-color: var(--s3); }
.pipeline-step.step-4 { border-top-color: var(--s4); } .pipeline-step.step-5 { border-top-color: var(--s5); } .pipeline-step.step-6 { border-top-color: var(--s6); }
.pipeline-n { font-size: .75rem; color: var(--muted); font-weight: 700; }
.pipeline-label { flex: 1; font-size: .85rem; font-weight: 600; }
.pipeline-count { font-size: 1.15rem; font-weight: 700; }

/* ------------------------------------------------------------------ Diseños */
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.design-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none !important; background: var(--surface); transition: box-shadow .15s, transform .15s; }
.design-card:hover { box-shadow: 0 6px 18px rgba(20, 24, 35, .1); transform: translateY(-1px); }
.design-thumb { position: relative; aspect-ratio: 1; background: var(--line-2); display: grid; place-items: center; }
.design-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-flag { position: absolute; left: .5rem; bottom: .5rem; background: rgba(22, 27, 39, .8); color: #fff; font-size: .7rem; padding: .15rem .45rem; border-radius: 4px; }
.thumb-empty { display: flex; flex-direction: column; align-items: center; gap: .35rem; color: var(--muted); font-size: .82rem; padding: 2rem; }
.design-info { padding: .75rem .85rem .9rem; display: flex; flex-direction: column; gap: .2rem; }
.design-info .muted { font-size: .84rem; }
.design-meta { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-size: .8rem; color: var(--ink-2); }
.threads { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.thread { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--mono); font-size: .72rem; padding: .1rem .4rem .1rem .2rem; border: 1px solid var(--line); border-radius: 999px; }
.thread i, .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); background: conic-gradient(#ddd 0 25%, #fff 0 50%, #ddd 0 75%, #fff 0); vertical-align: -1px; }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.view-toggle a { padding: .3rem .45rem; color: var(--muted); display: grid; }
.view-toggle a.active { background: var(--line-2); color: var(--ink); }
.image-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-bottom: 1.1rem; }
@media (max-width: 700px) { .image-pair { grid-template-columns: 1fr; } }
.image-panel { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem; display: flex; flex-direction: column; gap: .6rem; }
.image-panel figcaption { font-weight: 600; font-size: .9rem; }
.image-frame { aspect-ratio: 4 / 3; background: var(--line-2); border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.image-frame img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.image-frame a { display: contents; }
.quick-upload { display: inline; }
.quick-upload label { cursor: pointer; }
.image-panel .inline-form { display: inline-block; }
.dropzone { display: flex; gap: .8rem; align-items: center; padding: 1rem; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface-2); color: var(--ink-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone span { display: flex; flex-direction: column; flex: 1; }
.dropzone small { color: var(--muted); }
.dropzone input[type=file] { max-width: 260px; }
.upload-box { display: flex; flex-direction: column; gap: .7rem; padding: 1rem 1.25rem; border-top: 1px solid var(--line-2); }
.thread-rows, .line-rows, .receive-rows { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .5rem; }
.thread-row { display: grid; grid-template-columns: 28px 1fr 1fr 1.3fr; gap: .5rem; align-items: center; }
.thread-row.head, .line-row.head, .receive-row.head { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.thread-row .n { color: var(--muted); font-size: .85rem; text-align: center; }
.line-row { display: grid; grid-template-columns: 2fr .8fr 1fr .8fr 80px; gap: .5rem; align-items: center; }
.receive-row { display: grid; grid-template-columns: 1fr 90px 120px; gap: .6rem; align-items: center; padding: .25rem 0; border-bottom: 1px dashed var(--line-2); }
@media (max-width: 600px) {
  .thread-row { grid-template-columns: 22px 1fr 1fr; }
  .thread-row input:last-child { grid-column: 2 / span 2; }
  .line-row { grid-template-columns: 1fr 1fr; }
  .line-row input:nth-of-type(2) { grid-column: span 2; }
  .line-row.head { display: none; }
}
.embroidery-only.is-hidden { display: none; }

/* Depósito */
.mini-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; margin-bottom: 1rem; }
@media (max-width: 800px) { .mini-tiles { grid-template-columns: repeat(3, 1fr); } }
.mini-tiles > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; display: flex; flex-direction: column; }
.mini-tiles span { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-tiles small { color: var(--muted); }
.mini-tiles .is-danger span { color: var(--danger); }
.mini-tiles .is-warning span { color: var(--warning); }
.mini-tiles .is-accent { background: var(--accent-soft); border-color: #c9dcfb; }
.mini-tiles .is-accent span { color: var(--accent); }
.incident-photo img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; }
.close-deposit { max-width: 480px; }

/* Producción */
.current-step { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.current-step-n { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.05rem; flex: none; }
.current-step div { display: flex; flex-direction: column; }
.current-step small { color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(5, minmax(172px, 1fr)); gap: .55rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.board-col { background: #e9ecf2; border-radius: var(--radius); padding: .5rem; min-height: 200px; }
.board-col-head { display: flex; align-items: center; gap: .5rem; padding: .35rem .3rem .6rem; font-weight: 600; font-size: .85rem; }
.board-col-head .count { margin-left: auto; background: var(--surface); border-radius: 999px; padding: 0 .5rem; font-size: .78rem; }
.board-n { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: .75rem; flex: none; }
.board-cards { display: flex; flex-direction: column; gap: .5rem; }
.board-card { display: flex; flex-direction: column; gap: .2rem; padding: .7rem .75rem; background: var(--surface); border-radius: 8px; border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; font-size: .86rem; box-shadow: var(--shadow); }
.board-card:hover { border-color: var(--accent); }
.board-card-top { display: flex; justify-content: space-between; font-size: .76rem; }
.board-card-meta { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.board-card-foot { font-size: .74rem; margin-top: .2rem; }
.board-empty { color: var(--muted); font-size: .82rem; text-align: center; padding: 1rem 0; }
.chip { font-size: .7rem; padding: .05rem .4rem; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip-plain { background: var(--line-2); color: var(--ink-2); }
.notif summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1.25rem; list-style: none; }
.notif summary::-webkit-details-marker { display: none; }
.mail-body { white-space: pre-wrap; font-family: var(--font); font-size: .86rem; background: var(--surface-2); margin: 0 1.25rem 1rem; padding: .75rem; border-radius: 8px; border: 1px solid var(--line-2); }

/* Ventana emergente */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 18, 27, .5); display: grid; place-items: center; z-index: 100; padding: 1rem; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 10px; width: min(620px, 100%); max-height: 92vh; overflow-y: auto; padding: 1.25rem 1.4rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.modal h2 { display: flex; gap: .5rem; align-items: center; font-size: 1.15rem; }
@keyframes fade { from { opacity: 0; } }

/* Inicio de sesión y errores */
.bare-main { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 1rem; }
.login-wrap { display: grid; place-items: center; }
.login-card { width: min(400px, 100%); background: var(--surface); border-radius: 16px; padding: 2rem; box-shadow: 0 10px 40px rgba(20, 24, 35, .12); border: 1px solid var(--line); }
.login-brand { display: flex; flex-direction: column; gap: .7rem; align-items: center; text-align: center; margin-bottom: 1.5rem; }
.login-brand img { border-radius: 50%; box-shadow: 0 4px 18px rgba(30, 36, 51, .18); }
.login-brand strong { display: block; color: var(--ink); font-weight: 700; font-size: 1.45rem; letter-spacing: -.02em; }
.login-brand b { color: var(--brand); font-weight: 700; }
.login-brand small { color: var(--muted); font-style: italic; }
.login-foot { text-align: center; color: var(--muted); font-size: .8rem; margin: 1.2rem 0 0; }
.bare .bare-main { background: radial-gradient(circle at 50% 0%, #ebf2ff 0%, var(--frame) 60%); }
.login-card .btn { width: 100%; padding: .75rem; }
.error-page { max-width: 520px; margin: 4rem auto; text-align: center; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--accent); opacity: .25; line-height: 1; }
.error-page .row-actions { justify-content: center; margin-top: 1.5rem; }

/* ------------------------------------------------------------------ Taller (móvil) */
.scan-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: .9rem; align-items: stretch; }
.scan-video video { width: 100%; max-height: 50vh; border-radius: 10px; background: #000; object-fit: cover; }
.code-form { display: flex; gap: .5rem; }
.code-form input { font-size: 1.15rem; text-transform: uppercase; }
.m-head { margin-bottom: 1rem; }
.m-head h1 { margin: .15rem 0 .25rem; }
.m-code { font-size: .95rem; color: var(--accent); font-weight: 700; }
.m-action .card-body { display: flex; flex-direction: column; gap: .75rem; }
.m-design { display: flex; flex-direction: column; gap: .75rem; }
.m-design-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.m-design-imgs a { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); font-size: .75rem; text-align: center; }
.m-design-imgs img { border-radius: 8px; aspect-ratio: 1; object-fit: cover; background: var(--line-2); width: 100%; }
.m-specs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0; }
.m-specs div { background: var(--surface-2); border-radius: 8px; padding: .45rem .6rem; }
.m-specs dt { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.m-specs dd { margin: 0; font-weight: 600; }
.m-threads { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .25rem; }
.m-notes { background: var(--warning-soft); padding: .6rem .75rem; border-radius: 8px; font-size: .9rem; white-space: pre-line; }
.m-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.m-buttons .btn, .m-buttons label.btn { flex: 1 1 140px; padding: .75rem; }

/* ------------------------------------------------------------------ Hoja de taller (impresión A4) */
.sheet-body { background: #d9d6cf; }
.sheet-toolbar { position: sticky; top: 0; display: flex; justify-content: space-between; padding: .6rem 1rem; background: #1f2937; z-index: 5; }
.sheet-toolbar .btn-ghost { color: #fff; }
.sheet { width: 210mm; min-height: 297mm; margin: 1.5rem auto; background: #fff; padding: 12mm; color: #111; font-size: 10.5pt; box-shadow: 0 4px 30px rgba(0, 0, 0, .2); }
.sheet-head { display: grid; grid-template-columns: 1fr auto auto; gap: 8mm; align-items: center; border-bottom: 2px solid #111; padding-bottom: 4mm; margin-bottom: 4mm; }
.sheet-brand { display: flex; gap: 3mm; align-items: center; }
.sheet-brand img { width: 18mm; height: 18mm; border-radius: 50%; }
.sheet-brand strong { display: block; color: #111; font-size: 15pt; letter-spacing: .06em; }
.sheet-brand small { color: #555; }
.sheet-code { text-align: right; }
.sheet-code span { display: block; font-family: var(--mono); font-size: 22pt; font-weight: 800; }
.sheet-code small { color: #555; }
.sheet-qr { display: flex; flex-direction: column; align-items: center; width: 34mm; text-align: center; }
.sheet-qr svg { width: 30mm; height: 30mm; }
.sheet-qr small { font-size: 6.5pt; color: #555; line-height: 1.2; }
.sheet-info { display: grid; grid-template-columns: 1fr 1fr; gap: 2mm 6mm; margin-bottom: 4mm; }
.sheet-info label { display: block; font-size: 7.5pt; text-transform: uppercase; letter-spacing: .05em; color: #666; }
.sheet-design { display: grid; grid-template-columns: 52mm 1fr; gap: 5mm; border: 1px solid #bbb; border-radius: 3mm; padding: 3mm; margin-bottom: 3mm; break-inside: avoid; }
.sheet-design-img img { width: 52mm; height: 52mm; object-fit: contain; border: 1px solid #ddd; border-radius: 2mm; }
.sheet-design.two-imgs { grid-template-columns: 52mm 1fr; }
.sheet-design-imgs { display: flex; flex-direction: column; gap: 2mm; }
.sheet-design-imgs figure { margin: 0; text-align: center; }
.sheet-design-imgs img { width: 52mm; height: 46mm; object-fit: contain; border: 1px solid #ddd; border-radius: 2mm; background: #fafafa; }
.sheet-design-imgs figcaption { font-size: 7pt; color: #555; text-transform: uppercase; letter-spacing: .04em; }
.sheet-status { font-size: 8.5pt; margin: 0 0 2mm; color: #333; }
.sheet-qty { font-size: 12pt; }
.sheet-checks { font-size: 8.5pt; margin: 2mm 0 0; padding-top: 1.5mm; border-top: 1px dashed #bbb; }
.sheet-notes.alert-note { background: #fde8e4; }
.sheet-table td.blank-sm { width: 6mm; }
.sheet-total td { font-weight: 700; background: #f7f7f7; }
.sheet-now { display: block; font-weight: 700; color: #111 !important; }
.sheet-due { font-size: 12pt; }
.sheet-handover { display: grid; grid-template-columns: 1fr 1fr auto; gap: 2mm 5mm; align-items: center; font-size: 8.5pt; background: #f4f1e8; border-radius: 2mm; padding: 2mm 3mm; margin-bottom: 4mm; }
.sheet-handover-to { text-align: right; }
.sheet-lines { height: 22mm; background: repeating-linear-gradient(#fff 0 6.5mm, #bbb 6.5mm 6.8mm); }
.sheet-design h3 { font-size: 12pt; margin-bottom: 2mm; display: flex; gap: 2mm; align-items: center; }
.sheet-design h3 span { display: inline-grid; place-items: center; width: 6mm; height: 6mm; border-radius: 50%; background: #111; color: #fff; font-size: 8pt; }
.sheet-table { width: 100%; border-collapse: collapse; margin-bottom: 2mm; font-size: 9pt; }
.sheet-table th, .sheet-table td { border: 1px solid #ccc; padding: 1mm 1.5mm; text-align: left; }
.sheet-table th { background: #f2f2f2; font-weight: 600; width: 1%; white-space: nowrap; }
.sheet-table td.blank { min-width: 16mm; }
.threads-table th { width: auto; }
.sheet-files, .sheet-notes { font-size: 8.5pt; margin: 1mm 0 0; }
.sheet-notes { background: #fff7e0; padding: 1.5mm 2mm; border-radius: 1.5mm; }
.sheet-block { margin: 4mm 0; break-inside: avoid; }
.sheet-block h3 { font-size: 10.5pt; margin-bottom: 2mm; }
.sheet-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2mm; margin-top: 5mm; break-inside: avoid; }
.sheet-step { border: 1px solid #999; border-radius: 2mm; padding: 2mm; min-height: 22mm; display: flex; flex-direction: column; gap: 1mm; }
.sheet-step span { font-weight: 800; font-size: 9pt; }
.sheet-step small { color: #666; font-size: 7pt; margin-top: auto; }
@media screen and (max-width: 820px) { .sheet { width: auto; margin: 0; padding: 1rem; min-height: 0; } .sheet-head { grid-template-columns: 1fr; } .sheet-design, .sheet-design.two-imgs, .sheet-handover { grid-template-columns: 1fr; } .sheet-handover-to { text-align: left; } .sheet-steps { grid-template-columns: 1fr 1fr; } }
@media print {
  @page { size: A4; margin: 0; }
  .no-print { display: none !important; }
  .sheet-body { background: #fff; }
  .sheet { margin: 0; box-shadow: none; width: 210mm; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.check input[type=checkbox] { width: 18px; height: 18px; flex: none; }
.sheet-block .sheet-table th { width: auto; }
.stack > .row-actions.end { align-self: stretch; }

/* Simulación automática */
.generator { border-top: 1px dashed var(--line); padding-top: .6rem; }
.generator > summary { cursor: pointer; font-weight: 600; color: var(--accent); display: inline-flex; gap: .4rem; align-items: center; list-style: none; }
.generator > summary::-webkit-details-marker { display: none; }
.generator[open] > summary { margin-bottom: .7rem; }
.ai-note { display: flex; gap: .45rem; align-items: flex-start; background: var(--olive-soft); color: #2c3a57; border-radius: 8px; padding: .55rem .7rem; font-size: .86rem; margin: 0; }
.ai-note .icon { margin-top: 2px; color: var(--olive); }
.is-busy { opacity: .7; pointer-events: none; }
.busy-msg { display: inline-flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .88rem; }
.busy-msg::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.image-frame { position: relative; }
.image-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.image-frame .thumb-empty { position: absolute; inset: 0; justify-content: center; }

/* Quitar fondo del logo */
.bg-tool { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; background: var(--surface-2); display: flex; flex-direction: column; gap: .6rem; }
.bg-status { margin: 0; font-size: .9rem; display: flex; gap: .45rem; align-items: center; }
.ok-dot, .warn-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--success); }
.warn-dot { background: var(--warning); }
.bg-ask { font-weight: 600; }
.bg-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid #0003; vertical-align: -2px; margin-left: .2rem; }
.bg-options { display: flex; flex-direction: column; gap: .6rem; }
.small-seg label span { padding: .4rem; font-size: .8rem; }
.bg-tool input[type=range] { padding: 0; accent-color: var(--accent); }
.bg-previews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.bg-previews figure { margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.bg-previews canvas { width: 100%; height: 110px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: crosshair; }
.bg-previews .checker canvas { background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 14px 14px; cursor: default; }
.bg-previews .on-dark canvas { background: #1f2c4f; cursor: default; }
.bg-previews figcaption { font-size: .72rem; color: var(--muted); line-height: 1.25; }
@media (max-width: 600px) { .bg-previews { grid-template-columns: 1fr 1fr; } }

/* Aprobación de diseños */
.approval-bar { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid #c9dcfb; border-radius: var(--radius); padding: .55rem .85rem; margin-bottom: 1.1rem; color: #6d3a12; }
.approval-bar span { flex: 1 1 260px; }
.approval-panel { border: 1px solid var(--line); border-left: 4px solid var(--warning); background: var(--surface); border-radius: var(--radius); padding: .85rem 1.1rem; margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: .5rem; box-shadow: var(--shadow); }
.approval-panel.tone-success { border-left-color: var(--success); }
.approval-panel.tone-danger { border-left-color: var(--danger); }
.approval-panel.tone-neutral { border-left-color: var(--muted); }
.approval-head { display: flex; flex-direction: column; }
.approval-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.reject-note { margin: .3rem 0 0 .2rem; padding: .45rem .7rem; background: var(--danger-soft); border-radius: 8px; font-size: .88rem; }
.reject-note p { margin: .15rem 0 0; }
.pick-designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; }
.pick-design { display: flex; gap: .6rem; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; cursor: pointer; background: var(--surface-2); }
.pick-design:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick-design.disabled { opacity: .55; cursor: not-allowed; }
.pick-img { width: 64px; height: 64px; border-radius: 6px; background: var(--line-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.pick-img img { width: 100%; height: 100%; object-fit: contain; }
.pick-txt { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pick-txt small { color: var(--muted); }

/* Página pública de aprobación */
.ap-wrap { width: min(760px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; padding: 1rem 0 2rem; }
.ap-header { display: flex; gap: .8rem; align-items: center; justify-content: center; }
.ap-header img { border-radius: 50%; }
.ap-header strong { display: block; font-family: var(--display); font-size: 1.2rem; color: var(--olive); }
.ap-header small { color: var(--muted); font-style: italic; }
.ap-intro { text-align: center; }
.ap-intro h1 { margin: .1rem 0 .4rem; }
.ap-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; box-shadow: var(--shadow); scroll-margin-top: 1rem; }
@media (max-width: 640px) { .ap-item { grid-template-columns: 1fr; } }
.ap-imgs { display: grid; gap: .5rem; }
.ap-imgs figure { margin: 0; }
.ap-imgs img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.ap-imgs figcaption { font-size: .75rem; color: var(--muted); text-align: center; }
.ap-body h2 { font-family: var(--display); font-size: 1.3rem; margin-bottom: .2rem; }
.ap-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .8rem 0; }
.ap-opt input { position: absolute; opacity: 0; }
.ap-opt span { display: flex; gap: .4rem; align-items: center; justify-content: center; padding: .8rem .5rem; border-radius: 10px; border: 2px solid var(--line); font-weight: 700; cursor: pointer; text-align: center; background: var(--surface-2); }
.ap-opt.ok input:checked + span { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.ap-opt.no input:checked + span { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.ap-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.ap-reject { display: none; flex-direction: column; gap: .5rem; padding: .7rem; border-radius: 10px; background: var(--danger-soft); }
.ap-item:has(.ap-opt.no input:checked) .ap-reject { display: flex; }
.ap-q { font-weight: 700; margin: 0; }
.ap-reasons { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.ap-reject .field span { font-weight: 600; font-size: .88rem; }
.ap-send { align-self: center; min-width: 260px; }
.ap-thanks { text-align: center; background: var(--surface); border-radius: 14px; padding: 1.5rem; border: 1px solid var(--line); color: var(--info); }
.ap-thanks.ok { color: var(--success); }
.ap-thanks h2 { font-family: var(--display); font-size: 1.4rem; margin: .4rem 0; color: var(--ink); }
.ap-foot { text-align: center; color: var(--muted); font-size: .8rem; }

/* Contraseña visible / oculta y recuperación */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 2.8rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: .35rem; border-radius: 6px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover { color: var(--accent); background: var(--accent-soft); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-forgot { text-align: center; margin: 1rem 0 0; font-size: .88rem; }
.login-card .hint { margin-top: .7rem; }
.brand-text small { line-height: 1.3; max-width: 150px; }

/* Selector de logos ya subidos */
.logo-pick { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.logo-pick legend { font-size: .84rem; font-weight: 600; color: var(--ink-2); margin-bottom: .4rem; padding: 0; }
.logo-options { display: flex; flex-wrap: wrap; gap: .45rem; }
.logo-opt { position: relative; display: flex; align-items: center; border: 2px solid var(--line); border-radius: 10px; padding: .45rem .7rem; cursor: pointer; background: var(--surface); min-width: 0; max-width: 100%; }
.logo-opt input { position: absolute; opacity: 0; pointer-events: none; }
.logo-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.logo-opt:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-soft); }
.logo-opt.upload { border-style: dashed; }
.logo-cap { display: flex; flex-direction: column; min-width: 0; font-size: .82rem; line-height: 1.25; }
.logo-cap b { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.logo-cap small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
/* Vista previa del logo al pasar el ratón (o al enfocar con el teclado) */
.logo-preview { display: none; position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: 168px; height: 168px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); background: repeating-conic-gradient(#e9e9e9 0 25%, #fff 0 50%) 0 0 / 14px 14px; pointer-events: none; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-opt:hover .logo-preview, .logo-opt:has(input:focus-visible) .logo-preview { display: block; }
@media (hover: none) { .logo-opt:has(input:checked) .logo-preview { display: block; position: static; transform: none; width: 64px; height: 64px; margin-left: .6rem; padding: 4px; box-shadow: none; } }
.logo-pick:not(:has(input[value=upload]:checked)) .logo-upload { display: none; }

/* Resultado real a partir del paso 3 */
.image-pair.single { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 700px) { .image-pair.single { grid-template-columns: 1fr; } }
.result-later { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.1rem; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); }
.result-later strong { color: var(--ink-2); }
.result-later p { margin: .2rem 0 0; font-size: .88rem; }
.goods-choice { margin: 0; }
.stack.ap-form > .ap-send { align-self: center; }

/* Archivos del cliente */
.files-filters { padding: 1rem 1rem 0; margin-bottom: .5rem; }
.files-filters input[type=search] { flex: 1 1 240px; width: auto; }
.files-count { padding: 0 1rem .6rem; margin: 0; }
.files-table .group-row td { background: var(--surface-2); font-weight: 600; padding-top: .55rem; padding-bottom: .55rem; }
.files-table .group-row a { color: inherit; text-decoration: none; }
.files-table .file-thumb { width: 56px; padding-right: 0; }
.files-table .file-thumb img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: block; }
.files-table .file-ext { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font: 700 .7rem var(--mono); color: var(--muted); }
.files-table tr.old-version td { opacity: .62; }
.files-table .mobile-only { display: none; }
@media (max-width: 720px) {
  .files-table th:nth-child(n+3):nth-child(-n+6), .files-table td:nth-child(n+3):nth-child(-n+6) { display: none; }
  .files-table .group-row td { display: table-cell !important; }
  .files-table .mobile-only { display: block; margin-top: .3rem; }
  .files-table td { padding-left: .6rem; padding-right: .6rem; }
}

/* Fotos de prendas y calibración */
.photo-group { font-size: .95rem; margin: .8rem 0 .5rem; }
.photo-group:first-child { margin-top: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
.photo-card { display: flex; flex-direction: column; gap: .35rem; border: 1px solid var(--line); border-radius: 10px; padding: .45rem; text-decoration: none; color: inherit; background: var(--surface); }
.photo-card:hover { border-color: var(--accent); }
.photo-card.inactive { opacity: .55; }
.photo-img { height: 120px; display: grid; place-items: center; background: #fff; border-radius: 6px; overflow: hidden; }
.photo-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-cap { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; }
.photo-cap small { color: var(--muted); }
.hint-box { margin-top: 1rem; padding: .8rem 1rem; border-radius: 10px; background: var(--surface-2); font-size: .85rem; }
.hint-box ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.calib-svg { width: 100%; max-width: 560px; display: block; margin: 0 auto; border: 1px solid var(--line); border-radius: 10px; touch-action: none; cursor: grab; background: #fff; }
.calib-svg:active { cursor: grabbing; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }

/* Módulo de simulación en el formulario del diseño */
.sim-module { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 1.2rem; align-items: start; }
.sim-preview { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .3rem; align-items: center; }
.sim-preview img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.sim-preview .thumb-empty { width: 100%; aspect-ratio: 400 / 420; border-radius: 10px; }
.text-pick { border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .7rem; }
.text-pick legend { font-weight: 600; padding: 0 .3rem; }
.text-lines-inputs { display: grid; gap: .4rem; }
.text-sample { border-radius: 10px; padding: .8rem 1rem; text-align: center; font-size: 1.9rem; line-height: 1.2; overflow-wrap: anywhere; }
.text-sample small { display: block; font: .72rem var(--font, sans-serif); color: var(--muted); margin-top: .4rem; }
.text-lines { font-weight: 600; }
@media (max-width: 820px) { .sim-module { grid-template-columns: 1fr; } .sim-preview { position: static; max-width: 320px; margin: 0 auto; } }

.font-grid { display: grid; gap: .35rem; }
.font-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) 1fr auto; gap: .8rem; align-items: center; padding: .35rem .5rem; border-radius: 8px; background: var(--surface-2); }
.font-sample { font-size: 1.45rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-meta { display: flex; flex-direction: column; font-size: .82rem; min-width: 0; }
.font-meta small { color: var(--muted); }
.m-specs .m-span { grid-column: 1 / -1; }
.sheet-text { background: #eef3e6 !important; }

/* Paso 3: muestra real en la pestaña Producción */
.sample-panel { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; margin: .8rem 0; background: var(--surface-2); }
.sample-panel h3 { display: flex; align-items: center; gap: .4rem; font-size: 1rem; margin: 0 0 .2rem; }
.sample-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .5rem; }
.sample-list li { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .6rem; }
.sample-thumbs { display: flex; gap: .3rem; }
.sample-thumbs img, .sample-thumbs .thumb-empty.small { width: 54px; height: 54px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; font-size: .6rem; text-align: center; }
.sample-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.sample-info small { color: var(--muted); }
@media (max-width: 600px) { .sample-list li { grid-template-columns: auto 1fr; } .sample-list li form { grid-column: 1 / -1; } }


/* ------------------------------------------------------------ Uso rápido (tareas, «qué toca ahora», deshacer) */
.section-title { font-size: 1.05rem; margin: 1.4rem 0 .7rem; color: var(--muted); font-weight: 600; }
.task-list .task-text { font-size: 1.02rem; }
.task-list small { display: block; margin-top: .15rem; }
.list-side { flex-wrap: wrap; justify-content: flex-end; }
.due { display: inline-flex; align-items: center; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--muted); padding: .15rem .5rem; border-radius: 999px; background: var(--line-2); white-space: nowrap; }
.due-late { color: #fff; background: #b3261e; }
.due-today { color: #fff; background: var(--accent); }
.due-soon { color: var(--accent); background: var(--accent-soft); }
.now-card { border-color: var(--line); border-left: 3px solid var(--accent); }
.now-head { display: flex; gap: .75rem; align-items: center; margin-bottom: .7rem; }
.now-head strong { display: block; font-size: 1.02rem; font-weight: 600; line-height: 1.3; }
.now-head small { display: block; color: var(--muted); margin-top: .15rem; }
.now-card .btn-xl { min-height: 52px; }
.now-card .details { margin-top: .4rem; }
.manual-approval > summary { font-weight: 600; }
.count-box { padding: .8rem 1rem; border-radius: 10px; background: var(--accent-soft); }
.count-box p { margin: 0 0 .5rem; }
.count-box input { font-size: 1.3rem; max-width: 10rem; }
.undo-bar { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .7rem 1rem; margin-bottom: 1rem; border-radius: 10px; background: var(--success-soft); border: 1px solid #b8e0cb; color: #2f4a22; }
.undo-bar span { flex: 1; min-width: 12rem; }
.undo-bar .inline-form { margin: 0; }
.stepper li.skipped { opacity: .55; }
.stepper li.skipped .dot { border-style: dashed; }
.more-card { padding: 0; }
.more-card > summary { cursor: pointer; list-style: none; }
.more-card > summary::-webkit-details-marker { display: none; }
.more-card > summary h2::before { content: "▸ "; color: var(--muted); }
.more-card[open] > summary h2::before { content: "▾ "; }
.more-card h2 small { font-weight: 500; font-size: .8rem; }
.more-card .card { box-shadow: none; border: 0; margin: 0; }
.more-card .card .card-header { padding-left: 0; padding-right: 0; }
.scan-panel { margin-top: 0; }
/* Botones y campos más fáciles de tocar en el móvil */
@media (max-width: 700px) {
  .btn { min-height: 46px; }
  .btn-sm { min-height: 40px; }
  input, select, textarea { font-size: 16px; }
  .now-head strong { font-size: 1.05rem; }
  .list-side { flex-direction: column; align-items: flex-end; gap: .25rem; }
}
.card-body > .form-grid + .field, .card-body > datalist + .field { margin-top: 1rem; }

/* ------------------------------------------------------------ Vista previa con el marcaje arrastrable y «+» producto */
.sim-live { width: 100%; border-radius: 8px; overflow: hidden; background: #f1f3f7; transition: opacity .15s; }
.sim-live svg { display: block; width: 100%; height: auto; touch-action: none; }
.sim-live.is-loading { opacity: .65; }
.sim-draggable { cursor: grab; }
.sim-draggable:focus { outline: none; }
.sim-draggable:focus-visible { outline: 2px dashed var(--accent); }
.sim-draggable.is-dragging { cursor: grabbing; opacity: .85; }
.sim-live-hint { margin: .5rem 0 0; display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.select-plus { display: flex; gap: .4rem; align-items: stretch; }
.select-plus select { flex: 1; min-width: 0; }
.btn-plus { padding-left: .7rem; padding-right: .7rem; }
.add-product { padding: .9rem 1rem; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); }
.add-product p { margin: 0 0 .5rem; }
/* Las capas de luz y textura van encima del marcaje: que no tapen el arrastre */
.sim-live svg * { pointer-events: none; }
.sim-live svg #mk-mark, .sim-live svg #mk-mark * { pointer-events: auto; }
/* Foto de producto → modo diseño */
.pp-pick { align-self: flex-start; }
.pp-previews { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pp-previews figure { margin: 0; padding: .4rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: center; }
.pp-previews canvas { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.pp-previews figcaption { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.pp-previews .checker { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.product-thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #f1f3f7; margin-right: .6rem; }
.sim-size { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .35rem .45rem; width: 100%; margin-top: .6rem; }
.sim-size > span { grid-column: 1 / -1; font-weight: 600; }
.sim-size input[type=range] { width: 100%; min-width: 0; }
.sim-size .btn-sm { min-width: 2.2rem; justify-content: center; padding: .2rem .5rem; }
.sim-size output { min-width: 3.2rem; text-align: right; }
.package-grid { margin-top: .5rem; }
.details.rename > summary { font-size: .8rem; font-weight: 500; color: var(--muted); }

/* Mercancía del cliente: formulario de prendas previstas más compacto */
.compact-stack { gap: .6rem; }
.compact-stack .line-rows { margin-bottom: 0; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.pad > .hint:first-child { margin-bottom: .6rem; }
.no-pad-bottom { padding-bottom: 0; }

/* ------------------------------------------------------------------ Aprobación del cliente: una sola decisión */
.approval-choice { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: .7rem .8rem; margin: .2rem 0 .6rem; }
.approval-choice-title { font-weight: 600; font-size: .9rem; margin: 0 0 .55rem; display: flex; gap: .45rem; align-items: center; }
.approval-choice-title .icon { color: var(--accent); }
.approval-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.approval-option { display: flex; flex-direction: column; gap: .45rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem .75rem; min-width: 0; }
.approval-option > strong, .approval-option > b { font-size: .84rem; font-weight: 600; display: flex; gap: .4rem; align-items: center; }
.approval-option > small, .approval-option p { color: var(--muted); font-size: .78rem; margin: 0; }
.approval-option form { display: flex; flex-direction: column; gap: .45rem; margin: 0; }
.approval-option .btn { align-self: flex-start; }
@media (max-width: 760px) { .approval-options { grid-template-columns: 1fr; } }
.early-sample { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: .5rem .75rem; background: var(--surface); }
.early-sample > summary { color: var(--ink-2); }
.early-sample[open] { background: var(--surface-2); }


/* Hilos usados en la muestra real (ficha del diseño y vista móvil del taller) */
.sample-adjust .thread-rows { margin: 0 0 .3rem; }
.m-thread-edit { margin: .4rem 0 .6rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.m-thread-edit[open] { background: var(--surface); }
.m-thread-edit .row-actions .btn { min-height: 40px; }
.sample-adjust .subhead { margin: .2rem 0 .45rem; }
.sample-measures { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; }
.sample-measures .field { width: 120px; }
.sample-measures .times { padding-bottom: .5rem; color: var(--muted); font-weight: 600; }
.sample-measures small { padding-bottom: .55rem; }
.sample-measures .sample-font { width: 220px; }
.sample-text-lines { margin: 0 0 .35rem; }

/* Configuración → Catálogos: orden con flechas */
.catalog-hint { padding-bottom: 0; margin: 0; }
.catalog-list .list-row { gap: .5rem; }
.order-btns { display: inline-flex; gap: 2px; flex: none; }
.order-btn { color: var(--muted); border: 1px solid var(--line); background: var(--surface); width: 26px; height: 26px; padding: 0; }
.order-btn:hover:not([disabled]) { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.order-btn[disabled] { opacity: .3; cursor: default; }
.catalog-list .list-main { flex: 1; }

/* Configuración → Usuarios */
.users-table select { width: auto; min-width: 170px; }
.users-table td { vertical-align: middle; }
td.user-actions { white-space: normal; }
td.user-actions > * { margin: .15rem .4rem .15rem 0; }
.user-actions details[open] { display: block; min-width: 260px; max-width: 360px; padding: .5rem 0; }
.new-user-card { max-width: 560px; }

/* Detalle ampliado del marcaje (bajo la simulación, en la ficha del diseño) */
.detail-frame { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.detail-frame a { flex: 0 0 auto; }
.detail-frame img { width: 180px; height: auto; display: block; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.detail-frame small { font-size: .8rem; line-height: 1.35; }

/* Instrucciones numeradas dentro de un desplegable */
.small-list { margin: .5rem 0 .25rem 1.2rem; padding: 0; font-size: .875rem; line-height: 1.5; color: var(--ink); }
.small-list li { margin: .15rem 0; }

/* ------------------------------------------------------------------ Inicio: aprobaciones de los clientes */
.approvals-hub { border-radius: 12px; overflow: hidden; margin-bottom: 1rem; border: 1px solid #e7c9ad; background: #fffaf5; box-shadow: 0 1px 2px rgba(17,24,39,.05), 0 12px 30px -14px rgba(169,87,29,.35); }
.ah-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .95rem 1.1rem; color: #fff; background: linear-gradient(120deg, #a9571d 0%, #c8692a 55%, #e39a4b 100%); }
.ah-title { display: flex; align-items: center; gap: .7rem; }
.ah-title > svg { flex: 0 0 auto; padding: .45rem; box-sizing: content-box; background: rgba(255,255,255,.18); border-radius: 50%; }
.ah-title h2 { margin: 0; font-size: 1.15rem; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.ah-title p { margin: .1rem 0 0; font-size: .82rem; color: rgba(255,255,255,.85); }
.ah-counts { display: flex; flex-wrap: wrap; gap: .4rem; }
.ah-count { display: inline-flex; align-items: baseline; gap: .3rem; padding: .3rem .7rem; border-radius: 999px; background: #fff; font-size: .82rem; font-weight: 500; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.ah-count b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ah-count small { color: var(--muted); font-size: .72rem; }
.ah-count.ah-changes b { color: var(--danger); }
.ah-count.ah-approved b { color: var(--success); }
.ah-count.ah-waiting b { color: #b45309; }
.ah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .6rem; padding: .9rem; }
.ah-item { display: flex; gap: .65rem; padding: .6rem; background: #fff; border: 1px solid var(--line); border-left: 4px solid; border-radius: 8px; color: var(--ink); text-decoration: none !important; transition: box-shadow .15s, transform .15s; }
.ah-item:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.ah-item.ah-changes { border-left-color: var(--danger); background: #fffafa; }
.ah-item.ah-approved { border-left-color: var(--success); }
.ah-item.ah-waiting { border-left-color: #f59e0b; }
.ah-thumb { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; background: var(--line-2); display: grid; place-items: center; color: var(--muted); }
.ah-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ah-text { display: flex; flex-direction: column; min-width: 0; gap: .05rem; }
.ah-text strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-text small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-text em { font-size: .8rem; color: #991b1b; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ah-top { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.ah-status { display: inline-flex; align-items: center; gap: .2rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .1rem .4rem; border-radius: 4px; }
.ah-changes .ah-status { color: #991b1b; background: var(--danger-soft); }
.ah-approved .ah-status { color: #166534; background: var(--success-soft); }
.ah-waiting .ah-status { color: #92400e; background: #fef3c7; }
.ah-stage { font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: .05rem .35rem; }
.ah-when { margin-top: auto; }
.ah-empty, .ah-more { margin: 0; padding: .9rem 1.1rem; color: var(--ink-2); font-size: .9rem; }
.ah-more { padding-top: 0; }
@media (max-width: 600px) { .ah-grid { grid-template-columns: 1fr; padding: .6rem; } .ah-head { padding: .8rem; } }
