﻿/* Broker 360 · Gestión de cartera
   Paleta y tipografía tomadas de www.360broker.com.ar */
:root {
  /* marca */
  --navy: #102338;
  --navy-2: #0b1a2b;
  --navy-deep: #081019;
  --navy-paper: #17304a;
  --accent: #5fb8dc;
  --accent-2: #2f7194;
  --sky: #8fd0e8;
  --grad: linear-gradient(135deg, #5fb8dc, #2f7194);

  /* área de trabajo (clara, para leer tablas cómodamente) */
  --bg: #eef3f7;
  --panel: #ffffff;
  --ink: #102338;
  --ink-2: #3c566d;
  --muted: #6b8499;
  --line: #dde6ee;
  --brand: #2f7194;
  --brand-2: #235a78;
  --brand-soft: #e5f3f9;

  --ok: #177a52;   --ok-soft: #e0f4ea;
  --warn: #9a6200; --warn-soft: #fff3d9;
  --bad: #b3261e;  --bad-soft: #fde8e7;
  --gray-soft: #eef2f6;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Poppins", var(--sans);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 35, 56, .05), 0 10px 28px -18px rgba(16, 35, 56, .35);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); }
h1 { font-size: 24px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 12px; margin: 0 0 10px; font-weight: 600; color: var(--accent-2); text-transform: uppercase; letter-spacing: .12em; }
small, .muted { color: var(--muted); }

/* ---------- estructura ---------- */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.contenido { display: flex; flex-direction: column; min-width: 0; }
.main { padding: 26px 32px 40px; flex: 1; min-width: 0; }

.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px 18px;
  display: flex; flex-direction: column; color: #c3d6e4;
  background:
    radial-gradient(420px 320px at 0% 0%, rgba(95, 184, 220, .16), transparent 70%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: #fff; }
.brand:hover { text-decoration: none; color: #fff; }
.brand .logo { width: 46px; height: 46px; border-radius: 50%; background: #fff; object-fit: contain; padding: 2px;
  box-shadow: 0 0 0 2px rgba(143, 208, 232, .35), 0 8px 20px -8px rgba(0, 0, 0, .6); }
.brand b { display: block; font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.1; }
.brand small { display: block; color: var(--accent); font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.side .modulo { margin: 14px 8px 8px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--sky); text-align: center; background: rgba(255,255,255,.04); }
.side nav { flex: 1; }
.side nav a { display: block; color: #c3d6e4; padding: 8px 12px; border-radius: 10px; margin: 1px 0; font-weight: 500; position: relative;
  transition: background .2s var(--ease), color .2s; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side nav a.on { background: rgba(143, 208, 232, .14); color: #fff; }
.side nav a.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad); }
.side .grupo { font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; color: #85a0b3; margin: 18px 12px 5px; font-weight: 600; }
.side .yo { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid rgba(255,255,255,.1); margin-top: 18px; padding: 14px 8px 0; font-size: 13px; }
.avatar { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; }
.yo-datos b { display: block; color: #fff; font-weight: 600; }
.yo-datos small { display: block; color: #85a0b3; margin-bottom: 4px; }
.yo-datos a, .yo-datos button { color: var(--sky); }
.side .yo form { display: inline; }
.side .yo button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.side .yo a:hover, .side .yo button:hover { color: #fff; }
.side .web { margin: 14px 8px 0; font-size: 12px; color: #85a0b3; }
.side .web:hover { color: var(--sky); }

.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.topbar-marca { display: none; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; color: var(--navy); }
.topbar-marca img { width: 28px; height: 28px; border-radius: 50%; }
.topbar-web { font-size: 13px; font-weight: 500; color: var(--muted); }
.topbar .menu-btn { display: none; }
/* computadora: el menú se puede ocultar para trabajar con toda la pantalla (se recuerda en cada navegador) */
.topbar .ocultar-menu { margin-right: auto; }
.ocultar-menu .si-oculto, .menu-oculto .ocultar-menu .si-visible { display: none; }
.menu-oculto .ocultar-menu .si-oculto { display: inline; }
@media (min-width: 901px) {
  .menu-oculto .layout { grid-template-columns: 1fr; }
  .menu-oculto .side { display: none; }
}
.pie { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 32px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.pie a { color: var(--muted); font-weight: 500; }

.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head .acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.head .muted { font-size: 13px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-100%); transition: transform .3s var(--ease); z-index: 50; }
  .side.abierto { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .topbar .menu-btn { display: inline-flex; }
  .topbar .ocultar-menu { display: none; }
  .topbar { justify-content: space-between; padding: 10px 16px; }
  .topbar-marca { display: inline-flex; }
  .topbar-web { display: none; }
  .main { padding: 18px 16px 36px; }
  .pie { padding: 14px 16px; }
}

/* ---------- componentes ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 18px 20px 2px; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); opacity: .85; }
.kpi .lbl { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.kpi .val { font-family: var(--display); font-size: 28px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--navy); }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 18px; border-radius: 999px; font: 600 13.5px/1.2 var(--sans); cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s; }
.btn:hover { background: var(--gray-soft); text-decoration: none; color: var(--ink); }
.btn.pri { background: var(--grad); border-color: transparent; color: #fff; font-family: var(--display); box-shadow: 0 10px 22px -12px rgba(47, 113, 148, .9); }
.btn.pri:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 14px 26px -12px rgba(47, 113, 148, .95); }
.btn.peligro { color: var(--bad); border-color: #f2c3c0; }
.btn.peligro:hover { background: var(--bad-soft); color: var(--bad); }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; background: #f6f9fb; white-space: nowrap; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f5fafd; }
tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; background: #f6f9fb; border-top: 1px solid var(--line); }
.tabla-scroll { overflow-x: auto; }
.vacio { padding: 32px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b-Vigente, .b-Pagada, .b-ok { background: var(--ok-soft); color: var(--ok); }
.b-Vencida, .b-bad { background: var(--bad-soft); color: var(--bad); }
.b-Renovada, .b-info { background: var(--brand-soft); color: var(--brand); }
.b-Anulada, .b-gris { background: var(--gray-soft); color: var(--muted); }
.badge.b-No { background: var(--bad-soft); color: var(--bad); } /* "No renovada" */
.b-violeta { background: #efe9f8; color: #6a4aa5; }
.rp-grid > a { background: #f6f9fb; border-radius: 10px; padding: 10px 12px; text-decoration: none; }
.b-Pendiente, .b-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- formularios ---------- */
label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid #cfdbe5; border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(95, 184, 220, .25); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent-2); }
input[type=file] { padding: 10px; background: #f6f9fb; border-style: dashed; }
textarea { min-height: 70px; resize: vertical; }
.campos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.campos .s2 { grid-column: span 2; }
.campos .s4 { grid-column: 1 / -1; }
@media (max-width: 900px) { .campos { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .campos { grid-template-columns: 1fr; } .campos .s2 { grid-column: auto; } }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.form-pie { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.req::after { content: " *"; color: var(--bad); }

.filtros { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filtros > div { min-width: 150px; flex: 1; }
.filtros > div.ancho { flex: 2.5; min-width: 220px; }
.filtros .btns { flex: 0 0 auto; min-width: 0; display: flex; gap: 8px; }

.flash { padding: 11px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.info { background: var(--brand-soft); color: var(--brand); }

.datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.datos div span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin-bottom: 2px; }
.datos div b { font-weight: 550; }
@media (max-width: 700px) { .datos { grid-template-columns: 1fr 1fr; } }

.paginas { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 12px 18px; color: var(--muted); flex-wrap: wrap; border-top: 1px solid var(--line); }

/* buscador de clientes */
.buscador { position: relative; }
.resultados { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px -16px rgba(16,35,56,.35); z-index: 20; max-height: 280px; overflow-y: auto; margin-top: 4px; }
.resultados div { padding: 9px 14px; cursor: pointer; }
.resultados div:hover { background: var(--brand-soft); }
.elegido { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid #bfe3f1; background: var(--brand-soft); border-radius: 12px; }
.sep { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 18px 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.sep::before, .sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* barras */
.barra { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.barra .t { height: 8px; background: var(--gray-soft); border-radius: 99px; overflow: hidden; }
.barra .t i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.barra .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra > span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- acceso (login / primer uso), mismo lenguaje visual que la web ---------- */
body.acceso { background: var(--navy); color: #c3d6e4; }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 16px;
  background:
    radial-gradient(900px 520px at 15% -10%, rgba(95, 184, 220, .28), transparent 60%),
    radial-gradient(700px 500px at 100% 110%, rgba(47, 113, 148, .35), transparent 60%),
    radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); }
.login { width: 100%; max-width: 400px; text-align: center; padding: 32px 30px 30px; border-radius: 22px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(14px);
  box-shadow: 0 34px 80px -24px rgba(0,0,0,.6); }
.login-logo { width: 96px; height: 96px; border-radius: 50%; background: #fff; object-fit: contain; padding: 3px;
  box-shadow: 0 0 0 4px rgba(143, 208, 232, .25), 0 16px 34px -14px rgba(0,0,0,.7); }
.eyebrow { margin-top: 18px; color: var(--accent); font: 600 12px var(--display); letter-spacing: .2em; text-transform: uppercase; }
.login h1 { color: #eef5fa; font-size: 28px; margin-top: 6px; }
.login h1 span { color: var(--accent); }
.login-sub { color: #85a0b3; margin: 6px 0 18px; }
.login .campo { margin-top: 14px; text-align: left; }
.login label { color: #c3d6e4; }
.login input { background: rgba(8, 16, 25, .55); border-color: rgba(255,255,255,.14); color: #eef5fa; }
.login input:focus { border-color: var(--accent); }
.login .btn { width: 100%; justify-content: center; margin-top: 22px; padding: 12px; font-size: 15px; }
.login .flash { text-align: left; }
.volver { color: #85a0b3; font-size: 13px; }
.volver:hover { color: var(--sky); }

.mapeo td { vertical-align: middle; }
.mapeo select { min-width: 200px; }
.muestra { font-size: 12.5px; }
.muestra td, .muestra th { padding: 6px 10px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

details.edit summary { cursor: pointer; color: var(--brand); list-style: none; font-family: var(--display); }
details.edit summary::-webkit-details-marker { display: none; }
.fila-edit { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; align-items: end; padding: 10px 0; }
@media (max-width: 1000px) { .fila-edit { grid-template-columns: 1fr 1fr; } }

.clave-2fa { font: 600 18px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .08em; background: var(--brand-soft); border: 1px solid #bfe3f1;
  border-radius: 10px; padding: 10px 14px; margin: 4px 0 8px; word-break: break-all; }
.codigos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.codigos code { font: 600 16px ui-monospace, Consolas, monospace; background: var(--gray-soft); padding: 6px 10px; border-radius: 8px; text-align: center; }
form.en-linea select { max-width: 280px; padding: 5px 8px; }
.kpi.dinero .val { font-size: 22px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.subir-pdf { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.subir-pdf > div { flex: 1; min-width: 240px; }

.alerta-inc { margin-right: auto; background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: 13px; padding: 5px 12px; border-radius: 99px; }
.alerta-inc:hover { color: var(--bad); }
.incidencias-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 900px) { .alerta-inc { order: 3; flex-basis: 100%; text-align: center; margin-right: 0; } .topbar { flex-wrap: wrap; } }

tr.fila-fallida td { color: var(--bad); }

/* agenda */
.tipos-evento { display: flex; gap: 8px 22px; flex-wrap: wrap; padding: 14px 20px; }
.punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: 0; }
.ev-venc { background: #d9822b; } .ev-seg { background: #2f7194; } .ev-caso { background: #7b5bb5; } .ev-cumple { background: #d6457a; } .ev-cobro { background: #177a52; }
.calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-dia-sem { padding: 6px 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: #f6f9fb; border-bottom: 1px solid var(--line); }
.cal-dia { min-height: 96px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-dia:nth-child(7n) { border-right: 0; }
.cal-dia:hover { background: #f5fafd; text-decoration: none; }
.cal-dia.fuera { background: #fafcfd; color: var(--muted); }
.cal-dia .num { font-weight: 600; font-size: 13px; }
.cal-dia.hoy .num { background: var(--grad); color: #fff; border-radius: 99px; padding: 0 7px; align-self: flex-start; }
.cal-dia .chip { font-size: 11px; line-height: 1.35; color: #fff; border-radius: 5px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dia .mas { font-size: 11px; color: var(--muted); }
.cal-dia .puntos { display: none; gap: 3px; }
.agenda-dia { padding: 10px 20px; border-top: 1px solid var(--line); }
.agenda-fecha { font-weight: 700; font-family: var(--display); margin-bottom: 4px; }
.agenda-fecha.hoy { color: var(--brand); } .agenda-fecha.pasado { color: var(--muted); }
.agenda-ev { display: block; padding: 3px 0; color: var(--ink); }
.agenda-ev .punto { margin-right: 6px; }
@media (max-width: 700px) {
  .cal-dia { min-height: 54px; padding: 4px; }
  .cal-dia .chip, .cal-dia .mas { display: none; }
  .cal-dia .puntos { display: flex; flex-wrap: wrap; }
  .cal-dia .punto { width: 7px; height: 7px; }
}
/* resumen del período (Inicio) */
.rp-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rp-cab select { width: auto; }
.rp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rp-grid > div { background: #f6f9fb; border-radius: 10px; padding: 10px 12px; }
.rp-grid b { display: block; font-family: var(--display); font-size: 20px; }
.rp-grid span { font-size: 12px; color: var(--muted); }
@media (max-width: 700px) { .rp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grupo-forms { display: flex; gap: 10px 24px; flex-wrap: wrap; }
.grupo-forms form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grupo-forms select { width: auto; max-width: 220px; }

/* casos: tablero */
.btn.activo { background: var(--brand-soft); border-color: #bfe3f1; color: var(--brand); }
/* todas las columnas en una fila: se angostan al sumar columnas (mínimo 190px; si no entran, se desplaza de costado).
   Una columna cerrada queda angosta, con el nombre vertical y la cantidad, y las demás ocupan su lugar */
.tablero { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 20px; align-items: flex-start; }
.tablero .columna { flex: 1 1 0; min-width: 190px; }
.col-cab { cursor: pointer; user-select: none; }
.col-nuevo { display: block; margin: -2px 0 8px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--muted); text-align: center; }
.col-nuevo:hover { border-color: var(--accent); color: var(--brand); background: var(--brand-soft); }
.col-cab .col-flecha { margin-left: auto; color: var(--muted); font-size: 12px; }
.col-cab .col-flecha::after { content: "‹"; }
.tablero .columna.cerrada { flex: 0 0 52px; min-width: 52px; padding: 12px 6px; cursor: pointer; }
.columna.cerrada > :not(.col-cab) { display: none; }
.columna.cerrada .col-cab { writing-mode: vertical-rl; margin: 0 auto; gap: 10px; white-space: nowrap; }
.columna.cerrada .col-cab .col-flecha { margin: 0; }
.columna.cerrada .col-cab .col-flecha::after { content: "›"; }
.columna { background: #e4ecf2; border-radius: var(--radius); padding: 12px; min-height: 120px; }
.columna > h2 { display: flex; align-items: center; gap: 8px; margin: 2px 4px 10px; font-size: 14px; }
.columna > h2 small { font-family: var(--sans); color: var(--muted); font-weight: 600; }
.tarjeta { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(16, 35, 56, .06); }
.tarjeta.alta { border-left: 3px solid var(--bad); }
.tarjeta .t-tipo { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tarjeta .t-titulo { display: block; font-weight: 600; margin: 3px 0; color: var(--ink); }
.tarjeta .t-dato { font-size: 12.5px; color: var(--ink-2); }
.tarjeta .t-pie { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.tarjeta .t-mover { margin-top: 8px; }
.tarjeta .t-mover select { padding: 5px 8px; font-size: 12.5px; }
.tarjeta .t-mover + .t-mover { margin-top: 4px; }
.tarjeta .t-pasos { font-weight: 600; color: var(--warn); }
.tarjeta .t-pasos.listo { color: var(--ok); }
/* pasos en la ficha del caso */
.pasos { list-style: none; margin: 0; padding: 0 20px 6px; }
.pasos li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.pasos li:last-child { border-bottom: 0; }
.pasos button.tilde { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--muted); background: var(--panel); cursor: pointer; padding: 0; font-size: 14px; line-height: 1; color: #fff; flex: none; }
.pasos li.hecho button.tilde { background: var(--ok); border-color: var(--ok); }
.pasos li.hecho .txt { color: var(--muted); text-decoration: line-through; }
.pasos small { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.t-vacio { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 0; }
@media (max-width: 700px) { .tablero { scroll-snap-type: x mandatory; } .tablero .columna { flex: 0 0 82vw; scroll-snap-align: start; } .tablero .columna.cerrada { flex: 0 0 52px; } }

/* unir clientes */
label.card.unir { display: block; cursor: pointer; font-weight: 400; margin-bottom: 0; }
label.card.unir:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(95, 184, 220, .25); }

/* cotizaciones y seguimiento */
.side nav .cuenta { display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 6px; border-radius: 99px; background: var(--accent); color: var(--navy);
  font-size: 11px; font-weight: 700; text-align: center; vertical-align: 1px; }
.atrasado { color: var(--bad); }
h1 .badge { vertical-align: middle; font-family: var(--sans); }
h2 small { font-family: var(--sans); font-weight: 500; font-size: 13px; }
.opcion { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1.6fr) auto; gap: 10px; align-items: center; margin-bottom: 10px; }
@media (max-width: 700px) { .opcion { grid-template-columns: 1fr 1fr auto; } .opcion > div:nth-child(3) { grid-column: 1 / -1; order: 4; } }
.campos.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .campos.c2 { grid-template-columns: 1fr; } }
hr.linea { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.historial { list-style: none; margin: 0; padding: 0; }
.historial li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line); margin-left: 5px; }
.historial li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); }
.historial li.auto::before { background: var(--line); }
.historial li:last-child { padding-bottom: 0; }
.historial .h-cab { font-size: 12.5px; color: var(--ink-2); }
.historial .h-nota { white-space: pre-line; }
.historial li.auto .h-nota { color: var(--muted); font-style: italic; }

.solo-print { display: none; }
.membrete { align-items: center; gap: 14px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 3px solid var(--accent); }
.membrete img { width: 60px; height: 60px; border-radius: 50%; }
.membrete b { font-family: var(--display); font-size: 18px; color: var(--navy); }

@media print {
  .solo-print { display: flex; }
  .topbar, .pie { display: none !important; }
  .side, .no-print, .head .acciones { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
  .card, .kpi { box-shadow: none; }
  body { background: #fff; }
}

/* facturación: comparativo mes a mes */
.sube { color: var(--ok); white-space: nowrap; }
.baja { color: var(--bad); white-space: nowrap; }
.barras-mes { display: flex; align-items: stretch; gap: 6px; height: 200px; padding-top: 6px; }
.bm-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bm-par { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.bm-par i { display: block; width: 42%; max-width: 16px; border-radius: 3px 3px 0 0; }
.bm-fact { background: var(--grad); }
.bm-cobr { background: var(--ok); opacity: .55; }
.bm-egr { background: var(--bad); opacity: .55; }
.bm-col small { font-size: 11px; color: var(--muted); }
.bm-ref { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.bm-ref i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
.cuadro-meses td, .cuadro-meses th { white-space: nowrap; }

/* matriz de la organización: productores × compañías */
.matriz { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.matriz th, .matriz td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.matriz thead th { font-size: 11.5px; position: sticky; top: 0; background: var(--panel); z-index: 1; vertical-align: bottom; }
.matriz thead th.sin-datos { color: var(--muted); font-weight: 500; }
.matriz .prod { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 2; min-width: 190px; white-space: normal; }
.matriz thead .prod { z-index: 3; }
.matriz td.c { min-width: 74px; font-variant-numeric: tabular-nums; }
.matriz td.c a { color: inherit; display: block; }
.matriz td.produce { background: #dff3e8; color: #13603f; font-weight: 600; }
.matriz td.dormido { background: #fff1cc; color: #8a5a00; }
.matriz td.sin_codigo { background: #ffe2cc; color: #9a4a00; }
.matriz td.codigo { background: var(--brand-soft); color: var(--brand-2); }
.matriz td.nada { color: var(--line); }
.matriz td.total { background: var(--gray-soft); font-weight: 600; }
.matriz thead th a { color: inherit; }
.matriz thead th.orden { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.ranking td.barra-c { min-width: 220px; }
.ranking .barra { grid-template-columns: 1fr auto; margin: 0; }
.matriz tfoot td { border-top: 2px solid var(--line); position: sticky; bottom: 0; background: var(--panel); }
.matriz tfoot td.total { background: var(--gray-soft); }
.matriz td.c small { display: block; font-size: 10.5px; opacity: .8; font-weight: 400; }
.matriz-ref { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin: 10px 0; }
.matriz-ref i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

/* estadísticas: tortas (anillo SVG) y secciones */
.torta { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.torta svg { width: 150px; height: 150px; flex: none; }
.torta circle { transition: stroke-width .15s; }
.torta circle:hover { stroke-width: 9; }
.torta-total { font: 700 7px var(--display); fill: var(--navy); text-anchor: middle; }
.torta-unidad { font-size: 2.8px; fill: var(--muted); text-anchor: middle; text-transform: uppercase; letter-spacing: .08em; }
.torta-ley { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 190px; font-size: 13px; }
.torta-ley li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 50px; gap: 8px; align-items: center; padding: 3px 0; }
.torta-ley i { width: 10px; height: 10px; border-radius: 3px; }
.torta-ley .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.torta-ley b { font-variant-numeric: tabular-nums; }
.torta-ley small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.est-titulo { font-family: var(--display); font-size: 18px; margin: 28px 0 12px; color: var(--navy); }
.est-titulo small { font: 500 13px var(--sans); color: var(--muted); }
.kpi .val.chico { font-size: 22px; }

/* refacturaciones (ficha de la póliza y vencimientos) */
.refac-forms { border-top: 1px solid var(--line); padding: 12px 20px 4px; display: grid; gap: 4px; }
.refac-forms .filtros { margin: 0; padding: 0; box-shadow: none; border: 0; background: none; }
.ev-refac { background: #1f9aa5; }
.solapas { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.solapas a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font-weight: 600; font-size: 13px; text-decoration: none; }
.solapas a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.solapas a .cuenta { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 11px; text-align: center; }
.solapas a.on .cuenta { background: var(--accent); color: var(--navy); }
.solapas a .cuenta.alerta { background: var(--bad-soft); color: var(--bad); }
.en-fila { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.en-fila select { width: auto; padding: 4px 6px; font-size: 12px; }

/* ---------------- celular: teléfonos, tarjetas, filtros plegables e Inicio compacto ---------------- */
.tel-acciones { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.wa { display: inline-block; padding: 1px 8px; border-radius: 99px; background: #e3f6ea; color: #177a52; font-size: 11px; font-weight: 600; white-space: nowrap; }
.wa:hover { text-decoration: none; background: #c9eed7; }
button.wa { border: 0; cursor: pointer; font-family: inherit; }
.wa-grupo { display: inline-flex; gap: 4px; align-items: center; }
.wa-copiar { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 0 7px; font-size: 11px; cursor: pointer; font-family: inherit; }
.wa-copiar:hover { color: var(--ink); }
.plantilla-wa textarea { min-height: 84px; }
.plantilla-wa .vista { background: #e3f6ea; border-radius: 10px; padding: 8px 12px; font-size: 13px; white-space: pre-line; margin-top: 6px; }
.mas-filtros { display: none; }
@media (max-width: 700px) {
  table.tarjetas thead { display: none; }
  table.tarjetas, table.tarjetas tbody, table.tarjetas tfoot, table.tarjetas tr, table.tarjetas td { display: block; width: 100%; }
  table.tarjetas tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.tarjetas tbody tr:nth-child(even) { background: #fbfdfe; }
  table.tarjetas td { border: 0; padding: 3px 0; text-align: right; white-space: normal; overflow: hidden; }
  table.tarjetas td::before { content: attr(data-label); float: left; max-width: 45%; margin-right: 14px; padding-top: 2px; text-align: left; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
  table.tarjetas td:first-child { display: block; text-align: left; font-size: 15px; padding-bottom: 6px; }
  table.tarjetas td:first-child::before, table.tarjetas td[data-label=""]::before { display: none; }
  table.tarjetas td[data-label=""] { text-align: left; padding-top: 6px; }
  table.tarjetas td:empty { display: none; }
  table.tarjetas .tel-acciones { justify-content: flex-end; }
  .wa { padding: 4px 12px; font-size: 13px; }
  .tel-num { font-weight: 600; }
  /* filtros: a la vista solo el buscador, el resto con "Más filtros" */
  form.filtros.plegado > div:not(.ancho):not(.btns) { display: none; }
  .mas-filtros { display: inline-flex; }
  /* Inicio y totales: de a dos por fila y números más chicos */
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .lbl { font-size: 10px; letter-spacing: .05em; }
  .kpi .val { font-size: 22px; }
  .kpi.dinero .val { font-size: 16px; white-space: normal; overflow-wrap: anywhere; }
  .kpi .sub { font-size: 11px; }
  .rp-grid b { font-size: 16px; white-space: nowrap; }
  .rp-grid > div:nth-child(3) { grid-column: span 2; } /* premio emitido: el importe entero en una línea */
  .head h1 { font-size: 22px; }
}

/* menú con grupos que se abren y cierran */
.menu-grupo > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .16em; color: #85a0b3; margin: 14px 0 3px; padding: 4px 12px; border-radius: 8px; font-weight: 600; user-select: none; }
.menu-grupo > summary::-webkit-details-marker { display: none; }
.menu-grupo > summary::after { content: "▸"; margin-left: auto; font-size: 11px; transition: transform .15s; }
.menu-grupo[open] > summary::after { transform: rotate(90deg); }
.menu-grupo > summary:hover { color: #c3d6e4; background: rgba(255,255,255,.04); }
.menu-grupo > summary .cuenta { letter-spacing: 0; }
.menu-grupo[open] > summary .cuenta { display: none; } /* abierto, el número se ve en cada opción */

/* listas que se ordenan tocando el título de la columna */
th.orden { cursor: pointer; user-select: none; }
th.orden:hover { color: var(--brand); }
th.orden::after { content: "↕"; margin-left: 4px; opacity: .35; font-size: 10px; }
th.orden[data-dir="asc"]::after { content: "▲"; opacity: 1; color: var(--brand); }
th.orden[data-dir="desc"]::after { content: "▼"; opacity: 1; color: var(--brand); }

