/* ========== SYSTEM WIDE VARIABLES ========== */
:root {
    /* Colors */
    --primary: #4e73df;
    --primary-dark: #3a5bbc;
    --primary-light: #e8eafc;
    --secondary: #6c757d;
    --success: #1cc88a;
    --success-light: #e6f8f1;
    --info: #36b9cc;
    --info-light: #e3f6fc;
    --warning: #f6c23e;
    --warning-light: #fff3d8;
    --danger: #e74a3b;
    --danger-light: #fdedeb;
    --dark: #5a5c69;
    --muted: #858796;
    --light: #f8f9fc;
    --white: #ffffff;

    /* Backgrounds */
    --bg-body: #f8f9fc;
    --bg-sidebar: #2d3748;
    --bg-header: #ffffff;
    --bg-card: #ffffff;

    /* Borders */
    --border-radius: 0.25rem;
    --border-color: #e3e6f0;

    /* Shadows */
    --shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);
    --shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .175);
    --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, .075);

    /* Spacing */
    --spacer: 1rem;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --footer-height: 50px;

    /* Transitions */
    --transition-base: all 0.2s ease-in-out;
    --transition-sidebar: all 0.3s ease-in-out;

    /* Typography */
    --font-family-base: 'Vazirmatn', 'Tahoma', sans-serif;
    --font-size-base: 0.875rem;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
}

/* ========== RESET & BASE STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    color: var(--dark);
    background-color: var(--bg-body);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition-base);
}

a:hover {
    color: var(--primary-dark);
}

/* ========== LAYOUT STYLES ========== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background-color: var(--bg-sidebar);
    color: var(--white);
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    transition: var(--transition-sidebar);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: 40px;
    margin-left: 0.75rem;
}

.brand-name {
    font-size: 1.25rem;
    margin: 0;
    font-weight: var(--font-weight-bold);
    color: var(--white);
    transition: opacity 0.3s ease;
}

.sidebar-collapsed .brand-name {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    overflow: hidden;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
}

.sidebar-user {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.sidebar-collapsed .user-info {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    overflow: hidden;
}

.user-name {
    font-weight: var(--font-weight-medium);
    color: var(--white);
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex-grow: 1;
}

.menu-divider {
    padding: 0.5rem 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 1rem;
}

.sidebar-collapsed .menu-divider {
    opacity: 0;
    height: 1px;
    overflow: hidden;
    padding: 0;
    margin: 0.5rem 0;
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-base);
    position: relative;
}

.menu-link:hover, 
.menu-item.active > .menu-link {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-icon {
    margin-left: 0.75rem;
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    transition: var(--transition-base);
}

.menu-text {
    transition: opacity 0.3s ease;
}

.sidebar-collapsed .menu-text {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    overflow: hidden;
}

.menu-arrow {
    margin-right: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.sidebar-collapsed .menu-arrow {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    overflow: hidden;
}

.menu-item.active > .menu-link .menu-arrow,
.menu-item.submenu-open > .menu-link .menu-arrow {
    transform: rotate(-90deg);
}

.submenu {
    list-style: none;
    padding-right: 2.5rem;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.menu-item.active > .submenu,
.menu-item.submenu-open > .submenu {
    max-height: 1000px;
}

.submenu-item {
    margin: 0.25rem 0;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    transition: var(--transition-base);
    border-radius: var(--border-radius);
}

.submenu-link:hover, 
.submenu-item.active .submenu-link {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.05);
}

.submenu-icon {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

.sidebar-footer {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    padding: 0.5rem;
    transition: var(--transition-base);
}

.footer-link:hover {
    color: var(--white);
}

.footer-link i {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.sidebar-collapsed .footer-link span {
    display: none;
}

/* Main Content Styles */
.main-content {
    flex-grow: 1;
    margin-right: var(--sidebar-width);
    transition: var(--transition-sidebar);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-collapsed .main-content {
    margin-right: var(--sidebar-collapsed-width);
}

/* Header Styles */
.main-header {
    height: var(--header-height);
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: transparent;
    border: none;
    color: var(--dark);
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition-base);
}

.menu-toggle:hover {
    background-color: var(--light);
    color: var(--primary);
}

.page-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-medium);
    color: var(--dark);
}

.header-right {
    display: flex;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--dark);
    font-size: 1rem;
    cursor: pointer;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition-base);
}

.action-btn:hover {
    background-color: var(--light);
    color: var(--primary);
}

.action-btn .badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--danger);
    color: var(--white);
    font-size: 0.65rem;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--white);
}

.dropdown-toggle::after {
    margin-right: 0.5rem;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 24px;
    height: 24px;
}

/* Content Container Styles */
.content-container {
    padding: 1.5rem;
    flex-grow: 1;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.breadcrumb {
    padding: 0;
    margin-bottom: 0;
    background-color: transparent;
    font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--secondary);
    content: "/";
    font-weight: normal;
}

.date-display {
    font-size: 0.875rem;
    color: var(--secondary);
}

/* Content Body Styles */
.content-body {
    margin-bottom: 1.5rem;
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    background-color: var(--bg-card);
}

.card-stats {
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.card-stats .card-body {
    padding: 1.25rem;
}

.icon-shape {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.bg-gradient-primary {
    background: linear-gradient(87deg, #4e73df 0, #224abe 100%);
}

.bg-gradient-success {
    background: linear-gradient(87deg, #1cc88a 0, #13a573 100%);
}

.bg-gradient-info {
    background: linear-gradient(87deg, #36b9cc 0, #258391 100%);
}

.bg-gradient-warning {
    background: linear-gradient(87deg, #f6c23e 0, #dda20a 100%);
}

.bg-soft-primary {
    background-color: rgba(78, 115, 223, 0.1);
}

.bg-soft-success {
    background-color: rgba(28, 200, 138, 0.1);
}

.bg-soft-info {
    background-color: rgba(54, 185, 204, 0.1);
}

.bg-soft-warning {
    background-color: rgba(246, 194, 62, 0.1);
}

.bg-soft-danger {
    background-color: rgba(231, 74, 59, 0.1);
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

/* Table Styles */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table-light {
    background-color: var(--light);
}

.table th {
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: var(--dark);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-nowrap th, 
.table-nowrap td {
    white-space: nowrap;
}

/* Chart Container */
.chart-container {
    position: relative;
    margin: auto;
    height: 300px;
    width: 100%;
}

/* Activity Timeline */
.activity-timeline {
    position: relative;
    padding: 1.5rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    right: 31px;
    height: 100%;
    width: 1px;
    background-color: var(--border-color);
}

.activity-item {
    padding-bottom: 1.5rem;
    position: relative;
    padding-right: 45px;
    min-height: 70px;
}

.activity-item:last-child {
    padding-bottom: 0;
}

.activity-icon {
    position: absolute;
    right: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.875rem;
}

.activity-content {
    padding-right: 0.5rem;
}

.activity-content small {
    display: block;
    margin-top: 0.25rem;
}

/* Footer */
.footer {
    background-color: var(--bg-header);
    padding: 1rem 1.5rem;
    color: var(--secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
        box-shadow: var(--shadow);
    }
    
    .sidebar-open .sidebar {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .main-content {
        margin-right: 0 !important;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 0 1rem;
    }
    
    .content-container {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .action-btn {
        margin-right: 0.5rem;
    }
    
    .date-display {
        display: none;
    }
}

/* ========== UTILITY CLASSES ========== */
.text-uppercase {
    text-transform: uppercase !important;
}

.text-muted {
    color: var(--muted) !important;
}

.text-nowrap {
    white-space: nowrap !important;
}

.font-weight-bold {
    font-weight: var(--font-weight-bold) !important;
}

.small {
    font-size: 80% !important;
}

.text-sm {
    font-size: 0.875rem !important;
}

.border-left-primary {
    border-right: 4px solid var(--primary) !important;
    border-left: none !important;
}

.border-left-success {
    border-right: 4px solid var(--success) !important;
    border-left: none !important;
}

.border-left-info {
    border-right: 4px solid var(--info) !important;
    border-left: none !important;
}

.border-left-warning {
    border-right: 4px solid var(--warning) !important;
    border-left: none !important;
}

.border-left-danger {
    border-right: 4px solid var(--danger) !important;
    border-left: none !important;
}

.border-left-secondary {
    border-right: 4px solid var(--secondary) !important;
    border-left: none !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-in-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* RTL Specific Overrides */
.dropdown-toggle::after {
    margin-right: 0.255em;
    margin-left: 0;
}

.dropdown-menu-end {
    left: 0;
    right: auto;
}

.ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

.me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

.mr-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.ml-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* Dashboard.js specific styles */
.top-cards {
    margin-bottom: 1.5rem;
}

.currency-card {
    border-radius: var(--border-radius);
    padding: 1.5rem;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.currency-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.currency-title {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.currency-amount {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.currency-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.currency-change.positive {
    color: var(--success);
}

.currency-change.negative {
    color: var(--danger);
}

.currency-change i {
    margin-left: 0.25rem;
}
/* استایل‌های مربوط به آیکون‌های کارت‌ها */
.icon-shape {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bg-soft-primary {
    background-color: rgba(13, 110, 253, 0.2);
}
.bg-soft-danger {
    background-color: rgba(220, 53, 69, 0.2);
}
.bg-soft-success {
    background-color: rgba(25, 135, 84, 0.2);
}
/* استایل‌های تکمیلی برای آیکون‌های کارت */
.icon-shape i {
    font-size: 1.25rem;
}
.icon-shape.rounded {
    border-radius: 0.5rem;
}
/* برای آیکون‌های کارت */
.card-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* نمایش بهتر مبلغ موجودی */
.balance-display {
    font-size: 1.1rem;
    font-weight: 600;
}

/* سفارشی‌سازی بج‌های شماره کارت */
.card-number-badge {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    font-size: 1.2rem !important;
    padding: 0.35rem 0.65rem;
}
/* اندازه یکسان برای کارت های آمار */
.card-stats {
    height: 100%;
    min-height: 160px;
}

/* باکس‌های اندازه یکسان */
.card-stats {
    height: 100%;
    min-height: 100px;
}


/* تنظیم عرض ستون برای آیکون‌ها */
.card-stats .col-auto {
    min-width: 70px;
}

/* تنظیم عرض ستون اصلی */
.card-stats .col {
    min-width: 140px;
    max-width: calc(100% - 70px);
}
/* برای قرار دادن واحد پولی در خط پایین */
.card-stats .h2 {
    padding-top: 30px;
    white-space: nowrap;
    display: block;  /* عدد را در یک خط کامل نمایش می‌دهد */
}

/* استایل برای واحد پولی */
.currency-unit {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    margin-top: 0.25rem;
}

/* ===========================================
   بهینه‌سازی CSS برای Sidebar با قابلیت Collapse
   این کدها را به انتهای فایل style.css اضافه کنید
   =========================================== */

/* Performance optimizations */
.sidebar,
.main-content,
.sidebar-overlay {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Desktop collapse functionality */
@media (min-width: 992px) {
    .sidebar-collapse-btn {
        display: flex !important;
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.7);
        cursor: pointer;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        transition: all 0.2s ease;
        margin-left: 0.5rem;
        padding: 0;
    }
    
    .sidebar-collapse-btn:hover {
        color: white;
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .sidebar-collapse-btn:focus {
        outline: 2px solid rgba(255, 255, 255, 0.5);
        outline-offset: 2px;
    }
    
    /* Rotate arrow when collapsed */
    .sidebar-collapsed .sidebar-collapse-btn svg {
        transform: rotate(180deg);
    }
    
    /* Desktop sidebar states */
    .sidebar {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-right: var(--sidebar-width, 260px);
        width: calc(100% - var(--sidebar-width, 260px));
        transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Collapsed state */
    .sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed-width, 70px);
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar-collapsed .main-content {
        margin-right: var(--sidebar-collapsed-width, 70px);
        width: calc(100% - var(--sidebar-collapsed-width, 70px));
    }
    
    /* Hide text elements when collapsed */
    .sidebar-collapsed .menu-text,
    .sidebar-collapsed .brand-name,
    .sidebar-collapsed .user-info,
    .sidebar-collapsed .menu-arrow,
    .sidebar-collapsed .menu-divider {
        opacity: 0;
        width: 0;
        overflow: hidden;
        transition: opacity 0.15s ease;
    }
    
    /* Center icons when collapsed */
    .sidebar-collapsed .menu-link {
        justify-content: center;
        padding: 0.75rem 0.5rem;
    }
    
    .sidebar-collapsed .menu-icon {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Hide submenus when collapsed */
    .sidebar-collapsed .submenu {
        display: none;
    }
    
    /* Tooltip for collapsed menu items */
    .sidebar-collapsed .menu-link {
        position: relative;
    }
    
    .sidebar-collapsed .menu-link:hover::after {
        content: attr(data-title);
        position: absolute;
        right: 100%;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 0.5rem 0.75rem;
        border-radius: 0.25rem;
        font-size: 0.875rem;
        white-space: nowrap;
        z-index: 1000;
        margin-right: 0.5rem;
        opacity: 0;
        animation: tooltipFadeIn 0.2s ease forwards;
    }
}

/* Mobile optimizations */
@media (max-width: 991.98px) {
    .sidebar-collapse-btn {
        display: none !important;
    }
    
    /* Mobile sidebar positioning */
    .sidebar {
        transform: translateX(100%) !important;
        width: min(320px, 85vw) !important;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    
    .sidebar-open .sidebar {
        transform: translateX(0) !important;
    }
    
    /* Full width content on mobile */
    .main-content {
        margin-right: 0 !important;
        width: 100% !important;
    }
    
    /* Prevent body scroll when sidebar open */
    body.sidebar-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
    }
    
    /* Mobile button styles */
    .menu-toggle {
        display: flex !important;
    }
    
    .sidebar-close {
        display: flex !important;
    }
}

/* Header button container */
.sidebar-header-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Enhanced sidebar header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 70px;
    position: relative;
}

/* Brand improvements */
.brand-name {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 700;
    color: white;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

/* Menu improvements for better performance */
.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.menu-link:hover,
.menu-item.active > .menu-link {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.menu-icon {
    margin-left: 0.75rem;
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: margin 0.3s ease;
}

.menu-text {
    flex-grow: 1;
    transition: opacity 0.3s ease, width 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

/* Arrow animation */
.menu-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
    flex-shrink: 0;
}

.menu-item.submenu-open > .menu-link .menu-arrow {
    transform: rotate(-90deg);
}

/* Submenu optimizations */
.submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(0, 0, 0, 0.1);
}

.menu-item.submenu-open > .submenu {
    max-height: 300px;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 3rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.submenu-link:hover,
.submenu-item.active .submenu-link {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

/* Simple header optimizations */
.simple-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1000;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    backdrop-filter: blur(10px);
}

/* Overlay optimizations */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1019;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(2px);
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Animations */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Focus management */
.menu-toggle:focus,
.sidebar-close:focus,
.sidebar-collapse-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {
    .sidebar {
        border-left: 2px solid white;
    }
    
    .menu-link:hover,
    .menu-item.active > .menu-link {
        background-color: rgba(255, 255, 255, 0.3);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .main-content,
    .sidebar-overlay,
    .menu-arrow,
    .submenu,
    .menu-text,
    .brand-name,
    .sidebar-collapse-btn svg {
        transition: none !important;
        animation: none !important;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .menu-toggle,
    .sidebar-overlay,
    .sidebar-close,
    .sidebar-collapse-btn {
        display: none !important;
    }
    
    .main-content {
        margin-right: 0 !important;
        width: 100% !important;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .simple-header {
        background: #1a1a1a;
        border-bottom-color: #333;
    }
}

/* Ultra-wide screen optimizations */
@media (min-width: 1920px) {
    .sidebar {
        width: min(var(--sidebar-width, 260px), 15vw);
    }
    
    .sidebar-collapsed .sidebar {
        width: min(var(--sidebar-collapsed-width, 70px), 4vw);
    }
}

/* Small height devices */
@media (max-height: 600px) {
    .sidebar-header {
        min-height: 50px;
        padding: 0.75rem;
    }
    
    .menu-link {
        padding: 0.5rem 1.5rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .menu-link,
    .submenu-link {
        min-height: 44px;
    }
    
    .menu-toggle,
    .sidebar-close,
    .sidebar-collapse-btn {
        min-width: 44px;
        min-height: 44px;
    }
}