/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --danger-color: #f72585;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --sidebar-width: 250px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
}

.logo-img {
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: white;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--light-gray);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background-color: #dee2e6;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #e11570;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* Sidebar Layout for Dashboard */
.sidebar-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 70px;
}

/* Responsive sidebar widths and content offset (tablet / desktop) */
@media (min-width: 720px) and (max-width: 1400px) {
    :root { --sidebar-width: 80px; }

    .sidebar {
        width: var(--sidebar-width);
    }

    /* Compact sidebar on tablet: icons-only, centered */
    .sidebar {
        width: var(--sidebar-width);
    }
    .sidebar .sidebar-menu li a {
        justify-content: center;
        padding: 10px 6px;
    }
    .sidebar .sidebar-menu li a span { display: none; }
    .sidebar .sidebar-menu li a i { font-size: 1.25rem; margin-right: 0; }

    .logo { font-size: 1.1rem; }

    .main-content {
        margin-left: var(--sidebar-width);
        padding: 24px;
    }
}

/* Small screens: allow overlay (collapsed) sidebar; content no left margin */
@media (max-width: 719px) {
    :root { --sidebar-width: 0px; }
    .sidebar {
        position: fixed;
        z-index: 1050;
        width: 72px;
        left: 0;
        top: 70px;
        bottom: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 18px;
    }
}

.sidebar {
    width: var(--sidebar-width);
    background: white;
    box-shadow: var(--box-shadow);
    position: fixed;
    left: 0;
    top: 70px;
    bottom: 0;
    overflow-y: auto;
    padding: 20px 0;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
        padding: 12px 10px;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

    

.sidebar-menu li a:hover {
    background-color: var(--light-gray);
    border-left-color: var(--primary-color);
}

.sidebar-menu li a.active {
    background-color: rgba(0, 0, 0, 0.3);
    border-left-color: white;
    color: white;
    font-weight: 500;
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 10px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-color);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab-button:hover, .tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* Activities, Actions and Enquiries Grid */
.activities-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.activities-actions-grid .card {
    margin-bottom: 0;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.action-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
}

.action-card:hover::before {
    left: -100%;
}

.action-card:hover,
.action-card:focus {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-color: #e9ecef;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    animation: fadeInUp 0.6s ease-out forwards;
    outline: none;
}

.action-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.action-add-student .action-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-upload-marks .action-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.action-fee .action-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.action-content {
    flex: 1;
    position: relative;
    z-index: 2;
}

.action-content h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #212529 !important;
}

.action-content p {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d !important;
    line-height: 1.4;
}

.action-card:hover .action-content h4 {
    color: #212529 !important;
}

/* Tablet / Large Touch styles (OnePlus Tab and similar) */
@media (min-width: 720px) and (max-width: 1400px) {
    /* Use a centered container and prevent full-width stretching */
    .container {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Increase base font size for tablet readability */
    body {
        font-size: 18px;
        line-height: 1.5;
    }

    /* Card titles and headings hierarchy */
    .card-title {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }

    /* Touch-friendly controls */
    .btn {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 1rem;
    }

    .btn-sm { min-height: 40px; padding: 8px 12px; }

    .form-control,
    input[type="text"],
    select,
    textarea {
        min-height: 46px;
        padding: 10px 12px;
        border-radius: 8px;
        font-size: 1rem;
    }

    /* Make header action area more touch friendly */
    .card-header .d-flex { gap: 12px; align-items: center; }

    /* Table improvements */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        border-collapse: collapse;
        width: 100%;
        table-layout: auto;
        background: white;
    }

    .table thead th {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 5;
        text-align: left;
        padding: 14px 12px;
        border-bottom: 1px solid var(--light-gray);
    }

    .table tbody tr {
        border-bottom: 1px solid var(--light-gray);
        min-height: 56px;
    }

    .table td {
        padding: 14px 12px;
        vertical-align: middle;
    }

    /* Improve click targets inside tables */
    .table td a, .table td button {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        padding: 8px 10px;
    }

    /* Filters: keep in one row on tablet, allow horizontal scroll if too many */
    .filters-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    .filters-row select, .filters-row input, .filters-row button {
        min-width: 140px;
    }

    /* Modal touch targets */
    .modal .modal-content {
        padding: 20px;
        min-width: 520px;
    }

    /* Slightly larger sidebar for touch navigation */
    .sidebar {
        width: 260px;
    }

    .main-content {
        margin-left: 260px;
        padding: 28px;
    }

    /* Fade-in for pages (very minimal) */
    @keyframes subtleFadeIn {
        from { opacity: 0; transform: translateY(6px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .container, .card {
        animation: subtleFadeIn 220ms ease-out both;
    }

    /* Reports page filter buttons (useful across pages) */
    .filter-buttons {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        align-items: center;
    }

    .filter-btn {
        min-height: 48px;
        padding: 10px 16px;
        font-size: 1rem;
        border-radius: 8px;
    }
}

/* Small improvements for portrait tablets (narrower width) */
@media (max-width: 719px) and (min-width: 600px) {
    body { font-size: 17px; }
    .container { padding-left: 16px; padding-right: 16px; }
    .filters-row { gap: 10px; }
}

.action-card:hover .action-content p {
    color: #6c757d !important;
}

.action-arrow {
    margin-left: 12px;
    transition: transform 0.3s ease;
    color: #adb5bd !important;
    position: relative;
    z-index: 2;
}

.action-card:hover .action-arrow {
    transform: none;
    color: #adb5bd !important;
}

/* Animation keyframes */
@keyframes actionCardPulse {
    0% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
    50% {
        box-shadow: 0 4px 16px rgba(67, 97, 238, 0.15);
    }
    100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
}

.action-card:nth-child(1) { animation-delay: 0s; }
.action-card:nth-child(2) { animation-delay: 0.1s; }
.action-card:nth-child(3) { animation-delay: 0.2s; }

/* Entrance animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.students { background: #e3f2fd; color: #1976d2; }
.stat-icon.teachers { background: #f3e5f5; color: #7b1fa2; }
.stat-icon.revenue { background: #e8f5e9; color: #388e3c; }
.stat-icon.attendance { background: #fff3e0; color: #f57c00; }

.stat-info h3 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--gray-color);
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
}

.table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    min-width: 1100px; /* Wide enough for all columns + actions */
}

.table th {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.table th:last-child,
.table td:last-child {
    padding-right: 16px; /* Ensure last column (Actions) has right padding */
}

.table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--light-gray);
    vertical-align: middle;
}

.table tr:hover {
    background-color: var(--light-gray);
}

/* Sticky column styles - Left */
.table th.sticky-col-1, .table td.sticky-col-1 {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 40px;
}
.table th.sticky-col-2, .table td.sticky-col-2 {
    position: sticky;
    left: 40px; /* Width of col 1 */
    z-index: 2;
    min-width: 120px;
}
.table th.sticky-col-3, .table td.sticky-col-3 {
    position: sticky;
    left: 160px; /* Width of col 1 + 2 */
    z-index: 2;
    min-width: 180px;
    box-shadow: 4px 0 6px -2px rgba(0,0,0,0.1);
}

/* Rightmost sticky actions column */
.table th.sticky-right,
.table td.sticky-right {
    position: sticky;
    right: 0;
    z-index: 2;
    box-shadow: -4px 0 6px -2px rgba(0,0,0,0.1);
}

/* Sticky backgrounds */
.table th.sticky-col-1, .table th.sticky-col-2, .table th.sticky-col-3, .table th.sticky-right {
    background-color: var(--primary-color);
    color: white;
    z-index: 3; /* headers above sticky body cells */
}

.table td.sticky-col-1, .table td.sticky-col-2, .table td.sticky-col-3, .table td.sticky-right {
    background-color: white;
}

.table tr:hover td.sticky-col-1, 
.table tr:hover td.sticky-col-2, 
.table tr:hover td.sticky-col-3, 
.table tr:hover td.sticky-right {
    background-color: var(--light-gray);
}

/* Ensure actions container has enough width */
.table .actions {
    display: flex;
    gap: 4px;
    white-space: nowrap;
    min-width: 80px;
    align-items: center;
}

.actions button {
    padding: 4px 6px;
    font-size: 0.9rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.actions button i {
    font-size: 1rem;
}

/* Reduce overall cell padding for compact layout */
.table th, .table td {
    padding: 8px 6px;
}

/* Expand table container to full width */
#studentsTableContainer {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}



/* Ensure spacing between action buttons */
.actions button + button {
    margin-left: 4px;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.close-alert {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--light-gray);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-header p {
    color: var(--gray-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-menu li a span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .activities-actions-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .action-card {
        padding: 16px;
    }
    
    .action-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .action-content h4 {
        font-size: 0.95rem;
    }
    
    .action-content p {
        font-size: 0.8rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table .actions {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .card {
        padding: 15px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.d-none { display: none; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-column { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.w-100 { width: 100%; }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}
/* Fee Management Specific Styles */

/* Progress bars */
.progress {
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Status badges */
.badge {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 12px;
}

.bg-success { background-color: #28a745 !important; }
.bg-danger { background-color: #dc3545 !important; }
.bg-warning { background-color: #ffc107 !important; color: #212529; }
.bg-secondary { background-color: #6c757d !important; }

/* Cards */
.card {
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,.125);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1.25rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
    background-color: transparent;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive utilities */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }
.text-warning { color: #ffc107 !important; }
.text-info { color: #17a2b8 !important; }
.text-muted { color: #6c757d !important; }

/* Alerts */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.075);
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Grid system */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
.col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-6 { flex: 0 0 50%; max-width: 50%; }

@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}

/* Page header */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.page-header h1 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Alert container */
#alertContainer {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1100;
    max-width: 400px;
}

/* Utility classes */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.gap-2 { gap: 0.5rem !important; }

/* Organized Layout Styles */

/* Step Sections */
.step-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem;
    background: white;
}

.step-title {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #4361ee;
    color: white;
    border-radius: 50%;
    margin-right: 10px;
    font-size: 14px;
}

.step-content {
    padding-left: 38px;
}

/* Student Select */
.student-select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    background: white;
}

.student-select option {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.student-select option:hover {
    background-color: #f8f9fa;
}

/* Student Info Card */
.student-info-card {
    border-left: 4px solid #4361ee !important;
}

.info-item small {
    font-size: 12px;
    color: #6c757d;
}

/* Modal Improvements */
.modal-content {
    max-width: 700px;
}

.modal-header {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-title {
    color: white;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
}

.close-modal:hover {
    opacity: 1;
}

/* Fee Status Simple */
.fee-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #f8d7da;
    color: #721c24;
}

/* Progress Bar */
.progress {
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Cards */
.student-fee-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    height: 100%;
}

.student-fee-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.student-fee-card .card-body {
    padding: 1.25rem;
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.25rem;
}

.stat-icon.revenue {
    background-color: rgba(67, 97, 238, 0.1);
    color: #4361ee;
}

.stat-icon.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stat-icon.warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.stat-icon.info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

/* Form Controls */
.form-control:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4361ee;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert Container */
#alertContainer {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1100;
    max-width: 400px;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .step-content {
        padding-left: 0;
    }
    
    .student-select {
        height: 100px;
    }
}
/* Simple fee status styling */
.fee-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #f8d7da;
    color: #721c24;
}

/* Simple table styling */
.table-sm th, .table-sm td {
    padding: 8px 12px;
    vertical-align: middle;
}

/* Loading spinner */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* Additional styles for reports page */

/* Print styles */
@media print {
    .navbar, .sidebar, .filter-card, .export-actions, .page-actions {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .results-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Chart tooltip customization */
.chartjs-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border-radius: 4px !important;
    padding: 8px !important;
}

/* DataTables customization */
.dataTables_wrapper {
    margin-top: 20px;
}

.dataTables_filter input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 10px;
}

.dataTables_length select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Responsive tables */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
        margin-bottom: 10px;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.loading-overlay.active {
    display: flex;
}

/* Success/Error messages */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Keep only the logo visible in the top bar; hide links/user menu.
   Make navbar fixed at top with a subtle semi-transparent black background. */
.navbar {
    display: block !important;
    visibility: visible !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    background: rgba(0,0,0,0.55) !important;
    backdrop-filter: blur(4px) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12) !important;
    z-index: 1100 !important;
}

.navbar .nav-links,
.navbar .user-menu {
    display: none !important;
}

.navbar .container {
    justify-content: flex-start !important;
    padding: 0 20px !important;
    align-items: center !important;
    height: 60px !important;
}

.navbar .logo { display: flex !important; align-items: center !important; }

/* Ensure other content doesn't sit under the fixed navbar */
.sidebar-layout {
    padding-top: 0 !important;
    min-height: 100vh !important;
}

.sidebar {
    top: 60px !important;
}

.main-content {
    margin-top: 60px !important;
}

/* Ensure tablet fixed sidebar rules respect the navbar height */
@media (min-width: 600px) and (max-width: 1400px) {
    .sidebar { top: 60px !important; }
    .main-content { margin-top: 60px !important; }
}
