/* ============================================================
   SD NM COAR — Estilos globales
   ============================================================ */

:root {
    --blue-900: #0a1628;
    --blue-800: #0d2149;
    --blue-700: #1a3a6e;
    --blue-600: #1d4ed8;
    --blue-500: #3b82f6;
    --blue-400: #60a5fa;
    --blue-100: #dbeafe;
    --blue-50:  #eff6ff;
    --sidebar-w: 240px;
    --topbar-h: 56px;
}

/* ---- Layout ---- */
body {
    background: #f1f5f9;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.875rem;
}

#wrapper {
    min-height: 100vh;
}

/* ---- Sidebar ---- */
#sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--blue-900);
    transition: width 0.25s ease;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar.collapsed {
    width: 64px;
}

#sidebar.collapsed .sidebar-header span,
#sidebar.collapsed .nav-label,
#sidebar.collapsed .sidebar-footer,
#sidebar.collapsed .nav-link span {
    display: none;
}

#sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.5rem;
}

.sidebar-header {
    background: var(--blue-800);
    min-height: var(--topbar-h);
    white-space: nowrap;
}

.sidebar-hr {
    border-color: rgba(255,255,255,0.08);
    margin: 0;
}

.nav-label {
    color: rgba(255,255,255,0.35);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    padding: 0.75rem 0.5rem 0.25rem;
    display: block;
}

.sidebar-link {
    color: rgba(255,255,255,0.65);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link i {
    font-size: 1rem;
    flex-shrink: 0;
}

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

.sidebar-link.active {
    background: var(--blue-600);
    color: #fff;
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

/* ---- Cards ---- */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* ---- Stat cards ---- */
.stat-card {
    border-radius: 12px;
    border: none;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    color: #fff;
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

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

.stat-card .stat-label {
    font-size: 0.75rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bg-stat-1 { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.bg-stat-2 { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.bg-stat-3 { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.bg-stat-4 { background: linear-gradient(135deg, #059669, #34d399); }

/* ---- Tables ---- */
.table th {
    background: var(--blue-50);
    color: var(--blue-700);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--blue-100);
}

.table-hover tbody tr:hover {
    background: var(--blue-50);
}

/* ---- Badges ---- */
.badge-active {
    background: #dcfce7;
    color: #15803d;
    font-weight: 600;
    padding: 0.3em 0.65em;
    border-radius: 999px;
    font-size: 0.72rem;
}

.badge-inactive {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
    padding: 0.3em 0.65em;
    border-radius: 999px;
    font-size: 0.72rem;
}

/* ---- Buttons ---- */
.btn-primary {
    background: var(--blue-600);
    border-color: var(--blue-600);
}

.btn-primary:hover {
    background: var(--blue-700);
    border-color: var(--blue-700);
}

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

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

/* ---- Forms ---- */
.form-control:focus, .form-select:focus {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.2);
}

/* ---- Nota badge ---- */
.nota-badge {
    display: inline-block;
    min-width: 46px;
    text-align: center;
    padding: 0.2em 0.5em;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
}

.nota-alta   { background: #dcfce7; color: #15803d; }
.nota-media  { background: #fef9c3; color: #854d0e; }
.nota-baja   { background: #fee2e2; color: #b91c1c; }

/* ---- DataTables custom ---- */
div.dataTables_wrapper div.dataTables_filter input {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 0.3rem 0.6rem;
}

div.dataTables_wrapper div.dataTables_length select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

/* ---- Action buttons in table ---- */
.btn-action {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 0.85rem;
}
