/* ══════════════════════════════════════════════
   Colegio App — Custom Styles
   ══════════════════════════════════════════════ */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --topbar-height: 56px;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* ── Layout ── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f1f5f9;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #cbd5e1;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #334155;
    text-decoration: none;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-brand i {
    font-size: 1.4rem;
    margin-right: 0.6rem;
    color: var(--primary);
}

.sidebar-nav {
    padding: 0.75rem 0;
}

.sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 1.25rem 0.35rem;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}

.sidebar-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.sidebar-link i {
    width: 20px;
    margin-right: 0.7rem;
    font-size: 1rem;
    text-align: center;
}

/* ── Main content ── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar .btn-toggle-sidebar {
    display: none;
    border: none;
    background: none;
    font-size: 1.3rem;
    color: #475569;
    cursor: pointer;
}

/* ── Content area ── */
.content-area {
    padding: 1.5rem;
    flex: 1;
}

/* ── Cards ── */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.page-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* ── Tables ── */
.table-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.table-card .table {
    margin-bottom: 0;
}

.table-card .table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    font-weight: 600;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table-card .table tbody td {
    padding: 0.7rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    color: #334155;
}

.table-card .table tbody tr:hover {
    background: #f8fafc;
}

/* ── Badges ── */
.badge-active {
    background-color: #dcfce7;
    color: #166534;
}

.badge-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-closed {
    background-color: #e2e8f0;
    color: #475569;
}

.badge-graduated {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-promoted {
    background-color: #fef3c7;
    color: #92400e;
}

/* ── Login ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

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

.login-card h3 {
    font-weight: 700;
    color: #1e293b;
}

.login-card .login-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
}

/* ── Grades input ── */
.grade-input {
    width: 80px;
    text-align: center;
    font-weight: 600;
}

.grade-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

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

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .topbar .btn-toggle-sidebar {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* ── Utility ── */
.min-width-0 { min-width: 0; }

/* ── Confirm modal ── */
.modal-confirm .modal-header {
    border-bottom: 0;
    padding-bottom: 0;
}

.modal-confirm .modal-footer {
    border-top: 0;
}
