 :root {
            --primary: #4361ee;
            --secondary: #3f37c9;
            --success: #4cc9f0;
            --info: #4895ef;
            --warning: #f72585;
            --danger: #e63946;
            --light: #f8f9fa;
            --dark: #121212;
            --bg-dark: #1e1e1e;
            --card-dark: #252525;
            --text-dark: #e1e1e1;
            --text-light: #212529;
            --sidebar-width: 250px;
            --sidebar-collapsed: 70px;
            --transition: all 0.3s ease;
        }

        .light-mode {
            --bg-color: #f5f7fb;
            --card-bg: #ffffff;
            --text-color: #212529;
            --sidebar-bg: #ffffff;
            --border-color: #dee2e6;
            --hover-color: #f8f9fa;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        }

        .dark-mode {
            --bg-color: var(--bg-dark);
            --card-bg: var(--card-dark);
            --text-color: var(--text-dark);
            --sidebar-bg: var(--dark);
            --border-color: #444;
            --hover-color: #2a2a2a;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-color);
            transition: var(--transition);
            display: flex;
            min-height: 100vh;
        }
        
        .container {
            display: flex;
            flex: 1;
            min-height: 100vh;
            width: 100%;
        }

        /* Sidebar Styles */
        .sidebar {
            width: var(--sidebar-width);
            background-color: var(--sidebar-bg);
            height: 100vh;
            position: fixed;
            left: 0;
            top: 0;
            overflow-y: auto;
            transition: var(--transition);
            box-shadow: var(--shadow);
            z-index: 1000;
            padding-top: 70px;
        }

        .sidebar.collapsed {
            width: var(--sidebar-collapsed);
        }

        .sidebar-header {
            padding: 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--border-color);
            position: fixed;
            top: 0;
            left: 0;
            width: var(--sidebar-width);
            background-color: var(--sidebar-bg);
            z-index: 1001;
            transition: var(--transition);
        }

        .sidebar.collapsed .sidebar-header {
            width: var(--sidebar-collapsed);
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            overflow: hidden;
            white-space: nowrap;
        }

        .logo-text {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
            transition: var(--transition);
        }

        .logo-icon {
            font-size: 1.8rem;
            color: var(--primary);
            min-width: 30px;
        }

        .sidebar-menu {
            padding: 20px 0;
        }

        .sidebar ul {
            list-style: none;
        }

        .sidebar li {
            margin-bottom: 5px;
        }

        .menu-item {
            padding: 12px 20px;
            display: flex;
            align-items: center;
            gap: 15px;
            text-decoration: none;
            color: var(--text-color);
            transition: var(--transition);
            border-left: 4px solid transparent;
        }

        .menu-item:hover, .menu-item.active {
            background-color: var(--hover-color);
            border-left: 4px solid var(--primary);
        }

        .menu-item i {
            width: 20px;
            text-align: center;
        }

        .menu-text {
            transition: var(--transition);
            white-space: nowrap;
        }

        .sidebar.collapsed .menu-text {
            display: none;
        }

        /* Main Content Styles */
        .main-content {
            flex: 1;
            padding: 20px;
            padding-left:80px ;
            margin-left:190px;
            transition: var(--transition);
        }

        .main-content.expanded {
            margin-left:0px;
        }

        /* Header Styles */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background-color: var(--card-bg);
            border-radius: 10px;
            margin-bottom: 20px;
            box-shadow: var(--shadow);
            position: relative;
        }

        .school-info {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .school-logo {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            object-fit: cover;
            display: none;
        }

        .school-name {
            font-weight: 600;
            font-size: 1.1rem;
            color: var(--primary);
            display: none;
        }

        .toggle-sidebar {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-color);
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 15px;
            position: relative;
        }

        .user-info {
            text-align: right;
        }

        .user-name {
            font-weight: 600;
            font-size: 0.9rem;
        }

        .user-role {
            font-size: 0.7rem;
            opacity: 0.7;
        }

        .avatar {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background-color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 1.2rem;
            cursor: pointer;
            overflow: hidden;
            border: 2px solid var(--border-color);
        }

        .avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-menu {
            position: absolute;
            top: 100%;
            right: 0;
            background-color: var(--card-bg);
            border-radius: 8px;
            box-shadow: var(--shadow);
            padding: 10px 0;
            width: 200px;
            z-index: 1000;
            display: none;
        }

        .profile-menu.show {
            display: block;
        }

        .profile-menu-item {
            padding: 10px 20px;
            display: flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            color: var(--text-color);
            transition: var(--transition);
        }

        .profile-menu-item:hover {
            background-color: var(--hover-color);
        }

        .theme-toggle {
            background: none;
            border: none;
            font-size: 1.2rem;
            cursor: pointer;
            color: var(--text-color);
            margin-right: 15px;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.5);
        }

        .modal-content {
            background-color: var(--card-bg);
            margin: 5% auto;
            padding: 20px;
            border-radius: 10px;
            box-shadow: var(--shadow);
            width: 90%;
            max-width: 500px;
            position: relative;
        }

        .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            position: absolute;
            right: 20px;
            top: 15px;
        }

        .close:hover {
            color: var(--text-color);
        }

        .modal-title {
            font-size: 1.5rem;
            margin-bottom: 20px;
            color: var(--primary);
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
        }

        .form-group input {
            width: 100%;
            padding: 10px;
            border: 1px solid var(--border-color);
            border-radius: 5px;
            background-color: var(--bg-color);
            color: var(--text-color);
        }

        .logo-upload {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .logo-preview {
            width: 80px;
            height: 80px;
            border-radius: 8px;
            border: 2px dashed var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .logo-preview img {
            max-width: 100%;
            max-height: 100%;
            display: none;
        }

        .upload-btn {
            background-color: var(--primary);
            color: white;
            padding: 8px 15px;
            border-radius: 5px;
            cursor: pointer;
            transition: var(--transition);
        }

        .upload-btn:hover {
            background-color: var(--secondary);
        }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }

        .btn {
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            border: none;
            font-weight: 600;
            transition: var(--transition);
        }

        .btn-primary {
            background-color: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background-color: var(--secondary);
        }

        .btn-secondary {
            background-color: var(--bg-color);
            color: var(--text-color);
        }

        .btn-secondary:hover {
            background-color: var(--hover-color);
        }

        /* Dashboard Cards */
        .stats-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .card {
            background-color: var(--card-bg);
            border-radius: 10px;
            padding: 20px;
            box-shadow: var(--shadow);
        }

        .stat-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .stat-icon {
            width: 60px;
            height: 60px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
        }

        .employees { background-color: rgba(67, 97, 238, 0.2); color: var(--primary); }
        .students { background-color: rgba(76, 201, 240, 0.2); color: var(--success); }
        .classes { background-color: rgba(247, 37, 133, 0.2); color: var(--warning); }
        .collected { background-color: rgba(58, 191, 140, 0.2); color: #3abf8c; }
        .pending { background-color: rgba(230, 57, 70, 0.2); color: var(--danger); }
        .expenses { background-color: rgba(255, 159, 67, 0.2); color: #ff9f43; }

        .stat-info h3 {
            font-size: 1.8rem;
            margin-bottom: 5px;
        }

        .stat-info p {
            opacity: 0.8;
            font-size: 0.9rem;
        }

        /* Charts Section */
        .charts {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 20px;
            margin-bottom: 30px;
        }

        .chart-container {
            background-color: var(--card-bg);
            border-radius: 10px;
            padding: 20px;
            box-shadow: var(--shadow);
            position: relative;
            height: 350px;
            width: 100%;
        }

        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .chart-title {
            font-size: 1.2rem;
            font-weight: 600;
        }

        .chart-actions button {
            background: none;
            border: none;
            color: var(--text-color);
            cursor: pointer;
            margin-left: 10px;
        }

        canvas {
            width: 100% !important;
            height: 100% !important;
        }

        /* Class Filter */
        .class-filter {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
        }

        .class-filter select {
            background-color: var(--bg-color);
            color: var(--text-color);
            border: 1px solid var(--border-color);
            padding: 8px 12px;
            border-radius: 5px;
            outline: none;
        }

        /* Loading Animation */
        .stat-card.loading .stat-info h3 {
            color: transparent;
            background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            border-radius: 4px;
            min-width: 60px;
        }
        
        .dark-mode .stat-card.loading .stat-info h3 {
            background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
            background-size: 200% 100%;
        }
        
        @keyframes loading {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        /* Notification */
        .notification {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 15px 20px;
            border-radius: 5px;
            color: white;
            z-index: 10000;
            font-weight: 500;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        
        .notification.error {
            background: #e63946;
        }
        
        .notification.warning {
            background: #ff9f43;
        }
        
        .notification.success {
            background: #3abf8c;
        }

        /* Responsive */
        @media (max-width: 992px) {
            .charts {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .sidebar {
                width: var(--sidebar-collapsed);
                transform: translateX(-100%);
                left: -100%;
                position: fixed;
            }
            .sidebar.show {
                transform: translateX(100%);
                left: 0;
            }
            .sidebar .menu-text {
                display: none;
            }
            .main-content {
                margin-left: 0;
                width: 100%;
                padding: 10px;
            }
            
            .school-info {
                position: static;
                transform: none;
                margin: 0 auto;
                justify-content: center;
                width: 100%;
                order: 3;
                margin-top: 10px;
            }
            
            .header {
                flex-wrap: wrap;
            }
        }

        @media (max-width: 576px) {
            .header {
                flex-direction: column;
                gap: 15px;
            }
            .user-profile {
                width: 100%;
                justify-content: center;
            }
            .stats-cards {
                grid-template-columns: 1fr;
            }
            
            .modal-content {
                width: 95%;
                margin: 10% auto;
            }
        }
         /* Additional styles for the new charts */
        .chart-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 20px;
        }

        @media (max-width: 992px) {
            .chart-grid {
                grid-template-columns: 1fr;
            }
        }

        .chart-container {
            background: var(--card-bg);
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            padding: 20px;
            height: 400px;
            position: relative;
        }

        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .chart-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-color);
        }

        .chart-actions button {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            margin-left: 10px;
            font-size: 0.9rem;
        }

        .chart-actions button:hover {
            color: var(--primary-color);
        }

        .chart-canvas-container {
            position: relative;
            height: calc(100% - 40px);
            width: 100%;
        }

        .stats-cards {
            grid-template-columns: repeat(5, 1fr);
        }

        @media (max-width: 1200px) {
            .stats-cards {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (max-width: 768px) {
            .stats-cards {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 480px) {
            .stats-cards {
                grid-template-columns: 1fr;
            }
        }

        /* New styles for the monthly fee trend chart */
        .monthly-trend-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .class-select-container {
            flex: 1;
            margin-right: 15px;
        }

        .class-select-container label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
            color: var(--text-color);
        }

        .class-select {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background-color: var(--card-bg);
            color: var(--text-color);
            font-size: 0.9rem;
        }

        /* Currency Selector Styles */
        .currency-selector {
            display: flex;
            align-items: center;
            margin-right: 20px;
            gap: 8px;
        }

        .currency-label {
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-color);
            white-space: nowrap;
            position: relative;
            top: 14pc;
            left: 16pc;
        }

        .currency-select {
            padding: 8px 12px;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background-color: var(--card-bg);
            color: var(--text-color);
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 80px;
            position: relative;
            top: 14pc;
            left:16pc;
        }

        .currency-select:hover {
            border-color: var(--primary-color);
        }

        .currency-select:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(58, 191, 140, 0.1);
        }

        /* Update header to accommodate currency selector */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            height: 70px;
            background: var(--card-bg);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        /* Archive/Backup System Styles */
        .archive-container {
            background: var(--card-bg);
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            padding: 20px;
            margin-bottom: 20px;
        }

        .archive-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .archive-title {
            font-size: 1.4rem;
            font-weight: 600;
            color: var(--text-color);
        }

        .archive-controls {
            display: flex;
            gap: 10px;
        }

        .archive-year-select,
        .archive-month-select {
            padding: 8px 12px;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background-color: var(--card-bg);
            color: var(--text-color);
        }

        .archive-actions {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }

        .archive-action-card {
            background: var(--card-bg);
            border-radius: 8px;
            padding: 15px;
            text-align: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            transition: transform 0.2s, box-shadow 0.2s;
            cursor: pointer;
            border: 1px solid var(--border-color);
        }

        .archive-action-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .archive-action-icon {
            font-size: 2rem;
            margin-bottom: 10px;
            color: var(--primary-color);
        }

        .archive-action-text {
            font-weight: 500;
            color: var(--text-color);
        }

        .archive-list {
            margin-top: 30px;
        }

        .archive-list-title {
            font-size: 1.2rem;
            margin-bottom: 15px;
            color: var(--text-color);
        }

        .archive-table {
            width: 100%;
            border-collapse: collapse;
        }

        .archive-table th,
        .archive-table td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid var(--border-color);
        }

        .archive-table th {
            background-color: var(--table-header-bg);
            font-weight: 600;
        }

        .archive-table tr:hover {
            background-color: var(--table-hover-bg);
        }

        .archive-status {
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 500;
        }

        .status-completed {
            background-color: rgba(76, 175, 80, 0.15);
            color: #4CAF50;
        }

        .status-pending {
            background-color: rgba(255, 152, 0, 0.15);
            color: #FF9800;
        }

        .archive-action-btn {
            padding: 6px 12px;
            border: none;
            border-radius: 4px;
            background-color: var(--primary-color);
            color: white;
            cursor: pointer;
            font-size: 0.85rem;
            margin-right: 5px;
        }

        .archive-action-btn:hover {
            opacity: 0.9;
        }

        .btn-secondary {
            background-color: #6c757d;
        }

        /* Modal styles for archive generation */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
        }

        .modal-content {
            background-color: var(--card-bg);
            margin: 5% auto;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            width: 90%;
            max-width: 600px;
            position: relative;
        }

        .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
        }

        .close:hover {
            color: var(--text-color);
        }

        .modal-title {
            margin-top: 0;
            margin-bottom: 20px;
            color: var(--text-color);
        }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }

        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
        }

        .btn-primary {
            background-color: blue;
            color: white;
        }

        .progress-bar {
            height: 10px;
            background-color: #f0f0f0;
            border-radius: 5px;
            margin: 15px 0;
            overflow: hidden;
        }

        .progress {
            height: 100%;
            background-color: var(--primary-color);
            width: 0%;
            transition: width 0.3s;
        }

        .generation-status {
            text-align: center;
            margin: 15px 0;
            font-style: italic;
            color: var(--text-muted);
        }

        @media (max-width: 768px) {

            .header-left,
            .header-right {
                flex-wrap: wrap;
                gap: 10px;
            }

            .currency-selector {
                margin-right: 10px;
            }

            .currency-label {
                display: none;
                /* Hide label on mobile */
            }
        }