:root {
    --color-primary: #4998B0;
    --color-accent: #4998B0;
    --color-secondary: #4965b0;
    --color-tertiary: #49b095;
}

html {
    scrollbar-gutter: stable;
}

/* Prevent content shift when modals open/close.
   Flowbite Modal adds inline padding-right to body to compensate for the
   scrollbar disappearing, but scrollbar-gutter:stable already reserves that
   space. The extra padding causes a layout jump — override it. */
body {
    padding-right: 0 !important;
}

/* Neobrutalist Turbo Drive progress bar */
.turbo-progress-bar {
    height: 8px;
    background-color: #4998B0;
    border-bottom: 3px solid #000;
    border-radius: 0;
    z-index: 9999;
}

.page-container {
    position: relative;
    min-height: 100dvh;
    padding-bottom: 4rem;
    margin-bottom: 4rem;
}

.ts-control {
    z-index: 0;
}

/* Wizard unit search: keep Tom Select control at fixed height when item is selected */
.wizard-unit-search-wrapper .ts-wrapper .ts-control {
    min-height: 44px;
    max-height: 44px;
    overflow: hidden;
    flex-wrap: nowrap;
    align-items: center;
}
.wizard-unit-search-wrapper .ts-wrapper .ts-control > .item {
    max-width: calc(100% - 40px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ensure native select elements are readable on mobile */
select {
    font-size: 16px;
}
select option {
    font-size: 16px;
}

/* ------------------------------------------------------------------------------------------------------------------ */
/* Tooltip */
/* ------------------------------------------------------------------------------------------------------------------ */
/* Tooltip container */
.tooltip {
    position: relative;
    display: inline-block;
}

/* Tooltip text */
.tooltip .tooltiptext {
    visibility: hidden;
    width: 300px;
    color: #fff;
    text-align: center;
    padding: 0.25rem 0.5rem;
    right: 32%;
    bottom: 46%;
    margin-left: -150px; /* Use half of the width (150/2 = 75), to center the tooltip */
    /* Position the tooltip text - see examples below! */
    position: absolute;
    z-index: 100;
    font-size: 12px ;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
    visibility: visible;
}

/* Use the Stimulus tooltip controller when JS is available. */
html[data-js-tooltips="true"] [data-tip]::before,
html[data-js-tooltips="true"] [data-tip]::after,
html[data-js-tooltips="true"] [data-tooltip]::before,
html[data-js-tooltips="true"] [data-tooltip]::after {
    content: none !important;
    display: none !important;
}

/* ------------------------------------------------------------------------------------------------------------------ */
/* Navigation Modal — Legacy classes removed, now using daisyUI + Tailwind utilities in templates */
/* ------------------------------------------------------------------------------------------------------------------ */

/* ============================================================
   Gantt Month Overview
   ============================================================ */

.gantt-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    white-space: nowrap;
    font-size: 0; /* eliminate whitespace between inline-block month segments */
}

.gantt-timeline-wrapper {
    display: flex;
    flex-direction: row;
}

.gantt-fixed-units {
    flex-shrink: 0;
    width: 12rem;
    z-index: 20;
    background: #fafafa;
    border-right: 2px solid #e5e7eb;
    position: sticky;
    left: 0;
}

.gantt-unit-header-cell {
    height: 4rem; /* matches the day header row height (CW + weekday + day number) */
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #d1d5db;
    box-sizing: border-box;
    background: #fafafa;
    position: sticky;
    top: 7.5rem;
    z-index: 25;
}

.gantt-unit-label {
    display: flex;
    align-items: center;
    padding: 0 0.625rem;
    box-sizing: border-box;
    border-bottom: 1px solid #d1d5db;
    white-space: nowrap;
    overflow: hidden;
}

.gantt-unit-label a {
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-unit-label a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gantt-month-segment {
    display: inline-block;
    vertical-align: top;
    font-size: 0.75rem; /* restore font size (parent has font-size: 0 to kill whitespace) */
}

.gantt-unit-row {
    border-bottom: 1px solid #d1d5db;
    padding-top: 0;
    padding-bottom: 0;
    position: relative;
    z-index: 0;
    box-sizing: border-box;
    overflow: visible;
}

.gantt-drop-target {
    background-color: rgba(73, 152, 176, 0.25) !important;
    box-shadow: inset 0 0 0 2px rgba(73, 152, 176, 0.6);
    z-index: 5 !important;
    position: relative;
}

.gantt-unit-row > .gantt-bar,
.gantt-unit-row > a.gantt-bar {
    min-height: 0;
    height: 1.5rem;
    line-height: 1.5rem;
    overflow: hidden;
    margin-top: 3px;
    margin-bottom: 3px;
    font-size: 0.6875rem;
}

.gantt-grid {
    display: grid;
    position: relative;
    align-items: stretch;
    min-height: 2.5rem;
    /* Fixed cell width for infinite scroll mode: 2.5rem */
}

.gantt-header-unit,
.gantt-unit-name {
    position: sticky;
    left: 0;
    z-index: 20;
    background: rgba(73, 152, 176, 0.05);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(73, 152, 176, 0.15);
    border-right: 1px solid rgba(73, 152, 176, 0.15);
    min-width: 8rem;
    max-width: 8rem;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

.gantt-header-unit {
    white-space: nowrap;
}

.gantt-header-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0.375rem 0 0.25rem;
    border-bottom: 1px solid rgba(73, 152, 176, 0.15);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.75rem;
    height: 4rem; /* increased from 3.5rem to prevent CW cutoff */
    box-sizing: border-box;
}

.gantt-day-header-row {
    z-index: 20;
    background: white;
}

.gantt-cw {
    font-size: 0.625rem;
    color: var(--color-primary);
    margin-bottom: 0.125rem;
}

.gantt-weekday {
    font-size: 0.6875rem;
    color: #6b7280;
}

.gantt-day-num {
    font-size: 0.75rem;
    color: var(--color-primary);
    padding: 0.125rem 0.375rem;
}

.gantt-header-day.gantt-today {
    background-color: rgba(73, 152, 176, 0.25) !important;
    border-right: 1px solid rgba(73, 152, 176, 0.5) !important;
}

.gantt-day-today {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.gantt-cell {
    min-height: 2.5rem;
}

/* Vertical day gridlines — applied to the unit row container so they show behind bars */
.gantt-unit-row {
    background-image: repeating-linear-gradient(
        to right,
        transparent 0,
        transparent calc(2.5rem - 1px),
        rgba(0, 0, 0, 0.06) calc(2.5rem - 1px),
        rgba(0, 0, 0, 0.06) 2.5rem
    );
    background-size: 2.5rem 100%;
}

.gantt-today-bg {
    /* Background handled by the gantt-today-line overlay */
}

/* Today column vertical line — drawn by JS as an absolutely positioned overlay */
.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2.5rem;
    background-color: rgba(73, 152, 176, 0.12);
    border-left: 2px solid rgba(73, 152, 176, 0.5);
    border-right: 2px solid rgba(73, 152, 176, 0.5);
    pointer-events: none;
    z-index: 4;
}

/* Row wrapper with horizontal separator */
.gantt-row-wrapper {
    position: relative;
    border-bottom: 1px solid #e5e7eb;
}

/* Lines overlay — absolutely positioned OVER the grid, pointer-events pass through */
.gantt-lines-overlay {
    display: grid;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    pointer-events: none;
}

.gantt-line {
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.gantt-line-today {
    border-right: 2px solid rgba(73, 152, 176, 0.4);
    border-left: 2px solid rgba(73, 152, 176, 0.4);
    background-color: rgba(73, 152, 176, 0.08);
}

/* Gantt bar base */
.gantt-bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 0;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    margin: 0.25rem 1px;
    height: calc(2.75rem - 0.5rem);
    box-sizing: border-box;
    border: none;
    align-self: center;
    overflow: hidden;
    background: #e2e8f0;
    color: #475569;
}

.gantt-bar > span {
    display: flex;
    align-items: center;
}

.gantt-bar:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    z-index: 20;
}

/* Gantt bar badge tooltip — shows on hover of icon wrapper */
.gantt-bar-badge-wrap:hover .gantt-badge-tip {
    display: block;
}
.gantt-badge-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    z-index: 100;
    pointer-events: none;
    white-space: nowrap;
}
.gantt-badge-tip > span {
    background: #1e293b;
    color: white;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 2px;
    white-space: nowrap;
}

/* Responsive bar content — on narrow bars the guest name truncates with an
   ellipsis instead of being hidden behind an info icon (calendar-badge-display-fix).
   The two-class selector overrides the Tailwind `flex` utility so the name renders
   as a block and `text-overflow: ellipsis` can take effect. */
.gantt-bar .gantt-bar-guest-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
/* Very short bars (1-3 day spans) are too narrow for status icons — hide the
   icons so the truncated guest name keeps the space. The name stays visible. */
.gantt-bar[data-span="1"] .gantt-bar-icons,
.gantt-bar[data-span="2"] .gantt-bar-icons,
.gantt-bar[data-span="3"] .gantt-bar-icons {
    display: none;
}

/* Half-day edge bars (4-5 day spans with a check-in/out edge) lose usable width —
   hide the status icons so the guest name keeps the space. The name stays visible
   and truncates with an ellipsis. */
.gantt-bar.gantt-checkin-edge[data-span="4"] .gantt-bar-icons,
.gantt-bar.gantt-checkout-edge[data-span="4"] .gantt-bar-icons,
.gantt-bar.gantt-checkin-edge[data-span="5"] .gantt-bar-icons,
.gantt-bar.gantt-checkout-edge[data-span="5"] .gantt-bar-icons {
    display: none;
}

/* Medium bars (4-5 day spans without edges) — show guest name but hide icons to prevent clipping */
.gantt-bar[data-span="4"] .gantt-bar-icons,
.gantt-bar[data-span="5"] .gantt-bar-icons {
    display: none;
}

/* Status colors — solid pill backgrounds, no border */
.gantt-status-completed {
    background: #a7f3d0;
    color: #065f46;
}

.gantt-status-confirmed {
    background: #fef3c7;
    color: #92400e;
}

.gantt-status-pending {
    background: #fef08a;
    color: #a16207;
}

.gantt-status-new {
    background: #ddd6fe;
    color: #5b21b6;
}

.gantt-status-draft,
.gantt-status-tentative {
    background: #ddd6fe;
    color: #5b21b6;
}

.gantt-status-cancelled {
    background: #fecaca;
    color: #991b1b;
}

.gantt-status-checked_in {
    background: #bfdbfe;
    color: #1e40af;
}

.gantt-status-overlap {
    background: linear-gradient(135deg, #fef3c7 25%, #fde68a 25%, #fde68a 50%, #fef3c7 50%, #fef3c7 75%, #fde68a 75%);
    background-size: 8px 8px;
    color: #92400e;
    font-weight: 700;
}
.gantt-status-overlap:hover {
    filter: brightness(0.95);
}

/* KIT-130: status accent border for the canvas-positioned (day / 3-day) and
   grid-positioned (week) reservation bars. The month gantt conveys status with
   a solid pill background; these views are visually busier, so they add a 3px
   left border in the status accent color. `currentColor` resolves to the bar's
   text color, which the day/3-day controller sets inline and the week view sets
   via the `.gantt-status-*` classes — so the accent always tracks the status. */
.cal-status-accent {
    border-left: 3px solid currentColor;
}

/* KIT-134: tapered half-day edges for the day/3-day (canvas) and week (grid)
   views. Unlike the month gantt's .gantt-checkin-edge/.gantt-checkout-edge —
   which ALSO carry a half-cell margin to inset the bar — these views already
   inset the bar to its half-cell positionally (canvas geometry / grid lines),
   so these classes apply ONLY the angled clip-path plus flat inner corners.
   Both polygons keep the bottom-left vertex at x=0 so the .cal-status-accent
   left border survives the clip and stays visible on every bar. A bar that is
   both a real check-in and check-out (the common case) gets both classes and
   tapers on both ends, matching the month gantt; a bar clipped at the window
   edge keeps that side straight. */
.cal-clip-checkin {
    clip-path: polygon(0.5rem 0, 100% 0, 100% 100%, 0 100%);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    padding-left: 0.75rem;
}
.cal-clip-checkout {
    clip-path: polygon(0 0, 100% 0, calc(100% - 0.5rem) 100%, 0 100%);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding-right: 0.75rem;
}
/* Colored turnover borders — only shown when two reservations share the same day */
.cal-clip-checkin.cal-turnover-start::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0.5rem;
    background: #22c55e;
    pointer-events: none;
    z-index: 1;
}
.cal-clip-checkout.cal-turnover-end::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 0.5rem;
    background: #f59e0b;
    pointer-events: none;
    z-index: 1;
}
.cal-clip-checkin.cal-clip-checkout {
    clip-path: polygon(0.5rem 0, 100% 0, calc(100% - 0.5rem) 100%, 0 100%);
    border-radius: 0;
    border-left: none;
}

/* Clipped start — continuation from previous month: flat left edge, hide name */
.gantt-clipped-start {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: 0;
    border-left: none;
}
.gantt-clipped-start > span.truncate,
.gantt-clipped-start > span.gantt-guest-count {
    visibility: hidden;
}

/* Clipped end — continues into next month: flat right edge */
.gantt-clipped-end {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: 0;
}

/* Half-day check-in/check-out edges — each badge occupies half the shared day cell
   with a subtle gap (2px total) between them so concurrent check-out/check-in are both visible.
   Column width is 2.75rem; half = 1.375rem. Each side insets by half minus 1px for the gap.
   The clip-path creates the angled/slanted edge to visually indicate a partial day. */
.gantt-checkin-edge {
    margin-left: calc(1.375rem - 1px);
    clip-path: polygon(0.5rem 0, 100% 0, 100% 100%, 0 100%);
    padding-left: 0.75rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.gantt-checkout-edge {
    margin-right: calc(1.375rem - 1px);
    clip-path: polygon(0 0, 100% 0, calc(100% - 0.5rem) 100%, 0 100%);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.gantt-checkin-edge.gantt-checkout-edge {
    margin-left: calc(1.375rem - 1px);
    margin-right: calc(1.375rem - 1px);
    clip-path: polygon(0.5rem 0, 100% 0, calc(100% - 0.5rem) 100%, 0 100%);
    padding-left: 0.75rem;
    border-radius: 0;
}
.gantt-checkout-edge .gantt-bar-icons {
    padding-right: 0.625rem;
}

/* Same-day turnover colored indicators — only applied when two reservations share the same day.
   Green = check-in side (left edge), Amber = check-out side (right edge).
   Pseudo-elements fill the angled edge area with solid color.
   The parent's clip-path clips them to the exact diagonal shape. */
.gantt-turnover-start::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0.5rem;
    background: #22c55e;
    pointer-events: none;
    z-index: 1;
}
.gantt-turnover-end::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 0.5rem;
    background: #f59e0b;
    pointer-events: none;
    z-index: 1;
}

/* Guest count badge */
.gantt-guest-count {
    display: inline-flex;
    align-items: center;
    align-self: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.5625rem;
    font-weight: 700;
    margin-left: 0.25rem;
    flex-shrink: 0;
    line-height: 1;
}

/* Drag-and-drop styles for month overview */
.gantt-bar-dragging { opacity: 0.5; border: 2px dashed #9CA3AF; }
.gantt-drop-valid { background-color: #F0FDF4; border: 2px solid #86EFAC; }
.gantt-drop-swap { background-color: #EFF6FF; border: 2px solid #93C5FD; }
.gantt-drop-invalid { background-color: #FEF2F2; cursor: not-allowed; }
.gantt-bar-loading { animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.gantt-bar[draggable="true"] { cursor: grab; }
.gantt-bar[draggable="true"]:active { cursor: grabbing; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Drag-and-drop styles for month overview calendar */
.gantt-bar-dragging { opacity: 0.5; border: 2px dashed #9CA3AF; }
.gantt-drop-valid { background-color: rgba(134, 239, 172, 0.3); outline: 2px solid #86EFAC; outline-offset: -2px; }
.gantt-drop-swap { background-color: rgba(147, 197, 253, 0.3); outline: 2px solid #93C5FD; outline-offset: -2px; }
.gantt-drop-invalid { background-color: rgba(252, 165, 165, 0.2); cursor: not-allowed; }
.gantt-bar-loading { animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.gantt-bar[draggable="true"] { cursor: grab; }
.gantt-bar[draggable="true"]:active { cursor: grabbing; }

/* Infinite Scroll Calendar — merged into main gantt-scroll-container above */

.gantt-header-label {
    position: sticky;
    top: 0;
    z-index: 30;
}

.gantt-loading-indicator {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 50;
}

.calendar-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    z-index: 35;
}

.calendar-loading-overlay[hidden] {
    display: none;
}

/* Calendar unit thumbnail — smooth enlarge on hover */
[data-grid-role="unit-label"] img {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}
[data-grid-role="unit-label"] img:hover {
    transform: scale(1.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 50;
    position: relative;
}

.calendar-loading-spinner {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 3px solid rgba(73, 152, 176, 0.2);
    border-top-color: var(--color-primary);
    animation: calendar-spin 0.7s linear infinite;
}

@keyframes calendar-spin {
    to {
        transform: rotate(360deg);
    }
}

.calendar-skeleton-indicator {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 34;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.45) 25%, rgba(73, 152, 176, 0.2) 50%, rgba(255, 255, 255, 0.45) 75%);
    background-size: 220% 100%;
    animation: calendar-skeleton-shimmer 1.1s ease-in-out infinite;
}

@keyframes calendar-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.gantt-error-toast {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    z-index: 50;
}
.gantt-dragging-active .gantt-cell {
    z-index: 10;
    position: relative;
}
/* Show a ghost preview spanning multiple cells */
.gantt-drop-preview {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: rgba(73, 152, 176, 0.15);
    border: 2px dashed rgba(73, 152, 176, 0.5);
    border-radius: 2px;
    pointer-events: none;
    z-index: 9;
    transition: opacity 0.15s ease;
}

/* Payment status badge on gantt bars */
.gantt-badge-payment {
    position: absolute;
    top: -4px;
    left: 2px;
    font-size: 8px;
    font-weight: bold;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
}
.gantt-badge-payment--paid { background: #d1fae5; color: #065f46; }
.gantt-badge-payment--partial { background: #fef3c7; color: #92400e; }
.gantt-badge-payment--overdue { background: #fee2e2; color: #991b1b; }

/* Unread message count badge */
.gantt-badge-unread {
    position: absolute;
    top: -4px;
    right: 2px;
    font-size: 8px;
    font-weight: bold;
    min-width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    line-height: 1;
    padding: 0 2px;
}

/* Housekeeping status on gantt unit cells */
.gantt-cell[data-housekeeping="dirty"] { border-bottom: 3px solid #ef4444; }
.gantt-cell[data-housekeeping="in_progress"] { border-bottom: 3px solid #eab308; }
.gantt-cell[data-housekeeping="clean"] { border-bottom: 3px solid #22c55e; }

/* View Options toggle buttons */
.gantt-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid #e5e7eb;
    border-radius: 2px;
    background: white;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
    min-width: 44px;
}
.gantt-toggle-btn--active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(73, 152, 176, 0.05);
}
.gantt-toggle-btn--active:hover {
    border-color: #9ca3af;
    color: #6b7280;
    background: #ffffff;
}

.gantt-toggle-btn:not(.gantt-toggle-btn--active):hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(73, 152, 176, 0.05);
}

/* Hide overlays when toggled off */
.gantt-hide-financials .gantt-badge-payment { display: none !important; }
.gantt-hide-financials .gantt-bar-badge--payment { display: none !important; }
.gantt-hide-operations .gantt-cell[data-housekeeping] { border-bottom-color: transparent !important; }
.gantt-hide-operations .gantt-bar-badge--housekeeping { display: none !important; }
.gantt-hide-guestInfo .gantt-badge-unread { display: none !important; }
.gantt-hide-guestInfo .gantt-bar-badge--messages { display: none !important; }

/* Unread messages badge — optical vertical centering nudge */
.gantt-bar-badge--messages {
    padding-top: 1px;
}

/* Documentation prose styles (replaces @tailwindcss/typography) */
.doc-prose h1 { font-size: 1.875rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.75rem; color: #111827; line-height: 1.3; }
.doc-prose h2 { font-size: 1.5rem; font-weight: 600; margin-top: 1.75rem; margin-bottom: 0.5rem; color: #1f2937; line-height: 1.35; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.4rem; }
.doc-prose h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #374151; line-height: 1.4; }
.doc-prose h4 { font-size: 1.1rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.4rem; color: #374151; }
.doc-prose p { margin-top: 0.75rem; margin-bottom: 0.75rem; line-height: 1.7; color: #374151; }
.doc-prose ul { list-style-type: disc; padding-left: 1.5rem; margin-top: 0.5rem; margin-bottom: 0.75rem; }
.doc-prose ol { list-style-type: decimal; padding-left: 1.5rem; margin-top: 0.5rem; margin-bottom: 0.75rem; }
.doc-prose li { margin-top: 0.25rem; margin-bottom: 0.25rem; line-height: 1.6; color: #374151; }
.doc-prose li > ul, .doc-prose li > ol { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.doc-prose a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.doc-prose a:hover { opacity: 0.8; }
.doc-prose strong { font-weight: 600; color: #111827; }
.doc-prose em { font-style: italic; }
.doc-prose code { background: #f3f4f6; padding: 0.15rem 0.35rem; border-radius: 0.25rem; font-size: 0.875rem; color: #dc2626; }
.doc-prose pre { background: #1f2937; color: #e5e7eb; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin-top: 1rem; margin-bottom: 1rem; font-size: 0.875rem; line-height: 1.6; }
.doc-prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.doc-prose blockquote { border-left: 3px solid var(--color-primary); padding-left: 1rem; margin-top: 1rem; margin-bottom: 1rem; color: #6b7280; font-style: italic; }
.doc-prose hr { border: none; border-top: 1px solid #e5e7eb; margin: 1.5rem 0; }
.doc-prose table { width: 100%; border-collapse: collapse; margin-top: 1rem; margin-bottom: 1rem; font-size: 0.875rem; }
.doc-prose th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 2px solid #e5e7eb; font-weight: 600; color: #374151; }
.doc-prose td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #f3f4f6; color: #4b5563; }

/* Occupancy Heatmap — Neobrutalist */
.heatmap-vacant { background-color: #f1f5f9; border: 1px solid #e2e8f0; } /* slate-100 with border */
.heatmap-partial { background-color: #fcd34d; border: 1px solid #f59e0b; } /* amber-300 with amber border */
.heatmap-full { background-color: #ef4444; border: 1px solid #dc2626; } /* red-500 with red border */

/* Badge pop animation — subtle scale bounce when count updates */
@keyframes badge-pop {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); background-color: #22c55e; }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* ============================================================
   Operations Command Center — Calendar Grid
   ============================================================ */

/* Base day cell — fixed 40px columns */
.calendar-cell {
    width: 40px;
    min-width: 40px;
    position: relative;
}

/* Reservation bar base — absolutely positioned within the day cell */
.reservation-bar {
    position: absolute;
    top: 2px;
    bottom: 2px;
    border-radius: 2px;
}

/* Half-day edge classes */
.reservation-bar--full    { left: 0;   right: 0; }
.reservation-bar--checkin { left: 50%; right: 0; }
.reservation-bar--checkout { left: 0;  right: 50%; }
.reservation-bar--single  { left: 50%; right: 50%; }

/* Provisional / unconfirmed booking */
.reservation-bar--provisional {
    border: 2px dashed currentColor;
    background: transparent;
    opacity: 0.7;
}

/* Housekeeping heatmap — bottom border on day cells */
.calendar-cell[data-housekeeping="dirty"]       { border-bottom: 4px solid #ef4444; }
.calendar-cell[data-housekeeping="in_progress"] { border-bottom: 4px solid #eab308; }
.calendar-cell[data-housekeeping="inspected"]   { border-bottom: 4px solid #22c55e; }

/* Check-in state overlays */
.reservation-bar[data-checkin-state="expected"]    { opacity: 0.5; }
.reservation-bar[data-checkin-state="checked_in"]  { opacity: 1; }
.reservation-bar[data-checkin-state="checked_out"] { filter: grayscale(1); opacity: 0.7; }

/* Availability exception — hatched pattern */
.calendar-cell--ooo {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(239, 68, 68, 0.1) 4px,
        rgba(239, 68, 68, 0.1) 8px
    );
    pointer-events: none;
}

/* Hide scrollbar but keep scroll functionality */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* View Options toggle — hide layers on the enhanced calendar grid */
#calendar-grid.hide-financials .gantt-bar-badge--payment { display: none; }
#calendar-grid.hide-housekeeping .gantt-bar-badge--housekeeping { display: none; }
#calendar-grid.hide-operations .gantt-bar-badge--messages { display: none; }
#calendar-grid.hide-guest-info .gantt-bar-guest-name { opacity: 0; width: 0; overflow: hidden; }
#calendar-grid.flat-view [data-parent-path]:not([data-droppable]) { display: none; }
#calendar-grid.hide-rates .gantt-rate-label { display: none; }
.hide-operations .reservation-bar[data-checkin-state] { opacity: 1; filter: none; }
.hide-guest-info .calendar-badge--comms           { display: none; }

/* Calendar drag-selection highlight */
.calendar-cell-selected {
    background-color: rgb(73 152 176 / 0.15) !important;
    outline: 2px solid rgb(73 152 176 / 0.5);
    outline-offset: -2px;
}

/* Heatmap highlight for suggested dates */
.heatmap-selected {
    outline: 2px solid rgb(73 152 176 / 0.8);
    outline-offset: -2px;
    background-color: rgb(73 152 176 / 0.2) !important;
}

/* Optimistic UI states */
[data-optimistic="saving"] {
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
}
[data-optimistic="error"] {
    outline: 2px solid rgb(239 68 68 / 0.8);
    outline-offset: 2px;
    animation: optimistic-shake 0.35s ease-in-out;
}
[data-optimistic="confirmed"] {
    outline: 2px solid rgb(34 197 94 / 0.6);
    outline-offset: 2px;
}
@keyframes optimistic-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-4px); }
    40%       { transform: translateX(4px); }
    60%       { transform: translateX(-3px); }
    80%       { transform: translateX(3px); }
}

/* ── Chat message entrance animation ── */
@keyframes chat-message-slide-in {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.chat-message-enter {
    animation: chat-message-slide-in 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .chat-message-enter {
        animation: none;
    }
}
