:root {
  --indigo: #0037AA; --indigo-light: #EAF0FB; --navy: #0B1F4D; --brand-hover: #002B88; --brand-wash: #D6E2F7;
  --slate: #334155; --slate-light: #F1F5F9; --slate-200: #E2E8F0; --slate-400: #94A3B8;
  --green: #16A34A; --green-light: #F0FDF4;
  --amber: #B45309; --amber-light: #FFFBEB;
  --red: #DC2626; --red-light: #FEF2F2;
  --bg: #F8FAFC; --card: #fff; --text: #0F172A; --muted: #64748B; --hover: #EEF4FD; --zebra: #F7FAFE; --hover-soft: #FAFBFF; --link: var(--indigo);
  --tb1: #0B1F4D; --tb2: #0A2A7A; --tb3: #0033A0; --nav-hover: #D6E2F7;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg); color: var(--slate); font-size: 14px;
}
a { color: var(--link); }
button { font-family: inherit; cursor: pointer; }

/* ---------- Auth screens ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1100px 600px at 15% 10%, #1B4BC0 0%, transparent 60%), linear-gradient(135deg, #0B1F4D 0%, #0A2A7A 55%, #0037AA 100%); }
.auth-card { width: 380px; max-width: 100%; background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,10,50,.45); padding: 32px; }
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.auth-logo .badge-logo { width: 56px; height: 56px; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,40,140,.25), 0 0 0 1px #D6E2F7; flex-shrink: 0; }
.auth-logo .badge-logo img { width: 40px; height: auto; display: block; }
.auth-card h1 { color: var(--indigo); font-size: 28px; margin: 0; letter-spacing: .5px; }
.auth-card p.sub { color: var(--slate-400); margin: 0 0 24px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-size: 11px; font-weight: 700; color: var(--slate-400); text-transform: uppercase; }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--slate-200); border-radius: 6px; padding: 9px 10px; font-size: 13px; font-family: inherit; background: var(--card); color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--indigo); }
.btn {
  background: var(--indigo); color: #fff; border: none; border-radius: 6px; padding: 10px 16px;
  font-size: 13px; font-weight: 700;
}
.btn.block { width: 100%; }
.btn.outline { background: var(--card); color: var(--indigo); border: 1.5px solid var(--indigo); }
.btn.danger { background: var(--red); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn:hover:not(:disabled) { background: var(--brand-hover); }
.btn.outline:hover:not(:disabled) { background: var(--indigo-light); }
.btn.danger:hover:not(:disabled) { background: #B91C1C; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.error-msg { background: var(--red-light); color: var(--red); padding: 8px 10px; border-radius: 6px; font-size: 12px; margin-bottom: 12px; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; width: 230px; background: var(--indigo-light); border-right: 1px solid var(--slate-200); flex-shrink: 0; padding: 12px 0; }
.sidebar .brand { padding: 10px 20px 16px; font-weight: 800; color: var(--navy); font-size: 18px; }
.sidebar .brand span { color: var(--indigo); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 20px; color: var(--navy); text-decoration: none; font-size: 13px; border-radius: 0; }
.nav-item:hover { background: var(--nav-hover); }
.nav-item.active { background: var(--indigo); color: #fff; font-weight: 700; margin: 0 8px; border-radius: 6px; width: calc(100% - 16px); }
.nav-section {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  background: none; border: none; text-align: left; cursor: pointer;
  font-size: 11px; text-transform: uppercase; color: var(--slate); font-weight: 700; letter-spacing: .3px; padding: 11px 20px;
}
.nav-section:hover { background: var(--nav-hover); color: var(--navy); }
.nav-section .chev { font-size: 10px; color: var(--slate-400); transition: transform .15s ease; }
.nav-group.open > .nav-section .chev { transform: rotate(90deg); }
.nav-group.open > .nav-section { color: var(--navy); }
.nav-items { display: none; padding-bottom: 6px; }
.nav-group.open > .nav-items { display: block; }
.nav-items .nav-item { padding-left: 26px; }
.nav-items .nav-item.active { padding-left: 18px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; color: #fff; display: flex; align-items: center;
  background: linear-gradient(100deg, var(--tb1) 0%, var(--tb2) 55%, var(--tb3) 100%);
  box-shadow: 0 2px 8px rgba(0,20,80,.25);
  justify-content: space-between; padding: 0 20px; flex-shrink: 0;
}
.tb-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-badge {
  width: 46px; height: 46px; border-radius: 12px; background: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 2px rgba(255,255,255,.25);
}
.tb-badge img { width: 32px; height: auto; display: block; }
.tb-badge img.custom { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.auth-logo .badge-logo img.custom { width: 46px; height: 46px; object-fit: contain; border-radius: 10px; }
.tb-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.tb-company { font-size: 17px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { font-size: 11px; letter-spacing: .6px; color: rgba(255,255,255,.7); margin-top: 3px; white-space: nowrap; }
.tb-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tb-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.4); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.tb-name { font-size: 13px; }
@media (max-width: 700px) { .tb-name, .tb-sub { display: none; } }
.topbar .pill { border: 1px solid rgba(255,255,255,.4); border-radius: 12px; padding: 5px 12px; font-size: 12px; background: transparent; color: #fff; }
.content { padding: 24px; flex: 1; overflow-x: clip; }   /* sin overflow-y para que los encabezados fijos de las tablas funcionen */

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.page-header h2 { margin: 0; color: var(--navy); font-size: 20px; }

.cards-row { display: flex; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.kpi-card { background: var(--card); border: 1px solid var(--slate-200); border-radius: 8px; padding: 14px 16px; flex: 1; min-width: 160px; }
.kpi-card .label { font-size: 11px; color: var(--slate-400); text-transform: uppercase; font-weight: 700; }
.kpi-card .value { font-size: 22px; font-weight: 800; color: var(--navy); margin-top: 6px; }
.kpi-card .delta { font-size: 11px; margin-top: 4px; color: var(--green); }
.kpi-card .delta.warn { color: var(--amber); }

.panel { background: var(--card); border: 1px solid var(--slate-200); border-radius: 8px; padding: 16px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 14px; color: var(--navy); }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; background: var(--indigo); color: #fff; padding: 8px 10px; font-size: 11px; text-transform: uppercase; }
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--slate-200); }
table.data tr:hover td { background: var(--hover-soft); }
table.data tfoot td { font-weight: 700; background: var(--slate-light); }

.badge { display: inline-block; padding: 3px 9px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.badge.gray { background: var(--slate-light); color: var(--slate); }
.badge.green { background: var(--green-light); color: var(--green); }
.badge.amber { background: var(--amber-light); color: var(--amber); }
.badge.red { background: var(--red-light); color: var(--red); }
.badge.indigo { background: var(--indigo-light); color: var(--indigo); }

.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { border: 1.5px solid var(--slate-200); border-radius: 6px; padding: 7px 10px; font-size: 13px; }

/* Kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; }
.kcol { background: var(--slate-light); border-radius: 8px; padding: 10px; min-width: 220px; flex: 1; }
.kcol h4 { margin: 0 0 10px; font-size: 12px; color: var(--navy); }
.kcard { background: var(--card); border: 1px solid var(--slate-200); border-radius: 6px; padding: 10px; margin-bottom: 8px; font-size: 12px; }
.kcard .amt { font-weight: 700; color: var(--indigo); margin-top: 6px; }
.kcard select { margin-top: 8px; width: 100%; font-size: 11px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--card); color: var(--slate); border-radius: 10px; width: 520px; max-width: 92vw; max-height: 88vh; overflow-y: auto; padding: 22px; }
.modal h3 { margin: 0 0 16px; color: var(--navy); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.items-table input, .items-table select { width: 100%; font-size: 12px; padding: 5px; }
.items-table td { padding: 4px; }
.muted { color: var(--slate-400); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tag-line { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.tag-line.total { font-weight: 800; color: var(--navy); border-top: 1px solid var(--slate-200); margin-top: 4px; padding-top: 8px; }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 13px; z-index: 200; max-width: 360px; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--slate-200); }
.tab { padding: 8px 14px; font-size: 13px; color: var(--slate-400); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--indigo); border-color: var(--indigo); font-weight: 700; }

/* ---------- Vista de impresión de documentos ---------- */
.print-overlay { position: fixed; inset: 0; background: #E2E8F0; z-index: 150; overflow-y: auto; padding: 0 0 40px; }
.print-toolbar { position: sticky; top: 0; background: var(--navy); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; font-size: 13px; z-index: 2; }
.print-sheet { position: relative; background: #fff; width: 816px; max-width: 96vw; min-height: 1000px; margin: 20px auto; padding: 40px 44px; box-shadow: 0 4px 20px rgba(15,23,42,.15); color: #0F172A; font-size: 12px; }
.pd-logo-row { text-align: center; margin-bottom: 8px; }
.pd-logo { max-height: 96px; max-width: 280px; object-fit: contain; }
.pd-company { text-align: center; margin-bottom: 14px; line-height: 1.5; }
.pd-company-name { font-size: 18px; font-weight: 800; color: var(--navy); }
.pd-contact { color: var(--slate); font-size: 11px; }
.pd-band { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--navy); color: #fff; border-radius: 6px; padding: 9px 14px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pd-title { font-size: 14px; font-weight: 800; letter-spacing: .3px; }
.pd-band-right { display: flex; gap: 18px; align-items: center; font-size: 12px; }
.pd-number { font-size: 14px; font-weight: 800; background: rgba(255,255,255,.16); padding: 3px 10px; border-radius: 4px; }
.pd-late { color: var(--red); font-weight: 700; }
.pd-boxes { display: flex; gap: 14px; margin: 16px 0; }
.pd-box { flex: 1; border: 1px solid var(--slate-200); border-radius: 6px; padding: 10px 12px; line-height: 1.5; }
.pd-box-title { font-size: 10px; text-transform: uppercase; color: var(--slate-400); font-weight: 700; margin-bottom: 3px; }
.pd-strong { font-weight: 700; }
.pd-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.pd-table th { background: #D6E2F7; color: var(--navy); padding: 7px 8px; font-size: 10px; text-transform: uppercase; text-align: left; }
.pd-table tbody tr:nth-child(even) td { background: #F8FAFC; }
.pd-table td { padding: 7px 8px; border-bottom: 1px solid var(--slate-200); vertical-align: top; }
.pd-table .r, .pd-table th.r { text-align: right; }
.pd-totals-wrap { display: flex; gap: 20px; margin-top: 14px; align-items: flex-start; }
.pd-words { flex: 1; border: 1px solid var(--slate-200); border-radius: 6px; padding: 10px 12px; font-weight: 600; }
.pd-totals { width: 270px; }
.pd-section { margin-top: 14px; }
.pd-small { font-size: 10px; color: var(--slate); }
.pd-signatures { display: flex; gap: 60px; margin-top: 60px; }
.pd-signatures div { flex: 1; text-align: center; font-size: 11px; color: var(--slate); }
.pd-signatures span { display: block; border-top: 1px solid var(--slate); margin-bottom: 4px; }
.pd-footer { margin-top: 28px; text-align: center; color: var(--slate); font-size: 11px; border-top: 1px solid var(--slate-200); padding-top: 10px; }
.pd-watermark { position: absolute; top: 40%; left: 0; right: 0; text-align: center; font-size: 96px; font-weight: 900; color: rgba(220,38,38,.12); transform: rotate(-20deg); pointer-events: none; }
.logo-preview { max-height: 90px; max-width: 220px; border: 1px dashed var(--slate-200); padding: 6px; border-radius: 6px; background: #fff; }

/* ---- Formato de factura / cotización ---- */
.print-sheet.rf { --rf-c: #0037AA; --rf-tint: color-mix(in srgb, var(--rf-c) 7%, #fff); --rf-line: color-mix(in srgb, var(--rf-c) 20%, #fff); --rf-ink: #1E293B; --rf-mut: #64748B;
  font-family: "Segoe UI", Inter, "Helvetica Neue", Roboto, Arial, sans-serif; font-size: 12.5px; color: var(--rf-ink); line-height: 1.45; position: relative; }
.rf-bar { height: 6px; background: var(--rf-c); border-radius: 3px; margin-bottom: 16px; }
.rf-top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.rf-logo { display: block; max-height: 64px; max-width: 220px; object-fit: contain; margin-bottom: 8px; }
.rf-company { font-weight: 800; font-size: 15px; letter-spacing: .2px; }
.rf-muted { color: var(--rf-mut); }
.rf-doctype { text-align: right; }
.rf-title { font-size: 21px; font-weight: 700; color: var(--rf-c); line-height: 1.2; }
.rf-ncf { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 8px; padding: 5px 12px; border: 1.5px solid var(--rf-c); border-radius: 6px; background: var(--rf-tint); }
.rf-ncf span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--rf-c); }
.rf-ncf b { font-size: 14.5px; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.rf-sub { margin-top: 4px; font-size: 11.5px; color: var(--rf-mut); }
.rf-info { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; margin-top: 18px; }
.rf-card { border: 1px solid var(--rf-line); border-radius: 8px; padding: 10px 14px; }
.rf-card-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--rf-c); margin-bottom: 5px; }
.rf-name { font-weight: 700; font-size: 14px; }
.rf-k { color: var(--rf-mut); }
.rf-kv { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; border-bottom: 1px dashed var(--rf-line); }
.rf-kv:last-child { border-bottom: 0; }
.rf-kv span { color: var(--rf-mut); } .rf-kv b { font-weight: 600; text-align: right; }
.rf-subject { text-align: center; font-weight: 700; margin-top: 14px; font-size: 13.5px; color: var(--rf-c); letter-spacing: .3px; }
.rf-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 14px; border: 1px solid var(--rf-line); border-radius: 8px; overflow: hidden; font-size: 12.5px; }
.rf-table th { background: var(--rf-c); color: #fff; padding: 8px 10px; font-weight: 700; text-align: left; font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; white-space: nowrap; }
.rf-table td { padding: 8px 10px; vertical-align: top; border-bottom: 1px solid var(--rf-line); }
.rf-table tbody tr:nth-child(even) td { background: var(--rf-tint); }
.rf-table tbody tr:last-child td { border-bottom: 0; }
.rf-table .c { text-align: center; width: 56px; } .rf-table .r { text-align: right; white-space: nowrap; width: 96px; font-variant-numeric: tabular-nums; }
.rf-table th.r, .rf-table th.c { text-align: right; } .rf-table th.c { text-align: center; }
.rf-extra { font-size: 11px; color: var(--rf-mut); margin-top: 2px; line-height: 1.4; }
.rf-sum { display: flex; gap: 18px; align-items: flex-start; margin-top: 14px; }
.rf-words { flex: 1; font-size: 11.5px; font-style: italic; border: 1px solid var(--rf-line); border-radius: 8px; padding: 9px 14px; }
.rf-words-title { font-style: normal; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--rf-c); letter-spacing: .7px; margin-bottom: 3px; }
.rf-totals { width: 310px; flex-shrink: 0; margin: 0; border-collapse: separate; border-spacing: 0; border: 1px solid var(--rf-line); border-radius: 8px; overflow: hidden; }
.rf-totals td { background: #fff; border-bottom: 1px solid var(--rf-line); padding: 5px 14px; text-align: right; }
.rf-totals .val { font-variant-numeric: tabular-nums; width: 130px; white-space: nowrap; }
.rf-totals .lbl { color: var(--rf-mut); } .rf-totals .lbl strong { color: var(--rf-ink); }
.rf-totals tr:last-child td { border-bottom: 0; }
.rf-totals .sm { font-size: 11.5px; }
.rf-totals .rf-grand td { background: var(--rf-c); color: #fff; border-bottom: 0; padding: 9px 14px; }
.rf-totals .rf-grand .lbl strong { color: #fff; }
.rf-grand .lbl { font-size: 14px; } .rf-grand .val { font-size: 14.5px; font-weight: 700; }
.rf-notes { margin-top: 14px; padding: 9px 14px; border-left: 3px solid var(--rf-c); background: var(--rf-tint); border-radius: 0 6px 6px 0; }
.rf-terms { font-size: 11px; margin-top: 4px; color: #334155; }
.rf-signer { font-weight: 700; margin-top: 14px; min-height: 14px; }
.rf-receive { display: flex; gap: 40px; margin-top: 30px; }
.rf-receive > div { flex: 1; text-align: center; font-size: 10.5px; color: var(--rf-mut); }
.rf-receive .rf-rc-date { flex: 0 0 140px; }
.rf-receive span { display: block; border-top: 1px solid #94A3B8; margin-bottom: 4px; }
.rf-bottom { display: flex; gap: 30px; align-items: center; margin-top: 18px; padding-top: 12px; border-top: 2px solid var(--rf-c); }
.rf-qr { width: 120px; min-height: 84px; flex-shrink: 0; }
.rf-qr svg { max-width: 120px; height: auto; }
.rf-sec { font-size: 9px; margin-top: 4px; line-height: 1.3; color: var(--rf-mut); }
.rf-contact { flex: 1; text-align: center; font-size: 11.5px; color: #334155; }
.rf-slogan { font-style: italic; font-weight: 700; font-size: 13px; color: var(--rf-c); margin-bottom: 6px; }
.rf-note { margin-top: 10px; font-size: 9.5px; color: var(--rf-mut); text-align: center; }

@media print {
  @page { size: letter; margin: 10mm 10mm 14mm; @bottom-right { content: "Página " counter(page) " de " counter(pages); font-size: 9px; color: #64748B; } }
  body.printing-open > *:not(.print-overlay) { display: none !important; }
  body.printing-open { background: #fff; }
  .print-overlay { position: static; background: #fff; overflow: visible; padding: 0; }
  .print-toolbar { display: none !important; }
  .print-sheet { box-shadow: none; margin: 0; width: 100%; max-width: none; padding: 0; min-height: 0; }
  .pd-table th, .pd-table td, .pd-band, .pd-watermark, .rf-qr svg, .rf-bar, .rf-ncf, .rf-notes, .rf-table th, .rf-table td, .rf-totals td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .toast { display: none !important; }
  /* facturas largas: el encabezado de la tabla se repite en cada página y nada importante se parte */
  .rf-table { overflow: visible; }
  .rf-table thead { display: table-header-group; }
  .rf-table tr, .rf-sum, .rf-receive, .rf-bottom, .rf-notes, .rf-info { break-inside: avoid; page-break-inside: avoid; }
  .rf-table th:first-child { border-top-left-radius: 8px; } .rf-table th:last-child { border-top-right-radius: 8px; }
}

/* Buscador de cliente / proveedor en facturas, cotizaciones y órdenes de compra */
.combo { position: relative; }
.combo input#tp-search.combo-ok, .combo input.row-psearch.combo-ok { border-color: var(--green, #16A34A); }
.combo-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 50; background: var(--card); border: 1px solid var(--border, #E2E8F0); border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.18); max-height: 230px; overflow-y: auto; margin-top: 4px; }
.combo-item { padding: 9px 12px; cursor: pointer; font-size: 14px; }
.combo-item.active, .combo-item:hover { background: var(--indigo-light); }
.combo-sub { color: #94A3B8; font-size: 12px; margin-left: 6px; }
.combo-empty { padding: 10px 12px; color: #94A3B8; font-size: 13px; }
.combo input[type=text] { width: 100%; box-sizing: border-box; }



/* ---------- Punto de venta ---------- */
.pos-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; padding: 10px 14px; background: var(--card); border: 1px solid var(--slate-200); border-radius: 10px; flex-wrap: wrap; }
.pos-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; align-items: start; }
.pos-left, .pos-right { background: var(--card); border: 1px solid var(--slate-200); border-radius: 10px; padding: 12px; }
.pos-right { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 110px); }
.pos-search { display: flex; gap: 8px; margin-bottom: 10px; }
.pos-search input { flex: 1; font-size: 15px; padding: 11px 12px; border: 1.5px solid var(--slate-200); border-radius: 8px; }
.pos-search input:focus, .pos-search select:focus { outline: none; border-color: var(--indigo); }
.pos-search select { border: 1.5px solid var(--slate-200); border-radius: 8px; padding: 0 8px; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: calc(100vh - 220px); overflow-y: auto; padding: 2px; }
.pos-card { text-align: left; background: var(--bg); border: 1.5px solid var(--slate-200); border-left: 5px solid var(--cat, var(--slate-200)); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 3px; min-height: 86px; color: var(--slate); }
.pos-card:hover { border-color: var(--indigo); background: var(--indigo-light); }
.pos-card.out { opacity: .5; }
.pos-card-name { font-weight: 700; font-size: 13px; line-height: 1.25; }
.pos-card-sku { font-size: 11px; color: var(--slate-400); }
.pos-card-price { margin-top: auto; font-weight: 700; color: var(--indigo); }
.pos-doc { display: flex; gap: 0; margin-bottom: 8px; }
.pos-doc button { flex: 1; padding: 8px; border: 1.5px solid var(--indigo); background: var(--card); color: var(--indigo); font-weight: 700; font-size: 12px; }
.pos-doc button:first-child { border-radius: 6px 0 0 6px; } .pos-doc button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.pos-doc button.on { background: var(--indigo); color: #fff; }
.pos-cust .combo input { width: 100%; padding: 9px 10px; border: 1.5px solid var(--slate-200); border-radius: 6px; font-size: 13px; }
.pos-cust .combo input:focus { outline: none; border-color: var(--indigo); }
.pos-cart { flex: 1; overflow-y: auto; min-height: 120px; border-top: 1px solid var(--slate-200); border-bottom: 1px solid var(--slate-200); }
.pos-empty { color: var(--slate-400); text-align: center; padding: 30px 10px; }
.pos-line { padding: 8px 2px; border-bottom: 1px dashed var(--slate-200); }
.pos-line:last-child { border-bottom: 0; }
.pos-line-top { display: flex; justify-content: space-between; gap: 8px; }
.pos-line-name { font-weight: 700; font-size: 13px; }
.pos-x { border: 0; background: none; color: var(--red); font-size: 14px; }
.pos-line-bot { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; font-size: 12px; }
.pos-qty { display: inline-flex; align-items: center; }
.pos-qty button { width: 28px; height: 28px; border: 1.5px solid var(--slate-200); background: var(--card); color: var(--slate); font-size: 16px; font-weight: 700; }
.pos-qty button:first-child { border-radius: 6px 0 0 6px; } .pos-qty button:last-child { border-radius: 0 6px 6px 0; }
.pos-qty-in { width: 54px; height: 28px; text-align: center; border: 1.5px solid var(--slate-200); border-left: 0; border-right: 0; font-size: 13px; }
.pos-disc { display: inline-flex; align-items: center; gap: 3px; color: var(--slate-400); }
.pos-disc-in { width: 46px; height: 26px; border: 1.5px solid var(--slate-200); border-radius: 5px; text-align: center; }
.pos-line-total { margin-left: auto; font-size: 13px; }
.pos-totals .tag-line.total { font-size: 20px; }
.pos-actions { display: flex; gap: 8px; }
.pos-pay { flex: 1; font-size: 17px; padding: 14px; background: var(--green); }
.pos-due { display: flex; justify-content: space-between; align-items: baseline; background: var(--indigo-light); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.pos-due strong { font-size: 26px; color: var(--navy); }
.pos-payrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pos-payrow label { width: 140px; font-weight: 700; font-size: 13px; }
.pos-payrow input { flex: 1; padding: 10px; font-size: 16px; border: 1.5px solid var(--slate-200); border-radius: 6px; text-align: right; }
.pos-payrow input:focus { outline: none; border-color: var(--indigo); }
.pos-quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px 150px; }
.pos-result { min-height: 28px; font-size: 18px; text-align: right; margin: 8px 0; }
.pos-change { font-size: 24px; text-align: center; padding: 14px; background: var(--amber-light); border-radius: 8px; margin-bottom: 10px; }
.pos-done-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pos-done-actions .btn { padding: 12px; font-size: 14px; }
@media (max-width: 900px) { .pos-wrap { grid-template-columns: minmax(0, 1fr); } .pos-left, .pos-right { min-width: 0; } .pos-right { position: static; max-height: none; } }

/* ---------- Ticket 80 mm ---------- */
.tk { width: 72mm; margin: 20px auto; background: #fff; padding: 4mm 3mm; font-family: "Courier New", ui-monospace, monospace; font-size: 11.5px; line-height: 1.35; color: #000; box-shadow: 0 2px 12px rgba(15,23,42,.15); }
.tk-c { text-align: center; } .tk-b { font-weight: 700; } .tk-big { font-size: 14px; } .tk-small { font-size: 10px; margin-top: 2px; }
.tk-sep { border-top: 1px dashed #000; margin: 5px 0; }
.tk-row { display: flex; justify-content: space-between; gap: 6px; }
.tk-row > span:last-child { text-align: right; }
.tk-item { margin-bottom: 3px; }
.tk-logo { max-width: 40mm; max-height: 18mm; margin-bottom: 2px; }
.tk-qr { margin: 6px 0 2px; } .tk-qr svg { width: 34mm; height: auto; }
.tk-sign { margin-top: 28px; border-top: 1px solid #000; text-align: center; padding-top: 2px; }
@media print { .tk { width: auto; margin: 0; box-shadow: none; padding: 0; } .tk-qr svg { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }


/* ---------- Tablas: montos a la derecha y menú de acciones ---------- */
table.data th.num, table.data td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data tbody tr:nth-child(even) td { background: var(--zebra); }
table.data tbody tr:hover td { background: var(--hover); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }
.more-btn { padding: 4px 11px; font-size: 16px; line-height: 1; letter-spacing: 1px; }
.more-menu { position: fixed; z-index: 180; min-width: 190px; background: var(--card); border: 1px solid var(--slate-200); border-radius: 10px; box-shadow: 0 12px 32px rgba(11,31,77,.22); padding: 6px; display: flex; flex-direction: column; }
.more-menu .btn { display: block; width: 100%; background: transparent; color: var(--navy); border: 0; border-radius: 6px; padding: 9px 12px; text-align: left; font-size: 13px; font-weight: 600; }
.more-menu .btn:hover:not(:disabled) { background: var(--indigo-light); }
.more-menu .btn.danger { color: var(--red); } .more-menu .btn.danger:hover:not(:disabled) { background: var(--red-light); }
.more-menu .btn.outline { border: 0; }

/* ---------- Menú lateral deslizable (celular / tablet) ---------- */
.tb-menu { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; font-size: 20px; line-height: 1; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-backdrop { display: none; }
@media (max-width: 900px) {
  .tb-menu { display: flex; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 120; width: 270px; max-width: 84vw; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .app.nav-open .sidebar { transform: none; box-shadow: 8px 0 30px rgba(0,10,50,.35); }
  .app.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(11,31,77,.5); z-index: 110; }
  .content { padding: 14px; }
  .panel { overflow-x: auto; }
  .page-header { flex-wrap: wrap; gap: 10px; }
  .topbar { padding: 0 12px; }
  .tb-company { font-size: 14px; letter-spacing: .6px; }
  .tb-badge { width: 40px; height: 40px; } .tb-badge img { width: 28px; }
  .kpi-card .value { font-size: 19px; }
  .modal { padding: 16px; }
}

/* ---------- Dashboard ---------- */
.quick-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.quick-row a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 13px; background: var(--indigo); color: #fff; box-shadow: 0 2px 6px rgba(0,55,170,.25); }
.quick-row a:hover { background: var(--brand-hover); }
.quick-row a.ghost { background: var(--card); color: var(--indigo); box-shadow: none; border: 1.5px solid var(--brand-wash); }
.quick-row a.ghost:hover { background: var(--indigo-light); }
.kpi-card { position: relative; }
.kpi-card .kpi-ico { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 10px; background: var(--indigo-light); color: var(--indigo); display: flex; align-items: center; justify-content: center; }
.kpi-card .kpi-ico svg { width: 18px; height: 18px; }
.kpi-card .value { font-size: 24px; }
.kpi-card .note { font-size: 11px; color: var(--slate-400); margin-top: 4px; }
.ch-wrap { position: relative; }
.ch-svg { width: 100%; height: auto; display: block; }
.ch-grid { stroke: var(--slate-200); stroke-width: 1; }
.ch-base { stroke: var(--slate-400); stroke-width: 1; }
.ch-axis { fill: var(--slate-400); font-size: 11px; }
.ch-val { fill: var(--navy); font-size: 12px; font-weight: 700; }
.ch-bar { fill: var(--indigo); }
.ch-slot:hover .ch-bar, .ch-slot:focus .ch-bar { fill: var(--brand-hover); }
.ch-slot { outline: none; cursor: default; }
.ch-slot:focus-visible .ch-hit { stroke: var(--indigo); stroke-width: 1.5; fill: rgba(127,127,127,.08); }
.ch-hit { fill: transparent; }
.ch-tip { position: absolute; pointer-events: none; background: #0B1F4D; border: 1px solid rgba(255,255,255,.12); color: #fff; border-radius: 8px; padding: 8px 12px; font-size: 12px; box-shadow: 0 6px 18px rgba(0,10,50,.3); white-space: nowrap; transform: translate(-50%, -100%); z-index: 5; }
.ch-tip strong { display: block; font-size: 14px; }
.ch-tip span { color: #B3C6EA; }
.ch-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.ch-toggle { background: none; border: 0; color: var(--indigo); font-weight: 700; font-size: 12px; padding: 4px 0; }
.row-actions .btn, td .btn { white-space: nowrap; }
table.data td:last-child:has(.row-actions) { white-space: nowrap; width: 1%; }
.kpi-card .label { padding-right: 42px; }
@media (max-width: 480px) { .kpi-card .value { font-size: 17px; } .cards-row { gap: 10px; } .kpi-card { min-width: 140px; padding: 12px; } }
@media (max-width: 480px) { .kpi-card .kpi-ico { display: none; } .kpi-card .label { padding-right: 0; } }

/* ---------- Diálogo de confirmación propio ---------- */
.confirm-overlay { position: fixed; inset: 0; background: rgba(11,31,77,.55); display: flex; align-items: center; justify-content: center; z-index: 300; padding: 16px; animation: cf-fade .12s ease-out; }
.confirm-box { background: var(--card); color: var(--text); border-radius: 14px; padding: 24px 24px 18px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.3); text-align: center; animation: cf-pop .14s ease-out; }
.confirm-ico { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; background: var(--indigo-light); color: var(--indigo); }
.confirm-box.danger .confirm-ico { background: var(--red-light, #FEE2E2); color: var(--red, #DC2626); }
.confirm-box h3 { margin: 0 0 6px; font-size: 17px; }
.confirm-box p { margin: 0 0 18px; color: var(--muted, #64748B); font-size: 14px; line-height: 1.45; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.confirm-actions .btn { min-width: 110px; }
@keyframes cf-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes cf-pop { from { transform: scale(.94); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- Íconos del menú lateral ---------- */
.ni { display: inline-flex; width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.ni svg { width: 100%; height: 100%; }
.nav-section { gap: 10px; justify-content: flex-start; }
.nav-section .nl { flex: 1; text-align: left; }
.nav-section .ni { opacity: 1; color: var(--indigo); }
.nav-item.active .ni { opacity: 1; }
.nav-item .nl { min-width: 0; }

/* ---------- Botón de tema (claro/oscuro) ---------- */
.tb-theme { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tb-theme svg { width: 17px; height: 17px; }
.tb-theme:hover { background: rgba(255,255,255,.24); }

/* ---------- Listas: buscador, orden, encabezado fijo ---------- */
.list-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.list-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; max-width: 380px; border: 1.5px solid var(--slate-200); border-radius: 8px; padding: 0 10px; background: var(--card); color: var(--slate-400); }
.list-search:focus-within { border-color: var(--indigo); color: var(--indigo); }
.list-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.list-search input { border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; padding: 9px 0; width: 100%; font-family: inherit; }
.list-count { font-size: 12px; color: var(--slate-400); }
table.data th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.data th.sortable:hover { filter: brightness(1.15); }
table.data th.sortable::after { content: "↕"; margin-left: 6px; opacity: .35; font-size: 10px; }
table.data th.sorted-asc::after { content: "▲"; opacity: 1; }
table.data th.sorted-desc::after { content: "▼"; opacity: 1; }
table.data th.sortable:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
@media (min-width: 761px) {
  .panel > table.data[data-lst] > thead th { position: sticky; top: 0; z-index: 3; }
}
td.nores { text-align: center; padding: 22px 10px; }

/* ---------- Estados vacíos y de carga ---------- */
table.data.is-empty thead { display: none; }
table.data.is-empty tbody tr, table.data.is-empty tbody tr:hover td { background: transparent; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 12px; text-align: center; }
.empty-state .es-ico { width: 54px; height: 54px; border-radius: 50%; background: var(--indigo-light); color: var(--indigo); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.empty-state .es-ico svg { width: 26px; height: 26px; }
.empty-state .es-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.empty-state .es-sub { font-size: 12.5px; color: var(--slate-400); margin-bottom: 8px; }
td.es-cell { border-bottom: 0 !important; font-size: 13px; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 0; color: var(--slate-400); font-size: 14px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--brand-wash); border-top-color: var(--indigo); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 400; background: linear-gradient(90deg, transparent, var(--indigo), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: busy 1s ease-in-out infinite; }
.busy-bar[hidden] { display: none; }
@keyframes busy { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-row input[type=color] { width: 44px; height: 36px; padding: 2px; border-radius: 8px; cursor: pointer; }
.color-row .swatches { display: flex; gap: 6px; }
.color-row .sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--slate-200); padding: 0; }

/* ---------- Formulario de documentos con líneas (factura, cotización, orden de compra) ---------- */
.modal.li-modal { width: min(1180px, 96vw); max-width: 96vw; max-height: 94vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; }
.li-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--slate-200); background: var(--indigo-light); }
.li-head h3 { margin: 0; font-size: 18px; }
.li-x { border: none; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; border-radius: 8px; width: 34px; height: 34px; }
.li-x:hover { background: var(--brand-wash); color: var(--navy); }
.li-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; padding: 18px 22px 22px; overflow-y: auto; align-items: start; }
.li-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.li-card { border: 1px solid var(--slate-200); border-radius: 12px; padding: 14px 16px; background: var(--card); }
.li-card h4 { margin: 0 0 10px; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.li-card .field { margin-bottom: 0; }
.li-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.extra-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 14px; }
.extra-grid .field.full { grid-column: 1 / -1; }
.extra-grid .field[hidden] { display: none; }
.field label.req::after { content: ' *'; color: var(--red); }
.li-modal input, .li-modal select, .li-modal textarea { transition: border-color .12s, box-shadow .12s; }
.li-modal input.invalid, .li-modal select.invalid, .li-modal textarea.invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.li-modal input:focus, .li-modal select:focus, .li-modal textarea:focus { box-shadow: 0 0 0 3px var(--brand-wash); }
.li-modal .combo input#tp-search { padding: 11px 12px; font-size: 15px; border: 1.5px solid var(--slate-200); border-radius: 8px; background: var(--card); color: var(--text); }
.li-modal .combo input#tp-search:focus { outline: none; border-color: var(--indigo); }
.tp-card { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--slate-light); font-size: 13px; color: var(--text); }
.tp-name { font-weight: 700; color: var(--navy); font-size: 14px; flex-basis: 100%; }
.tp-card span em { display: block; font-style: normal; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.tp-card .owes { color: var(--red); font-weight: 700; }
.tp-pad { font-size: 12px; font-weight: 600; }
.tp-pad.ok { color: var(--green); } .tp-pad.warn { color: var(--amber); }
/* tabla de líneas */
.li-table-wrap { overflow: visible; }  /* los desplegables de producto no deben quedar recortados */
table.data.li-table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data.li-table th { background: transparent; color: var(--muted); border-bottom: 2px solid var(--slate-200); padding: 6px 6px; font-size: 11px; }
table.data.li-table td { padding: 8px 6px; border-bottom: 1px solid var(--slate-200); vertical-align: top; }
table.data.li-table tr:hover td { background: transparent; }
.li-table .c-n { width: 28px; } .li-table .c-qty { width: 84px; } .li-table .c-price { width: 120px; } .li-table .c-rate { width: 80px; } .li-table .c-sub { width: 104px; text-align: right; } .li-table .c-x { width: 38px; }
#li-rows { counter-reset: ln; }
#li-rows tr { counter-increment: ln; }
.row-n::before { content: counter(ln); color: var(--muted); font-size: 12px; font-weight: 700; display: inline-block; padding-top: 10px; }
.li-modal .items-table input[type=text], .li-modal .items-table input[type=number] { width: 100%; box-sizing: border-box; height: 40px; font-size: 14px; padding: 8px 10px; border: 1.5px solid var(--slate-200); border-radius: 8px; background: var(--card); color: var(--text); }
.li-modal .items-table input:focus { outline: none; border-color: var(--indigo); }
.li-modal .items-table input[readonly] { background: var(--slate-light); color: var(--muted); }
.li-modal .items-table input.combo-ok { border-color: var(--green); }
.li-modal .items-table input[type=number] { text-align: right; }
.row-desc { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; resize: none; overflow: hidden; font: inherit; font-size: 12.5px; padding: 6px 8px; min-height: 32px; border: 1px dashed var(--slate-200); border-radius: 8px; background: transparent; color: var(--text); }
.row-desc:focus { outline: none; border-style: solid; border-color: var(--indigo); background: var(--card); }
.row-meta { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.row-meta.warn { color: var(--amber); font-weight: 600; }
.row-subtotal { text-align: right; font-weight: 700; color: var(--navy); padding-top: 18px !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-remove { border: none; background: transparent; color: var(--muted); width: 34px; height: 34px; margin-top: 3px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.row-remove:hover { background: var(--red-light); color: var(--red); }
.combo-sub.low { color: var(--red); }
.li-add { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.li-hints { font-size: 12px; color: var(--muted); }
/* resumen */
.li-sum .tag-line { font-size: 14px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.li-sum .tag-line.total { font-size: 24px; margin-top: 8px; padding-top: 10px; }
.li-alert { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: var(--amber-light); color: var(--amber); font-size: 12.5px; line-height: 1.4; border: 1px solid var(--amber); }
.li-alert div + div { margin-top: 6px; }
.li-actions { display: flex; gap: 8px; margin-top: 14px; }
.li-actions .btn { flex: 1; padding: 11px 14px; }
.li-actions .btn[type=submit] { flex: 2; }
/* vista previa */
.li-prev { padding: 12px; }
.lp-sheet { background: #fff; color: #0F172A; border: 1px solid #E2E8F0; border-radius: 8px; overflow: hidden; font-size: 10.5px; line-height: 1.35; padding-bottom: 8px; }
.lp-bar { height: 5px; background: var(--indigo); }
.lp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 9px 10px 6px; }
.lp-co { font-weight: 800; font-size: 11.5px; } .lp-co small { display: block; font-weight: 500; color: #64748B; font-size: 9.5px; }
.lp-doc { font-weight: 800; color: var(--indigo); text-align: right; text-transform: uppercase; letter-spacing: .3px; font-size: 10.5px; }
.lp-cust { margin: 0 10px 6px; padding: 6px 8px; background: #F1F5F9; border-radius: 6px; font-weight: 600; }
.lp-cust small { display: block; color: #64748B; font-size: 9px; text-transform: uppercase; font-weight: 700; }
.lp-subj { margin: 0 10px 6px; font-weight: 700; color: var(--indigo); }
.lp-t { width: calc(100% - 20px); margin: 0 10px; border-collapse: collapse; }
.lp-t th { text-align: left; font-size: 9px; text-transform: uppercase; color: #64748B; border-bottom: 1.5px solid var(--indigo); padding: 3px 2px; }
.lp-t th:nth-child(n+2), .lp-t td:nth-child(n+2) { text-align: right; white-space: nowrap; padding-left: 6px; }
.lp-t td { padding: 3px 2px; border-bottom: 1px solid #E2E8F0; vertical-align: top; }
.lp-t td small { display: block; color: #64748B; font-size: 9px; }
.lp-t .lp-empty { text-align: center !important; color: #94A3B8; font-style: italic; }
.lp-tot { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin: 8px 10px 0; padding-top: 6px; border-top: 1.5px solid var(--indigo); }
.lp-tot span, .lp-tot b { text-align: right; }
.lp-tot span:nth-child(even), .lp-tot b:nth-child(even) { min-width: 70px; }
.lp-tot b { color: var(--indigo); font-size: 12px; }
@media (max-width: 960px) {
  .modal.li-modal { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; padding: 0; }
  .li-grid { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .li-table-wrap { overflow-x: auto; padding-bottom: 150px; margin-bottom: -150px; }
  .li-side { position: static; }
  .li-prev { display: none; }
}

/* ---------- WhatsApp ---------- */
.modal-overlay.wa-overlay { z-index: 200; }
.wa-modal { width: 520px; }
.wa-modal textarea { font-size: 13px; line-height: 1.45; }
.wa-save { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: -4px 0 12px; cursor: pointer; }
.wa-save[hidden] { display: none; }
.wa-steps { margin: 4px 0 0; padding-left: 20px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.btn.wa-go { background: #25D366; color: #06371b; font-weight: 800; }
.btn.wa-go:hover:not(:disabled) { background: #1FB857; }
.wa-modal input.invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

/* ---------- Modo oscuro ---------- */
html[data-theme="dark"] {
  --indigo: #3F73DC; --brand-hover: #5A86E6; --indigo-light: #14213F; --brand-wash: #1E3366; --navy: #E6ECF8;
  --slate: #C5CFDF; --slate-light: #1C2740; --slate-200: #2A3550; --slate-400: #8A98B3;
  --green: #4ADE80; --green-light: #0F2A1C; --amber: #FBBF24; --amber-light: #2B2410; --red: #F87171; --red-light: #331818;
  --bg: #0B1220; --card: #131C31; --text: #E6ECF8; --muted: #94A3B8; --hover: #1B2A4A; --zebra: #101A2E; --hover-soft: #17223C; --link: #7FA6F5;
  --tb1: #060E24; --tb2: #0A1A4A; --tb3: #0B2670; --nav-hover: #1B2A4A;
  color-scheme: dark;
}
html[data-theme="dark"] .btn.danger { background: #DC2626; color: #fff; }
html[data-theme="dark"] .btn.danger:hover:not(:disabled) { background: #B91C1C; }
html[data-theme="dark"] .toast { background: #1E2A47; color: #fff; }
html[data-theme="dark"] .toast.error { background: #B91C1C; }
html[data-theme="dark"] .toast.success { background: #15803D; }
html[data-theme="dark"] .confirm-overlay, html[data-theme="dark"] .modal-overlay { background: rgba(2,6,18,.7); }
html[data-theme="dark"] .badge.green { background: #12351F; }
html[data-theme="dark"] .tb-badge, html[data-theme="dark"] .auth-logo .badge-logo { background: #fff; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #64748B; }
/* los documentos impresos, tickets y la pantalla de acceso siempre se ven como papel claro */
.print-overlay, .auth-card, .tk {
  --indigo: #0037AA; --brand-hover: #002B88; --indigo-light: #EAF0FB; --brand-wash: #D6E2F7; --navy: #0B1F4D; --slate: #334155; --slate-light: #F1F5F9;
  --slate-200: #E2E8F0; --slate-400: #94A3B8; --green: #16A34A; --green-light: #F0FDF4; --amber: #B45309; --amber-light: #FFFBEB; --red: #DC2626; --red-light: #FEF2F2;
  --card: #fff; --text: #0F172A; --bg: #F8FAFC; --link: #0037AA; color-scheme: light;
}

/* ---------- POS: categorías y modo táctil ---------- */
.pos-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
.pos-chips[hidden] { display: none; }
.pos-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--slate-200); background: var(--card); color: var(--slate); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pos-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--cat); }
.pos-chip:hover { border-color: var(--cat, var(--indigo)); }
.pos-chip.on { background: var(--cat, var(--indigo)); border-color: var(--cat, var(--indigo)); color: #fff; }
.pos-chip.on i { background: #fff; }
.pos-card-name { color: var(--text); }
@media (pointer: coarse), (max-width: 900px) {
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .pos-card { min-height: 108px; padding: 12px; }
  .pos-card-name { font-size: 14px; }
  .pos-card-price { font-size: 15px; }
  .pos-chip { padding: 10px 16px; font-size: 13.5px; }
  .pos-search input { padding: 14px; font-size: 16px; }
  .pos-search select { display: none; }
  .pos-doc button { padding: 12px 8px; font-size: 13px; }
  .pos-qty button { width: 40px; height: 40px; font-size: 20px; }
  .pos-qty-in { height: 40px; width: 58px; font-size: 15px; }
  .pos-x { font-size: 20px; padding: 8px 10px; }
  .pos-actions .btn { padding: 16px; font-size: 15px; }
  .pos-bar .btn { padding: 10px 14px; font-size: 13px; }
}
.pos-search input { min-width: 0; }

/* ====================================================================
   MÓVIL (solo pantallas pequeñas; el escritorio no cambia)
   ==================================================================== */
.list-sort { display: none; }
/* --- barra de accesos rápidos inferior (celular / tablet) --- */
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--card); border-top: 1px solid var(--slate-200); box-shadow: 0 -4px 16px rgba(0,20,60,.08); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; border-radius: 10px; font-family: inherit; -webkit-tap-highlight-color: transparent; }
  .bn-item .ni { display: inline-flex; width: 22px; height: 22px; }
  .bn-item .ni svg { width: 22px; height: 22px; }
  .bn-item.active { color: var(--indigo); background: var(--indigo-light); }
  .content { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* con el teclado abierto la barra estorba: se esconde */
  body:has(input:focus, textarea:focus, select:focus) .bottom-nav { display: none; }
}

/* --- teclado, tamaños y áreas táctiles --- */
@media (max-width: 700px) {
  input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=file]), select, textarea { font-size: 16px !important; }
  .field input:not([type=checkbox]):not([type=radio]), .field select { min-height: 44px; }
  .field label { font-size: 12px; }
  table.data.stack td { font-size: 14px; }
  .row-meta, .combo-sub { font-size: 12.5px; }
}
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; padding-left: 12px; padding-right: 12px; }
  .nav-item, .nav-section { min-height: 44px; }
  .pill, .tb-theme { min-height: 36px; }
  .more-menu .btn { min-height: 44px; }
  .row-actions { gap: 8px; }
}

/* --- vista previa de documentos en pantalla pequeña (solo en pantalla: el papel / PDF no cambia) --- */
@media screen and (max-width: 700px) {
  .print-overlay { padding-bottom: calc(24px + env(safe-area-inset-bottom)); overflow-x: hidden; }
  .print-toolbar { padding: 8px 10px; gap: 8px; }
  .print-toolbar > span:first-child { display: none; }
  .print-toolbar > span:last-child { display: flex; gap: 8px; width: 100%; }
  .print-toolbar .btn { flex: 1; padding: 10px 6px; font-size: 14px; margin: 0; }
  .print-sheet { width: auto; max-width: none; min-height: 0; margin: 10px; padding: 18px 14px; }
  /* factura / cotización */
  .rf-top { flex-direction: column; gap: 12px; }
  .rf-doctype { text-align: left; }
  .rf-title { font-size: 19px; }
  .rf-ncf { flex-wrap: wrap; }
  .rf-info { grid-template-columns: 1fr; margin-top: 14px; }
  .rf-table { font-size: 11.5px; }
  .rf-table th { padding: 7px 5px; font-size: 9.5px; letter-spacing: .3px; white-space: normal; }
  .rf-table td { padding: 7px 5px; }
  .rf-table .c { width: 34px; }
  .rf-table .r { width: auto; }
  .rf-sum { flex-direction: column; gap: 12px; }
  .rf-totals { width: 100%; }
  .rf-totals td { padding: 6px 12px; }
  .rf-totals .val { width: auto; }
  .rf-words { width: 100%; box-sizing: border-box; }
  .rf-receive { gap: 18px; margin-top: 24px; }
  .rf-receive .rf-rc-date { flex: 0 0 90px; }
  .rf-bottom { flex-direction: column; gap: 14px; text-align: center; }
  .rf-qr { width: auto; }
  .rf-qr svg { max-width: 130px; margin: 0 auto; display: block; }
  .rf-contact { width: 100%; }
  /* orden de compra, estado de cuenta, recibo */
  .pd-band { flex-wrap: wrap; }
  .pd-band-right { flex-wrap: wrap; gap: 8px 14px; }
  .pd-boxes { flex-direction: column; gap: 10px; }
  .pd-table { font-size: 10px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pd-table th { font-size: 9px; letter-spacing: 0; }
  .pd-table th, .pd-table td { padding: 6px 3px; }
  .pd-table .r { white-space: nowrap; }
  .pd-po :is(th, td):first-child { display: none; }  /* orden de compra: se oculta el código para que quepa el importe */
  /* estado de cuenta: una tarjeta por factura */
  .pd-table.pd-st, .pd-st tbody { display: block; overflow: visible; }
  .pd-st thead { display: none; }
  .pd-st tbody tr { display: block; border: 1px solid var(--slate-200); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
  .pd-st tbody tr:nth-child(even) td { background: transparent; }
  .pd-st td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; font-size: 12px; text-align: right; }
  .pd-st td::before { content: attr(data-l); color: var(--slate-400); font-size: 10px; text-transform: uppercase; font-weight: 700; text-align: left; }
  .pd-st td:first-child { font-weight: 700; font-size: 13px; color: var(--navy); }
  .pd-totals-wrap { flex-direction: column; gap: 12px; }
  .pd-totals { width: 100%; }
  .pd-signatures { gap: 20px; margin-top: 36px; }
  .pd-watermark { font-size: 56px; }
}

@media (max-width: 700px) {
  /* --- listas como tarjetas --- */
  .panel:has(> table.data.stack) { background: transparent; border: 0; padding: 0; overflow: visible; }
  table.data.stack, table.data.stack tbody { display: block; width: 100%; }
  table.data.stack thead { display: none; }
  table.data.stack tbody tr { display: block; background: var(--card); border: 1px solid var(--slate-200); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,20,60,.05); }
  table.data.stack tbody tr[hidden] { display: none; }
  table.data.stack tbody tr td { display: flow-root; padding: 5px 0; border: 0; background: transparent !important; text-align: right; white-space: normal; width: auto; overflow-wrap: anywhere; }
  table.data.stack td::before { content: attr(data-label); float: left; max-width: 42%; margin-right: 12px; text-align: left; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; line-height: 1.8; }
  table.data.stack td[data-label=""]::before { display: none; }
  table.data.stack td:empty { display: none; }
  table.data.stack td.num { white-space: normal; }
  table.data.stack td.st-title { text-align: left; font-weight: 700; font-size: 14.5px; color: var(--navy); padding: 0 0 7px; margin-bottom: 4px; border-bottom: 1px solid var(--slate-200); }
  table.data.stack td.st-title::before { display: none; }
  table.data.stack tbody tr td.st-actions { width: auto; white-space: normal; padding-top: 9px; margin-top: 4px; border-top: 1px solid var(--slate-200); overflow: visible; }
  table.data.stack td.st-actions::before { display: none; }
  table.data.stack td.st-actions .row-actions { flex-wrap: wrap; }
  .list-tools { flex-wrap: wrap; gap: 8px; }
  .list-tools .list-search { flex: 1 1 100%; max-width: none; }
  .list-sort { display: block; flex: 1 1 140px; min-width: 0; border: 1.5px solid var(--slate-200); border-radius: 8px; padding: 8px 10px; background: var(--card); color: var(--text); font-size: 13px; font-family: inherit; }
}

@media (max-width: 700px) {
  /* --- formulario de factura / cotización / orden: líneas como mini tarjetas --- */
  .modal.li-modal { height: 100dvh; max-height: 100dvh; }
  .li-head { padding: 12px 16px; }
  .li-grid { padding: 12px; gap: 12px; }
  .li-card { padding: 12px; }
  .li-table-wrap { overflow: visible; padding-bottom: 0; margin-bottom: 0; }
  table.data.li-table, table.data.li-table tbody { display: block; min-width: 0; width: 100%; }
  table.data.li-table thead { display: none; }
  #li-rows tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 10px; align-items: end; border: 1px solid var(--slate-200); border-radius: 12px; padding: 10px 12px 12px; margin-bottom: 10px; background: var(--card); }
  table.data.li-table tbody tr td, table.data.li-table tbody tr:hover td { background: transparent !important; }
  #li-rows td { display: block; padding: 0; border: 0; width: auto; min-width: 0; }
  #li-rows td.row-n { grid-column: 1 / 3; grid-row: 1; align-self: center; }
  .row-n::before { content: "Línea " counter(ln); padding-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
  #li-rows td:last-child { grid-column: 3; grid-row: 1; justify-self: end; align-self: center; }
  #li-rows td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  #li-rows td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 3px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
  #li-rows td.row-subtotal { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 0 !important; border-top: 1px dashed var(--slate-200); font-size: 15px; }
  #li-rows td.row-subtotal::before { content: "Subtotal"; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
  .row-remove { width: 40px; height: 40px; margin: 0; }
  .li-modal .items-table input[type=text], .li-modal .items-table input[type=number] { height: 44px; font-size: 16px; }
  .li-add .li-hints { display: none; }
  .li-add .btn { width: 100%; padding: 12px; }
  .combo-item { padding: 12px 14px; font-size: 15px; min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; box-sizing: border-box; }
  .combo-list { max-height: 50vh; }
  /* resumen y botones fijos abajo */
  .li-side { display: contents; }
  .li-modal .li-sum { position: sticky; bottom: -12px; z-index: 6; margin: 0 -12px -12px; border-radius: 14px 14px 0 0; border-width: 1px 0 0; box-shadow: 0 -6px 20px rgba(0,20,60,.14); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
  .li-sum h4, .li-sum > .tag-line:first-of-type { display: none; }
  .li-sum .tag-line { font-size: 12px; padding: 0; color: var(--muted); }
  .li-sum .tag-line.total { grid-column: 1 / -1; font-size: 20px; margin: 2px 0 0; padding-top: 6px; color: var(--navy); }
  .li-sum .li-alert { grid-column: 1 / -1; max-height: 64px; overflow-y: auto; margin-top: 6px; font-size: 12px; }
  .li-sum .li-actions { grid-column: 1 / -1; margin-top: 8px; }
  .li-actions .btn { padding: 13px 14px; font-size: 15px; }
}

/* --- Empresas: modal con introducción, casillas y aviso de peligro --- */
.modal-intro { font-size: 13px; color: var(--slate-600, #475569); margin: -6px 0 14px; line-height: 1.45; }
.warn-box { background: var(--red-light, #FEE2E2); color: #7F1D1D; border: 1px solid #FCA5A5; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.warn-box code { font-size: 12px; }
.checks-group { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow: auto; border: 1px solid var(--slate-200, #E2E8F0); border-radius: 8px; padding: 6px 8px; }
.field .check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: inherit; text-transform: none; padding: 6px 2px; cursor: pointer; }
.check-row input { width: auto; margin: 0; }
html[data-theme="dark"] .warn-box { background: #3B1212; color: #FECACA; border-color: #7F1D1D; }
@media (max-width: 700px) { .checks-group { max-height: 40vh; } .field .check-row { padding: 10px 2px; font-size: 15px; } }

.dup-warn { margin-top: 4px; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; background: #FEF3C7; color: #78350F; border: 1px solid #FCD34D; }
html[data-theme="dark"] .dup-warn { background: #3B2A06; color: #FDE68A; border-color: #92400E; }

/* --- Menú lateral: buscador, favoritos (estrella) y resultados --- */
.nav-search { padding: 0 12px 10px; position: sticky; top: 0; z-index: 2; background: var(--indigo-light); }
.nav-search input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--slate-200); border-radius: 8px; font-size: 13px; background: #fff; color: var(--navy); }
.nav-search input:focus { outline: 2px solid var(--indigo); outline-offset: 0; border-color: var(--indigo); }
.nav-row { position: relative; }
.nav-row .nav-item { padding-right: 36px; }
.nav-star { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; font-size: 15px; line-height: 1; padding: 4px; color: var(--slate-400); opacity: 0; transition: opacity .12s; }
.nav-row:hover .nav-star, .nav-star:focus-visible, .nav-star.on { opacity: 1; }
.nav-star.on { color: #D97706; }
.nav-star:hover { color: #D97706; }
.nav-row:has(.nav-item.active) .nav-star { color: #fff; }
.nav-row:has(.nav-item.active) .nav-star.on { color: #FCD34D; }
.nav-section.static { cursor: default; }
.nav-section.static:hover { background: transparent; }
.nav-favs .nav-section .ni { color: #D97706; }
.nav-results { padding: 0 8px 12px; }
.nav-hit { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--navy); text-decoration: none; font-size: 13px; }
.nav-hit .nl small { display: block; font-size: 11px; color: var(--slate-400); }
.nav-hit:hover, .nav-hit.sel { background: var(--nav-hover); }
.nav-hit.sel { outline: 1px solid var(--indigo); }
.nav-hit .ni { color: var(--indigo); }
.nav-empty { padding: 10px 12px; font-size: 12px; color: var(--slate-400); line-height: 1.4; }
html[data-theme="dark"] .nav-search { background: var(--indigo-light); }
html[data-theme="dark"] .nav-search input { background: rgba(255,255,255,.06); color: inherit; border-color: rgba(255,255,255,.14); }
@media (pointer: coarse), (max-width: 900px) { .nav-star { opacity: .75; padding: 10px; right: 8px; } .nav-star.on { opacity: 1; } .nav-search input { font-size: 16px; padding: 10px; } .nav-hit { min-height: 44px; } }

/* --- Menú: grupo único, subtítulos de Configuración, atajos --- */
.nav-search { display: flex; gap: 6px; align-items: center; }
.nav-search input { flex: 1; min-width: 0; }
.nav-single { flex: none; width: 34px; height: 34px; border: 1px solid var(--slate-200); border-radius: 8px; background: #fff; color: var(--slate-400); cursor: pointer; display: grid; place-items: center; padding: 0; }
.nav-single .ni { width: 18px; height: 18px; display: block; color: inherit; }
.nav-single.on { background: var(--indigo); border-color: var(--indigo); color: #fff; }
html[data-theme="dark"] .nav-single { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
html[data-theme="dark"] .nav-single.on { background: var(--indigo); }
.nav-group.nav-config { margin-top: 8px; border-top: 1px solid var(--slate-200); padding-top: 6px; }
.nav-sub { padding: 8px 20px 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--slate-400); }
.nav-foot { padding: 14px 20px 18px; font-size: 11.5px; color: var(--slate-400); }
kbd { display: inline-block; min-width: 18px; padding: 1px 6px; border: 1px solid var(--slate-200); border-bottom-width: 2px; border-radius: 5px; background: #fff; color: var(--navy); font-weight: 600; font-size: 12px; line-height: 1.5; text-align: center; }
html[data-theme="dark"] kbd { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: inherit; }
.kbd-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; align-items: center; margin: 12px 0 4px; font-size: 14px; }
@media (max-width: 900px), (pointer: coarse) { .nav-foot { display: none; } .nav-single { width: 44px; height: 44px; } }

.tb-account { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; }
.tb-account:hover, .tb-account:focus-visible { background: rgba(255,255,255,.14); outline: none; }

.auth-alt { text-align: center; margin: 14px 0 0; font-size: 13px; }
.auth-alt a { color: var(--indigo); text-decoration: none; font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }
.ok-msg { background: #DCFCE7; color: #14532D; border: 1px solid #86EFAC; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin-bottom: 12px; }
.ok-inline { color: #15803D; }
html[data-theme="dark"] .ok-msg { background: #052E16; color: #BBF7D0; border-color: #166534; }
.btn.danger-text { color: var(--red); border-color: var(--red); }

/* formularios de dos columnas pasan a una en pantallas chicas */
.grid2 > .field { min-width: 0; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }

[hidden] { display: none !important; }
