/* ============================================================
   SISTEMA HIS TIC SELVA - Estilos principales
   ============================================================ */

:root {
    --his-primary:    #0d6e8a;
    --his-secondary:  #1a9e7e;
    --his-accent:     #f0a500;
    --his-dark:       #0a2e3d;
    --his-light:      #e8f4f8;
    --his-danger:     #dc3545;
    --his-success:    #198754;
    --sidebar-w:      260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- NAVBAR ---- */
.bg-his {
    background: linear-gradient(135deg, var(--his-dark) 0%, var(--his-primary) 100%) !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.25);
}

.brand-icon {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    color: var(--his-accent);
}

.brand-title {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.brand-sub {
    font-size: 0.62rem;
    opacity: 0.75;
    letter-spacing: 0.3px;
    line-height: 1.1;
}

.navbar-nav .nav-link {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    transition: background 0.2s;
}
.navbar-nav .nav-link:hover {
    background: rgba(255,255,255,0.12);
}

/* ---- CONTENIDO PRINCIPAL ---- */
.main-content {
    flex: 1;
    padding: 1.5rem;
}

/* ---- CARDS ---- */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.11); }

.card-header-his {
    background: linear-gradient(135deg, var(--his-primary), var(--his-secondary));
    color: white;
    border-radius: 14px 14px 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- STATS CARDS ---- */
.stat-card {
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card .icon { font-size: 2.5rem; opacity: 0.8; }
.stat-card .number { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-card .label { font-size: 0.8rem; opacity: 0.85; font-weight: 600; }

.stat-blue    { background: linear-gradient(135deg, #0d6e8a, #1a9e7e); }
.stat-green   { background: linear-gradient(135deg, #198754, #20c997); }
.stat-orange  { background: linear-gradient(135deg, #f0a500, #fd7e14); }
.stat-red     { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.stat-purple  { background: linear-gradient(135deg, #6f42c1, #a855f7); }
.stat-teal    { background: linear-gradient(135deg, #0891b2, #06b6d4); }

/* ---- FORMULARIOS ---- */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--his-primary);
    box-shadow: 0 0 0 0.2rem rgba(13,110,138,0.15);
}

.form-label { font-weight: 600; font-size: 0.83rem; color: #495057; margin-bottom: 0.3rem; }
.required-mark { color: var(--his-danger); }

/* ---- BOTONES ---- */
.btn-his {
    background: linear-gradient(135deg, var(--his-primary), var(--his-secondary));
    color: white;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-his:hover { opacity: 0.9; color: white; transform: translateY(-1px); }

.btn-his-outline {
    border: 2px solid var(--his-primary);
    color: var(--his-primary);
    background: transparent;
    font-weight: 600;
    border-radius: 8px;
}
.btn-his-outline:hover {
    background: var(--his-primary);
    color: white;
}

/* ---- TABLAS ---- */
.table { font-size: 0.85rem; }
.table thead th {
    background: var(--his-dark);
    color: white;
    font-weight: 700;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
}
.table tbody tr:hover { background: var(--his-light); }
.table td { padding: 0.6rem 1rem; vertical-align: middle; }

/* ---- BADGES ---- */
.badge-rol-admin    { background: #dc3545; }
.badge-rol-digitador { background: #0d6e8a; }
.badge-rol-consulta  { background: #6c757d; }

/* ---- PÁGINA DE LOGIN ---- */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--his-dark) 0%, var(--his-primary) 50%, var(--his-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    top: -200px; right: -150px;
}
.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    bottom: -100px; left: -100px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative; z-index: 1;
}

.login-logo {
    width: 70px; height: 70px;
    background: linear-gradient(135deg, var(--his-primary), var(--his-secondary));
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 25px rgba(13,110,138,0.35);
}

.login-title { font-weight: 800; color: var(--his-dark); font-size: 1.3rem; text-align: center; }
.login-subtitle { font-size: 0.78rem; color: #6c757d; text-align: center; margin-bottom: 1.75rem; }

/* ---- FOOTER ---- */
.footer-his {
    background: white;
    border-top: 1px solid #e9ecef;
}

/* ---- SECCIÓN HIS FORM ---- */
.his-section-title {
    background: var(--his-light);
    border-left: 4px solid var(--his-primary);
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--his-dark);
    border-radius: 0 8px 8px 0;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- PRINT ---- */
@media print {
    .navbar, .footer-his, .btn, .no-print { display: none !important; }
    body { background: white; }
    .main-content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .main-content { padding: 1rem 0.75rem; }
    .stat-card .number { font-size: 1.5rem; }
}
