/* ── CLASS Design System ─────────────────────────────────────── */
:root {
    --cls-primary:       #006cb6;
    --cls-primary-dark:  #005a9c;
    --cls-primary-light: rgba(0,108,182,0.08);
    --cls-orange:        #F9b036;
    --cls-yellow:        #Fedc09;
    --cls-gray-bg:       #F2F2F2;
    --cls-text:          #333333;
    --cls-muted:         #666666;
}

/* ── Base ─────────────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--cls-gray-bg);
    color: var(--cls-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar { background-color: var(--cls-primary) !important; padding: 0 0; }
.navbar .container-fluid { padding: 0.55rem 1rem; }
.navbar-brand { font-weight: 700; font-size: 1.2rem; letter-spacing: 0.04em; line-height: 1.1; }
.navbar-brand small { font-size: 0.62rem; font-weight: 400; opacity: 0.75; display: block; }
.navbar-nav .nav-link { font-size: 0.9rem; padding: 0.55rem 0.8rem; }
.navbar-nav .nav-link:hover { opacity: 0.85; }
.cls-nav-user { font-size: 0.85rem; }

/* ── Dropdown ─────────────────────────────────────────────────── */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.13);
    min-width: 230px;
    padding: 0.4rem 0.3rem;
}
.dropdown-header {
    color: var(--cls-primary);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 0.55rem 0.85rem 0.2rem;
}
.dropdown-item {
    font-size: 0.875rem;
    padding: 0.45rem 0.85rem;
    border-radius: 7px;
    transition: background-color 0.15s;
    color: var(--cls-text);
}
.dropdown-item:hover { background-color: var(--cls-primary-light); color: var(--cls-primary); }
.dropdown-item i { width: 18px; margin-right: 5px; opacity: 0.65; }
.dropdown-divider { margin: 0.3rem 0.5rem; }

/* ── Accent bar ───────────────────────────────────────────────── */
.accent-bar {
    height: 3px;
    background: linear-gradient(to right, var(--cls-orange), var(--cls-yellow));
    flex-shrink: 0;
}

/* ── Main ─────────────────────────────────────────────────────── */
.cls-main { flex: 1; padding: 2rem 0 3rem; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.11); }
.card-header {
    background-color: var(--cls-primary);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 0.8rem 1.2rem;
    border: none;
}
.card-body { padding: 1.25rem; }

/* ── Dashboard metric cards ───────────────────────────────────── */
.dash-card { border-radius: 12px; padding: 1.5rem; color: white; box-shadow: 0 4px 15px rgba(0,0,0,0.1); height: 100%; }
.dash-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.dash-card-icon { font-size: 2.4rem; opacity: 0.75; }
.dash-card-label { font-size: 0.88rem; font-weight: 600; margin-top: 0.7rem; opacity: 0.9; }
.dash-card-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.dash-card-sub { font-size: 0.85rem; opacity: 0.85; margin-top: 0.2rem; }
.dash-primary { background: linear-gradient(135deg, var(--cls-primary) 0%, #0088d4 100%); }
.dash-orange  { background: linear-gradient(135deg, #F9b036 0%, #ffc266 100%); }
.dash-green   { background: linear-gradient(135deg, #198754 0%, #20c997 100%); }
.dash-purple  { background: linear-gradient(135deg, #6610f2 0%, #6f42c1 100%); }
.dash-red     { background: linear-gradient(135deg, #dc3545 0%, #e35d6a 100%); }

/* ── Nav section cards (quick-access) ─────────────────────────── */
.nav-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: white;
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    text-decoration: none;
    color: var(--cls-text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.15s;
    height: 100%;
}
.nav-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,0.11); background-color: #fafcff; color: var(--cls-text); }
.nav-card-icon { font-size: 1.6rem; color: var(--cls-primary); flex-shrink: 0; margin-top: 2px; }
.nav-card-title { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.2rem; }
.nav-card-desc { font-size: 0.8rem; color: var(--cls-muted); line-height: 1.4; margin: 0; }

/* ── Tables ───────────────────────────────────────────────────── */
.table { background-color: white; margin-bottom: 0; }
.table thead { background-color: var(--cls-primary); color: white; }
.table thead th { border: none; font-weight: 600; font-size: 0.85rem; padding: 0.8rem 1rem; }
.table tbody td { padding: 0.75rem 1rem; vertical-align: middle; border-color: #f0f0f0; }
.table-hover tbody tr:hover { background-color: var(--cls-primary-light); }
.table-wrapper { border-radius: 12px; overflow-x: auto; overflow-y: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.07); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary { background-color: var(--cls-primary); border-color: var(--cls-primary); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--cls-primary-dark); border-color: var(--cls-primary-dark); }
.btn-outline-primary { color: var(--cls-primary); border-color: var(--cls-primary); }
.btn-outline-primary:hover { background-color: var(--cls-primary); border-color: var(--cls-primary); }

/* ── Forms ────────────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
    border-color: var(--cls-primary);
    box-shadow: 0 0 0 0.2rem rgba(0,108,182,0.2);
}
.form-label { font-weight: 600; font-size: 0.875rem; }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert { border: none; border-radius: 10px; }
.alert-dismissible .btn-close { padding: 0.85rem; }

/* ── Misc ─────────────────────────────────────────────────────── */
.accent-line {
    height: 3px;
    background: linear-gradient(to right, var(--cls-orange), var(--cls-yellow));
    border-radius: 2px;
    margin: 0.5rem 0 1.25rem;
}
.page-title { font-size: clamp(1.3rem, 2.5vw, 1.85rem); font-weight: 700; margin-bottom: 0.2rem; }
.page-subtitle { color: var(--cls-muted); font-size: 0.9rem; }
code { background: #eef3f8; color: var(--cls-primary-dark); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }
a { color: var(--cls-primary); }
a:hover { color: var(--cls-primary-dark); }
.text-primary { color: var(--cls-primary) !important; }
.badge { padding: 0.4em 0.7em; font-weight: 500; }
.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--cls-muted);
    margin-bottom: 0.85rem;
}

/* ── Footer ───────────────────────────────────────────────────── */
.cls-footer { background: white; border-top: 3px solid var(--cls-orange); padding: 0.85rem 0; }
.cls-footer-text { color: var(--cls-muted); font-size: 0.78rem; }

/* ── Animation ────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease-out; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cls-main { padding: 1.25rem 0 2rem; }
    .dash-card  { padding: 1.1rem; }
}

/* ════════════════════════════════════════════════════════════════
   Login / Guest layout
   ════════════════════════════════════════════════════════════════ */
.cls-guest body {
    background: linear-gradient(135deg, var(--cls-primary) 0%, #0088d4 100%);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.login-wrapper { width: min(500px, 100%); }
.login-card {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}
.login-header {
    background-color: var(--cls-primary);
    color: white;
    padding: 2rem 2rem 1.6rem;
    text-align: center;
}
.login-header .brand-icon { font-size: 2.8rem; opacity: 0.9; }
.login-header .brand-name {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: 0.3rem 0 0.15rem;
}
.login-header .brand-sub { font-size: 0.82rem; opacity: 0.75; }
.login-body {
    padding: 2rem;
    background: white;
}
.login-body .form-control {
    border-radius: 10px;
    padding: 0.65rem 1rem;
    border-color: #dde3ea;
}
.btn-login {
    background-color: var(--cls-primary);
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    width: 100%;
    font-size: 1rem;
    transition: background-color 0.2s, transform 0.15s;
    color: white;
}
.btn-login:hover { background-color: var(--cls-primary-dark); transform: translateY(-1px); color: white; }

/* ── El atributo `hidden` gana a las utilidades de display ─────── */
/*
 * Bootstrap declara `[hidden]{display:none!important}` cerca del principio de su hoja y las
 * utilidades `.d-flex` / `.d-inline` / `.d-block` cerca del final, todas con `!important` y la misma
 * especificidad (0,1,0): gana la última, así que un elemento con `class="d-flex" hidden` se veía
 * igual. El proyecto usa el patrón «pintar siempre y alternar con `hidden`» en varias pantallas
 * (el aviso de retiro de D-22 en la ficha de la CxC, el formulario de reiniciar nota, los avisos de
 * la card de cuenta), y ahí el atributo era inerte.
 *
 * Esta hoja se carga DESPUÉS de Bootstrap, así que esta regla lo resuelve en un solo lugar en vez
 * de cambiar cada marcado. Detectado en la ronda 2 de la revisión de cierre de la Fase 4.
 */
[hidden] {
    display: none !important;
}
