/* static/css/pages/booking.css */
/* Layout کلی صفحه رزرو */

.booking-page {
    direction: rtl;
    text-align: right;
    max-width: 960px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
}

.booking-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #0f172a;
}

/* پیام‌های بالای صفحه */

.booking-messages {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    display: none;
}

.booking-messages--info,
.booking-messages--success,
.booking-messages--error,
.booking-messages--warning { display: block; }

.booking-messages--info { background: #eff6ff; color: #1d4ed8; }
.booking-messages--success { background: #ecfdf5; color: #047857; }
.booking-messages--error { background: #fef2f2; color: #b91c1c; }
.booking-messages--warning { background: #fffbeb; color: #92400e; border: 1px solid #f59e0b; }

/* بخش‌ها */

.booking-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed #e5e7eb;
}

.booking-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.booking-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #111827;
}

/* انتخاب خدمت */

.booking-service-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.booking-service-card {
    flex: 0 0 auto;
    /* min-width: 140px; */
    max-width: 240px;
    width: auto;
    border-radius: 0.7rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    text-align: right;
    transition: all 0.15s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 36px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.booking-service-input {
    display: none;
}

.booking-service-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
    white-space: nowrap;
}

.booking-service-meta {
    font-size: 0.78rem;
    color: #6b7280;
}

.booking-service-card:hover {
    border-color: #60a5fa;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.booking-service-card:has(.booking-service-input:checked),
.booking-service-card--active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2), 0 6px 14px rgba(37, 99, 235, 0.12);
}

/* گروه رادیویی (شهر، کلینیک) */

.booking-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.booking-radio-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.65rem;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.12s ease-in-out;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.booking-radio-item input {
    accent-color: #2563eb;
}

.booking-radio-item:hover {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
}

.booking-radio-item--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.booking-radio-label {
    white-space: nowrap;
}

/* تاریخ و Day Strip */

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 10px;
}

.calendar-day {
    padding: 8px 4px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    text-align: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.12s ease-in-out;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: relative;
}

.slot-count {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #059669;
    background: #ecfdf5;
    padding: 1px 4px;
    border-radius: 4px;
    min-width: 16px;
    text-align: center;
}

.calendar-day:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.calendar-day.selected {
    background: #1976d2;
    border-color: #1565c0;
    color: #ffffff;
}

.calendar-day.available {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.calendar-day.available:hover {
    background: #bbf7d0;
}

.calendar-day.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

.booking-date-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    max-width: 260px;
}

.booking-label {
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.1rem;
}

.booking-date-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border-radius: 0.7rem;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
    direction: ltr;
    text-align: left;
}

.booking-date-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.booking-date-hint {
    font-size: 0.75rem;
    color: #6b7280;
}

.booking-day-strip {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0.3rem 0.1rem;
    scrollbar-width: thin;
}

.booking-day-strip::-webkit-scrollbar {
    height: 6px;
}

.booking-day-strip::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 9999px;
}

.booking-day-item {
    min-width: 42px;
    border-radius: 0.8rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 0.35rem 0.4rem;
    font-size: 0.75rem;
    color: #111827;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    transition: all 0.12s ease-in-out;
}

.booking-day-item__day {
    font-weight: 500;
    color: #6b7280;
}

.booking-day-item__date {
    font-weight: 700;
    font-size: 0.9rem;
}

.booking-day-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.booking-day-item--selected {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.booking-day-item--selected .booking-day-item__day {
    color: #e5e7eb;
}

.booking-day-item--disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* اسلات‌ها */

.booking-slots-container {
    min-height: 48px;
}

.booking-slots-placeholder {
    font-size: 0.85rem;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 0.6rem 0.75rem;
}

.booking-slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.booking-slot-btn {
    min-width: 92px;
    padding: 0.35rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.12s ease-in-out;
}

.booking-slot-btn--available {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.booking-slot-btn--available:hover {
    background: #bbf7d0;
}

.booking-slot-btn--selected {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}

.booking-slot-btn--disabled {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* فرم بیمار */

.booking-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.booking-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
}

.booking-form-field {
    display: flex;
    flex-direction: column;
}

.booking-form-field-full {
    grid-column: 1 / -1;
}

.booking-input,
.booking-textarea {
    border-radius: 0.7rem;
    border: 1px solid #d1d5db;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    background: #ffffff;
}

.booking-input:focus,
.booking-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.booking-textarea {
    resize: vertical;
}

/* دکمه ثبت */

.booking-submit-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.booking-submit-btn {
    padding: 0.55rem 1.4rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s ease-in-out, transform 0.06s ease-in-out;
}

.booking-submit-btn:hover {
    background: #1d4ed8;
}

.booking-submit-btn:active {
    transform: scale(0.98);
}

.booking-submit-btn--loading {
    opacity: 0.7;
    cursor: wait;
}

.booking-submit-status {
    font-size: 0.8rem;
}

.booking-submit-status--info {
    color: #2563eb;
}

.booking-submit-status--success {
    color: #15803d;
}

.booking-submit-status--error {
    color: #b91c1c;
}

/* Reception list / manage */
.reception-page {
    max-width: 1200px;
}

.reception-title {
    margin-bottom: 0.3rem;
}

.reception-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    align-items: flex-end;
    margin: 0.6rem 0 0.4rem;
}

.reception-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.reception-input {
    border-radius: 0.7rem;
    border: 1px solid #d1d5db;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    min-width: 140px;
    background: #ffffff;
}

.reception-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.reception-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reception-search {
    flex: 1 1 180px;
    min-width: 180px;
}

.reception-search input {
    width: 100%;
}

.booking-submit-btn--compact {
    padding: 0.4rem 1rem;
    font-weight: 600;
}

.btn-link{
    font-size: 0.8rem;
    color: #2563eb;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

.text-muted {
    color: #9ca3af;
    font-size: 0.8rem;
}

.pagination {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.8rem;
}

/* Summary bar */

.reception-summary {
    margin: 0.5rem 0 1rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.summary-title {
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 0.4rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
}

.summary-card {
    border-radius: 0.75rem;
    padding: 0.4rem 0.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.summary-card--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.summary-card--warning {
    background: #fffbeb;
    border-color: #fed7aa;
}

.summary-card--muted {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.summary-card--accent {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.summary-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.2rem;
}

.summary-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

/* ================================
   Booking Success - Clinic Map
   ================================ */

.booking-success-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.booking-success-section__title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.booking-success-section__subtitle {
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 0.6rem;
}

.booking-success-section__note {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.4rem;
}

.booking-map-actions {
    margin-bottom: 0.6rem;
}

.booking-map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #0ea5e9;
    font-size: 0.8rem;
    text-decoration: none;
    color: #0f766e;
    background: #ecfeff;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.07s ease;
}

.booking-map-link::before {
    content: "\1F4CD";
    font-size: 1rem;
}

.booking-map-link:hover {
    background: #e0f2fe;
    border-color: #0284c7;
    transform: translateY(-1px);
}

.booking-map-embed-wrapper {
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.booking-map-embed {
    width: 100%;
    height: 260px;
    border: 0;
}

/* واکنش‌گرا */

@media (max-width: 640px) {
    .booking-page {
        padding: 1rem;
        margin: 1rem;
        border-radius: 0.75rem;
    }

    .booking-title {
        font-size: 1.3rem;
    }

    .booking-section {
        margin-bottom: 1.25rem;
    }
}

/* ========================================
   VISIT PAGE STYLES
   ======================================== */

.visit-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    direction: rtl;
    text-align: right;
}

.visit-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.visit-header-main {
    margin-bottom: 1.5rem;
}

.visit-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    margin-bottom: 0.5rem;
}

.visit-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.visit-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.visit-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.visit-chip .label {
    font-weight: 600;
    opacity: 0.8;
}

.visit-chip .value {
    font-weight: 500;
}

.visit-chip.status.completed {
    background: rgba(34, 197, 94, 0.2);
}

.visit-chip.status.pending {
    background: rgba(245, 158, 11, 0.2);
}

.visit-chip.payment.paid {
    background: rgba(34, 197, 94, 0.2);
}

.visit-chip.payment.pending {
    background: rgba(245, 158, 11, 0.2);
}

/* Layout Visit */
.visit-layout {
    display: grid;
    grid-template-columns: 300px 1fr 250px;
    gap: 2rem;
}

.visit-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.visit-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.visit-timeline {
    grid-column: 1 / -1;
}

.visit-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.75rem;
}

.visit-field {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.visit-field .label {
    font-weight: 600;
    color: #6b7280;
}

.visit-field .value {
    color: #111827;
}

.visit-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-secondary {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
    border-radius: 8px;
    /* border: 1px solid #d1d5db; */
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.btn-primary {
    display: inline-block;
 /*   padding: 0.6rem 1.2rem; */
    background: #667eea;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-link {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: none;
    color: #667eea;
    text-decoration: underline;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.btn-link:hover {
    color: #5568d3;
}

/* Prescriptions in Visit */
.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.timeline-item.timeline-prescription {
    padding: 0.75rem;
    background: #f9fafb;
    border-left: 4px solid #dc2626;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.timeline-type {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 4px;
    font-weight: 600;
}

.timeline-date {
    color: #6b7280;
}

.timeline-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.3rem;
}

.timeline-content {
    color: #6b7280;
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* Follow-up Items */
.followup-item {
    background: #ffffff;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 2px solid #e5e7eb;
    border-left: 6px solid #f97316;
    transition: all 0.2s;
}

.followup-item:hover {
    border-color: #f97316;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.1);
}

.followup-item.followup-done {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.followup-item.followup-pending {
    border-left-color: #f97316;
    background: #fffbeb;
}

.f-title {
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.f-desc {
    font-size: 0.95rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.f-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #ffffff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.followup-item.followup-done .f-status {
    background: #dbeafe;
    color: #0c4a6e;
}

.followup-item.followup-pending .f-status {
    background: #fed7aa;
    color: #7c2d12;
}

/* Dashboard Metrics */
.dashboard-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.metric-label {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

/* Images Grid */
.visit-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.visit-image-card {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.visit-image-thumb {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f9fafb;
}

.visit-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.visit-image-meta {
    padding: 0.5rem;
    font-size: 0.8rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge.badge-muted {
    background: #f3f4f6;
    color: #6b7280;
}

.text-small {
    color: #6b7280;
    margin-top: 0.25rem;
}

.text-muted {
    color: #9ca3af;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

/* Form Styling */
.visit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-row label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-row input[type="text"],
.form-row input[type="date"],
.form-row input[type="time"],
.form-row input[type="tel"],
.form-row input[type="file"],
.form-row select,
.form-row textarea {
    padding: 0.6rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-row input[type="text"]:focus,
.form-row input[type="date"]:focus,
.form-row input[type="time"]:focus,
.form-row input[type="tel"]:focus,
.form-row input[type="file"]:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-row .errors {
    color: #dc2626;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .visit-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .visit-page {
        padding: 1rem;
    }

    .visit-header {
        padding: 1.5rem;
    }

    .visit-header-meta {
        flex-direction: column;
    }

    .visit-title {
        font-size: 1.4rem;
    }

    .dashboard-metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .visit-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 600px) {
    .booking-map-embed {
        height: 220px;
    }

.booking-map-link {
    width: 100%;
    justify-content: center;
    }
}

/* Visit form */
.visit-container {
    max-width: 900px;
    margin: 2rem auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.visit-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.visit-appointment-meta {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.8rem;
}

.visit-form-row {
    margin-bottom: 1rem;
}

.visit-form-row label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.visit-form-row input[type="text"],
.visit-form-row textarea,
.visit-form-row select {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-sizing: border-box;
}

.visit-form-row textarea {
    min-height: 80px;
    resize: vertical;
}

.visit-form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.8rem;
}

.visit-form-actions .btn-primary {
    background: #2563eb;
    border: none;
    color: #fff;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

.visit-form-actions .btn-primary:hover {
    background: #1d4ed8;
}

.visit-form-actions .btn-secondary {
    display: inline-block;
    padding: 0.48rem 1rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #333;
    background: #f9fafb;
}

.btn-visit {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 999px;
    border: 1px dashed #2563eb;
    color: #2563eb;
    text-decoration: none;
    margin-top: 0.2rem;
}

.btn-visit:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* Patient documents & visit images */
.patient-files-card,
.visit-images-card {
    margin-top: 1.5rem;
}

.patient-file-upload-form,
.visit-image-upload-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.patient-files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.patient-files-table th,
.patient-files-table td {
    border: 1px solid #e0e0e0;
    padding: 0.4rem 0.6rem;
    text-align: right;
}

.patient-files-table thead {
    background-color: #f8f8f8;
}

.visit-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.visit-image-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0.5rem;
    background-color: #fff;
}

.visit-image-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 0.4rem;
}

.visit-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.visit-image-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background-color: #eef6ff;
}

.btn-xs {
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
}

.prescription-list {
    list-style: none;
    padding: 0;
    margin: 0.6rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.prescription-list li {
    padding: 0.5rem 0.7rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0.6rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.timeline-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    background: #fff;
}

.timeline-header {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.timeline-title {
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.timeline-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #111827;
}

.timeline-date {
    font-size: 0.8rem;
    color: #6b7280;
}

.timeline-tag {
    background: #eff6ff;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #1d4ed8;
}

.badge-note-type {
    background: #eef2ff;
    color: #4338ca;
}

/* Doctor dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.dashboard-card .card-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.3rem;
}

.dashboard-card .card-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
}

.patient-privacy-section {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}
.patient-privacy-section .section-title {
    margin-bottom: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
}
.patient-privacy-section .form-row {
    margin-bottom: 0.75rem;
}
.patient-privacy-section .checkbox-row label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.allowed-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.allowed-service-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    font-size: 0.85rem;
}
.patient-privacy-section .btn-primary {
    margin-top: 0.75rem;
}
.patient-privacy-section .anonymize-form {
    margin-top: 1rem;
    text-align: left;
}

/* Doctor visit page */
.visit-page {
    max-width: 1280px;
    margin: 1.5rem auto 2.5rem;
    padding: 0 1rem;
}

.visit-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.3rem;
    background: #ffffff;
    border-radius: 0.9rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.2rem;
}

.visit-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.visit-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
}

.visit-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: flex-start;
}

.visit-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 0.82rem;
}

.visit-chip .label {
    color: #6b7280;
}

.visit-chip .value {
    font-weight: 600;
}

.visit-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 1rem;
}

@media (max-width: 1100px) {
    .visit-layout {
        grid-template-columns: 1fr;
    }
}

.visit-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.visit-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.88rem;
    padding: 0.2rem 0;
}

.visit-field .label {
    color: #6b7280;
}

.visit-field .value {
    font-weight: 600;
}

.visit-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.visit-form .form-row {
    margin-bottom: 0.65rem;
}

.visit-input,
.visit-textarea {
    width: 100%;
    border-radius: 0.55rem;
    border: 1px solid #d1d5db;
    padding: 0.42rem 0.6rem;
    font-size: 0.88rem;
}

.visit-textarea {
    resize: vertical;
}

.visit-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 0.6rem;
}

.visit-image-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.5rem;
    background: #fff;
}

.visit-image-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 0.4rem;
}

.visit-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.visit-image-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.8rem;
}

.visit-timeline .timeline-list {
    margin-top: 0.4rem;
}

.visit-timeline .timeline-item {
    border: 1px dashed #e5e7eb;
}

/* Timeline shared block */
.timeline {
    position: relative;
    padding-right: 1.5rem;
    border-right: 2px solid #e5e7eb;
}
.timeline-item {
    position: relative;
    margin-bottom: 1rem;
}
.timeline-dot {
    position: absolute;
    right: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #9ca3af;
}
.timeline-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.7rem 0.9rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.timeline-date {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}
.timeline-title {
    font-weight: 700;
    margin-bottom: 0.1rem;
}
.timeline-subtitle {
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.35rem;
}
.timeline-link {
    font-size: 0.8rem;
    color: #2563eb;
    text-decoration: none;
}
.timeline-link:hover {
    text-decoration: underline;
}
.timeline-item--appointment .timeline-dot {
    background: #3b82f6;
}
.timeline-item--note .timeline-dot {
    background: #10b981;
}
.timeline-item--followup .timeline-dot {
    background: #f59e0b;
}
.timeline-item--prescription .timeline-dot {
    background: #8b5cf6;
}
.timeline-item--payment .timeline-dot {
    background: #22c55e;
}

/* Doctor dashboard */
.doctor-dashboard {
    max-width: 1200px;
    margin: 1.5rem auto 2rem;
    padding: 0 1rem;
}

.dashboard-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin: 0.8rem 0 1.2rem;
}

.metric-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    padding: 0.8rem 0.9rem;
}

.metric-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

.metric-suffix {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
}

.dashboard-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.dashboard-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    padding: 0.9rem;
}

.dashboard-section h2 {
    margin-top: 0;
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.dashboard-table th,
.dashboard-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
}

.dashboard-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

/* Patient portal */
.patient-portal {
    max-width: 900px;
    margin: 1.5rem auto;
}
.patient-portal .title {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
}
.list {
    padding: 0;
    list-style: none;
}
.list li {
    background: #fafafa;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
}
.btn-edit {
    background: #0277bd;
    color: #fff !important;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
}
.small-btn {
    background: #009688;
    color: #fff !important;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 12px;
    text-decoration: none;
}
/* static/css/admin/scheduling_admin.css */

/* ---------------- Scoped styles for booking.html (new layout) ---------------- */
.booking-wrapper {
    max-width: 1100px;
    margin: 1.5rem auto 3rem;
    padding: 20px;
    display: flex;
    gap: 20px;
    box-sizing: border-box;
}

.booking-content { flex: 1 1 0; }
.booking-main {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.step-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.step-bar .step {
    flex: 1;
    padding: 8px;
    font-size: 0.85rem;
    background: #eef2ff;
    color: #4b5563;
    border-radius: 8px;
    text-align: center;
}
.step-bar .step.active {
    background: #1e88e5;
    color: #fff;
}

.booking-section { margin-bottom: 14px; }
.section-title {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.booking-alert {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
}
.booking-alert-title { font-weight: 700; margin-bottom: 4px; }
.booking-alert-body { font-size: 0.9rem; }

.service-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.service-card {
    background: #fafafa;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s ease;
    display: block;
}
.service-card:hover { border-color: #90caf9; background: #e3f2fd; }
.service-card-active { border-color: #1976d2; background: #bbdefb; }
.service-card-disabled { opacity: 0.45; cursor: not-allowed; }
.booking-service-title { font-weight: 700; margin-bottom: 6px; }
.booking-service-meta { font-size: 0.85rem; color: #475569; }

.booking-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.booking-radio-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
}
.booking-radio-item-disabled { opacity: 0.4; cursor: not-allowed; }
.booking-radio-label { font-weight: 600; color: #111827; }
.booking-clinic-tags {
    display: inline-block;
    margin-right: 6px;
    font-size: 0.78rem;
    color: #4b5563;
}

.day-strip {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
}
.day-item {
    width: 80px;
    padding: 10px;
    background: #f5f5f5;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
}
.day-item.disabled { opacity: 0.3; cursor: not-allowed; }
.day-item.active { background: #1976d2; color: #fff; border-color: #1976d2; }
.date-input {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    width: 180px;
}

.slots-container { min-height: 80px; }
.booking-slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.booking-slot-btn {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #e0f2f1;
    color: #0f766e;
    cursor: pointer;
    font-size: 0.92rem;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.booking-slot-btn-full {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}
.booking-slot-selected {
    background: #1976d2 !important;
    color: #fff !important;
    border-color: #1976d2;
}
.booking-slots-placeholder,
.booking-loading {
    padding: 10px;
    color: #6b7280;
    font-size: 0.9rem;
}

.patient-form .form-group { margin-bottom: 12px; }
.patient-form label { display: block; margin-bottom: 4px; font-weight: 600; }
.patient-form input,
.patient-form textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
}

.summary-card {
    width: 260px;
    background: #ffffff;
    border-radius: 12px;
    padding: 15px;
    position: sticky;
    top: 20px;
    height: fit-content;
    box-shadow: 0 0 12px rgba(0,0,0,0.06);
}
.summary-card h3 { margin: 0 0 10px; }
.summary-card p { margin: 6px 0; color: #0f172a; }

/* Time slots */
.time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.time-slot {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #e0eeff;
    color: #111827;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.12s ease-in-out;
}

.time-slot:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.time-slot.selected {
    background: #1976d2;
    border-color: #1565c0;
    color: #ffffff;
}

/* ===============================
   Enhanced day strip (AliBaba-like)
   =============================== */

.day-strip {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    overflow: hidden;
    max-width: 100%;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.day-strip-scroller {
    flex: 1 1 auto;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 4px 4px 6px;
    scrollbar-width: thin;
}

.day-strip-scroller::-webkit-scrollbar {
    height: 6px;
}
.day-strip-scroller::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 999px;
}

.day-strip-nav {
    flex: 0 0 auto;
    width: 38px;
    border: none;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: #6b7280;
    transition: background 0.12s ease, color 0.12s ease;
}
.day-strip-nav:hover {
    background: #e5e7eb;
    color: #111827;
}
.day-strip-nav:disabled {
    opacity: 0.4;
    cursor: default;
}

/* تک تک روزها */

.day-item {
    min-width: 88px;
    padding: 6px 4px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.12s ease-in-out;
}

.day-item-weekday {
    color: #6b7280;
    font-weight: 500;
}

.day-item-date {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
}

.day-item:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.day-item.active,
.day-item.day-item-active {
    background: #1976d2;
    border-color: #1565c0;
    color: #ffffff;
}

.day-item.active .day-item-weekday,
.day-item.active .day-item-date {
    color: #ffffff;
}

.day-item.day-item-today {
    box-shadow: 0 0 0 1px #60a5fa inset;
}

.day-item.day-item-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ================================
   Booking Success - Calendar Day Slot Count (new style)
   ================================ */

.calendar-day {
    padding: 8px 4px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    text-align: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.12s ease-in-out;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: relative;
}

.slot-count {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #059669;
    background: #ecfdf5;
    padding: 1px 4px;
    border-radius: 4px;
    min-width: 16px;
    text-align: center;
}



@media (max-width: 960px) {
    .booking-wrapper { flex-direction: column; }
    .summary-card { width: 100%; position: static; }
}
/* ---------------- End of booking.html styles ---------------- */