html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}
/* ========================================
   School Management System - Custom Styles
   ======================================== */

:root {
    --sidebar-width: 260px;
    --primary-color: #4361ee;
    --primary-dark: #3a51d4;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --success-color: #06d6a0;
    --warning-color: #ffd166;
    --danger-color: #ef476f;
    --info-color: #118ab2;
    --dark-color: #1b2838;
    --sidebar-bg: #1b2838;
    --sidebar-hover: #243447;
    --sidebar-active: #4361ee;
    --body-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0f1923 100%);
    color: #fff;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar-brand {
    padding: 20px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(67, 97, 238, 0.1);
}

    .sidebar-brand h3 {
        font-size: 1.2rem;
        font-weight: 700;
        letter-spacing: 0.5px;
        margin: 0;
    }

    .sidebar-brand .brand-icon {
        font-size: 2rem;
        margin-bottom: 5px;
        display: block;
    }

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
    margin: 0;
}

    .sidebar-menu li {
        margin: 2px 10px;
    }

        .sidebar-menu li a {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            color: rgba(255,255,255,0.75);
            text-decoration: none;
            border-radius: 8px;
            transition: all 0.25s ease;
            font-size: 0.9rem;
            font-weight: 500;
        }

            .sidebar-menu li a:hover {
                background-color: var(--sidebar-hover);
                color: #fff;
                transform: translateX(3px);
            }

            .sidebar-menu li a.active {
                background: linear-gradient(135deg, var(--sidebar-active), var(--accent-color));
                color: #fff;
                box-shadow: 0 4px 12px rgba(67,97,238,0.4);
            }

            .sidebar-menu li a i {
                margin-right: 12px;
                font-size: 1.1rem;
                width: 22px;
                text-align: center;
            }

.sidebar-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 10px 15px;
}

.sidebar-section-title {
    padding: 10px 25px 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
}

/* ===== TOP NAVBAR ===== */
.top-navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 60px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

    .top-navbar .page-title {
        font-size: 1.15rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .top-navbar .user-info {
        display: flex;
        align-items: center;
        gap: 15px;
    }

        .top-navbar .user-info .user-avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 700;
            font-size: 0.9rem;
        }

        .top-navbar .user-info .user-name {
            font-weight: 600;
            font-size: 0.9rem;
        }

        .top-navbar .user-info .user-role {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 60px;
    padding: 25px;
    min-height: calc(100vh - 60px);
}

/* ===== DASHBOARD CARDS ===== */
.stat-card {
    border: none;
    border-radius: 12px;
    padding: 22px;
    color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 130px;
}

    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    }

    .stat-card .stat-icon {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 3rem;
        opacity: 0.2;
    }

    .stat-card .stat-number {
        font-size: 2rem;
        font-weight: 700;
        line-height: 1;
        margin-bottom: 5px;
    }

    .stat-card .stat-label {
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        opacity: 0.9;
    }

.bg-gradient-primary {
    background: linear-gradient(135deg, #4361ee, #3a86ff);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #06d6a0, #05b384);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffd166, #f0b429);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #ef476f, #d63384);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #118ab2, #0a6e8f);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #3f37c9, #6c63ff);
}

/* ===== CARDS ===== */
.content-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

    .content-card .card-header-custom {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid var(--border-color);
    }

        .content-card .card-header-custom h5 {
            font-weight: 700;
            color: var(--text-primary);
            margin: 0;
        }

/* ===== TABLES ===== */
.table-custom {
    width: 100%;
    border-collapse: collapse;
}

    .table-custom thead th {
        background: linear-gradient(135deg, var(--dark-color), #243447);
        color: #fff;
        padding: 14px 15px;
        font-size: 0.85rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border: none;
    }

        .table-custom thead th:first-child {
            border-radius: 8px 0 0 0;
        }

        .table-custom thead th:last-child {
            border-radius: 0 8px 0 0;
        }

    .table-custom tbody td {
        padding: 13px 15px;
        border-bottom: 1px solid var(--border-color);
        vertical-align: middle;
        font-size: 0.9rem;
    }

    .table-custom tbody tr:hover {
        background-color: #f7f9fc;
    }

    .table-custom tbody tr:last-child td {
        border-bottom: none;
    }

/* ===== BUTTONS ===== */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

    .btn-primary-custom:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(67,97,238,0.4);
        color: #fff;
    }

.btn-sm-custom {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-edit {
    background: var(--warning-color);
    color: #333;
}

    .btn-edit:hover {
        background: #f0b429;
        transform: translateY(-1px);
    }

.btn-delete {
    background: var(--danger-color);
    color: #fff;
}

    .btn-delete:hover {
        background: #d63384;
        color: #fff;
        transform: translateY(-1px);
    }

.btn-view {
    background: var(--info-color);
    color: #fff;
}

    .btn-view:hover {
        background: #0a6e8f;
        color: #fff;
        transform: translateY(-1px);
    }

/* ===== FORMS ===== */
.form-control-custom {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

    .form-control-custom:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(67,97,238,0.15);
        outline: none;
    }

.form-label-custom {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

/* ===== LOGIN / REGISTER ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1b2838 0%, #0f1923 50%, #4361ee 100%);
}

.auth-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

    .auth-card h2 {
        text-align: center;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 5px;
    }

    .auth-card .auth-subtitle {
        text-align: center;
        color: var(--text-secondary);
        font-size: 0.9rem;
        margin-bottom: 30px;
    }

    .auth-card .brand-logo {
        text-align: center;
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

/* ===== BADGES ===== */
.badge-present {
    background: var(--success-color);
    color: #fff;
}

.badge-absent {
    background: var(--danger-color);
    color: #fff;
}

.badge-late {
    background: var(--warning-color);
    color: #333;
}

/* ===== ALERTS ===== */
.alert-custom-success {
    background: linear-gradient(135deg, rgba(6,214,160,0.1), rgba(6,214,160,0.05));
    border-left: 4px solid var(--success-color);
    border-radius: 8px;
    padding: 15px 20px;
    color: #065f46;
}

.alert-custom-danger {
    background: linear-gradient(135deg, rgba(239,71,111,0.1), rgba(239,71,111,0.05));
    border-left: 4px solid var(--danger-color);
    border-radius: 8px;
    padding: 15px 20px;
    color: #9b1c31;
}

/* ===== PAGINATION ===== */
.pagination-custom .page-item .page-link {
    border: none;
    color: var(--text-primary);
    padding: 8px 14px;
    margin: 0 3px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-custom .page-item.active .page-link {
    background: var(--primary-color);
    color: #fff;
}

.pagination-custom .page-item .page-link:hover {
    background: #e2e8f0;
}

/* ===== ANNOUNCEMENT CARD ===== */
.announcement-item {
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 10px;
    background: #f7f9fc;
    border-radius: 0 8px 8px 0;
    transition: transform 0.2s ease;
}

    .announcement-item:hover {
        transform: translateX(5px);
    }

    .announcement-item h6 {
        font-weight: 700;
        margin-bottom: 3px;
    }

    .announcement-item small {
        color: var(--text-secondary);
    }

/* ===== EVENT CARD ===== */
.event-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f7f9fc;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

    .event-item:hover {
        transform: translateX(5px);
    }

.event-date {
    min-width: 55px;
    text-align: center;
    padding: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #fff;
    border-radius: 8px;
    margin-right: 15px;
}

    .event-date .day {
        font-size: 1.3rem;
        font-weight: 700;
        line-height: 1;
    }

    .event-date .month {
        font-size: 0.7rem;
        text-transform: uppercase;
    }

/* ===== ACCESS DENIED ===== */
.access-denied {
    text-align: center;
    padding: 80px 20px;
}

    .access-denied i {
        font-size: 5rem;
        color: var(--danger-color);
        margin-bottom: 20px;
    }

    .access-denied h2 {
        font-weight: 700;
        color: var(--text-primary);
    }

    .access-denied p {
        color: var(--text-secondary);
        margin-bottom: 25px;
    }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .top-navbar {
        left: 0;
    }

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

    .top-navbar .sidebar-toggle {
        display: block;
    }
}

/* ===== DELETE CONFIRMATION ===== */
.delete-confirm {
    text-align: center;
    padding: 30px;
}

    .delete-confirm i {
        font-size: 4rem;
        color: var(--danger-color);
        margin-bottom: 15px;
    }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
}