/* ============================================
   MineMaint AI - استایل اصلی
   طراحی مدرن با تم معدنی
   ============================================ */

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

:root {
    --primary: #ff6b1a;        /* نارنجی معدنی */
    --primary-dark: #e55a0d;
    --dark: #1a2332;            /* سرمه‌ای تیره */
    --dark-2: #253044;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e2e8f0;
}
/* ============ حالت تاریک ============ */
[data-theme="dark"] {
    --primary: #ff8c42;
    --primary-dark: #ff6b1a;
    --dark: #e2e8f0;
    --dark-2: #cbd5e1;
    --gray: #94a3b8;
    --light: #0f172a;
    --white: #1e293b;
    --border: #334155;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
}

[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

[data-theme="dark"] .header {
    background: #020617;
    border-bottom: 1px solid #1e293b;
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .equipment-card,
[data-theme="dark"] .form-card {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .page-title {
    color: #f1f5f9;
}

[data-theme="dark"] .page-subtitle,
[data-theme="dark"] .stat-label,
[data-theme="dark"] .equipment-hours,
[data-theme="dark"] .equipment-type {
    color: #94a3b8;
}

[data-theme="dark"] .stat-value {
    color: #f1f5f9;
}

[data-theme="dark"] .stat-value.orange { color: #ff8c42; }
[data-theme="dark"] .stat-value.green  { color: #34d399; }
[data-theme="dark"] .stat-value.red    { color: #f87171; }

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #64748b;
}

[data-theme="dark"] table {
    background: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] table thead tr {
    background: #020617 !important;
}

[data-theme="dark"] table tbody tr {
    border-color: #334155 !important;
}

[data-theme="dark"] table td {
    color: #cbd5e1;
}

[data-theme="dark"] .btn-secondary {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #ff8c42;
    color: #ffffff;
    border-color: #ff8c42;
}

[data-theme="dark"] .empty-banner {
    background: linear-gradient(135deg, #020617 0%, #1e293b 100%);
    color: #e2e8f0;
}

[data-theme="dark"] .equipment-name.empty {
    color: #64748b;
}

[data-theme="dark"] .footer {
    color: #64748b;
    border-color: #334155;
}

[data-theme="dark"] .calendar-grid {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .calendar-weekday {
    background: #0f172a;
    color: #e2e8f0;
}

[data-theme="dark"] .calendar-day {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .calendar-day:hover:not(.empty) {
    background: #1e293b;
}

[data-theme="dark"] .calendar-day.today {
    background: #422006;
    border-color: #ff8c42;
}

[data-theme="dark"] .calendar-day .day-number {
    color: #e2e8f0;
}

[data-theme="dark"] .nav-disabled {
    color: #475569;
}

/* ============ انیمیشن ============ */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.15s ease;
}

/* ============ کلید تغییر حالت ============ */
.theme-toggle {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 12px;
}

.theme-toggle:hover {
    background: #ff6b1a;
    border-color: #ff6b1a;
    transform: rotate(20deg);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255,255,255,0.05);
}
/* ============ اصلاح منو در حالت تاریک ============ */
.nav a {
    color: #ffffff;
    transition: all 0.2s;
}

.nav a:hover {
    background: rgba(255,107,26,0.2);
    color: #ff8c42;
}

.nav a.active {
    background: #ff6b1a;
    color: #ffffff;
}

[data-theme="dark"] .nav a {
    color: #e2e8f0;
}

[data-theme="dark"] .nav a:hover {
    background: rgba(255,140,66,0.2);
    color: #ff8c42;
}

[data-theme="dark"] .nav a.active {
    background: #ff8c42;
    color: #ffffff;
}

[data-theme="dark"] .nav-disabled {
    color: #64748b;
}

/* ============ اصلاح فوتر و سایر متون ============ */
[data-theme="dark"] .footer {
    color: #94a3b8;
}

[data-theme="dark"] .logo {
    color: #ffffff;
}

[data-theme="dark"] .logo-text {
    color: #ff8c42;
}

/* ============ اصلاح کارت‌های دستگاه در دارک ============ */
[data-theme="dark"] .equipment-card {
    color: #e2e8f0;
}

[data-theme="dark"] .equipment-card .equipment-code {
    color: #ff8c42;
}

[data-theme="dark"] .equipment-card .equipment-name {
    color: #f1f5f9;
}

[data-theme="dark"] .equipment-card .equipment-name.empty {
    color: #64748b;
    font-style: italic;
}

[data-theme="dark"] .equipment-card .equipment-type {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .equipment-card .equipment-hours {
    color: #94a3b8;
}

[data-theme="dark"] .equipment-card .equipment-hours strong {
    color: #f1f5f9;
}

/* ============ اصلاح دکمه‌ها ============ */
[data-theme="dark"] .btn-primary {
    background: #ff8c42;
    color: #ffffff;
}

[data-theme="dark"] .btn-primary:hover {
    background: #ff6b1a;
}

/* ============ اصلاح جدول ============ */
[data-theme="dark"] table thead tr {
    background: #020617 !important;
    color: #e2e8f0;
}

[data-theme="dark"] table tbody tr:hover {
    background: #334155 !important;
}

/* ============ اصلاح لینک‌های داخل جدول ============ */
[data-theme="dark"] table a {
    color: #ff8c42;
}

/* ============ اصلاح صفحه‌بندی و متون فرعی ============ */
[data-theme="dark"] .form-group label {
    color: #e2e8f0;
}

[data-theme="dark"] .form-group small {
    color: #64748b;
}

/* ============ اصلاح منوی موبایل ============ */
@media (max-width: 900px) {
    [data-theme="dark"] .nav {
        background: #020617;
    }
    
    [data-theme="dark"] .nav a {
        color: #e2e8f0;
        border-bottom: 1px solid #1e293b;
    }
    
    [data-theme="dark"] .nav a:hover {
        background: rgba(255,140,66,0.15);
        color: #ff8c42;
    }
    
    [data-theme="dark"] .nav a.active {
        background: #ff8c42;
        color: #ffffff;
    }
    
    .nav a {
        border-bottom: 1px solid #e2e8f0;
    }
}
[data-theme="dark"] body {
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    background-attachment: fixed;
}

/* ============ منوی موبایل ============ */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 900px) {
    .header-content {
        flex-wrap: wrap;
    }
    .mobile-menu-btn {
        display: block;
        order: 2;
    }
    .theme-toggle {
        order: 3;
    }
    .nav {
        order: 4;
        width: 100%;
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: #0f172a;
        border-radius: 12px;
        padding: 0;
        margin-top: 12px;
    }
    .nav.open {
        max-height: 500px;
        padding: 12px 0;
    }
    .nav a, .nav .nav-disabled {
        padding: 12px 20px;
        border-radius: 0;
        text-align: right;
    }
    .logo {
        order: 1;
        font-size: 18px;
    }
}
body {
    font-family: 'Vazirmatn', -apple-system, 'Segoe UI', Tahoma, sans-serif;
    background: var(--light);
    color: var(--dark);
    direction: rtl;
    line-height: 1.7;
    min-height: 100vh;
}

/* ============ هدر ============ */
.header {
    background: var(--dark);
    color: var(--white);
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
}

.logo-icon {
    font-size: 32px;
}

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

.nav {
    display: flex;
    gap: 8px;
}

.nav a {
    color: var(--white);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 600;
}

.nav a:hover, .nav a.active {
    background: var(--primary);
}

/* ============ کانتینر اصلی ============ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--dark);
}

.page-subtitle {
    color: var(--gray);
    margin-bottom: 32px;
    font-size: 15px;
}

/* ============ کارت‌های آماری ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.stat-label {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--dark);
}

.stat-value.orange { color: var(--primary); }
.stat-value.green  { color: var(--success); }
.stat-value.red    { color: var(--danger); }

/* ============ کارت‌های دستگاه ============ */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.equipment-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.equipment-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.equipment-code {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.equipment-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark);
    min-height: 27px;
}

.equipment-name.empty {
    color: var(--gray);
    font-style: italic;
    font-weight: 400;
}

.equipment-type {
    display: inline-block;
    padding: 4px 12px;
    background: var(--light);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 12px;
}

.equipment-hours {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    font-size: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.equipment-hours strong {
    color: var(--dark);
    font-size: 18px;
    font-weight: 800;
}

/* ============ بنر خالی ============ */
.empty-banner {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    color: var(--white);
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    text-align: center;
}

.empty-banner h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.empty-banner p {
    color: #cbd5e1;
    font-size: 15px;
}

/* ============ دکمه‌ها ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,107,26,0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* ============ فوتر ============ */
.footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--gray);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

/* ============ موبایل ============ */
@media (max-width: 768px) {
    .header-content {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    .nav {
        width: 100%;
        justify-content: center;
        overflow-x: auto;
    }
    .nav a {
        padding: 6px 12px;
        font-size: 14px;
    }
    .container {
        padding: 20px 16px;
    }
    .page-title { font-size: 22px; }
    .stat-value { font-size: 26px; }
}
ENDOFFILEcat > ~/Desktop/minemaint-ai/web/templates/base.html << 'ENDOFFILE'
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}MineMaint AI{% endblock %}</title>
    <link rel="stylesheet" href="/static/style.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;600;700;800&display=swap" rel="stylesheet">
</head>
<body>
    <header class="header">
        <div class="header-content">
            <a href="/" class="logo">
                <span class="logo-icon">🚜</span>
                <span>Mine<span class="logo-text">Maint</span> AI</span>
            </a>
            <nav class="nav">
                <a href="/" class="{% if active == 'dashboard' %}active{% endif %}">📊 داشبورد</a>
                <a href="/equipment" class="{% if active == 'equipment' %}active{% endif %}">🚜 تجهیزات</a>
                <a href="#" title="به‌زودی">🔧 نگهداری</a>
                <a href="#" title="به‌زودی">📦 انبار</a>
                <a href="#" title="به‌زودی">🤖 دستیار AI</a>
            </nav>
        </div>
    </header>

    <main class="container">
        {% block content %}{% endblock %}
    </main>

    <footer class="footer">
        🚜 MineMaint AI - سامانه هوشمند نگهداری ماشین‌آلات معدنی
        <br>
        نسخه 0.1 - در حال توسعه
    </footer>
</body>
</html>
/* ============ فرم‌ها ============ */
.form-card {
    background: var(--white);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    max-width: 900px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    background: var(--white);
    color: var(--dark);
    transition: border-color 0.2s;
    direction: rtl;
}

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

.form-group input:read-only {
    background: var(--light);
    color: var(--gray);
    cursor: not-allowed;
}

.form-group small {
    color: var(--gray);
    font-size: 12px;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* دکمه شناور افزودن */
.add-button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

/* کارت با دکمه ویرایش */
.equipment-card-wrapper {
    position: relative;
}

.edit-link {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--light);
    color: var(--dark);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.2s;
    z-index: 2;
}

.edit-link:hover {
    background: var(--primary);
    color: var(--white);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-card {
        padding: 20px;
    }
}
/* لینک‌های غیرفعال منو */
.nav-disabled {
    color: #64748b;
    padding: 8px 16px;
    cursor: not-allowed;
    font-weight: 600;
    opacity: 0.6;
    user-select: none;
}
/* ============ تقویم شمسی ============ */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: #1a2332;
    border-radius: 12px;
    color: white;
}

.calendar-month-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.calendar-month-title .month-name {
    font-size: 24px;
    font-weight: 800;
    color: #ff6b1a;
}

.calendar-month-title .month-year {
    font-size: 14px;
    color: #cbd5e1;
}

.calendar-header .btn-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.calendar-header .btn-secondary:hover {
    background: #ff6b1a;
    border-color: #ff6b1a;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

.calendar-weekday {
    text-align: center;
    font-weight: 700;
    padding: 12px 8px;
    color: #1a2332;
    font-size: 14px;
    border-bottom: 2px solid #e2e8f0;
}

.calendar-weekday.friday {
    color: #dc2626;
}

.calendar-day {
    min-height: 90px;
    padding: 8px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    position: relative;
    transition: all 0.2s;
}

.calendar-day.empty {
    background: transparent;
    border: none;
}

.calendar-day:hover:not(.empty) {
    background: #f1f5f9;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.calendar-day.today {
    background: #fff7ed;
    border: 2px solid #ff6b1a;
    box-shadow: 0 4px 12px rgba(255,107,26,0.2);
}

.calendar-day.friday {
    background: #fef2f2;
}

.calendar-day.friday .day-number {
    color: #dc2626;
}

.calendar-day.has-event {
    background: #ecfdf5;
    border-color: #22c55e;
}

.calendar-day.today.has-event {
    background: #fff7ed;
}

.calendar-day .day-number {
    font-size: 18px;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 4px;
    font-family: Vazirmatn, sans-serif;
}

.calendar-day .day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-event {
    font-size: 10px;
    padding: 2px 6px;
    background: #22c55e;
    color: white;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.day-event-more {
    font-size: 10px;
    color: #16a34a;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 768px) {
    .calendar-grid {
        gap: 4px;
        padding: 8px;
    }
    .calendar-day {
        min-height: 60px;
        padding: 4px;
    }
    .calendar-day .day-number {
        font-size: 14px;
    }
    .calendar-weekday {
        font-size: 11px;
        padding: 8px 2px;
    }
    .day-event {
        font-size: 9px;
        padding: 1px 3px;
    }
    .calendar-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .calendar-month-title .month-name {
        font-size: 18px;
    }
}
/* ============ زیباسازی دیت‌پیکر ============ */
.datepicker-plot-area {
    font-family: Vazirmatn, Tahoma, sans-serif !important;
    direction: rtl;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
    border: 1px solid #e2e8f0 !important;
    z-index: 9999 !important;
}

.datepicker-plot-area .datepicker-day-view .table-days td span {
    font-family: Vazirmatn, Tahoma, sans-serif !important;
    border-radius: 8px;
}

.datepicker-plot-area .datepicker-day-view .table-days td.selected span {
    background-color: #ff6b1a !important;
    color: white !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255,107,26,0.4);
}

.datepicker-plot-area .datepicker-day-view .table-days td:hover span {
    background-color: #fff7ed !important;
    color: #ff6b1a !important;
}

.datepicker-plot-area .datepicker-day-view .table-days td.today span {
    background-color: #ff6b1a !important;
    color: white !important;
    opacity: 0.7;
}

.datepicker-plot-area .datepicker-header {
    background-color: #1a2332 !important;
    color: white !important;
    border-radius: 12px 12px 0 0 !important;
}

.datepicker-plot-area .datepicker-header .btn-next,
.datepicker-plot-area .datepicker-header .btn-switch,
.datepicker-plot-area .datepicker-header .btn-prev {
    color: white !important;
}

.datepicker-plot-area .datepicker-navigator .pwt-btn-next,
.datepicker-plot-area .datepicker-navigator .pwt-btn-switch,
.datepicker-plot-area .datepicker-navigator .pwt-btn-prev {
    background-color: #1a2332 !important;
    color: white !important;
}

.datepicker-plot-area .toolbox {
    background-color: #f8fafc !important;
    border-radius: 0 0 12px 12px !important;
}

/* نشانگر فیلد تاریخ */
input[name*="date"] {
    cursor: pointer !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ff6b1a' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 40px !important;
}
/* ============ نام کاربر و دکمه خروج ============ */
.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.user-name {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 50%;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.2s;
    cursor: pointer;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: rotate(-10deg);
}

[data-theme="dark"] .user-name {
    color: #94a3b8;
}

[data-theme="dark"] .logout-btn {
    background: rgba(239,68,68,0.2);
}

@media (max-width: 900px) {
    .user-name {
        display: none;
    }
    .header-user {
        margin-left: 0;
        order: 2;
    }
}
/* ============ منوی کاربر ============ */
.user-menu {
    position: relative;
}

.user-name {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    user-select: none;
}

.user-name:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
    min-width: 220px;
    padding: 8px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    direction: rtl;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 10px 14px;
    color: #1a2332;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
}

.user-dropdown a:hover {
    background: #f1f5f9;
    color: #ff6b1a;
}

.user-dropdown .logout-item {
    color: #ef4444;
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
    padding-top: 14px;
}

.user-dropdown .logout-item:hover {
    background: #fee2e2;
    color: #dc2626;
}

[data-theme="dark"] .user-dropdown {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .user-dropdown a {
    color: #e2e8f0;
}

[data-theme="dark"] .user-dropdown a:hover {
    background: #334155;
    color: #ff8c42;
}

[data-theme="dark"] .user-dropdown .logout-item {
    border-color: #334155;
}

[data-theme="dark"] .user-dropdown .logout-item:hover {
    background: #7f1d1d;
    color: #fecaca;
}

@media (max-width: 900px) {
    .user-name {
        font-size: 12px;
        padding: 6px 8px;
    }
    .user-dropdown {
        min-width: 180px;
        left: auto;
        right: 0;
    }
}
/* ============ نشان شرکت ============ */
.company-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255,107,26,0.15);
    border: 1px solid rgba(255,107,26,0.4);
    border-radius: 20px;
    color: #ff8c42;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    margin-left: 8px;
}

.change-company-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s;
    margin-right: 4px;
}

.change-company-btn:hover {
    background: #ff6b1a;
    transform: rotate(180deg);
}

@media (max-width: 900px) {
    .company-badge {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
/* ============ لینک‌های کاربر در منوی موبایل ============ */
    
    .nav-user-links a {
        display: block;
        padding: 12px 20px;
        color: #cbd5e1;
        text-decoration: none;
        border-radius: 8px;
        font-weight: 600;
        font-size: 14px;
        transition: all 0.2s;
    }
    
    .nav-user-links a:hover {
        background: rgba(255,255,255,0.05);
        color: white;
    }
    
    .nav-user-links .nav-logout {
        color: #ef4444;
        margin-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.05);
        padding-top: 14px;
    }
    
    .nav-user-links .nav-logout:hover {
        background: rgba(239,68,68,0.1);
        color: #f87171;
    }
    
    [data-theme="dark"] .nav-user-links {
        border-color: #334155;
    }
    
    /* مخفی کردن منوی کشویی کاربر در موبایل */
     .header-user {
        display: none;
    }
    /* ============ منوی کاربر در موبایل ============ */
.mobile-user-menu {
    display: none;
}

@media (max-width: 900px) {
    /* مخفی کردن منوی کاربر دسکتاپ */
    .header-user {
        display: none !important;
    }
    
    /* نمایش منوی کاربر موبایل */
    .mobile-user-menu {
        display: block;
        width: 100%;
        order: 99;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: #0f172a;
        border-radius: 12px;
        margin-top: 0;
    }
    
    .mobile-user-menu.open {
        max-height: 500px;
        margin-top: 12px;
        padding: 12px;
    }
    
    .mobile-user-menu a {
        display: block;
        padding: 12px 20px;
        color: #cbd5e1;
        text-decoration: none;
        border-radius: 8px;
        font-weight: 600;
        font-size: 14px;
        transition: all 0.2s;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .mobile-user-menu a:last-child {
        border-bottom: none;
    }
    
    .mobile-user-menu a:hover {
        background: rgba(255,255,255,0.05);
        color: white;
    }
    
    .mobile-user-menu .nav-logout {
        color: #ef4444;
        margin-top: 8px;
        border-top: 2px solid rgba(239,68,68,0.2);
        border-bottom: none;
        padding-top: 16px;
    }
    
    .mobile-user-menu .nav-logout:hover {
        background: rgba(239,68,68,0.1);
        color: #f87171;
    }
    
    [data-theme="dark"] .mobile-user-menu {
        background: #020617;
    }
}
/* ============================================
   منوی کاربر — دسکتاپ + موبایل
   ============================================ */

/* دسکتاپ */
.header-user {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

/* منوی موبایل: مخفی در دسکتاپ */
.mobile-user-menu {
    display: none !important;
}

@media (max-width: 900px) {
    /* در موبایل منوی کاربر دسکتاپ مخفی */
    .header-user {
        display: none !important;
    }
    
    /* در موبایل منوی کشویی کاربر مخفی */
    .header-user .user-menu .user-dropdown {
        display: none !important;
    }
    
    /* نمایش منوی کاربر موبایل */
    .mobile-user-menu {
        display: block !important;
        width: 100%;
        order: 99;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: #0f172a;
        border-radius: 12px;
        margin-top: 0;
    }
    
    .mobile-user-menu.open {
        max-height: 500px;
        margin-top: 12px;
        padding: 12px;
    }
    
    .mobile-user-menu a {
        display: block;
        padding: 12px 20px;
        color: #cbd5e1;
        text-decoration: none;
        border-radius: 8px;
        font-weight: 600;
        font-size: 14px;
        transition: all 0.2s;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .mobile-user-menu a:last-child {
        border-bottom: none;
    }
    
    .mobile-user-menu a:hover {
        background: rgba(255,255,255,0.05);
        color: white;
    }
    
    .mobile-user-menu .nav-logout {
        color: #ef4444;
        margin-top: 8px;
        border-top: 2px solid rgba(239,68,68,0.2);
        border-bottom: none;
        padding-top: 16px;
    }
    
    .mobile-user-menu .nav-logout:hover {
        background: rgba(239,68,68,0.1);
        color: #f87171;
    }
    
    [data-theme="dark"] .mobile-user-menu {
        background: #020617;
    }
}