/* DESVELO — panel de administración */
:root {
  --bg: #EFEFEB;
  --card: #FFFFFF;
  --line: #E1E1DB;
  --line-2: #EDEDE8;
  --ink: #16181D;
  --ink-2: #4E525B;
  --ink-3: #7C808A;
  --side: #1E2638;
  --side-2: #29334A;
  --side-ink: #C9CEDA;
  --sodio: #E8651A;
  --sodio-soft: #FDEBDF;
  --s1: #3A5BA8;          /* serie: ingresos / ventas */
  --s1-soft: rgba(58, 91, 168, .12);
  --s2: #E8651A;          /* serie: egresos */
  --ok: #2E7D4F; --ok-soft: #E3F2E8;
  --warn: #9A6200; --warn-soft: #FFF2D6;
  --info: #2F5FA8; --info-soft: #E6EEFA;
  --bad: #B3261E; --bad-soft: #FBE7E5;
  --muted-soft: #EEEEEA;
  --font: 'Archivo', system-ui, sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--sodio); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- login ---------- */
.login { min-height: 100svh; display: grid; place-items: center; background: var(--side); padding: 20px; }
.login-box { width: min(420px, 100%); }
.login-brand { display: flex; align-items: center; gap: 12px; color: #fff; margin-bottom: 28px; }
.login-brand svg { width: 42px; fill: var(--sodio); stroke: var(--sodio); }
.login-brand b { font-weight: 860; font-stretch: 125%; font-size: 26px; letter-spacing: -0.02em; }
.login-brand span { color: var(--side-ink); font-size: 14px; margin-left: 4px; }
.login .card { padding: 28px; }
.login h1 { margin: 0 0 6px; font-weight: 800; font-stretch: 112%; font-size: 22px; }
.login p { margin: 0 0 20px; color: var(--ink-2); }
.login .hint { margin-top: 16px; font-size: 13px; color: var(--side-ink); text-align: center; }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100svh; }
.side { background: var(--side); color: var(--side-ink); padding: 22px 14px; position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 10px 24px; }
.side-brand svg { width: 30px; fill: var(--sodio); stroke: var(--sodio); }
.side-brand b { font-weight: 860; font-stretch: 125%; font-size: 19px; letter-spacing: -0.02em; }
.side-brand span { font-size: 12px; color: var(--side-ink); font-weight: 500; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none; font-weight: 550; font-size: 14px; transition: background .15s, color .15s; }
.side nav a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; flex: 0 0 auto; }
.side nav a:hover { background: var(--side-2); color: #fff; }
.side nav a[aria-current="page"] { background: #fff; color: var(--ink); }
.side nav a .badge { margin-left: auto; background: var(--sodio); color: #fff; font-size: 11.5px; font-weight: 700; min-width: 22px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.side nav a[aria-current="page"] .badge { background: var(--sodio); }
.side nav a .badge[hidden] { display: none; }
.side-foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid var(--side-2); padding-top: 12px; }
.side-foot a, .side-foot button { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none; font-weight: 550; font-size: 14px; background: none; border: 0; color: var(--side-ink); text-align: left; }
.side-foot a:hover, .side-foot button:hover { background: var(--side-2); color: #fff; }
.side-foot svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 12px 4px; font-size: 13px; }
.side-user i { width: 30px; height: 30px; border-radius: 50%; background: var(--sodio); color: #fff; font-style: normal; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.side-user small { display: block; color: #8d95a8; font-size: 12px; }
.main { min-width: 0; padding: 26px 32px 60px; }
.mtop { display: none; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { margin: 0; font-weight: 820; font-stretch: 116%; font-size: 28px; letter-spacing: -0.025em; line-height: 1.1; }
.head p { margin: 4px 0 0; color: var(--ink-2); }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--ink-3); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.crumb:hover { color: var(--ink); }

/* ---------- piezas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 700; }
.card-h a { font-size: 13px; color: var(--ink-2); }
.card-b { padding: 16px 20px 20px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g21 { grid-template-columns: 2fr 1fr; }
.g12 { grid-template-columns: 1fr 1.25fr; }
.span2 { grid-column: span 2; }
.kpi { padding: 18px 20px; }
.kpi .label { font-size: 13px; color: var(--ink-2); font-weight: 550; }
.kpi .value { font-weight: 800; font-stretch: 108%; font-size: 27px; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12.5px; margin-top: 2px; color: var(--ink-3); }
.delta .up { color: var(--ok); font-weight: 650; }
.delta .down { color: var(--bad); font-weight: 650; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 650; font-size: 13.5px; text-decoration: none; white-space: nowrap; transition: background .15s; }
.btn:hover { background: #2B2E36; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn.light { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.light:hover { background: #F6F6F3; }
.btn.accent { background: var(--sodio); border-color: var(--sodio); color: #1d0b02; }
.btn.accent:hover { background: #f27a33; }
.btn.danger { background: var(--card); color: var(--bad); border-color: #EBC5C1; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--sodio-soft); color: #A9480F; }
.pill.muted { background: var(--muted-soft); color: var(--ink-3); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.tag-mini { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 6px; background: var(--muted-soft); color: var(--ink-2); }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); vertical-align: middle; }
.sws { display: inline-flex; gap: 4px; margin-left: 2px; }

/* tablas */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFAF8; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.link { cursor: pointer; transition: background .12s; }
.t tbody tr.link:hover { background: #F8F8F5; }
.t .r { text-align: right; }
.thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--bg); overflow: hidden; display: grid; place-items: center; flex: 0 0 auto; }
.thumb img { width: 120%; max-width: none; margin-top: 18%; }
.thumb.sq img { width: 90%; margin: 0; }
.prod-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.prod-cell b { font-weight: 650; display: block; }
.prod-cell small { color: var(--ink-3); font-size: 12.5px; }
.card .t th:first-child, .card .t td:first-child { padding-left: 20px; }
.card .t th:last-child, .card .t td:last-child { padding-right: 20px; }
.card > .table-wrap:first-child table th:first-child { border-top-left-radius: var(--radius); }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }

/* barra de herramientas */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; }
.search input { height: 38px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 0 12px 0 34px; width: 260px; max-width: 100%; }
.search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; stroke: var(--ink-3); fill: none; stroke-width: 2; }
.toolbar select, .field select, .field input, .field textarea { height: 38px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 0 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button, .tabs a { background: none; border: 0; padding: 10px 12px; font-weight: 600; font-size: 13.5px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs [aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
.tabs .count { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }
.pager div { display: flex; gap: 6px; }

/* formularios */
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field > span.lab { font-size: 13px; font-weight: 600; }
.field input, .field select { width: 100%; }
.field textarea { width: 100%; height: 90px; padding: 9px 10px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(22,24,29,.06); }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.field.bad input { border-color: var(--bad); }
.err { color: var(--bad); font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.money-in { position: relative; }
.money-in input { padding-left: 24px; }
.money-in::before { content: '$'; position: absolute; left: 11px; top: 9px; color: var(--ink-3); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: #CFCFC9; position: relative; transition: background .2s; margin: 0; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(16px); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); margin-top: 2px; }

/* editor de producto */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.editor .card + .card { margin-top: 16px; }
.preview { position: sticky; top: 20px; }
.color-row { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 14px; }
.color-row + .color-row { margin-top: 12px; }
.color-meta { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: end; }
.color-meta input[type="color"] { width: 100%; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.slots { display: flex; gap: 10px; grid-column: 1 / -1; }
.slot { flex: 1; position: relative; border: 1.5px dashed #C7C7C0; border-radius: 12px; min-height: 180px; display: grid; place-items: center; text-align: center; padding: 10px; background: repeating-conic-gradient(#F3F3F0 0% 25%, #FAFAF8 0% 50%) 50% / 18px 18px; transition: border-color .2s, background-color .2s; }
.slot.drag { border-color: var(--sodio); }
.slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.slot .slot-empty { font-size: 13px; color: var(--ink-2); pointer-events: none; }
.slot .slot-empty b { display: block; color: var(--ink); margin-bottom: 4px; }
.slot .slot-empty svg { width: 26px; height: 26px; stroke: var(--ink-3); fill: none; stroke-width: 1.6; margin: 0 auto 6px; display: block; }
.slot img { max-height: 200px; width: auto; pointer-events: none; filter: drop-shadow(0 8px 8px rgba(0,0,0,.15)); }
.slot .slot-state { position: absolute; left: 8px; bottom: 8px; font-size: 11.5px; background: rgba(255,255,255,.92); padding: 3px 8px; border-radius: 6px; pointer-events: none; }
.slot .slot-x { position: absolute; top: 6px; right: 6px; z-index: 2; background: #fff; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; padding: 2px 8px; }
.slot .bar { position: absolute; left: 12px; right: 12px; bottom: 34px; height: 4px; background: #E5E5E0; border-radius: 2px; overflow: hidden; pointer-events: none; }
.slot .bar i { display: block; height: 100%; width: 30%; background: var(--sodio); animation: load 1.1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(330%); } }
.stock-grid { overflow-x: auto; }
.stock-grid table { border-collapse: collapse; font-size: 13.5px; }
.stock-grid th, .stock-grid td { padding: 6px 8px; text-align: center; }
.stock-grid th { font-weight: 600; color: var(--ink-3); font-size: 12.5px; }
.stock-grid td:first-child, .stock-grid th:first-child { text-align: left; padding-left: 0; white-space: nowrap; }
.stock-grid input { width: 64px; height: 34px; text-align: center; border: 1px solid var(--line); border-radius: 8px; }
.size-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.savebar { position: sticky; bottom: 0; margin: 18px -32px -60px; padding: 14px 32px; background: rgba(239,239,235,.94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; z-index: 5; }
.savebar .msg { margin-right: auto; font-size: 13px; color: var(--ink-2); }

/* mini parchero de vista previa */
.mini-wall { --gw: 150px; background: #E3E4E0; border-radius: 12px; overflow: hidden; position: relative; padding: 24px 0 8px; }
.mini-rack { position: relative; display: flex; justify-content: center; padding-top: calc(var(--gw) * .1); min-height: calc(var(--gw) * 1.55); }
.mini-rack .rail { position: absolute; left: 10px; right: 10px; top: calc(var(--gw) * .03 - 4px); height: 8px; border-radius: 4px; background: linear-gradient(180deg, #fbfcfa 0%, #d4d7d8 28%, #8f9498 58%, #c9cccd 82%, #8b8f93 100%); box-shadow: 0 5px 8px -3px rgba(22,24,29,.25); z-index: 2; }
.mg { position: relative; flex: 0 0 auto; width: calc(var(--gw) * .2); height: calc(var(--gw) * 1.5); z-index: 3; }
.mg .card2 { position: absolute; left: 50%; top: 0; width: var(--gw); margin-left: calc(var(--gw) / -2); transform-origin: 50% 0; transform: perspective(900px) rotateY(-79deg); filter: brightness(.82); }
.mg.front { width: calc(var(--gw) * 1.02); }
.mg.front .card2 { transform: none; filter: none; animation: mswing 1.8s ease both; }
@keyframes mswing { 0% { transform: rotate(0); } 20% { transform: rotate(2.5deg); } 45% { transform: rotate(-1.6deg); } 70% { transform: rotate(.6deg); } 100% { transform: rotate(0); } }
.mg .hook { position: absolute; left: 50%; width: calc(var(--gw) * .1); margin-left: calc(var(--gw) * -.05); top: calc(var(--gw) * -.09); height: calc(var(--gw) * .14); }
.mg .ph { position: relative; z-index: 1; aspect-ratio: 2/3; filter: drop-shadow(0 12px 10px rgba(22,24,29,.2)); }
.mg .ph img { width: 100%; height: 100%; object-fit: contain; }
.mg .ph .ph-empty { position: absolute; inset: 8% 14% 30%; border: 1.5px dashed #9da0a6; border-radius: 10px; display: grid; place-items: center; font-size: 11px; color: #6c7078; text-align: center; padding: 6px; background: rgba(255,255,255,.4); }
.mini-shelf { display: flex; justify-content: center; align-items: flex-end; gap: 10px; padding: 20px 14px 0; min-height: 200px; position: relative; }
.mini-shelf::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 12px; border-radius: 3px; background: linear-gradient(180deg, #c49a6c, #a5774a 60%, #8a6038); }
.mini-shelf .it { width: 100px; } .mini-shelf .it.front { width: 150px; }
.mini-shelf img { width: 100%; }
.preview-cap { text-align: center; font-size: 13px; padding: 10px 14px 4px; }
.preview-cap b { display: block; font-size: 14px; }

/* gráficos */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-l { stroke: #ECECE7; stroke-width: 1; }
.chart .axis-t { font-size: 11.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .lbl { font-size: 12px; fill: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .lbl-name { font-size: 13px; fill: var(--ink); }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .12s; z-index: 4; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.tip.on { opacity: 1; }
.tip b { font-weight: 700; display: block; font-variant-numeric: tabular-nums; }
.tip .k { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.tip .k i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); padding: 0 20px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* listas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .grow small { color: var(--ink-3); font-size: 12.5px; }
.queue { display: grid; gap: 10px; }
.queue a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #F7F7F4; text-decoration: none; border: 1px solid var(--line-2); transition: border-color .15s; }
.queue a:hover { border-color: var(--ink-3); }
.queue a b { font-size: 24px; font-weight: 800; font-stretch: 108%; font-variant-numeric: tabular-nums; }
.queue a span { font-weight: 600; }
.queue a small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12.5px; }

/* detalle de pedido */
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.items .it { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); align-items: center; }
.items .it:last-child { border-bottom: 0; }
.items .thumb { width: 56px; height: 64px; border-radius: 8px; background: var(--bg); overflow: hidden; display: grid; place-items: center; }
.items .thumb img { width: 125%; max-width: none; margin-top: 22%; }
.items .thumb.sq img { width: 90%; margin: 0; }
.sumrow { display: flex; justify-content: space-between; padding: 5px 0; font-variant-numeric: tabular-nums; }
.sumrow.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: 16px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.timeline li::after { content: ''; position: absolute; left: 4px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline small { display: block; color: var(--ink-3); }
.note-box { background: var(--warn-soft); color: #6b4500; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }

/* modal y aviso */
.modal { position: fixed; inset: 0; background: rgba(16,18,24,.45); display: grid; place-items: center; z-index: 60; padding: 20px; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal-box { background: var(--card); border-radius: 16px; width: min(560px, 100%); max-height: 92vh; overflow: auto; }
.modal-box.wide { width: min(720px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-h h2 { margin: 0; font-size: 17px; font-weight: 750; }
.modal-h button { background: none; border: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.modal-b { padding: 20px 22px; display: grid; gap: 14px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s; z-index: 80; display: flex; gap: 12px; align-items: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: #ffb58a; }
.demo-banner { background: var(--sodio-soft); border: 1px solid #F6CDB2; color: #7a3a0f; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.demo-banner button { background: none; border: 0; font-size: 13px; font-weight: 600; color: #7a3a0f; text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: 1fr 1fr; }
  .g3 > :last-child { grid-column: 1 / -1; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-105%); transition: transform .3s; }
  .side.open { transform: none; box-shadow: 20px 0 40px rgba(0,0,0,.3); }
  .mtop { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 40; }
  .mtop button { background: none; border: 0; color: #fff; display: flex; align-items: center; gap: 8px; font-weight: 600; }
  .mtop svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
  .mtop b { font-weight: 860; font-stretch: 125%; }
  .main { padding: 20px 16px 50px; }
  .g21, .g12, .g2, .order-grid { grid-template-columns: minmax(0, 1fr); }
  .head h1 { font-size: 24px; }
  .search input { width: 100%; }
  .toolbar .search { flex: 1 1 100%; }
  .savebar { margin: 18px -16px -50px; padding: 12px 16px; }
  .slots { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .g4, .g3 { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 22px; }
  .color-meta { grid-template-columns: 1fr 90px; }
  .savebar .msg { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media print { .side, .mtop, .head-actions, .savebar { display: none !important; } .app { display: block; } }
