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

:root {
    /* Dark Theme Colors - مطابق للصور */
    --bg-primary: #1A1A1A;
    --bg-secondary: #242424;
    --bg-tertiary: #2D2D2D;
    --bg-card: #2A2A2A;
    --bg-sidebar: #1E1E1E;
    
    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    
    /* Accent Colors - Orange */
    --accent-orange: #FF8C00;
    --accent-orange-light: #FFA500;
    --accent-orange-dark: #FF7700;
    
    /* Primary Color (for organization theme) */
    --primary: #2563EB;
    --primary-light: rgba(37, 99, 235, 0.08);
    --primary-dark: #1E40AF;
    
    /* Status Colors */
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    
    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-light: rgba(255, 255, 255, 0.05);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.grid {
    display: grid;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.hidden { display: none; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-primary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid var(--text-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input:hover {
    border-color: var(--border-color);
}

/* Layout */
.dashboard-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Sidebar - Dark Theme */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    border-left: 1px solid var(--border-color);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sidebar-logo h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-welcome {
    margin-bottom: 1.5rem;
}

.sidebar-welcome .welcome-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.sidebar-welcome .welcome-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-stats {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.sidebar-stats .stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.sidebar-stats .stats-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: var(--bg-sidebar);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--bg-card);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
}

.nav-item i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--text-primary);
}

.nav-item.active i {
    color: var(--text-primary);
}

/* Collapsible navigation */
.nav-item-collapsible {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-size: 1rem;
}

.nav-item-collapsible:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-submenu {
    margin-right: 0.5rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-subitem:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-subitem.active {
    background: rgba(255, 140, 0, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.nav-subitem i {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 1rem;
    opacity: 0.5;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-info .user-email {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-info .user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sidebar-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
}

.sidebar-logout:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.sidebar-help {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--primary);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.sidebar-help:hover {
    background: var(--bg-card);
}

.sidebar-collapse {
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.sidebar-collapse:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Top Bar - Dark Theme */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.topbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-search {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.topbar-search input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s;
}

.topbar-search input::placeholder {
    color: var(--text-tertiary);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.topbar-search i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.topbar-icon {
    position: relative;
    padding: 0.625rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.125rem;
}

.topbar-icon:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.topbar-icon .notification-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-user-menu {
    position: relative;
}

.topbar-user {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
    background: transparent;
    padding: 0;
}

.topbar-user:hover {
    border-color: var(--primary);
}

.topbar-user img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* User Dropdown Menu */
.topbar-user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 250px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    overflow: hidden;
    padding: 0.5rem;
}

.topbar-user-dropdown.show {
    display: block;
    animation: fadeInDropdown 0.2s ease-out;
}

/* Quick Actions Dropdown */
.topbar-quick-actions {
    position: relative;
}

.topbar-quick-actions-btn {
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: inherit;
}

.topbar-quick-actions-btn span {
    display: none;
}

.topbar-quick-actions-btn .fa-chevron-down {
    display: none;
}

.topbar-quick-actions-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.topbar-quick-actions-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.topbar-quick-actions-dropdown.show {
    display: block;
    animation: fadeInDropdown 0.2s ease-out;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.topbar-quick-actions-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.topbar-quick-actions-dropdown.show .topbar-quick-actions-dropdown-item {
    opacity: 0;
    transform: translateX(-10px);
    animation: slideInItem 0.25s ease-out forwards;
}

@keyframes slideInItem {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.topbar-quick-actions-dropdown.show .topbar-quick-actions-dropdown-item:nth-child(1) {
    animation-delay: 0.05s;
}

.topbar-quick-actions-dropdown.show .topbar-quick-actions-dropdown-item:nth-child(2) {
    animation-delay: 0.1s;
}

.topbar-quick-actions-dropdown.show .topbar-quick-actions-dropdown-item:nth-child(3) {
    animation-delay: 0.15s;
}

.topbar-quick-actions-dropdown.show .topbar-quick-actions-dropdown-item:nth-child(4) {
    animation-delay: 0.2s;
}

.topbar-quick-actions-dropdown.show .topbar-quick-actions-dropdown-item:nth-child(5) {
    animation-delay: 0.25s;
}

.topbar-quick-actions-dropdown-item:last-child {
    border-bottom: none;
}

.topbar-quick-actions-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.topbar-quick-actions-dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.topbar-quick-actions-dropdown-item:hover i {
    color: var(--primary);
}

.topbar-quick-actions-dropdown-item.primary {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 600;
}

.topbar-quick-actions-dropdown-item.primary:hover {
    background: linear-gradient(to right, var(--primary-dark), var(--primary));
}

.topbar-quick-actions-dropdown-item.primary i {
    color: white;
}

/* General Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    overflow-y: auto;
    animation: fadeInModal 0.3s ease-out;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-card);
    border-radius: 1.25rem;
    padding: 0;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 2rem auto;
    animation: slideUpModal 0.3s ease-out;
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
}

.modal-close {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--error);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    background: var(--bg-card);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* Enhanced Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
    opacity: 0.6;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-group small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* Enhanced Checkbox Styles */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 4px;
    transition: all 0.2s ease;
}

input[type="checkbox"]:hover {
    transform: scale(1.1);
}

/* Enhanced Button Styles in Modal */
.modal-footer .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.modal-footer .btn-outline {
    border: 2px solid var(--border-color);
}

.modal-footer .btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

/* Quick Payment Modal */
.quick-payment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.quick-payment-modal.show {
    display: flex;
    animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.quick-payment-modal-content {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: slideUpModal 0.3s ease-out;
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.quick-payment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.quick-payment-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-payment-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-payment-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.quick-payment-form-group {
    margin-bottom: 1.25rem;
    overflow: visible;
}

.quick-payment-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.quick-payment-form-group input,
.quick-payment-form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.quick-payment-form-group input:focus,
.quick-payment-form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.quick-payment-form-group input::placeholder {
    color: var(--text-tertiary);
}

.quick-payment-student-search {
    position: relative;
    z-index: 1;
}

.quick-payment-student-results {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10001;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-top: 0.25rem;
}

.quick-payment-student-results.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
}

.quick-payment-student-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quick-payment-student-item:hover {
    background: var(--bg-tertiary);
}

.quick-payment-student-item:last-child {
    border-bottom: none;
}

.quick-payment-student-item:last-child {
    border-bottom: none;
}

.quick-payment-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.quick-payment-modal-actions button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 1rem;
}

.quick-payment-modal-actions .btn-primary {
    background: var(--primary);
    color: white;
}

.quick-payment-modal-actions .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.quick-payment-modal-actions .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.quick-payment-modal-actions .btn-secondary:hover {
    background: var(--bg-card);
}

.quick-payment-modal-actions .btn-primary.disabled,
.quick-payment-modal-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Payment Form Fields Animation */
.quick-payment-form-group {
    opacity: 0;
    transform: translateY(20px);
    max-height: 0;
    overflow: visible;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, max-height 0.4s ease-out, margin 0.4s ease-out, padding 0.4s ease-out;
    margin-bottom: 0;
    padding: 0;
}

.quick-payment-form-group.show {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
    margin-bottom: 1.25rem;
    padding: 0;
}

.quick-payment-form-group:first-child {
    opacity: 1;
    transform: translateY(0);
    max-height: none;
    margin-bottom: 1.25rem;
    padding: 0;
}

.quick-payment-form-group.show:nth-child(2) {
    animation-delay: 0.1s;
}

.quick-payment-form-group.show:nth-child(3) {
    animation-delay: 0.2s;
}

.quick-payment-form-group.show:nth-child(4) {
    animation-delay: 0.3s;
}

.quick-payment-form-group.show:nth-child(5) {
    animation-delay: 0.4s;
}

.quick-payment-form-group.show:nth-child(6) {
    animation-delay: 0.5s;
}

.quick-payment-form-group.show:nth-child(7) {
    animation-delay: 0.6s;
}

.quick-payment-form-group.show:nth-child(8) {
    animation-delay: 0.7s;
}

.quick-payment-form-group.show:nth-child(9) {
    animation-delay: 0.8s;
}

#payment-info-card {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

#payment-info-card.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-primary);
}

.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: var(--bg-card);
}

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

.content-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.content-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.stat-card.orange {
    background: var(--accent-orange);
    border-color: var(--primary);
}

.stat-card.orange .stat-value,
.stat-card.orange .stat-title {
    color: var(--text-primary);
}

.stat-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
}

.stat-info h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-info .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-info .stat-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.5rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 140, 0, 0.2);
    color: var(--primary);
    font-size: 1.5rem;
}

.stat-card.orange .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.stat-card .stat-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.table thead {
    background: var(--bg-tertiary);
}

.table th {
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.table tbody tr {
    transition: all 0.2s;
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

.table-action-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.table-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-tertiary);
    font-size: 3rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.toggle-switch.active {
    background: var(--accent-orange);
    border-color: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text-primary);
    top: 2px;
    right: 2px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    right: 24px;
}

.toggle-switch.active::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 1;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg-primary);
}

.login-left {
    flex: 1;
    display: flex; /* Always show on mobile */
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-secondary);
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .login-left {
        min-height: auto;
    }
}

.login-right {
    flex: 1;
    display: none; /* Hidden on mobile by default */
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 3rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@media (min-width: 1024px) {
    .login-right {
        display: flex; /* Show on desktop */
    }
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

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

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: var(--accent-orange);
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.login-logo-icon i {
    font-size: 2rem;
    color: var(--text-primary);
}

/* Responsive - Mobile First */
@media (max-width: 768px) {
    /* Login Page Mobile */
    .login-page {
        flex-direction: column;
    }
    
    .login-page {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .login-left {
        padding: 1rem;
        padding-top: 2rem;
        padding-bottom: 2rem;
        min-height: 100vh;
        justify-content: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }
    
    .login-right {
        display: none; /* Hide on mobile */
    }
    
    .login-card {
        padding: 1.5rem;
        max-width: 100%;
        margin: 0 auto;
        border-radius: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .login-logo {
        margin-bottom: 1.5rem;
    }
    
    .login-logo h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .login-logo p {
        font-size: 0.875rem;
        margin-bottom: 0;
    }
    
    .login-logo img {
        max-height: 70px !important;
        max-width: 180px !important;
        margin-bottom: 1rem !important;
    }
    
    .login-logo-icon {
        width: 56px;
        height: 56px;
    }
    
    .login-logo-icon i {
        font-size: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Dashboard Mobile */
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        right: -280px;
        z-index: 1000;
        transition: right 0.3s;
        height: 100vh;
        width: 280px;
    }
    
    .sidebar.open {
        right: 0;
    }
    
    .main-content {
        width: 100%;
        margin-right: 0;
    }
    
    .topbar {
        padding: 0.75rem 1rem;
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .topbar-title {
        font-size: 1.25rem;
    }
    
    .topbar-search {
        width: 100%;
        max-width: 100%;
        order: 3;
    }
    
    .topbar-search input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.625rem 2.5rem 0.625rem 0.75rem;
    }
    
    .topbar-actions {
        gap: 0.5rem;
    }
    
    .topbar-icon {
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-card h3 {
        font-size: 1.125rem;
    }
    
    .stats-card .stats-value {
        font-size: 1.75rem;
    }
    
    /* Cards Grid Mobile */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Tables Mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
        font-size: 0.875rem;
    }
    
    /* Buttons Mobile */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .btn-block {
        width: 100%;
    }
    
    /* Modal Mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Quick Actions Mobile */
    .topbar-quick-actions-dropdown {
        left: auto;
        right: 0;
        min-width: 200px;
    }
    
    /* Sidebar Toggle Button */
    .sidebar-toggle-btn {
        display: block !important;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 1001;
        width: 44px;
        height: 44px;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        cursor: pointer;
        box-shadow: var(--shadow-md);
    }
    
    .sidebar-toggle-btn:hover {
        background: var(--primary-dark);
    }
    
    /* Sidebar Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Extra Small Devices (Phones, < 480px) */
@media (max-width: 480px) {
    .login-page {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
    }
    
    .login-left {
        padding: 0.75rem !important;
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
        min-height: 100vh;
        justify-content: flex-start;
    }
    
    .login-right {
        display: none;
    }
    
    .login-card {
        padding: 1.25rem !important;
        margin: 0 auto;
        width: 100%;
        box-sizing: border-box;
    }
    
    .login-logo {
        margin-bottom: 1.25rem;
    }
    
    .login-logo h1 {
        font-size: 1.25rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .login-logo p {
        font-size: 0.8125rem;
    }
    
    .login-logo img {
        max-height: 60px !important;
        max-width: 150px !important;
        margin-bottom: 0.75rem !important;
    }
    
    .form-group {
        margin-bottom: 0.875rem;
    }
    
    .form-input {
        padding: 0.625rem;
        font-size: 16px;
    }
    
    .topbar {
        padding: 0.5rem 0.75rem;
        min-height: 56px;
    }
    
    .topbar-title {
        font-size: 1.125rem;
    }
    
    .content-area {
        padding: 0.75rem;
    }
    
    .stats-card {
        padding: 0.75rem;
    }
    
    .stats-card h3 {
        font-size: 1rem;
    }
    
    .stats-card .stats-value {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .sidebar-toggle-btn {
        width: 40px;
        height: 40px;
        top: 0.75rem;
        right: 0.75rem;
        font-size: 1.125rem;
    }
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

    border: 1px solid var(--border-color);
}

.quick-payment-modal-actions .btn-secondary:hover {
    background: var(--bg-card);
}

.quick-payment-modal-actions .btn-primary.disabled,
.quick-payment-modal-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Payment Form Fields Animation */
.quick-payment-form-group {
    opacity: 0;
    transform: translateY(20px);
    max-height: 0;
    overflow: visible;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, max-height 0.4s ease-out, margin 0.4s ease-out, padding 0.4s ease-out;
    margin-bottom: 0;
    padding: 0;
}

.quick-payment-form-group.show {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
    margin-bottom: 1.25rem;
    padding: 0;
}

.quick-payment-form-group:first-child {
    opacity: 1;
    transform: translateY(0);
    max-height: none;
    margin-bottom: 1.25rem;
    padding: 0;
}

.quick-payment-form-group.show:nth-child(2) {
    animation-delay: 0.1s;
}

.quick-payment-form-group.show:nth-child(3) {
    animation-delay: 0.2s;
}

.quick-payment-form-group.show:nth-child(4) {
    animation-delay: 0.3s;
}

.quick-payment-form-group.show:nth-child(5) {
    animation-delay: 0.4s;
}

.quick-payment-form-group.show:nth-child(6) {
    animation-delay: 0.5s;
}

.quick-payment-form-group.show:nth-child(7) {
    animation-delay: 0.6s;
}

.quick-payment-form-group.show:nth-child(8) {
    animation-delay: 0.7s;
}

.quick-payment-form-group.show:nth-child(9) {
    animation-delay: 0.8s;
}

#payment-info-card {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

#payment-info-card.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-primary);
}

.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: var(--bg-card);
}

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

.content-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.content-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.stat-card.orange {
    background: var(--accent-orange);
    border-color: var(--primary);
}

.stat-card.orange .stat-value,
.stat-card.orange .stat-title {
    color: var(--text-primary);
}

.stat-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
}

.stat-info h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-info .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-info .stat-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.5rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 140, 0, 0.2);
    color: var(--primary);
    font-size: 1.5rem;
}

.stat-card.orange .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.stat-card .stat-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.table thead {
    background: var(--bg-tertiary);
}

.table th {
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.table tbody tr {
    transition: all 0.2s;
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

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

.table-action-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.table-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-tertiary);
    font-size: 3rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.toggle-switch.active {
    background: var(--accent-orange);
    border-color: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text-primary);
    top: 2px;
    right: 2px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    right: 24px;
}

.toggle-switch.active::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 1;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg-primary);
}

.login-left {
    flex: 1;
    display: flex; /* Always show on mobile */
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-secondary);
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .login-left {
        min-height: auto;
    }
}

.login-right {
    flex: 1;
    display: none; /* Hidden on mobile by default */
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 3rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@media (min-width: 1024px) {
    .login-right {
        display: flex; /* Show on desktop */
    }
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

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

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: var(--accent-orange);
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.login-logo-icon i {
    font-size: 2rem;
    color: var(--text-primary);
}

/* Responsive - Mobile First */
@media (max-width: 768px) {
    /* Login Page Mobile */
    .login-page {
        flex-direction: column;
    }
    
    .login-page {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .login-left {
        padding: 1rem;
        padding-top: 2rem;
        padding-bottom: 2rem;
        min-height: 100vh;
        justify-content: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }
    
    .login-right {
        display: none; /* Hide on mobile */
    }
    
    .login-card {
        padding: 1.5rem;
        max-width: 100%;
        margin: 0 auto;
        border-radius: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .login-logo {
        margin-bottom: 1.5rem;
    }
    
    .login-logo h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .login-logo p {
        font-size: 0.875rem;
        margin-bottom: 0;
    }
    
    .login-logo img {
        max-height: 70px !important;
        max-width: 180px !important;
        margin-bottom: 1rem !important;
    }
    
    .login-logo-icon {
        width: 56px;
        height: 56px;
    }
    
    .login-logo-icon i {
        font-size: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Dashboard Mobile */
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        right: -280px;
        z-index: 1000;
        transition: right 0.3s;
        height: 100vh;
        width: 280px;
    }
    
    .sidebar.open {
        right: 0;
    }
    
    .main-content {
        width: 100%;
        margin-right: 0;
    }
    
    .topbar {
        padding: 0.75rem 1rem;
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .topbar-title {
        font-size: 1.25rem;
    }
    
    .topbar-search {
        width: 100%;
        max-width: 100%;
        order: 3;
    }
    
    .topbar-search input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.625rem 2.5rem 0.625rem 0.75rem;
    }
    
    .topbar-actions {
        gap: 0.5rem;
    }
    
    .topbar-icon {
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-card h3 {
        font-size: 1.125rem;
    }
    
    .stats-card .stats-value {
        font-size: 1.75rem;
    }
    
    /* Cards Grid Mobile */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Tables Mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
        font-size: 0.875rem;
    }
    
    /* Buttons Mobile */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .btn-block {
        width: 100%;
    }
    
    /* Modal Mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Quick Actions Mobile */
    .topbar-quick-actions-dropdown {
        left: auto;
        right: 0;
        min-width: 200px;
    }
    
    /* Sidebar Toggle Button */
    .sidebar-toggle-btn {
        display: block !important;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 1001;
        width: 44px;
        height: 44px;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        cursor: pointer;
        box-shadow: var(--shadow-md);
    }
    
    .sidebar-toggle-btn:hover {
        background: var(--primary-dark);
    }
    
    /* Sidebar Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Extra Small Devices (Phones, < 480px) */
@media (max-width: 480px) {
    .login-page {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
    }
    
    .login-left {
        padding: 0.75rem !important;
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
        min-height: 100vh;
        justify-content: flex-start;
    }
    
    .login-right {
        display: none;
    }
    
    .login-card {
        padding: 1.25rem !important;
        margin: 0 auto;
        width: 100%;
        box-sizing: border-box;
    }
    
    .login-logo {
        margin-bottom: 1.25rem;
    }
    
    .login-logo h1 {
        font-size: 1.25rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .login-logo p {
        font-size: 0.8125rem;
    }
    
    .login-logo img {
        max-height: 60px !important;
        max-width: 150px !important;
        margin-bottom: 0.75rem !important;
    }
    
    .form-group {
        margin-bottom: 0.875rem;
    }
    
    .form-input {
        padding: 0.625rem;
        font-size: 16px;
    }
    
    .topbar {
        padding: 0.5rem 0.75rem;
        min-height: 56px;
    }
    
    .topbar-title {
        font-size: 1.125rem;
    }
    
    .content-area {
        padding: 0.75rem;
    }
    
    .stats-card {
        padding: 0.75rem;
    }
    
    .stats-card h3 {
        font-size: 1rem;
    }
    
    .stats-card .stats-value {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .sidebar-toggle-btn {
        width: 40px;
        height: 40px;
        top: 0.75rem;
        right: 0.75rem;
        font-size: 1.125rem;
    }
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}