:root {
  --bg:        oklch(10%   0.020 235);
  --surface:   oklch(13.5% 0.022 238);
  --surface2:  oklch(17%   0.025 240);
  --surface3:  oklch(21%   0.028 242);
  --surface4:  oklch(26%   0.030 240);
  --ink:       oklch(93%   0.012 60);
  --ink-mid:   oklch(72%   0.015 58);
  --ink-muted: oklch(52%   0.012 56);
  --ink-faint: oklch(34%   0.010 54);
  --line:        oklch(23% 0.028 240);
  --line-mid:    oklch(31% 0.032 238);
  --line-bright: oklch(40% 0.038 236);
  --ac:        oklch(76% 0.175 65);
  --ac-mid:    oklch(56% 0.140 65);
  --ac-dim:    oklch(22% 0.070 65);
  --ac-ink:    oklch(13% 0.035 65);
  /* Cotizadas — indigo */
  --co:        oklch(66% 0.220 245);
  --co-dim:    oklch(20% 0.080 245);
  /* Aprobadas — magenta/pink */
  --or:        oklch(64% 0.245 335);
  --or-dim:    oklch(22% 0.085 335);
  /* Entregadas — cyan */
  --te:        oklch(74% 0.160 195);
  --te-dim:    oklch(20% 0.060 195);
  /* Cobradas — emerald */
  --em:        oklch(72% 0.190 145);
  --em-dim:    oklch(20% 0.070 145);
  /* Danger */
  --ru:        oklch(63% 0.220 25);
  --ru-dim:    oklch(20% 0.075 25);
  /* Warning */
  --wa:        oklch(76% 0.180 80);
  --wa-dim:    oklch(22% 0.066 80);
  /* Laser type — violet */
  --pu:        oklch(64% 0.215 290);
  --pu-dim:    oklch(20% 0.075 290);
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --r-xs: 3px; --r-sm: 5px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
  --ff-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --ff-body:    'Epilogue', system-ui, sans-serif;
  --sh-card:  0 2px 8px oklch(0% 0 0 / 0.40), 0 1px 2px oklch(0% 0 0 / 0.30);
  --sh-md:    0 8px 32px oklch(0% 0 0 / 0.55);
  --sh-panel: -10px 0 56px oklch(0% 0 0 / 0.65);
  --gl-ac: 0 0 24px oklch(76% 0.180 65  / 0.34);
  --gl-ru: 0 0 18px oklch(63% 0.220 25  / 0.45);
  --gl-em: 0 0 18px oklch(72% 0.190 145 / 0.36);
  --gl-co: 0 0 18px oklch(66% 0.220 245 / 0.36);
  --gl-or: 0 0 18px oklch(64% 0.245 335 / 0.40);
  --gl-te: 0 0 18px oklch(74% 0.160 195 / 0.36);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--ff-body);
  font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow: hidden;
  background-image:
    radial-gradient(circle at 15% 6%,  oklch(76% 0.180 65  / 0.08) 0%, transparent 40%),
    radial-gradient(circle at 88% 88%, oklch(66% 0.220 245 / 0.07) 0%, transparent 42%),
    radial-gradient(circle at 60% 50%, oklch(64% 0.245 335 / 0.04) 0%, transparent 50%);
}
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; color-scheme: dark; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-mid); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-bright); }

@keyframes card-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse-ru {
  0%, 100% { box-shadow: var(--sh-card), 0 0 6px oklch(63% 0.220 25 / 0.30); }
  50%       { box-shadow: var(--sh-card), 0 0 18px oklch(63% 0.220 25 / 0.55); }
}
@keyframes pulse-wa {
  0%, 100% { box-shadow: var(--sh-card), 0 0 4px oklch(76% 0.180 75 / 0.20); }
  50%       { box-shadow: var(--sh-card), 0 0 14px oklch(76% 0.180 75 / 0.40); }
}
@keyframes scan-line { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 oklch(63% 0.220 25 / 0.6); }
  100%      { box-shadow: 0 0 0 8px oklch(63% 0.220 25 / 0); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.top-line {
  height: 2px; flex-shrink: 0; position: relative; overflow: hidden;
  background: linear-gradient(90deg, var(--ru) 0%, var(--wa) 30%, var(--ac) 55%, var(--co) 80%, var(--em) 100%);
}
.top-line::after {
  content: ''; position: absolute; inset: 0; width: 30%;
  background: linear-gradient(90deg, transparent, oklch(100% 0 0 / 0.45), transparent);
  animation: scan-line 6s linear infinite;
}

.topbar {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 0 var(--sp-5); height: 54px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  flex-shrink: 0; z-index: 10;
}
.tb-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--ac);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-display); font-weight: 800; font-size: .82rem;
  color: var(--ac-ink); letter-spacing: -.5px; box-shadow: var(--gl-ac);
}
.brand-name { font-family: var(--ff-display); font-size: .9rem; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.brand-sub { font-size: .65rem; color: var(--ink-muted); letter-spacing: .03em; }
.tb-sep { width: 1px; height: 22px; background: var(--line-mid); flex-shrink: 0; }
.tb-time {
  font-family: var(--ff-display); font-size: .72rem; font-weight: 600;
  color: var(--ink-mid); letter-spacing: .03em; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tb-time-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--em); margin-right: 6px; vertical-align: 1px;
  box-shadow: 0 0 6px oklch(68% 0.175 158 / 0.7);
}
.tb-search {
  flex: 1; max-width: 280px; display: flex; align-items: center; gap: var(--sp-2);
  padding: 7px var(--sp-3); background: var(--surface2);
  border: 1px solid var(--line); border-radius: var(--r); transition: all .15s;
}
.tb-search:focus-within { border-color: var(--ac); background: var(--surface3); box-shadow: 0 0 0 3px oklch(76% 0.175 65 / 0.10); }
.tb-search input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-size: .8rem; }
.tb-search input::placeholder { color: var(--ink-muted); }
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 3px;
  background: var(--surface3); border: 1px solid var(--line-mid);
  color: var(--ink-muted); font-family: var(--ff-display); font-size: .62rem; font-weight: 600;
}
.tb-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }
.bell {
  position: relative; width: 34px; height: 34px; border-radius: var(--r);
  background: var(--surface2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: var(--ink-mid); transition: all .15s;
}
.bell:hover { background: var(--surface3); border-color: var(--line-mid); color: var(--ink); }
.bell-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  background: var(--ru); color: white; font-size: .58rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--gl-ru);
}
.btn-new {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 8px 16px; background: var(--ac); border: none; border-radius: var(--r);
  color: var(--ac-ink); font-size: .8rem; font-weight: 700;
  font-family: var(--ff-display); letter-spacing: -.1px;
  transition: all .15s cubic-bezier(.25,.46,.45,.94);
  box-shadow: 0 2px 10px oklch(76% 0.175 65 / 0.20);
}
.btn-new:hover { box-shadow: var(--gl-ac), 0 4px 18px oklch(76% 0.175 65 / 0.30); transform: translateY(-1px); }
.btn-new:active { transform: translateY(0); }

.health-bar { display: flex; height: 3px; flex-shrink: 0; }
.hb-seg { transition: flex .6s cubic-bezier(.4,0,.2,1); }
.hb-co { flex: 9;  background: var(--co); }
.hb-or { flex: 4;  background: var(--or); }
.hb-ac { flex: 3;  background: var(--ac); }
.hb-te { flex: 1;  background: var(--te); }
.hb-em { flex: 43; background: var(--em); opacity: .35; }

.stage-summary {
  display: flex; align-items: stretch; background: var(--surface);
  border-bottom: 1px solid var(--line); flex-shrink: 0; overflow-x: auto;
}
.ss-stage {
  flex: 1; min-width: 110px; padding: 11px var(--sp-4);
  display: flex; flex-direction: column; gap: 2px;
  cursor: pointer; transition: background .15s; user-select: none;
  border-right: 1px solid var(--line); position: relative;
}
.ss-stage:last-child { border-right: none; }
.ss-stage:hover { background: var(--surface2); }
.ss-stage.active { background: var(--surface3); }
.ss-stage.active::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.ss-stage[data-stage="cotizada"].active::before  { background: var(--co); box-shadow: var(--gl-co); }
.ss-stage[data-stage="aprobada"].active::before  { background: var(--or); box-shadow: var(--gl-or); }
.ss-stage[data-stage="curso"].active::before     { background: var(--ac); box-shadow: var(--gl-ac); }
.ss-stage[data-stage="entregada"].active::before { background: var(--te); box-shadow: var(--gl-te); }
.ss-stage[data-stage="cobrada"].active::before   { background: var(--em); box-shadow: var(--gl-em); }
.ss-label { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-muted); }
.ss-count { font-size: 1.4rem; font-weight: 800; line-height: 1.05; font-family: var(--ff-display); }
.c-co { color: var(--co); } .c-or { color: var(--or); } .c-ac { color: var(--ac); }
.c-te { color: var(--te); } .c-em { color: var(--em); }
.ss-value { font-size: .7rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

.ss-clear {
  margin-left: var(--sp-3); padding: 0 10px; align-self: center;
  background: var(--surface2); border: 1px solid var(--line-mid); border-radius: var(--r-sm);
  color: var(--ink-mid); font-size: .68rem; height: 26px;
  display: none; align-items: center; gap: 4px;
}
.ss-clear.show { display: inline-flex; }
.ss-clear:hover { color: var(--ink); border-color: var(--line-bright); }

.tab-bar {
  display: flex; align-items: center; padding: 0 var(--sp-5);
  background: var(--surface); border-bottom: 1px solid var(--line);
  gap: 2px; flex-shrink: 0;
}
.tab-btn {
  padding: 11px 14px; background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-muted); font-size: .8rem; font-weight: 500;
  transition: color .15s, border-color .15s; white-space: nowrap;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ac); border-bottom-color: var(--ac); font-weight: 600; }
.tab-chip {
  display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 20px;
  font-size: .58rem; font-weight: 700; margin-left: 5px;
  background: var(--surface3); color: var(--ink-muted);
}
.tab-chip.urgent { background: var(--ru-dim); color: var(--ru); }

.content { flex: 1; overflow: hidden; min-height: 0; }
.tab-panel { display: none; height: 100%; overflow: auto; padding: var(--sp-4) var(--sp-5); }
.tab-panel.active { display: flex; flex-direction: column; gap: var(--sp-4); animation: fade-in .25s ease; }

.toolbar { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.search-field {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 7px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); flex: 1; min-width: 200px; max-width: 320px; transition: all .15s;
}
.search-field:focus-within { border-color: var(--ac); }
.search-field input { flex: 1; background: none; border: none; outline: none; font-size: .8rem; color: var(--ink); }
.search-field input::placeholder { color: var(--ink-muted); }
.filter-sel {
  padding: 7px 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); color: var(--ink); font-size: .78rem; outline: none;
}
.filter-sel:focus { border-color: var(--ac); }
.btn-ghost {
  padding: 7px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); color: var(--ink-mid); font-size: .78rem; transition: all .15s;
}
.btn-ghost:hover { background: var(--surface2); border-color: var(--line-mid); color: var(--ink); }
.spacer { flex: 1; }

.kanban {
  display: flex; gap: var(--sp-4); align-items: flex-start;
  overflow-x: auto; flex: 1; min-height: 0; padding-bottom: var(--sp-5);
}
.k-col { flex-shrink: 0; width: 240px; display: flex; flex-direction: column; gap: var(--sp-3); transition: opacity .3s, filter .3s; }
.k-col.dim { opacity: .25; pointer-events: none; filter: blur(1px) grayscale(.4); }

.k-col-head {
  padding: 10px 13px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  display: flex; justify-content: space-between; align-items: flex-start;
  position: sticky; top: 0; z-index: 2;
}
.k-col-label { font-family: var(--ff-display); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.k-col-meta { text-align: right; }
.k-col-count { font-size: .62rem; font-weight: 700; color: var(--ink-muted); }
.k-col-total { font-size: .72rem; font-weight: 600; color: var(--ink-mid); font-variant-numeric: tabular-nums; margin-top: 1px; }
.k-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.job-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 12px 13px 10px; cursor: pointer;
  animation: card-in .35s cubic-bezier(.25,.46,.45,.94) both;
  transition: transform .2s cubic-bezier(.25,.46,.45,.94), box-shadow .2s, border-color .2s;
  box-shadow: var(--sh-card);
}
.job-card:hover { transform: translateY(-3px); border-color: var(--line-bright); }

/* Tinte sutil por tipo de trabajo (fondo) */
.jt-tapizado { background: oklch(15.5% 0.030 65);  border-color: oklch(27% 0.058 65); }
.jt-muebles  { background: oklch(15%   0.032 245); border-color: oklch(27% 0.060 245); }
.jt-laser    { background: oklch(15%   0.038 290); border-color: oklch(27% 0.072 290); }

/* Glow al hacer hover — color del indicador de la etapa */
.st-cotizada:hover  { box-shadow: var(--sh-card), 0 0 28px oklch(66% 0.220 245 / 0.45); border-color: oklch(54% 0.180 245); }
.st-aprobada:hover  { box-shadow: var(--sh-card), 0 0 28px oklch(64% 0.245 335 / 0.50); border-color: oklch(54% 0.200 335); }
.st-curso:hover     { box-shadow: var(--sh-card), 0 0 28px oklch(76% 0.180 65  / 0.45); border-color: oklch(56% 0.140 65); }
.st-entregada:hover { box-shadow: var(--sh-card), 0 0 28px oklch(74% 0.160 195 / 0.45); border-color: oklch(54% 0.130 195); }
.st-cobrada:hover   { box-shadow: var(--sh-card), 0 0 28px oklch(72% 0.190 145 / 0.45); border-color: oklch(54% 0.150 145); }
.job-card:hover { animation-play-state: paused; }

.job-card.has-critical { animation: card-in .35s both, pulse-ru 3.2s 1s ease-in-out infinite; }
.job-card.has-warn     { animation: card-in .35s both, pulse-wa 4.5s 1.5s ease-in-out infinite; }

.job-card.payment-pending {
  border-color: var(--wa);
  box-shadow: var(--sh-card), 0 0 24px oklch(76% 0.180 75 / 0.25);
  background: oklch(17% 0.045 70);
}

.job-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.job-folio {
  font-family: var(--ff-display); font-size: .6rem; font-weight: 700; letter-spacing: .08em;
  color: var(--ink-muted); text-transform: uppercase;
  background: var(--surface3); padding: 3px 8px; border-radius: 3px; border: 1px solid var(--line);
}
.job-stamp {
  font-size: .58rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 3px;
}
.stamp-tapizado { background: var(--ac-dim);  color: var(--ac); }
.stamp-muebles  { background: var(--co-dim);  color: var(--co); }
.stamp-laser    { background: var(--pu-dim);  color: var(--pu); }

.job-title { font-family: var(--ff-display); font-size: .88rem; font-weight: 650; line-height: 1.3; color: var(--ink); margin-bottom: 3px; }
.job-client { font-size: .7rem; color: var(--ink-muted); margin-bottom: 9px; }

.job-alert {
  border-radius: var(--r-sm); padding: 5px 8px;
  display: flex; align-items: flex-start; gap: 6px;
  font-size: .68rem; font-weight: 500; line-height: 1.4; margin-bottom: 6px;
}
.job-alert-icon { flex-shrink: 0; font-size: .8rem; line-height: 1; margin-top: 1px; }
.ja-critical { background: var(--ru-dim); color: var(--ru); }
.ja-warn     { background: var(--wa-dim); color: oklch(76% 0.175 75); }
.ja-info     { background: var(--co-dim); color: var(--co); }
.ja-money    { background: var(--em-dim); color: var(--em); }

.job-more {
  display: block; font-size: .65rem; color: var(--ink-muted);
  cursor: pointer; padding: 3px 0 6px; user-select: none;
}
.job-more:hover { color: var(--ac); }
.job-more::before { content: '+ '; }
.job-more.open::before { content: '− '; }
.job-hidden-alerts { display: none; }
.job-hidden-alerts.open { display: block; }

.job-progress { margin: 0 0 9px; }
.jp-row { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: .6rem; }
.jp-l { color: var(--ink-muted); }
.jp-v { font-weight: 700; }
.jp-track { height: 3px; background: var(--surface3); border-radius: 2px; overflow: hidden; }
.jp-fill { height: 100%; border-radius: 2px; transition: width .8s cubic-bezier(.25,.46,.45,.94); }
.fill-ok      { background: var(--em); }
.fill-soon    { background: var(--ac); box-shadow: 0 0 6px oklch(76% 0.175 65 / 0.55); }
.fill-urgent  { background: var(--ru); box-shadow: 0 0 8px oklch(63% 0.220 25 / 0.70); }

.job-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 2px; }
.job-amount { font-family: var(--ff-display); font-size: .92rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.job-amount.is-due { color: var(--wa); }
.job-date { font-size: .65rem; font-weight: 600; }
.date-ok      { color: var(--em); }
.date-soon    { color: var(--ac); }
.date-urgent  { color: var(--ru); }
.date-overdue { color: var(--ru); font-weight: 800; }
.date-neutral { color: var(--ink-muted); font-weight: 500; }

.job-actions { display: flex; gap: 4px; margin-top: 8px; }
.act {
  flex: 1; padding: 6px 8px; font-size: .66rem; font-weight: 700;
  border-radius: var(--r-sm); border: none; letter-spacing: .02em; transition: all .15s;
}
.act:hover { transform: translateY(-1px); }
.act-back { background: var(--surface3); color: var(--ink-mid); }
.act-back:hover { background: var(--surface4); color: var(--ink); }
.act-next { background: var(--ac); color: var(--ac-ink); }
.act-next:hover { box-shadow: var(--gl-ac); }
.act-em { background: var(--em); color: oklch(11% 0.030 158); }
.act-em:hover { box-shadow: var(--gl-em); }

.k-empty {
  padding: 28px 14px; text-align: center;
  color: var(--ink-faint); font-size: .76rem;
  background: var(--surface); border: 1px dashed var(--line-mid);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.k-empty-icon { font-size: 1.4rem; opacity: .4; }

.cob-mini {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 8px 11px;
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-3); transition: all .15s; cursor: pointer;
  animation: card-in .35s cubic-bezier(.25,.46,.45,.94) both;
}
.cob-mini:hover { border-color: var(--em); transform: translateY(-1px); box-shadow: 0 0 14px oklch(72% 0.190 145 / 0.30); }
.cob-mini-info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.cob-mini-title { font-size: .74rem; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--ff-display); }
.cob-mini-client { font-size: .62rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cob-mini-amount { font-family: var(--ff-display); font-size: .8rem; font-weight: 700; color: var(--em); font-variant-numeric: tabular-nums; white-space: nowrap; }

.cob-summary {
  background: linear-gradient(180deg, oklch(20% 0.075 145), oklch(15% 0.050 145));
  border: 1px solid oklch(28% 0.090 145);
  border-radius: var(--r-lg); padding: 16px 14px;
  text-align: center; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 0 32px oklch(72% 0.190 145 / 0.14);
}
.cob-num { font-family: var(--ff-display); font-size: 2.1rem; font-weight: 800; color: var(--em); line-height: 1; }
.cob-num-l { font-size: .66rem; color: var(--ink-muted); }
.cob-div { height: 1px; background: oklch(28% 0.090 145); margin: 8px 0 4px; }
.cob-ytd { font-family: var(--ff-display); font-size: 1.05rem; font-weight: 700; color: var(--em); }
.cob-ytd-l { font-size: .6rem; color: var(--ink-muted); }

/* ─── HOY TAB ────────────────────────────────────────────────── */
.hoy-head {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 22px;
  flex-shrink: 0;
}
.hoy-title {
  font-family: var(--ff-display); font-size: 1.35rem; font-weight: 700;
  letter-spacing: -.4px; color: var(--ink);
}
.hoy-sub { font-size: .76rem; color: var(--ink-muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.hoy-pulse { display: flex; gap: 18px; }
.hp-row { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--ink-mid); font-weight: 600; font-variant-numeric: tabular-nums; }
.hp-row span:nth-child(2) { font-family: var(--ff-display); font-weight: 800; font-size: .9rem; color: var(--ink); }
.hp-dot { width: 8px; height: 8px; border-radius: 50%; }
.hp-dot.dot-overdue { background: var(--ru); box-shadow: 0 0 6px var(--ru); }
.hp-dot.dot-pending { background: var(--ac); box-shadow: 0 0 6px oklch(76% 0.180 65 / 0.7); }
.hp-dot.dot-paid    { background: var(--em); box-shadow: 0 0 6px oklch(72% 0.190 145 / 0.6); }

.hoy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); flex: 1; min-height: 0; }
.hoy-block {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); display: flex; flex-direction: column;
  overflow: hidden;
}
.hoy-urgent { border-color: oklch(36% 0.090 25); box-shadow: 0 0 28px oklch(63% 0.220 25 / 0.13); }
.hoy-stock { border-color: oklch(34% 0.075 65); box-shadow: 0 0 24px oklch(76% 0.180 65 / 0.10); }
.hoy-block-head {
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line); flex-shrink: 0; background: var(--surface2);
}
.hoy-block-icon { font-size: 1rem; }
.hoy-block-title { flex: 1; font-family: var(--ff-display); font-size: .82rem; font-weight: 700; color: var(--ink); letter-spacing: -.1px; }
.hoy-block-count {
  font-size: .68rem; font-weight: 700; padding: 2px 9px; border-radius: 20px;
  background: var(--surface3); color: var(--ink-muted); font-variant-numeric: tabular-nums;
}
.hoy-urgent .hoy-block-count { background: var(--ru-dim); color: var(--ru); }
.hoy-stock .hoy-block-count  { background: var(--ac-dim); color: var(--ac); }
.hoy-block-body { flex: 1; overflow-y: auto; }

.hoy-task {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); transition: background .12s; cursor: pointer;
}
.hoy-task:hover { background: var(--surface2); }
.hoy-task:last-child { border-bottom: none; }
.ht-bullet {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface3); border: 1.5px solid var(--ink-muted);
}
.ht-bullet.b-urgent  { background: var(--ru); border-color: var(--ru); box-shadow: 0 0 6px var(--ru); }
.ht-bullet.b-warn    { background: var(--wa); border-color: var(--wa); }
.ht-bullet.b-active  { background: var(--ac); border-color: var(--ac); box-shadow: 0 0 6px oklch(76% 0.180 65 / 0.6); }
.ht-bullet.b-em      { background: var(--em); border-color: var(--em); }
.ht-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ht-row1 { font-family: var(--ff-display); font-size: .82rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-row2 { font-size: .66rem; color: var(--ink-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ht-tag {
  font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 1px 6px; border-radius: 3px;
}
.ht-tag.tag-cut    { background: var(--co-dim); color: var(--co); }
.ht-tag.tag-sew    { background: var(--ac-dim); color: var(--ac); }
.ht-tag.tag-deliv  { background: var(--te-dim); color: var(--te); }
.ht-tag.tag-cobro  { background: var(--em-dim); color: var(--em); }
.ht-tag.tag-buy    { background: var(--wa-dim); color: var(--wa); }
.ht-tag.tag-init   { background: var(--or-dim); color: var(--or); }
.ht-meta {
  font-family: var(--ff-display); font-size: .76rem; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap;
}
.ht-meta.urgent { color: var(--ru); }
.ht-meta.soon   { color: var(--ac); }
.ht-empty { padding: 28px 16px; text-align: center; color: var(--ink-faint); font-size: .8rem; }

/* ─── INVENTARIO ─────────────────────────────────────────────── */
.inv-thumb {
  width: 28px; height: 28px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--surface3); position: relative; overflow: hidden;
  border: 1px solid var(--line-mid);
}
.inv-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 30%, oklch(100% 0 0 / 0.08) 50%, transparent 70%);
}
.stock-bar-wrap {
  display: flex; align-items: center; gap: 8px; min-width: 110px;
}
.stock-num {
  font-family: var(--ff-display); font-weight: 700; font-size: .82rem;
  font-variant-numeric: tabular-nums; min-width: 30px;
}
.stock-num.s-low { color: var(--ru); }
.stock-num.s-warn { color: var(--wa); }
.stock-num.s-ok { color: var(--em); }
.stock-bar-track {
  flex: 1; height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden;
  min-width: 60px; max-width: 90px;
}
.stock-bar-fill { height: 100%; border-radius: 2px; transition: width .6s; }
.stock-bar-fill.s-low { background: var(--ru); box-shadow: 0 0 6px var(--ru); }
.stock-bar-fill.s-warn { background: var(--wa); }
.stock-bar-fill.s-ok { background: var(--em); }
.inv-action-buy {
  padding: 4px 10px; background: var(--ac); border: none;
  border-radius: var(--r-sm); color: var(--ac-ink); font-size: .68rem;
  font-weight: 700; transition: all .15s; opacity: 0;
}
tbody tr:hover .inv-action-buy { opacity: 1; }
.inv-action-buy:hover { box-shadow: var(--gl-ac); }

/* ─── PHOTO GALLERY (in order view) ──────────────────────────── */
.photo-gal { display: flex; flex-direction: column; gap: var(--sp-3); }
.pg-section { display: flex; flex-direction: column; gap: 6px; }
.pg-section-title {
  font-size: .58rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-muted);
  display: flex; justify-content: space-between; align-items: center;
}
.pg-section-title .pg-add {
  background: none; border: 1px dashed var(--line-mid); border-radius: var(--r-sm);
  color: var(--ink-muted); font-size: .65rem; font-weight: 700;
  padding: 2px 8px; transition: all .15s;
}
.pg-section-title .pg-add:hover { color: var(--ac); border-color: var(--ac); }
.pg-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pg-thumb {
  width: 64px; height: 64px; border-radius: var(--r-sm);
  position: relative; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line-mid); transition: all .15s;
}
.pg-thumb:hover { transform: translateY(-2px); border-color: var(--ac); box-shadow: 0 0 12px oklch(76% 0.180 65 / 0.30); }
.pg-thumb::after {
  content: '🔍'; position: absolute; inset: 0;
  background: oklch(0% 0 0 / 0.5); opacity: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: opacity .15s;
}
.pg-thumb:hover::after { opacity: 1; }
.pg-empty {
  padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-sm);
  text-align: center; color: var(--ink-faint); font-size: .72rem; font-style: italic;
}

/* ─── ITEM DETAILS (variables per concepto) ──────────────────── */
.vi-item-name { font-weight: 600; color: var(--ink); }
.vi-details {
  margin-top: 5px; padding: 6px 10px; background: var(--surface3);
  border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 3px;
  border-left: none; /* no border-left stripes */
}
.vi-detail-row {
  display: flex; gap: 8px; font-size: .7rem; line-height: 1.4;
}
.vi-detail-key {
  color: var(--ink-muted); font-weight: 600; min-width: 120px;
  text-transform: uppercase; letter-spacing: .03em; font-size: .62rem; padding-top: 1px;
}
.vi-detail-val { color: var(--ink); flex: 1; }

.cat-thumb {
  width: 26px; height: 26px; border-radius: 4px; flex-shrink: 0;
  border: 1px solid var(--line-mid); position: relative; overflow: hidden;
}
.cat-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 30%, oklch(100% 0 0 / 0.08) 50%, transparent 70%);
}

/* ─── PAGOS TAB ──────────────────────────────────────────────── */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); flex-shrink: 0; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px 18px;
  display: flex; flex-direction: column; gap: 2px;
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: -30px; right: -30px; width: 90px; height: 90px;
  border-radius: 50%; opacity: .06; pointer-events: none; background: var(--ink);
}
.kpi-label { font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-muted); }
.kpi-value {
  font-family: var(--ff-display); font-size: 1.7rem; font-weight: 800;
  letter-spacing: -.5px; font-variant-numeric: tabular-nums;
  color: var(--ink); line-height: 1.05; margin-top: 4px;
}
.kpi-sub { font-size: .68rem; color: var(--ink-muted); margin-top: 2px; }

.kpi-card.kpi-danger {
  background: linear-gradient(135deg, oklch(20% 0.080 25), oklch(13% 0.045 25));
  border-color: oklch(36% 0.095 25);
  box-shadow: 0 0 32px oklch(63% 0.220 25 / 0.20);
}
.kpi-card.kpi-danger::before { background: var(--ru); opacity: .15; }
.kpi-card.kpi-danger .kpi-value { color: var(--ru); }

.kpi-card.kpi-warm::before { background: var(--ac); opacity: .12; }
.kpi-card.kpi-warm .kpi-value { color: var(--ac); }

.kpi-card.kpi-em {
  background: linear-gradient(135deg, oklch(20% 0.080 145), oklch(13% 0.045 145));
  border-color: oklch(36% 0.095 145);
  box-shadow: 0 0 32px oklch(72% 0.190 145 / 0.18);
}
.kpi-card.kpi-em::before { background: var(--em); opacity: .14; }
.kpi-card.kpi-em .kpi-value { color: var(--em); }

.pagos-grid { display: grid; grid-template-columns: 380px 1fr; gap: var(--sp-4); flex: 1; min-height: 0; }

.pagos-cal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-3);
  overflow: hidden;
}
.cal-head { display: flex; justify-content: space-between; align-items: center; }
.cal-nav {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--ink-mid); font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.cal-nav:hover:not(:disabled) { background: var(--surface3); color: var(--ink); border-color: var(--line-mid); }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-month { font-family: var(--ff-display); font-size: 1rem; font-weight: 700; color: var(--ink); letter-spacing: -.2px; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-muted); text-align: center;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; gap: 4px; flex: 1; min-height: 220px; }
.cal-day {
  padding: 5px 6px; background: var(--surface2);
  border: 1px solid transparent; border-radius: var(--r-sm);
  display: flex; flex-direction: column; gap: 3px;
  transition: all .15s; position: relative; min-height: 50px;
}
.cal-day.outside { opacity: .3; }
.cal-day.has-events { cursor: pointer; }
.cal-day.has-events:hover { border-color: var(--line-mid); background: var(--surface3); transform: translateY(-1px); }
.cal-day.today {
  background: oklch(20% 0.062 65);
  border-color: var(--ac);
  box-shadow: 0 0 18px oklch(76% 0.180 65 / 0.32);
}
.cd-num { font-family: var(--ff-display); font-size: .76rem; font-weight: 700; color: var(--ink-mid); }
.cal-day.today .cd-num { color: var(--ac); font-weight: 800; }
.cal-day.outside .cd-num { color: var(--ink-faint); }
.cd-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.cd-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.cd-dot.dot-overdue { background: var(--ru); box-shadow: 0 0 5px var(--ru); }
.cd-dot.dot-pending { background: var(--ac); box-shadow: 0 0 5px oklch(76% 0.180 65 / 0.7); }
.cd-dot.dot-paid    { background: var(--em); }
.cd-amount { font-size: .58rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: auto; }
.cd-amount.cd-overdue { color: var(--ru); }
.cd-amount.cd-pending { color: var(--ac); }
.cd-amount.cd-paid { color: var(--em); }

.cal-legend { display: flex; gap: var(--sp-3); font-size: .65rem; color: var(--ink-muted); padding-top: var(--sp-2); border-top: 1px solid var(--line); flex-wrap: wrap; }
.cl-item { display: flex; align-items: center; gap: 5px; }
.cl-dot { width: 7px; height: 7px; border-radius: 50%; }
.cl-dot.dot-overdue { background: var(--ru); }
.cl-dot.dot-pending { background: var(--ac); }
.cl-dot.dot-paid    { background: var(--em); }

.pagos-list {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden;
}
.pl-head {
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.pl-title { font-family: var(--ff-display); font-size: .85rem; font-weight: 700; color: var(--ink); letter-spacing: -.2px; }
.pl-count { font-size: .68rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pl-body { flex: 1; overflow-y: auto; }
.pl-section-title {
  padding: 7px 16px; font-size: .58rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .09em; color: var(--ink-muted);
  background: var(--surface2);
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line); border-top: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
.pl-section-title.urgent  { color: var(--ru); background: oklch(16% 0.055 25); }
.pl-section-title.soon    { color: var(--ac); background: oklch(16% 0.045 65); }
.pl-section-title.success { color: var(--em); background: oklch(16% 0.050 145); }
.pl-section-amount { font-family: var(--ff-display); font-weight: 700; font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--ink); }

.pl-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.pl-item:hover { background: var(--surface2); }
.pl-item.clickable { cursor: pointer; }
.pl-item-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pl-item-row1 {
  font-size: .82rem; font-weight: 600; font-family: var(--ff-display); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-item-row2 { font-size: .66rem; color: var(--ink-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pl-folio {
  font-family: var(--ff-display); font-size: .58rem; color: var(--ink-muted);
  letter-spacing: .05em; text-transform: uppercase;
  background: var(--surface3); padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line);
}
.pl-type { font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.pl-type.t-saldo, .pl-type.t-saldo-final, .pl-type.t-total { color: var(--ac); }
.pl-type.t-paid { color: var(--em); }
.pl-amount { font-family: var(--ff-display); font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.pl-amount.urgent { color: var(--ru); }
.pl-amount.paid { color: var(--em); }
.pl-action {
  padding: 6px 12px; background: var(--em); border: none; border-radius: var(--r-sm);
  color: oklch(11% 0.030 145); font-size: .68rem; font-weight: 800;
  transition: all .15s; flex-shrink: 0; letter-spacing: .03em;
}
.pl-action:hover { box-shadow: var(--gl-em); transform: translateY(-1px); }
.pl-empty { padding: 32px 16px; text-align: center; color: var(--ink-faint); font-size: .8rem; }

.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: auto; flex: 1; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--line-mid); }
th { padding: 11px 14px; text-align: left; font-size: .62rem; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; background: var(--surface); }
tbody tr { border-bottom: 1px solid var(--line); transition: background .12s; cursor: pointer; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
td { padding: 11px 14px; font-size: .82rem; }
.td-main { color: var(--ink); font-weight: 500; font-family: var(--ff-display); }
.td-muted { color: var(--ink-muted); }
.td-mono { font-family: var(--ff-display); font-size: .68rem; color: var(--ink-muted); letter-spacing: .04em; }
.td-num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; color: var(--ink); }
.td-act { text-align: right; white-space: nowrap; }
.row-act {
  opacity: 0; padding: 4px 9px; background: var(--surface3); border: 1px solid var(--line-mid);
  border-radius: var(--r-sm); color: var(--ink-mid); font-size: .68rem; font-weight: 600;
  transition: all .15s; margin-left: 4px;
}
tbody tr:hover .row-act { opacity: 1; }
.row-act:hover { background: var(--ac); color: var(--ac-ink); border-color: var(--ac); }

.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: .62rem; font-weight: 700; white-space: nowrap; letter-spacing: .02em; }
.b-co { background: var(--co-dim); color: var(--co); }
.b-or { background: var(--or-dim); color: var(--or); }
.b-ac { background: var(--ac-dim); color: var(--ac); }
.b-te { background: var(--te-dim); color: var(--te); }
.b-em { background: var(--em-dim); color: var(--em); }
.b-ru { background: var(--ru-dim); color: var(--ru); }
.b-wa { background: var(--wa-dim); color: var(--wa); }
.b-pu { background: var(--pu-dim); color: var(--pu); }
.chip { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 20px; font-size: .6rem; font-weight: 600; white-space: nowrap; margin: 1px; }
.ch-info   { background: var(--co-dim); color: var(--co); }
.ch-warn   { background: var(--wa-dim); color: var(--wa); }
.ch-danger { background: var(--ru-dim); color: var(--ru); }

.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: oklch(0% 0 0 / 0); pointer-events: none;
  transition: background .3s; backdrop-filter: blur(0px);
}
.overlay.open { background: oklch(0% 0 0 / 0.65); pointer-events: auto; backdrop-filter: blur(2px); }

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(620px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--sh-panel);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.25,.46,.45,.94);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel.open { transform: translateX(0); }
.panel[data-mode="new"]  .panel-view { display: none; }
.panel[data-mode="view"] .panel-new  { display: none; }

.panel-head {
  padding: 18px var(--sp-5) 14px; border-bottom: 1px solid var(--line);
  flex-shrink: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4);
}
.panel-head-l { flex: 1; min-width: 0; }
.panel-title { font-family: var(--ff-display); font-size: 1.08rem; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.panel-sub { font-size: .72rem; color: var(--ink-muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-x {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: none; border: 1px solid var(--line); color: var(--ink-muted);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: .9rem; transition: all .15s;
}
.panel-x:hover { background: var(--surface2); color: var(--ink); border-color: var(--line-mid); }

.panel-body { flex: 1; overflow-y: auto; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-5); }
.panel-foot {
  padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--line);
  flex-shrink: 0; display: flex; gap: var(--sp-3); align-items: center;
}
.foot-r { margin-left: auto; display: flex; gap: var(--sp-3); align-items: center; }

.v-sec { display: flex; flex-direction: column; gap: var(--sp-3); }
.v-sec-title {
  font-family: var(--ff-display); font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted);
  padding-bottom: var(--sp-2); border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.v-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-5); }
.v-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3) var(--sp-5); }
.v-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v-meta-l { font-size: .6rem; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; }
.v-meta-v { font-size: .85rem; color: var(--ink); font-family: var(--ff-display); font-weight: 500; word-wrap: break-word; }
.v-meta-v.big { font-size: 1.4rem; font-weight: 700; color: var(--ac); font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.v-meta-v.amount-due { color: var(--wa); }

.tl-wrap { display: flex; align-items: flex-start; padding: 10px 0 4px; }
.tl-step { display: flex; flex-direction: column; align-items: center; gap: 5px; flex-shrink: 0; }
.tl-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface3); border: 2px solid var(--line-mid);
  position: relative; transition: all .3s;
}
.tl-dot.done { background: var(--em); border-color: var(--em); box-shadow: 0 0 10px oklch(72% 0.190 145 / 0.65); }
.tl-dot.cur  { background: var(--ac); border-color: var(--ac); box-shadow: 0 0 14px oklch(76% 0.180 65 / 0.75); }
.tl-dot.cur::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--ac); opacity: .4;
  animation: pulse-dot 1.8s ease-in-out infinite;
}
.tl-label { font-size: .58rem; color: var(--ink-muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.tl-label.done { color: var(--em); }
.tl-label.cur  { color: var(--ac); }
.tl-line { flex: 1; height: 2px; background: var(--line); margin-top: 9px; }
.tl-line.done { background: var(--em); box-shadow: 0 0 8px oklch(72% 0.190 145 / 0.50); }

.vi-tbl { width: 100%; border-collapse: collapse; font-size: .8rem; }
.vi-tbl th { padding: 7px 10px; font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); text-align: left; background: var(--surface2); border-bottom: 1px solid var(--line); }
.vi-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.vi-tbl tr:last-child td { border-bottom: none; }
.vi-r { text-align: right; font-variant-numeric: tabular-nums; }

.v-totals { display: flex; justify-content: flex-end; }
.v-totals-inner { display: flex; flex-direction: column; gap: 5px; min-width: 230px; padding: 10px 14px; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r); }
.vt-row { display: flex; justify-content: space-between; gap: var(--sp-5); font-size: .8rem; }
.vt-row .vl { color: var(--ink-muted); }
.vt-row.grand { font-family: var(--ff-display); font-weight: 700; font-size: 1rem; color: var(--ac); padding-top: 6px; border-top: 1px solid var(--line); margin-top: 3px; }

.v-alerts { display: flex; flex-direction: column; gap: var(--sp-2); }
.va-item { padding: 9px 12px; border-radius: var(--r); display: flex; align-items: flex-start; gap: 8px; font-size: .8rem; line-height: 1.4; }
.va-critical { background: var(--ru-dim); color: var(--ru); }
.va-warn     { background: var(--wa-dim); color: var(--wa); }
.va-info     { background: var(--co-dim); color: var(--co); }
.va-money    { background: var(--em-dim); color: var(--em); }

.v-notes { padding: 10px 14px; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r); font-size: .82rem; color: var(--ink-mid); line-height: 1.5; font-style: italic; }

.form-section { display: flex; flex-direction: column; gap: var(--sp-3); }
.form-section-hdr {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: var(--sp-2); border-bottom: 1px solid var(--line);
}
.form-section-title {
  font-family: var(--ff-display); font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted);
}
.form-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.form-group { flex: 1; min-width: 155px; display: flex; flex-direction: column; gap: 5px; }
.form-group.full { flex-basis: 100%; }
.form-label { font-size: .65rem; font-weight: 600; color: var(--ink-muted); letter-spacing: .03em; }
.form-input, .form-select, .form-textarea {
  padding: 8px 11px; background: var(--surface2);
  border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); font-size: .82rem; outline: none; width: 100%;
  transition: all .15s; font-family: var(--ff-body);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--ac); background: var(--surface3);
  box-shadow: 0 0 0 3px oklch(76% 0.175 65 / 0.12);
}
.form-textarea { resize: vertical; min-height: 60px; line-height: 1.5; }

.picker-wrap { position: relative; }
.picker-list {
  background: var(--surface2); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; margin-top: var(--sp-2);
  box-shadow: var(--sh-md); max-height: 240px; overflow-y: auto;
}
.picker-item {
  padding: 9px 12px; display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; transition: background .1s; border-bottom: 1px solid var(--line);
}
.picker-item:last-child { border-bottom: none; }
.picker-item:hover { background: var(--surface3); }
.pi-name { font-size: .82rem; font-weight: 500; color: var(--ink); }
.pi-price { font-size: .7rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pi-add {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ac-dim); color: var(--ac);
  font-size: .95rem; font-weight: 700; border: none; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.picker-item:hover .pi-add { background: var(--ac); color: var(--ac-ink); box-shadow: var(--gl-ac); }

.items-tbl-wrap { background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
.items-tbl { width: 100%; border-collapse: collapse; font-size: .78rem; }
.items-tbl th { padding: 7px 10px; font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); text-align: left; background: var(--surface3); }
.items-tbl td { padding: 6px 10px; border-top: 1px solid var(--line); }
.qty-input, .price-input {
  width: 72px; padding: 4px 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  color: var(--ink); font-size: .78rem; text-align: right; outline: none; font-family: var(--ff-body);
}
.qty-input:focus, .price-input:focus { border-color: var(--ac); }
.del-item-btn { background: none; border: none; color: var(--ink-faint); font-size: .9rem; transition: color .15s; }
.del-item-btn:hover { color: var(--ru); }

.totals-block { display: flex; justify-content: flex-end; margin-top: var(--sp-3); }
.totals-inner { background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; min-width: 220px; display: flex; flex-direction: column; gap: 5px; }
.totals-row { display: flex; justify-content: space-between; gap: 24px; font-size: .8rem; }
.totals-row .tl { color: var(--ink-muted); }
.totals-row.grand { font-family: var(--ff-display); font-weight: 700; color: var(--ac); font-size: 1rem; padding-top: 7px; border-top: 1px solid var(--line); margin-top: 4px; }

.alert-entry { display: flex; gap: var(--sp-2); align-items: center; padding: 6px 8px; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.ae-sel { padding: 4px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font-size: .72rem; outline: none; }
.ae-inp { flex: 1; padding: 4px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font-size: .72rem; outline: none; }
.ae-del { background: none; border: none; color: var(--ink-muted); font-size: .85rem; transition: color .15s; }
.ae-del:hover { color: var(--ru); }

.btn-tc { padding: 9px 18px; background: var(--ac); border: none; border-radius: var(--r); color: var(--ac-ink); font-size: .82rem; font-weight: 700; font-family: var(--ff-display); transition: all .15s; }
.btn-tc:hover { box-shadow: var(--gl-ac); transform: translateY(-1px); }
.btn-outline { padding: 9px 18px; background: var(--surface2); border: 1px solid var(--line-mid); border-radius: var(--r); color: var(--ink-mid); font-size: .82rem; transition: all .15s; }
.btn-outline:hover { background: var(--surface3); color: var(--ink); border-color: var(--line-bright); }
.btn-text { padding: 9px 12px; background: none; border: none; color: var(--ink-muted); font-size: .8rem; transition: color .15s; }
.btn-text:hover { color: var(--ink); }
.btn-print { padding: 9px 16px; background: var(--surface2); border: 1px solid var(--line-mid); border-radius: var(--r); color: var(--ink); font-size: .82rem; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; transition: all .15s; }
.btn-print:hover { background: var(--surface3); border-color: var(--ac); color: var(--ac); box-shadow: 0 0 14px oklch(76% 0.175 65 / 0.18); }
.btn-sm { padding: 5px 10px; font-size: .72rem; border-radius: var(--r-sm); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--surface3); color: var(--ink);
  padding: 10px 18px; border: 1px solid var(--line-bright); border-radius: var(--r);
  font-size: .8rem; font-weight: 500;
  opacity: 0; transition: all .25s cubic-bezier(.25,.46,.45,.94);
  pointer-events: none; z-index: 200; white-space: nowrap;
  box-shadow: var(--sh-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#print-frame { display: none; }
@media print {
  body > *:not(#print-frame) { display: none !important; }
  body { overflow: auto !important; background: white !important; color: #111 !important; }
  #print-frame {
    display: block !important; font-family: 'Epilogue', Arial, sans-serif;
    font-size: 10pt; color: #111; line-height: 1.45; background: white; padding: 0;
  }
  @page { size: A4 portrait; margin: 16mm 14mm; }
  .po-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18pt; padding-bottom: 12pt; border-bottom: 2pt solid #111; }
  .po-brand-name { font-size: 22pt; font-weight: 800; letter-spacing: -.5pt; font-family: 'Bricolage Grotesque', Arial; line-height: 1; }
  .po-brand-sub { font-size: 8pt; color: #555; letter-spacing: 1pt; text-transform: uppercase; margin-top: 4pt; }
  .po-order-info { text-align: right; }
  .po-otype { font-size: 8pt; color: #888; letter-spacing: 1pt; text-transform: uppercase; }
  .po-folio { font-size: 18pt; font-weight: 700; font-family: 'Bricolage Grotesque', Arial; margin-top: 2pt; }
  .po-status-pill { display: inline-block; padding: 2pt 8pt; background: #f4a72f; color: white; font-size: 8pt; font-weight: 700; text-transform: uppercase; letter-spacing: .5pt; border-radius: 3pt; margin-top: 5pt; }
  .po-section { margin-bottom: 14pt; }
  .po-section-title { font-size: 7pt; font-weight: 700; text-transform: uppercase; letter-spacing: 1pt; color: #888; border-bottom: .5pt solid #ccc; padding-bottom: 3pt; margin-bottom: 8pt; }
  .po-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10pt 16pt; }
  .po-field { display: flex; flex-direction: column; gap: 2pt; }
  .po-field-label { font-size: 7pt; color: #888; text-transform: uppercase; letter-spacing: .8pt; font-weight: 600; }
  .po-field-value { font-size: 11pt; font-weight: 600; color: #111; }
  .po-field-big { font-size: 13pt; font-weight: 700; }
  .po-desc-box { background: #f8f8f5; padding: 8pt 10pt; font-size: 10pt; line-height: 1.5; margin-top: 4pt; border-radius: 3pt; border: .5pt solid #ddd; }
  .po-table { width: 100%; border-collapse: collapse; margin-bottom: 8pt; }
  .po-table th { padding: 5pt 8pt; background: #efefe9; font-size: 8pt; font-weight: 700; text-transform: uppercase; letter-spacing: .5pt; text-align: left; border-bottom: 1pt solid #bbb; }
  .po-table td { padding: 6pt 8pt; border-bottom: .5pt solid #ddd; font-size: 10pt; }
  .po-table .tr { text-align: right; font-variant-numeric: tabular-nums; }
  .po-table tbody tr:last-child td { border-bottom: 1pt solid #888; }
  .po-totals { display: flex; justify-content: flex-end; }
  .po-totals-inner { min-width: 180pt; padding-top: 4pt; }
  .po-total-row { display: flex; justify-content: space-between; gap: 24pt; font-size: 10pt; padding: 2pt 0; }
  .po-total-row .vl { color: #555; }
  .po-total-row.grand { font-size: 14pt; font-weight: 800; border-top: 1.5pt solid #111; padding-top: 5pt; margin-top: 3pt; font-family: 'Bricolage Grotesque', Arial; }
  .po-alerts-box { background: #fff8e8; border: 1pt solid #f4a72f; padding: 8pt 12pt; border-radius: 4pt; margin-bottom: 12pt; }
  .po-alerts-title { font-size: 8pt; font-weight: 700; text-transform: uppercase; color: #b06b00; margin-bottom: 5pt; letter-spacing: .8pt; }
  .po-alert { font-size: 10pt; padding: 2pt 0; }
  .po-notes-box { background: #f6f6f0; padding: 8pt 12pt; border-radius: 3pt; font-size: 10pt; line-height: 1.5; font-style: italic; color: #444; margin-bottom: 12pt; }
  .po-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 28pt; margin-top: 32pt; padding-top: 14pt; border-top: 1pt solid #aaa; }
  .po-sig-title { font-size: 8pt; font-weight: 700; text-transform: uppercase; letter-spacing: .8pt; color: #555; margin-bottom: 22pt; }
  .po-sig-line { border-bottom: .8pt solid #111; height: 1pt; margin-bottom: 5pt; }
  .po-sig-name { font-size: 8pt; color: #555; }
  .po-disclaimer { font-size: 7pt; color: #888; text-align: center; margin-top: 16pt; line-height: 1.5; }
}
