/* ── Base ───────────────────────────────────────────── */
* { box-sizing: border-box; }

body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif; }

/* ── Login Page ─────────────────────────────────────── */
.login-body {
    background: linear-gradient(135deg, #1a3a6b 0%, #0d2040 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem 2.5rem 2rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-img {
    max-width: 280px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 0.6rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-subtitle {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
}

.login-card .form-control {
    border-radius: 8px;
    padding: 0.65rem 1rem;
    border: 1.5px solid #dee2e6;
    font-size: 0.95rem;
}

.login-card .form-control:focus {
    border-color: #1a3a6b;
    box-shadow: 0 0 0 3px rgba(26, 58, 107, 0.12);
}

.login-card .btn-primary {
    background: #1a3a6b;
    border-color: #1a3a6b;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.login-card .btn-primary:hover {
    background: #2a5eb5;
    border-color: #2a5eb5;
}

/* ── Portal Layout ──────────────────────────────────── */
.portal-body { background: #f4f6fb; min-height: 100vh; }

/* ── Navbar ─────────────────────────────────────────── */
.portal-navbar {
    background: #1a3a6b;
    padding: 0 1.5rem;
    height: 58px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.portal-navbar .navbar-brand {
    padding: 0;
    line-height: 1;
}

.nav-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

.nav-menu { display: flex; align-items: center; gap: 0.25rem; }

.nav-btn {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.45rem 1.1rem;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
}

.nav-btn-logout {
    color: rgba(255, 200, 200, 0.9);
    margin-left: 0.5rem;
}

.nav-btn-logout:hover {
    background: rgba(220, 53, 69, 0.25);
    color: #fff;
}

/* ── Content ────────────────────────────────────────── */
.content-area {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header {
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
}

.page-header h4 {
    margin: 0;
    font-weight: 700;
    color: #1a3a6b;
    font-size: 1.3rem;
}

/* ── Stat Cards ─────────────────────────────────────── */
.stat-card {
    border-radius: 12px;
    padding: 1.5rem 2rem;
    color: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,0.12);
}

.stat-blue   { background: linear-gradient(135deg, #1a3a6b, #2a5eb5); }
.stat-orange { background: linear-gradient(135deg, #e67e22, #f39c12); }
.stat-red    { background: linear-gradient(135deg, #c0392b, #e74c3c); }

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

/* ── Boletas Sub-nav ────────────────────────────────── */
.boletas-subnav {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0;
}

.subnav-btn {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    padding: 0.5rem 1.25rem;
    border-radius: 6px 6px 0 0;
    border: 1.5px solid transparent;
    border-bottom: none;
    transition: background 0.18s, color 0.18s;
    position: relative;
    bottom: -2px;
}

.subnav-btn:hover {
    background: #e9ecef;
    color: #1a3a6b;
}

.subnav-sep {
    display: inline-block;
    width: 1px;
    background: #dee2e6;
    margin: 0 0.4rem;
    align-self: stretch;
}

.subnav-btn.active {
    background: #fff;
    color: #1a3a6b;
    font-weight: 700;
    border-color: #dee2e6;
    border-bottom-color: #fff;
}

/* ── Nueva Boleta Form ──────────────────────────────── */
.nueva-boleta-form {
    background: #fff;
    border-radius: 10px;
    padding: 1.75rem 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    max-width: 800px;
}

.nueva-boleta-form .form-control,
.nueva-boleta-form .form-select {
    border-radius: 7px;
    border: 1.5px solid #dee2e6;
    font-size: 0.9rem;
}

.nueva-boleta-form .form-control:focus,
.nueva-boleta-form .form-select:focus {
    border-color: #1a3a6b;
    box-shadow: 0 0 0 3px rgba(26,58,107,0.1);
}

/* ── Boletas Table ──────────────────────────────────── */
.table-boletas thead th {
    background: #1a3a6b;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border: none;
    padding: 0.85rem 1rem;
}

.table-boletas tbody tr:hover { background: #eef2fb; }

.table-boletas td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    vertical-align: middle;
    border-color: #e9ecef;
}

/* ── Status Badges ──────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 0.3em 0.75em;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Estado */
.badge-estado-abierta     { background: #d4edda; color: #155724; }
.badge-estado-en_progreso { background: #cce5ff; color: #004085; }
.badge-estado-pendiente   { background: #fff3cd; color: #856404; }
.badge-estado-cerrada     { background: #e2e3e5; color: #383d41; }
.badge-estado-eliminada   { background: #f8d7da; color: #721c24; }

/* Prioridad */
.badge-prioridad-baja    { background: #d4edda; color: #155724; }
.badge-prioridad-media   { background: #d1ecf1; color: #0c5460; }
.badge-prioridad-alta    { background: #ffe5d0; color: #7b3600; }
.badge-prioridad-critica { background: #f8d7da; color: #721c24; }

/* ── Eliminar button ────────────────────────────────── */
.btn-eliminar {
    background: rgba(220, 53, 69, 0.15);
    color: #f8d7da;
    border: 1px solid rgba(220, 53, 69, 0.4);
    transition: background 0.18s, color 0.18s;
}
.btn-eliminar:hover {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.btn-restaurar {
    background: rgba(40, 167, 69, 0.15);
    color: #c3e6cb;
    border: 1px solid rgba(40, 167, 69, 0.4);
    transition: background 0.18s, color 0.18s;
}
.btn-restaurar:hover {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

/* ── Notas / Comentarios ────────────────────────────── */
.detalle-notas {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fb;
}

.notas-lista { display: flex; flex-direction: column; gap: 0.75rem; }

.nota-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-left: 4px solid #1a3a6b;
    border-radius: 0 8px 8px 0;
    padding: 0.85rem 1.1rem;
}

.nota-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.nota-autor {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1a3a6b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.nota-fecha {
    font-size: 0.75rem;
    color: #6c757d;
}

.nota-texto {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.55;
}

.detalle-notas .form-control:focus {
    border-color: #1a3a6b;
    box-shadow: 0 0 0 3px rgba(26,58,107,0.1);
}

/* ── Clickable rows ─────────────────────────────────── */
.table-clickable tbody tr {
    cursor: pointer;
}

/* ── Detalle Boleta ─────────────────────────────────── */
.detalle-boleta {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    overflow: hidden;
}

.detalle-header {
    background: linear-gradient(135deg, #1a3a6b, #2a5eb5);
    color: #fff;
    padding: 1.75rem 2rem;
}

.detalle-numero {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    opacity: 0.8;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.detalle-titulo {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    line-height: 1.3;
}

.detalle-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.detalle-body { padding: 1.75rem 2rem; }

.detalle-section { margin-bottom: 1.5rem; }

.detalle-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e9ecef;
}

.detalle-descripcion {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.65;
    min-height: 60px;
}

.detalle-dl dt {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-top: 0.9rem;
}

.detalle-dl dd {
    font-size: 0.92rem;
    color: #212529;
    margin-bottom: 0;
}

/* ── Extra small button ─────────────────────────────── */
.btn-xs {
    padding: 0.2rem 0.6rem;
    font-size: 0.78rem;
    border-radius: 5px;
}

/* ── Date columns ───────────────────────────────────── */
.date-cell {
    white-space: nowrap;
    font-size: 0.82rem;
    color: #555;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 576px) {
    .portal-navbar { padding: 0 0.75rem; }
    .content-area  { padding: 1.25rem 1rem; }
    .stat-number   { font-size: 2.2rem; }
}
