/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Barlow', sans-serif;
    background: #f0f2f5;
}

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

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.sidebar {
    width: 72px;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow: hidden;
    transition: width 0.3s ease;
}

/* Brand */
.sidebar-brand {
    padding: 1rem 0;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
}

.brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 0.25rem;
}

.brand-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.academy-mini-mark {
    display: grid;
    grid-template-columns: repeat(3, 8px);
    gap: 4px;
}

.academy-mini-mark i {
    display: block;
    width: 8px;
    height: 8px;
    background: #4fc3f7;
    border-radius: 2px;
}

.sidebar-logo {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    display: block;
    object-fit: contain;
    flex: 0 0 32px;
    border-radius: 50%;
}

/* Navigation - Scrollable */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Webkit scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Section Labels */
.nav-section {
    padding: 0.5rem 0.5rem 0.25rem 0.5rem;
    margin-top: 0.25rem;
}

.nav-section-label {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.45rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: block;
    text-align: center;
}

/* Nav Items */
.nav-item {
    color: rgba(255, 255, 255, 0.5);
    padding: 0.6rem 0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    margin: 0.1rem 0.5rem;
    transition: all 0.2s;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.1rem;
    transition: all 0.2s;
}

.nav-item span {
    font-size: 0.55rem;
    line-height: 1.1;
    font-weight: 500;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.12);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 2px;
    background: #4fc3f7;
    border-radius: 0 2px 2px 0;
}

.nav-item.active i {
    color: #4fc3f7;
}

.nav-item.logout-item {
    color: rgba(255, 100, 100, 0.6);
}

.nav-item.logout-item:hover {
    color: #ff6b6b;
    background: rgba(255, 100, 100, 0.1);
}

/* Sidebar Bottom */
.sidebar-bottom {
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.sidebar-bottom .nav-item {
    margin: 0.1rem 0.5rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: 72px;
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.topbar h4 {
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.topbar p {
    color: #6c757d;
    margin: 0;
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: #1a1a2e;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
}

/* User Info */
.user-avatar {
    width: 40px;
    height: 40px;
    background: #4fc3f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Panels */
.panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.panel-header h5 {
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

/* Metric Cards */
.metric-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
}

.metric-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Buttons */
.btn-primary {
    background: #1a1a2e;
    border-color: #1a1a2e;
}

.btn-primary:hover {
    background: #2a2a4e;
    border-color: #2a2a4e;
}

.btn-outline-secondary:hover {
    background: #f8f9fa;
}

/* Badges */
.badge-current {
    background: #28a745;
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

.badge-success {
    background: #28a745;
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

.badge-secondary {
    background: #6c757d;
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

/* Academic Tabs */
.academics-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.academics-tabs a {
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    color: #6c757d;
    background: white;
    font-weight: 500;
    transition: all 0.2s;
}

.academics-tabs a.active {
    background: #1a1a2e;
    color: white;
}

.academics-tabs a:hover:not(.active) {
    background: #e9ecef;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: #1a1a2e;
}

.form-control,
.form-select {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.6rem 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #1a1a2e;
    box-shadow: 0 0 0 0.2rem rgba(26, 26, 46, 0.1);
}

.form-check-input:checked {
    background-color: #1a1a2e;
    border-color: #1a1a2e;
}

/* Tables */
.table th {
    font-weight: 600;
    color: #495057;
    border-top: none;
}

.table td {
    vertical-align: middle;
}

/* Alerts */
.alert {
    border-radius: 10px;
}

/* Footer */
.footer-text {
    font-size: 0.85rem;
    color: #adb5bd;
}

.text-danger {
    color: #dc3545;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    /* Sidebar */
    .sidebar {
        width: 0;
        overflow: hidden;
        transition: width 0.3s ease;
    }

    .sidebar.open {
        width: 72px;
        overflow: visible;
    }

    .sidebar.open .sidebar-nav {
        overflow-y: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    /* Hamburger */
    .hamburger-btn {
        display: block;
    }

    /* Topbar */
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Tabs */
    .academics-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        width: 100%;
    }

    .academics-tabs a {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }

    /* Panels */
    .panel {
        padding: 1rem;
    }

    /* Tables */
    .table-responsive {
        font-size: 0.85rem;
    }

    /* Metrics */
    .metric-card {
        padding: 1rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   NOTIFICATION BELL & PROFILE DROPDOWN
   ============================================ */

/* Notification Bell */
.btn-notification {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    padding: 0;
}

.btn-notification:hover {
    background: #e9ecef;
}

.btn-notification i {
    font-size: 1.25rem;
    color: #495057;
}

.badge-notification {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(25%, -25%);
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    background: #1a1a2e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Dropdown Menus */
.dropdown-menu {
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 0.5rem 0;
    min-width: 220px;
}

.dropdown-menu .dropdown-header {
    padding: 0.75rem 1.25rem;
}

.dropdown-menu .dropdown-item {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.dropdown-menu .dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-menu .dropdown-item i {
    width: 1.2rem;
    text-align: center;
}

.dropdown-menu .dropdown-item.bg-light {
    background: #f0f7ff !important;
}

.dropdown-menu .dropdown-item.bg-light:hover {
    background: #e3f0ff !important;
}

/* Notification dropdown */
.dropdown-menu-notification {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-menu-notification .dropdown-item {
    white-space: normal;
    padding: 0.75rem 1rem;
}

.dropdown-menu-notification .dropdown-item .notification-time {
    font-size: 0.7rem;
    color: #6c757d;
}

/* Badge Styles */
.badge-current {
    background: #28a745;
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

.badge-success {
    background: #28a745;
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

.badge-secondary {
    background: #6c757d;
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

/* ============================================
   HAMBURGER BUTTON (Mobile)
   ============================================ */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: #1a1a2e;
    font-size: 1.5rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.hamburger-btn:hover {
    background: rgba(26, 26, 46, 0.05);
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }
    
    .dropdown-menu-notification {
        min-width: 280px;
        right: -60px !important;
    }
    
    .topbar .d-flex.align-items-center.gap-3 {
        gap: 0.5rem !important;
    }
}

/* Badge Styles */
.badge-current {
    background: #28a745;
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

.badge-success {
    background: #28a745;
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

.badge-secondary {
    background: #6c757d;
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

.badge-info {
    background: #17a2b8;
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 50rem;
    font-size: 0.75rem;
}

/* Notification Badge on Bell Icon */
.btn-notification {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-notification:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-notification i {
    font-size: 1.3rem;
    color: #495057;
}

.badge-notification {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(25%, -25%);
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Notification Dropdown */
.dropdown-menu-notification {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-menu-notification .dropdown-item {
    white-space: normal;
    padding: 0.75rem 1rem;
}

.dropdown-menu-notification .dropdown-item .notification-time {
    font-size: 0.7rem;
    color: #6c757d;
}

.dropdown-menu-notification .dropdown-item.bg-light {
    background: #f0f7ff !important;
}

.dropdown-menu-notification .dropdown-item.bg-light:hover {
    background: #e3f0ff !important;
}

/* ============================================
   DASHBOARD SPECIFIC STYLES
   ============================================ */

.dashboard-wrap {
    padding: 0;
}

/* Metric Cards Enhancements */
.metric-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.metric-card .metric-label {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.metric-card .metric-label i {
    margin-right: 0.25rem;
}

.metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.metric-card .metric-trend {
    margin-top: 0.5rem;
}

/* Panel Enhancements */
.panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.panel:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.panel-header h5 {
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    font-size: 1rem;
}

.panel-header small {
    color: #6c757d;
    font-size: 0.8rem;
}

/* Performance Chart */
.performance-chart .bar-column {
    transition: height 0.3s ease;
    min-height: 20px;
}

/* Attendance Legend */
.attendance-legend {
    margin-top: 0.5rem;
}

.attendance-legend > div {
    padding: 0.35rem 0;
}

/* Avatar Small */
.avatar-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.7rem;
}

.bg-success-light {
    background: #d4edda;
    color: #155724;
}

.bg-warning-light {
    background: #fff3cd;
    color: #856404;
}

.bg-danger-light {
    background: #f8d7da;
    color: #721c24;
}

/* Quick Actions */
.quick-actions .btn {
    justify-content: flex-start;
    padding: 0.6rem 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .metric-card .metric-value {
        font-size: 1.5rem;
    }
    
    .panel {
        padding: 1rem;
    }
    
    .dashboard-wrap .row.g-3 {
        --bs-gutter-y: 1rem;
    }
}

/* Dashboard specific colors */
.text-success-light {
    color: #28a745;
}

.bg-success-light {
    background: #d4edda;
}

.text-warning-light {
    color: #ffc107;
}

.bg-warning-light {
    background: #fff3cd;
}

.text-danger-light {
    color: #dc3545;
}

.bg-danger-light {
    background: #f8d7da;
}

/* Timeline styles */
.timeline {
    padding: 0.25rem 0;
}

.timeline .border-start {
    border-color: #dee2e6 !important;
}

.timeline .border-start.border-3 {
    border-color: #0d6efd !important;
}

/* Badge opacity variants */
.badge.bg-success.bg-opacity-10 {
    background-color: rgba(40, 167, 69, 0.1) !important;
    color: #28a745 !important;
}

.badge.bg-warning.bg-opacity-10 {
    background-color: rgba(255, 193, 7, 0.1) !important;
    color: #ffc107 !important;
}

.badge.bg-danger.bg-opacity-10 {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

.badge.bg-info.bg-opacity-10 {
    background-color: rgba(13, 202, 240, 0.1) !important;
    color: #0dcaf0 !important;
}

.badge.bg-primary.bg-opacity-10 {
    background-color: rgba(13, 110, 253, 0.1) !important;
    color: #0d6efd !important;
}

.badge.bg-secondary.bg-opacity-10 {
    background-color: rgba(108, 117, 125, 0.1) !important;
    color: #6c757d !important;
}

/* ============================================
   PERFORMANCE BAR CHART
   ============================================ */

.chart-container .bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 140px;
    width: 100%;
}

.chart-container .bar-column {
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 30px;
    min-height: 10px;
    border-radius: 4px 4px 0 0;
}

.chart-container .bar-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #495057;
    margin-top: 4px;
}

.chart-container .bar-value {
    font-size: 0.65rem;
    color: #6c757d;
}

/* Responsive chart */
@media (max-width: 768px) {
    .chart-container .bar-column {
        width: 24px;
    }
    
    .chart-container .bar-wrapper {
        height: 100px;
    }
}

@media (max-width: 576px) {
    .chart-container .bar-column {
        width: 18px;
    }
    
    .chart-container .bar-wrapper {
        height: 80px;
    }
}
/* v11 Phase 3.2 - student form layout */
.student-form-panel{max-width:1180px;margin:0 auto;padding:24px}
.student-form-panel .card{overflow:visible}
.student-form-section .card-header{padding:14px 18px}.student-form-section .card-body{padding:20px}
.student-form-section .form-label{font-weight:600;margin-bottom:7px;line-height:1.25}
.guardian-options,.income-options{display:flex;flex-wrap:wrap;gap:12px 28px;padding:12px 14px;border:1px solid #e6e9ef;border-radius:10px;background:#fafbfc}
.income-options .form-check,.guardian-options .form-check{margin:0;min-width:180px}
@media(max-width:767.98px){.student-form-panel{padding:14px}.student-form-section .card-body{padding:16px}.guardian-options,.income-options{display:block}.guardian-options .form-check,.income-options .form-check{margin-bottom:10px}}

/* Phase 5.3.3: keep header actions at the upper-right on narrow screens. */
.topbar { flex-direction: row; align-items: flex-start; flex-wrap: nowrap; }
.topbar > :first-child { flex: 1 1 auto; min-width: 0; }
.topbar > :last-child { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; justify-content: flex-end; }
.topbar > :last-child .dropdown { position: relative; }
.topbar .dropdown-menu-notification { max-width: min(360px, calc(100vw - 24px)); }
@media (max-width: 768px) {
  .topbar { flex-direction: row; align-items: flex-start; flex-wrap: nowrap; gap: .5rem; }
  .topbar > :first-child { flex: 1 1 auto; min-width: 0; }
  .topbar > :last-child { flex: 0 0 auto; margin-left: auto; gap: .5rem !important; }
  .topbar > :last-child .badge.bg-dark { display: none !important; }
  .topbar .dropdown-menu-notification { right: 0 !important; left: auto !important; }
}
