/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
}

/* Login Styles */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.school-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.school-logo h1 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.school-logo p {
    color: #7f8c8d;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.input-group input {
    width: 100%;
    padding: 12px 40px;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.login-btn:hover {
    background: #2980b9;
}

.forgot-password {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: #7f8c8d;
    text-decoration: none;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Mobile Menu and Top Navigation */
.top-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 999;
    align-items: center;
    gap: 1rem;
}

.site-title {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 0;
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #2c3e50;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.close-mobile-menu {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    padding: 1.5rem;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.admin-name {
    font-size: 0.9rem;
    color: #95a5a6;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    color: #ecf0f1;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.sidebar-menu a i {
    margin-right: 10px;
    width: 20px;
}

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    background: rgba(255,255,255,0.1);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Top Bar Styles */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.search-bar input {
    width: 100%;
    padding: 10px 40px;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    font-size: 0.9rem;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notifications {
    position: relative;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 10px;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-profile i {
    font-size: 2rem;
    color: #2c3e50;
}

.admin-profile span {
    color: #2c3e50;
    font-weight: 500;
}

/* Stats Grid Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 1.5rem;
}

.stat-details h3 {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.3rem;
}

.stat-details p {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Table Styles */
.table-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f1f1;
}

.new-invoice-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    padding-top: 8px; /* Space for top scrollbar */
}

/* Create a wrapper for double scrollbars */
.table-responsive::before {
    content: "";
    display: block;
    height: 8px;
    background: transparent;
    margin-bottom: -8px;
    overflow-x: auto;
    visibility: hidden;
}

.table-responsive:hover::before {
    visibility: visible;
}

/* Style the scrollbars for modern browsers */
.table-responsive::-webkit-scrollbar,
.table-responsive::before::-webkit-scrollbar {
    height: 8px;
    background-color: #f1f1f1;
}

.table-responsive::-webkit-scrollbar-thumb,
.table-responsive::before::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-track,
.table-responsive::before::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 4px;
}

/* Firefox scrollbar styles */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Ensure the table takes full width */
table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    margin-bottom: 8px; /* Space for bottom scrollbar */
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #f1f1f1;
}

td {
    font-size: 0.9rem;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.status-paid,
.status-partial,
.status-pending,
.status-overpaid {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.status-paid {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-partial {
    background: #fff3e0;
    color: #f57c00;
}

.status-pending {
    background: #fce4ec;
    color: #c2185b;
}

.status-overpaid {
    background: #e3f2fd;
    color: #1976d2;
}

.action-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 5px;
    margin-right: 5px;
}

.action-btn:hover {
    color: #2980b9;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .top-nav {
        display: flex;
    }

    .mobile-menu-toggle {
        display: block;
    }

    body.menu-open {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding-top: 4rem;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    .sidebar.mobile-active {
        transform: translateX(0);
    }

    .close-mobile-menu {
        display: block;
    }

    .main-content {
        padding-top: 5rem;
    }

    /* Overlay when menu is open */
    body.menu-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }

    .sidebar.mobile-active {
        transform: translateX(0);
        z-index: 999;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    .stat-card {
        padding: 1rem;
        gap: 0.75rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon i {
        font-size: 1.2rem;
    }

    .stat-details h3 {
        font-size: 0.8rem;
    }

    .stat-details p {
        font-size: 1.2rem;
    }

    .search-bar {
        width: 100%;
        max-width: 200px;
    }

    .top-bar {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .table-responsive {
        margin: 0 -1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.75rem 1rem;
    }

    .action-btn {
        padding: 3px;
    }

    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .new-invoice-btn {
        width: 100%;
        justify-content: center;
    }

    .admin-profile span {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        margin: 0 0.5rem;
    }

    .stat-card {
        border-radius: 8px;
        margin-bottom: 0;
    }

    .table-card {
        border-radius: 0;
        margin: 0 -1rem;
    }

    .search-bar {
        width: 100%;
        max-width: none;
    }

    .top-bar-right {
        width: 100%;
        justify-content: space-between;
    }
} 