:root {
    --sidebar-bg: #1e2a3a;
    --sidebar-active: #2f6fed;
}

body {
    background: #f3f5f9;
}

.min-vw-0 { min-width: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: 250px;
    /* !important: Bootstrap pone .offcanvas-lg transparente en pantallas grandes */
    background-color: var(--sidebar-bg) !important;
    color: #fff;
    display: flex;
    flex-direction: column;
}
@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        flex-shrink: 0;
    }
}
.sidebar.offcanvas-lg { --bs-offcanvas-bg: var(--sidebar-bg); --bs-offcanvas-width: 260px; }
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-brand > .bi { font-size: 1.8rem; color: #8fb4ff; }
.sidebar-logo {
    width: 44px; height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    padding: 2px;
}
.login-logo { max-width: 120px; max-height: 120px; object-fit: contain; }
.logo-preview {
    width: 96px; height: 96px;
    object-fit: contain;
    border: 1px solid #dfe3ea;
    border-radius: .5rem;
    background: #fff;
    padding: 4px;
}
.logo-preview-vacio {
    width: 96px; height: 96px;
    display: grid; place-items: center;
    border: 1px dashed #c4cad4;
    border-radius: .5rem;
    font-size: 2.2rem;
    color: #9aa1ab;
}
.sidebar .nav-link {
    color: rgba(255, 255, 255, .75);
    border-radius: .5rem;
    padding: .6rem .8rem;
    margin-bottom: 2px;
}
.sidebar .nav-link .bi { width: 1.4rem; display: inline-block; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.sidebar .nav-link.active { color: #fff; background: var(--sidebar-active); }

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    background: #fff;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid #e3e7ee;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ---------- Tarjetas ---------- */
.card { border: 0; box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
.card-header { background: #fff; font-weight: 600; }
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 1.4rem;
}
.stat-card .stat-valor { font-size: 1.45rem; font-weight: 700; }

/* ---------- Grilla de meses ---------- */
.meses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
}
.mes-tile {
    display: block;
    border: 2px solid #dfe3ea;
    border-radius: .75rem;
    padding: .7rem .8rem;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s, background .15s;
    position: relative;
}
.mes-tile input { position: absolute; top: .7rem; right: .7rem; transform: scale(1.25); }
.mes-tile .mes-nombre { font-weight: 600; }
.mes-tile .mes-costo { font-size: .9rem; color: #5b6576; }
.mes-tile:hover { border-color: #9bb8f5; }
.mes-tile:has(input:checked) { border-color: var(--sidebar-active); background: #eef3ff; }
.mes-tile.pagado { border-color: #8fd3a8; background: #ecf9f0; cursor: default; }
.mes-tile.deshabilitado { background: #f1f2f4; color: #9aa1ab; cursor: not-allowed; border-style: dashed; }
.mes-tile .mes-info { font-size: .75rem; margin-top: .25rem; }

.kardex-box {
    border: 2px solid #dfe3ea;
    border-radius: .75rem;
    padding: .8rem 1rem;
    cursor: pointer;
}
.kardex-box:has(input:checked) { border-color: var(--sidebar-active); background: #eef3ff; }

.total-box {
    background: #1e2a3a;
    color: #fff;
    border-radius: .75rem;
    padding: 1rem 1.25rem;
}
.total-box .monto { font-size: 1.8rem; font-weight: 700; }

/* ---------- Autocompletado ---------- */
.autocomplete-list {
    position: absolute;
    left: 0; right: 0;
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
}

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1e2a3a 0%, #2f6fed 100%);
    padding: 1rem;
}
.login-card { width: 100%; max-width: 400px; }

.table th { white-space: nowrap; font-size: .85rem; color: #5b6576; }

/* Leyenda de estudiante nuevo */
.badge-nuevo { background: #ffc107; color: #3d2e00; font-weight: 700; }
.badge-nuevo .bi { font-size: .7em; }
.badge-mini { font-size: .65rem; }
