@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #C6A43F;
    --primary-dark: #A8882E;
    --primary-light: #E8D5A8;
    --secondary: #1B4D3E;
    --secondary-dark: #0F3328;
    --secondary-light: #2A7A62;
    --dark: #1A1A2E;
    --gray: #6C757D;
    --light: #F8F9FA;
    --white: #FFFFFF;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    background: linear-gradient(135deg, #0F2E2A 0%, #1A3F3A 100%);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
}

/* ========== سایدبار ========== */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(12px);
    border-left: 1px solid rgba(198, 164, 63, 0.2);
    padding: 25px 15px;
    transition: all 0.3s ease;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    text-align: center;
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(198, 164, 63, 0.2);
}

.sidebar-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 30px;
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 4px;
}

.sidebar-header p {
    color: rgba(255,255,255,0.5);
    font-size: 10px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(198, 164, 63, 0.15);
    color: var(--primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--dark);
}

.nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    position: absolute;
    bottom: 20px;
    right: 15px;
    left: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(198, 164, 63, 0.2);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 10px;
    color: #EF4444;
    text-decoration: none;
    background: rgba(239, 68, 68, 0.1);
    font-weight: 500;
    font-size: 14px;
}

/* ========== محتوای اصلی ========== */
.main-content {
    margin-right: 260px;
    padding: 20px;
    min-height: 100vh;
}

/* ========== کارت‌ها ========== */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(198, 164, 63, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* ========== دکمه‌ها ========== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--dark);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(198, 164, 63, 0.3);
}

/* ========== تقویم مدرن و زیبا ========== */
.calendar-container {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 28px;
    padding: 20px;
    margin-top: 20px;
    max-width: 450px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(197, 160, 40, 0.1);
    transition: all 0.3s ease;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.calendar-nav {
    background: rgba(197, 160, 64, 0.12);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #5a4a2e;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(197, 160, 64, 0.3);
}

.calendar-month-year {
    font-size: 1.2rem;
    font-weight: 800;
    color: #2c2c2c;
    background: rgba(197, 160, 64, 0.08);
    padding: 8px 20px;
    border-radius: 40px;
    letter-spacing: 0.5px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 12px;
    padding: 8px 0;
    background: rgba(197, 160, 64, 0.05);
    border-radius: 20px;
}

.weekday {
    font-weight: 700;
    color: #7a6a4a;
    font-size: 0.85rem;
    font-family: 'Vazirmatn', monospace;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    background: white;
    border: 1px solid #edece4;
    color: #2c2c2c;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.calendar-day:hover:not(.empty):not(.disabled):not(.selected-start):not(.selected-end) {
    background: #fef7e0;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -8px rgba(0,0,0,0.2);
}

/* روزهای غیرفعال (رزرو شده یا گذشته) */
.calendar-day.disabled,
.calendar-day.past {
    background: #f5f3ef;
    color: #bcb9b0;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.7;
    border-color: #e8e6e0;
}

/* استایل تاریخ شروع و پایان */
.calendar-day.selected-start {
    background: linear-gradient(135deg, var(--primary), #dbb42c);
    color: white;
    border-radius: 20px 0 0 20px;
    border: none;
    box-shadow: 0 4px 12px rgba(197,160,64,0.4);
}

.calendar-day.selected-end {
    background: linear-gradient(135deg, #dbb42c, var(--primary));
    color: white;
    border-radius: 0 20px 20px 0;
    border: none;
    box-shadow: 0 4px 12px rgba(197,160,64,0.4);
}

/* بازه بین دو تاریخ */
.calendar-day.in-range {
    background: rgba(197, 160, 64, 0.2);
    border-radius: 0;
    border-top: 1px solid #f0e2b6;
    border-bottom: 1px solid #f0e2b6;
    transform: none;
}

/* تاریخ امروز */
.calendar-day.today {
    border: 2px solid var(--primary);
    background: #fffaf0;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px white, 0 0 0 2px var(--primary);
    color: #a47c1a;
}

/* اگر روز انتخاب شده (start/end) هم امروز باشد */
.calendar-day.selected-start.today,
.calendar-day.selected-end.today {
    border: none;
    box-shadow: 0 4px 12px rgba(197,160,64,0.4);
}

.calendar-day.past::after {
    content: "•";
    font-size: 10px;
    position: absolute;
    bottom: 2px;
    right: 4px;
    color: #aaa;
}

/* جعبه‌های انتخاب تاریخ (ورود/خروج) */
.date-info {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.date-box {
    flex: 1;
    padding: 14px 12px;
    border: 2px solid #e2dfd7;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    backdrop-filter: blur(2px);
}

.date-box.active {
    border-color: var(--primary);
    background: rgba(197, 160, 64, 0.08);
    box-shadow: 0 6px 14px rgba(197, 160, 64, 0.15);
    transform: translateY(-2px);
}

.date-box-label {
    font-size: 0.75rem;
    color: #5f5b50;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.date-box-value {
    font-size: 1rem;
    font-weight: 700;
    color: #2c2c2c;
}

/* واکنش‌گرایی */
@media (max-width: 768px) {
    .calendar-container {
        padding: 15px;
        max-width: 100%;
    }
    .calendar-day {
        font-size: 0.8rem;
        border-radius: 14px;
    }
    .calendar-nav {
        width: 34px;
        height: 34px;
    }
    .date-box {
        padding: 10px;
    }
}
/* روزهای غیرقابل انتخاب (آینده رزرو شده) */
.calendar-day.disabled {
    background: #f0f0f0;
    color: #aaa;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.6;
}

/* روزهای گذشته (قبل از امروز) - قابل انتخاب نیستند اما نباید شبیه رزرو شده باشند */
.calendar-day.past {
    background: #f9f9f9;
    color: #bbb;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.5;
}

/* روزهای رزرو شده (آینده) - با رنگ متفاوت و آیکون رزرو */
.calendar-day.booked {
    background: #ffe6e6;
    color: #c0392b;
    text-decoration: line-through;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.calendar-day.booked .booked-text {
    font-size: 8px;
    background: #ffcccc;
    padding: 2px 4px;
    border-radius: 10px;
    margin-top: 3px;
    color: #a00;
}

.calendar-day.booked::after {
    content: "رزرو شده";
    font-size: 8px;
    display: block;
    margin-top: 2px;
    font-weight: normal;
    text-decoration: none;
    color: #c0392b;
    background: none;
    position: static;
}

/* ========== جداول ========== */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: right;
    padding: 10px 12px;
    background: var(--secondary);
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #E5E7EB;
    color: var(--dark);
}

.data-table tr:hover {
    background: rgba(198, 164, 63, 0.05);
}

/* ========== وضعیت‌ها ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 600;
}

.badge-pending {
    background: #FEF3C7;
    color: #D97706;
}

.badge-approved {
    background: #D1FAE5;
    color: #059669;
}

.badge-rejected {
    background: #FEE2E2;
    color: #DC2626;
}

/* ========== فرم‌ها ========== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(198, 164, 63, 0.1);
}

/* ========== پیام‌ها ========== */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-right: 3px solid var(--success);
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border-right: 3px solid var(--danger);
}

/* ========== مودال ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 30px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== ریسپانسیو ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        width: 250px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        padding: 12px;
    }
    
    .menu-toggle {
        display: block;
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 101;
        background: var(--primary);
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 20px;
        cursor: pointer;
    }
    
    .date-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .calendar-container {
        padding: 10px;
    }
    
    .calendar-day {
        font-size: 11px;
    }
    
    .calendar-day.disabled::after,
    .calendar-day.past::after {
        font-size: 7px;
    }
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none;
    }
}

/* ========== اسکرول ========== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* استایل متن‌های روی روزهای تقویم */
.calendar-day {
    position: relative;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.calendar-day .booked-text,
.calendar-day .past-text {
    font-size: 8px;
    font-weight: normal;
}

.calendar-day .booked-text {
    color: #EF4444;
}

.calendar-day .past-text {
    color: #9CA3AF;
}

.calendar-day.disabled {
    background: #F3F4F6;
    color: #9CA3AF;
    cursor: not-allowed;
    opacity: 0.7;
}

.calendar-day.past {
    background: #F9FAFB;
    color: #D1D5DB;
    cursor: not-allowed;
    text-decoration: line-through;
}

.calendar-day.empty {
    visibility: hidden;
    pointer-events: none;
}

.calendar-day.today {
    border: 2px solid var(--primary);
    font-weight: 800;
    background: rgba(198, 164, 63, 0.1);
}

.calendar-day.selected-start {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 0 10px 10px 0 ;
}

.calendar-day.selected-end {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 10px 0 0 10px;
}

.calendar-day.in-range {
    background: rgba(198, 164, 63, 0.2);
    border-radius: 0;
}

/* ========== تقویم (سایز مناسب برای لپ‌تاپ) ========== */
.calendar-container {
    background: white;
    border-radius: 18px;
    padding: 15px;
    margin-top: 15px;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

/* برای صفحه‌های بزرگتر از لپ‌تاپ */
@media (min-width: 1200px) {
    .calendar-container {
        max-width: 380px;
    }
}

/* برای لپ‌تاپ معمولی */
@media (min-width: 769px) and (max-width: 1199px) {
    .calendar-container {
        max-width: 350px;
    }
    
    .calendar-day {
        font-size: 12px;
    }
    
    .calendar-nav {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .calendar-month-year {
        font-size: 14px;
    }
    
    .weekday {
        font-size: 11px;
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

.calendar-nav {
    background: var(--light);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.calendar-nav:hover {
    background: var(--primary);
    color: white;
}

.calendar-month-year {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
    padding: 8px 0;
    background: var(--light);
    border-radius: 10px;
}

.weekday {
    font-weight: 600;
    color: var(--gray);
    font-size: 12px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    background: var(--white);
    border: 1px solid #E5E7EB;
}