/* Cotizador Kreuzen — "papel y grafito" */
@font-face { font-family: 'Geist'; src: url('/fonts/geist-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-600.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono-500.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif-400i.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --paper: #F3F1EC; --paper-2: #EAE7E0; --card: #FBFAF7; --card-2: #F6F4EF;
  --ink: #1C1D1F; --ink-2: #48494D; --muted: #6B6963; --hair: #DCD8CF; --hair-2: #CBC6BB;
  --accent: #B4431A; --accent-2: #9A3713; --accent-soft: #F6E3DA; --on-accent: #fff;
  --ok: #2E6A4D; --ok-soft: #DDEBE2; --warn: #9A6514; --warn-soft: #F3E6CF;
  --shadow: 0 1px 0 rgba(28,29,31,.04), 0 12px 32px -18px rgba(28,29,31,.28);
  --shadow-lg: 0 30px 80px -30px rgba(28,29,31,.45);
  --cross: rgba(28,29,31,.07);
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --r: 14px; --r-sm: 9px; --rail: 264px;
  --ease: cubic-bezier(.2,.75,.15,1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131416; --paper-2: #0E0F10; --card: #1A1B1D; --card-2: #202124;
    --ink: #ECEAE5; --ink-2: #BCBAB4; --muted: #96948E; --hair: #2B2C30; --hair-2: #3A3B40;
    --accent: #EE6A3D; --accent-2: #FF8257; --accent-soft: #3A2219; --on-accent: #160C08;
    --ok: #6FC39A; --ok-soft: #173126; --warn: #E3AE5A; --warn-soft: #33270F;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 16px 40px -20px rgba(0,0,0,.7); --shadow-lg: 0 30px 80px -30px rgba(0,0,0,.85);
    --cross: rgba(236,234,229,.05); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131416; --paper-2: #0E0F10; --card: #1A1B1D; --card-2: #202124;
  --ink: #ECEAE5; --ink-2: #BCBAB4; --muted: #96948E; --hair: #2B2C30; --hair-2: #3A3B40;
  --accent: #EE6A3D; --accent-2: #FF8257; --accent-soft: #3A2219; --on-accent: #160C08;
  --ok: #6FC39A; --ok-soft: #173126; --warn: #E3AE5A; --warn-soft: #33270F;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 16px 40px -20px rgba(0,0,0,.7); --shadow-lg: 0 30px 80px -30px rgba(0,0,0,.85);
  --cross: rgba(236,234,229,.05); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 400 14.5px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11"; min-height: 100dvh; overflow-x: hidden;
}
/* Trama de cruces: el signo de kreuzen como textura de fondo */
.trama { position: fixed; inset: 0; pointer-events: none; z-index: 0; background-image: var(--trama); background-size: 48px 48px; background-position: -24px -24px; }
:root { --trama: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 20v8M20 24h8' stroke='%231C1D1F' stroke-opacity='.075' stroke-width='1'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] { --trama: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 20v8M20 24h8' stroke='%23ECEAE5' stroke-opacity='.06' stroke-width='1'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --trama: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M24 20v8M20 24h8' stroke='%23ECEAE5' stroke-opacity='.06' stroke-width='1'/%3E%3C/svg%3E"); } }

h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mono { font-family: var(--mono); font-feature-settings: "zero"; letter-spacing: -.01em; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.eyebrow { font: 500 10.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.accent { color: var(--accent); }

/* ===================== Login ===================== */
.login { position: relative; z-index: 1; min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-arte { position: relative; background: #17181A; color: #EDEBE6; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px; isolation: isolate; }
.login-arte .marca { display: flex; align-items: center; gap: 12px; }
.login-arte .marca .mk { width: 40px; height: 32px; background: #EDEBE6; -webkit-mask: url('/img/mark.png') center/contain no-repeat; mask: url('/img/mark.png') center/contain no-repeat; }
.login-arte .marca .wm { width: 104px; height: 24px; background: #EDEBE6; -webkit-mask: url('/img/wordmark.png') left center/contain no-repeat; mask: url('/img/wordmark.png') left center/contain no-repeat; }
.login-arte h1 { font: 400 clamp(52px, 7.2vw, 112px)/.92 var(--serif); letter-spacing: -.03em; max-width: 9ch; }
.login-arte h1 em { font-style: italic; color: #F0663A; }
.login-arte .pie { display: flex; justify-content: space-between; font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #8C8A84; }
.login-cruces { position: absolute; inset: 0; z-index: -1; }
.login-cruces i { position: absolute; width: 18px; height: 18px; transform: translate(-50%, -50%); opacity: 0; animation: cruzIn .9s var(--ease) forwards; }
.login-cruces i::before, .login-cruces i::after { content: ""; position: absolute; background: #3B3C40; }
.login-cruces i::before { left: 0; right: 0; top: 50%; height: 1px; }
.login-cruces i::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.login-cruces i.on::before, .login-cruces i.on::after { background: #F0663A; }
@keyframes cruzIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-45deg); } to { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); } }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-form form { width: min(380px, 100%); display: grid; gap: 18px; }
.login-form h2 { font: 400 40px/1 var(--serif); letter-spacing: -.02em; }
.login-form .sub { color: var(--muted); margin-top: -8px; }
.login-error { color: var(--accent); font-size: 13.5px; min-height: 20px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-arte { padding: 26px 22px 30px; min-height: 300px; }
  .login-arte h1 { font-size: 58px; margin-top: 40px; }
  .login-arte .pie { display: none; }
}

/* ===================== Campos y botones ===================== */
.campo { display: grid; gap: 7px; min-width: 0; }
.campo > span, .campo > label { font: 500 10.5px/1.2 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.input, .campo input, .campo select, .campo textarea {
  width: 100%; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 11px 13px; min-height: 44px;
  transition: border-color .18s, box-shadow .18s, background .18s; outline: none;
}
.campo textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
.input:hover, .campo input:hover, .campo select:hover, .campo textarea:hover { border-color: var(--hair-2); }
.input:focus, .campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.campo input[type="date"] { font-family: var(--mono); font-size: 13.5px; }
.campo .ayuda { font-size: 12.5px; color: var(--muted); }
.campo.invalido input, .campo.invalido textarea { border-color: var(--accent); }
.fila { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
@media (max-width: 640px) { .fila { grid-template-columns: 1fr; } .fila > * { grid-column: auto !important; } }

.btn {
  --bg: var(--card); --fg: var(--ink); --bd: var(--hair);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--bd); background: var(--bg); color: var(--fg); cursor: pointer;
  font: 500 14px/1 var(--sans); letter-spacing: -.005em; white-space: nowrap; text-decoration: none;
  transition: transform .16s var(--ease), background .18s, border-color .18s, box-shadow .2s, color .18s; user-select: none;
}
.btn:hover { border-color: var(--hair-2); background: var(--card-2); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled], .btn.cargando { opacity: .5; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primario { --bg: var(--ink); --fg: var(--paper); --bd: var(--ink); }
.btn.primario:hover { --bg: color-mix(in srgb, var(--ink) 86%, var(--accent)); box-shadow: 0 10px 24px -14px var(--ink); }
.btn.acento { --bg: var(--accent); --fg: var(--on-accent); --bd: var(--accent); }
.btn.acento:hover { --bg: var(--accent-2); box-shadow: 0 10px 26px -12px var(--accent); }
.btn.fantasma { --bg: transparent; --bd: transparent; }
.btn.fantasma:hover { --bg: var(--paper-2); }
.btn.peligro { --fg: var(--accent); }
.btn.chico { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.icono { width: 42px; padding: 0; }
.btn.chico.icono { width: 34px; }
.btn.ancho { width: 100%; }
.btn .spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: giro .7s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.grupo-btn { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ===================== Estructura ===================== */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 22px; padding: 26px 18px 18px;
  border-right: 1px solid var(--hair); background: color-mix(in srgb, var(--paper) 70%, var(--card));
}
.rail .marca { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; }
.mk, .wm { display: block; background: var(--ink); }
.mk { width: 34px; height: 27px; -webkit-mask: url('/img/mark.png') center/contain no-repeat; mask: url('/img/mark.png') center/contain no-repeat; }
.wm { width: 92px; height: 21px; -webkit-mask: url('/img/wordmark.png') left center/contain no-repeat; mask: url('/img/wordmark.png') left center/contain no-repeat; }
.nav { display: grid; gap: 2px; }
.nav a {
  position: relative; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px;
  text-decoration: none; color: var(--ink-2); font-weight: 500; transition: background .18s, color .18s;
}
.nav a .n { font: 500 10.5px var(--mono); color: var(--muted); letter-spacing: .06em; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.activo { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.nav a.activo .n { color: var(--accent); }
.nav a .badge { font: 500 10.5px var(--mono); background: var(--accent-soft); color: var(--accent); padding: 2px 7px; border-radius: 99px; }

.termometro { margin-top: auto; padding: 18px 16px 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--hair); position: relative; overflow: hidden; }
.termometro .monto { font: 400 34px/1 var(--serif); letter-spacing: -.02em; margin: 10px 0 4px; }
.termometro .meta { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.barra { position: relative; height: 8px; border-radius: 99px; background: var(--paper-2); margin: 14px 0 9px; overflow: visible; }
.barra > i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: var(--ink); transition: width 1.2s var(--ease); }
.barra > i.lleno { background: var(--accent); }
.barra > b { position: absolute; top: 50%; right: 0; width: 13px; height: 13px; transform: translate(50%, -50%); }
.barra > b::before, .barra > b::after { content: ""; position: absolute; background: var(--accent); }
.barra > b::before { left: 0; right: 0; top: 6px; height: 1px; }
.barra > b::after { top: 0; bottom: 0; left: 6px; width: 1px; }
.rail .yo { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--hair); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font: 500 12px var(--mono); flex: none; }
.yo .quien { min-width: 0; flex: 1; line-height: 1.25; }
.yo .quien b { display: block; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yo .quien small { color: var(--muted); font-size: 12px; }

.main { min-width: 0; padding: 34px clamp(18px, 3.4vw, 52px) 80px; }
.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.cabecera h1 { font: 400 clamp(38px, 4.6vw, 60px)/.95 var(--serif); letter-spacing: -.03em; }
.cabecera h1 em { font-style: italic; color: var(--muted); }
.cabecera .eyebrow { margin-bottom: 12px; display: flex; gap: 10px; align-items: center; }
.cabecera .eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); }

.topbar { display: none; }
.tabbar { display: none; }

@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
    border-bottom: 1px solid var(--hair);
  }
  .topbar .mk { width: 28px; height: 22px; }
  .topbar .mini { margin-left: auto; display: grid; gap: 4px; justify-items: end; text-decoration: none; min-width: 120px; }
  .topbar .mini b { font: 400 21px/1 var(--serif); }
  .topbar .mini .barra { width: 120px; margin: 0; height: 4px; }
  .topbar .mini .barra > b { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-top: 1px solid var(--hair); padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none; text-decoration: none; color: var(--muted); font: 500 10.5px var(--sans); border-radius: 10px; cursor: pointer; min-height: 48px; }
  .tabbar svg { width: 21px; height: 21px; }
  .tabbar .activo { color: var(--ink); }
  .tabbar .activo svg { color: var(--accent); }
  .main { padding: 22px 16px calc(110px + env(safe-area-inset-bottom)); }
  .cabecera { margin-bottom: 20px; }
}

/* ===================== Tarjetas y listas ===================== */
.tarjeta { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--shadow); }
.tarjeta.pad { padding: 22px; }
.registro { position: relative; }
.registro::before, .registro::after { content: ""; position: absolute; width: 11px; height: 11px; pointer-events: none;
  background: linear-gradient(var(--hair-2), var(--hair-2)) center/100% 1px no-repeat, linear-gradient(var(--hair-2), var(--hair-2)) center/1px 100% no-repeat; }
.registro::before { top: -6px; left: -6px; }
.registro::after { bottom: -6px; right: -6px; }
.seccion-t { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }
.seccion-t h2 { font: 400 28px/1 var(--serif); letter-spacing: -.02em; }
.vacio { padding: 46px 20px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.vacio .serif { font-size: 26px; color: var(--ink-2); }

.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.buscar { position: relative; flex: 1 1 260px; }
.buscar svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.buscar input { padding-left: 39px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--hair); background: var(--card); border-radius: 99px; padding: 7px 13px; font: 500 12.5px var(--sans); cursor: pointer; color: var(--ink-2); min-height: 36px; transition: all .16s; }
.chip:hover { border-color: var(--hair-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.lista { display: grid; }
.item {
  display: grid; grid-template-columns: 86px minmax(0, 1.6fr) 104px 130px 150px; gap: 16px; align-items: center; padding: 15px 18px;
  border-bottom: 1px solid var(--hair); text-decoration: none; color: inherit; cursor: pointer; transition: background .15s; position: relative;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--card-2); }
.item:hover .folio { color: var(--accent); }
.item .folio { font: 500 13px var(--mono); color: var(--ink-2); transition: color .15s; }
.item .quien { min-width: 0; }
.item .quien b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .quien small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .fecha { font: 400 12.5px var(--mono); color: var(--muted); }
.item .total { font: 400 22px/1 var(--serif); text-align: right; letter-spacing: -.01em; }
.item.compacta { grid-template-columns: 82px minmax(0, 1fr) 118px 120px; }
.lista-cab { display: grid; grid-template-columns: 86px minmax(0, 1.6fr) 104px 130px 150px; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--hair); }
.lista-cab span:nth-child(4) { text-align: right; }
@media (max-width: 860px) {
  .lista-cab { display: none; }
  .item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "folio total" "quien quien" "fecha estado"; gap: 6px 12px; padding: 15px 16px; }
  .item.compacta { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "folio total" "quien quien" "fecha estado"; }
  .item .folio { grid-area: folio; } .item .quien { grid-area: quien; } .item .fecha { grid-area: fecha; align-self: center; } .item .total { grid-area: total; } .item .estado { grid-area: estado; justify-self: end; }
}

.estado { display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--sans); white-space: nowrap; }
.estado .pista { display: inline-grid; grid-template-columns: 4fr 6fr; gap: 2px; width: 46px; height: 5px; }
.estado .pista i { border-radius: 2px; background: var(--hair); }
.estado.parcial .pista i:first-child { background: var(--ink); }
.estado.pagada .pista i { background: var(--ok); }
.estado.pagada { color: var(--ok); }
.estado.sin_pago { color: var(--muted); }
.estado.parcial { color: var(--ink); }

.kpis { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 0; border: 1px solid var(--hair); border-radius: var(--r); background: var(--card); overflow: hidden; }
.kpi { padding: 18px 20px 20px; border-right: 1px solid var(--hair); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi .v { font: 400 clamp(26px, 2.6vw, 36px)/1 var(--serif); letter-spacing: -.02em; margin-top: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .d { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kpi.acento .v { color: var(--accent); }
@media (max-width: 860px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi:nth-child(2n) { border-right: 0; } .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--hair); } }

/* ===================== Cotizador ===================== */
.cotizador { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 28px; align-items: start; }
@media (max-width: 1280px) { .cotizador { grid-template-columns: 1fr; } .previa-col { display: none; } }
.bloque { padding: 22px; display: grid; gap: 16px; }
.bloque + .bloque { border-top: 1px solid var(--hair); }
.bloque-t { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bloque-t h3 { font: 400 23px/1 var(--serif); letter-spacing: -.01em; }
.lineas { display: grid; gap: 10px; }
.linea {
  display: grid; grid-template-columns: 26px 92px 150px minmax(0, 1fr) 34px; grid-template-areas: "n desc desc desc quitar" ". cant unit sub sub";
  gap: 10px; align-items: end; padding: 12px; border-radius: 12px;
  background: var(--card-2); border: 1px solid transparent; transition: border-color .2s, background .2s; animation: aparece .35s var(--ease);
}
.linea:focus-within { border-color: var(--hair-2); background: var(--card); }
.linea .n { grid-area: n; align-self: start; font: 500 12px var(--mono); color: var(--muted); padding-top: 13px; }
.linea .c-desc { grid-area: desc; } .linea .c-cant { grid-area: cant; } .linea .c-unit { grid-area: unit; }
.linea textarea { min-height: 44px; resize: none; overflow: hidden; line-height: 1.5; }
.linea .sub { grid-area: sub; font: 400 20px/44px var(--serif); text-align: right; color: var(--ink); white-space: nowrap; }
.linea .quitar { grid-area: quitar; align-self: start; margin-top: 5px; }
.linea input.num { text-align: right; font-family: var(--mono); font-size: 13.5px; }
.linea .c-desc .etq { display: none; }
.linea .etq { display: block; font: 500 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
@media (max-width: 760px) {
  .linea { grid-template-columns: 22px 1fr 1fr 34px; grid-template-areas: "n desc desc quitar" ". cant unit unit" ". sub sub sub"; }
  .linea .sub { line-height: 1.2; }
}
.totalbar {
  position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 14px 14px 22px; margin-top: 16px; border-radius: 18px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lg);
}
.totalbar .t { display: grid; gap: 2px; }
.totalbar .t .eyebrow { color: color-mix(in srgb, var(--paper) 55%, transparent); }
.totalbar .t b { font: 400 34px/1 var(--serif); letter-spacing: -.02em; }
.totalbar .split { font: 400 12px var(--mono); color: color-mix(in srgb, var(--paper) 60%, transparent); }
.totalbar .btn { --bg: var(--paper); --fg: var(--ink); --bd: var(--paper); }
.totalbar .btn.fantasma { --bg: transparent; --fg: var(--paper); --bd: color-mix(in srgb, var(--paper) 25%, transparent); }
@media (max-width: 1023px) { .totalbar { bottom: calc(78px + env(safe-area-inset-bottom)); } }
@media (max-width: 640px) {
  .totalbar { flex-wrap: nowrap; padding: 10px 10px 10px 16px; gap: 10px; border-radius: 16px; }
  .totalbar .t b { font-size: 26px; } .totalbar .split, .totalbar .t .eyebrow { display: none; }
  .totalbar .btn { padding: 0 14px; font-size: 13.5px; } .totalbar .btn.fantasma { display: none; }
}

/* Vista previa en papel */
.previa-col { position: sticky; top: 24px; }
.papel {
  aspect-ratio: 210 / 297; background: #FDFCFA; color: #1E1F21; border-radius: 4px; box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 40px 80px -40px rgba(28,29,31,.5), 0 0 0 1px rgba(28,29,31,.06);
  padding: 9% 8.5%; font-size: 9.2px; line-height: 1.45; position: relative; overflow: hidden; transform-origin: top center;
  container-type: inline-size;
}
.papel .cz { position: absolute; width: 10px; height: 10px; }
.papel .cz::before, .papel .cz::after { content: ""; position: absolute; background: #1E1F21; }
.papel .cz::before { left: 0; right: 0; top: 50%; height: .7px; } .papel .cz::after { top: 0; bottom: 0; left: 50%; width: .7px; }
.papel .cz:nth-child(1) { top: 3.4%; left: 3.4%; } .papel .cz:nth-child(2) { top: 3.4%; right: 3.4%; } .papel .cz:nth-child(3) { bottom: 3.4%; left: 3.4%; } .papel .cz:nth-child(4) { bottom: 3.4%; right: 3.4%; }
.papel .p-cab { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #1E1F21; padding-bottom: 4.2cqw; margin-bottom: 4cqw; }
.papel .p-marca { display: flex; align-items: center; gap: 1.6cqw; }
.papel .p-marca .mk { width: 7cqw; height: 5.5cqw; background: #2B2D30; }
.papel .p-marca .wm { width: 17cqw; height: 4cqw; background: #2B2D30; }
.papel .p-lema { font: italic 400 2.3cqw var(--serif); color: #7A7872; margin-top: 1.6cqw; }
.papel .p-tipo { text-align: right; }
.papel .p-tipo .e { font: 500 1.55cqw var(--mono); letter-spacing: .2em; color: #C8441C; text-transform: uppercase; }
.papel .p-tipo .f { font: 400 6.6cqw/1 var(--serif); margin-top: .6cqw; }
.papel .p-tipo .d { font: 400 1.5cqw var(--mono); letter-spacing: .18em; color: #7A7872; text-transform: uppercase; margin-top: 1cqw; }
.papel .p-datos { display: grid; grid-template-columns: 2.3fr 1fr 1.7fr; gap: 2cqw; margin-bottom: 4cqw; }
.papel .p-datos .e, .papel .p-th { font: 500 1.4cqw var(--mono); letter-spacing: .16em; color: #7A7872; text-transform: uppercase; }
.papel .p-datos .v { font: 500 2.05cqw/1.35 var(--sans); margin-top: .8cqw; word-break: break-word; }
.papel .p-tabla { display: grid; grid-template-columns: 4cqw 1fr 6cqw 14cqw 14cqw; }
.papel .p-th { background: #F6F4EF; padding: 1.4cqw .8cqw; }
.papel .p-th.r, .papel .p-td.r { text-align: right; }
.papel .p-td { padding: 1.6cqw .8cqw; border-bottom: .5px solid #D9D6CF; font: 400 1.95cqw/1.45 var(--sans); word-break: break-word; }
.papel .p-td.m { font: 400 1.75cqw/1.6 var(--mono); }
.papel .p-td.descr { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.papel .p-pie { display: flex; justify-content: space-between; gap: 4cqw; margin-top: 4cqw; }
.papel .p-nota { border-left: 2px solid #1E1F21; padding-left: 2cqw; font: 400 1.7cqw/1.5 var(--sans); color: #45464A; max-width: 52%; }
.papel .p-total { text-align: right; }
.papel .p-total .v { font: 400 7.2cqw/1 var(--serif); margin-top: 1cqw; border-bottom: 2px solid #C8441C; padding-bottom: 1.2cqw; }
.papel .p-total .s { font: 400 1.55cqw/1.8 var(--mono); color: #45464A; margin-top: 1.2cqw; }
.papel .p-vacio { color: #A9A6A0; font: italic 400 2.4cqw var(--serif); padding: 3cqw .8cqw; grid-column: 1 / -1; }
.papel .p-mas { grid-column: 1 / -1; font: 400 1.6cqw var(--mono); color: #7A7872; padding: 1.4cqw .8cqw; }

/* Combobox (autocompletar) */
.combo { position: relative; }
.combo-lista {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; background: var(--card); border: 1px solid var(--hair); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 300px; overflow: auto; animation: aparece .18s var(--ease);
}
.combo-lista button { display: grid; width: 100%; text-align: left; gap: 2px; padding: 9px 11px; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.combo-lista button small { color: var(--muted); font: 400 12px var(--mono); }
.combo-lista button[aria-selected="true"], .combo-lista button:hover { background: var(--paper-2); }
.combo-lista mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ===================== Panel lateral (detalle) y diálogos ===================== */
.velo { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, #0B0B0C 42%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: velo .25s ease; }
@keyframes velo { from { opacity: 0; } }
.cajon {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(640px, 100vw); background: var(--paper); border-left: 1px solid var(--hair);
  display: flex; flex-direction: column; animation: cajon .42s var(--ease); box-shadow: var(--shadow-lg);
}
@keyframes cajon { from { transform: translateX(40px); opacity: 0; } }
.cajon-cab { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--hair); }
.cajon-cuerpo { flex: 1; overflow: auto; padding: 22px 24px 40px; overscroll-behavior: contain; }
.cajon-pie { border-top: 1px solid var(--hair); padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 8px; flex-wrap: wrap; background: var(--card); }
@media (max-width: 640px) {
  .cajon { top: auto; left: 0; width: 100%; height: 92dvh; border-left: 0; border-radius: 20px 20px 0 0; animation: hoja .42s var(--ease); }
  @keyframes hoja { from { transform: translateY(60px); opacity: 0; } }
  .cajon-cuerpo { padding: 18px 16px 30px; }
}
.dialogo {
  position: fixed; z-index: 70; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow: auto;
  background: var(--card); border: 1px solid var(--hair); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 26px; animation: dlg .32s var(--ease);
}
@keyframes dlg { from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)) scale(.98); } }
.dialogo h3 { font: 400 30px/1.02 var(--serif); letter-spacing: -.02em; margin-bottom: 6px; }
.dialogo .acciones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.dialogo .cuerpo { display: grid; gap: 14px; margin-top: 16px; }

.det-folio { font: 400 54px/.95 var(--serif); letter-spacing: -.03em; }
.det-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 22px 0; padding: 16px 0; border-block: 1px solid var(--hair); }
.det-meta b { display: block; font-weight: 500; margin-top: 6px; word-break: break-word; }
@media (max-width: 560px) { .det-meta { grid-template-columns: 1fr 1fr; } }
.det-items { display: grid; gap: 0; }
.det-items .di { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.det-items .di .n { font: 500 11.5px var(--mono); color: var(--muted); padding-top: 2px; }
.det-items .di p { white-space: pre-line; }
.det-items .di .m { font: 400 13px var(--mono); text-align: right; white-space: nowrap; }
.det-items .di .m small { display: block; color: var(--muted); font-size: 11.5px; }
.det-items .di p.recortado { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.det-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; }
.det-total .serif { font-size: 40px; }

/* Línea de pagos 40 → 60 / 100 */
.ruta { display: grid; gap: 10px; margin-top: 10px; }
.paso { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 12px; background: var(--card); }
.paso .dot { width: 36px; height: 36px; border-radius: 50%; border: 1px dashed var(--hair-2); display: grid; place-items: center; font: 500 11px var(--mono); color: var(--muted); }
.paso.hecho .dot { border: 0; background: var(--ink); color: var(--paper); }
.paso.hecho .dot svg { width: 16px; height: 16px; }
.paso.bloq { opacity: .55; }
.paso b { font-weight: 500; }
.paso small { display: block; color: var(--muted); font-size: 12.5px; }
.paso .monto { font: 400 20px var(--serif); }
.o { text-align: center; font: italic 400 15px var(--serif); color: var(--muted); }

.aviso { display: flex; gap: 12px; padding: 13px 15px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; align-items: flex-start; }
.aviso svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.aviso.ok { background: var(--ok-soft); color: var(--ok); }

/* Selector de pago */
.opciones-pago { display: grid; gap: 10px; }
.op-pago { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 15px 16px; border: 1px solid var(--hair); border-radius: 14px; cursor: pointer; background: var(--card); text-align: left; transition: all .18s; width: 100%; }
.op-pago:hover:not([disabled]) { border-color: var(--ink); transform: translateY(-1px); }
.op-pago[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.op-pago[disabled] { opacity: .45; cursor: not-allowed; }
.op-pago .pct { font: 400 30px/1 var(--serif); width: 66px; }
.op-pago small { display: block; color: var(--muted); font-size: 12.5px; }
.op-pago .v { font: 400 13.5px var(--mono); }

/* Éxito */
.exito { text-align: center; padding: 8px 0 4px; }
.exito .sello { width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); animation: sello .6s var(--ease); }
.exito .sello svg { width: 32px; height: 32px; }
@keyframes sello { from { transform: scale(.4) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.06); } }
.exito .grande { font: 400 46px/1 var(--serif); letter-spacing: -.02em; }
.acciones-doc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.acciones-doc .btn { flex-direction: column; height: auto; padding: 14px 8px; border-radius: 14px; gap: 7px; font-size: 13px; white-space: normal; }
.acciones-doc .btn svg { width: 20px; height: 20px; }

/* Toasts */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 28px)); pointer-events: none; }
@media (max-width: 1023px) { .toasts { bottom: calc(86px + env(safe-area-inset-bottom)); } }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast .35s var(--ease); }
.toast.error { background: var(--accent); color: var(--on-accent); }
.toast a { color: inherit; font-weight: 600; margin-left: auto; }
@keyframes toast { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ===================== Ficha de cliente ===================== */
.ficha-cab { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; margin-bottom: 24px; }
.ficha-cab h1 { font: 400 clamp(34px, 4vw, 54px)/1 var(--serif); letter-spacing: -.025em; }
.ficha-cab .datos { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; color: var(--ink-2); font-size: 13.5px; }
.ficha-cab .datos span { display: inline-flex; gap: 7px; align-items: center; }
.ficha-cab .datos svg { width: 15px; height: 15px; color: var(--muted); }
@media (max-width: 760px) { .ficha-cab { grid-template-columns: 1fr; } }
.columnas { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .columnas { grid-template-columns: 1fr; } }
.linea-tiempo { display: grid; gap: 0; }
.lt { display: grid; grid-template-columns: 86px 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--hair); }
.lt .f { font: 400 12px var(--mono); color: var(--muted); padding-top: 2px; }
.lt p { white-space: pre-line; }
.lt small { color: var(--muted); font-size: 12px; }
.clientes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 14px; }
.cli { min-width: 0; } .cli * { overflow-wrap: anywhere; }
.cli { padding: 20px; display: grid; gap: 14px; text-decoration: none; color: inherit; transition: transform .2s var(--ease), box-shadow .2s; }
.cli:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cli h3 { font: 400 23px/1.1 var(--serif); letter-spacing: -.01em; }
.cli .cifras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid var(--hair); }
.cli .cifras b { display: block; font: 400 19px var(--serif); margin-top: 4px; }

/* ===================== Bitácora ===================== */
.bitacora { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 1100px) { .bitacora { grid-template-columns: 1fr; } }
.bitacora .form { position: sticky; top: 24px; }
@media (max-width: 1100px) { .bitacora .form { position: static; } }
.mes-t { font: italic 400 22px var(--serif); padding: 22px 0 6px; display: flex; justify-content: space-between; align-items: baseline; }
.mes-t small { font: 500 10.5px var(--mono); letter-spacing: .12em; color: var(--muted); font-style: normal; text-transform: uppercase; }
.nota { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--hair); animation: aparece .3s var(--ease); }
.nota .f { font: 400 12px var(--mono); color: var(--muted); padding-top: 2px; }
.nota .c { font: 500 12px var(--sans); color: var(--muted); margin-bottom: 3px; }
.nota p { white-space: pre-line; }
.nota .acc { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.nota:hover .acc, .nota:focus-within .acc { opacity: 1; }
@media (hover: none) { .nota .acc { opacity: 1; } }

/* ===================== Panel ===================== */
.grafico { padding: 22px 22px 16px; }
.grafico-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.leyenda { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.barras { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(4px, 1vw, 12px); height: 280px; align-items: end; position: relative; padding-top: 22px; }
.mesb { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: pointer; border-radius: 8px; padding: 0 2px; }
.mesb:hover { background: var(--card-2); }
.mesb .col { position: relative; width: 100%; max-width: 44px; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.mesb .cot { position: absolute; bottom: 0; width: 100%; border-radius: 5px 5px 2px 2px; background: repeating-linear-gradient(135deg, var(--hair) 0 2px, transparent 2px 6px); border: 1px solid var(--hair); transition: height .9s var(--ease); }
.mesb .ven { position: relative; width: 62%; border-radius: 4px 4px 1px 1px; background: var(--ink); transition: height 1s var(--ease); min-height: 0; }
.mesb .ven.logro { background: var(--accent); }
.mesb .metal { position: absolute; left: -2px; right: -2px; height: 0; border-top: 1.5px dashed var(--accent); transition: bottom .9s var(--ease); }
.mesb .et { font: 500 10.5px var(--mono); color: var(--muted); padding: 8px 0 2px; text-transform: uppercase; letter-spacing: .06em; }
.mesb.actual .et { color: var(--accent); }
.mesb .tip { position: absolute; bottom: calc(100% - 8px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 9px 11px; border-radius: 10px; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 3; line-height: 1.45; }
.mesb:hover .tip, .mesb:focus-visible .tip { opacity: 1; }
.mesb:nth-child(-n+2) .tip { left: 0; transform: none; }
.mesb:nth-last-child(-n+2) .tip { left: auto; right: 0; transform: none; }
.tip b { font-family: var(--mono); font-weight: 500; }
.lista-simple { display: grid; }
.lista-simple a { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--hair); text-decoration: none; align-items: center; }
.lista-simple a:last-child { border-bottom: 0; }
.lista-simple a:hover { background: var(--card-2); }
.lista-simple .folio { font: 500 12px var(--mono); color: var(--muted); }
.lista-simple span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-simple .v { font: 400 18px var(--serif); }

/* ===================== Configuración ===================== */
.config { display: grid; gap: 24px; max-width: 920px; }
.usuarios { display: grid; }
.usuario { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.usuario:last-child { border-bottom: 0; }
.usuario .avatar { width: 36px; height: 36px; }
.tag { font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); }
.tag.acento { background: var(--accent-soft); color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--hair); border-radius: 99px; padding: 3px; background: var(--card); }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 99px; cursor: pointer; font: 500 13px var(--sans); color: var(--ink-2); min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Paleta de comandos */
.paleta { position: fixed; z-index: 80; left: 50%; top: 12vh; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); background: var(--card); border: 1px solid var(--hair); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: dlg2 .25s var(--ease); }
@keyframes dlg2 { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.98); } }
.paleta input { width: 100%; border: 0; border-bottom: 1px solid var(--hair); background: none; padding: 18px 20px; font-size: 17px; outline: none; }
.paleta .res { max-height: 52vh; overflow: auto; padding: 6px; }
.paleta .res button { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; width: 100%; text-align: left; padding: 11px 14px; border: 0; background: none; border-radius: 10px; cursor: pointer; align-items: center; }
.paleta .res button small { font: 500 10.5px var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.paleta .res button[aria-selected="true"] { background: var(--paper-2); }
.paleta .ayuda { padding: 10px 16px; border-top: 1px solid var(--hair); font: 400 11.5px var(--mono); color: var(--muted); display: flex; gap: 14px; }
kbd { font: 500 11px var(--mono); border: 1px solid var(--hair); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--paper); }

/* ===================== Animaciones de entrada ===================== */
@keyframes aparece { from { opacity: 0; transform: translateY(8px); } }
.vista { animation: vista .5s var(--ease); }
@keyframes vista { from { opacity: 0; transform: translateY(14px); } }
.vista > * { animation: aparece .6s var(--ease) both; }
.vista > *:nth-child(2) { animation-delay: .05s; } .vista > *:nth-child(3) { animation-delay: .1s; } .vista > *:nth-child(4) { animation-delay: .15s; } .vista > *:nth-child(5) { animation-delay: .2s; }
.esqueleto { background: linear-gradient(90deg, var(--paper-2), var(--card-2), var(--paper-2)); background-size: 200% 100%; animation: brillo 1.2s linear infinite; border-radius: 8px; }
@keyframes brillo { to { background-position: -200% 0; } }
.cargando-vista { display: grid; gap: 12px; }
.cargando-vista .esqueleto { height: 54px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
@media print { .rail, .topbar, .tabbar, .toasts { display: none !important; } }

/* Textos sin espacios (URLs, nombres largos) no desbordan la pantalla */
.det-items p, .ficha-cab h1, .ficha-cab .datos, .cli h3, .nota p, .lt p, .det-meta b, .exito p, .item .quien b, .dialogo h3 { overflow-wrap: anywhere; }
.det-items .di > p { min-width: 0; }
