:root {
    --primary-blue: #29b6f6;
    --bg-body: #f5f7fa;
    --border-color: #e0e0e0;
    --text-main: #333;
    --text-muted: #999;
    --slot-height: 60px;
    --col-width: 400px;
    --hover-slot-bg: rgba(41, 182, 246, 0.2);
    --current-time-color: #ff5252;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
    font-size: 13px;
}

/* === Main Layout === */

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #fff;
    overflow: hidden;
}

/* === Resource Header === */

.resource-header {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    background: #fff;
    flex-shrink: 0;
    padding-left: 60px;
    overflow: hidden;
    position: relative;
}

.resource-col-header {
    width: var(--col-width);
    flex-shrink: 0;
    padding: 0 10px;
    border-right: 1px solid var(--border-color);
    position: relative;
    cursor: grab;
    user-select: none;
}

.resource-col-header:active {
    cursor: grabbing;
    background-color: #f0f8ff;
}

.sortable-ghost .doctor-remove-btn {
    display: none;
}

.resource-card {
    background: #fff;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.res-info { display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; }
.res-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-role { font-size: 11px; color: var(--text-muted); }

.btn-remove-resource {
    position: absolute;
    top: 2px;
    right: 5px;
    color: #ff5252;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 14px;
}
.resource-col-header:hover .btn-remove-resource { opacity: 1; }

.btn-schedule-resource {
    position: absolute;
    top: 2px;
    right: 25px;
    color: #ffa000;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 14px;
}
.resource-col-header:hover .btn-schedule-resource { opacity: 1; }

.btn-add-resource {
    margin-left: 15px;
    background: #e1f5fe;
    color: var(--primary-blue);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* === Scheduler Grid === */

.scheduler-wrapper {
    flex-grow: 1;
    overflow: auto;
    position: relative;
    display: flex;
    scrollbar-width: none;
}
.scheduler-wrapper::-webkit-scrollbar {
    display: none;
}

.time-gutter {
    width: 60px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 20;
    padding-top: 10px;
}

.time-label {
    height: var(--slot-height);
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    padding-right: 10px;
    position: relative;
}
.time-label span { position: relative; top: -7px; background: #fff; padding-left: 5px; }

.grid-columns-container {
    display: flex;
    position: relative;
    background-size: 100% var(--slot-height);
    background-image: linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
    margin-top: 10px;
}

.resource-column {
    width: var(--col-width);
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    position: relative;
    height: 100%;
}

#gridColumns {
    display: flex;
}

.slot-consultation-label {
    position: absolute;
    left: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1f1f1f66;
    gap: 4px;
    font-size: 10px;
    line-height: 10px;
    font-weight: normal;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
}

.slot-consultation-label--online::before,
.slot-consultation-label--offline::before {
    content: '';
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-radius: 50%;
}
.slot-consultation-label--online::before { background-color: #29b6f6; }
.slot-consultation-label--offline::before { background-color: #66bb6a; }

/* === Ghost Slot (hover preview) === */

.ghost-slot {
    position: absolute;
    left: 2px;
    right: 2px;
    background: var(--hover-slot-bg);
    border: 1px dashed var(--primary-blue);
    border-radius: 3px;
    pointer-events: none;
    display: none;
    z-index: 100;
    color: var(--primary-blue);
    font-size: 11px;
    font-weight: bold;
    padding: 2px 5px;
    align-items: center;
    justify-content: center;
}

/* === Booked Events === */

.booked-event {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 11px;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    z-index: 10;
    pointer-events: auto;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.booked-event .evt-content {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booked-event .evt-title { font-weight: bold; font-size: 11px; }
.booked-event .evt-time { font-size: 10px; opacity: 0.9; }

.booked-event .evt-contact {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
}

.booked-event .delete-booking-btn {
    position: absolute;
    top: 2px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.9);
    color: #ff5252;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    z-index: 100;
    transition: all 0.2s;
}

.booked-event .delete-booking-btn:hover {
    background: #ff5252;
    color: white;
    transform: scale(1.1);
}

.booked-event:hover .delete-booking-btn {
    display: flex;
}

.booked-event .comment-dot {
    position: absolute;
    top: 4px;
    right: 24px;
    width: 8px;
    height: 8px;
    background: #000;
    border-radius: 50%;
    z-index: 50;
    pointer-events: none;
}

/* === Non-working Zones === */

.non-working-slot {
    position: absolute;
    left: 0;
    right: 0;
    background: repeating-linear-gradient(
      45deg,
      #f0f0f0,
      #f0f0f0 10px,
      #e0e0e0 10px,
      #e0e0e0 20px
    );
    opacity: 0.7;
    z-index: 5;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 10px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

/* === Scroll Arrows === */

.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 100px;
    background-color: rgba(0, 0, 0, 0.05);
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 30px;
    user-select: none;
}

.scroll-arrow:hover {
    background-color: rgba(41, 182, 246, 0.8);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.scroll-arrow-left {
    left: 10px;
    display: none;
}

.scroll-arrow-right {
    right: 10px;
    display: none;
}

/* === Sidebar Right === */

.sidebar-right {
    width: 300px;
    border-left: 1px solid var(--border-color);
    background: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 60px 20px 20px 20px;
}

.cal-header { display: flex; justify-content: space-between; margin-bottom: 15px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal-day-name { color: var(--text-muted); font-size: 11px; margin-bottom: 5px; }
.cal-day {
    height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; cursor: pointer; font-size: 12px;
}
.cal-day:hover { background: #f0f0f0; }
.cal-day.active { background: var(--primary-blue); color: #fff; }

/* === Services === */

.service-option {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.service-option:hover { background-color: #f5f7fa; border-color: var(--primary-blue); }
.service-option.selected {
    background-color: #e1f5fe;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}
.service-time { font-weight: bold; font-size: 12px; background: #fff; padding: 2px 6px; border-radius: 4px; }

/* === Select2 Overrides === */

.select2-container { z-index: 9999 !important; }
.select2-container--default .select2-selection--single { height: 38px; padding: 6px 12px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 24px; }

/* === Tabs === */

.tab-btn.active {
    background: #fff !important;
    border-bottom: 3px solid #29b6f6 !important;
    color: #29b6f6;
    font-weight: 600;
}

.tab-btn:hover {
    background: #e8f4f8;
}

.settings-tabs { overflow-x: auto; flex-shrink: 0; }
.settings-tabs .tab-btn { flex-shrink: 0; white-space: nowrap; }

/* === Settings Panel z-index === */

#settingsPanel ~ .modal {
    z-index: 10001 !important;
}
.modal-backdrop {
    z-index: 10000 !important;
}

/* === Status Legend === */

.status-legend {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.status-legend-title {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #555;
}

.status-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.status-legend-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === Deal Search === */

#searchResults .list-group-item:hover {
    background-color: #e3f2fd;
    border-color: #29b6f6;
}

#searchResults .list-group-item:active {
    background-color: #bbdefb;
}

#dealSearchSection .input-group input:focus {
    border-color: #29b6f6;
    box-shadow: 0 0 0 0.2rem rgba(41, 182, 246, 0.25);
}

/* === Full Calendar (modal) === */

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
    font-weight: 600;
    text-align: center;
    color: #555;
    flex-shrink: 0;
    margin-right: 5px;
}
.calendar-grid-header div { padding: 5px; }

.calendar-grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(100px, auto);
    overflow-y: auto;
    padding-right: 5px;
}

.cal-cell {
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 30px 4px 4px 4px;
    position: relative;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell.empty {
    background: #fcfcfc;
    color: #ccc;
}
.cal-cell.today {
    background: #fff9c4;
}

.cal-cell.unavailable {
    background: rgba(220, 53, 69, 0.1);
}
.cal-cell.unavailable.today .cal-cell-date {
    color: #842029;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.cal-cell-availability {
    color: #842029;
    font-size: 11px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.cal-cell-date {
    position: absolute;
    top: 5px;
    right: 8px;
    font-weight: bold;
    font-size: 14px;
    color: #777;
    z-index: 1;
}

.cal-event-item {
    font-size: 10px;
    padding: 3px 5px;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
    margin-bottom: 2px;
    white-space: normal;
    line-height: 1.2;
    overflow: hidden;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: opacity 0.2s;
}
.cal-event-item:hover { opacity: 0.9; }

/* Full calendar overview */
.full-calendar-modal-content { height: 90vh; border: 0; border-radius: 14px; overflow: hidden; }
.full-calendar-modal-body { min-height: 0; padding: 18px 20px 20px; }
.calendar-controls-main { gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.calendar-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calendar-filters .form-select { width: auto; min-width: 170px; }
.calendar-view-toggle .btn { min-width: 76px; }
.calendar-navigation { display: flex; align-items: center; gap: 8px; }
.calendar-navigation h5 { min-width: 170px; text-align: center; font-size: 17px; }
.calendar-grid-body { min-height: 0; }

/* ============================================
   Top-right action icons (Calendar / Report / Settings)
   ============================================ */
.topbar-actions {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    display: flex;
    gap: 8px;
}
.topbar-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #546e7a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
    padding: 0;
}
.topbar-icon-btn:hover {
    color: #29b6f6;
    border-color: #29b6f6;
    background: #f5fbfe;
}
.topbar-icon-btn:active { transform: scale(0.94); }
.topbar-icon-btn--primary {
    background: #29b6f6;
    color: #fff;
    border-color: #29b6f6;
    box-shadow: 0 2px 6px rgba(41,182,246,0.35);
}
.topbar-icon-btn--primary:hover {
    background: #039be5;
    color: #fff;
    border-color: #039be5;
}

/* === Mobile scheduler === */
.mobile-scheduler-controls,
.mobile-date-strip { display: none; }

@media (max-width: 767px) {
    :root { --slot-height: 104px; }

    body {
        min-height: 100dvh;
        height: 100dvh;
        padding-bottom: calc(82px + env(safe-area-inset-bottom));
        overflow: hidden;
        background: #fff;
    }

    .sidebar-right, .resource-header, .scroll-arrow, .topbar-actions { display: none !important; }

    .main-content { min-width: 0; }

    #fullCalendarModal .modal-dialog { margin: 0; max-width: none; width: 100%; height: 100dvh; }
    .full-calendar-modal-content { height: 100dvh; border-radius: 0; }
    .full-calendar-modal-body { padding: 12px; }
    #fullCalendarModal .modal-header { padding: 12px 14px; }
    .calendar-controls-main { display: block; margin-bottom: 10px; }
    .calendar-filters { display: grid; grid-template-columns: 1fr; gap: 7px; margin-bottom: 10px; }
    .calendar-filters .form-select { width: 100%; min-width: 0; }
    .calendar-view-toggle { display: flex; width: 100%; }
    .calendar-view-toggle .btn { flex: 1; }
    .calendar-navigation { justify-content: space-between; gap: 5px; }
    .calendar-navigation h5 { min-width: 0; flex: 1; font-size: 15px; }
    .calendar-navigation .btn-outline-secondary { padding-inline: 8px; }
    .calendar-grid-header { font-size: 11px; padding: 6px 0; }
    .calendar-grid-body { grid-auto-rows: minmax(68px, auto); padding-right: 0; }
    .cal-cell { min-height: 68px; padding: 23px 2px 3px; }
    .cal-cell-date { top: 4px; right: 5px; font-size: 11px; }
    .cal-cell-availability { font-size: 10px; }
    .cal-event-item { font-size: 9px; padding: 3px 3px; line-height: 1.1; }

    .mobile-scheduler-controls {
        display: flex;
        flex: 0 0 auto;
        gap: 8px;
        min-height: 88px;
        padding: 10px 14px 8px;
        overflow-x: auto;
        scrollbar-width: none;
        border-bottom: 1px solid #edf0f3;
        background: #fff;
    }
    .mobile-scheduler-controls::-webkit-scrollbar { display: none; }

    .mobile-calendar-button { min-width: 92px; flex: 0 0 92px; min-height: 68px; padding: 4px 8px; border: 1px solid #dfe5e8; border-radius: 12px; color: #247d73; background: #f2faf8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 11px; font-weight: 700; }
    .mobile-calendar-button i { font-size: 18px; }


    .mobile-doctor-button {
        min-width: min(72vw, 260px);
        flex: 0 0 min(72vw, 260px);
        min-height: 68px;
        padding: 4px 8px;
        border: 0;
        border-radius: 12px;
        color: #6c737d;
        background: transparent;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        font-size: 13px;
        white-space: nowrap;
    }
    .mobile-doctor-button.active { color: #20252c; background: #e9f7fd; font-weight: 600; box-shadow: inset 0 -3px 0 var(--primary-blue); }
    .mobile-doctor-button:focus-visible,
    .mobile-date-button:focus-visible,
    .mobile-time-option:focus-visible,
    .mobile-sheet-heading button:focus-visible { outline: 3px solid rgba(41, 182, 246, .45); outline-offset: 2px; }
    .mobile-doctor-avatar {
        width: 36px; height: 36px; border-radius: 11px;
        display: grid; place-items: center;
        color: var(--primary-blue); background: #e9f7fd;
    }

    .scheduler-wrapper { overflow-x: auto; padding-bottom: 8px; }
    .time-gutter {
        width: 58px;
        flex: 0 0 58px;
        min-height: 100%;
        padding-top: 10px;
        z-index: 20;
        align-self: flex-start;
        background: repeating-linear-gradient(45deg, #f0f0f0, #f0f0f0 10px, #e0e0e0 10px, #e0e0e0 20px);
    }
    .time-label { font-size: 13px; padding-right: 8px; color: #58606b; font-variant-numeric: tabular-nums; }
    .time-label span { background: rgba(255, 255, 255, .92); padding: 0 4px; }
    .grid-columns-container { width: max-content; min-width: calc(100vw - 58px); flex: 0 0 auto; }
    .resource-column,
    .resource-column.mobile-active-doctor { display: block; width: min(72vw, 260px); border-right: 1px solid #e1e5e9; cursor: pointer; }
    #gridColumns > div[style*="min-width"] { display: none; }
    .ghost-slot { display: none !important; }
    .booked-event { left: 6px; right: 8px; min-height: 28px; border-radius: 8px; padding: 5px 8px; font-size: 12px; }
    .non-working-slot { font-size: 11px; }

    .mobile-date-strip {
        position: fixed;
        z-index: 9000;
        left: 10px; right: 10px; bottom: max(8px, env(safe-area-inset-bottom));
        height: 68px;
        padding: 6px;
        display: flex;
        gap: 2px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        border-radius: 16px;
        background: #252a31;
        box-shadow: 0 10px 30px rgba(19, 24, 31, .24);
    }
    .mobile-date-strip::-webkit-scrollbar { display: none; }
    .mobile-date-button {
        flex: 0 0 50px; min-width: 50px; min-height: 54px; padding: 4px 1px;
        border: 0; border-radius: 11px;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
        color: #fff; background: transparent; font-size: 11px; text-transform: lowercase;
    }
    .mobile-date-button strong { font-size: 18px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
    .mobile-date-button.weekend { color: #ff806f; }
    .mobile-date-button.unavailable { color: #7f8790; opacity: .55; }
    .mobile-date-button.active { color: #1d232a; background: #ffd225; }
    .mobile-date-button.active.unavailable { color: #1d232a; opacity: 1; }

    .mobile-time-sheet-backdrop { position: fixed; inset: 0; z-index: 10020; background: rgba(17, 23, 31, .42); }
    .mobile-time-sheet {
        position: fixed; z-index: 10021; left: 0; right: 0; bottom: 0;
        max-height: min(68dvh, 520px); overflow-y: auto;
        padding: 8px 18px max(24px, env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0; background: #fff;
        box-shadow: 0 -12px 36px rgba(17, 23, 31, .18);
        animation: mobileSheetIn .22s cubic-bezier(.2,.8,.2,1);
    }
    .mobile-sheet-handle { width: 38px; height: 4px; margin: 0 auto 14px; border-radius: 2px; background: #c9ced4; }
    .mobile-sheet-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
    .mobile-sheet-heading div { display: flex; flex-direction: column; gap: 2px; }
    .mobile-sheet-heading strong { font-size: 18px; }
    .mobile-sheet-heading span { color: #747b85; font-size: 13px; }
    .mobile-sheet-heading button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #f1f3f5; font-size: 26px; line-height: 1; }
    .mobile-time-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .mobile-time-option { min-height: 48px; border: 1px solid #dfe4e8; border-radius: 12px; background: #fff; color: #20252c; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
    .mobile-time-option:active { background: #e9f7fd; border-color: var(--primary-blue); }
    .mobile-time-empty { grid-column: 1 / -1; margin: 12px 0 22px; color: #747b85; text-align: center; font-size: 15px; }

    .modal-dialog { margin: 8px; }
    .modal-content { max-height: calc(100dvh - 16px); border-radius: 16px; }
    .modal-body { overflow-y: auto; }

    /* Booking form keeps Bootstrap behavior but enters as a thumb-friendly sheet. */
    #bookingModal .modal-dialog {
        display: flex;
        align-items: flex-end;
        min-height: 100%;
        margin: 0;
        max-width: none;
    }
    #bookingModal .modal-content {
        width: 100%;
        max-height: min(88dvh, 760px);
        border: 0;
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -12px 36px rgba(17, 23, 31, .18);
        animation: bookingSheetIn .22s cubic-bezier(.2,.8,.2,1);
    }
    #bookingModal .modal-header {
        position: relative;
        padding: 22px 18px 14px;
        border-bottom: 1px solid #edf0f3;
    }
    #bookingModal .modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        width: 38px;
        height: 4px;
        border-radius: 4px;
        background: #c9ced4;
        transform: translateX(-50%);
    }
    #bookingModal .modal-body { padding: 16px 18px; }
    #bookingModal .modal-footer { padding: 12px 18px max(16px, env(safe-area-inset-bottom)); gap: 8px; }
    #bookingModal .modal-footer > button { min-height: 46px; flex: 1; }

    #bookingModal #dealSearchSection {
        padding: 12px;
        border: 1px solid #b9e7f8;
        border-radius: 12px;
        background: #f1fbfe;
    }
    #bookingModal #phoneSearchInput {
        border: 2px solid var(--primary-blue);
        background: #fff;
    }
    #bookingModal #phoneSearchInput:focus {
        border-color: #039be5;
        box-shadow: 0 0 0 3px rgba(41, 182, 246, .18);
    }
}

@keyframes mobileSheetIn {
    from { transform: translateY(24px); opacity: .4; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes bookingSheetIn {
    from { transform: translateY(28px); opacity: .4; }
    to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-time-sheet, #bookingModal .modal-content { animation: none; }
}

/* Arabic reading direction. Keep the time grid's physical coordinates and
   synchronized scrollLeft unchanged; its labels still read right to left. */
html[dir="rtl"] body { direction: ltr; }
html[dir="rtl"] :is(.sidebar-right, .modal, #settingsPanel, #reportModal, .mobile-time-sheet) {
    direction: rtl;
    text-align: start;
}
html[dir="rtl"] :is(.res-info, .booked-event, .mobile-doctor-button, .mobile-calendar-button, .slot-consultation-label) {
    direction: rtl;
    text-align: start;
}
html[dir="rtl"] :is(.cal-event-item, .res-name) { unicode-bidi: plaintext; }
html[dir="rtl"] .modal-header .btn-close { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .form-select {
    background-position: left .75rem center;
    padding-left: 2.25rem;
    padding-right: .75rem;
}
html[dir="rtl"] .form-check { padding-left: 0; padding-right: 1.5em; }
html[dir="rtl"] .form-check .form-check-input { float: right; margin-left: 0; margin-right: -1.5em; }
html[dir="rtl"] .form-switch { padding-right: 2.5em; }
html[dir="rtl"] .form-switch .form-check-input { margin-right: -2.5em; }
html[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }
html[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
html[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
html[dir="rtl"] :is(input[type="date"], input[type="time"], input[type="tel"], input[type="number"], #searchPhone) {
    direction: ltr;
    text-align: start;
}
html[dir="rtl"] :is(.calendar-navigation, .cal-header) :is(.fa-chevron-left, .fa-chevron-right) {
    transform: scaleX(-1);
}
html[dir="rtl"] .cal-cell { border-right: none; border-left: 1px solid #eee; }
html[dir="rtl"] .cal-cell:nth-child(7n) { border-left: none; }
html[dir="rtl"] .cal-cell-date { right: auto; left: 8px; }
.resource-col-header.technical-resource {
    cursor: default;
    background-color: #f8fafb;
}
.resource-col-header.technical-resource:active {
    cursor: default;
    background-color: #f8fafb;
}
