/* Alas de Gloria · Sistema de gestión */
:root {
  --c: #018CC9; --c-osc: #0A5F8A; --c-cla: #E8F4FB; --c-cla2: #F3F9FD;
  --t: #2B2B2B; --t2: #5E6873; --t3: #8A949E; --b: #DCE5EB; --b2: #EEF2F5; --fondo: #F6F9FB;
  --ok: #2E8B57; --ok-cla: #E7F5EC; --alerta: #B7791F; --alerta-cla: #FFF6E5; --error: #B23B3B; --error-cla: #FCEDED;
  --serif: Georgia, "Times New Roman", "Book Antiqua", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radio: 8px; --sombra: 0 1px 2px rgba(16, 42, 60, .06), 0 1px 6px rgba(16, 42, 60, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--t); background: var(--fondo); font-size: 14px; line-height: 1.45; }
a { color: var(--c-osc); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: normal; color: var(--c-osc); margin: 0 0 .5em; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
small, .muted { color: var(--t2); }
.mono { font-variant-numeric: tabular-nums; }

/* Layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--b); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .logo { padding: 18px 20px 14px; border-bottom: 1px solid var(--b2); }
.side .logo img { width: 160px; display: block; }
.side nav { padding: 10px 0; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 20px; color: var(--t2); border-left: 3px solid transparent; }
.side nav a:hover { background: var(--c-cla2); color: var(--c-osc); text-decoration: none; }
.side nav a.on { background: var(--c-cla); color: var(--c-osc); border-left-color: var(--c); font-weight: 600; }
.side nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--t3); padding: 14px 20px 4px; }
.side .user { padding: 12px 20px; border-top: 1px solid var(--b2); font-size: 12.5px; color: var(--t2); }
.side .user b { color: var(--t); display: block; font-size: 13.5px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 16px; padding: 12px 28px; background: #fff; border-bottom: 1px solid var(--b); position: sticky; top: 0; z-index: 5; }
.top form.buscar { flex: 1; max-width: 520px; }
.top form.buscar input { width: 100%; padding: 9px 14px 9px 36px; border: 1px solid var(--b); border-radius: 20px; background: var(--fondo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A949E' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }
.top .pv { margin-left: auto; font-size: 12.5px; color: var(--t2); white-space: nowrap; }
.top .pv b { color: var(--c-osc); }
.contenido { padding: 24px 28px 48px; max-width: 1400px; }
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.encabezado h1 { margin: 0; }
.encabezado .sub { color: var(--t2); margin-top: 2px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Cards */
.card { background: #fff; border: 1px solid var(--b); border-radius: var(--radio); box-shadow: var(--sombra); padding: 18px 20px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card .card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.card .card-head h2, .card .card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.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)); } .g-2-1 { grid-template-columns: 2fr 1fr; } .g-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1, .g-1-2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .app { grid-template-columns: 1fr; } .side { position: static; height: auto; } .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* KPI */
.kpi { background: #fff; border: 1px solid var(--b); border-radius: var(--radio); padding: 14px 16px; box-shadow: var(--sombra); }
.kpi span { display: block; color: var(--t2); font-size: 12.5px; }
.kpi strong { display: block; font-family: var(--serif); font-weight: normal; font-size: 24px; color: var(--c-osc); margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; }
.kpi.alta strong { color: var(--error); } .kpi.media strong { color: var(--alerta); }

/* Tablas */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 600; font-size: 12px; color: var(--t2); text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--b); background: var(--c-cla2); }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--b2); vertical-align: top; }
table.t tr:hover td { background: #FAFCFD; }
table.t .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tfoot td { font-weight: 600; border-top: 1px solid var(--b); background: var(--c-cla2); }
.tabla-scroll { overflow-x: auto; }
.vacio { padding: 26px; text-align: center; color: var(--t3); }

/* Formularios */
label { display: block; font-size: 12.5px; color: var(--t2); margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=search], input[type=tel], input[type=month], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--b); border-radius: 6px; font: inherit; color: var(--t); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(1, 140, 201, .25); border-color: var(--c); }
textarea { min-height: 80px; resize: vertical; }
.campo { margin-bottom: 12px; }
.fila { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: normal; color: var(--t); font-size: 14px; }
.ayuda { font-size: 12px; color: var(--t3); margin-top: 3px; }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filtros .campo { margin: 0; min-width: 140px; }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--b); background: #fff; color: var(--t); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--c-cla2); text-decoration: none; }
.btn.prim { background: var(--c); border-color: var(--c); color: #fff; } .btn.prim:hover { background: var(--c-osc); }
.btn.peligro { color: var(--error); border-color: #EBC5C5; } .btn.peligro:hover { background: var(--error-cla); }
.btn.chico { padding: 5px 10px; font-size: 12.5px; }
.btn.link { border: 0; background: none; color: var(--c-osc); padding: 0; font-weight: 600; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Etiquetas */
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--b2); color: var(--t2); white-space: nowrap; }
.tag.ALTA, .tag.error, .tag.ANULADO, .tag.ERROR, .tag.RESCINDIDA { background: var(--error-cla); color: var(--error); }
.tag.MEDIA, .tag.alerta, .tag.RESERVA, .tag.RESERVADO, .tag.PENDIENTE { background: var(--alerta-cla); color: var(--alerta); }
.tag.BAJA, .tag.info, .tag.DISPONIBLE { background: var(--c-cla); color: var(--c-osc); }
.tag.ok, .tag.ACTIVA, .tag.PAGADO, .tag.EMITIDA, .tag.VIGENTE, .tag.ABIERTA, .tag.CUMPLIDO { background: var(--ok-cla); color: var(--ok); }
.tag.VENDIDO, .tag.CERRADA, .tag.REFINANCIADO { background: #EDEFF2; color: #4A5560; }

/* Mensajes */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: var(--ok-cla); border-color: #BFE3CC; color: #1F6B42; }
.flash.error { background: var(--error-cla); border-color: #EFC9C9; color: var(--error); }
.flash.info { background: var(--c-cla); border-color: #C5E3F3; color: var(--c-osc); }
.flash.alerta { background: var(--alerta-cla); border-color: #F0DDB5; color: #8A5A00; }
.aviso { background: var(--alerta-cla); border-left: 4px solid #E0A030; padding: 10px 14px; border-radius: 6px; margin: 10px 0; }
.nota { background: var(--c-cla); border-radius: 6px; padding: 10px 14px; margin: 10px 0; }

/* Datos */
dl.datos { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
dl.datos dt { color: var(--t2); font-size: 13px; } dl.datos dd { margin: 0; }
.barra { height: 8px; background: var(--b2); border-radius: 4px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--c); }
.barra i.ALTA { background: var(--error); } .barra i.MEDIA { background: #E0A030; } .barra i.BAJA { background: var(--c); }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.chart .col i { width: 100%; background: var(--c); border-radius: 3px 3px 0 0; min-height: 1px; }
.chart .col small { font-size: 10px; margin-top: 4px; color: var(--t3); white-space: nowrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--b); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; color: var(--t2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--c-osc); border-bottom-color: var(--c); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--c-osc); }

/* Plano de nichos */
.plano-wrap { overflow-x: auto; padding-bottom: 6px; }
.plano { display: grid; gap: 3px; width: max-content; }
.plano .rot { font-size: 10.5px; color: var(--t3); display: flex; align-items: center; justify-content: center; }
.plano a.n { width: 26px; height: 22px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 8.5px; color: transparent; text-decoration: none; position: relative; }
.plano a.n:hover { outline: 2px solid var(--t); z-index: 2; color: #fff; }
.n.DISPONIBLE { background: var(--c); } .n.RESERVADO { background: #F2C46D; } .n.VENDIDO { background: #9AA7B3; } .n.BLOQUEADO { background: #E3E7EA; }
.n.vacio { background: transparent; border: 1px dashed var(--b); }
.n.d-ALTA { box-shadow: inset 0 0 0 2.5px var(--error); } .n.d-MEDIA { box-shadow: inset 0 0 0 2.5px #E0A030; }
.plano.solo-deuda a.n:not(.d-ALTA):not(.d-MEDIA):not(.d-BAJA) { opacity: .25; }
.n.d-BAJA { box-shadow: inset 0 0 0 2px #6FB7DD; }
.n.tipo-off { opacity: .2; }
.leyenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--t2); margin: 10px 0; }
.leyenda b { display: inline-block; width: 14px; height: 12px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #fff 0%, var(--c-cla2) 100%); padding: 20px; }
.login .caja { width: 380px; max-width: 100%; background: #fff; border: 1px solid var(--b); border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 42, 60, .08); padding: 34px 32px; }
.login img { width: 220px; display: block; margin: 0 auto 26px; }
.login h1 { font-size: 18px; text-align: center; color: var(--t2); margin-bottom: 20px; }
.login .btn { width: 100%; justify-content: center; padding: 10px; }

/* Lista de pagos */
.pagos .pago { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: end; }
.totales { display: flex; gap: 22px; justify-content: flex-end; font-size: 15px; margin-top: 8px; }
.totales b { font-family: var(--serif); font-weight: normal; font-size: 20px; color: var(--c-osc); }

/* Matriz de permisos */
table.matriz td, table.matriz th { text-align: center; }
table.matriz td:first-child, table.matriz th:first-child { text-align: left; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--b); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.timeline li small { display: block; }

/* Impresión */
.solo-print { display: none; }
@media print {
  .side, .top, .no-print, .acciones, .flash { display: none !important; }
  .app { display: block; } .contenido { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .solo-print { display: block; }
}
.doc-impreso { background: #fff; max-width: 820px; margin: 0 auto; padding: 40px 50px; border: 1px solid var(--b); font-family: var(--serif); font-size: 15px; line-height: 1.6; color: #222; }
.doc-impreso h2 { text-align: center; font-size: 20px; color: #222; margin-bottom: 14px; }
.doc-impreso p { text-align: justify; margin: 0 0 12px; white-space: normal; }
.doc-impreso .membrete { display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid var(--c); padding-bottom: 12px; margin-bottom: 22px; font-family: var(--sans); font-size: 12px; color: var(--t2); }
.doc-impreso .membrete img { width: 170px; }
@media print { .doc-impreso { border: 0; padding: 0; max-width: none; } }
.marca-agua { border: 2px dashed var(--error); color: var(--error); text-align: center; padding: 6px; font-weight: 700; font-family: var(--sans); margin-bottom: 14px; }

/* Filas editables (maestros) */
.filas-edit .fe { display: grid; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--b2); }
.filas-edit .fe.cab { font-size: 12px; font-weight: 600; color: var(--t2); text-transform: uppercase; background: var(--c-cla2); }

/* Guía de funerarias */
.fichas { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.ficha { background: #fff; border: 1px solid var(--b); border-radius: 10px; overflow: hidden; box-shadow: var(--sombra); display: flex; flex-direction: column; }
.ficha .foto { aspect-ratio: 16 / 10; background: var(--c-cla); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ficha .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ficha .foto .ini { font-family: var(--serif); font-size: 46px; color: var(--c); letter-spacing: .04em; }
.ficha .cuerpo { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ficha h3 { margin: 0; font-size: 18px; }
.ficha .dato { display: flex; gap: 8px; font-size: 13.5px; color: var(--t); }
.ficha .dato svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--c); }
.ficha .pie { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.ficha .nota-f { font-size: 12.5px; color: var(--t2); background: var(--c-cla2); border-radius: 6px; padding: 6px 8px; }

/* Selector de archivo / cámara */
.selector-archivo { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.selector-archivo label.btn { margin: 0; font-weight: 600; color: var(--t); cursor: pointer; }
.selector-archivo .archivo-elegido { font-size: 12.5px; color: var(--t2); }
.selector-archivo .archivo-preview { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--b); }
.selector-archivo.falta .archivo-elegido { color: var(--error); font-weight: 600; }
@media (hover: hover) and (pointer: fine) and (min-width: 901px) { .solo-tactil { display: none !important; } }

/* Menú móvil */
.btn-menu { display: none; background: none; border: 0; padding: 6px; margin-left: -6px; color: var(--c-osc); cursor: pointer; }
.btn-menu svg { width: 26px; height: 26px; display: block; }
.velo { display: none; }
.top .logo-movil { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; left: 0; bottom: 0; width: 270px; height: 100%; z-index: 40; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 30px rgba(0,0,0,.18); }
  body.menu-abierto .side { transform: none; }
  body.menu-abierto .velo { display: block; position: fixed; inset: 0; background: rgba(10, 30, 45, .35); z-index: 30; }
  .side nav a { padding: 12px 20px; font-size: 15px; }
  .btn-menu { display: block; }
  .top { padding: 10px 14px; gap: 10px; flex-wrap: wrap; padding-top: max(10px, env(safe-area-inset-top)); }
  .top .logo-movil { display: block; height: 30px; }
  .top .pv { display: none; }
  .top form.buscar { order: 3; flex-basis: 100%; max-width: none; }
  .contenido { padding: 16px 14px 60px; }
  h1 { font-size: 22px; }
  .encabezado { margin-bottom: 14px; }
  .encabezado .acciones { width: 100%; }
  .card { padding: 14px; border-radius: 10px; }
  .kpi strong { font-size: 20px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs a { white-space: nowrap; padding: 10px 12px; }
  .filtros .campo { min-width: 0; flex: 1 1 140px; }
  .filtros .campo[style] { flex: 1 1 100% !important; max-width: none !important; }
  .filtros > .check { flex: 1 1 100%; }
  .btn { padding: 10px 14px; }
  .btn.chico { padding: 7px 11px; }
  input, select, textarea { font-size: 16px !important; } /* evita el zoom automático en iPhone */
  dl.datos { grid-template-columns: 120px 1fr; }
  .pagos .pago { grid-template-columns: 1fr 1fr; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .fe { grid-template-columns: 1fr 1fr !important; }
  .fe.cab { display: none !important; }
  /* Tablas como tarjetas */
  table.t:not(.no-resp) thead { display: none; }
  table.t:not(.no-resp), table.t:not(.no-resp) tbody, table.t:not(.no-resp) tfoot { display: block; }
  table.t:not(.no-resp) tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--b); }
  table.t:not(.no-resp) td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; text-align: right; }
  table.t:not(.no-resp) td.num { white-space: normal; }
  table.t:not(.no-resp) td::before { content: attr(data-label); color: var(--t2); font-size: 12px; text-align: left; font-weight: 600; flex: none; max-width: 45%; }
  table.t:not(.no-resp) td:not([data-label])::before, table.t:not(.no-resp) td[data-label=""]::before { display: none; }
  table.t:not(.no-resp) td:first-child { font-weight: 600; }
  table.t:not(.no-resp) td:only-child { justify-content: center; }
  table.t:not(.no-resp) tfoot tr { background: var(--c-cla2); }
  table.t:not(.no-resp) tr:hover td { background: none; }
  table.matriz td { text-align: center; }
  .plano a.n { width: 30px; height: 26px; }
  .doc-impreso { padding: 18px; }
  .ficha .pie .btn { flex: 1; justify-content: center; }
  .demo-banda { font-size: 11px; bottom: 8px; }
}
@media (max-width: 480px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 10px 12px; }
  .kpi strong { font-size: 17px; }
  .fichas { grid-template-columns: 1fr; }
}

/* Agenda */
.badge { margin-left: auto; background: var(--error); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.tareas { list-style: none; margin: 0; padding: 0; }
.tarea { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 10px 4px; border-bottom: 1px solid var(--b2); }
.tarea:last-child { border-bottom: 0; }
.tarea .chk { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--c); background: #fff; cursor: pointer; padding: 0; margin-top: 1px; }
.tarea .chk:hover { background: var(--c-cla); }
.tarea.HECHA .chk { background: var(--ok); border-color: var(--ok); }
.tarea.HECHA .titulo { text-decoration: line-through; color: var(--t3); }
.tarea .titulo { font-weight: 600; }
.tarea .meta { font-size: 12.5px; color: var(--t2); display: flex; gap: 6px 10px; flex-wrap: wrap; margin-top: 3px; }
.tarea .meta a { font-weight: 600; }
.tarea .desc { font-size: 13px; color: var(--t2); margin-top: 3px; white-space: pre-wrap; }
.tarea .fecha-t { font-size: 12.5px; text-align: right; white-space: nowrap; color: var(--t2); }
.tarea .fecha-t.vencida { color: var(--error); font-weight: 600; }
.grupo-tareas h3 { font-size: 14px; font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--t2); margin: 6px 0 4px; }
.grupo-tareas h3 .n { font-weight: 600; color: var(--t3); }
.grupo-tareas.vencidas h3 { color: var(--error); }
.prio-ALTA { border-left: 3px solid var(--error); padding-left: 8px; } .prio-MEDIA { border-left: 3px solid #E0A030; padding-left: 8px; } .prio-BAJA { border-left: 3px solid var(--b); padding-left: 8px; }
@media (max-width: 900px) { .tarea { grid-template-columns: 28px 1fr; } .tarea .fecha-t { grid-column: 2; text-align: left; } }

/* Persona que gestiona el pago */
.estrella { color: var(--c); font-size: 1.05em; margin-left: 3px; cursor: help; }
.paga-radio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--c-osc); cursor: pointer; }
.paga-radio input { accent-color: var(--c); }

/* Modo simple: pantallas más grandes y despejadas para el uso diario --------------- */
body.simple { font-size: 17px; line-height: 1.55; }
body.simple h1 { font-size: 30px; } body.simple h2 { font-size: 22px; }
body.simple label { font-size: 15px; }
body.simple .check { font-size: 17px; }
body.simple .ayuda { font-size: 14.5px; color: var(--t2); }
body.simple input, body.simple select, body.simple textarea { font-size: 17px; padding: 11px 12px; }
body.simple .btn { padding: 12px 20px; font-size: 17px; }
body.simple .btn.chico { padding: 8px 14px; font-size: 15px; }
body.simple .side nav a { font-size: 17px; padding-top: 12px; padding-bottom: 12px; }
body.simple .side .user { font-size: 15px; }
body.simple table.t td { padding: 11px 10px; }
body.simple table.t th { font-size: 13.5px; }
body.simple .tag { font-size: 13.5px; }
body.simple .tabs a { font-size: 17px; }
body.simple .top .buscar input { font-size: 17px; }
body.simple input[type=checkbox], body.simple input[type=radio] { width: 22px; height: 22px; }
.buscar-grande { background: #fff; border: 1px solid var(--b); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.buscar-grande label { font-size: 18px; color: var(--c-osc); }
.buscar-grande div { display: flex; gap: 10px; }
.buscar-grande input { flex: 1; font-size: 20px !important; padding: 14px 16px !important; }
.accesos { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.acceso { display: block; background: var(--c); color: #fff; border-radius: 10px; padding: 22px 20px; text-decoration: none; min-height: 96px; }
.acceso:hover { background: var(--c-osc); text-decoration: none; }
.acceso b { display: block; font-size: 22px; font-family: var(--serif); font-weight: normal; }
.acceso span { display: block; margin-top: 6px; font-size: 15px; opacity: .92; }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--b2); }

/* Detalle ítem por ítem de caja */
.libro-caja tr.anulado td { color: var(--t3); text-decoration: line-through; }
.libro-caja tr.anulado td .tag, .libro-caja tr.anulado td a { text-decoration: none; }
.libro-caja tr.ok-check td { background: #EEF8EF; }
.libro-caja .casillero { display: none; width: 14px; height: 14px; border: 1.5px solid #333; }
@media print {
  .libro-caja input[type=checkbox] { display: none; }
  .libro-caja .casillero { display: inline-block; }
  .no-print { display: none !important; }
}

/* Plano dibujado como las hojas en papel ------------------------------------------- */
.hoja-wrap { overflow-x: auto; padding: 6px 0 10px; }
.hoja { width: max-content; min-width: 100%; display: flex; flex-direction: column; gap: 22px; align-items: center; }
.banda { display: flex; gap: 22px; align-items: center; justify-content: center; }
.u { display: flex; align-items: stretch; }
.u .lado { display: flex; flex-direction: column; gap: 2px; }
.u .lado.izq .ren { justify-content: flex-end; }
.u .ren { display: flex; gap: 2px; align-items: center; min-height: 26px; }
.u .ren.t-REDUCIDO { min-height: 17px; }
.u .ren.vacio { min-height: 26px; }
.u .pasillo { width: 56px; position: relative; border-left: 1px solid #b9c6cf; border-right: 1px solid #b9c6cf; background: #F7FAFC; margin: 0 4px; }
.u .pasillo span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 11px; font-weight: 600; color: var(--t2);
  border: 1px solid #9aa9b4; background: #fff; padding: 2px 6px; white-space: nowrap; }
.hoja .col { width: 22px; text-align: center; font-size: 11px; color: var(--t2); flex: none; }
.hn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border: 1px solid #9fb2bf; background: #fff; color: #23323d;
  font-size: 9.5px; font-variant-numeric: tabular-nums; width: 52px; height: 23px; flex: none; border-radius: 2px; letter-spacing: -.2px; }
.hn.t-REDUCIDO { width: 18px; height: 15px; font-size: 9px; }
.hn.hueco { border: 0; background: transparent; }
.hn.VENDIDO { background: #7CC6EA; border-color: #4FA6CF; color: #0B3550; }
.hn.RESERVADO { background: #F6D58A; border-color: #D8AE4E; }
.hn.BLOQUEADO { background: repeating-linear-gradient(45deg, #E6E9EC, #E6E9EC 4px, #D3D8DC 4px, #D3D8DC 8px); color: #556; }
.hn.d-ALTA { box-shadow: inset 0 0 0 2px var(--error); } .hn.d-MEDIA { box-shadow: inset 0 0 0 2px #E0A030; } .hn.d-BAJA { box-shadow: inset 0 0 0 2px #6FB7DD; }
a.hn:hover { outline: 2px solid var(--c-osc); z-index: 2; text-decoration: none; }
.leyenda b.hn { width: 16px; height: 12px; border-radius: 2px; }
.v { display: flex; flex-direction: column; gap: 2px; }
.v .vf { display: flex; gap: 2px; }
.v .vf .col { width: 18px; }
.v .hn.t-COMUN { width: 56px; }
.marca { width: 70px; height: 70px; border-radius: 50%; border: 1.5px solid #556; display: flex; align-items: center; justify-content: center;
  text-align: center; font-weight: 700; font-size: 13px; line-height: 1.2; color: #333; background: #fff; }
.rotulo { border: 1px solid #9aa9b4; padding: 8px 12px; font-size: 12px; color: var(--t2); background: #fff; }
@media print {
  .hoja-card { box-shadow: none; border: 0; }
  .hoja-wrap { overflow: visible; }
  .hoja { zoom: .7; }
}
.u + .u { margin-left: -22px; }
.u + .u .lado.izq { border-left: 3px solid #4a5a66; padding-left: 4px; }
.hu { display: flex; flex-direction: column; }
.hu .hs { display: flex; gap: 2px; }
.hu .hs.sup { align-items: flex-end; } .hu .hs.inf { align-items: flex-start; }
.hu .hc { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.hu .hc .col { width: auto; }
.hu .hpas { height: 44px; position: relative; border-top: 1px solid #b9c6cf; border-bottom: 1px solid #b9c6cf; background: #F7FAFC; margin: 4px 0; }
.hu .hpas span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 11px; font-weight: 600; color: var(--t2);
  border: 1px solid #9aa9b4; background: #fff; padding: 2px 6px; }

/* Ventana emergente (nueva tarea) ------------------------------------------------- */
dialog.modal { border: 0; border-radius: 12px; padding: 22px 24px; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(20, 35, 45, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h2 { margin: 0; }
.modal textarea { min-height: 56px; }
.vinculo-tarea { position: relative; }
.vinculo-elegido { background: var(--c-cla2); border: 1px solid var(--b); border-radius: 6px; padding: 9px 12px; font-weight: 600; }
.vinculo-resultados { position: absolute; left: 0; right: 0; z-index: 20; background: #fff; border: 1px solid var(--b); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 260px; overflow: auto; }
.vinculo-resultados:empty { display: none; }
.vinculo-resultados button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; font: inherit;
  border-bottom: 1px solid var(--b2); }
.vinculo-resultados button:hover, .vinculo-resultados button.on { background: var(--c-cla2); }
.vinculo-resultados small { color: var(--t3); display: block; }
.modal .vinculo-resultados { position: static; box-shadow: none; margin-top: 4px; max-height: 220px; }

/* Planilla de caja (A4 horizontal) ------------------------------------------------ */
.planilla-caja { background: #fff; border: 1px solid var(--b); border-radius: 8px; padding: 18px 20px; }
.pc-cabecera { display: flex; justify-content: space-between; font-size: 14px; border-bottom: 2px solid #333; padding-bottom: 6px; margin-bottom: 10px; }
.pc-tablas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
table.pc { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.pc th, table.pc td { border: 1px solid #9aa5ae; padding: 4px 6px; vertical-align: top; }
table.pc th { background: #EEF4F8; font-weight: 600; text-align: left; }
table.pc th.pc-titulo { background: var(--c); color: #fff; font-size: 13.5px; text-align: center; }
table.pc tfoot td { font-weight: 700; background: #F4F7F9; }
table.pc tr.anulado td { color: #8a949c; text-decoration: line-through; }
table.pc tr.anulado td b { text-decoration: none; }
.pc-totales { display: flex; justify-content: flex-end; gap: 28px; margin-top: 12px; font-size: 14px; }
.pc-totales div { display: flex; flex-direction: column; align-items: flex-end; }
.pc-totales span { font-size: 12px; color: var(--t2); }
.pc-neto b { font-size: 18px; border-top: 2px solid #333; padding-top: 2px; }
.pc-obs { margin-top: 8px; font-size: 12.5px; }
.pc-firmas { display: flex; justify-content: space-around; margin-top: 38px; font-size: 12px; }
.pc-firmas div { width: 32%; border-top: 1px solid #333; text-align: center; padding-top: 4px; }
.planilla-caja { page: planilla; }
@page planilla { size: A4 landscape; margin: 10mm; }
@media print {
  .planilla-caja { border: 0; padding: 0; }
  table.pc { font-size: 9.5px; }
  table.pc th, table.pc td { padding: 2px 4px; }
  table.pc tfoot { display: table-row-group; }
  .encabezado, .carga-mov { display: none !important; }
  table.pc th.pc-titulo { background: #ddd !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Carpeta de documentos del nicho */
.carpeta { display: flex; flex-direction: column; border: 1px solid var(--b2); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.archivo { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--b2); }
.archivo:last-child { border-bottom: 0; }
.arch-icono { width: 42px; height: 48px; flex: none; border-radius: 4px; background: #E8EEF2; color: #455; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; text-decoration: none; border: 1px solid #cfd8de; }
.arch-icono.ext-pdf { background: #FBE9E7; color: #B23A2B; border-color: #F0C4BD; }
.arch-icono.ext-jpg, .arch-icono.ext-jpeg, .arch-icono.ext-png, .arch-icono.ext-webp, .arch-icono.ext-heic { background: #E6F4FB; color: var(--c-osc); border-color: #BFE0F0; }
.arch-icono.ext-doc, .arch-icono.ext-docx, .arch-icono.ext-odt { background: #E8EEFB; color: #2B4FA0; }
.arch-icono.ext-xls, .arch-icono.ext-xlsx, .arch-icono.ext-ods { background: #E6F4EA; color: #237A3E; }
.arch-datos { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.arch-datos b { word-break: break-all; }
.arch-acc { display: flex; gap: 6px; flex: none; }

.hn.foco { outline: 3px solid #E0A030; outline-offset: 2px; z-index: 3; position: relative; animation: foco 1.2s ease-in-out 3; }
@keyframes foco { 50% { outline-color: transparent; } }

/* Ficha del nicho: datos fijos + pestañas */
.ficha-fija dl.datos dd { font-size: 1.02em; }
.pestanas { margin: -4px 0 14px; }
[data-pestanas].js .panel { display: none; }
[data-pestanas].js .panel.on { display: block; }
.panel > .card { border: 0; box-shadow: none; padding: 0; margin: 0; background: transparent; }
.panel > .card > .card-head h2 { display: none; }
.evento { display: grid; grid-template-columns: 110px 22px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--b2); }
.evento > span { color: var(--c-osc); text-align: center; }
.evento b { font-weight: 600; }
.edit-persona { border: 1px solid var(--b); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.edit-persona.quitada { opacity: .55; }
.edit-persona .cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.edit-persona .cab label { font-weight: normal; display: inline-flex; gap: 6px; align-items: center; }
.anteriores { background: var(--fondo); border-radius: 10px; padding: 10px 14px; }
.edit-persona .cab select { width: auto; min-width: 170px; }
.pestanas a[role=tab] { cursor: pointer; }
.tag.forma-CAJON { background: #E3F0F8; color: #0B4F75; } .tag.forma-RESTOS { background: #F3EEE3; color: #6B5320; } .tag.forma-URNA { background: #EEE9F5; color: #4F3A78; }
.opciones-forma { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.opciones-forma label.check { font-weight: normal; margin: 0; }
tr.anulado td { color: var(--t3); }

/* Íconos de contacto (WhatsApp / e-mail) */
.iconos-contacto { display: inline-flex; gap: 6px; vertical-align: middle; }
.iconos-contacto a, .iconos-contacto span.off { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; text-decoration: none; }
.iconos-contacto svg { width: 16px; height: 16px; }
.iconos-contacto .ico-wa { background: #E6F6EC; color: #1E8E4E; } .iconos-contacto .ico-wa:hover { background: #1E8E4E; color: #fff; }
.iconos-contacto .ico-mail { background: var(--c-cla); color: var(--c-osc); } .iconos-contacto .ico-mail:hover { background: var(--c); color: #fff; }
.iconos-contacto .off { background: var(--b2) !important; color: var(--t3) !important; cursor: not-allowed; }
.iconos-contacto.grande { gap: 10px; margin: 8px 0 6px; display: flex; }
.iconos-contacto.grande a, .iconos-contacto.grande span.off { width: auto; height: 40px; border-radius: 20px; padding: 0 16px; gap: 8px; font-weight: 600; font-size: 14px; }
.iconos-contacto.grande svg { width: 20px; height: 20px; }
.pestanas a.pestana-alerta { color: var(--error); }
.card.adelantar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; }
.card.adelantar select { width: auto; }
.nota-persona { display: flex; gap: 4px; margin-top: 6px; max-width: 360px; }
.nota-persona input { padding: 4px 8px; font-size: 12.5px; background: #FFFBEA; border-color: #EBDDA6; }
.nota-persona small { background: #FFFBEA; border: 1px solid #EBDDA6; border-radius: 6px; padding: 3px 8px; display: inline-block; }
td.col-nota { min-width: 200px; } td.col-nota .nota-persona { margin-top: 0; }
.card-head > h2 { white-space: nowrap; } .card-head > .acciones { justify-content: flex-end; flex-wrap: wrap; flex: 1; }
/* Remitos */
.tipos-remito { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.tipo-remito { border: 1px solid var(--b); border-radius: 10px; padding: 14px; color: var(--t); font-weight: 600; text-decoration: none; background: #fff; }
.tipo-remito:hover { border-color: var(--c); text-decoration: none; } .tipo-remito.on { border-color: var(--c); background: var(--c-cla); color: var(--c-osc); }
.remito { position: relative; background: #fff; border: 1.5px solid #333; padding: 14px 18px 8px; font-family: var(--sans); font-size: 13.5px; color: #111; max-width: 190mm; margin: 0 auto 10px; min-height: 118mm; box-sizing: border-box; display: flex; flex-direction: column; }
.rm-cab { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; align-items: center; border: 1px solid #333; padding: 8px 10px; }
.rm-emp { font-size: 11.5px; line-height: 1.45; } .rm-emp span { display: block; font-size: 12.5px; }
.rm-logo { text-align: center; } .rm-logo img { width: 150px; }
.rm-num { text-align: right; font-size: 12px; } .rm-num b { display: block; font-size: 18px; } .rm-num span { font-size: 15px; letter-spacing: .04em; } .rm-num small { display: block; font-size: 10px; margin-top: 4px; }
.rm-x { text-align: center; } .rm-x b { display: inline-block; background: #333; color: #fff; font-size: 30px; padding: 0 12px; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .rm-x small { display: block; font-size: 9px; text-transform: uppercase; }
.rm-fecha { text-align: right; margin: 10px 0 4px; }
.rm-iva { display: flex; justify-content: space-between; border-bottom: 1px solid #333; padding: 6px 0; font-size: 12px; text-transform: uppercase; }
.rm-linea { margin: 7px 0; line-height: 1.6; } .rm-linea u { text-decoration: none; border-bottom: 1px dotted #555; padding: 0 4px; font-weight: 600; }
.rm-detalle { display: flex; gap: 18px; align-items: flex-start; }
.rm-t { border-collapse: collapse; font-size: 12.5px; min-width: 230px; } .rm-t th, .rm-t td { border: 1px solid #333; padding: 3px 8px; }
.rm-firma { display: flex; gap: 30px; justify-content: flex-end; margin-top: auto; padding-top: 26px; flex: 1; align-items: flex-end; }
.rm-firma div { width: 170px; border-top: 1px dotted #333; text-align: center; font-size: 11.5px; padding-top: 2px; min-height: 1px; }
.rm-firma div:empty { border: 0; }
.rm-pago { display: flex; gap: 22px; align-items: center; border-top: 1px solid #333; padding-top: 8px; margin-top: 6px; } .rm-total { margin-left: auto; font-size: 15px; }
.rm-pie { font-size: 10px; text-align: center; color: #555; margin-top: 6px; }
.rm-corte { border-top: 1px dashed #999; margin: 6px 0 8px; }
.rm-detalle > span { white-space: nowrap; } .rm-t td { white-space: nowrap; }
.remito .sello-anulado { position: absolute; inset: 40% 0 auto; text-align: center; font-size: 48px; font-weight: 800; color: rgba(181,59,59,.35); transform: rotate(-12deg); pointer-events: none; }
@media print { .remito { page-break-inside: avoid; margin: 0 auto 3mm; font-size: 12.5px; padding: 10px 14px 6px; } .rm-linea { margin: 5px 0; } .rm-corte { margin: 2mm 0 3mm; } .rm-firma { padding-top: 18px; } }
.copias { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; color: var(--t2); }
.franja-prueba { position: sticky; top: 0; z-index: 50; background: #F6D58A; color: #5a4300; text-align: center; font-weight: 700; font-size: 13px; padding: 5px 10px; }
@media print { .franja-prueba { display: none; } }
/* Plano: entrada por niveles */
.niveles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.nivel-btn { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--b); border-radius: 12px; padding: 18px 20px; box-shadow: var(--sombra); color: var(--t); text-decoration: none; }
.nivel-btn:hover { border-color: var(--c); text-decoration: none; }
.nivel-btn b { font-family: var(--serif); font-weight: normal; font-size: 26px; color: var(--c-osc); }
.nivel-btn .pasillos { font-size: 13px; color: var(--t2); }
.nivel-btn .cifras { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; } .nivel-btn .c-disp { color: var(--c-osc); font-weight: 600; }
.nivel-btn .barra { height: 6px; background: var(--b2); border-radius: 3px; overflow: hidden; } .nivel-btn .barra i { display: block; height: 100%; background: #7CC6EA; }
.niveles-barra { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
body.simple .nivel-btn b { font-size: 30px; }
