/* =============================================================================
   EPRE Mendoza — Sistema Administrativo
   Estilos personalizados sobre Bootstrap 5
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Variables CSS (paleta institucional EPRE)
   Modificar estas variables para adaptar el sistema a cualquier identidad visual
   ----------------------------------------------------------------------------- */
:root {
    /* Colores primarios institucionales */
    --epre-primary:        #1a3a6b;  /* Azul institucional oscuro */
    --epre-primary-light:  #2563a8;  /* Azul claro para hover */
    --epre-primary-dark:   #0f2547;  /* Azul muy oscuro para activos */
    --epre-accent:         #e8a020;  /* Amarillo/dorado EPRE */
    --epre-accent-dark:    #c4861a;

    /* Colores de superficie */
    --epre-bg:             #f4f6f9;  /* Fondo general */
    --epre-bg-sidebar:     #1e2d45;  /* Fondo sidebar */
    --epre-bg-header:      #1a3a6b;  /* Fondo header */
    --epre-border:         #dee2e6;
    --epre-text-muted:     #6c757d;

    /* Dimensiones de layout */
    --epre-header-height:  62px;
    --epre-footer-height:  48px;
    --epre-sidebar-width:  240px;

    /* Tipografía */
    --epre-font-size-base: 0.9rem;
    --epre-font-family:    'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Bordes y sombras */
    --epre-radius:         0.4rem;
    --epre-shadow:         0 1px 4px rgba(0,0,0,.08);
    --epre-shadow-md:      0 3px 10px rgba(0,0,0,.12);
}

/* -----------------------------------------------------------------------------
   Base
   ----------------------------------------------------------------------------- */
body {
    font-family: var(--epre-font-family);
    font-size: var(--epre-font-size-base);
    background-color: var(--epre-bg);
    color: #212529;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* -----------------------------------------------------------------------------
   Header
   ----------------------------------------------------------------------------- */
.epre-header {
    background-color: var(--epre-bg-header);
    height: var(--epre-header-height);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.epre-header .navbar {
    height: 100%;
    padding: 0;
}

.epre-header .nav-link {
    font-size: 0.875rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--epre-radius);
    transition: background .15s;
}

.epre-header .nav-link:hover {
    background: rgba(255,255,255,.12);
}

.epre-header .nav-link.active {
    background: rgba(255,255,255,.18);
    font-weight: 600;
}

.epre-logo-placeholder {
    width: 40px;
    height: 40px;
    background: var(--epre-accent);
    border-radius: var(--epre-radius);
    color: var(--epre-primary-dark);
    flex-shrink: 0;
}

.epre-header-subtitle {
    font-size: 0.72rem;
    opacity: 0.75;
    letter-spacing: 0.02em;
}

/* -----------------------------------------------------------------------------
   Sidebar (preparado para cuando se active)
   ----------------------------------------------------------------------------- */
.epre-sidebar {
    width: var(--epre-sidebar-width);
    min-width: var(--epre-sidebar-width);
    background-color: var(--epre-bg-sidebar);
    border-right: 1px solid rgba(255,255,255,.05);
    overflow-y: auto;
}

.epre-sidebar .sidebar-link {
    color: rgba(255,255,255,.72);
    padding: 0.55rem 1.25rem;
    border-radius: 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: background .15s, color .15s;
}

.epre-sidebar .sidebar-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.epre-sidebar .sidebar-link.active {
    background: var(--epre-primary-light);
    color: #fff;
    border-left: 3px solid var(--epre-accent);
}

.epre-sidebar .sidebar-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-heading {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,.35);
    padding: 1.1rem 1.25rem 0.35rem;
}

/* -----------------------------------------------------------------------------
   Área de contenido principal
   ----------------------------------------------------------------------------- */
.epre-main {
    min-width: 0;
    overflow-x: hidden;
}

.epre-page-header {
    background: #fff;
    border-bottom: 1px solid var(--epre-border);
    padding: 0 1rem;
}

.epre-page-header h4 {
    font-size: 1.1rem;
    color: var(--epre-primary);
}

.epre-page-header .breadcrumb-item a {
    color: var(--epre-primary-light);
    text-decoration: none;
}

.epre-page-header .breadcrumb-item a:hover {
    text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------------- */
.epre-footer {
    background: #fff;
    border-top: 1px solid var(--epre-border);
    height: var(--epre-footer-height);
    display: flex;
    align-items: center;
    margin-top: auto;
}

/* -----------------------------------------------------------------------------
   Tarjetas (card)
   ----------------------------------------------------------------------------- */
.epre-card {
    border: 1px solid var(--epre-border);
    border-radius: var(--epre-radius);
}

.epre-card-header {
    background: #fff;
    border-bottom: 2px solid var(--epre-primary);
    display: flex;
    align-items: center;
    padding: 0.7rem 1.1rem;
}

.epre-card-header .card-title {
    color: var(--epre-primary);
    font-size: 0.9rem;
}

/* -----------------------------------------------------------------------------
   Tarjetas de estadísticas (stat cards)
   ----------------------------------------------------------------------------- */
.epre-stat-card {
    border-radius: var(--epre-radius);
    padding: 1.1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--epre-shadow);
    transition: box-shadow .2s;
}

.epre-stat-card:hover {
    box-shadow: var(--epre-shadow-md);
}

.epre-stat-icon {
    font-size: 1.8rem;
    opacity: .85;
}

.epre-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.epre-stat-label {
    font-size: 0.78rem;
    opacity: .8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.epre-stat-primary  { background: var(--epre-primary); color: #fff; }
.epre-stat-success  { background: #198754; color: #fff; }
.epre-stat-warning  { background: #fd7e14; color: #fff; }
.epre-stat-info     { background: #0dcaf0; color: #1a1a2e; }
.epre-stat-danger   { background: #dc3545; color: #fff; }

/* -----------------------------------------------------------------------------
   Tablas
   ----------------------------------------------------------------------------- */
.epre-table {
    font-size: 0.875rem;
}

.epre-table thead th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    vertical-align: middle;
}

.epre-table tbody tr:hover td {
    background-color: rgba(26, 58, 107, 0.04);
}

.epre-link {
    color: var(--epre-primary-light);
}

.epre-link:hover {
    color: var(--epre-primary);
}

/* -----------------------------------------------------------------------------
   Formularios
   ----------------------------------------------------------------------------- */
.form-control:focus,
.form-select:focus {
    border-color: var(--epre-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 168, .2);
}

.form-label {
    font-size: 0.85rem;
    color: #344054;
    margin-bottom: 0.3rem;
}

/* -----------------------------------------------------------------------------
   Botones
   ----------------------------------------------------------------------------- */
.btn-primary {
    background-color: var(--epre-primary);
    border-color: var(--epre-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--epre-primary-light);
    border-color: var(--epre-primary-light);
}

.btn-outline-primary {
    color: var(--epre-primary);
    border-color: var(--epre-primary);
}

.btn-outline-primary:hover {
    background-color: var(--epre-primary);
    border-color: var(--epre-primary);
}

/* -----------------------------------------------------------------------------
   Badges y estados
   ----------------------------------------------------------------------------- */
.badge {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* -----------------------------------------------------------------------------
   Alertas
   ----------------------------------------------------------------------------- */
.alert {
    font-size: 0.875rem;
    border-radius: var(--epre-radius);
}

/* -----------------------------------------------------------------------------
   Utilidades adicionales
   ----------------------------------------------------------------------------- */
.text-epre-primary { color: var(--epre-primary) !important; }
.bg-epre-primary   { background-color: var(--epre-primary) !important; }
.border-epre       { border-color: var(--epre-primary) !important; }

/* Scrollbar personalizado (WebKit) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c0c8d4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9aa8b8; }

/* Impresión básica */
@media print {
    .epre-header,
    .epre-sidebar,
    .epre-footer,
    .epre-page-header .btn,
    .btn-group { display: none !important; }
    .epre-main { padding: 0 !important; }
}
