/* ============================================================
   Fichero de Juntas — style.css
   Diseno corporativo encuadrado. Limpio y portable.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* -- Variables -------------------------------------------- */
:root {
    --azul:        #004a99;
    --azul-osc:    #003370;
    --azul-med:    #0062cc;
    --azul-claro:  #e8f0fb;
    --azul-card:   #dce8f8;
    --gris-body:   #cdd5e0;
    --gris-label:  #edf0f4;
    --gris-borde:  #c2cad8;
    --gris-nav:    #e2e7ef;
    --blanco:      #ffffff;
    --texto:       #1e2633;
    --texto-suave: #5a6478;
    --rojo:        #b91c1c;
    --verde-ok:    #15803d;
    --radio:       5px;
    --radio-lg:    10px;
    --sombra:      0 4px 24px rgba(0,40,100,0.13);
}

/* -- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 22px; }
body {
    font-family: 'Inter', Arial, sans-serif;
    background: var(--gris-body);
    color: var(--texto);
    min-height: 100vh;
    padding: 20px 10px 40px;
}
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--azul-med); }

/* ============================================================
   CAJA PRINCIPAL — max 1100px centrada
   ============================================================ */
.caja {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--blanco);
    box-shadow: var(--sombra);
    border-radius: var(--radio-lg);
    overflow: hidden;
    border: 1px solid #b8c4d8;
}

/* ============================================================
   CABECERA 3 BLOQUES
   ============================================================ */
.hdr {
    display: table;
    width: 100%;
    border-collapse: collapse;
    border-bottom: 3px solid var(--azul-osc);
}
.hdr > div { display: table-cell; vertical-align: middle; }

/* ── Bloque izquierdo: ancho generoso para imagen ── */
.hdr-izq {
    width: 210px;
    padding: 8px 12px;
    background: var(--blanco);
    text-align: center;
    border-right: 1px solid var(--gris-borde);
    vertical-align: middle;
}

.logo-circ {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--azul-claro);
    border: 3px solid var(--azul);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Bloque central azul: estrecho, solo el texto ── */
.hdr-centro {
    background: var(--azul);
    text-align: center;
    padding: 10px 12px;
}
.hdr-centro h1 {
    font-size: 1.28rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.hdr-centro .subtitulo {
    font-size: 0.64rem;
    color: #f0f4f8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
    white-space: nowrap;
}

/* ── Bloque derecho: ancho generoso para imagen ── */
.hdr-der {
    width: 210px;
    padding: 8px 12px;
    background: var(--blanco);
    text-align: center;
    border-left: 1px solid var(--gris-borde);
    vertical-align: middle;
}

/* Contenedor de imagen en cabecera (izq o der) */
/* Sustituye el src="#" por la ruta de tu imagen real */
.hdr-img {
    width: 100%;
    height: 88px;
    object-fit: contain;   /* la imagen no se recorta ni deforma */
    display: block;
}

/* Placeholder visual cuando aun no hay imagen */
.hdr-img-placeholder {
    width: 100%;
    height: 88px;
    border: 2px dashed #c8d4e8;
    border-radius: 6px;
    background: #f5f7fb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c0c8d8;
    font-size: 0.68rem;
    gap: 6px;
    flex-direction: column;
}

/* ============================================================
   NAVEGACION
   ============================================================ */
.nav-bar {
    background: var(--gris-nav);
    border-bottom: 1px solid var(--gris-borde);
    display: flex;
    flex-wrap: wrap;
    padding: 0 10px;
}
.nav-bar a {
    display: inline-block;
    padding: 9px 18px;
    font-size: 0.81rem;
    font-weight: 600;
    color: var(--azul-osc);
    border-right: 1px solid var(--gris-borde);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    text-decoration: none;
}
.nav-bar a:first-child { border-left: 1px solid var(--gris-borde); }
.nav-bar a:hover      { background: var(--azul); color: #fff; text-decoration: none; }
.nav-bar a.activo     { background: var(--azul); color: #fff; font-weight: 700; }

/* ============================================================
   BARRA DE ESTADO
   ============================================================ */
.barra-estado {
    background: #f2f4f8;
    border-bottom: 1px solid var(--gris-borde);
    padding: 5px 18px;
    font-size: 0.74rem;
    color: var(--texto-suave);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.barra-estado .usr { font-weight: 700; color: var(--azul-osc); }

/* ============================================================
   CONTENIDO
   ============================================================ */
.contenido { padding: 22px 26px; min-height: 420px; }

/* Titulo de seccion con boton */
.tit-pagina {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--azul-osc);
    border-bottom: 2px solid var(--azul);
    padding-bottom: 7px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.migas {
    font-size: 0.73rem;
    color: var(--texto-suave);
    margin-bottom: 16px;
}
.migas a { color: var(--azul); }

/* ============================================================
   ALERTAS
   ============================================================ */
.alerta {
    padding: 9px 14px;
    border-radius: var(--radio);
    font-size: 0.82rem;
    margin-bottom: 14px;
    border-left: 4px solid;
    font-weight: 600;
}
.alerta-ok    { background: #f0fdf4; color: var(--verde-ok); border-color: #22c55e; }
.alerta-error { background: #fef2f2; color: var(--rojo);     border-color: #ef4444; }
.alerta-info  { background: var(--azul-claro); color: var(--azul-osc); border-color: var(--azul); }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: inline-block;
    padding: 7px 18px;
    border-radius: var(--radio);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.81rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }

.btn-azul  { background: var(--azul);      color: #fff; border-color: var(--azul-osc); }
.btn-azul:hover  { background: var(--azul-osc); color: #fff; }

.btn-gris  { background: var(--gris-label); color: var(--texto); border-color: var(--gris-borde); }
.btn-gris:hover  { background: #d5dbe6; }

.btn-rojo  { background: var(--rojo); color: #fff; border-color: #7f1d1d; }
.btn-rojo:hover  { background: #7f1d1d; color: #fff; }

.btn-sm   { padding: 5px 12px; font-size: 0.76rem; }
.btn-icon {
    background: none; border: none; cursor: pointer;
    color: var(--texto-suave); padding: 3px 6px;
    border-radius: 3px; font-size: 1rem;
    transition: background 0.12s, color 0.12s;
}
.btn-icon:hover { background: #fee2e2; color: var(--rojo); }

/* ============================================================
   TARJETAS DE ESTADISTICAS — dashboard
   ============================================================ */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 160px;
    background: linear-gradient(145deg, #e8f0fb 0%, #d0e2f8 100%);
    border: 1px solid #b3cef0;
    border-radius: var(--radio-lg);
    padding: 20px 22px 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,74,153,0.10);
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,74,153,0.16);
}

/* Circulo decorativo de fondo */
.stat-card::after {
    content: '';
    position: absolute;
    right: -18px;
    top: -18px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0,74,153,0.08);
}

.stat-card .stat-num {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--azul-osc);
    line-height: 1;
    display: block;
    position: relative;
    z-index: 1;
}

.stat-card .stat-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #3a6aaa;
    display: block;
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

/* Icono de la tarjeta */
.stat-card .stat-ico {
    position: absolute;
    right: 18px;
    bottom: 14px;
    font-size: 1.6rem;
    opacity: 0.25;
}

/* ============================================================
   PANEL DE ACCIONES RAPIDAS — dashboard
   ============================================================ */
.panel-acciones {
    background: var(--gris-label);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-lg);
    padding: 18px 22px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.panel-acciones .acc-saludo {
    font-size: 0.9rem;
    color: var(--texto-suave);
}
.panel-acciones .acc-saludo strong {
    color: var(--azul-osc);
    font-size: 0.95rem;
}
.panel-acciones .acc-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   FORMULARIO — TABLA CLASICA COMPACTA
   Etiqueta (fondo gris, ancho fijo) | Input (ancho propio)
   ============================================================ */
.form-tbl {
    border-collapse: collapse;
    margin-bottom: 16px;
    /* NO width:100% — la tabla se ajusta al contenido */
}

/* Fila separadora por seccion */
.form-tbl tr.sec-hdr td {
    background: var(--azul-osc);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 5px 14px;
}

.form-tbl tr { border-bottom: 1px solid var(--gris-borde); }
.form-tbl tr:last-child { border-bottom: none; }

/* Celda etiqueta */
.form-tbl td.lbl {
    background: var(--gris-label);
    border-right: 1px solid var(--gris-borde);
    width: 200px;
    padding: 8px 14px;
    font-size: 0.79rem;
    font-weight: 700;
    color: var(--texto-suave);
    vertical-align: middle;
    text-align: right;
    white-space: nowrap;
}

/* Celda input — el input tiene su propio ancho, NO 100% */
.form-tbl td.inp {
    padding: 6px 12px;
    background: var(--blanco);
    vertical-align: middle;
}

/* Inputs de texto: ancho razonable */
.form-tbl td.inp input[type="text"],
.form-tbl td.inp input[type="password"],
.form-tbl td.inp select {
    width: 250px;
    padding: 6px 10px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.83rem;
    color: var(--texto);
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Inputs de fecha: compactos, pegados a la izquierda */
.form-tbl td.inp input[type="date"] {
    width: 160px;          /* solo lo necesario para dd/mm/aaaa + icono */
    padding: 6px 8px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.83rem;
    color: var(--texto);
    background: #fff;
    outline: none;
    display: block;        /* pegado al borde izquierdo de la celda */
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Textarea: ancho algo mayor para leer bien */
.form-tbl td.inp textarea {
    width: 420px;
    padding: 7px 10px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.83rem;
    color: var(--texto);
    background: #fff;
    outline: none;
    resize: vertical;
    min-height: 90px;
    line-height: 1.55;
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Focus en cualquier campo */
.form-tbl td.inp input:focus,
.form-tbl td.inp select:focus,
.form-tbl td.inp textarea:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 2px rgba(0,74,153,0.13);
}

/* Select con flecha custom */
.form-tbl td.inp select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M0 0l5 7 5-7z' fill='%235a6478'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

/* Botones del formulario */
.form-btns {
    padding: 12px 0 4px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
   TABLA CLASICA — ficha de visualizacion
   ============================================================ */
.ficha-tbl {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    overflow: hidden;
    margin-bottom: 14px;
}
.ficha-tbl tr { border-bottom: 1px solid var(--gris-borde); }
.ficha-tbl tr:last-child { border-bottom: none; }

.ficha-tbl tr.sec-hdr td {
    background: var(--azul-osc);
    color: #fff;
    font-size: 0.71rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 5px 14px;
    border-right: none;
}

.ficha-tbl td.f-lbl {
    background: var(--gris-label);
    border-right: 1px solid var(--gris-borde);
    width: 180px;
    padding: 9px 14px;
    font-size: 0.77rem;
    font-weight: 700;
    color: var(--texto-suave);
    vertical-align: top;
    text-align: right;
    white-space: nowrap;
}

.ficha-tbl td.f-val {
    padding: 9px 14px;
    font-size: 0.85rem;
    color: var(--texto);
    background: var(--blanco);
    word-break: break-word;
    vertical-align: top;
}

.ficha-tbl td.f-val.vacio { color: #bbb; font-style: italic; }

/* ============================================================
   TABLA DE LISTADO
   ============================================================ */
.tbl-wrap {
    overflow-x: auto;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    margin-bottom: 12px;
}
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.79rem;
}
.tbl thead tr { background: var(--azul); color: #fff; }
.tbl thead th {
    padding: 9px 11px;
    font-weight: 700;
    text-align: left;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.14);
}
.tbl thead th:last-child { border-right: none; }
.tbl tbody tr { border-bottom: 1px solid var(--gris-borde); transition: background 0.1s; }
.tbl tbody tr:nth-child(odd)  { background: var(--blanco); }
.tbl tbody tr:nth-child(even) { background: #f2f6fc; }
.tbl tbody tr:hover { background: var(--azul-claro); }
.tbl tbody td {
    padding: 7px 11px;
    border-right: 1px solid var(--gris-borde);
    vertical-align: middle;
}
.tbl tbody td:last-child { border-right: none; }

/* Badge tipo reunion */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.71rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Pie de tabla */
.tbl-pie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--gris-borde);
}
.pag-info { font-size: 0.75rem; color: var(--texto-suave); }
.paginacion { display: flex; gap: 3px; flex-wrap: wrap; }
.pag-btn {
    display: inline-block;
    padding: 4px 9px;
    border: 1px solid var(--gris-borde);
    background: var(--blanco);
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--texto);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.pag-btn:hover, .pag-btn.activo {
    background: var(--azul);
    border-color: var(--azul-osc);
    color: #fff;
    text-decoration: none;
}

/* ============================================================
   PANEL FILTROS
   ============================================================ */
.panel-filtros {
    background: var(--gris-label);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.panel-filtros .f-titulo {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--azul-osc);
    border-bottom: 1px solid var(--gris-borde);
    padding-bottom: 7px;
    margin-bottom: 10px;
}
.filtros-tbl td {
    padding: 3px 10px 3px 0;
    vertical-align: middle;
    white-space: nowrap;
}
.filtros-tbl td label {
    font-size: 0.77rem;
    font-weight: 700;
    color: var(--texto-suave);
    margin-right: 5px;
}
.filtros-tbl td input[type="date"],
.filtros-tbl td input[type="text"] {
    padding: 5px 9px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.81rem;
    color: var(--texto);
    outline: none;
}
.filtros-tbl td input[type="date"] { width: 155px; }
.filtros-tbl td input[type="text"] { width: 175px; }
.filtros-tbl td input:focus { border-color: var(--azul); box-shadow: 0 0 0 2px rgba(0,74,153,0.10); }

/* ============================================================
   NAVEGACION FICHA
   ============================================================ */
.ficha-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--gris-label);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    padding: 8px 14px;
    margin-bottom: 16px;
}
.ficha-cnt { margin-left: auto; font-size: 0.75rem; color: var(--texto-suave); }

/* ============================================================
   LOGIN
   ============================================================ */
body.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #00214d 0%, #004a99 100%);
}
.login-caja {
    width: 100%;
    max-width: 390px;
    background: var(--blanco);
    border-radius: var(--radio-lg);
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
    overflow: hidden;
}
.login-hdr {
    background: var(--azul);
    padding: 22px 28px 18px;
    text-align: center;
    border-bottom: 3px solid #f5a623;
}
.login-hdr h2 { color: rgba(255,255,255,0.65); font-size: 0.71rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 4px; }
.login-hdr h3 { color: #fff; font-size: 1.1rem; font-weight: 700; }
.login-body-inner { padding: 26px 28px; }

/* ============================================================
   PIE DE PAGINA PROFESIONAL — 3 columnas, ancho contenedor
   ============================================================ */
.pie {
    background: #f0f3f8;
    border-top: 2px solid var(--gris-borde);
    /* Padding horizontal para que no toque los bordes */
    padding: 12px 28px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    /* El footer ya vive dentro de .caja (max 1100px), asi que
       este margin no lo hace mas ancho, solo separa del borde */
    margin: 0;
}
.pie-izq {
    font-size: 0.74rem;
    color: var(--texto-suave);
    font-weight: 500;
}
.pie-centro {
    font-size: 0.74rem;
    color: var(--azul-osc);
    font-weight: 700;
    text-align: center;
    background: var(--azul-claro);
    border: 1px solid #b3cef0;
    border-radius: 20px;
    padding: 4px 18px;
    white-space: nowrap;
}
.pie-centro span {
    font-size: 0.9rem;
    font-weight: 800;
}
.pie-der {
    font-size: 0.70rem;
    color: var(--texto-suave);
    text-align: right;
    font-family: monospace;
}

/* ============================================================
   SISTEMA DE MODAL UNIFICADO
   Soporta dos modos:
     - Confirmacion (borrado): icono naranja, Cancel + Eliminar
     - Aviso (error/info):     icono azul,   solo Aceptar
   ============================================================ */

/* Overlay oscuro que cubre toda la pantalla */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 20, 40, 0.58);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Caja blanca centrada */
.modal-caja {
    background: var(--blanco);
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.32);
    padding: 34px 38px 28px;
    max-width: 430px;
    width: 100%;
    text-align: center;
    animation: modalIn 0.18s ease;
}

@keyframes modalIn {
    from { transform: scale(0.90); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.modal-icono {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 12px;
}

/* Icono naranja = confirmacion peligrosa */
.modal-icono-confirmar { color: #e67e22; }

/* Icono azul = aviso informativo */
.modal-icono-aviso { color: var(--azul); }

.modal-titulo {
    font-size: 1.06rem;
    font-weight: 700;
    color: var(--texto);
    margin-bottom: 10px;
}

.modal-texto {
    font-size: 0.88rem;
    color: var(--texto-suave);
    margin-bottom: 26px;
    line-height: 1.65;
}

.modal-info-detalle {
    display: inline-block;
    margin-top: 4px;
    font-weight: 700;
    color: var(--rojo);
}

/* Fila de botones */
.modal-botones {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.modal-botones .btn { min-width: 120px; }
/* ════ FIN SISTEMA MODAL ════ */

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
    body { padding: 0; }
    .caja { border-radius: 0; border-left: none; border-right: none; }
    .hdr { display: block; }
    .hdr-izq, .hdr-der { display: none; }
    .hdr-centro { display: block; padding: 14px; }
    .contenido { padding: 14px 12px; }
    .form-tbl td.lbl  { width: 120px; font-size: 0.74rem; }
    .form-tbl td.inp input[type="text"],
    .form-tbl td.inp select { width: 180px; }
    .form-tbl td.inp textarea { width: 220px; }
    .stats-row { flex-direction: column; }
    .panel-acciones { flex-direction: column; align-items: flex-start; }
    .filtros-tbl { display: block; }
    .filtros-tbl td { display: block; padding: 4px 0; }
    .filtros-tbl td input { width: 100% !important; }
    .tbl-pie { flex-direction: column; align-items: flex-start; }
}

/* ── CONTENIDO TRUNCADO: maximo 2 lineas con puntos suspensivos ── */
.contenido-truncado {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 260px;
    font-size: 0.78rem;
    color: var(--texto);
    line-height: 1.5;
    cursor: pointer;
    word-break: break-word;
    transition: all 0.2s ease;
}

/* ── CONTENIDO EXPANDIDO: se activa con doble clic ── */
.contenido-expandido {
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ============================================================
   BOTONES WORKFLOW (validación en cascada)
   ============================================================ */
.wf-grupo {
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.wf-grupo.wf-activo  { border-color: var(--azul); }
.wf-grupo.wf-ok      { border-color: var(--verde-ok); }
.wf-grupo.wf-bloq    { opacity: 0.55; }

.wf-cabecera {
    background: var(--gris-label);
    border-bottom: 1px solid var(--gris-borde);
    padding: 5px 12px;
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--texto-suave);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.wf-grupo.wf-activo  .wf-cabecera { background: var(--azul-claro); color: var(--azul-osc); }
.wf-grupo.wf-ok      .wf-cabecera { background: #f0fdf4;           color: var(--verde-ok); }

.wf-obligatorio { color: var(--rojo); font-size: 0.85rem; }
.wf-opcional    { color: var(--texto-suave); font-size: 0.75rem; font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; }

.wf-cuerpo {
    padding: 8px 12px;
    background: var(--blanco);
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.wf-cuerpo textarea,
.wf-cuerpo input[type="text"] {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.83rem;
    color: var(--texto);
    resize: vertical;
    min-height: 52px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wf-cuerpo textarea:focus,
.wf-cuerpo input[type="text"]:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 2px rgba(0,74,153,0.12);
}
.wf-cuerpo textarea:disabled,
.wf-cuerpo input[type="text"]:disabled {
    background: #f5f7fb;
    color: #aab;
    cursor: not-allowed;
}

.btn-validar {
    padding: 6px 14px;
    background: var(--azul);
    color: #fff;
    border: none;
    border-radius: var(--radio);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    align-self: flex-end;
    margin-bottom: 2px;
}
.btn-validar:hover   { background: var(--azul-osc); }
.btn-validar:disabled { background: #a0b4cc; cursor: not-allowed; }
.btn-validar.validado {
    background: var(--verde-ok);
    cursor: default;
}
.wf-error {
    font-size: 0.72rem;
    color: var(--rojo);
    padding: 2px 12px 6px;
    display: none;
}

/* ============================================================
   IMPRESIÓN — @media print
   Para modificar manualmente: busca este bloque en style.css.
   Controla TODO lo que se ve al imprimir la ficha.
   ============================================================ */
@media print {

    /* ── Ocultar cabecera, menú, botones y pie ── */
    .hdr,
    .nav-bar,
    .barra-estado,
    .ficha-nav,
    .migas,
    .tit-pagina .btn,
    .tit-pagina > div,
    .modal-overlay,
    .pie,
    #btn-eliminar-ficha,
    .btn-print-ficha,
    .alerta {
        display: none !important;
    }

    /* ── Fondo blanco, sin relleno de pantalla ── */
    body {
        background: #fff !important;
        padding: 0 !important;
        /* 8pt = texto compacto legible en A4 */
        font-size: 7pt !important;
    }

    /* ── Contenedor sin sombras ni bordes decorativos ── */
    .caja {
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        max-width: 100% !important;
    }

    /* ── Márgenes del contenido más estrechos ── */
    .contenido {
        padding: 4px 8px !important;
    }

    /* ── Título de la ficha (Nº Orden, etc.) ── */
    .tit-pagina {
        font-size: 15pt !important;
        border-bottom: 1.5px solid #003370 !important;
        margin-bottom: 8px !important;
        color: #003370 !important;
        padding-bottom: 4px !important;
    }

    /* ── Tabla principal de la ficha ── */
    .ficha-tbl {
        width: 100% !important;
        border: 1px solid #bbb !important;
        font-size: 6pt !important;  /* ligeramente menor que el body */
        border-collapse: collapse !important;
    }

    /* ── Celdas más compactas verticalmente ── */
    .ficha-tbl td {
        padding: 1px 5px !important;
        line-height: 1.3 !important;
    }

    /* ── Cabeceras de sección (fondo azul) ── */
    .ficha-tbl tr.sec-hdr td {
        background: #003370 !important;
        color: #fff !important;
        font-size: 8.5pt !important;
        padding: 3px 7px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ── Columna de etiqueta (izquierda gris) ── */
    .ficha-tbl td.f-lbl {
        background: #edf0f4 !important;
        font-size: 10pt !important;
        width: 130px !important;   /* más estrecha para dar espacio al valor */
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ── Bloque de puntos del acta (cont-puntos) ──
       Márgenes más estrechos y fuente más pequeña    */
    .cont-puntos {
        margin: 0 !important;
        padding: 0 !important;
    }

    .cont-punto-bloque {
        padding: 5px 0 !important;
        border-bottom: 1px solid #ddd !important;
    }

    /* ── Títulos de cada punto: negrita + subrayado + compacto ── */
    .cont-punto-titulo {
        font-size: 11pt !important;
        font-weight: bold !important;
        text-decoration: underline !important;
        margin-bottom: 1px !important;
        color: #003370 !important;
    }

    /* ── Texto de cada punto ── */
    .cont-punto-valor {
        font-size: 6pt !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        white-space: pre-wrap !important;
    }

    /* ── Logo e imágenes: tamaño máximo controlado ── */
    .logo-circ,
    .hdr-img,
    .hdr-img-placeholder,
    img {
        max-width: 60px !important;
        max-height: 60px !important;
    }

    /* ── No partir una fila de datos entre páginas ── */
    .ficha-tbl tr        { page-break-inside: avoid; }
    .cont-punto-bloque   { page-break-inside: avoid; }

    /* ── Márgenes del papel ── */
    @page {
        margin: 0.5cm 1cm;
    }
}

/* ============================================================
   VISUALIZACION DE PUNTOS DEL ACTA EN FICHA (ficha_cat.php)
   ============================================================ */
.cont-puntos {
    width: 100%;
}

.cont-punto-bloque {
    padding: 10px 0 10px 0;
    border-bottom: 1px solid #e2e8f0;
}
.cont-punto-bloque:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cont-punto-titulo {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--azul-osc);
    text-decoration: underline;
    margin-bottom: 5px;
    line-height: 1.4;
}

.cont-punto-cuerpo {
    font-size: 0.83rem;
    color: var(--texto);
    line-height: 1.65;
    padding-left: 8px;
    border-left: 3px solid var(--azul-claro);
}

.cont-punto-vacio {
    color: #9ca3af;
    font-style: italic;
    border-left-color: #e5e7eb;
}

/* ============================================================
   WORKFLOW — Refuerzo cross-browser (Flexbox explícito)
   Garantiza apariencia identica en Chrome, Firefox y Safari
   ============================================================ */
.wf-grupo {
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    margin-bottom: 10px;
    overflow: hidden;
    -webkit-transition: border-color 0.2s;
    transition: border-color 0.2s;
}
.wf-grupo.wf-activo { border-color: var(--azul); }
.wf-grupo.wf-ok     { border-color: var(--verde-ok); }
.wf-grupo.wf-bloq   { opacity: 0.55; }

.wf-cabecera {
    background: var(--gris-label);
    border-bottom: 1px solid var(--gris-borde);
    padding: 5px 12px;
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--texto-suave);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.wf-grupo.wf-activo .wf-cabecera { background: var(--azul-claro); color: var(--azul-osc); }
.wf-grupo.wf-ok     .wf-cabecera { background: #f0fdf4;           color: var(--verde-ok); }

.wf-cuerpo {
    padding: 8px 12px;
    background: var(--blanco);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 8px;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
}
.wf-cuerpo textarea {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.83rem;
    color: var(--texto);
    resize: vertical;
    min-height: 52px;
    line-height: 1.5;
    outline: none;
    -webkit-transition: border-color 0.15s, box-shadow 0.15s;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.wf-cuerpo textarea:focus {
    border-color: var(--azul);
    -webkit-box-shadow: 0 0 0 2px rgba(0,74,153,0.12);
    box-shadow: 0 0 0 2px rgba(0,74,153,0.12);
}
.wf-cuerpo textarea:disabled {
    background: #f5f7fb;
    color: #aab;
    cursor: not-allowed;
}
.wf-cuerpo textarea[readonly] {
    background: #f0fdf4;
    color: #166534;
    cursor: default;
}

.btn-validar {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    padding: 6px 14px;
    background: var(--azul);
    color: #fff;
    border: none;
    border-radius: var(--radio);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    -webkit-transition: background 0.15s;
    transition: background 0.15s;
    -ms-flex-item-align: end;
    align-self: flex-end;
    margin-bottom: 2px;
    line-height: 1.4;
}
.btn-validar:hover    { background: var(--azul-osc); }
.btn-validar:disabled { background: #a0b4cc; cursor: not-allowed; }
.btn-validar.validado { background: var(--verde-ok); cursor: default; }

/* ============================================================
   CABECERA DINAMICA DEL ACTA (ficha_cat.php)
   ============================================================ */
.cabecera-acta {
    background: #fdfdfd; /* Un blanco más limpio */
    border: 1px solid #ccc;
    border-left: 4px solid var(--azul);
    border-radius: var(--radio);
    padding: 15px 20px;
    margin-bottom: 18px;
    
    /* ESTO ES LO IMPORTANTE PARA QUE SE VEA JUNTO */
    font-size: 0.92rem;    /* Un pelo más grande para que se lea bien */
    line-height: 1.35;     /* Interlineado más apretado, como un documento oficial */
    color: #000;           /* Negro puro para máxima seriedad */
    text-align: justify;   /* Texto justificado para que los bordes queden rectos */
    
    /* Evita que los saltos de línea del archivo TXT se vuelvan locos */
    white-space: normal;   
}

/* Forzamos que los títulos dentro de la cabecera (si los hay) no tengan margen */
.cabecera-acta p {
    margin: 0 0 10px 0;
}

/* En impresion: aprovechamos mejor el folio */
@media print {
    .cabecera-acta {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        font-size: 10pt !important;
        line-height: 1.3 !important;
        text-align: justify;
    }
}
