/* Lunori = luna: noche violeta en el menú, degradado violeta → rosa como acento, fondo lavanda suave. */
:root {
  --bg: #f6f3fc;
  --surface: #ffffff;
  --surface-2: #f3effa;
  --hover: #f7f3ff;
  --border: #e8e1f3;
  --border-strong: #d3c8ea;
  --text: #1e1631;
  --text-2: #554a6c;
  --muted: #8d849f;
  --accent: #6a4cf5;
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, #6a4cf5 0%, #a64fe0 55%, #e4579d 100%);
  --grad-soft: linear-gradient(135deg, #efeaff 0%, #fbeaf4 100%);
  --side-bg: linear-gradient(185deg, #241650 0%, #33207a 55%, #46248f 100%);
  --side-text: #d8d0f7;
  --side-muted: #9d92c9;
  --side-hover: rgba(255, 255, 255, .08);
  --series-1: #6a4cf5;
  --series-2: #f08a3c;
  --good: #11804a;
  --good-bg: #e2f6ea;
  --warn: #965d00;
  --warn-bg: #fff1d6;
  --bad: #c0344d;
  --bad-bg: #fde6ea;
  --info: #2160c4;
  --info-bg: #e4eefd;
  --neutral-bg: #eeebf3;
  --violet: #5b3fd6;
  --violet-bg: #ece7ff;
  --teal: #08746f;
  --teal-bg: #dcf4f1;
  --out-bg: #fff2ea;
  --out: #b4541a;
  --shadow-sm: 0 1px 2px rgba(58, 36, 120, .05), 0 6px 18px rgba(58, 36, 120, .06);
  --shadow: 0 18px 44px rgba(46, 26, 110, .18);
  --ring: 0 0 0 3px rgba(106, 76, 245, .2);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #110d1c;
    --surface: #1a1529;
    --surface-2: #231d36;
    --hover: #241e38;
    --border: #322a4a;
    --border-strong: #4a3f6a;
    --text: #f2eefb;
    --text-2: #c5bcdb;
    --muted: #8f86a8;
    --accent: #9179ff;
    --grad: linear-gradient(135deg, #7b5cff 0%, #ac55e6 55%, #e5609f 100%);
    --grad-soft: linear-gradient(135deg, #251d42 0%, #2f1b37 100%);
    --side-bg: linear-gradient(185deg, #160e33 0%, #1f1449 60%, #2a1760 100%);
    --series-1: #9179ff;
    --series-2: #f39a55;
    --good: #74d9a0;
    --good-bg: #13301f;
    --warn: #f3c45e;
    --warn-bg: #3a2b0b;
    --bad: #f58a9c;
    --bad-bg: #3d1720;
    --info: #8fb8f5;
    --info-bg: #15263f;
    --neutral-bg: #2a2438;
    --violet: #b9a8ff;
    --violet-bg: #2a2150;
    --teal: #79d9d3;
    --teal-bg: #11302e;
    --out-bg: #35210f;
    --out: #f3a76b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --shadow: 0 18px 44px rgba(0, 0, 0, .55);
    --ring: 0 0 0 3px rgba(145, 121, 255, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .muted { color: var(--muted); }
h1 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 12px; font-weight: 700; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side-bg);
  color: var(--side-text);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
/* Un par de estrellas y el brillo de la luna en el fondo del menú. */
.sidebar::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 85% 6%, rgba(255, 214, 240, .22), transparent 32%),
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255, 255, 255, .7), transparent),
    radial-gradient(1px 1px at 70% 45%, rgba(255, 255, 255, .6), transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(255, 255, 255, .45), transparent),
    radial-gradient(1px 1px at 85% 85%, rgba(255, 255, 255, .5), transparent);
}
.sidebar > * { position: relative; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; padding: 2px 8px 22px; }
.brand div span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sidebar .brand { color: #fff; }
.sidebar .brand div span { background: linear-gradient(135deg, #c9b8ff, #ffb3d6); -webkit-background-clip: text; background-clip: text; }
.logo {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(164, 79, 224, .45);
}
.logo svg { width: 19px; height: 19px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 11px; color: var(--side-text); font-weight: 600; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 3px 0 0 #ff9fcd; }
.nav a.active svg { opacity: 1; color: #ffb3d6; }
.nav .count { margin-left: auto; font-size: 12px; background: var(--grad); color: #fff; border-radius: 99px; padding: 0 7px; }
.sidebar .me {
  margin-top: auto; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .07);
  display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.sidebar .me b { color: #fff; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .me small { display: block; color: var(--side-muted); }
.sidebar .me > div { flex: 1; min-width: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.sidebar .me button { background: transparent; border-color: rgba(255, 255, 255, .18); color: var(--side-text); padding: 6px; }
.sidebar .me button:hover { background: var(--side-hover); color: #fff; }
.sidebar .me button svg { width: 16px; height: 16px; }
.main { padding: 26px 30px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .spacer { flex: 1; }
.page-head .hello { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; left: 0; width: 252px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .main { padding: 16px 16px 60px; }
  .menu-btn { display: inline-flex; }
}

/* ---------- Controles ---------- */
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 10px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .15s, filter .15s;
}
button:hover { background: var(--hover); }
button.primary {
  background: var(--grad); border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 6px 16px rgba(130, 70, 230, .28);
}
button.primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(130, 70, 230, .34); }
button.primary:disabled { transform: none; box-shadow: none; }
button.danger { color: var(--bad); }
button.ghost { border-color: transparent; background: transparent; box-shadow: none; }
button.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
button:disabled { opacity: .55; cursor: default; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 11px; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
button:focus-visible { outline: none; box-shadow: var(--ring); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
textarea { resize: vertical; min-height: 64px; width: 100%; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); font-weight: 500; }
label.field input, label.field select, label.field textarea { font-size: 14px; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.grid { display: grid; gap: 10px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 640px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input[type=search] {
  width: 270px; padding-left: 34px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238d849f' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 5px 13px; font-size: 13px; color: var(--text-2); font-weight: 600;
}
.chip b { margin-left: 4px; color: var(--text); font-weight: 800; }
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(130, 70, 230, .25); }
.chip.active b { color: #fff; }

.bulk {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 9px 14px; margin-bottom: 12px;
  background: var(--grad-soft); color: var(--violet); border: 1px solid var(--border); border-radius: 12px; font-weight: 700;
}

/* ---------- Tablas ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th {
  font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: background .12s; }
tbody tr.click:hover { background: var(--hover); }
tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
td small { display: block; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty::before { content: '🌙'; display: block; font-size: 30px; margin-bottom: 8px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.s-nuevo { background: var(--info-bg); color: var(--info); }
.s-no_contesta { background: var(--warn-bg); color: var(--warn); }
.s-confirmado { background: var(--violet-bg); color: var(--violet); }
.s-enviado { background: var(--neutral-bg); color: var(--text-2); }
.s-en_agencia { background: var(--teal-bg); color: var(--teal); }
.chip.late { border-color: var(--bad); color: var(--bad); }
.chip.late.active { background: var(--bad); border-color: var(--bad); color: #fff; }
.chip.late.active b { color: #fff; }
.late-note { color: var(--bad); font-weight: 600; font-size: 12px; }
.s-entregado { background: var(--good-bg); color: var(--good); }
.s-devuelto, .s-cancelado { background: var(--bad-bg); color: var(--bad); }
.s-pendiente { background: var(--info-bg); color: var(--info); }
.s-contactado { background: var(--warn-bg); color: var(--warn); }
.s-recuperado { background: var(--good-bg); color: var(--good); }
.s-descartado { background: var(--neutral-bg); color: var(--text-2); }
.dup { background: var(--warn-bg); color: var(--warn); }
.rec { background: var(--good-bg); color: var(--good); margin-left: 4px; }
.low { color: var(--bad); font-weight: 600; }
.pos { color: var(--good); }
.neg { color: var(--bad); }

/* ---------- Panel lateral y modales ---------- */
.overlay { position: fixed; inset: 0; background: rgba(30, 16, 70, .38); backdrop-filter: blur(2px); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--bg); z-index: 41;
  display: flex; flex-direction: column; box-shadow: var(--shadow); animation: slide-in .22s ease-out;
}
.drawer::before { content: ''; height: 4px; background: var(--grad); flex: none; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.drawer header, .drawer footer { padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.drawer footer { border-top: 1px solid var(--border); border-bottom: 0; }
.drawer .body { padding: 6px 18px 20px; overflow: auto; flex: 1; }
.drawer .body h3:first-child { margin-top: 14px; }
.items-table td, .items-table th { padding: 5px 6px; }
.items-table input { width: 100%; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.totals div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; }
.totals div:first-child { background: var(--grad-soft); }
.totals b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.totals .paid { background: var(--good-bg); border-color: transparent; color: var(--good); }
.paid-check { padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.log { font-size: 13px; color: var(--text-2); }
.log div { padding: 4px 0; border-bottom: 1px dashed var(--border); white-space: pre-wrap; overflow-wrap: anywhere; }
.alert { padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); margin-top: 12px; font-size: 13px; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.good { background: var(--good-bg); color: var(--good); }

.modal {
  position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 18px; padding: 22px; box-shadow: var(--shadow);
  border-top: 4px solid #a64fe0;
}
.modal-overlay { z-index: 50; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #2a1a5e; color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600;
  animation: pop .2s ease-out;
}
.toast::before { content: '✦'; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; background: var(--grad); font-size: 12px; }
.toast.error { background: var(--bad); }
.toast.error::before { content: '!'; background: rgba(255, 255, 255, .25); }
@keyframes pop { from { transform: translateY(8px) scale(.97); opacity: 0; } }

/* ---------- Login ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(circle at 15% 15%, rgba(166, 79, 224, .22), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(228, 87, 157, .18), transparent 40%),
    var(--bg);
}
.auth .card { width: min(390px, 100%); padding: 28px; border-radius: 22px; box-shadow: var(--shadow); }
.auth .brand { padding: 0 0 18px; font-size: 20px; }
.auth h2 { font-size: 19px; font-weight: 800; }
.auth form { display: grid; gap: 14px; }
.auth button.primary { justify-content: center; padding: 11px; font-size: 15px; }

/* ---------- Ventas ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 14px 20px; box-shadow: var(--shadow-sm);
}
/* Cada tarjeta con su color en el borde izquierdo, para que no se vean todas iguales. */
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--k, var(--accent)); }
.kpi:nth-child(4n+1) { --k: linear-gradient(#6a4cf5, #a64fe0); }
.kpi:nth-child(4n+2) { --k: linear-gradient(#e4579d, #f08a3c); }
.kpi:nth-child(4n+3) { --k: linear-gradient(#14b8a6, #22c55e); }
.kpi:nth-child(4n+4) { --k: linear-gradient(#f59e0b, #f97316); }
.kpi .label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.kpi .value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pnl { width: 100%; max-width: 460px; }
.pnl td { border: 0; padding: 5px 0; }
.pnl tr.total td { border-top: 1px solid var(--border); font-weight: 700; padding-top: 8px; font-size: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

.kpi.link { cursor: pointer; transition: border-color .15s, transform .15s; }
.kpi.link:hover, .kpi.link:focus-visible { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(70, 40, 150, .13); outline: none; }
.kpi .go { color: var(--accent); font-weight: 700; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; padding: 2px; background: var(--surface-2); gap: 2px; }
.seg button { border: 0; border-radius: 8px; padding: 4px 11px; font-size: 13px; background: transparent; color: var(--text-2); }
.seg button.on { background: var(--grad); color: #fff; }

.legend-btn { border: 0; background: none; padding: 2px 4px; font-size: 12px; color: var(--text-2); }
.legend-btn i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend-btn.off { opacity: .4; text-decoration: line-through; }

.funnel { display: grid; gap: 6px; }
.funnel-row {
  display: grid; grid-template-columns: 96px 1fr 44px 44px; align-items: center; gap: 10px;
  border: 0; background: none; padding: 6px 4px; border-radius: 8px; text-align: left; font-weight: 400;
}
.funnel-row:hover { background: var(--surface-2); }
.f-label { font-size: 13px; color: var(--text-2); }
.f-bar { height: 14px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.f-bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.f-num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.f-pct { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.ranking th.sortable { cursor: pointer; user-select: none; }
.ranking th.sorted { color: var(--accent); }
.ranking tr.selected td { background: var(--info-bg); }
.meter { display: inline-block; width: 54px; height: 6px; background: var(--surface-2); border-radius: 3px; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--grad); border-radius: 3px; }

.cashflow { margin-bottom: 16px; }
.cf-grid { display: grid; grid-template-columns: 1fr 1fr minmax(180px, .7fr); gap: 16px; }
@media (max-width: 980px) { .cf-grid { grid-template-columns: 1fr; } }
.cf-col { border-radius: 14px; padding: 14px 16px; background: var(--surface-2); }
.cf-col.in { background: var(--good-bg); }
.cf-col.out { background: var(--out-bg); }
.cf-col.net { background: var(--grad-soft); }
.cf-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin-bottom: 6px; }
.cf-col.in .cf-head { color: var(--good); }
.cf-col.out .cf-head { color: var(--out); }
.cf-col.net .cf-head { color: var(--violet); }
.cf-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; }
.cf-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-row small { color: var(--muted); }
.cf-row.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; font-weight: 700; }
.cf-row.muted span { font-size: 12px; color: var(--muted); }
.cf-big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, -100%); z-index: 2;
}
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Rótulos de envío ---------- */
/* La hoja es papel: blanca y en negro también en modo oscuro. 8 rótulos por A4 (2 × 4), con línea de corte punteada. */
#label-sheet { overflow-x: auto; }
.label-page {
  width: 210mm; min-height: 297mm; padding: 10mm; margin: 0 auto 16px; background: #fff; color: #000;
  box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 68mm; align-content: start;
}
.lbl {
  border: 1px dashed #777; padding: 5mm 6mm; display: flex; flex-direction: column; justify-content: space-between;
  font-family: Arial, Helvetica, sans-serif; overflow: hidden;
}
.lbl-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #000; padding-bottom: 1.5mm; }
.lbl-head b { font-size: 15pt; letter-spacing: .04em; }
.lbl-row { display: flex; align-items: flex-end; gap: 2mm; }
.lbl-row span { font-size: 9.5pt; white-space: nowrap; }
.lbl-row b { flex: 1; min-height: 6.5mm; border-bottom: 1px solid #000; font-size: 12pt; line-height: 1.2; overflow-wrap: anywhere; }

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .sidebar, .no-print, #toasts, .drawer, .overlay { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  #label-sheet { overflow: visible; }
  .label-page { margin: 0; box-shadow: none; height: 297mm; overflow: hidden; break-after: page; }
  .label-page:last-child { break-after: auto; }
}
