/* Customizing Tailwind colors and adding Premium Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Premium Color Palette */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    
    /* Backgrounds */
    --bg-main: #f8fafc;
    --bg-sidebar: rgba(15, 23, 42, 0.85); /* Dark Glass */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    
    /* Text */
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    /* Shadows & Transitions */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.3);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

/* Custom styles for the sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1), left 0.3s cubic-bezier(0.4,0,0.2,1), transform 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 50;
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    margin: 0.25rem 1rem;
    border-radius: 0.75rem;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: #cbd5e1;
    font-weight: 500;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(4px);
}

.sidebar-nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.sidebar-nav-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Main content area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

/* Top navigation bar */
.top-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 1rem;
    z-index: 40;
}

.top-nav .search-bar {
    flex-grow: 1;
    max-width: 450px;
    position: relative;
}

.top-nav .search-bar input {
    width: 100%;
    padding: 0.85rem 1.25rem 0.85rem 2.75rem;
    border: 1px solid rgba(0,0,0,0.05);
    background: rgba(255,255,255,0.8);
    border-radius: 2rem;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.top-nav .search-bar input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.top-nav .search-bar i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Global Search Results */
#globalSearchResults {
    max-height: 250px;
    overflow-y: auto;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.search-result-item {
    padding: 1rem 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

.top-nav-menu a {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.top-nav-menu a:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Dashboard cards */
.dashboard-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-card .icon-wrapper {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.dashboard-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.dashboard-card p {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-dark);
}

/* Dashboard list/activity card */
.dashboard-list-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
}

.dashboard-list-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

.dashboard-list-item:hover {
    padding-left: 0.5rem;
}

.dashboard-list-item:last-child {
    border-bottom: none;
}

.dashboard-list-item .icon-box {
    width: 42px;
    height: 42px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Empty Cards */
.empty-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
}

.empty-card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.empty-card-header .tab-button {
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.empty-card-header .tab-button.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.empty-card-header .tab-button:not(.active) {
    background: transparent;
    color: var(--text-muted);
}
.empty-card-header .tab-button:not(.active):hover {
    background: rgba(0,0,0,0.05);
}

/* Data Tables */
.data-table-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: rgba(248, 250, 252, 0.8);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1.25rem 1rem;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

.data-table td {
    padding: 1.25rem 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: background-color 0.2s;
}

.data-table tr:hover td {
    background-color: rgba(255,255,255,0.5);
}

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

/* Forms & Buttons */
.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.form-group input, .form-group select, .form-group textarea {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    background: #fff;
}

.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.35);
}

.secondary {
    background: white;
    color: var(--text-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    transition: var(--transition);
}

.secondary:hover {
    background: #f8fafc;
    border-color: rgba(0,0,0,0.2);
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 92vh;
    overflow-y: auto;
}

/* Wider + fully scrollable student transactions modal */
#studentTransactionsModal .modal-content {
    max-width: 700px;
    width: 95%;
    text-align: left;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
}

@keyframes modalPop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Enhanced Login Page */
#loginSection {
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #312e81, #1e3a8a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#loginSection .login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

#loginSection .login-card h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 2rem;
    letter-spacing: -1px;
}

#loginSection .login-card .form-group input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 1rem 1.25rem;
}

#loginSection .login-card .form-group input::placeholder {
    color: rgba(255,255,255,0.6);
}

#loginSection .login-card .form-group input:focus {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

#loginSection .login-card .primary {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    margin-top: 1rem;
}

#loginSection .login-card .forgot-password-link {
    color: rgba(255,255,255,0.8);
    display: inline-block;
    margin-top: 1.5rem;
}
#loginSection .login-card .forgot-password-link:hover {
    color: white;
}

/* Colors for Utilities */
.bg-green-600 { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.bg-red-600 { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.bg-yellow-600 { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.text-green-600 { color: #059669; font-weight: 600; }
.text-red-600 { color: #dc2626; font-weight: 600; }

/* Mobile Sidebar Backdrop */
#sidebarBackdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 45; /* Below sidebar (50) but above main content */
    opacity: 0;
    transition: opacity 0.3s ease;
}
#sidebarBackdrop.show {
    display: block;
    opacity: 1;
}

/* =============================================
   TABLET — Icon-only Sidebar (769–1024px)
   ============================================= */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar { width: 72px; }
    .sidebar-header { padding: 0 0 1.5rem; justify-content: center; }
    .sidebar-header h2 { display: none; }
    .sidebar-header > div:first-child { margin: 0 auto; }
    .sidebar-close-btn { display: none !important; }
    .sidebar-nav-item {
        justify-content: center;
        padding: 0.9rem 0;
        margin: 0.2rem 0.5rem;
        gap: 0;
        position: relative;
    }
    .sidebar-nav-item span { display: none; }
    .sidebar-nav-item i { font-size: 1.35rem; width: auto; }
    .sidebar-nav-item::after {
        content: attr(data-label);
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%);
        background: rgba(15, 23, 42, 0.95);
        color: #f1f5f9;
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 0.8rem;
        font-weight: 600;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
        z-index: 999;
        border: 1px solid rgba(255,255,255,0.1);
    }
    .sidebar-nav-item:hover::after { opacity: 1; }
    .top-nav-menu { display: none; }
}

/* =============================================
   MOBILE (≤ 768px)
   ============================================= */
@media (max-width: 768px) {
    /* AppContainer should NOT flex-row on mobile */
    #appContainer {
        flex-direction: column !important;
        overflow-x: hidden;
        position: relative;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        padding: 1.5rem 0;
        z-index: 200;
        transform: translateX(-100%);  /* Hidden off-screen left */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0,0,0,0.5);
    }
    .sidebar.sidebar-open {
        transform: translateX(0);  /* Slides in from left */
    }
    .sidebar-header h2, .sidebar-nav-item span { display: block; }
    .sidebar-nav-item { justify-content: flex-start; padding: 0.85rem 1.5rem; gap: 1rem; }
    .sidebar-close-btn { display: flex !important; }

    .main-content { padding: 0.75rem; padding-bottom: 92px; width: 100%; min-width: 0; overflow-x: hidden; }

    .data-table-card { padding: 0.75rem; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0.75rem; }
    .data-table { min-width: 500px; }

    .dashboard-card { padding: 1rem; }
    .dashboard-card .icon-wrapper { width: 42px; height: 42px; font-size: 1.1rem; margin-bottom: 0.75rem; }
    .dashboard-card h3 { font-size: 0.875rem; }
    .dashboard-card p { font-size: 1.5rem; }

    .top-nav { padding: 0.6rem 0.75rem; margin-bottom: 0.75rem; gap: 0.5rem; top: 0.5rem; border-radius: 0.75rem; }
    .top-nav .search-bar input { font-size: 0.9rem; padding: 0.65rem 1rem 0.65rem 2.25rem; }
    .user-profile { padding: 4px !important; }
    .top-nav-menu { display: none; }

    .modal { align-items: flex-end; }
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 1.5rem 1.5rem 0 0 !important;
        margin: 0 !important;
        padding: 1.75rem 1.25rem 1.5rem;
        max-height: 93vh;
        animation: slideUpModal 0.35s cubic-bezier(0.4,0,0.2,1) !important;
    }
    @keyframes slideUpModal {
        from { transform: translateY(100%); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }

    .form-group input, .form-group select, .form-group textarea { font-size: 16px; }
    .form-buttons-group { flex-direction: column; }
    .form-buttons-group button { width: 100%; }
    .section-header h2 { font-size: 1.5rem; }
    #loginSection .login-card { padding: 2rem 1.5rem; margin: 1rem; }
    #mobileMenuBtn { display: flex !important; align-items: center; justify-content: center; }
    #attEntryPanel { width: 100% !important; max-width: 100% !important; }
}

@media (max-width: 400px) {
    .main-content { padding: 0.5rem 0.5rem 92px; }
    .top-nav { padding: 0.5rem; }
    .dashboard-card p { font-size: 1.25rem; }
}

@media (max-width: 768px) {

    
    .main-content { 
        padding: 0.75rem; 
        padding-top: 1rem;
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }
    
    /* Full width tables on mobile with horizontal scroll */
    .data-table-card {
        padding: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0.75rem;
    }

    .data-table {
        min-width: 500px; /* Minimum width before scroll kicks in */
    }

    /* Dashboard cards: 2 per row on mobile */
    .dashboard-card {
        padding: 1rem;
    }
    .dashboard-card .icon-wrapper {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    .dashboard-card h3 { font-size: 0.875rem; }
    .dashboard-card p { font-size: 1.5rem; }

    /* Top Nav adjustments */
    .top-nav {
        padding: 0.6rem 0.75rem;
        margin-bottom: 1rem;
        gap: 0.5rem;
    }
    .top-nav .search-bar { min-width: 0; }
    .user-profile .hidden { display: none !important; }

    /* Forms on mobile */
    .form-group input, .form-group select, .form-group textarea {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    /* Buttons full width on mobile forms */
    .form-buttons-group {
        flex-direction: column;
    }
    .form-buttons-group button {
        width: 100%;
    }

    /* Modal on mobile */
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    /* Show Hamburger Menu */
    #mobileMenuBtn {
        display: block !important;
    }

    /* Section headings */
    .section-header h2 { font-size: 1.5rem; }

    /* Login card on mobile */
    #loginSection .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
}

/* Extra small phones */
@media (max-width: 400px) {
    .main-content { padding: 0.5rem; }
    .top-nav { padding: 0.5rem; }
    .dashboard-card p { font-size: 1.25rem; }
}


/* Make hamburger button hidden on desktop */
#mobileMenuBtn {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}
#mobileMenuBtn:hover {
    background-color: rgba(0,0,0,0.05);
}

/* Hide default display for app container to let JS control it */
/* Hide default display for app container to let JS control it */
/* JS sets display:flex on login, style.display is controlled by JS */
/* Receipt and Print Styling */
.receipt-output-container {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }
    #receiptOutput, #receiptOutput * {
        visibility: visible;
    }
    #receiptOutput {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 148mm; /* A5 width */
        height: 210mm; /* A5 height */
        padding: 20mm;
        margin: 0;
        font-family: 'Inter', sans-serif;
        color: black;
        background: white;
    }
    .receipt-header {
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }
    .receipt-header h1 {
        font-size: 24px;
        margin: 0 0 5px 0;
    }
    .receipt-details, .receipt-student-info, .receipt-payment-info, .receipt-balance {
        margin-bottom: 15px;
        line-height: 1.5;
    }
    .receipt-student-info h3, .receipt-payment-info h3 {
        border-bottom: 1px solid #ccc;
        padding-bottom: 5px;
        margin-bottom: 10px;
        font-size: 16px;
    }
    .receipt-footer {
        margin-top: 30px;
        text-align: center;
        font-style: italic;
        font-size: 12px;
    }
    @page {
        size: A5;
        margin: 0;
    }
}

/* Phase 2: Report A4 Document & Next Level UI Enhancements */
.report-output-container {
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    max-width: 900px;
    margin: 2rem auto;
    padding: 3rem;
    color: #1f2937;
    font-family: 'Inter', sans-serif;
    border-top: 8px solid var(--primary);
    position: relative;
}

.report-header-section {
    text-align: center;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.report-header-section h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.report-header-section p {
    color: #6b7280;
    font-size: 1.1rem;
    font-weight: 500;
}

.report-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-student-details-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.report-student-details-box p {
    font-size: 0.95rem;
    color: #475569;
    display: flex;
    flex-direction: column;
}

.report-student-details-box strong {
    color: #0f172a;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.report-summary-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .report-summary-box {
        grid-template-columns: 1fr;
    }
}

.report-summary-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.report-summary-item i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.report-summary-item.pm i { color: #10b981; }
.report-summary-item.expense i { color: #ef4444; }
.report-summary-item.return i { color: #3b82f6; }

.report-summary-item .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.report-summary-item .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
}

/* Global Next Level Enhancements */
.data-table-card {
    transition: box-shadow 0.3s ease;
}

.data-table-card:hover {
    box-shadow: var(--shadow-lg);
}

.data-table tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.002);
    z-index: 10;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.form-group input, .form-group select, .form-group textarea {
    transition: all 0.2s ease;
    border: 1px solid #cbd5e1;
}

.form-group input:hover, .form-group select:hover, .form-group textarea:hover {
    border-color: #94a3b8;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: #ffffff;
    transform: translateY(-1px);
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}
/* Premium Report Styles */
.report-output-container {
    background: #fff;
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    color: #1e293b;
    max-width: 900px;
    margin: 2rem auto;
    border: 1px solid #e2e8f0;
}

.report-header-section {
    text-align: center;
    border-bottom: 2px solid #4f46e5;
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
}

.report-header-section h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #4f46e5;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.report-header-section p {
    color: #64748b;
    font-size: 1.1rem;
}

.report-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 2.5rem 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.report-section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.5rem;
    background: #4f46e5;
    border-radius: 2px;
}

.report-student-details-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
}

.report-student-details-box p {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.report-student-details-box strong {
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-summary-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.report-summary-item {
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.report-summary-item i {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 4rem;
    opacity: 0.05;
}

.report-summary-item.pm { background: #f0fdf4; border-color: #dcfce7; }
.report-summary-item.expense { background: #fef2f2; border-color: #fee2e2; }
.report-summary-item.return { background: #eff6ff; border-color: #dbeafe; }

.report-summary-item .label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
}

.report-summary-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.report-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
}

.report-table-container table {
    width: 100%;
    border-collapse: collapse;
}

.report-table-container th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.report-table-container td {
    padding: 1rem;
    font-size: 0.9rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.report-table-container tr:last-child td {
    border-bottom: none;
}

@media (max-width: 640px) {
    .report-output-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .report-summary-box {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   ATTENDANCE CARD GRID — Premium UI
   ========================================= */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
.att-std-card:hover {
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.18) !important;
    transform: translateY(-3px);
    border-color: #c7d2fe !important;
}
#attCardGrid { animation: fadeUp 0.35s ease; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   MOBILE BOTTOM NAVIGATION BAR
   ============================================= */
#mobileBottomNav { display: none; }

@media (max-width: 768px) {
    #mobileBottomNav {
        display: block;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: rgba(10, 15, 30, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255,255,255,0.07);
        z-index: 150;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .bottom-nav-items {
        display: flex;
        justify-content: space-around;
        align-items: stretch;
        padding: 5px 2px 6px;
    }
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 8px 6px;
        cursor: pointer;
        color: #475569;
        font-size: 0.58rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        border-radius: 12px;
        transition: all 0.2s ease;
        min-width: 52px;
        min-height: 50px;
        text-transform: uppercase;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        user-select: none;
    }
    .bottom-nav-item i {
        font-size: 1.2rem;
        transition: transform 0.2s ease, filter 0.2s ease;
    }
    .bottom-nav-item.active { color: #818cf8; background: rgba(99,102,241,0.12); }
    .bottom-nav-item.active i {
        transform: translateY(-2px);
        filter: drop-shadow(0 0 8px rgba(129,140,248,0.7));
    }
    .bottom-nav-item::before {
        content: '';
        position: absolute;
        top: 0; left: 50%;
        transform: translateX(-50%);
        width: 28px; height: 3px;
        background: linear-gradient(90deg, #4f46e5, #8b5cf6);
        border-radius: 0 0 4px 4px;
        opacity: 0;
        transition: opacity 0.2s;
    }
    .bottom-nav-item.active::before { opacity: 1; }
}

/* =============================================
   SIDEBAR CLOSE BUTTON (mobile only)
   ============================================= */
.sidebar-close-btn {
    display: none;
    background: rgba(255,255,255,0.08);
    border: none;
    color: #cbd5e1;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-left: auto;
    flex-shrink: 0;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,0.15); color: white; }

/* Section page header responsive */
.dashboard-header h1,
.section-header h2 {
    font-size: clamp(1.4rem, 4vw, 2rem);
}

/* Better button touch targets */
.primary, .secondary {
    min-height: 44px;
}

/* Smoother table row hover on touch */
@media (hover: none) {
    .data-table tbody tr:hover { background-color: transparent; transform: none; box-shadow: none; }
    .dashboard-card:hover { transform: none; }
}

/* =============================================
   SIDEBAR BACKDROP & CUSTOM CALENDAR
   ============================================= */
#sidebarBackdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 190;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#sidebarBackdrop.show {
    display: block;
    opacity: 1;
}

/* Custom Attendance Calendar */
.att-calendar-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}
.att-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.att-calendar-header h3 {
    margin: 0; font-size: 1.1rem; color: #1e293b; font-weight: 700;
}
.att-calendar-header button {
    background: #fff; border: 1px solid #cbd5e1; cursor: pointer; color: #475569; 
    padding: 6px 12px; border-radius: 6px; transition: 0.2s; font-weight: 500; font-size: 0.85rem;
}
.att-calendar-header button:hover { background: #f1f5f9; color: #0f172a; border-color: #94a3b8; }
.att-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #f1f5f9;
}
.att-calendar-day-header {
    text-align: center; font-size: 0.75rem; font-weight: 700; color: #64748b; padding: 12px 0; background: #fff;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.att-calendar-day {
    background: #fff; min-height: 90px; padding: 8px; display: flex; flex-direction: column; cursor: pointer; transition: 0.15s;
    position: relative;
}
.att-calendar-day:hover { background: #f8fafc; }
.att-calendar-day .date-num { font-size: 0.9rem; font-weight: 600; color: #475569; margin-bottom: 6px; display:inline-block; }
.att-calendar-day.empty { background: #fafafa; cursor: default; }
.att-calendar-day.today .date-num { 
    color: #fff; background: #4f46e5; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; 
}
.att-calendar-day.selected { border: 2px solid #4f46e5; background: #eef2ff; }
.att-status-indicator { font-size: 0.75rem; padding: 3px 6px; border-radius: 6px; margin-top: auto; text-align: center; font-weight: 600; }
.att-status-present { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.att-status-absent { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.att-status-partial { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.att-status-none { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; font-size: 0.65rem; }

@media (max-width: 768px) {
    .att-calendar-day { min-height: 70px; padding: 4px; }
    .att-calendar-day .date-num { font-size: 0.8rem; margin-bottom: 2px; }
    .att-status-indicator { font-size: 0.6rem; padding: 2px 0; }
    .att-calendar-header { padding: 12px 14px; }
    .att-calendar-header h3 { font-size: 1rem; }
}
