/* =============================================
   EduManage Pro - Main Stylesheet
   ============================================= */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a237e;
    --sidebar-hover: rgba(255,255,255,0.1);
    --sidebar-active: rgba(255,214,0,0.2);
    --sidebar-active-border: #ffd600;
    --primary: #1a237e;
    --accent: #ffd600;
    --navbar-height: 60px;
    --card-radius: 12px;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
}

/* ===================== LAYOUT ===================== */
body { background: #f0f2f5; font-family: 'Segoe UI', Tahoma, sans-serif; }

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

/* ===================== SIDEBAR ===================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo {
    display: flex;
    align-items: center;
}
.sidebar-subtitle {
    font-size: 0.75rem;
    margin-top: 4px;
    padding-left: 4px;
}
.school-logo-sm {
    width: 36px; height: 36px;
    border-radius: 8px;
    object-fit: contain;
    background: white;
    padding: 2px;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    flex: 1;
}
.sidebar-menu li.menu-label {
    padding: 10px 20px 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
}
.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}
.sidebar-menu li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-menu li a.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: var(--sidebar-active-border);
    font-weight: 600;
}
.sidebar-menu li a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

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

/* ===================== TOP NAVBAR ===================== */
.top-navbar {
    height: var(--navbar-height);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 1px 5px rgba(0,0,0,0.06);
}
.sidebar-toggle {
    color: #374151;
    background: none;
    border: none;
}

/* ===================== CONTENT AREA ===================== */
.content-area {
    padding: 24px;
    flex: 1;
}

/* ===================== CARDS ===================== */
.card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
}
.card-header {
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    font-weight: 600;
}

/* ===================== STAT CARDS ===================== */
.stat-card {
    border-radius: var(--card-radius);
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}
.stat-card .stat-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.2;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.85rem; opacity: 0.9; }
.stat-card .stat-change { font-size: 0.8rem; opacity: 0.8; margin-top: 4px; }

.bg-stat-1 { background: linear-gradient(135deg, #1a237e, #283593); }
.bg-stat-2 { background: linear-gradient(135deg, #006064, #00838f); }
.bg-stat-3 { background: linear-gradient(135deg, #e65100, #ef6c00); }
.bg-stat-4 { background: linear-gradient(135deg, #1b5e20, #2e7d32); }
.bg-stat-5 { background: linear-gradient(135deg, #4a148c, #6a1b9a); }
.bg-stat-6 { background: linear-gradient(135deg, #880e4f, #ad1457); }

/* ===================== TABLES ===================== */
.table th { background: #f8f9fa; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7280; }
.table td { vertical-align: middle; }

/* ===================== BADGES ===================== */
.badge { font-size: 0.75rem; padding: 5px 10px; border-radius: 30px; }

/* ===================== BUTTONS ===================== */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #283593; border-color: #283593; }
.btn-sm { font-size: 0.8rem; }

/* ===================== AVATAR ===================== */
.avatar-circle {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #1a237e, #01579b);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}
.avatar-lg {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, #1a237e, #01579b);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2rem;
}

/* ===================== PAGE HEADER ===================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h4 {
    font-weight: 700;
    color: #1a237e;
    margin: 0;
}

/* ===================== NOTIFICATION DROPDOWN ===================== */
.notification-dropdown { max-height: 400px; overflow-y: auto; }
.notification-item { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; cursor: pointer; }
.notification-item:hover { background: #f9fafb; }
.notification-item.unread { border-left: 3px solid #1a237e; background: #eff6ff; }

/* ===================== SIDEBAR COLLAPSED ===================== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ===================== ATTENDANCE GRID ===================== */
.attendance-cell { width: 32px; height: 32px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 600; }
.att-present { background: #d1fae5; color: #065f46; }
.att-absent  { background: #fee2e2; color: #991b1b; }
.att-late    { background: #fef9c3; color: #713f12; }
.att-leave   { background: #e0e7ff; color: #3730a3; }

/* ===================== PRINT STYLES ===================== */
@media print {
    .sidebar, .top-navbar, .btn, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ===================== STATUS BADGES ===================== */
.status-active   { background:#d1fae5; color:#065f46; }
.status-inactive { background:#fee2e2; color:#991b1b; }
.status-pending  { background:#fef9c3; color:#713f12; }
.status-expired  { background:#f3f4f6; color:#6b7280; }
.status-paid     { background:#d1fae5; color:#065f46; }
.status-unpaid   { background:#fee2e2; color:#991b1b; }
.status-partial  { background:#fef3c7; color:#92400e; }
.status-overdue  { background:#fce7f3; color:#9d174d; }
.status-deleted  { background:#f3f4f6; color:#6b7280; }

/* ===================== FORM HELPERS ===================== */
.form-control:focus, .form-select:focus { border-color: #1a237e; box-shadow: 0 0 0 0.25rem rgba(26,35,126,0.15); }
.required::after { content: ' *'; color: #dc2626; }

/* ===================== BREADCRUMB ===================== */
.breadcrumb { background: transparent; padding: 0; }
.breadcrumb-item + .breadcrumb-item::before { content: '›'; }

/* ===================== TIMELINE ===================== */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: #e5e7eb; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #1a237e; }

/* ===================== ID CARD ===================== */
.id-card { width: 320px; background: linear-gradient(135deg, #1a237e, #0d47a1); border-radius: 16px; padding: 20px; color: white; }
.id-card-photo { width: 80px; height: 80px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.5); object-fit: cover; }

/* ===================== FEE RECEIPT ===================== */
.receipt-header { background: linear-gradient(135deg, #1a237e, #01579b); color: white; padding: 20px; border-radius: 8px 8px 0 0; }
.receipt-divider { border-top: 2px dashed #e5e7eb; margin: 15px 0; }

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #999; }
