/* ===================================
   Global Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px 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);
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* ===================================
   Sidebar Styles
   =================================== */
.sidebar {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    left: 0;
    top: 0;
    transition: transform 0.3s ease, width 0.3s ease;
}

/* Sidebar collapsed state */
.sidebar.collapsed {
    transform: translateX(-100%);
}

@media (min-width: 769px) {
    .sidebar.collapsed {
        transform: translateX(0);
        width: 70px;
        min-width: 70px;
        max-width: 70px;
    }
    
    .sidebar.collapsed .nav-item span:not(.nav-icon) {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
    }
    
    .sidebar.collapsed .nav-item {
        justify-content: center;
        padding: 12px 10px;
    }
    
    .sidebar.collapsed .submenu-item {
        display: none;
    }
    
    .sidebar.collapsed .submenu-container {
        display: none !important;
    }
    
    .sidebar.collapsed .menu-chevron {
        display: none;
    }
    
    /* On desktop: Show sidebar toggle when sidebar is visible */
    .menu-toggle {
        display: flex !important;
    }
    
    /* Hide header toggle on desktop by default (will be shown by JavaScript when sidebar is collapsed) */
    .header-toggle {
        display: none !important;
    }
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header > div {
    flex: 1;
    min-width: 0;
}

.sidebar-header h1,
.sidebar-header p {
    transition: opacity 0.2s, visibility 0.2s;
    white-space: nowrap;
    margin: 0;
}

.sidebar-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar.collapsed .sidebar-header > div {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .menu-toggle {
    margin: 0 auto;
}

.sidebar-nav {
    padding: 20px 0;
    flex: 1;
}

.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.user-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.logout-btn {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    text-align: left !important;
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.8) !important;
    cursor: pointer !important;
    padding: 12px 20px !important;
    margin: 0 !important;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-icon {
    margin-right: 12px;
    font-size: 20px;
    display: inline-block;
    width: 24px;
    text-align: center;
}

/* Menu Icons via CSS */
.nav-item-home .nav-icon::before {
    content: '🏠';
}

.nav-item-projects .nav-icon::before {
    content: '🏗️';
}

.nav-item-amount-entries .nav-icon::before {
    content: '💵';
}

.nav-item-reports .nav-icon::before {
    content: '📈';
}

.nav-item-accounts .nav-icon::before {
    content: '💰';
}

.nav-item-users .nav-icon::before {
    content: '👤';
}

.nav-item-chat .nav-icon::before {
    content: '💬';
}

.nav-item-menu-assignment .nav-icon::before {
    content: '📋';
}

.nav-item-amount-issue .nav-icon::before {
    content: '💸';
}

.nav-item-dashboard .nav-icon::before {
    content: '📊';
}

/* Sidebar Header Icon */
.sidebar-header .header-icon::before {
    content: '📊';
    margin-right: 8px;
}

/* Footer Icons */
.user-icon::before {
    content: '👤';
}

.logout-icon::before {
    content: '🚪';
}

/* Submenu Item Styles */
.menu-group {
    margin-bottom: 2px;
}

.nav-item.has-submenu {
    cursor: pointer;
    position: relative;
}

.menu-chevron {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
    display: inline-block;
    opacity: 0.7;
}

.nav-item.has-submenu.expanded .menu-chevron {
    transform: rotate(180deg);
}

.submenu-container {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}

.submenu-container.collapsed {
    display: none !important;
}

.submenu-container[style*="display: none"] {
    max-height: 0;
    opacity: 0;
    display: none !important;
}

.submenu-item {
    margin-left: 30px;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease;
}

.submenu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.submenu-item.active {
    background: rgba(59, 130, 246, 0.3);
    color: white;
}

.submenu-item .nav-icon {
    font-size: 16px;
    min-width: 20px;
}

/* Submenu Icons */
.submenu-icon-list .nav-icon::before {
    content: '📋';
}

.submenu-icon-create .nav-icon::before,
.submenu-icon-create-user .nav-icon::before {
    content: '➕';
}

.submenu-icon-report .nav-icon::before {
    content: '📊';
}

.submenu-icon-financial .nav-icon::before {
    content: '💹';
}

.submenu-icon-add .nav-icon::before {
    content: '➕';
}

.submenu-icon-history .nav-icon::before {
    content: '📜';
}

.submenu-icon-users .nav-icon::before {
    content: '👥';
}

.submenu-icon-assignment .nav-icon::before {
    content: '📋';
}

/* Partners Menu Icon */
.nav-item-partners .nav-icon::before {
    content: '🤝';
}

/* Expenses Menu Icon */
.nav-item-expenses .nav-icon::before {
    content: '💰';
}

/* Financial Summary Menu Icon */
.nav-item-financial-summary .nav-icon::before {
    content: '📊';
}

/* Partner Submenu Icons */
.submenu-icon-partner-assignment .nav-icon::before {
    content: '👥';
}

.submenu-icon-amount-issue .nav-icon::before,
.submenu-icon-partner-amount-issue .nav-icon::before {
    content: '💰';
}

.submenu-icon-balance-report .nav-icon::before {
    content: '📊';
}

/* ===================================
   Main Content Styles
   =================================== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px 30px;
    min-height: 100vh;
    width: calc(100% - 260px);
    max-width: calc(100% - 260px);
    overflow-x: hidden;
    box-sizing: border-box;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Main content when sidebar is collapsed */
@media (min-width: 769px) {
    .main-content.sidebar-collapsed {
        margin-left: 70px;
        width: calc(100% - 70px);
        max-width: calc(100% - 70px);
    }
}

@media (max-width: 768px) {
    .main-content.sidebar-collapsed {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.top-header h2 {
    font-size: 28px;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===================================
   Stats Grid
   =================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 40px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    border-radius: 12px;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===================================
   Content Section
   =================================== */
.content-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 20px;
    color: var(--text-primary);
}

/* ===================================
   Buttons
   =================================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--border-color);
}

/* ===================================
   Tables
   =================================== */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table thead {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 2px solid #1e3a8a;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Reports table specific styling */
#reportsTable thead {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#reportsTable thead th {
    background: transparent;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding: 14px 16px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

.table-total {
    background: var(--bg-color);
    font-weight: 600;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.due-amount {
    color: var(--danger-color);
    font-weight: 600;
}

.due-amount.success {
    color: var(--success-color);
}

/* ===================================
   Status Badges
   =================================== */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-badge.active {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

/* ===================================
   Project Cards
   =================================== */
.projects-list {
    display: grid;
    gap: 20px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.project-card:hover {
    box-shadow: var(--shadow-lg);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.project-header h4 {
    font-size: 18px;
    color: var(--text-primary);
}

.project-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item .label {
    font-size: 12px;
    color: var(--text-secondary);
}

.detail-item .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #3b82f6);
    border-radius: 10px;
    transition: width 0.3s;
}

/* ===================================
   Forms
   =================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group .required {
    color: var(--danger-color);
}

.form-control,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range input {
    flex: 1;
}

/* ===================================
   Entry Form Styles
   =================================== */
.entry-form {
    margin-top: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.summary-card-small {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.summary-card-small label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.summary-card-small .summary-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===================================
   File Upload Styles
   =================================== */
.file-preview {
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-color);
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.file-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 5px;
}

.form-text {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* ===================================
   User Form Styles
   =================================== */
.user-form {
    max-width: 800px;
}

.text-danger {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.is-invalid {
    border-color: var(--danger-color) !important;
    border-width: 2px !important;
}

.form-control.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.validation-summary-errors {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ef4444;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 20px;
}

.validation-summary-errors:empty {
    display: none !important;
}

/* Hide validation summary when there are no errors */
.validation-summary-errors:not(:has(li)) {
    display: none !important;
}

/* ===================================
   Modals
   =================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s;
}

.modal-content.large-modal {
    max-width: 900px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 20px;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* ===================================
   Tabs
   =================================== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===================================
   Project Info Grid
   =================================== */
.project-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-card {
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-card label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.info-card p {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===================================
   Persons List
   =================================== */
.persons-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

/* Person cards use the same style as info-card */
.persons-list .info-card {
    position: relative;
    min-height: 120px;
}

.person-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.person-info strong {
    color: var(--text-primary);
}

.person-info span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===================================
   Summary Cards
   =================================== */
.summary-card {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.summary-card h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.summary-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
}

.summary-item label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
}

/* ===================================
   Filter Section
   =================================== */
.filter-section {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-section .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

/* ===================================
   Empty State
   =================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* ===================================
   Chart Section
   =================================== */
.chart-section {
    margin-top: 30px;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.chart-section h3 {
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
}

.chart-container {
    position: relative;
    height: 400px;
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* ===================================
   Toggle Button Styles
   =================================== */
.menu-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    z-index: 10;
    position: relative;
}

/* Toggle button visibility rules are handled in responsive section below */

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.menu-toggle:active {
    transform: scale(0.95);
}

.menu-toggle span {
    display: block;
    line-height: 1;
    font-weight: bold;
    user-select: none;
}

.header-toggle {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #1e293b;
    font-size: 18px;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
}

/* Show header toggle on mobile */
@media (max-width: 768px) {
    .header-toggle {
        display: flex !important;
    }
    
    .menu-toggle {
        display: none !important;
    }
}

.header-toggle:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: scale(1.05);
}

.header-toggle:active {
    transform: scale(0.95);
}

.header-toggle span {
    display: block;
    line-height: 1;
    font-weight: bold;
    user-select: none;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
        width: 100%;
        max-width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }
}
