/* =====================================================================
   Gestión de Entregas — ACI
   Hoja de estilos principal
   ===================================================================== */

:root {
    --navy:    #1B2A4A;
    --navy-2:  #243859;
    --verde:   #059669;
    --dorado:  #D4A843;
    --azul:    #3B82F6;
    --morado:  #8B5CF6;
    --naranja: #EA580C;
    --rojo:    #DC2626;
    --amarillo:#D97706;
    --gris:    #64748B;

    --tinta:   #1E293B;
    --tinta-2: #64748B;
    --linea:   #E2E8F0;
    --fondo:   #F1F5F9;
    --panel:   #FFFFFF;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --sombra:    0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
    --sombra-md: 0 4px 12px rgba(15,23,42,.10);
    --sombra-lg: 0 10px 30px rgba(15,23,42,.18);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'DM Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--tinta);
    background: var(--fondo);
    line-height: 1.5;
}

h1, h2, h3 { margin: 0 0 .25rem; font-weight: 700; color: var(--navy); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; }
p  { margin: .25rem 0; }
a  { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--tinta-2); font-size: .85rem; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* =====================================================================
   BOTONES
   ===================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .4rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    padding: .55rem .95rem;
    font: inherit; font-weight: 600; font-size: .9rem;
    cursor: pointer; white-space: nowrap;
    transition: filter .15s, background .15s, border-color .15s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(.96); }
.btn:active { transform: translateY(1px); }
.btn-primario  { background: var(--navy);   color: #fff; }
.btn-secundario{ background: var(--azul);   color: #fff; }
.btn-verde     { background: var(--verde);  color: #fff; }
.btn-naranja   { background: var(--naranja);color: #fff; }
.btn-fantasma  { background: #fff; color: var(--navy); border-color: var(--linea); }
.btn-fantasma:hover { background: var(--fondo); filter: none; }
.btn-sm { padding: .32rem .6rem; font-size: .8rem; border-radius: 6px; }
.btn-bloque { width: 100%; }

/* =====================================================================
   PANTALLAS DE AUTENTICACIÓN / INSTALACIÓN
   ===================================================================== */
.pantalla-centro {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #0f1a30 100%);
}
.tarjeta-auth {
    width: 100%; max-width: 420px;
    background: var(--panel);
    border-radius: var(--r-lg);
    box-shadow: var(--sombra-lg);
    padding: 2rem;
}
.auth-marca { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.5rem; }
.auth-marca h1 { font-size: 1.25rem; margin: 0; }
.auth-logo {
    width: 52px; height: 52px; flex: 0 0 52px;
    border-radius: var(--r-md);
    background: var(--navy); color: var(--dorado);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem; letter-spacing: .5px;
}

/* =====================================================================
   FORMULARIOS
   ===================================================================== */
.form { display: flex; flex-direction: column; gap: .9rem; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--navy); }
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=search], input[type=month],
select, textarea {
    width: 100%;
    margin-top: .3rem;
    padding: .55rem .7rem;
    border: 1px solid var(--linea);
    border-radius: var(--r-sm);
    font: inherit; font-size: .9rem;
    background: #fff; color: var(--tinta);
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; margin: 0; }
small.muted { display: block; font-weight: 400; margin-top: .25rem; }

/* =====================================================================
   ALERTAS
   ===================================================================== */
.alerta {
    padding: .7rem .9rem; border-radius: var(--r-sm);
    font-size: .88rem; margin-bottom: 1rem; border: 1px solid;
}
.alerta-error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.alerta-ok    { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.alerta-aviso { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }

/* =====================================================================
   BARRA SUPERIOR / NAVEGACIÓN
   ===================================================================== */
.barra {
    display: flex; align-items: center; gap: 1rem;
    background: var(--navy); color: #fff;
    padding: .6rem 1.25rem;
    box-shadow: var(--sombra-md);
    position: sticky; top: 0; z-index: 50;
}
.barra-marca { display: flex; align-items: center; gap: .6rem; }
.barra-logo {
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    background: rgba(255,255,255,.1); color: var(--dorado);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
}
.barra-titulo { font-weight: 700; font-size: 1rem; }
.barra-nav { display: flex; gap: .25rem; margin-left: .5rem; flex: 1; }
.barra-nav a {
    color: rgba(255,255,255,.78);
    padding: .45rem .8rem; border-radius: var(--r-sm);
    font-size: .9rem; font-weight: 600;
}
.barra-nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.barra-nav a.activo { background: rgba(255,255,255,.16); color: #fff; }
.barra-usuario { display: flex; align-items: center; gap: .8rem; }
.barra-usuario-info { display: flex; flex-direction: column; text-align: right; line-height: 1.1; }
.barra-usuario-info strong { font-size: .85rem; }
.barra-usuario-info .muted { color: rgba(255,255,255,.6); font-size: .75rem; }
.barra-toggle {
    display: none;
    background: rgba(255,255,255,.1); color: #fff; border: none;
    width: 38px; height: 38px; border-radius: var(--r-sm);
    font-size: 1.2rem; cursor: pointer;
}

/* =====================================================================
   ESTRUCTURA DE PÁGINA
   ===================================================================== */
.contenido {
    max-width: 1200px; margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}
.pie {
    text-align: center; color: var(--tinta-2);
    font-size: .8rem; padding: 1.5rem; border-top: 1px solid var(--linea);
}
.encabezado-pagina {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.acciones-encabezado { display: flex; gap: .5rem; }
.enlace-volver { display: inline-block; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }

/* =====================================================================
   TARJETAS DE RESUMEN (STATS)
   ===================================================================== */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .85rem; margin-bottom: 1.25rem;
}
.stat {
    background: var(--panel);
    border: 1px solid var(--linea);
    border-left: 4px solid var(--gris);
    border-radius: var(--r-md);
    padding: .9rem 1rem;
    box-shadow: var(--sombra);
    display: flex; flex-direction: column; gap: .15rem;
    text-decoration: none; color: var(--tinta);
    transition: box-shadow .15s, transform .1s;
}
a.stat:hover { box-shadow: var(--sombra-md); text-decoration: none; transform: translateY(-1px); }
.stat-num { font-size: 1.7rem; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-lbl { font-size: .8rem; color: var(--tinta-2); font-weight: 600; }
.stat-verde    { border-left-color: var(--verde); }
.stat-amarillo { border-left-color: var(--amarillo); }
.stat-rojo     { border-left-color: var(--rojo); }
.stat-gris     { border-left-color: var(--gris); }
.stat-activa   { box-shadow: 0 0 0 2px var(--navy); }

/* =====================================================================
   FILTROS
   ===================================================================== */
.filtros {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
    background: var(--panel);
    border: 1px solid var(--linea);
    border-radius: var(--r-md);
    padding: .8rem; margin-bottom: 1.25rem;
    box-shadow: var(--sombra);
}
.filtros select, .filtros input { width: auto; min-width: 150px; margin-top: 0; }
.filtros input[type=search] { min-width: 200px; }

.vacio {
    background: var(--panel); border: 1px dashed var(--linea);
    border-radius: var(--r-md); padding: 2rem;
    text-align: center; color: var(--tinta-2);
}

/* =====================================================================
   TABLAS
   ===================================================================== */
.tabla-wrap { overflow-x: auto; border-radius: var(--r-md); }
.tabla {
    width: 100%; border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--linea);
    border-radius: var(--r-md); overflow: hidden;
    font-size: .9rem;
}
.tabla thead th {
    background: #F8FAFC; text-align: left;
    padding: .7rem .85rem; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .03em;
    color: var(--tinta-2); border-bottom: 1px solid var(--linea);
}
.tabla tbody td { padding: .7rem .85rem; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla tbody tr { border-left: 4px solid transparent; }
.tabla-compacta td { padding: .5rem .6rem; }
.acciones-fila { display: flex; gap: .35rem; flex-wrap: wrap; }

.fila-verde    { border-left-color: var(--verde) !important; }
.fila-amarillo { border-left-color: var(--amarillo) !important; }
.fila-rojo     { border-left-color: var(--rojo) !important; }
.fila-gris     { border-left-color: var(--gris) !important; }
.fila-inactiva { opacity: .55; }

.enlace { font-weight: 600; color: var(--navy); }
.enlace:hover { color: var(--azul); }

/* Barras de progreso (reportes) */
.barra-celda { position: relative; background: var(--fondo); border-radius: 6px; height: 18px; min-width: 90px; overflow: hidden; }
.barra-prog  { position: absolute; left: 0; top: 0; bottom: 0; background: var(--verde); border-radius: 6px; }
.barra-pct   { position: relative; font-size: .72rem; font-weight: 700; color: var(--navy); padding-left: .4rem; line-height: 18px; }

/* Paginación */
.paginacion { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; }

/* =====================================================================
   CHIPS / ETIQUETAS
   ===================================================================== */
.chip {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .15rem .5rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700;
    background: var(--fondo); color: var(--tinta-2);
    border: 1px solid var(--linea);
}
.chip-ok       { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.chip-obs      { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.chip-alerta   { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.chip-auditoria{ background: #FFF7ED; color: var(--naranja); border-color: #FED7AA; }
.chip-estado   { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.chip-pendiente { background: var(--fondo); color: var(--tinta-2); }
.chip-recibido  { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.chip-en_proceso{ background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.chip-entregado { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }

/* Badges de fase / departamento */
.badge-fase {
    display: inline-block; padding: .2rem .55rem;
    border-radius: var(--r-sm); font-size: .75rem; font-weight: 700;
    color: #fff;
}
.badge-contabilidad { background: var(--navy); }
.badge-impuestos    { background: var(--morado); }
.badge-auditoria    { background: var(--naranja); }
.badge-financiera   { background: var(--verde); }
.badge-completado   { background: var(--gris); }

/* Puntos de semáforo */
.punto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.punto-verde    { background: var(--verde); }
.punto-amarillo { background: var(--amarillo); }
.punto-rojo     { background: var(--rojo); }
.punto-gris     { background: var(--gris); }

/* =====================================================================
   MODALES
   ===================================================================== */
.modal {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(15,23,42,.55);
    display: flex; align-items: center; justify-content: center;
    padding: 1.25rem;
}
.modal[hidden] { display: none; }
.modal-caja {
    background: var(--panel);
    border-radius: var(--r-lg);
    box-shadow: var(--sombra-lg);
    padding: 1.5rem;
    width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: .85rem;
}
.modal-acciones { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.fieldset-fechas { border: 1px solid var(--linea); border-radius: var(--r-md); padding: .8rem; }
.fieldset-fechas legend { font-size: .8rem; font-weight: 700; color: var(--navy); padding: 0 .4rem; }
.grid-fechas { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

/* =====================================================================
   KANBAN / PIPELINE
   ===================================================================== */
.kanban {
    display: grid; grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 1fr);
    gap: .9rem; overflow-x: auto; padding-bottom: .5rem;
}
.kanban-col {
    background: var(--panel);
    border: 1px solid var(--linea);
    border-radius: var(--r-md);
    display: flex; flex-direction: column;
    box-shadow: var(--sombra); min-height: 120px;
}
.kanban-col-cab {
    display: flex; align-items: center; justify-content: space-between;
    padding: .65rem .85rem; font-weight: 700; font-size: .9rem;
    color: #fff; border-radius: var(--r-md) var(--r-md) 0 0;
}
.kc-contabilidad { background: var(--navy); }
.kc-impuestos    { background: var(--morado); }
.kc-auditoria    { background: var(--naranja); }
.kc-financiera   { background: var(--verde); }
.kc-completado   { background: var(--gris); }
.kanban-conteo {
    background: rgba(255,255,255,.25); border-radius: 999px;
    padding: .05rem .5rem; font-size: .8rem;
}
.kanban-lista { padding: .6rem; display: flex; flex-direction: column; gap: .6rem; }
.kanban-vacio { text-align: center; color: var(--tinta-2); padding: 1rem 0; }

.kcard {
    display: block; background: #fff; color: var(--tinta);
    border: 1px solid var(--linea);
    border-left: 4px solid var(--gris);
    border-radius: var(--r-sm);
    padding: .6rem .7rem; box-shadow: var(--sombra);
    transition: box-shadow .15s, transform .1s;
}
.kcard:hover { box-shadow: var(--sombra-md); text-decoration: none; transform: translateY(-1px); }
.kcard-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kcard-nombre { font-weight: 700; color: var(--navy); font-size: .9rem; }
.kcard-sub { font-size: .78rem; color: var(--tinta-2); margin: .15rem 0 .4rem; }
.kcard-pie { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }

/* Bordes de color (semáforo) para tarjetas y cabeceras */
.borde-verde    { border-left-color: var(--verde) !important; }
.borde-amarillo { border-left-color: var(--amarillo) !important; }
.borde-rojo     { border-left-color: var(--rojo) !important; }
.borde-gris     { border-left-color: var(--gris) !important; }

/* =====================================================================
   DETALLE DE ENTREGA
   ===================================================================== */
.detalle-cab {
    background: var(--panel);
    border: 1px solid var(--linea);
    border-left: 4px solid var(--gris);
    border-radius: var(--r-md);
    padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
    box-shadow: var(--sombra);
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.detalle-estado { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; text-align: right; }
.detalle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.panel {
    background: var(--panel);
    border: 1px solid var(--linea);
    border-radius: var(--r-md);
    padding: 1.1rem 1.25rem; box-shadow: var(--sombra);
    margin-bottom: 1.25rem;
}

/* Etapas de contabilidad */
.etapas { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.etapas li {
    display: flex; align-items: center; gap: .65rem;
    padding: .55rem .7rem; border: 1px solid var(--linea);
    border-radius: var(--r-sm); background: #fff;
}
.etapas li.hecha { background: #F0FDF4; border-color: #BBF7D0; }
.etapa-check {
    width: 22px; height: 22px; flex: 0 0 22px;
    border-radius: 50%; border: 2px solid var(--linea);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; color: #fff; font-weight: 700;
}
.etapas li.hecha .etapa-check { background: var(--verde); border-color: var(--verde); }
.etapa-lbl { flex: 1; font-weight: 600; font-size: .9rem; }
.etapa-fecha { font-size: .78rem; }

.dep-estados { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.dep-fila { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

/* Acciones de flujo */
.acciones-flujo { display: flex; flex-direction: column; gap: .8rem; }
.bloque-estado, .bloque-devolver {
    border: 1px solid var(--linea); border-radius: var(--r-sm);
    padding: .7rem; background: #F8FAFC;
    display: flex; flex-direction: column; gap: .5rem;
}
.fila-inline { display: flex; gap: .5rem; align-items: center; }
.fila-inline select { flex: 1; }

/* Observaciones */
.obs-lista { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.obs-lista li {
    border: 1px solid var(--linea); border-radius: var(--r-sm);
    padding: .7rem .85rem; background: #fff;
}
.obs-lista li.obs-resuelta { background: #F8FAFC; opacity: .8; }
.obs-cab { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; flex-wrap: wrap; }
.obs-lista p { margin: .25rem 0 .5rem; font-size: .9rem; }

/* =====================================================================
   TOAST
   ===================================================================== */
.toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(150%);
    background: var(--navy); color: #fff;
    padding: .7rem 1.2rem; border-radius: var(--r-md);
    box-shadow: var(--sombra-lg); font-weight: 600; font-size: .9rem;
    z-index: 200; opacity: 0; transition: transform .25s, opacity .25s;
    max-width: 90vw;
}
.toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.toast-error { background: var(--rojo); }
.toast.toast-ok    { background: var(--verde); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 860px) {
    .detalle-grid { grid-template-columns: 1fr; }
    .barra-usuario-info { display: none; }
}
@media (max-width: 720px) {
    .barra { flex-wrap: wrap; }
    .barra-toggle { display: block; margin-left: auto; }
    .barra-nav {
        order: 3; flex-basis: 100%; flex-direction: column;
        margin: 0; display: none;
    }
    .barra-nav.abierto { display: flex; }
    .barra-nav a { padding: .65rem .8rem; }
    .barra-usuario { margin-left: 0; }
    .encabezado-pagina { align-items: flex-start; }
    .grid-fechas { grid-template-columns: 1fr; }
    .filtros select, .filtros input, .filtros input[type=search] { min-width: 0; width: 100%; }
    .filtros { flex-direction: column; align-items: stretch; }
}

/* ===== Fase 2: bloque de motivo + línea de tiempo ===== */
.bloque-motivo {
    background: var(--gris-50, #f8fafc);
    border: 1px solid var(--borde, #e2e8f0);
    border-radius: 10px;
    padding: .8rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.bloque-motivo select,
.bloque-motivo textarea { width: 100%; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
    content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px;
    width: 2px; background: var(--borde, #e2e8f0);
}
.timeline li {
    position: relative; padding: 0 0 1.1rem 2rem; min-height: 1.4rem;
}
.timeline li::before {
    content: ""; position: absolute; left: 3px; top: 5px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--navy, #1B2A4A); border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--borde, #e2e8f0);
}
.timeline-fecha {
    display: block; font-size: .8rem; color: var(--muted, #64748b); margin-bottom: .15rem;
}
.timeline-cuerpo { line-height: 1.4; }
.timeline-cuerpo .chip { margin-left: .4rem; }

/* ===== Fase 2b-2: tarjetas por área ===== */
.areas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.1rem; align-items: start; margin-bottom: 1.25rem; }
.area-card { border-top: 3px solid var(--borde); }
.area-card.area-contabilidad { border-top-color: var(--navy); }
.area-card.area-impuestos    { border-top-color: var(--morado); }
.area-card.area-auditoria    { border-top-color: var(--naranja); }
.area-card.area-costos       { border-top-color: #0E7490; }
.area-card.area-financiera   { border-top-color: var(--verde); }
.area-card.area-lista        { background: #FbFdfb; }
.area-card-cab { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.area-resp { margin: .1rem 0; font-size: .82rem; }
.area-fecha { margin: .1rem 0 .4rem; font-size: .82rem; }
.area-acciones { display: flex; flex-direction: column; gap: .5rem; margin-top: .7rem; }
.area-acciones .btn { width: 100%; }
.badge-costos { background: #0E7490; }
.chip-en_revision { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.chip-devuelto    { background: #FEE2E2; color: #B91C1C; border-color: #FECACA; }
.chip-enviado     { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.chip-cerrado     { background: #E5E7EB; color: #374151; border-color: #D1D5DB; }

/* ===== Fase 3a: impuestos ===== */
.grid-checks { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .9rem; margin-top: .3rem; }
@media (max-width: 560px) { .grid-checks { grid-template-columns: 1fr; } }
.grid-checks .check { font-size: .9rem; }
.lista-impuestos { margin: .2rem 0 .5rem; padding-left: 1.1rem; }
.lista-impuestos li { font-size: .85rem; margin: .12rem 0; }

/* ===== Fase 3b: calendario DIAN ===== */
.cal-selector { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-acciones { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; }
.tabla-cal th, .tabla-cal td { text-align: center; padding: .35rem .3rem; }
.tabla-cal th:first-child, .tabla-cal td:first-child { text-align: left; white-space: nowrap; }
.tabla-cal input[type=date] { width: 9.4rem; font-size: .82rem; padding: .25rem .3rem; }

/* ===== Fase 3c: fechas de impuestos en la ficha ===== */
.lista-imp-fechas { list-style: none; padding-left: 0; }
.lista-imp-fechas li { margin: .4rem 0; }
.imp-nom { display: block; font-weight: 600; font-size: .9rem; }
.imp-fecha { font-size: .82rem; }

/* ===== Fase 3c+: visibilidad de fechas ===== */
.venc-pill { display:inline-block; padding:.22rem .55rem; border-radius:var(--r-sm); font-weight:700; font-size:.95rem; white-space:nowrap; }
.venc-ok { background:#ECFDF5; color:#047857; }
.venc-amarillo { background:#FEF3C7; color:#92400E; }
.venc-rojo { background:#FEE2E2; color:#B91C1C; }
.tabla .col-clave { font-size:1rem; }
.tabla .col-sec { color: var(--tinta-2); font-size:.82rem; }

/* Novedades / pendientes (Fase 6) */
.novedades h3 { margin-top: 0; }
.nov-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.nov-lista li { padding: .55rem .75rem; border-radius: var(--r-sm); border-left: 4px solid #CBD5E1; background: #F8FAFC; }
.nov-lista li a { color: #1B2A4A; text-decoration: none; font-weight: 600; display: block; }
.nov-lista li a:hover { text-decoration: underline; }
.nov-lista li.nov-urgent { border-left-color: #B91C1C; background: #FEF2F2; }
.nov-lista li.nov-warn   { border-left-color: #D97706; background: #FFFBEB; }
.nov-lista li.nov-info   { border-left-color: #2563EB; background: #EFF6FF; }

/* ===== Cambios estéticos: color Costos + campana/tuerca + equipo ===== */
.kc-costos { background: #0891B2; }

/* Acciones del encabezado (campana / tuerca) */
.barra-acciones { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.menu-icono { position: relative; }
.barra-icono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.10); color: #fff; border: 0; cursor: pointer; position: relative;
  transition: background .15s ease;
}
.barra-icono:hover { background: rgba(255,255,255,.22); }
.icono-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
  background: #DC2626; color: #fff; border-radius: 9px; font-size: .7rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--navy);
}
.menu-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
  width: 320px; max-width: 86vw; max-height: 70vh; overflow: auto;
  background: #fff; border: 1px solid var(--c-borde, #E2E8F0); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.18); padding: .4rem;
}
.menu-pop-cab { font-weight: 700; color: var(--navy); padding: .4rem .55rem; font-size: .9rem; }
.menu-pop-item, .nov-item {
  display: block; padding: .55rem .6rem; border-radius: 8px; color: #1B2A4A; text-decoration: none; font-weight: 600; font-size: .92rem;
}
.menu-pop-item:hover, .nov-item:hover { background: #F1F5F9; }
.menu-pop-item.activo { background: #EEF2FF; }
.menu-pop-vacio { padding: .7rem .6rem; margin: 0; }
.nov-item { border-left: 4px solid #CBD5E1; border-radius: 0 8px 8px 0; margin: .2rem 0; }
.nov-item.nov-urgent { border-left-color: #B91C1C; }
.nov-item.nov-warn   { border-left-color: #D97706; }
.nov-item.nov-info   { border-left-color: #2563EB; }

/* Popover de equipo en el dashboard */
.equipo-wrap { position: relative; display: inline-flex; align-items: center; gap: .35rem; }
.btn-equipo {
  width: 20px; height: 20px; border-radius: 50%; border: 0; cursor: pointer;
  background: #1B2A4A; color: #fff; font-weight: 700; font-size: .78rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-equipo:hover { background: #2b4170; }
.equipo-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 250px;
  background: #fff; border: 1px solid var(--c-borde, #E2E8F0); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15,23,42,.18); padding: .5rem .2rem;
}
.equipo-pop-cab { font-weight: 700; color: var(--navy); padding: .15rem .6rem .4rem; font-size: .85rem; }
.equipo-pop-fila { display: flex; justify-content: space-between; gap: .6rem; padding: .28rem .6rem; font-size: .88rem; }
.equipo-pop-fila .ep-area { color: #64748B; font-weight: 600; }
.equipo-pop-fila .ep-nom { text-align: right; }

@media (max-width: 720px) {
  .barra-acciones { order: 3; }
  .menu-pop { right: auto; left: 0; }
}
