:root {
  --violeta: #B541FA; --cian: #4FD2E9; --navy: #192584; --gris: #74706D;
  --rojo: #d21f4b; --ambar: #b86a00; --verde: #0f8a58;
  --r: 26px; --ease: cubic-bezier(.2, .8, .2, 1);
  --disp: 'Sora', system-ui, sans-serif;
}
[data-theme="claro"] {
  --bg1: #e6e8ff; --bg2: #f3e3ff; --bg3: #d9f6fb; --base: #f4f6ff;
  --card: rgba(255, 255, 255, .74); --card2: #fff; --stroke: rgba(255, 255, 255, .95);
  --ink: #192584; --ink2: #3a4170; --mut: #646886; --line: rgba(25, 37, 132, .12);
  --hero: #192584; --heroInk: #fff; --heroMut: rgba(255, 255, 255, .75);
  --chip: rgba(25, 37, 132, .07); --shadow: 0 10px 40px -14px rgba(25, 37, 132, .24); --hatch: rgba(25, 37, 132, .14);
  --ac: #B541FA; --acInk: #fff; --on: #192584; --onInk: #fff;
}
[data-theme="noche"] {
  --bg1: #101763; --bg2: #2a1159; --bg3: #0c3a55; --base: #0b1048;
  --card: rgba(29, 39, 122, .62); --card2: #171f6e; --stroke: rgba(255, 255, 255, .08);
  --ink: #fff; --ink2: #d8dcf6; --mut: #a9afdc; --line: rgba(255, 255, 255, .12);
  --hero: #4FD2E9; --heroInk: #0d1450; --heroMut: rgba(13, 20, 80, .72);
  --chip: rgba(255, 255, 255, .08); --shadow: 0 10px 40px -12px rgba(0, 0, 0, .55); --hatch: rgba(255, 255, 255, .16);
  --ac: #B541FA; --acInk: #fff; --on: #4FD2E9; --onInk: #0d1450;
}
[data-theme="vidrio"] {
  --bg1: #060a33; --bg2: #060a33; --bg3: #060a33; --base: #060a33;
  --card: rgba(10, 14, 58, .5); --card2: #141b66; --stroke: transparent;
  --ink: #f4f6ff; --ink2: #d5d9f4; --mut: #a7adda; --line: rgba(255, 255, 255, .11);
  --hero: #B541FA; --heroInk: #fff; --heroMut: rgba(255, 255, 255, .8);
  --chip: rgba(255, 255, 255, .08); --hatch: rgba(255, 255, 255, .16);
  --shadow: inset 0 0 0 1px rgba(255, 255, 255, .09), inset 0 1px 0 rgba(255, 255, 255, .22), 0 20px 44px rgba(0, 0, 0, .6);
  --ac: #B541FA; --acInk: #fff; --on: #4FD2E9; --onInk: #0d1450;
}
* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body {
  font: 400 15px/1.45 'Public Sans', system-ui, sans-serif; color: var(--ink);
  background: radial-gradient(60vw 50vh at 0% 0%, var(--bg1), transparent 70%), radial-gradient(50vw 60vh at 100% 20%, var(--bg2), transparent 70%), radial-gradient(60vw 50vh at 40% 110%, var(--bg3), transparent 70%), var(--base);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--violeta); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { position: relative; z-index: 1; max-width: 1360px; margin: 0 auto; padding: 18px 16px 96px; }
h1, h2, h3, h4 { font-weight: 700; }

.esferas { display: none; }
[data-theme="vidrio"] .esferas { display: block; position: fixed; inset: 0; overflow: hidden; z-index: 0; }
.esferas i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; background: radial-gradient(circle, var(--c), transparent 65%); animation: flota 26s ease-in-out infinite alternate; }
.esferas i:nth-child(1) { --c: #B541FA; left: -12%; top: -18%; }
.esferas i:nth-child(2) { --c: #4FD2E9; right: -14%; top: 8%; animation-delay: -8s; }
.esferas i:nth-child(3) { --c: #2a37c0; left: 22%; bottom: -30%; animation-delay: -15s; }
.esferas i:nth-child(4) { --c: #7f49e8; right: 8%; bottom: -24%; animation-delay: -4s; }
@keyframes flota { to { transform: translate(8vw, 7vh) scale(1.12); } }
.app { position: relative; z-index: 1; }

/* Barra superior */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.logo { flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: #fff; }
.nav { margin: 0 auto; display: flex; gap: 2px; padding: 5px; border-radius: 999px; background: var(--card); backdrop-filter: blur(16px); border: 1px solid var(--stroke); box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.nav a { padding: 8px 15px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink2); white-space: nowrap; transition: .25s var(--ease); }
.nav a:hover { background: var(--chip); color: var(--ink); }
.nav a.on { background: var(--on); color: var(--onInk); }
.nav a .cnt { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 5px; border-radius: 99px; background: var(--ac); color: #fff; font-size: 11px; font-weight: 700; }
.tools { display: flex; gap: 8px; }
.ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--stroke); backdrop-filter: blur(16px); transition: .25s; }
.ico:hover { transform: translateY(-2px); }
.ava { width: 40px; height: 40px; border-radius: 50%; background: var(--ac); display: grid; place-items: center; color: #fff; font-weight: 700; }

/* Encabezado */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.head h1 { font: 700 clamp(28px, 3.4vw, 46px)/1.05 var(--disp); letter-spacing: -.04em; }
.head h1 small { display: block; font: 500 14px 'Public Sans'; letter-spacing: 0; color: var(--mut); text-transform: none; margin-bottom: 8px; }
.head-acc { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: flex; gap: 26px; flex-wrap: wrap; }
.kpi { text-align: left; border-radius: 16px; padding: 6px 10px; margin: -6px -10px; transition: .25s; }
.kpi:hover { background: var(--card); }
.kpi > span { font-size: 13px; color: var(--mut); font-weight: 600; }
.kpi b { display: block; font: 700 clamp(21px, 2vw, 28px)/1.15 var(--disp); letter-spacing: -.04em; margin-top: 2px; }
.kpi b.rojo { color: var(--rojo); }
[data-theme="noche"] .kpi b.rojo, [data-theme="vidrio"] .kpi b.rojo { color: #ff7a99; }

/* Rejilla bento */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.card {
  position: relative; grid-column: span 4; min-width: 0; border-radius: var(--r); padding: 20px; background: var(--card);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border: 1px solid var(--stroke); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(18px) scale(.98); transition: transform .45s var(--ease), opacity .6s var(--ease);
}
.card.in { opacity: 1; transform: none; }
.card.lift.in:hover { transform: translateY(-5px); }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(181, 65, 250, .16), transparent 60%); }
.card:hover::after { opacity: 1; }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ch h3 { font-size: 16px; }
.ch .sub { font-size: 13px; color: var(--mut); font-weight: 500; }
.sel { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--chip); }
.sel.on { background: var(--on); color: var(--onInk); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--chip); white-space: nowrap; }
.pill.ok { background: rgba(15, 138, 88, .16); color: var(--verde); }
.pill.mal { background: rgba(210, 31, 75, .14); color: var(--rojo); }
.pill.aviso { background: rgba(184, 106, 0, .16); color: var(--ambar); }
.pill.ac { background: var(--ac); color: #fff; }
[data-theme="noche"] .pill.ok, [data-theme="vidrio"] .pill.ok { color: #5de3ad; }
[data-theme="noche"] .pill.mal, [data-theme="vidrio"] .pill.mal { color: #ff8fa8; }
[data-theme="noche"] .pill.aviso, [data-theme="vidrio"] .pill.aviso { color: #ffc56e; }

/* Medidor */
.gwrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.gnum > span { font-size: 13px; color: var(--mut); font-weight: 600; }
.gnum b { display: block; font: 700 30px/1.05 var(--disp); letter-spacing: -.04em; margin: 4px 0; }
.gauge { width: 56%; max-width: 220px; }
.needle { transform-origin: 100px 100px; transition: transform 1.4s var(--ease); }
.gfoot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gfoot button, .gfoot a { flex: 1 1 96px; text-align: left; padding: 10px 12px; border-radius: 16px; background: var(--chip); transition: .25s; }
.gfoot button:hover, .gfoot a:hover { background: var(--cian); color: #0d1450; }
.gfoot small { display: block; font-size: 12px; font-weight: 600; opacity: .8; }
.gfoot b { font-size: 16px; }

/* Destacada */
.c-hero { background: var(--hero); color: var(--heroInk); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.c-hero h3 { font: 700 22px/1.1 var(--disp); letter-spacing: -.03em; }
.big { font: 700 64px/1 var(--disp); letter-spacing: -.05em; }
.c-hero p { color: var(--heroMut); }
.blob { position: absolute; right: -50px; bottom: -50px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, var(--violeta), transparent 65%); opacity: .75; animation: blob 7s ease-in-out infinite; pointer-events: none; }
[data-theme="noche"] .blob, [data-theme="vidrio"] .blob { background: radial-gradient(circle, #fff, transparent 65%); opacity: .4; }
@keyframes blob { 50% { transform: translate(-20px, -16px) scale(1.08); } }
.btnw { position: relative; z-index: 1; display: inline-flex; align-self: flex-start; padding: 10px 18px; border-radius: 999px; background: var(--cian); color: #0d1450; font-size: 14px; font-weight: 700; transition: .25s; }
[data-theme="noche"] .btnw { background: var(--navy); color: #fff; }
.btnw:hover { transform: translateX(3px); }

/* Filas */
.row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 8px; border-radius: 12px; transition: .2s; }
button.row:hover, a.row:hover, .row[data-d]:hover { background: var(--chip); }
.row[data-d] { cursor: pointer; }
.av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--chip); }
.av.ac { background: var(--ac); color: #fff; }
.av.c { background: var(--cian); color: #0d1450; }
.nm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; }
.nm > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm small { display: block; font-size: 13px; color: var(--mut); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row > b, .mon { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.vacio { font-size: 14px; color: var(--mut); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 18px; }

/* Alertas */
.alerta { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 14px; }
.alerta + .alerta { margin-top: 4px; }
.alerta .nm { cursor: pointer; }
.alerta .nm > span { white-space: normal; }
.alerta .nm small { white-space: normal; }
.mini { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--on); color: var(--onInk); font-size: 13px; font-weight: 700; transition: .2s; white-space: nowrap; }
.mini:hover { transform: translateY(-2px); }
.mini.sec { background: var(--chip); color: var(--ink); }
.mini.wa { background: #128c4b; color: #fff; }
.punto { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--mut); }
.punto.mal { background: var(--rojo); } .punto.aviso { background: #e89a1a; } .punto.ac { background: var(--violeta); } .punto.c { background: var(--cian); }

/* Barras */
.rangos { display: flex; gap: 4px; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 200px; }
.bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; padding: 0; }
.bar .b { width: 100%; max-width: 34px; border-radius: 10px; height: 0; transition: height 1s var(--ease), filter .2s; background: repeating-linear-gradient(135deg, var(--hatch) 0 2px, transparent 2px 7px); border: 1px solid var(--line); }
.bar.real .b { background: var(--cian); border: 0; }
.bar.now .b { background: var(--violeta); border: 0; }
.bar.proy .b { background: repeating-linear-gradient(135deg, rgba(181, 65, 250, .45) 0 2px, transparent 2px 7px); border: 1px dashed var(--violeta); }
.bar:hover .b { filter: brightness(1.1); }
.bar small { font-size: 12px; color: var(--mut); font-weight: 600; height: 16px; }
.dobles { display: flex; align-items: flex-end; gap: 8px; height: 220px; }
.dob { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 0; }
.dob-b { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.dob-b i { display: block; flex: 1; max-width: 18px; border-radius: 6px 6px 2px 2px; height: 0; transition: height 1s var(--ease); }
.dob-b i.ing { background: var(--cian); } .dob-b i.egr { background: var(--violeta); }
.dob small { text-align: center; font-size: 12px; color: var(--mut); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--mut); font-weight: 600; margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

/* Agenda */
.days { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.day { flex: 0 0 auto; width: 54px; padding: 10px 0 14px; border-radius: 999px; text-align: center; background: var(--chip); transition: .25s var(--ease); position: relative; }
.day small { display: block; font-size: 12px; font-weight: 600; opacity: .75; text-transform: capitalize; }
.day b { font-size: 16px; }
.day.has::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--violeta); transform: translateX(-50%); }
.day:hover { transform: translateY(-3px); }
.day.on { background: var(--on); color: var(--onInk); }

/* Embudo */
.fr { display: grid; grid-template-columns: 1fr 46px; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 6px 8px; border-radius: 12px; transition: .2s; }
.fr:hover { background: var(--chip); }
.fr .t { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.fr .t small { color: var(--mut); font-weight: 500; font-size: 13px; }
.track { height: 7px; border-radius: 9px; background: var(--chip); margin-top: 5px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; border-radius: 9px; background: var(--violeta); transition: width 1.2s var(--ease); }
.track.c i { background: var(--cian); }
.fr > b { font: 700 20px var(--disp); text-align: right; }
.nota-pie { grid-column: span 12; font-size: 13px; color: var(--mut); padding: 4px 8px; }

/* Botones */
.bt { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 18px; border-radius: 999px; background: var(--chip); color: var(--ink); font-weight: 600; transition: .2s; white-space: nowrap; }
.bt:hover { transform: translateY(-2px); }
.bt-p { background: var(--ac); color: var(--acInk); font-weight: 700; }
.bt-n { background: var(--on); color: var(--onInk); }
.bt-wa { background: #128c4b; color: #fff; }
.bt-mal { background: rgba(210, 31, 75, .14); color: var(--rojo); }
.bt:disabled { opacity: .5; cursor: default; transform: none; }

/* Cola de cotizaciones */
.cola { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: start; }
.col { border-radius: 22px; padding: 12px; background: var(--card); border: 1px solid var(--stroke); backdrop-filter: blur(16px); min-height: 220px; transition: background .2s; }
.col.sobre { background: var(--chip); outline: 2px dashed var(--violeta); }
.col h3 { display: flex; justify-content: space-between; gap: 6px; font-size: 14px; margin-bottom: 10px; }
.col h3 small { color: var(--mut); font-weight: 500; font-size: 13px; }
.ct { display: block; width: 100%; text-align: left; padding: 11px; margin-bottom: 8px; border-radius: 15px; background: var(--card2); border: 1px solid var(--line); cursor: grab; transition: .2s; }
.ct:hover { border-color: var(--violeta); transform: translateY(-2px); }
.ct b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.ct small { display: block; font-size: 13px; color: var(--mut); }
.ct .pie { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 700; flex-wrap: wrap; }
.ct-mov { width: 100%; margin-top: 8px; padding: 5px; border-radius: 9px; background: var(--chip); font-size: 13px; border: 0; }

/* Tablas */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 13px; color: var(--mut); font-weight: 600; padding: 8px; white-space: nowrap; }
.tabla td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.tabla tbody tr[data-d] { cursor: pointer; transition: background .2s; }
.tabla tbody tr[data-d]:hover { background: var(--chip); }
.tabla .der { text-align: right; }
.tabla small { display: block; color: var(--mut); font-size: 13px; }
.acc { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.tools-v { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tools-v input[type=search], .tools-v select { min-height: 42px; padding: 8px 14px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); }
.tools-v input[type=search] { flex: 1 1 200px; }
.mapa-a { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mapa-a button { text-align: left; padding: 12px; border-radius: 16px; background: var(--chip); transition: .2s; }
.mapa-a button:hover { transform: translateY(-2px); background: var(--cian); color: #0d1450; }
.mapa-a small { display: block; font-size: 13px; font-weight: 600; }
.mapa-a b { font: 700 20px var(--disp); letter-spacing: -.03em; }

/* Panel lateral */
.scrim { position: fixed; inset: 0; background: rgba(10, 15, 70, .4); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: .3s; z-index: 30; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(500px, calc(100% - 24px)); border-radius: var(--r); background: var(--card2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); transform: translateX(calc(100% + 24px)); visibility: hidden; transition: transform .45s var(--ease), visibility .45s; z-index: 31; display: flex; flex-direction: column; }
.drawer.on { transform: none; visibility: visible; }
.drawer header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 20px 22px 10px; }
.dr-tit small { font-size: 13px; color: var(--mut); font-weight: 600; }
.dr-tit h2 { font: 700 26px/1.1 var(--disp); letter-spacing: -.03em; margin-top: 4px; overflow-wrap: anywhere; }
.dr-volver { font-size: 13px; font-weight: 700; margin-bottom: 6px; display: block; }
.drawer .body { padding: 6px 22px 24px; overflow: auto; flex: 1; }
.dt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 16px; }
.dt > div { padding: 10px 12px; border-radius: 14px; background: var(--chip); min-width: 0; overflow-wrap: anywhere; }
.dt small { display: block; font-size: 12px; color: var(--mut); font-weight: 600; }
.dt b { font-size: 15px; }
.seccion { font-size: 15px; font-weight: 700; margin: 18px 0 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.linea-t { position: relative; padding: 0 0 12px 18px; font-size: 14px; }
.linea-t::before { content: ""; position: absolute; left: 3px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--violeta); }
.linea-t::after { content: ""; position: absolute; left: 6.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.linea-t small { display: block; color: var(--mut); font-size: 13px; }
.checks label { display: flex; align-items: center; gap: 8px; padding: 7px 4px; cursor: pointer; }
.checks input { width: 19px; height: 19px; accent-color: var(--violeta); }

/* Formularios */
.modal { width: min(620px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); border: 0; border-radius: var(--r); padding: 22px; background: var(--card2); color: var(--ink); margin: auto; }
.modal.ancho { width: min(1040px, calc(100vw - 20px)); }
.modal::backdrop, .buscar::backdrop { background: rgba(10, 15, 70, .55); }
.modal h2 { font: 700 26px/1.1 var(--disp); letter-spacing: -.03em; margin-bottom: 14px; }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f { display: grid; gap: 4px; font-size: 13px; font-weight: 600; min-width: 0; }
.f.w2 { grid-column: span 2; }
.f input, .f select, .f textarea, .it input, .it select { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 12px; background: transparent; border: 1px solid var(--line); font-weight: 400; font-size: 15px; }
.f select option, .it select option { color: #192584; }
.m-pie { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.m-err { color: var(--rojo); font-weight: 600; margin-top: 10px; }
.items { margin: 14px 0 8px; }
.it { display: grid; grid-template-columns: 2.4fr 1.6fr .6fr 1fr 1fr 36px; gap: 6px; margin-bottom: 6px; align-items: center; }
.it-cab { font-size: 13px; font-weight: 600; color: var(--mut); }
.tot { display: flex; gap: 22px; justify-content: flex-end; flex-wrap: wrap; font-weight: 600; padding: 10px 0; }
.tot b { font: 700 20px var(--disp); margin-left: 6px; }

/* Buscador */
.buscar { width: min(620px, calc(100vw - 20px)); margin: 10vh auto auto; border: 0; border-radius: 22px; padding: 12px; background: var(--card2); color: var(--ink); }
.buscar input { width: 100%; min-height: 48px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--line); background: transparent; }
#buscarRes { max-height: 50vh; overflow: auto; margin-top: 8px; }

/* Tema, marca, avisos */
.theme { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 3px; padding: 5px; border-radius: 999px; background: var(--card2); box-shadow: var(--shadow); z-index: 20; }
.theme button { padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.theme button.on { background: var(--on); color: var(--onInk); }
.demo { position: fixed; right: 14px; bottom: 20px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--cian); color: #0d1450; z-index: 20; }
.tip { position: fixed; z-index: 60; pointer-events: none; padding: 6px 10px; border-radius: 10px; background: #0d1450; color: #fff; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .12s; max-width: 280px; }
.tip.on { opacity: 1; }
.toast { position: fixed; left: 50%; bottom: 70px; transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 999px; background: #0d1450; color: #fff; font-weight: 600; opacity: 0; transition: .3s; pointer-events: none; z-index: 70; max-width: calc(100vw - 24px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.mal { background: var(--rojo); }

/* Acceso */
.login { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-caja { width: min(440px, 100%); padding: 36px; border-radius: var(--r); background: var(--navy); color: #fff; display: grid; gap: 14px; }
.login-marca { display: flex; align-items: center; gap: 12px; font: 700 30px/1 var(--disp); letter-spacing: -.04em; color: #fff; }
.login-marca svg { width: 52px; height: 52px; flex: none; }
.login-msg:empty { display: none; }

/* Documentos */
.docver { position: fixed; inset: 0; z-index: 50; overflow: auto; background: #dfe3f5; padding: 70px 12px 40px; }
.docbar { position: fixed; top: 0; left: 0; right: 0; z-index: 2; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 12px; background: #192584; }
.docbar .bt { background: #fff; color: #192584; }
.docbar .bt-wa { background: #128c4b; color: #fff; }
.docbar .bt-p { background: #B541FA; color: #fff; }
.hoja { width: 760px; max-width: 100%; margin: 0 auto; padding: 44px; background: #fff; color: #1b2152; font: 400 14px/1.5 'Public Sans', sans-serif; }
.doc-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 14px; border-bottom: 4px solid #192584; margin-bottom: 20px; }
.doc-marca { display: flex; align-items: center; gap: 8px; font: 700 24px/1 'Sora', sans-serif; letter-spacing: -.04em; color: #192584; margin-bottom: 8px; }
.doc-marca img { width: 36px; height: 36px; }
.doc-tit { text-align: right; }
.doc-tit h2 { font: 700 26px/1.1 'Sora', sans-serif; color: #B541FA; }
.doc-sello { display: inline-block; padding: 3px 10px; border: 2px solid currentColor; font-weight: 700; font-size: 12px; margin-top: 6px; }
.doc-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 18px; }
.doc-2 h4 { font-size: 12px; color: #74706D; font-weight: 600; margin-bottom: 2px; }
.doc-t { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.doc-t th { background: #192584; color: #fff; text-align: left; padding: 7px 9px; font-size: 13px; }
.doc-t td { padding: 7px 9px; border-bottom: 1px solid #dfe3f5; }
.doc-t .der { text-align: right; }
.doc-total { text-align: right; font-size: 15px; margin-bottom: 4px; }
.doc-total b { font: 700 24px 'Sora', sans-serif; color: #192584; }
.doc-letras { text-align: right; color: #74706D; font-size: 13px; margin-bottom: 16px; }
.doc-pago { padding: 12px 14px; background: #e4f7fb; margin-bottom: 14px; }
.doc-firma { margin-top: 44px; width: 260px; border-top: 1px solid #1b2152; padding-top: 6px; font-size: 13px; }
.doc-pie { margin-top: 22px; font-size: 12px; color: #74706D; }

@media (max-width: 1180px) {
  .card, .s2, .s3, .s4, .s5, .s7 { grid-column: span 6; }
  .s8, .s12 { grid-column: span 12; }
  .cola { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .top { flex-wrap: wrap; }
  .logo { order: 1; } .tools { order: 2; margin-left: auto; } .nav { order: 3; width: 100%; margin: 0; }
  .grid { display: flex; flex-direction: column; }
  .card { width: 100%; }
  .kpis { gap: 18px; }
  .cola { grid-template-columns: 1fr; }
  .col { min-height: 0; }
  .campos { grid-template-columns: 1fr; }
  .f.w2 { grid-column: auto; }
  .it { grid-template-columns: 1fr 1fr; padding: 10px; border-radius: 14px; background: var(--chip); }
  .it-cab { display: none; }
  .it > :first-child { grid-column: span 2; }
  .mapa-a { grid-template-columns: 1fr 1fr; }
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla tr { padding: 10px 0; border-top: 1px solid var(--line); }
  .tabla td { border: 0; padding: 3px 4px; }
  .tabla .der { text-align: left; }
  .acc { justify-content: flex-start; }
  .theme { bottom: 10px; }
  .demo { bottom: 62px; right: 10px; }
  .hoja { padding: 22px; }
  .doc-2 { grid-template-columns: 1fr; }
  .esferas i:nth-child(n+3) { display: none; }
  .esferas i { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
