﻿@font-face {
    font-family: 'Yekan';
    src: url('fonts/W_yekan.eot');
    src: local('☺'), url('fonts/W_yekan.woff') format('woff'), url('fonts/W_yekan.ttf') format('truetype'), url('fonts/W_yekan.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Koodak';
    src: url('fonts/W_koodak.eot');
    src: local('☺'), url('fonts/W_koodak.woff') format('woff'), url('fonts/W_koodak.ttf') format('truetype'), url('fonts/W_koodak.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Tahoma';
    src: url('fonts/W_tahoma.eot');
    src: local('☺'), url('fonts/W_tahoma.woff') format('woff'), url('fonts/W_tahoma.ttf') format('truetype'), url('fonts/W_tahoma.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

.Yekan {
    font-family: Yekan !important;
}

.Koodak {
    font-family: Koodak !important;
}

.Tahoma {
    font-family: Tahoma !important;
}

/* ══════════════════════════════════════════════
   سیستم نوبت‌دهی - استایل‌ها
   ══════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: url('bd.png');
    font-variant-numeric: normal;
    overflow-x: hidden; /* ← جلوگیری از اسکرول افقی */
}

input:disabled,
input[readonly],
input:empty:not(:placeholder-shown) {
    /* این بخش بیشتر برای جلوگیری از استایل‌دهی پیش‌فرض مرورگر است */
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

/* ─── هدر ─── */
.header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 16px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    text-align: center;
    flex-grow: 1;
}

    .header-content h2 {
        margin: 0;
        font-size: 1.1rem;
        color: #2c3e50;
    }

.today-info {
    margin-top: 5px;
    font-size: clamp(0.65rem, 1.5vw, 0.8rem);
    color: #6c757d;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 15px;
    display: inline-block;
}

    .today-info .highlight {
        color: #d63384;
        font-weight: bold;
    }

/* گریدها باید فضای باقی‌مانده را پر کنند و اسکرول داخلی داشته باشند */
.months-grid, .days-grid, .time-slots-grid {
    padding-top: 10px;
    flex-grow: 1; /* فضای خالی را پر می‌کند */
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

    .logo i {
        font-size: 1.4rem;
    }

/* ─── محتوای اصلی ─── */
.main-content {
    flex: 1;
    padding: 24px 0;
    overflow: hidden; /* ← اضافه شد: جلوگیری از اسکرول افقی و عمودی */
    position: relative; /* ← اضافه شد: برای positioning صحیح فرزندان */
}

/* ─── فوتر ─── */
.footer {
    background: #1a1a2e;
    color: white;
    text-align: center;
    padding: 16px 0;
    font-size: 0.9rem;
}

/* ══════════════════════════════════════════════
   تب‌های پزشکان
   ══════════════════════════════════════════════ */
.doctor-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(6px, 1.2vw, 10px);
    margin-bottom: 24px;
    position: relative;
    z-index: 10;
}

.doctor-tab {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

    .doctor-tab:hover {
        border-color: #2563eb;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    }

    .doctor-tab.active {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        color: white;
        border-color: #2563eb;
    }
    /* ─── تب با پروفایل ─── */
    .doctor-tab.has-profile {
        display: flex;
        align-items: center;
        gap: clamp(6px, 1.5vw, 12px);
        padding: clamp(6px, 1.5vw, 10px) clamp(8px, 2vw, 14px);
        text-align: right;
    }

        .doctor-tab.has-profile .profile-image {
            width: clamp(48px, 8vw, 100px);
            height: clamp(48px, 8vw, 100px);
            border-radius: 50%;
            overflow: hidden;
            border: 3px solid rgba(37, 99, 235, 0.3);
            flex-shrink: 0;
        }

            .doctor-tab.has-profile .profile-image img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }

        .doctor-tab.has-profile.active .profile-image {
            border-color: rgba(255, 255, 255, 0.5);
        }

        .doctor-tab.has-profile .profile-info {
            display: flex;
            flex-direction: column;
        }

            .doctor-tab.has-profile .profile-info .name {
                font-size: clamp(0.7rem, 1.6vw, 0.95rem);
            }

            .doctor-tab.has-profile .profile-info .specialty {
                font-size: clamp(0.6rem, 1.3vw, 0.75rem);
                opacity: 0.8;
                margin-top: 2px;
            }

/* ══════════════════════════════════════════════
   تقویم
   ══════════════════════════════════════════════ */

.calendar-wrapper {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: visible;
    display: flex;
    flex-direction: column;
}

    .calendar-wrapper::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(16, 185, 129, 0.03) 50%, rgba(37, 99, 235, 0.03) 100%);
        opacity: 0;
        transition: opacity 0.5s ease;
        pointer-events: none;
        z-index: 0;
    }

    .calendar-wrapper.transitioning::before {
        opacity: 1;
    }


/* استایل پایه برای لایه‌ها */
.calendar-view, .year-calendar, .time-slots-page {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    background-color: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
    z-index: 1;
    display: none;
    flex-direction: column;
    padding: clamp(6px, 2vw, 15px) clamp(6px, 3vw, 15px);
    box-sizing: border-box;
}

    .calendar-view.active, .year-calendar.active, .time-slots-page.active {
        display: block;
        animation: slideUp 0.4s ease;
    }

.slide-animate {
    animation: slideUp 0.4s ease;
}

/* ─── تقویم سالانه ─── */
.year-calendar {
    display: none;
}

    .year-calendar.active {
        display: block;
        animation: slideUp 0.4s ease;
    }

/* ─── تقویم ماهانه ─── */
.month-calendar {
    display: none;
}

    .month-calendar.active {
        display: block;
        animation: slideUp 0.4s ease;
    }

/* ─── انیمیشن: اسلاید از پایین به بالا ─── */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(80px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── انیمیشن خروج به بالا ─── */
@keyframes slideOutTop {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.98);
    }
}

/* هدر چسبان */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 20;
    margin-bottom: 10px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

    .calendar-header h2 {
        font-size: clamp(1rem, 2.2vw, 1.5rem);
        align-items: center;
        gap: 10px;
        transition: all 0.3s ease;
    }

        .calendar-header h2 i {
            color: #2563eb;
            transition: transform 0.3s ease;
            margin-left: 9px;
        }

    .calendar-header:hover h2 i {
        transform: rotate(360deg) scale(1.3);
    }

.fa-solid, .fas {
    transition: transform 0.3s ease;
}

    .fa-solid:hover, .fas:hover {
        transform: rotate(360deg) scale(1.3);
    }

.btn-back {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 1px solid #d1d5db;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Yekan', sans-serif;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    overflow: hidden;
}

    .btn-back::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
        transition: left 0.5s ease;
    }

    .btn-back:hover {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        color: white;
        border-color: #2563eb;
        transform: translateX(-3px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

        .btn-back:hover::before {
            left: 100%;
        }

/* استایل دکمه‌های تغییر سال */
.year-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

    .year-nav button {
        background: #007bff;
        color: white;
        border: none;
        padding: 10px 15px;
        border-radius: 5px;
        cursor: pointer;
    }

        .year-nav button:hover {
            background: #2563eb;
            color: white;
        }

    .year-nav span {
        font-size: 2rem;
        min-width: 80px;
        text-align: center;
    }

/* ══════════════════════════════════════════════
   ماه‌های سالانه
   ══════════════════════════════════════════════ */
.months-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(4px, 1vw, 14px);
    width: min(90%, 900px);
    margin: 0 auto;
}

/* ۱. تعریف ترنسفورم پایه برای هاور (بدون تداخل با انیمیشن) */
.month-card {
    background: white;
    border-radius: 12px;
    padding: clamp(10px, 2.5vw, 20px);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    opacity: 0;
    /* ترنسفورم در اینجا قرار می‌گیرد */
    transform: translateY(30px) scale(0.75);
}

    /* ۲. انیمیشن ورود فقط اپاسیتی و موقعیت نهایی را ست می‌کند */
    .month-card.animate-in {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    /* ۳. استایل هاور با اولویت بالا */
    .month-card:hover {
        transform: translateY(-3px) scale(1.03) !important;
        box-shadow: 0 12px 30px rgba(37, 99, 235, 0.2);
    }

    /* رنگ‌بندی فصل‌ها */
    .month-card.spring {
        background: linear-gradient(135deg, #fef3c7, #fde68a);
        border: 2px solid #f59e0b;
    }

    .month-card.summer {
        background: linear-gradient(135deg, #dcfce7, #bbf7d0);
        border: 2px solid #10b981;
    }

    .month-card.fall {
        background: linear-gradient(135deg, #fed7aa, #fdba74);
        border: 2px solid #f97316;
    }

    .month-card.winter {
        background: linear-gradient(135deg, #e0f2fe, #bae6fd);
        border: 2px solid #0ea5e9;
    }

.month-name {
    font-size: clamp(1.3rem, 4vw, 2.5rem);
    margin-bottom: 6px;
    font-weight: 900;
}

/* ══════════════════════════════════════════════
   ناوبری ماهانه
   ══════════════════════════════════════════════ */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

    .month-nav h2 {
        margin: 0;
        min-width: 150px;
        text-align: center;
    }

.month-nav-btn, .day-nav-btn {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #d1d5db;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .month-nav-btn:hover, .day-nav-btn:hover {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        color: white;
        border-color: #2563eb;
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

    .month-nav-btn:active, .day-nav-btn:active {
        transform: scale(0.95);
    }

.days {
    font-size: clamp(0.85rem, 2vw, 1.3rem);
    color: #64748b;
}

/* ══════════════════════════════════════════════
   ناوبری روزانه
   ══════════════════════════════════════════════ */
.day-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0 auto; /* مرکز چین کردن ناوبری */
}

    .day-nav h2 {
        margin: 0;
        min-width: 180px;
        text-align: center;
        font-size: 1.2rem;
        color: #1a1a2e;
    }

.day-nav-btn {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #d1d5db;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .day-nav-btn:hover {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        color: white;
        border-color: #2563eb;
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

    .day-nav-btn:active {
        transform: scale(0.95);
    }

/* ══════════════════════════════════════════════
   دکمه پرینت
   ══════════════════════════════════════════════ */
.btn-print {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Yekan', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

    .btn-print:hover {
        background: #059669;
        transform: translateY(-2px);
    }

    .btn-print:active {
        transform: translateY(0);
    }

/* ══════════════════════════════════════════════
   استایل‌های پرینت
   ══════════════════════════════════════════════ */
@media print {
    /* مخفی کردن همه عناصر غیر از گزارش */
    body * {
        visibility: hidden;
    }

    /* نمایش فقط بخش گزارش */
    #printReportArea,
    #printReportArea * {
        visibility: visible;
    }

    /* پوزیشن و اندازه صفحه */
    #printReportArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20px;
        background: white;
    }

    /* مخفی کردن دکمه‌ها در پرینت */
    .btn-print,
    .btn-back,
    .day-nav-btn,
    .header-actions {
        display: none !important;
    }

    /* تنظیمات جدول */
    .report-table {
        width: 100%;
        border-collapse: collapse;
        font-family: 'Yekan', Tahoma, Arial, sans-serif;
        font-size: 12pt;
    }

        .report-table th,
        .report-table td {
            border: 1px solid #333;
            padding: 10px 8px;
            text-align: center;
        }

        .report-table th {
            background: #f0f0f0;
            font-weight: bold;
        }

        .report-table tr:nth-child(even) {
            background: #f9f9f9;
        }

    .report-header {
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #333;
    }

        .report-header h1 {
            font-size: 18pt;
            margin: 0 0 10px 0;
            color: #1a1a2e;
        }

        .report-header p {
            font-size: 11pt;
            margin: 5px 0;
            color: #555;
        }

    .report-footer {
        margin-top: 20px;
        padding-top: 15px;
        border-top: 1px solid #ccc;
        text-align: center;
        font-size: 10pt;
        color: #888;
    }

    .empty-slot {
        color: #999;
        font-style: italic;
    }

    .booked-slot {
        color: #333;
    }
}

/* ══════════════════════════════════════════════
   تقویم ماهانه
   ══════════════════════════════════════════════ */
/* ─── دکمه برگشت ─── */
.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

    .back-btn:hover {
        background: #2563eb;
        color: white;
    }

/* ─── روزهای هفته ─── */
.weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(3px, 1vw, 6px);
    margin-bottom: 16px;
    position: sticky;
    position: -webkit-sticky;
    top: 75px;
    z-index: 15;
    padding: clamp(6px, 1.5vw, 12px) clamp(4px, 1vw, 8px);
    border-radius: 12px;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

.weekday {
    text-align: center;
    font-size: clamp(0.75rem, 2vw, 2rem);
    padding: 8px 4px;
    background: #1a1a2e;
    color: white;
    border-radius: 6px;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ─── روزهای ماه ─── */
.days-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(3px, 1vw, 6px);
    margin-top: 12px;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

    .days-grid:has(.day-cell:hover) {
        z-index: 16; 
    }

.day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: Yekan;
    position: relative;
    opacity: 0;
    transform: scale(0.8);
    padding: 0;
    width: 100%;
    height: auto;
}

    .day-cell .day-number {
        font-size: clamp(1rem, 3.2vw, 4rem);
        line-height: 1;
    }

    .day-cell .day-gregorian {
        font-size: clamp(0.5rem, 1.3vw, 0.85rem);
        color: #00a3b8;
        margin-top: 6px;
        direction: rtl;
    }

    .day-cell.today .day-gregorian {
        color: #92400e;
    }

    .day-cell.holiday .day-gregorian {
        color: #b91c1c;
    }

    .day-cell.animate-in {
        animation: dayCellPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }

.gregorian-subtitle {
    display: inline-block;
    font-size: clamp(0.6rem, 1.4vw, 0.85rem);
    color: #94a3b8;
    font-weight: normal;
    direction: ltr;
    margin-inline-start: 6px;
    direction: rtl;
}

@keyframes dayCellPop {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }

    70% {
        transform: scale(1.1) rotate(2deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.day-cell:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: scale(1.05);
}

.day-cell.empty {
    opacity: 0.3;
    transform: none;
    animation: none;
}

    .day-cell.empty:hover {
        transform: none;
        background: transparent;
        color: inherit;
        border-color: transparent;
    }

.day-cell.today {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.day-cell.past {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.day-cell:not(.past):not(.empty) {
    cursor: pointer !important;
    pointer-events: auto;
}

.day-cell.holiday:not(.past) {
    cursor: pointer !important;
}

.day-cell.past:hover {
    transform: none;
    background: #f8fafc;
    color: inherit;
    border-color: #e2e8f0;
}

/* ─── روزهای تعطیل ─── */
.day-cell.holiday {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

    .day-cell.holiday:hover {
        background: #dc2626;
        color: white;
        border-color: #dc2626;
    }

    .day-cell.holiday.today {
        background: #fef3c7;
        border-color: #f59e0b;
        color: #92400e;
    }

/* ─── روز مناسبتی ─── */
.day-cell.has-event {
    position: relative;
}

    .day-cell.has-event::after {
        content: '';
        position: absolute;
        top: 1px;
        left: 1px;
        width: 9px;
        height: 9px;
        background: #3b82f6;
        border-radius: 50%;
    }

/* ─── نقطه تعطیلات رسمی ─── */
.day-cell.has-holiday-dot::after {
    background: #dc2626;
}

/* ══════════════════════════════════════════════
   تولتیپ مدرن (تنظیم برای سایز کوچکتر)
   ══════════════════════════════════════════════ */
.day-cell[data-tooltip] {
    cursor: pointer;
    position: relative;
}

    .day-cell[data-tooltip]:hover .custom-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

.custom-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    white-space: normal;
    width: max-content;
    max-width: 240px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

    .custom-tooltip.tooltip-red {
        background: linear-gradient(135deg, #dc2626, #b91c1c);
        box-shadow: 0 20px 80px rgba(220, 38, 38, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.1);
    }

    .custom-tooltip .tooltip-arrow {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 12px solid transparent;
        border-top-color: #334155;
    }

    .custom-tooltip.tooltip-red .tooltip-arrow {
        border-top-color: #b91c1c;
    }


/* ══════════════════════════════════════════════
   صفحه زمان‌بندی
   ══════════════════════════════════════════════ */
.time-slots-page {
    display: none;
    animation: slideUp 0.4s ease;
}

    .time-slots-page.active {
        display: block;
    }

.time-slots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.time-slots-date {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .time-slots-date h2 {
        font-size: 1.2rem;
        color: #1a1a2e;
    }

    .time-slots-date i {
        color: #2563eb;
        font-size: 1.4rem;
    }

.time-slots-info {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: clamp(0.7rem, 1.8vw, 0.95rem);
}

    .info-item i {
        color: #2563eb;
    }

/* ─── گرید زمان‌ها ─── */
.time-slots-grid {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.time-row {
    display: grid;
    grid-template-columns: minmax(40px, 80px) repeat(6, minmax(0, 1fr));
    border-bottom: 1px solid #e2e8f0;
    opacity: 0;
    transform: translateY(20px);
}

    .time-row.animate-in {
        animation: rowSlideIn 0.5s ease forwards;
    }

@keyframes rowSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.time-row:last-child {
    border-bottom: none;
}

.time-row:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.time-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(6px, 1.5vw, 12px) clamp(3px, 1vw, 8px);
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    font-size: clamp(0.7rem, 2.2vw, 1.3rem);
    color: #475569;
    border-left: 1px solid #e2e8f0;
    font-family: 'Yekan', sans-serif;
}

.time-slot {
    padding: clamp(6px, 1.5vw, 12px) clamp(3px, 1vw, 8px);
    text-align: center;
    border-left: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: clamp(0.7rem, 2.2vw, 1.3rem);
    color: #64748b;
    position: relative;
    opacity: 0;
    transform: translateX(-20px);
}

    .time-slot.animate-in {
        animation: slotSlideIn 0.4s ease forwards;
    }

@keyframes slotSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.time-slot:hover:not(.booked) {
    background: #2563eb;
    color: white;
}

.time-slot.booked {
    background-color: #e5e7eb;
    color: #374151;
    cursor: default;
}

.time-slot.available {
    color: #10b981;
}
/* ساعتی که توسط کاربر دیگری قفل شده است */
.time-slot.reserved {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}
/* ساعتی که توسط خود کاربر جاری قفل شده است */
.time-slot.my-reservation {
    background-color: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ─── اطلاعات داخل سلول‌های زمان‌بندی ─── */
.time-slot .patient-name {
    display: block;
    font-size: clamp(0.55rem, 1.6vw, 0.9rem);
    margin-top: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
}

.time-slot .patient-phone {
    display: block;
    font-size: clamp(0.5rem, 1.4vw, 0.8rem);
    margin-top: 2px;
    direction: ltr;
    color: #6b7280;
}

.time-slot.booked .patient-phone {
    color: #4b5563;
}

/* ══════════════════════════════════════════════
   مودال ثبت نوبت
   ══════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .modal-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    transform: scale(0.9);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

    .modal-header h3 {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: clamp(0.85rem, 2vw, 1.1rem);
        margin: 0;
    }

.modal-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: all 0.2s ease;
}

    .modal-close:hover {
        transform: scale(1.2);
    }

.modal-body {
    padding: 20px;
}

.selected-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #f0f9ff;
    border-radius: 10px;
    color: #2563eb;
    margin-bottom: 20px;
}

    .selected-time i {
        font-size: 1.1rem;
    }

/* ─── هدر حالت مشاهده ─── */
.view-mode-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 10px;
    color: #92400e;
    font-size: clamp(0.85rem, 2vw, 1.3rem);
    margin-bottom: 16px;
}

    .view-mode-header i {
        color: #f59e0b;
    }

.form-group {
    margin-bottom: 16px;
}

    .form-group label {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 6px;
        font-size: 0.9rem;
        color: #475569;
    }

        .form-group label i {
            color: #94a3b8;
        }

    .form-group input {
        width: 100%;
        padding: 12px 14px;
        border: 2px solid #e2e8f0;
        border-radius: 10px;
        font-size: 1rem;
        font-family: inherit;
        transition: all 0.2s ease;
    }

        .form-group input:focus {
            outline: none;
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .form-group input::placeholder {
            color: #94a3b8;
        }

        .form-group input[readonly] {
            background-color: #f1f5f9 !important;
            color: #64748b !important;
            cursor: not-allowed !important;
            border-color: #e2e8f0 !important;
        }

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-cancel,
.btn-submit {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: clamp(0.85rem, 2vw, 1rem);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

    .btn-cancel:hover {
        background: #e2e8f0;
    }

.btn-submit {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

    .btn-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }


/* ─── تعداد نوبت‌ها در کارت ماه ─── */
.month-card .appointment-count {
    font-size: clamp(0.75rem, 1.8vw, 1.2rem);
    color: #64748b;
    margin-top: 4px;
    min-height: 1.5em;
    line-height: 1.5;
}

/* ─── تعداد نوبت در روز ─── */
.day-cell.has-appointments {
    position: relative;
}

.day-appointment-count {
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    color: white;
    font-size: clamp(0.55rem, 1.8vw, 1rem);
    padding: 2px 4px;
    border-radius: 4px;
    width: max-content;
    text-align: center;
    white-space: nowrap;
}

.day-cell.past .day-appointment-count {
    background: #94a3b8;
}

.day-cell.holiday .day-appointment-count {
    background: #dc2626;
}

/* ─── فرمت شماره تلفن ─── */
.patient-phone {
    display: block;
    font-size: 1.3rem;
    color: #64748b;
    direction: ltr;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════
   ریسپانسیو - تبلت
   ══════════════════════════════════════════════ */

@media (max-width: 1130px) {
    .weekday {
        width: 125px;
        height: 55px;
        font-size: 1.7rem;
    }

    .day-cell {
        width: 125px;
        height: 125px;
        font-size: 3.5rem;
    }
}

@media (max-width: 950px) {
    .weekday {
        width: 125px;
        height: 50px;
        font-size: 1.4rem;
    }

    .day-cell {
        width: 125px;
        height: 125px;
        font-size: 3rem;
    }

    .day-appointment-count {
        font-size: 0.85rem;
        padding: 1px 3px;
    }
}

@media (max-width: 700px) {
    .weekday {
        width: 75px;
        height: 45px;
        font-size: 1.1rem;
    }

    .day-cell {
        width: 75px;
        height: 75px;
        font-size: 2.2rem;
        border-width: 1px;
    }

    .day-appointment-count {
        font-size: 0.7rem;
        padding: 1px 2px;
        bottom: -2px;
    }

    .custom-tooltip {
        font-size: 1rem;
        padding: 6px 10px;
        max-width: 180px;
    }
}

@media (max-width: 480px) {

    .month-nav {
        display: grid;
    }

    .calendar-header {
        display: block;
    }

    btn-back {
        margin-bottom: 30px !important;
    }

    .patient-phone {
        font-size: 1.3rem;
        letter-spacing: 1px;
    }

    .time-slot .patient-name {
        font-size: 1.3rem;
        max-width: 50px;
    }

    .months-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .doctor-tab.has-profile .profile-info .name {
        font-size: 0.8rem;
    }

    .doctor-tab.has-profile .profile-info .specialty {
        font-size: 0.65rem;
    }

    .month-card {
        padding: 14px 10px;
    }

    .year-nav span {
        font-size: 1.2rem;
    }

    .weekday {
        width: 100%;
        height: 40px;
        font-size: 0.85rem;
        border-radius: 4px;
    }

    .day-cell {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        font-size: 1.6rem;
        border-width: 1px;
        border-radius: 4px;
    }

    .day-appointment-count {
        font-size: 0.6rem;
        padding: 1px 2px;
        bottom: 0;
        border-radius: 0 0 4px 4px;
        width: 100%;
        left: 0;
        transform: none;
    }

    .custom-tooltip {
        font-size: 0.85rem;
        padding: 5px 8px;
        max-width: 140px;
    }

        .custom-tooltip .tooltip-arrow {
            border-width: 8px;
        }
}

/* ══════════════════════════════════════════════
   تزئینات پس‌زمینه calendar-wrapper
   (برای همه لایه‌ها)
   ══════════════════════════════════════════════ */

/* پس‌زمینه الگوی تقویمی */
.calendar-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 15% 85%, rgba(37, 99, 235, 0.08) 0%, transparent 40%), radial-gradient(circle at 85% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%), radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* خطوط راهنمای تقویمی */
.calendar-decoration-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.06) 15%, rgba(37, 99, 235, 0.06) 85%, transparent);
    height: 1px;
    width: 100%;
    left: 0;
    z-index: 0;
}

    .calendar-decoration-line:nth-child(1) {
        top: 12%;
    }

    .calendar-decoration-line:nth-child(2) {
        top: 28%;
    }

    .calendar-decoration-line:nth-child(3) {
        top: 44%;
    }

    .calendar-decoration-line:nth-child(4) {
        top: 60%;
    }

    .calendar-decoration-line:nth-child(5) {
        top: 76%;
    }

    .calendar-decoration-line:nth-child(6) {
        top: 92%;
    }

/* عناصر تزئینی شناور */
.floating-decoration {
    position: absolute;
    opacity: 0.12;
    color: #2563eb;
    animation: floatGently 8s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

    .floating-decoration:nth-child(1) {
        top: 5%;
        right: 2%;
        font-size: 120px;
        animation-delay: 0s;
        animation-duration: 10s;
    }

    .floating-decoration:nth-child(2) {
        top: 20%;
        left: 1%;
        font-size: 90px;
        animation-delay: 1.5s;
        animation-duration: 12s;
        color: #10b981;
    }

    .floating-decoration:nth-child(3) {
        top: 45%;
        right: 5%;
        font-size: 80px;
        animation-delay: 3s;
        animation-duration: 9s;
    }

    .floating-decoration:nth-child(4) {
        top: 65%;
        left: 2%;
        font-size: 100px;
        animation-delay: 4.5s;
        animation-duration: 11s;
        color: #8b5cf6;
    }

    .floating-decoration:nth-child(5) {
        top: 80%;
        right: 3%;
        font-size: 85px;
        animation-delay: 2s;
        animation-duration: 10s;
    }

    .floating-decoration:nth-child(6) {
        top: 35%;
        left: 5%;
        font-size: 70px;
        animation-delay: 5s;
        animation-duration: 13s;
        color: #f59e0b;
    }

@keyframes floatGently {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    }

    25% {
        transform: translateY(-15px) translateX(5px) rotate(4deg) scale(1.05);
    }

    50% {
        transform: translateY(-25px) translateX(-2px) rotate(-2deg) scale(1.1);
    }

    75% {
        transform: translateY(-12px) translateX(7px) rotate(5deg) scale(1.03);
    }
}

/* کادر تزئینی دور تقویم */
.calendar-decorative-frame {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px dashed rgba(37, 99, 235, 0.15);
    border-radius: 16px;
    z-index: 0;
}

/* گوشه‌های تزئینی */
.calendar-corner {
    position: absolute;
    width: 50px;
    height: 50px;
    border-color: rgba(37, 99, 235, 0.25);
    border-style: solid;
    border-width: 0;
    z-index: 0;
}

    .calendar-corner.top-left {
        top: 3px;
        left: 3px;
        border-top-width: 3px;
        border-left-width: 3px;
        border-top-left-radius: 12px;
    }

    .calendar-corner.top-right {
        top: 3px;
        right: 3px;
        border-top-width: 3px;
        border-right-width: 3px;
        border-top-right-radius: 12px;
    }

    .calendar-corner.bottom-left {
        bottom: 3px;
        left: 3px;
        border-bottom-width: 3px;
        border-left-width: 3px;
        border-bottom-left-radius: 12px;
    }

    .calendar-corner.bottom-right {
        bottom: 3px;
        right: 3px;
        border-bottom-width: 3px;
        border-right-width: 3px;
        border-bottom-right-radius: 12px;
    }

/* دایره‌های تزئینی پس‌زمینه */

.decorative-circle,
.decorative-strip,
.calendar-decorative-frame,
.calendar-corner,
.calendar-decoration-line,
.decorative-dots,
.decorative-star,
.floating-particle,
.floating-decoration,
.decorative-watermark {
    pointer-events: none !important;
}

.decorative-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    background: #2563eb;
    animation: pulseCircle 6s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

    .decorative-circle:nth-child(1) {
        width: 300px;
        height: 300px;
        top: -80px;
        right: -80px;
        animation-delay: 0s;
    }

    .decorative-circle:nth-child(2) {
        width: 250px;
        height: 250px;
        bottom: -60px;
        left: -60px;
        background: #10b981;
        animation-delay: 2s;
    }

    .decorative-circle:nth-child(3) {
        width: 180px;
        height: 180px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: #8b5cf6;
        animation-delay: 4s;
    }

@keyframes pulseCircle {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.06;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.1;
    }
}

/* متن واترمارک */
.decorative-watermark {
    position: absolute;
    font-size: 180px;
    font-family: 'Yekan', sans-serif;
    font-weight: bold;
    color: rgba(37, 99, 235, 0.04);
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    animation: watermarkPulse 8s ease-in-out infinite;
    z-index: 0;
    overflow: hidden;
}

    .decorative-watermark.top-watermark {
        top: 15%;
        left: 50%;
        transform: translateX(-50%) rotate(-5deg);
        animation-delay: 0s;
    }

    .decorative-watermark.bottom-watermark {
        bottom: 5%;
        left: 50%;
        transform: translateX(-50%) rotate(5deg);
        animation-delay: 4s;
    }

@keyframes watermarkPulse {
    0%, 100% {
        opacity: 0.04;
        transform: translateX(-50%) rotate(-5deg) scale(1);
    }

    50% {
        opacity: 0.07;
        transform: translateX(-50%) rotate(-3deg) scale(1.05);
    }
}

/* نوار تزئینی بالا و پایین */
.decorative-strip {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, rgba(37, 99, 235, 0.15) 15%, rgba(37, 99, 235, 0.25) 50%, rgba(37, 99, 235, 0.15) 85%, transparent 100%);
    animation: stripGlow 4s ease-in-out infinite;
    z-index: 0;
}

    .decorative-strip.top-strip {
        top: 0;
    }

    .decorative-strip.bottom-strip {
        bottom: 0;
    }

@keyframes stripGlow {
    0%, 100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* نقطه‌چین‌های تزئینی */
.decorative-dots {
    position: absolute;
    display: flex;
    gap: 12px;
    animation: dotsBounce 3s ease-in-out infinite;
    z-index: 0;
}

    .decorative-dots.left-dots {
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        flex-direction: column;
    }

    .decorative-dots.right-dots {
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        flex-direction: column;
        animation-delay: 1.5s;
    }

    .decorative-dots span {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: rgba(37, 99, 235, 0.15);
    }

        .decorative-dots span:nth-child(2) {
            background: rgba(37, 99, 235, 0.25);
            animation-delay: 0.3s;
        }

        .decorative-dots span:nth-child(3) {
            background: rgba(37, 99, 235, 0.35);
            animation-delay: 0.6s;
        }

@keyframes dotsBounce {
    0%, 100% {
        transform: translateY(-50%) translateX(0);
    }

    50% {
        transform: translateY(-55%) translateX(3px);
    }
}

/* ستاره‌های تزئینی */
.decorative-star {
    position: absolute;
    font-size: 300px;
    color: rgba(37, 99, 235, 0.1);
    animation: twinkle 180s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

    .decorative-star:nth-child(1) {
        top: 15%;
        left: 20%;
        animation-delay: 0s;
    }

    .decorative-star:nth-child(2) {
        top: 30%;
        right: 25%;
        animation-delay: 0.5s;
        font-size: 15px;
    }

    .decorative-star:nth-child(3) {
        top: 55%;
        left: 15%;
        animation-delay: 1s;
        font-size: 25px;
    }

    .decorative-star:nth-child(4) {
        top: 70%;
        right: 20%;
        animation-delay: 1.5s;
    }

    .decorative-star:nth-child(5) {
        top: 85%;
        left: 25%;
        animation-delay: 2s;
        font-size: 18px;
    }

@keyframes twinkle {
    0%, 100% {
        opacity: 0.1;
        transform: scale(1) rotate(0deg);
        left: 0;
    }

    50% {
        opacity: 0.3;
        transform: scale(2) rotate(720deg);
        left: 900px; /* ← کاهش حرکت برای ماندن در محدوده */
    }
}

/* ذرات متحرک */
.floating-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(37, 99, 235, 0.2);
    border-radius: 50%;
    animation: particleFloat 15s linear infinite;
    z-index: 0;
    pointer-events: none;
}

    .floating-particle:nth-child(1) {
        left: 10%;
        animation-duration: 18s;
        animation-delay: 0s;
    }

    .floating-particle:nth-child(2) {
        left: 30%;
        animation-duration: 22s;
        animation-delay: 3s;
        width: 4px;
        height: 4px;
    }

    .floating-particle:nth-child(3) {
        left: 50%;
        animation-duration: 20s;
        animation-delay: 6s;
    }

    .floating-particle:nth-child(4) {
        left: 70%;
        animation-duration: 25s;
        animation-delay: 9s;
        width: 8px;
        height: 8px;
    }

    .floating-particle:nth-child(5) {
        left: 90%;
        animation-duration: 19s;
        animation-delay: 12s;
        width: 5px;
        height: 5px;
    }

@keyframes particleFloat {
    0% {
        bottom: -10px;
        opacity: 0;
    }

    10% {
        opacity: 0.3;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        bottom: calc(100% + 10px); /* ← محدود کردن به داخل wrapper */
        opacity: 0;
    }
}

.weekday .wd-short {
    display: none;
}

@media (max-width: 420px) {
    .weekday .wd-full {
        display: none;
    }

    .weekday .wd-short {
        display: inline;
    }
}

/* ══════════════════════════════════════════════
   لایه‌ی شماره تخت‌ها
   ══════════════════════════════════════════════ */
.beds-page {
    display: none;
    animation: slideUp 0.4s ease;
}

    .beds-page.active {
        display: block;
    }

.beds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: clamp(4px, 1vw, 10px);
    padding: 10px 0;
}

.bed-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: clamp(0.8rem, 2.5vw, 1.3rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.8);
    text-align: center;
}

    .bed-cell.animate-in {
        opacity: 1;
        transform: scale(1);
    }

    .bed-cell:hover:not(.booked):not(.reserved) {
        background: #2563eb;
        color: white;
        border-color: #2563eb;
        transform: scale(1.05);
    }

    .bed-cell.booked {
        background: #e5e7eb;
        color: #374151;
    }

    .bed-cell.reserved {
        background-color: #f3f4f6 !important;
        border-color: #d1d5db !important;
        color: #9ca3af !important;
        cursor: not-allowed !important;
        opacity: 0.6;
    }

    .bed-cell.my-reservation {
        background-color: #ef4444 !important;
        border-color: #dc2626 !important;
        color: #ffffff !important;
        animation: pulse-red 2s infinite;
    }

    .bed-cell .bed-patient {
        font-size: 0.6em;
        margin-top: 2px;
        max-width: 90%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* وضعیت‌های سلول ساعت (اکنون بر اساس تعداد تخت رزروشده) */
.time-slot.full {
    background-color: #fee2e2;
    color: #991b1b;
}

.time-slot.partial {
    background-color: #fef9c3;
    color: #854d0e;
}

.slot-count {
    display: block;
    font-size: 0.75em;
    margin-top: 2px;
    opacity: 0.8;
}

/* ══════════════════════════════════════════════
   لایه‌ی زمان‌بندی روز (Gantt)
   ══════════════════════════════════════════════ */
.gantt-page {
    padding: 10px;
    display: none;
    animation: slideUp 0.4s ease;
}

    .gantt-page.active {
        display: block;
    }

.gantt-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 10px;
    font-size: clamp(0.7rem, 1.6vw, 0.9rem);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

    .legend-dot.not-arrived {
        background: #94a3b8;
    }

    .legend-dot.in-progress {
        background: #f59e0b;
    }

    .legend-dot.completed {
        background: #10b981;
    }

.gantt-scroll-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: white;
    cursor: grab;
    user-select: none;
}

    .gantt-scroll-wrapper.dragging {
        cursor: grabbing;
    }

.gantt-header-row {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #1a1a2e;
    color: white;
}

.gantt-corner-cell {
    width: 92px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-inline-end: 1px solid rgba(255,255,255,0.2);
    position: sticky;
    inset-inline-start: 0;
    background: #1a1a2e;
    z-index: 11;
}

.gantt-hours-track {
    display: flex;
}

.gantt-hour-mark {
    flex-shrink: 0;
    text-align: center;
    padding: 10px 0;
    font-size: 0.85rem;
    border-inline-end: 1px dashed rgba(255,255,255,0.15);
}

.gantt-rows-wrapper {
    display: flex;
    flex-direction: column;
}

.gantt-row {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    min-height: 46px;
}

.gantt-bed-label {
    width: 92px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 4px;
    background: #f8fafc;
    border-inline-end: 1px solid #e2e8f0;
    font-weight: bold;
    font-size: clamp(0.65rem, 1.6vw, 0.9rem);
    text-align: center;
    line-height: 1.2;
    position: sticky;
    inset-inline-start: 0;
    z-index: 5;
}

.bed-add-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #2563eb;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .bed-add-btn:hover {
        background: #1d4ed8;
        transform: scale(1.15);
    }

.gantt-track {
    position: relative;
}

.gantt-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f1f5f9;
}

.gantt-block {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 6px;
    color: white;
    font-size: clamp(0.6rem, 1.3vw, 0.8rem);
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.15s ease;
    text-align: center;
}

    .gantt-block:hover {
        transform: scale(1.03);
        z-index: 8;
    }

    .gantt-block .block-name {
        text-overflow: ellipsis;
        transition: all 0.15s ease;
    }

        .gantt-block .block-name:hover {
            font-size: 1.5em;
        }

    .gantt-block .block-time {
        font-size: 0.85em;
        opacity: 0.9;
    }

    .gantt-block.status-not-arrived {
        background: #94a3b8;
    }

    .gantt-block.status-in-progress {
        background: #f59e0b;
    }

    .gantt-block.status-completed {
        background: #10b981;
    }

/* دکمه‌های وضعیت داخل مودال */
.status-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.status-btn {
    flex: 1;
    padding: 8px 6px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: clamp(0.65rem, 1.6vw, 0.85rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

    .status-btn.not-arrived.active {
        border-color: #94a3b8;
        background: #94a3b8;
        color: white;
    }

    .status-btn.in-progress.active {
        border-color: #f59e0b;
        background: #f59e0b;
        color: white;
    }

    .status-btn.completed.active {
        border-color: #10b981;
        background: #10b981;
        color: white;
    }

.form-row {
    display: flex;
    gap: 10px;
}

    .form-row .form-group {
        flex: 1;
    }

.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
}

.btn-delete {
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: #fee2e2;
    color: #dc2626;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.2s ease;
}

    .btn-delete:hover {
        background: #dc2626;
        color: white;
    }

/* ══════════════════════════════════════════════
   جست‌وجوی بیمار
   ══════════════════════════════════════════════ */
.global-search-btn {
    position: fixed;
    bottom: 24px;
    inset-inline-start: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

    .global-search-btn:hover {
        transform: scale(1.08);
        box-shadow: 0 8px 26px rgba(37, 99, 235, 0.55);
    }

.search-modal-content {
    max-width: 480px;
    width: 100%;
}

.search-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

    .search-input-row input {
        flex: 1;
        padding: 12px 14px;
        border: 2px solid #e2e8f0;
        border-radius: 10px;
        font-size: 1rem;
        font-family: inherit;
    }

        .search-input-row input:focus {
            outline: none;
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

.search-go-btn {
    width: 46px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

    .search-go-btn:hover {
        transform: translateY(-1px);
    }

.search-results-box {
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-hint {
    text-align: center;
    color: #94a3b8;
    padding: 24px 10px;
    font-size: 0.9rem;
}

.search-result-item {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .search-result-item:hover {
        border-color: #2563eb;
        background: #f0f9ff;
        transform: translateX(-2px);
    }

.search-result-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.search-result-name {
    font-weight: bold;
    font-size: 1rem;
}

.search-result-phone {
    color: #64748b;
    font-size: 0.85rem;
    direction: ltr;
}

.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
    color: #64748b;
}

    .search-result-meta i {
        margin-inline-end: 3px;
        color: #94a3b8;
    }

.search-result-status {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: white;
}

    .search-result-status.status-not-arrived {
        background: #94a3b8;
    }

    .search-result-status.status-in-progress {
        background: #f59e0b;
    }

    .search-result-status.status-completed {
        background: #10b981;
    }

@media (max-width: 480px) {
    .global-search-btn {
        width: 48px;
        height: 48px;
        bottom: 16px;
        inset-inline-start: 16px;
        font-size: 1.1rem;
    }
}

.gantt-row:nth-child(16) .gantt-bed-label,
.gantt-row:nth-child(17) .gantt-bed-label {
    background: #dcfce7;
    color: #166534;
}

.gantt-row:nth-child(18) .gantt-bed-label,
.gantt-row:nth-child(19) .gantt-bed-label {
    background: #fce7f3;
    color: #9d174d;
}

.gantt-rows-wrapper {
    position: relative;
}

.gantt-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #f97316;
    z-index: 20;
    pointer-events: none;
}

    .gantt-now-line::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #f97316;
        box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
    }

.gantt-hour-mark.current-hour {
    background: #f59e0b;
    color: #1a1a2e;
    font-weight: bold;
}

.day-cell .day-hijri {
    font-size: clamp(0.45rem, 1.2vw, 0.75rem);
    color: #7c3aed;
    margin-top: 6px;
    line-height: 1;
    direction: rtl;
}

.day-cell.today .day-hijri {
    color: #92400e;
}

.day-cell.holiday .day-hijri {
    color: #b91c1c;
}

.month-hijri-range {
    font-size: clamp(0.55rem, 1.4vw, 0.8rem);
    color: #7c3aed;
    margin-bottom: 4px;
}

#selectedDayInfoBox .highlight {
    display: inline-block;
    margin-top: 2px;
}

.gantt-container {
    text-align: center;
    text-align: -webkit-center;
}