:root {
    --azul: #600000;
    --azul-claro: #2c5282;
    --gris-bg: #f5f7fa;
    --borde: #d7dde3;
    --rojo: #c0392b;
    --verde: #2f855a;
}
* {
    box-sizing: border-box;

}
html, body {
    margin: 0;
    padding: 0;
}
body {
    font-family: -apple-system, Segoe UI, Roboto, sans-serif;
    color: #1a1a1a;
    overflow-x: hidden;
}

.log{
    margin: 0 auto;
    width: 20%;
    padding: 20px;
}

.inicio{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100vw;  /* 100% del ancho de la ventana */
    min-height: 100vh; /* alto mínimo de la ventana (permite crecer si el contenido es más alto) */
    background-color: #e4e0e0; /* mismo gris de fondo.png: rellena sin dejar "costuras" visibles */
    background-image: url('/imagenes/fondo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain; /* nunca recorta la imagen, sin importar el aspecto de la pantalla */
    padding: 24px;
}

/* La imagen es apaisada (800x450) y en pantallas angostas/verticales (celulares)
   "contain" la deja muy pequeña y descentrada visualmente; en esos casos es mejor
   ocultarla del todo y dejar solo el color de fondo, priorizando la tarjeta. */
@media (max-width: 700px) {
    .inicio {
        background-image: none;
        padding: 16px;
    }
}

.inicio-card {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 10px;
    padding: 28px 32px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
    text-align: center;
}
.inicio-card h1 { margin: 0 0 4px; font-size: 18px; line-height: 1.3; }
.inicio-card form { text-align: left; margin-top: 16px; }


.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 20px; 
}

.topbar { 
    background: var(--azul); 
    color: #fff; display: flex; 
    align-items: center; 
    padding: 12px 24px; 
}
.topbar-brand { 
    font-weight: 700; 
}
.topbar-nav a { 
    color: #dce6f0; 
    text-decoration: none; 
    margin-left: 16px; 
    font-size: 19px; 
}
.topbar-nav a:hover { 
    color: #fff; 
    text-decoration: underline; 
}
.topbar-user { 
    margin-left: 19px; 
    font-weight: 600; 
}

h1 { 
    color: var(--azul); 
}
fieldset { 
    border: 1px solid var(--borde); 
    border-radius: 6px; 
    margin-bottom: 16px; 
    padding: 16px; 
}
legend { font-weight: 700; 
    color: var(--azul-claro); 
    padding: 0 6px;
     }

label { display: block; 
    margin-bottom: 12px; 
    font-size: 14px; 
    font-weight: 600; 
}
input, select, textarea {
    display: block; 
    width: 100%; 
    margin-top: 4px;
     padding: 8px 10px;
    border: 1px solid var(--borde); border-radius: 4px; 
    font-size: 14px; 
    font-family: inherit;
}
.form-inline { 
    display: flex; 
    gap: 10px; 
    align-items: flex-end; 
    flex-wrap: wrap; 
}
.form-inline label { 
    margin-bottom: 0; 
}

.btn {
    display: inline-block; 
    background: #fff; 
    border: 1px solid var(--borde); 
    color: #333;
    padding: 8px 14px; 
    border-radius: 4px; 
    text-decoration: none; 
    cursor: pointer; font-size: 14px;
}
.btn-primary { 
    background: var(--azul); 
    color: #fff; 
    border-color: var(--azul);
}
.btn-danger { 
    background: var(--rojo); 
    color: #fff; 
    border-color: var(--rojo); 
}
.btn-sm { 
    padding: 4px 8px; 
    font-size: 12px; 
}

.table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 24px; 
    background: #fff; 
}
.table th, .table td {
/** Valores originales: padding: 8px 10px;*/ 
    padding: 3px 5px; 
    border-bottom: 1px solid var(--borde); 
    text-align: left; font-size: 14px;
}
.table th { 
    background: #eef2f6;
}
.row-vencido { 
    background: #fdecea; 
}

.badge { 
    display: inline-block;
    padding: 2px 8px; 
    border-radius: 12px; 
    font-size: 12px; 
    background: #e2e8f0; 
}
.badge-abierto { 
    background: #fef3c7;
     color: #92400e; 
 }
.badge-cerrado { 
    background: #d1fae5; 
    color: var(--verde); 
}

.alert { 
    padding: 10px 14px;
     border-radius: 4px; 
     margin-bottom: 16px;
}
.alert-error { 
    background: #fdecea; 
    color: var(--rojo); 
    border: 1px solid #f5c6cb; 
}
.alert-warning { 
    background: #fff8e1; 
    color: #92400e; 
    border: 1px solid #ffe08a; 
}

.auth-box { 
    max-width: 380px; 
    margin: 60px auto; 
    background: #fff; 
    padding: 28px; 
    border-radius: 8px; 
    box-shadow: 0 1px 4px rgba(0,0,0,.1); 
}
.empty-state { 
    color: #718096;
    font-style: italic;
}

.volante-grid { 
    display: grid;
     grid-template-columns: 1.2fr 1fr; 
     gap: 24px; 
 }
.volante-info dl { 
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 6px 12px; 
}
.volante-info dt { 
    font-weight: 700; 
    color: var(--azul-claro); 
}
.respuesta-item { 
    background: #fff; 
    border: 1px solid var(--borde); 
    border-radius: 6px; 
    padding: 10px; 
    margin-bottom: 10px; 
}
.respuesta-item .fecha { 
    float: right; 
    color: #888; 
    font-size: 12px; 
}
.respuesta-item .movimiento-tipo { 
    display: block; 
    color: var(--azul-claro); 
    font-size: 12px; 
    font-weight: 600;
     margin-top: 2px; 
 }
.respuesta-respuesta_admin_reabrir { 
    border-left: 4px solid #d69e2e; 
}
.respuesta-respuesta_admin_finalizar { 
    border-left: 
    4px solid var(--verde); 
}
.respuesta-recepcion { 
    background: #f7fafc; 
    font-style: italic;
     }

.hilo-turnado { 
    background: #fbfcfd; 
    border: 1px solid var(--borde); 
    border-radius: 8px; 
    padding: 14px; 
    margin-bottom: 18px; 
}
.hilo-turnado h3 { 
    margin-top: 0;
     font-size: 15px; 
 }

.admin-respuesta-form { 
    background: #fff8e1; 
    border: 1px solid #ffe08a; 
    border-radius: 6px; padding: 12px; 
    margin-top: 10px; 
}
.admin-modo-botones { 
    display: flex; gap: 10px; 
    margin: 10px 0; 
}
.ticket-acciones { 
    display: flex; 
    gap: 10px; flex-wrap: wrap;
     margin-top: 10px; 
 }
.hint { 
    color: #718096; 
    font-size: 13px; 
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--borde);
}
#last-updated-dashboard {
    font-size: 14px;
    color: #666;
}
#refresh-dashboard {
    background: var(--azul);
    color: white;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
#refresh-dashboard:hover {
    opacity: 0.85;
}

/* Tablero: buscador, pestañas y paginación */
.dash-search {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.dash-search input[type="search"] {
    flex: 1 1 280px;
    padding: 6px 10px;
    border: 1px solid var(--borde);
    border-radius: 6px;
}
.dash-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid var(--borde);
    margin-bottom: 16px;
}
.dash-tab {
    padding: 8px 14px;
    border: 1px solid var(--borde);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: var(--gris-bg);
    color: #444;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: -2px;
}
.dash-tab:hover { background: #fff; }
.dash-tab.active {
    background: #fff;
    color: var(--azul);
    font-weight: 600;
    border-bottom: 2px solid #fff;
}
.dash-tab-count {
    display: inline-block;
    min-width: 22px;
    padding: 0 6px;
    margin-left: 4px;
    border-radius: 11px;
    background: var(--azul);
    color: #fff;
    font-size: 12px;
    text-align: center;
}
.user-select-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.user-select-form select {
    min-width: 260px;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--borde);
    border-radius: 6px;
}
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
}
.pager-info {
    margin-right: auto;
    font-size: 13px;
    color: #666;
}
.pager-link {
    padding: 4px 10px;
    border: 1px solid var(--borde);
    border-radius: 4px;
    color: var(--azul);
    text-decoration: none;
    font-size: 14px;
}
.pager-link:hover { background: var(--gris-bg); }
.pager-link.active {
    background: var(--azul);
    color: #fff;
    border-color: var(--azul);
}

.preview-box { 
    border: 1px solid var(--borde); 
    border-radius: 6px;
    overflow: hidden; 
    margin-bottom: 8px; 
 }
.preview-embed {
 width: 100%; 
 height: 480px; 
 border: 0; 
 display: block; 
}

.archivos-grid { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px; margin: 8px 0; 
}
.archivo-card { 
    width: 120px; 
    text-align: center; 
    background: #fff; 
    border: 1px solid var(--borde); 
    border-radius: 6px; padding: 8px; 
    font-size: 12px; 
}
.archivo-thumb { 
    width: 100%; 
    height: 80px; 
    object-fit: cover; 
    border-radius: 4px; 
    display: block; 
}
.archivo-icon { 
    display: block; 
    font-size: 36px; 
    text-decoration: none; 
    line-height: 80px; 
}
.archivo-nombre { 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    margin-top: 4px; 
}
.archivo-acciones { 
    margin-top: 4px; 
}
.archivo-acciones a { 
    color: var(--azul-claro); 
    text-decoration: none; 
    font-size: 11px; 
}
.archivo-acciones a:hover { 
    text-decoration: underline; 
}

@media (max-width: 800px) {
    .volante-grid { 
        grid-template-columns: 1fr; 
    }
}

/* Reportes */
.rep-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 24px 28px;
    margin-bottom: 16px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(120deg, #2b0000 0%, var(--azul) 55%, #8a1c1c 100%);
}
.rep-hero h1 { margin: 8px 0 4px; color: #fff; }
.rep-hero p { margin: 0; opacity: .85; font-size: 14px; }
.rep-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.15);
    font-size: 13px;
    font-weight: 600;
}
.rep-print {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 10px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.rep-print:hover { background: rgba(255,255,255,.22); }
.rep-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 4px;
}
.rep-filter label { display: flex; flex-direction: column; font-size: 13px; color: #555; gap: 2px; }
.rep-filter input[type="date"] { padding: 5px 8px; border: 1px solid var(--borde); border-radius: 6px; }
.rep-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.rep-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.rep-card {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    border: 1px solid var(--borde);
    border-radius: 14px;
    background: #fff;
}
.rep-card-n { font-size: 28px; font-weight: 700; color: var(--azul); line-height: 1.1; }
.rep-card-l { font-size: 13px; color: #666; }
.rep-card-alert .rep-card-n { color: var(--rojo); }
.rep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.rep-panel {
    padding: 18px 20px;
    margin-bottom: 16px;
    border: 1px solid var(--borde);
    border-radius: 16px;
    background: #fff;
    overflow-x: auto;
}
.rep-grid .rep-panel { margin-bottom: 0; }
.rep-panel h2 { margin-top: 0; font-size: 18px; }
.rep-row { padding: 8px 12px; margin-bottom: 8px; border: 1px solid var(--borde); border-radius: 12px; background: var(--gris-bg); }
.rep-row-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.rep-track { height: 10px; border-radius: 6px; background: #e2e8f0; overflow: hidden; }
.rep-track-sm { height: 8px; margin: 2px 0; }
.rep-bar { height: 100%; border-radius: 6px; }
.rep-bar-azul  { background: #2b6cb0; }
.rep-bar-verde { background: var(--verde); }
.rep-bar-ambar { background: #d69e2e; }
.rep-bar-rojo  { background: var(--rojo); }
.rep-bar-gris  { background: #718096; }
.rep-table td, .rep-table th { text-align: center; }
.rep-table td:first-child, .rep-table th:first-child { text-align: left; }
.rep-warn { color: var(--rojo); font-weight: 700; }

@media print {
    .topbar, .no-print, footer { display: none !important; }
    body { background: #fff; }
    .rep-hero, .rep-bar, .rep-card, .rep-row, .rep-track {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .rep-panel, .rep-card { break-inside: avoid; }
}
