:root {
    /* Light Theme */
    --primary-bg: #ffffff;
    --secondary-bg: #f8fafc;
    --accent-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-indigo: #6366f1;
    --accent-teal: #14b8a6;
    --accent-rose: #f43f5e;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    /* Dark Theme */
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --accent-bg: #334155;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-light: #334155;
    --border-medium: #475569;
    --accent-blue: #60a5fa;
    --accent-emerald: #34d399;
    --accent-red: #f87171;
    --accent-amber: #fbbf24;
    --accent-purple: #a78bfa;
    --accent-indigo: #818cf8;
    --accent-teal: #2dd4bf;
    --accent-rose: #fb7185;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.2);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.2);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.2);
}

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

body {
    font-family: 'IBM Plex Sans Arabic', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

/* Layout Components */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--card-bg);
    border-left: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(100%);
}

/* Mobile sidebar visibility */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.visible {
        transform: translateX(0);
    }
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--gradient-primary);
}

.company-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
}

.company-name {
    font-size: 18px;
    font-weight: 700;
}

.company-subtitle {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 4px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 0 20px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
    font-size: 14px;
}

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

.nav-item.active {
    background: var(--secondary-bg);
    color: var(--accent-blue);
    border-right-color: var(--accent-blue);
}

.nav-item i {
    width: 20px;
    margin-left: 12px;
    font-size: 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 280px;
    transition: margin-right 0.3s ease;
    min-width: 0;
}

.main-content.expanded {
    margin-right: 0;
}

/* Header */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
}

.menu-toggle:hover {
    background: var(--secondary-bg);
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    background: var(--secondary-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--accent-blue);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--accent-bg);
}

/* Content Area */
.content-area {
    padding: 16px;
    max-width: 100%;
    margin: 0 auto;
}

/* Action Bar */
.action-bar {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    min-height: 40px;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--accent-emerald);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-purple {
    background: var(--accent-purple);
    color: white;
}

.btn-purple:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 11px;
    min-height: 32px;
}

/* Search Bar */
.search-container {
    position: relative;
    flex: 1;
    max-width: 300px;
    margin-right: auto;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    font-size: 14px;
    background: var(--secondary-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.sales { background: var(--accent-blue); }
.stat-icon.expenses { background: var(--accent-red); }
.stat-icon.salaries { background: var(--accent-purple); }
.stat-icon.suppliers { background: var(--accent-emerald); }
.stat-icon.count { background: var(--accent-teal); }
.stat-icon.profit { background: var(--accent-amber); }

.stat-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    direction: ltr;
    text-align: right;
}

/* Data Table */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.table-header {
    background: var(--secondary-bg);
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.table-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th {
    background: var(--accent-bg);
    color: var(--text-primary);
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
    vertical-align: middle;
}

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

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

.actions-cell {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    backdrop-filter: blur(4px);
    padding: 10px;
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.3s ease-out;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-control {
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 14px;
    background: var(--primary-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
    min-height: 42px;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.empty-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-text {
    color: var(--text-muted);
    font-size: 14px;
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed var(--border-medium);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    background: var(--secondary-bg);
}

.file-upload-area:hover {
    border-color: var(--accent-blue);
    background: var(--accent-bg);
}

.file-upload-area.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder i {
    font-size: 28px;
    color: var(--accent-blue);
    margin-bottom: 12px;
}

.upload-placeholder p {
    margin: 0 0 8px 0;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.upload-placeholder small {
    color: var(--text-muted);
    font-size: 11px;
}

.uploaded-files {
    margin-top: 16px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.file-icon {
    width: 28px;
    height: 28px;
    background: var(--accent-blue);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.file-icon.pdf {
    background: var(--accent-red);
}

.file-icon.doc {
    background: var(--accent-blue);
}

.file-icon.image {
    background: var(--accent-purple);
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 12px;
    margin-bottom: 2px;
    word-break: break-word;
}

.file-size {
    font-size: 10px;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-file {
    padding: 6px 8px;
    font-size: 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-download {
    background: var(--accent-emerald);
    color: white;
}

.btn-download:hover {
    background: #059669;
}

.btn-remove {
    background: var(--accent-red);
    color: white;
}

.btn-remove:hover {
    background: #dc2626;
}

.attachments-cell {
    text-align: center;
}

.attachment-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--accent-blue);
    color: white;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.attachment-count:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.attachment-count.empty {
    background: var(--text-muted);
    cursor: default;
}

.attachment-count.empty:hover {
    transform: none;
}

/* Attachments Modal */
.attachments-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1051;
    backdrop-filter: blur(4px);
    padding: 10px;
}

.attachments-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 16px;
}

.attachment-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

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

.attachment-preview {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    background: var(--accent-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.attachment-card .file-name {
    font-size: 11px;
    margin-bottom: 8px;
    word-break: break-word;
}

/* Utility Classes */
.text-success { color: var(--accent-emerald); }
.text-danger { color: var(--accent-red); }
.text-warning { color: var(--accent-amber); }
.text-info { color: var(--accent-blue); }
.fw-bold { font-weight: 600; }
.text-center { text-align: center; }
.d-none { display: none; }
.d-block { display: block; }
.mb-3 { margin-bottom: 16px; }
.mt-3 { margin-top: 16px; }
.badge { 
    padding: 4px 8px; 
    border-radius: 12px; 
    font-size: 10px; 
    font-weight: 500; 
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: var(--accent-emerald);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease-out;
    font-size: 14px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.visible {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 12px;
    }

    .search-container {
        max-width: 100%;
        margin: 8px 0;
        order: 3;
        flex-basis: 100%;
    }

    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

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

@media (max-width: 768px) {
    .content-area {
        padding: 12px;
    }

    .header {
        padding: 10px 12px;
    }

    .page-title {
        font-size: 16px;
    }

    .action-bar {
        padding: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 18px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 11px;
    }

    .actions-cell {
        flex-direction: column;
        gap: 2px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .modal-dialog {
        margin: 5px;
        width: calc(100% - 10px);
        max-height: calc(100vh - 10px);
    }

    .modal-body {
        padding: 12px;
    }

    .modal-header {
        padding: 12px;
    }

    .modal-footer {
        padding: 10px 12px;
    }

    .attachments-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .file-upload-area {
        padding: 16px;
    }

    .upload-placeholder i {
        font-size: 24px;
    }

    .upload-placeholder p {
        font-size: 13px;
    }

    .company-name {
        font-size: 16px;
    }

    .nav-item {
        padding: 10px 16px;
        font-size: 13px;
    }

    .sidebar {
        width: 260px;
    }

    .main-content {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 8px;
    }

    .action-bar {
        padding: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .modal-dialog {
        margin: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .data-table {
        min-width: 500px;
    }

    .form-control {
        min-height: 44px;
        font-size: 16px;
    }

    .btn {
        min-height: 44px;
        font-size: 14px;
    }

    .search-input {
        min-height: 44px;
        font-size: 16px;
    }

    .attachment-count {
        font-size: 9px;
        padding: 3px 6px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .header,
    .action-bar,
    .actions-cell,
    .modal,
    .attachments-modal {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
    }
    
    .content-area {
        padding: 0;
    }

    .data-table {
        min-width: auto;
    }
}

/* Scrollbar Styles */
.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Modal backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.modal-backdrop.show {
    display: block;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Touch improvements */
.btn, .nav-item, .modal-close, .theme-toggle, .menu-toggle {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
/* Content Area */
.content-area {
    padding: 20px;
    min-height: calc(100vh - 80px);
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    font-size: 18px;
    color: var(--text-secondary);
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    font-size: 18px;
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: 8px;
    margin: 20px;
}

/* Module visibility */
.module {
    display: block;
}

.module.d-none {
    display: none;
}

/* Navigation active state */
.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

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


/* Commission Status Styles */
.commission-status {
    text-align: center;
}

.commission-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.commission-badge.confirmed {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.commission-badge.confirmed:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.commission-badge.pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.commission-badge.pending:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* Checkbox Container Styles */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.form-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-medium);
    border-radius: 0.375rem;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-checkbox:checked {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Enhanced table responsiveness for new columns */
@media (max-width: 1200px) {
    .data-table th:nth-child(8),
    .data-table td:nth-child(8),
    .data-table th:nth-child(9),
    .data-table td:nth-child(9) {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .commission-badge {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .commission-badge i {
        font-size: 0.875rem;
    }
}

