/* Auto-extracted from index.html inline <style> blocks. */
/* Keep edits here and regenerate index.compiled.html via tools/build-compiled.mjs. */

/* --- Style Block 1 --- */

        :root {
            --bg-dark: #0f172a;
            --bg-card: #1e293b;
            --text-primary: #f8fafc;
            --text-secondary: #94a3b8;
            --accent-green: #10b981;
            --accent-blue: #3b82f6;
            --accent-purple: #8b5cf6;
            --border: #334155;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
        }

        body {
            background-color: var(--bg-dark);
            color: var(--text-primary);
            padding: 2rem;
            line-height: 1.5;
        }

        h1 {
            font-size: 2rem;
            margin-bottom: 2rem;
            font-weight: 700;
            letter-spacing: -0.025em;
        }

        h2 {
            font-size: 1.25rem;
            margin-bottom: 1rem;
            color: var(--text-secondary);
            font-weight: 600;
        }

        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 1.5rem;
            margin-bottom: 3rem;
        }

        .stat-card {
            background: var(--bg-card);
            padding: 1.5rem;
            border-radius: 1rem;
            border: 1px solid var(--border);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }

        .stat-label {
            color: var(--text-secondary);
            font-size: 0.875rem;
            font-weight: 500;
        }

        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            margin-top: 0.5rem;
        }

        .stat-sub {
            font-size: 0.875rem;
            color: var(--accent-green);
            margin-top: 0.25rem;
        }

        /* Timeline / Gantt */
        .timeline-container {
            background: var(--bg-card);
            border-radius: 1rem;
            border: 1px solid var(--border);
            padding: 1.5rem;
            margin-bottom: 3rem;
            overflow-x: auto;
        }

        .timeline-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 1rem;
            align-items: center;
        }

        .legend {
            display: flex;
            gap: 1rem;
            font-size: 0.875rem;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
        }

        .dot.direct {
            background: var(--accent-green);
        }

        .dot.booking {
            background: var(--accent-blue);
        }

        .gantt-grid {
            display: grid;
            grid-template-columns: 44px repeat(17, 1fr);
            /* Room Name + 17 Days (15-31) */
            gap: 1px;
            background: var(--border);
            border: 1px solid var(--border);
            min-width: 900px;
        }

        .gantt-grid,
        .gantt-grid * {
            -webkit-user-select: none;
            user-select: none;
            -webkit-touch-callout: none;
            -webkit-tap-highlight-color: transparent;
        }

        /* Tab Navigation */
        .tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }

        .tab-btn {
            padding: 0.75rem 1.5rem;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            color: var(--text-secondary);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .tab-btn:hover {
            background: #25334d;
        }

        .tab-btn.active {
            background: var(--accent-blue);
            color: white;
            border-color: var(--accent-blue);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .gantt-cell {
            background: var(--bg-card);
            padding: 0.5rem;
            font-size: 0.75rem;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            border-right: 1px solid rgba(255, 255, 255, 0.06);
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        }

        .gantt-cell.timeline-empty-cell {
            cursor: pointer;
        }

        .gantt-cell.timeline-empty-cell.timeline-cell-selected {
            background: rgba(59, 130, 246, 0.22);
            box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.95);
        }

        .gantt-header {
            background: #25334d;
            font-weight: 600;
            color: var(--text-secondary);
            text-align: center;
            position: sticky;
            top: 0;
            z-index: 24;
        }

        .gantt-row-label {
            background: #25334d;
            font-weight: 600;
            position: sticky;
            left: 0;
            z-index: 32;
            text-align: left;
            padding-left: 1rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .gantt-corner {
            position: sticky !important;
            top: 0 !important;
            left: 0 !important;
            z-index: 40 !important;
        }

        .gantt-monday-guide {
            position: relative;
            z-index: 1;
            pointer-events: none;
            align-self: stretch;
            justify-self: start;
            width: 2px;
            background: #ffffff;
            opacity: 1;
        }

        .booking-bar {
            border-radius: 4px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            position: relative;
            padding: 2px 0.5rem;
            overflow: hidden;
            white-space: nowrap;
            color: white;
            font-weight: 600;
            font-size: 0.70rem;
            line-height: 1.2;
            cursor: pointer;
            z-index: 2;
            transition: transform 0.1s;
            min-height: 28px;
            border-left: 1px solid rgba(2, 6, 23, 0.42);
            border-right: 1px solid rgba(2, 6, 23, 0.42);
        }

        .booking-day-separators {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 0;
        }

        .booking-day-separator {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 1px;
            transform: translateX(-0.5px);
            background: rgba(2, 6, 23, 0.28);
            opacity: 0.55;
        }

        .booking-day-separator.monday {
            background: rgba(255, 255, 255, 0.24);
            opacity: 0.75;
        }

        .booking-bar > :not(.booking-day-separators) {
            position: relative;
            z-index: 1;
        }

        .booking-bar:hover {
            transform: scale(1.02);
            z-index: 5;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        }

        .booking-bar.direct {
            background: var(--accent-green);
        }

        .booking-bar.booking {
            background: var(--accent-blue);
        }

        .booking-bar.mobile-selected {
            box-shadow: inset 0 0 0 2px rgba(186, 230, 253, 0.95), 0 0 0 1px rgba(56, 189, 248, 0.75);
        }

        /* tooltip */
        .tooltip {
            position: absolute;
            background: #000;
            color: #fff;
            padding: 8px;
            border-radius: 4px;
            font-size: 12px;
            pointer-events: none;
            display: none;
            z-index: 1000;
            border: 1px solid var(--border);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
        }

        .tooltip.mobile-adaptive {
            position: fixed;
            width: min(320px, calc(100vw - 28px));
            background: rgba(0, 0, 0, 0.9);
            z-index: 4000;
            pointer-events: auto;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.75);
        }

        .tooltip.mobile-adaptive * {
            text-shadow: inherit;
        }

        .tooltip.mobile-adaptive .tooltip-edit-action {
            margin-top: 8px;
            width: 100%;
            border: 1px solid rgba(147, 197, 253, 0.7);
            border-radius: 8px;
            background: rgba(30, 41, 59, 0.75);
            color: #e2e8f0;
            font-size: 12px;
            font-weight: 700;
            padding: 7px 10px;
            cursor: pointer;
        }

        #mobileTimelineStepNav {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 3200;
            pointer-events: none;
        }

        #mobileTimelineBack10,
        #mobileTimelineForward10 {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 38px;
            height: 38px;
            border: 1px solid rgba(148, 163, 184, 0.55);
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.62);
            color: #f8fafc;
            font-size: 0.95rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            cursor: pointer;
            box-shadow: 0 8px 18px rgba(2, 6, 23, 0.45);
            pointer-events: auto;
            opacity: 0.9;
        }

        #mobileTimelineBack10 {
            left: 34px;
        }

        #mobileTimelineForward10 {
            right: 6px;
        }

        #mobileTimelineBack10[disabled],
        #mobileTimelineForward10[disabled] {
            display: none;
        }

        #mobileTimelineBack10::after,
        #mobileTimelineForward10::after {
            content: attr(data-target-label);
            position: absolute;
            top: -20px;
            left: 50%;
            transform: translateX(-50%);
            padding: 2px 6px;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.82);
            border: 1px solid rgba(148, 163, 184, 0.35);
            color: #e2e8f0;
            font-size: 10px;
            font-weight: 700;
            line-height: 1.2;
            white-space: nowrap;
            pointer-events: none;
        }

        #mobileTimelineBack10[data-target-label=""]::after,
        #mobileTimelineForward10[data-target-label=""]::after {
            display: none;
        }

        /* Detail Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 2000;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 1rem;
            padding: 2rem;
            min-width: 400px;
            max-width: 500px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid var(--border);
            padding-bottom: 1rem;
        }

        .modal-title {
            font-size: 1.25rem;
            font-weight: 700;
        }

        .modal-close {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
        }

        .modal-close:hover {
            color: #fff;
        }

        .modal-row {
            display: flex;
            justify-content: space-between;
            padding: 0.6rem 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }

        .modal-label {
            color: var(--text-secondary);
            font-size: 0.85rem;
        }

        .modal-value {
            font-weight: 500;
            text-align: right;
        }

        .modal-value.phone {
            color: var(--accent-blue);
        }

        .modal-value a {
            color: var(--accent-blue);
            text-decoration: none;
        }

        .modal-value a:hover {
            text-decoration: underline;
        }

        .modal-badge {
            display: inline-block;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .modal-badge.direct {
            background: rgba(16, 185, 129, 0.2);
            color: var(--accent-green);
        }

        .modal-badge.booking {
            background: rgba(59, 130, 246, 0.2);
            color: var(--accent-blue);
        }

        tr.clickable {
            cursor: pointer;
        }

        tr.clickable:hover td {
            background: rgba(59, 130, 246, 0.1);
        }

        /* Group Dividers */
        .group-header {
            grid-column: 1 / -1;
            background: var(--bg-dark);
            color: var(--text-secondary);
            padding: 0.5rem 1rem;
            font-weight: 700;
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        /* Table */
        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
        }

        th {
            text-align: left;
            padding: 0.5rem 0.25rem;
            border-bottom: 2px solid var(--border);
            color: var(--text-secondary);
            font-size: 0.8rem;
            white-space: normal;
            /* Allow header wrapping */
        }

        td {
            padding: 0.4rem 0.25rem;
            border-bottom: 1px solid var(--border);
            font-size: 0.85rem;
            word-wrap: break-word;
            /* Force wrapping for long text */
            max-width: 150px;
            /* limits width to force wrap */
        }

        tr:hover td {
            background: rgba(255, 255, 255, 0.02);
        }

        .badge {
            padding: 0.25rem 0.6rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .badge-direct {
            background: rgba(16, 185, 129, 0.2);
            color: var(--accent-green);
        }

        .badge-booking {
            background: rgba(59, 130, 246, 0.2);
            color: var(--accent-blue);
        }

        /* Sortable Headers & Filter Icons */
        th {
            position: relative;
        }

        .header-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
        }

        .header-content:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .booking-list-filter-bar {
            display: flex;
            flex-wrap: nowrap;
            gap: 8px;
            margin: 0 0 10px 0;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
        }

        .list-filter-btn {
            flex: 0 0 auto;
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: rgba(30, 41, 59, 0.9);
            color: #e2e8f0;
            border-radius: 8px;
            padding: 6px 10px;
            font-size: 0.78rem;
            font-weight: 700;
            cursor: pointer;
            line-height: 1.1;
            white-space: nowrap;
        }

        .list-filter-btn:hover,
        .list-filter-btn.active {
            border-color: rgba(56, 189, 248, 0.65);
            background: rgba(30, 58, 138, 0.5);
            color: #dbeafe;
        }

        .sort-icon::after {
            content: '⇅';
            opacity: 0.3;
        }

        th.asc .sort-icon::after {
            content: '▲';
            opacity: 1;
            color: var(--accent-blue);
        }

        th.desc .sort-icon::after {
            content: '▼';
            opacity: 1;
            color: var(--accent-blue);
        }

        .filter-icon {
            opacity: 0.5;
            font-size: 1.1em;
            padding: 2px 6px;
            border-radius: 4px;
        }

        .filter-icon:hover,
        .filter-icon.active {
            opacity: 1;
            background: rgba(59, 130, 246, 0.2);
            color: var(--accent-blue);
        }

        /* Filter Popover */
        .filter-popover {
            display: none;
            position: absolute;
            top: 0;
            left: 100%;
            margin-left: 10px;
            background: #1e293b;
            border: 1px solid #334155;
            border-radius: 8px;
            padding: 12px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
            z-index: 50;
            min-width: 200px;
        }

        .filter-popover.show {
            display: block;
        }

        .filter-popover-actions {
            display: none;
        }

        .filter-popover-title-row {
            display: none;
        }

        .filter-popover-title-main {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }

        .filter-popover-sort {
            border: 1px solid rgba(56, 189, 248, 0.55);
            background: rgba(30, 58, 138, 0.45);
            color: #dbeafe;
            padding: 4px 8px;
            border-radius: 999px;
            font-size: 0.72rem;
            font-weight: 700;
            line-height: 1.1;
            cursor: pointer;
            white-space: nowrap;
        }

        .filter-action-btn {
            border: 1px solid #334155;
            background: #0f172a;
            color: #e2e8f0;
            padding: 8px 10px;
            border-radius: 8px;
            font-size: 0.82rem;
            font-weight: 700;
            cursor: pointer;
        }

        .filter-action-btn.apply {
            border-color: rgba(56, 189, 248, 0.55);
            background: rgba(30, 58, 138, 0.5);
        }

        .filter-action-btn.back {
            border-color: rgba(148, 163, 184, 0.45);
            background: rgba(30, 41, 59, 0.78);
        }

        .filter-popover-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(2, 6, 23, 0.5);
            backdrop-filter: blur(1px);
            -webkit-backdrop-filter: blur(1px);
            z-index: 3550;
        }

        .filter-popover-backdrop.show {
            display: block;
        }

        .custom-period-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(2, 6, 23, 0);
            z-index: 3550;
        }

        .custom-period-overlay.show {
            display: block;
        }

        .custom-period-popover {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            margin: 0 !important;
            width: min(calc(100vw - 20px), 380px);
            max-width: calc(100vw - 20px);
            min-width: 0 !important;
            max-height: min(76vh, 540px);
            overflow-y: auto;
            overflow-x: hidden;
            z-index: 12000;
            border-radius: 14px;
            box-shadow: 0 12px 24px rgba(2, 6, 23, 0.38);
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: #0f172a;
            padding: 14px;
            box-sizing: border-box;
            -webkit-backface-visibility: hidden;
        }

        .custom-period-popover.show {
            display: block;
        }

        .custom-period-date-field {
            display: flex;
            flex-direction: column;
            gap: 4px;
            width: 100%;
            min-width: 0;
        }

        .custom-period-date-field label {
            color: #94a3b8;
            font-size: 0.8em;
        }

        .custom-period-title-toggle {
            border: 1px solid rgba(56, 189, 248, 0.5);
            background: rgba(30, 58, 138, 0.42);
            color: #dbeafe;
            border-radius: 999px;
            padding: 4px 8px;
            font-size: 0.72rem;
            font-weight: 700;
            line-height: 1.1;
            cursor: pointer;
            white-space: nowrap;
            min-height: 26px;
        }

        .custom-period-popover input[type="date"] {
            display: block;
            width: 100%;
            max-width: 100%;
            min-width: 0;
            background: #0f172a;
            border: 1px solid #334155;
            color: white;
            padding: 10px 11px;
            border-radius: 9px;
            font-size: 16px;
            box-sizing: border-box;
            margin: 0;
        }

        .custom-period-months {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 6px;
            width: 100%;
        }

        .custom-period-month-btn {
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: #1e293b;
            color: #e2e8f0;
            border-radius: 8px;
            padding: 7px 8px;
            font-size: 0.78rem;
            font-weight: 700;
            cursor: pointer;
            white-space: nowrap;
            min-width: 0;
            text-align: center;
        }

        .custom-period-month-btn.active {
            background: var(--accent-green);
            color: #fff;
            border-color: var(--accent-green);
        }

        @media (max-width: 420px) {
            .custom-period-months {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }
        }

        .filter-popover input,
        .filter-popover select {
            width: 100%;
            margin-bottom: 8px;
            background: #0f172a;
            border: 1px solid #334155;
            color: white;
            padding: 6px;
            border-radius: 4px;
            font-size: 0.9em;
        }

        .filter-date-field {
            margin-bottom: 8px;
        }

        .filter-date-field label {
            display: block;
            font-size: 0.8em;
            color: #94a3b8;
            margin-bottom: 4px;
        }

        /* Right align for numeric columns (pop to left) */
        th:nth-last-child(-n+2) .filter-popover {
            left: auto;
            right: 100%;
            margin-left: 0;
            margin-right: 10px;
        }

        .btn-reset {
            background: none;
            border: 1px solid var(--border);
            color: var(--text-secondary);
            padding: 4px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.8rem;
        }

        .btn-reset:hover {
            background: #334155;
            color: white;
        }

        /* Responsive Improvements */
        @media (max-width: 768px) {
            .timeline-container {
                padding: 0.5rem !important;
                /* Minimal container padding */
                margin-left: -1rem;
                /* Negative margin to pull to edges */
                margin-right: -1rem;
                width: calc(100% + 2rem);
                /* Compensate for negative margins */
                border-radius: 0;
                border-left: none;
                border-right: none;
            }

            table {
                font-size: 14px !important;
                /* larger font */
                width: 100%;
                table-layout: auto;
            }

            tbody tr {
                height: 48px !important;
                /* Force Height */
            }

            th,
            td {
                padding: 0.75rem 4px !important;
                /* taller rows to match month bar height */
                max-width: none;
                /* allow columns to use full width */
                overflow: hidden;
                white-space: normal;
            }

            .date-cell {
                min-width: 40px;
                /* allow date to shrink significantly */
                white-space: normal;
                line-height: 1.1;
                font-size: 0.95em;
            }

            .room-col {
                width: 25px;
                max-width: 25px;
                text-align: right;
                padding: 0 4px 0 0 !important;
                border-right: none !important;
                font-weight: 700;
            }

            .price-col {
                text-align: left;
                padding-left: 4px !important;
                border-left: none !important;
                font-size: 0.75rem;
            }

            /* Mobile filter popovers become centered modal-like panels. */
            .filter-popover {
                position: fixed !important;
                top: 50% !important;
                left: 50% !important;
                right: auto !important;
                transform: translate(-50%, -50%) translateZ(0);
                margin: 0 !important;
                width: min(94vw, 380px);
                min-width: 0 !important;
                max-height: min(76vh, 540px);
                overflow-y: auto;
                overflow-x: hidden;
                z-index: 12000;
                border-radius: 14px;
                box-shadow: 0 12px 24px rgba(2, 6, 23, 0.38);
                border: 1px solid rgba(148, 163, 184, 0.35);
                background: #0f172a;
                padding: 14px;
                -webkit-backface-visibility: hidden;
            }

            th:nth-last-child(-n+2) .filter-popover {
                left: 50% !important;
                right: auto !important;
                margin: 0 !important;
            }

            .filter-popover-actions {
                display: flex;
                gap: 8px;
                margin-top: 10px;
            }

            .filter-popover-actions .filter-action-btn {
                flex: 1;
                min-height: 44px;
                font-size: 16px;
            }

            .filter-popover-title-row {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 10px;
                margin-bottom: 10px;
                padding-bottom: 8px;
                border-bottom: 1px solid rgba(148, 163, 184, 0.2);
            }

            .filter-popover-title {
                font-size: 1rem;
                font-weight: 700;
                color: #e2e8f0;
            }

            .filter-popover-sort {
                min-height: 28px;
                padding: 5px 9px;
            }

            .filter-popover-close {
                width: 28px;
                height: 28px;
                border-radius: 999px;
                border: 1px solid rgba(148, 163, 184, 0.45);
                background: rgba(30, 41, 59, 0.82);
                color: #cbd5e1;
                font-size: 18px;
                line-height: 1;
                cursor: pointer;
            }

            .filter-popover input,
            .filter-popover select {
                font-size: 16px !important;
                border-radius: 9px;
                padding: 10px 11px;
                margin-bottom: 10px;
            }

            .filter-popover-backdrop {
                display: none !important;
                pointer-events: none !important;
            }

            /* Keep a very thin date/header row on mobile. */
            .gantt-header {
                display: flex !important;
            }

            /* Force equal row heights by giving gantt a viewport-based height */
            #gantt {
                margin-top: 0 !important;
                padding-top: 0 !important;
                border-top: none !important;
                /* Thin header track + regular room rows */
                grid-template-rows: var(--timeline-header-h, 14px) !important;
                grid-auto-rows: minmax(var(--timeline-row-h, 64px), 1fr) !important;
            }


            .badge {
                padding: 0px 2px;
                font-size: 0.65rem;
            }

            /* Hide room group prefix if possible, or just keep it small */
            .room-prefix {
                display: none;
            }

            .gantt-row-label {
                font-size: 0.9em;
                padding-left: 0.5rem;
                text-align: center;
            }

            /* Compact top search row for mobile booking list. */
            #tab-list thead th {
                font-size: 0.6rem !important;
                padding: 2px 1px !important;
                white-space: nowrap !important;
                height: 25px !important;
            }

            .booking-list-filter-bar {
                display: grid;
                grid-template-columns: repeat(5, minmax(0, 1fr));
                gap: 4px;
                width: 100%;
                max-width: 100%;
                margin: 0 0 8px 0;
                padding: 0;
                box-sizing: border-box;
                overflow: visible;
            }

            .list-filter-btn {
                flex: unset;
                width: 100%;
                min-width: 0;
                min-height: 32px;
                font-size: 0.64rem;
                padding: 5px 4px;
                border-radius: 7px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            /* Keep filter popover nodes mounted, but hide duplicate header visuals. */
            #tab-list thead {
                display: table-header-group !important;
            }

            #tab-list thead tr {
                height: 0 !important;
            }

            #tab-list thead th {
                padding: 0 !important;
                border: 0 !important;
                height: 0 !important;
                line-height: 0 !important;
                font-size: 0 !important;
                color: transparent !important;
            }

            #tab-list thead .header-content {
                display: none !important;
            }

            /* Hide sort icons in footer on mobile if they take too much space */
            #tab-list thead .sort-icon {
                display: none !important;
            }
        }

/* --- Style Block 2 --- */

        /* --- GLASSMORPHISM THEME OVERRIDES --- */
        :root {
            --glass-bg: rgba(30, 41, 59, 0.65);
            --glass-border: rgba(255, 255, 255, 0.08);
            --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
            --primary-gradient: linear-gradient(135deg, #0f172a 0%, #312e81 100%);
        }

        /* 1. Fix Background & Contrast */
        body {
            background: var(--primary-gradient) !important;
            min-height: 100vh;
            margin: 0;
            overflow-x: hidden;
            /* Prevent horizontal scroll */
            color: #f8fafc;
            padding-bottom: 20px;
            /* Reduced — carousel controls moved to header */
        }

        /* 2. Glass Cards (Stats, Timeline) */
        .stat-card,
        .timeline-container,
        .edit-modal-box {
            background: var(--glass-bg) !important;
            backdrop-filter: blur(16px) !important;
            -webkit-backdrop-filter: blur(16px) !important;
            border: 1px solid var(--glass-border) !important;
            box-shadow: var(--glass-shadow) !important;
            border-radius: 20px !important;
        }

        /* 3. Typography Pop */
        .stat-value {
            background: linear-gradient(to right, #ffffff, #cbd5e1);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        h1,
        h2,
        h3,
        h4 {
            color: white !important;
            margin-top: 0;
        }

        .stat-label,
        .stat-sub {
            color: #cbd5e1 !important;
        }

        /* 4. Modern Inputs */
        input,
        select,
        textarea {
            background: rgba(15, 23, 42, 0.5) !important;
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
            backdrop-filter: blur(4px);
            color: white !important;
            border-radius: 10px !important;
            padding: 12px !important;
        }

        input:focus,
        select:focus {
            border-color: #8b5cf6 !important;
            outline: none;
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
        }

        /* FAB group */
        .fab-group {
            position: fixed;
            bottom: 70px;
            right: 10px;
            z-index: 1000;
            display: flex;
            flex-direction: column-reverse;
            align-items: center;
            gap: 8px;
        }

        .fab {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            color: white;
            font-size: 22px;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.2s, box-shadow 0.2s;
            position: relative;
            /* Glassy FAB */
            border: 1px solid rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(4px);
            opacity: 1;
            /* User requested 100% for menu items */
        }

        .fab:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
            opacity: 1;
        }

        .fab-add {
            background: linear-gradient(135deg, #10b981, #059669);
            font-size: 28px;
            width: 60px;
            height: 60px;
        }

        .fab-import {
            background: linear-gradient(135deg, #8b5cf6, #7c3aed);
        }

        .fab-import-wrap {
            position: relative;
        }

        .fab-year-wrap {
            position: relative;
        }

        .fab-import-options {
            display: none;
            position: absolute;
            right: 62px;
            top: 50%;
            transform: translateY(-50%);
            min-width: 132px;
            background: rgba(15, 23, 42, 0.95);
            border: 1px solid rgba(148, 163, 184, 0.35);
            border-radius: 10px;
            padding: 6px;
            box-shadow: 0 10px 24px rgba(2, 6, 23, 0.55);
            z-index: 100001;
            backdrop-filter: blur(8px);
        }

        .fab-import-options .opt-btn {
            width: 100%;
            border: 1px solid rgba(148, 163, 184, 0.25);
            background: rgba(30, 41, 59, 0.9);
            color: #f8fafc;
            font-size: 12px;
            font-weight: 700;
            border-radius: 7px;
            padding: 7px 9px;
            margin-bottom: 5px;
            cursor: pointer;
            text-align: left;
        }

        .fab-import-options .opt-btn:last-child {
            margin-bottom: 0;
        }

        .fab-import-options .opt-btn:hover {
            background: rgba(51, 65, 85, 0.95);
        }

        .fab-import-options .opt-btn.active-import {
            border-color: rgba(56, 189, 248, 0.65);
            box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
            background: rgba(30, 58, 138, 0.5);
        }

        .fab-import-last {
            color: #cbd5e1;
            font-size: 11px;
            font-weight: 600;
            line-height: 1.3;
            padding: 4px 2px 7px 2px;
            margin-bottom: 6px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.2);
            word-break: break-word;
        }

        .fab-export {
            background: linear-gradient(135deg, #3b82f6, #2563eb);
        }

        .fab-year {
            background: linear-gradient(135deg, #14b8a6, #0f766e);
        }

        .fab-update {
            background: linear-gradient(135deg, #6366f1, #4f46e5);
        }

        .fab-undo {
            background: linear-gradient(135deg, #f59e0b, #d97706);
        }

        .fab-scroll {
            background: linear-gradient(135deg, #3b82f6, #2563eb);
            display: none;
        }

        .fab .fab-tooltip {
            position: absolute;
            right: 68px;
            white-space: nowrap;
            background: rgba(30, 41, 59, 0.9);
            color: #e2e8f0;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 500;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .fab:hover .fab-tooltip {
            opacity: 1;
        }

        .edit-modal-overlay {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(5px);
            overflow-x: hidden;
        }

        .edit-modal-overlay.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .edit-modal-box {
            color: #e2e8f0;
            padding: 25px;
            width: 480px;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
        }

        .edit-close {
            color: #94a3b8;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
        }

        .edit-close:hover {
            color: #fff;
        }

        .edit-form-group {
            margin-bottom: 15px;
            min-width: 0;
        }

        .edit-form-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 10px;
        }

        .edit-top-row {
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

        .edit-contact-row {
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 10px;
        }

        .edit-finance-row {
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 10px;
        }

        .edit-date-row {
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }

        .edit-form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: 600;
            color: #cbd5e1;
            font-size: 0.85em;
        }

        .edit-form-group input,
        .edit-form-group select {
            width: 100%;
            box-sizing: border-box;
            font-size: 14px;
            min-width: 0;
        }

        .btn-edit-save {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
            padding: 12px;
            border: none;
            cursor: pointer;
            width: 100%;
            border-radius: 10px;
            font-size: 16px;
            font-weight: bold;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        }

        .btn-edit-save:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }

        .btn-edit-delete {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: white;
            padding: 12px;
            border: none;
            cursor: pointer;
            width: 100%;
            margin-top: 10px;
            border-radius: 10px;
            font-size: 16px;
        }

        .btn-edit-delete:hover {
            opacity: 0.9;
        }

        .gantt-bar {
            cursor: pointer;
            transition: opacity 0.2s;
            border-radius: 4px;
        }

        .gantt-bar:hover {
            opacity: 0.85;
            box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
        }

        /* Carousel controls: HIDDEN on desktop */
        #mobileCarouselControls {
            display: none !important;
        }

        /* --- MOBILE LAYOUT OVERHAUL (<768px) --- */
        @media (max-width: 768px) {

            /* 0. GLOBAL SCROLLBARS (Visible on mobile) */
            ::-webkit-scrollbar {
                height: 8px;
                width: 8px;
                background: rgba(0, 0, 0, 0.2);
            }

            ::-webkit-scrollbar-thumb {
                background: rgba(255, 255, 255, 0.4);
                border-radius: 4px;
            }

            ::-webkit-scrollbar-thumb:hover {
                background: rgba(255, 255, 255, 0.6);
            }

            /* Standard Scroll for All */
            /* Standard Scroll for All */
            body {
                height: 100dvh !important;
                display: flex !important;
                flex-direction: column !important;
                overflow: hidden !important;
                /* Restore Lock */
                position: fixed;
                /* prevent rubber banding */
                width: 100%;
                margin: 0 !important;
                padding: 0 !important;
                background-color: #0f172a !important;
                /* FIX WHITE BACKGROUND */
                color: #f8fafc !important;
            }

            /* HIDE TITLE completely */
            #dashboardTitle {
                display: none !important;
            }

            /* A. TIMELINE WRAPPER (TOP) - Flattened for body-level reordering */
            #tab-timeline {
                display: contents !important;
            }

            /* Timeline Container - Flattened for body-level reordering */
            .timeline-container {
                border: none !important;
                background: transparent !important;
                box-shadow: none !important;
                padding: 0 !important;
                margin: 0 !important;
                display: contents !important;
            }

            /* Header (Top) -> Now moved to Order 2 (After Months) */
            /* Header (Top) -> Order 1 */
            .timeline-header {
                order: 1 !important;
                margin-bottom: 0px !important;
                margin-top: 0px !important;
                flex-direction: row !important;
                justify-content: center !important;
                padding: 2px 0 0 0 !important;
            }

            .timeline-header .legend {
                display: none !important;
            }

            .timeline-header>div:first-child {
                justify-content: center !important;
                width: 100%;
            }

            #timelineTitle {
                font-size: 1rem !important;
            }

            /* Grid (Middle) -> Order 3 (Below Months) */
            .gantt-grid {
                order: 3 !important;
                border-radius: 0 !important;
                overflow-x: auto !important;
                overflow-y: auto !important;
                border: none !important;
                flex-grow: 1 !important;
                flex-shrink: 1 !important;
                min-height: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
                height: auto !important;
                width: 100vw !important;
                max-width: 100vw !important;
                margin-left: calc(-1 * (100vw - 100%) / 2) !important;
                box-sizing: border-box !important;
                background: var(--bg-card) !important;
                gap: 1px !important;
                row-gap: 1px !important;
                column-gap: 1px !important;
            }

            /* Edge-to-edge: kill ALL padding on parent containers */
            #dashboardApp {
                padding: 0 !important;
                margin: 0 !important;
            }

            /* B. MONTH NAV WRAPPER (Bottom) -> Order 3 */
            /* B. MONTH NAV WRAPPER -> Order 2 (Below Header, Above Grid) */
            div[style*="justify-content:space-between"] {
                order: 2 !important;
                flex-direction: column !important;
                flex-shrink: 0 !important;
                gap: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
                background: transparent !important;
            }

            /* FAB Container Position (Mobile) */
            .fab-container {
                bottom: 10px !important;
                right: 10px !important;
                z-index: 9999 !important;
                position: fixed !important;
                pointer-events: auto !important;
            }

            .fab-container button,
            .fab-container .fab {
                pointer-events: auto !important;
            }

            /* Carousel controls: show on mobile */
            #mobileCarouselControls {
                display: flex !important;
            }

            /* Inner Container */
            div[style*="justify-content:space-between"]>div {
                display: flex !important;
                flex-direction: column !important;
                width: 100% !important;
                gap: 0 !important;
                margin-bottom: 0 !important;
            }

            /* B1. Month buttons */
            div[style*="justify-content:space-between"]>div>div:first-child {
                order: 1 !important;
                flex-wrap: nowrap !important;
                overflow-x: auto;
                padding-bottom: 2px !important;
                /* Minimal scroller padding */
                justify-content: flex-start !important;
                -webkit-overflow-scrolling: touch;
                margin-bottom: 0 !important;
            }

            /* B2. Search/Custom Toggle (Bottom of Nav block, but still Order 0 overall) */
            div[style*="justify-content:space-between"]>div>div:nth-child(2) {
                order: 100 !important;
                border-left: none !important;
                padding-left: 0 !important;
                display: flex !important;
                justify-content: center !important;
                width: 100% !important;
            }

            #customToggle {
                width: 100% !important;
                text-align: center;
                background: rgba(255, 255, 255, 0.05) !important;
            }

            /* H. ADAPTIVE MONTH BAR (Full Width) */
            #mainHeader {
                width: 100vw !important;
                max-width: 100vw !important;
                margin-left: calc(-50vw + 50%) !important;
                margin-bottom: 0 !important;
                padding: 4px 4px !important;
                box-sizing: border-box !important;
                gap: 0 !important;
                flex-shrink: 0 !important;
                order: 0 !important;
            }

            #mainHeader>div {
                width: 100% !important;
                gap: 0 !important;
            }

            #mainHeader>div>div {
                width: 100% !important;
                gap: 3px !important;
                flex-wrap: nowrap !important;
            }

            /* Hide the hidden select wrapper */
            #mainHeader>div>select,
            #mainHeader>div>div:has(#monthSelect) {
                display: none !important;
            }

            .month-btn {
                flex: 1 !important;
                padding: 0.4rem 0 !important;
                font-size: 0.75rem !important;
                border-radius: 6px !important;
                text-align: center !important;
                white-space: nowrap !important;
                min-width: 0 !important;
            }

            /* C. TABS (Lower Middle) */
            .tabs {
                order: 5 !important;
                justify-content: center;
                margin-bottom: 1rem !important;
            }

            /* D. STATS GRID (Bottom) */
            /* D. STATS GRID & VIEWS (Mobile Carousel) */
            /* By default hide OTHER views */
            #tab-list,
            .stats-grid {
                display: none !important;
            }

            /* VITAL: Hide loose stat cards on mobile so they don't block the view if JS fails */
            .stat-card {
                display: none !important;
            }

            /* Only show stat cards if they are inside the active mobile view */
            .mobile-view-active .stat-card {
                display: block !important;
            }

            /* When active, show them */
            .mobile-view-active {
                display: flex !important;
                flex-direction: column !important;
                flex-grow: 1 !important;
                /* overflow-y: auto !important; <-- handled by body now or container */
            }

            /* Specific overrides */
            .stats-grid.mobile-view-active {
                display: grid !important;
            }

            /* Stat cards are hidden by the generic rule, need to unhide */
            .mobile-view-active .stat-card {
                display: block !important;
            }

            /* Ensure Gantt keeps grid layout when active */
            .gantt-grid {
                /* Default is visible, JS will toggle display:none if inactive */
            }

            .gantt-grid.mobile-view-active {
                display: grid !important;
                flex-direction: unset !important;
                overflow-x: auto !important;
                -webkit-overflow-scrolling: touch;
                min-width: 0 !important;
                gap: 1px !important;
            }

            /* Compact gantt header row on mobile */
            .gantt-cell.gantt-header {
                padding: 0 !important;
                font-size: 0.62rem !important;
                font-weight: 600 !important;
                min-height: unset !important;
                max-height: var(--timeline-header-h, 14px) !important;
                height: var(--timeline-header-h, 14px) !important;
                line-height: var(--timeline-header-h, 14px) !important;
                box-sizing: border-box !important;
                background: #25334d !important;
            }

            /* Compact gantt cells on mobile - eliminate row gaps */
            .gantt-cell {
                padding: 1px !important;
                align-self: stretch !important;
                min-height: 0 !important;
            }

            .booking-bar {
                min-height: 22px !important;
                margin: 1px 0 !important;
                padding: 1px 4px !important;
            }

            .stat-card {
                padding: 1rem !important;
            }

            .stat-value {
                font-size: 1.4rem !important;
            }

            .stat-label {
                font-size: 0.75rem !important;
            }

            .modal {
                width: 95% !important;
                min-width: unset !important;
            }

            /* C. TABS (Original Desktop Tabs - HIDDEN on Mobile) */
            .tabs {
                display: none !important;
            }

            /* D. BOOKING LIST TOGGLE (Mobile Only) */
            #mobileBookingToggle {
                display: flex !important;
                order: 5 !important;
                background: var(--bg-card);
                border: 1px solid var(--border);
                color: var(--text-primary);
                padding: 1rem;
                border-radius: 12px;
                font-weight: 600;
                justify-content: space-between;
                align-items: center;
                margin-bottom: 1rem;
                cursor: pointer;
                box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            }

            #mobileBookingToggle:hover {
                background: rgba(255, 255, 255, 0.05);
            }

            /* E. BOOKING LIST CONTENT */
            #tab-list {
                order: 6 !important;
                width: 100% !important;
                display: none;
            }

            #tab-list.active-mobile {
                display: block !important;
                margin-bottom: 1rem;
            }

            /* Keep final booking rows visible above fixed month/timeline bars. */
            #tab-list.mobile-view-active {
                padding-bottom: 0 !important;
                scroll-padding-bottom: 0 !important;
                box-sizing: border-box !important;
                max-height: calc(100vh - var(--mobile-bottom-reserve, 96px) - env(safe-area-inset-bottom)) !important;
            }

            /* F. STATS GRID (Bottom) */
            .stats-grid {
                order: 10 !important;
                grid-template-columns: 1fr 1fr !important;
                gap: 10px !important;
                margin-bottom: 0 !important;
                padding-bottom: 0 !important;
            }

            /* G. TIMELINE WIDTH & LABELS (Mobile Requests) */
            /* NOTE: grid-template-columns is now set by JS (mobile-aware) — do NOT override here */
            #gantt.gantt-grid {
                /* Thin dedicated header track on mobile + regular room rows. */
                grid-template-rows: var(--timeline-header-h, 14px) !important;
                grid-auto-rows: minmax(var(--timeline-row-h, 64px), 1fr) !important;

                /* Flexbox parent behavior */
                flex-grow: 1 !important;
                overflow-y: auto !important;
                /* Remove extra bottom padding so there is no blank gap under the last row */
                padding: 0 !important;
                height: auto !important;
                /* Let flex-grow handle it */
            }

            .gantt-row-label {
                justify-content: center !important;
                text-align: center !important;
                padding: 0 !important;
                font-weight: bold;
                font-size: 0.9rem;
                width: 100% !important;
                position: sticky !important;
                left: 0 !important;
                z-index: 30 !important;
                background: #25334d !important;
                box-shadow: 2px 0 0 rgba(15, 23, 42, 0.65);
            }

            /* Header Row - Keep "Room" word but align it */
            .gantt-header:first-child {
                justify-content: center !important;
                text-align: center !important;
            }
        }

        /* DESKTOP: Hide mobile-only UI elements */
        @media (min-width: 769px) {
            #headerCarouselDots {
                display: none !important;
            }

            #mobileNavBar,
            #mobileBookingToggle {
                display: none !important;
            }
        }

        /* Ensure Toggle Button is Hidden (We use Carousel now) */
        #mobileBookingToggle {
            display: none !important;
        }

        /* --- MOBILE CAROUSEL STYLES --- */
        @media (max-width: 768px) {

            /* Hide everything by default, we will show active view */
            .mobile-view {
                display: none;
                width: 100%;
                height: 100%;
                /* Fill body */
                flex-direction: column;
                overflow: hidden;
                /* Container is fixed */
                background: var(--bg-dark);
            }

            /* Booking list: allow scrolling when active */
            #view-list.mobile-view.active {
                overflow-y: auto !important;
                -webkit-overflow-scrolling: touch;
            }

            .mobile-view.active {
                display: flex;
            }

            /* View Specific Adjustments */
            #view-timeline {
                /* Layout: Header -> Grid -> Month Nav -> (Nav Bar is global) */
            }

            /* Floating Nav Pill (Minimalist) - DISABLED / REPLACED BY CAROUSEL CONTROLS */
            .mobile-nav-bar {
                display: none !important;
            }

            /* Minimal Arrows */
            .nav-arrow {
                background: transparent;
                color: var(--text-primary);
                border: none;
                width: 24px;
                height: 24px;
                font-size: 18px;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                opacity: 0.7;
            }

            .nav-arrow:active {
                opacity: 1;
                transform: scale(0.9);
            }

            /* Dot Indicators */
            .nav-dots {
                display: flex;
                gap: 6px;
            }

            .nav-dot {
                width: 8px;
                height: 8px;
                border-radius: 50%;
                background: rgba(255, 255, 255, 0.2);
                transition: all 0.3s;
            }

            .nav-dot.active {
                background: var(--accent-blue);
                transform: scale(1.2);
            }

            /* Ensure Views have padding so content isn't covered by pill */
            /* For timeline we remove bottom padding so the grid can stretch to the bottom */
            #view-timeline {
                padding-bottom: 0;
            }

            #view-list {
                padding-bottom: 50px;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }

            #view-list.active {
                overflow-y: auto !important;
                -webkit-overflow-scrolling: touch;
            }

            #view-stats {
                padding-bottom: 50px;
                overflow-y: auto;
            }
        }

        /* --- MOBILE LIST: EDGE-TO-EDGE (No Gaps) --- */
        @media (max-width: 768px) {

            /* Kill ALL padding on the list tab and its container */
            #tab-list {
                padding: 0 !important;
                margin: 0 !important;
                width: 100vw !important;
                max-width: 100vw !important;
                margin-left: calc(-50vw + 50%) !important;
                box-sizing: border-box !important;
            }

            #tab-list>.timeline-container,
            #tab-list .timeline-container {
                padding: 0 !important;
                margin: 0 !important;
                border: none !important;
                border-radius: 0 !important;
                box-shadow: none !important;
                background: transparent !important;
                backdrop-filter: none !important;
                width: 100% !important;
                max-width: 100% !important;
                overflow: visible !important;
            }

            /* Table: full width, no gaps */
            #tab-list table {
                width: 100% !important;
                margin: 0 !important;
                padding: 0 !important;
                border-collapse: collapse !important;
                table-layout: auto !important;
            }

            /* CRITICAL FIX: Remove the 80px max-width cap on ALL columns */
            #tab-list td,
            #tab-list th {
                max-width: none !important;
                overflow: visible !important;
            }

            /* Column width distribution: Guest Name gets the most space */
            #tab-list td:nth-child(2) {
                /* Guest Name */
                width: 40% !important;
            }

            /* Rows: taller with vertical centering */
            #tab-list tbody tr td {
                padding-top: 10px !important;
                padding-bottom: 10px !important;
                vertical-align: middle !important;
            }

            /* Last column (Profit): flush right edge */
            #tab-list td:last-child,
            #tab-list th:last-child {
                padding-right: 4px !important;
                text-align: right !important;
                white-space: nowrap !important;
            }

            /* First column: flush left edge */
            #tab-list td:first-child,
            #tab-list th:first-child {
                padding-left: 4px !important;
            }
        }

        /* --- Client-side auth gate --- */
        html.auth-locked #appRoot {
            display: none !important;
        }

        html:not(.auth-locked) #authGate {
            display: none !important;
        }

        html.auth-locked body {
            padding: 0 !important;
        }

        #authGate {
            position: fixed;
            inset: 0;
            z-index: 9999;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.22), transparent 52%),
                radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.18), transparent 50%),
                #020617;
        }

        #loginCard {
            width: 100%;
            max-width: 420px;
            background: rgba(15, 23, 42, 0.78);
            border: 1px solid rgba(148, 163, 184, 0.4);
            border-radius: 16px;
            box-shadow: 0 24px 48px rgba(2, 6, 23, 0.55);
            padding: 24px;
        }

        #loginCard h2 {
            margin: 0 0 8px 0;
            color: #f8fafc;
        }

        #loginCard p {
            margin: 0 0 14px 0;
            color: #cbd5e1;
            font-size: 0.95rem;
        }

        #loginCard label {
            display: block;
            margin-bottom: 6px;
            color: #cbd5e1;
            font-size: 0.85rem;
            font-weight: 600;
        }

        #loginPasswordInput {
            width: 100%;
            border: 1px solid rgba(100, 116, 139, 0.7);
            border-radius: 10px;
            background: rgba(15, 23, 42, 0.75);
            color: #f8fafc;
            padding: 10px 12px;
            font-size: 1rem;
            outline: none;
        }

        #loginPasswordInput:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
        }

        #loginSubmitBtn {
            margin-top: 14px;
            width: 100%;
            border: none;
            border-radius: 10px;
            padding: 11px 14px;
            cursor: pointer;
            background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
            color: #ffffff;
            font-weight: 700;
            font-size: 0.95rem;
        }

        #loginErrorMsg {
            min-height: 20px;
            margin-top: 10px;
            color: #fda4af;
            font-size: 0.85rem;
        }

/* --- Style Block 3 --- */
        #startupLoader {
            position: fixed;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(6, 10, 18, 0.55);
            z-index: 120000;
            transition: opacity 0.2s ease;
        }

        #startupLoader.is-hidden {
            opacity: 0;
            pointer-events: none;
        }

        #startupLoaderCard {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            border-radius: 10px;
            background: rgba(17, 24, 39, 0.9);
            border: 1px solid rgba(255, 255, 255, 0.18);
            color: #f3f4f6;
            font-size: 0.92rem;
            letter-spacing: 0.01em;
        }

        #startupLoaderSpinner {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-top-color: #ffffff;
            animation: startupSpin 0.7s linear infinite;
        }

        @keyframes startupSpin {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }

/* --- Style Block 4 --- */

        /* Mobile only: flex layout for carousel */
        @media (max-width: 768px) {
            #dashboardApp {
                flex-grow: 1 !important;
                overflow: hidden !important;
                display: flex !important;
                flex-direction: column !important;
                min-height: 0 !important;
            }
        }

/* --- Style Block 5 --- */

        /* Close button is now visible */

        #editOverlay #editPanelTitle,
        #editPanelTitle {
            display: none !important;
        }

        /* HIDE TOP CLOSE BUTTON AND TITLE IN VIEW BOOKING POPUP */
        #modalOverlay .modal-close,
        .modal-close {
            display: none !important;
        }

        #modalOverlay #modalTitle,
        #modalTitle {
            display: none !important;
        }

        /* Room stats popup uses shared modal header with visible title + close. */
        #modalOverlay.modal-room-stats .modal-header {
            display: flex !important;
        }

        #modalOverlay.modal-room-stats .modal-close {
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
        }

        #modalOverlay.modal-room-stats #modalTitle {
            display: inline !important;
        }

        /* REMOVE TOP GAP IN POPUPS */
        #editOverlay .edit-modal-box,
        #modalOverlay>div {
            padding-top: 35px !important;
            /* Increased for noticeable gap */
        }

        #modalContent {
            margin-top: 0 !important;
            padding-top: 10px !important;
            /* Slight internal padding for content? No, user wants close to top. */
        }

        /* Be careful: if padding-top is 0, we might need some padding for the content itself if it borders the edge. 
   But #modalOverlay > div creates the box. Content is inside. 
   If I set padding-top: 0 on box, content touches top.
   Let's set padding-top: 0 on box, and padding-top: 5px on #modalContent to give a tiny breathing room? 
   User said "start straight from guest name". 
   Let's try 0 on box and 5px on content. */
        #modalContent {
            margin-top: 0 !important;
            padding-top: 10px !important;
        }

        /* Wait, #modalContent is the inner div. */
        #editOverlay .edit-modal-box {
            padding-top: 20px;
            /* Default for sides? */
        }

        /* Let's try explicit overrides */
        #editOverlay .edit-modal-box,
        #modalOverlay>div {
            padding-top: 0 !important;
        }

        #modalContent {
            margin-top: 15px !important;
            /* Move content down slightly so it doesn't touch border? No, user wants NO GAP. */
            /* If I put margin-top: 15px, that IS a gap. */
            /* The user wants "start straight from guest name to be as close to the top as possible". */
            /* So I should use 0 or very small. */
            margin-top: 5px !important;
            padding-top: 0 !important;
        }

        #modalContent label:first-child {
            margin-top: 0 !important;
        }

        /* --- FORCE FULL HEIGHT & NO BOTTOM GAP (User Request) --- */
        html,
        body {
            height: 100vh;
            margin: 0;
            padding: 0 !important;
            /* Remove body padding */
            overflow: hidden;
            /* Prevent double scrollbars */
            display: flex;
            flex-direction: column;
        }

        #mainHeader {
            flex: 0 0 auto;
            padding: 1rem 2rem;
        }

        /* Ensure intermediate containers grow */
        .tab-content {
            flex: 1 1 auto;
            /* Do NOT force display here so inactive tabs stay hidden */
        }

        .tab-content.active {
            display: flex !important;
            /* Active tab becomes flex container */
            flex-direction: column;
            overflow: hidden;
        }

        /* Stats and Tabs naturally take their space (flex: 0) */
        .stats-grid,
        .tabs {
            flex: 0 0 auto;
        }

        /* If stats are hidden or not present, they take 0 space. */

        .timeline-container {
            flex: 1 1 auto;
            /* Grow to fill execution space */
            margin: 0 2rem 0 2rem !important;
            /* Keep side margins, NO bottom margin */
            padding: 1.5rem 1.5rem 0 1.5rem !important;
            /* NO bottom padding */
            border-bottom: none !important;
            border-bottom-left-radius: 0 !important;
            border-bottom-right-radius: 0 !important;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        /* Allow scrolling in Booking List + FULL WIDTH (Zero Gap) */
        #tab-list .timeline-container {
            overflow-y: auto !important;
            display: block !important;
            /* Allow normal flow for table */
            margin: 0 !important;
            padding: 0 !important;
            width: 100% !important;
            border-radius: 0 !important;
        }

        #gantt {
            flex: 1 1 auto;
            overflow: auto;
            overscroll-behavior: none;
            overscroll-behavior-x: none;
            overscroll-behavior-y: none;
            touch-action: pan-x pan-y;
            /* Scroll inside grid */
            min-height: 0;
            /* Allow shrinking */
            align-content: stretch;
            /* Stretch rows to fill container */
            grid-auto-rows: minmax(min-content, 1fr);
            /* Distribute space equally among rows */
        }

        /* DESKTOP: Allow normal scrolling (override the 100vh lock above) */
        @media (min-width: 769px) {
            :root {
                --desktop-control-height: 38px;
                --desktop-timeline-header-h: 18px;
                --desktop-bottom-tabs-h: 46px;
                --desktop-bottom-months-h: 46px;
                --desktop-bottom-reserve: calc(var(--desktop-bottom-tabs-h) + var(--desktop-bottom-months-h) + 10px);
            }

            html,
            body {
                height: auto !important;
                overflow-y: auto !important;
                overflow-x: hidden !important;
            }

            /* Keep header and tabs always at top */
            #dashboardTitle {
                display: none !important;
            }

            /* Compact desktop date header row to free vertical room. */
            #gantt.gantt-grid {
                grid-template-rows: var(--timeline-header-h, var(--desktop-timeline-header-h)) !important;
                grid-auto-rows: minmax(var(--timeline-row-h, 56px), 1fr) !important;
                align-content: stretch !important;
            }

            #gantt .gantt-cell.gantt-header {
                padding: 0 0.15rem !important;
                min-height: var(--timeline-header-h, var(--desktop-timeline-header-h)) !important;
                height: var(--timeline-header-h, var(--desktop-timeline-header-h)) !important;
                line-height: var(--timeline-header-h, var(--desktop-timeline-header-h)) !important;
                font-size: 0.68rem !important;
            }

            .tabs {
                position: fixed !important;
                left: 0 !important;
                right: 0 !important;
                bottom: 0 !important;
                z-index: 1050 !important;
                display: flex !important;
                justify-content: center !important;
                gap: 0.25rem !important;
                margin: 0 !important;
                padding: 0.25rem 0.35rem !important;
                background: var(--bg-dark) !important;
                border-top: 1px solid var(--border) !important;
            }

            .tabs .tab-btn {
                height: var(--desktop-control-height) !important;
                min-height: var(--desktop-control-height) !important;
                padding: 0 1rem !important;
                display: inline-flex !important;
                align-items: center !important;
                justify-content: center !important;
                line-height: 1 !important;
            }

            #mainHeader {
                position: fixed !important;
                left: 0 !important;
                right: 0 !important;
                bottom: var(--desktop-bottom-tabs-h) !important;
                z-index: 1049 !important;
                background: var(--bg-dark) !important;
                border-top: 1px solid var(--border) !important;
                justify-content: center !important;
                margin: 0 !important;
                padding: 0.25rem 0.35rem !important;
                gap: 0.25rem !important;
            }

            #mainHeader .month-btn,
            #mainHeader #btnDates {
                height: var(--desktop-control-height) !important;
                min-height: var(--desktop-control-height) !important;
                padding: 0 1rem !important;
                display: inline-flex !important;
                align-items: center !important;
                justify-content: center !important;
                line-height: 1 !important;
            }

            #mainHeader > div {
                width: 100% !important;
                display: flex !important;
                justify-content: center !important;
            }

            #tab-timeline {
                /* Timeline height is already explicitly fitted in JS; extra reserve here creates a visible dead gap. */
                padding-bottom: 0 !important;
                box-sizing: border-box !important;
            }

            #tab-list,
            #tab-dashboard {
                padding-bottom: var(--desktop-bottom-reserve) !important;
                box-sizing: border-box !important;
            }

            /* Near edge-to-edge desktop layout with minimal gaps. */
            .timeline-container {
                margin-top: 0 !important;
                margin-left: 0.25rem !important;
                margin-right: 0.25rem !important;
                padding: 0.22rem 0.22rem 0 0.22rem !important;
                border-radius: 0.55rem !important;
            }

            #tab-list .timeline-container,
            #tab-dashboard .stats-grid {
                margin-left: 0.25rem !important;
                margin-right: 0.25rem !important;
            }

            /* Hide the desktop view nav bar and timeline header (redundant) */
            #desktopViewNav,
            .timeline-header {
                display: none !important;
            }
        }

        /* Mobile: hide Dates button (timeline header handles date selection) */
        @media (max-width: 768px) {
            body {
                --mobile-bottom-reserve: 96px;
            }

            body.months-bar-hidden {
                --mobile-bottom-reserve: 48px;
            }

            #btnDates {
                display: none !important;
            }

            /* Fix months bar and timeline header to bottom */
            #mainHeader {
                position: fixed !important;
                bottom: 48px !important;
                left: 0 !important;
                right: 0 !important;
                z-index: 1000 !important;
                background: var(--bg-dark) !important;
                padding: 0.4rem 0.5rem !important;
                border-top: 1px solid var(--border) !important;
                margin: 0 !important;
            }

            .timeline-header {
                position: fixed !important;
                bottom: 0 !important;
                left: 0 !important;
                right: 0 !important;
                z-index: 1001 !important;
                background: var(--bg-dark) !important;
                padding: 0.4rem 0.5rem !important;
                border-top: 1px solid var(--border) !important;
                margin: 0 !important;
            }

            body.months-bar-hidden #mainHeader {
                display: none !important;
            }

            /* Fill screen edge-to-edge, no padding */
            body {
                padding: 0 !important;
                margin: 0 !important;
            }

            #dashboardTitle {
                display: none !important;
            }

            /* Position FAB above the fixed months bar */
            .fab-container {
                bottom: 105px !important;
            }

            /* Keep edit popup full-width and prevent iOS focus zoom/pan on inputs. */
            #editOverlay .edit-modal-box {
                width: 100vw !important;
                min-width: 100vw !important;
                max-width: 100vw !important;
                box-sizing: border-box !important;
                overflow-x: hidden !important;
            }

            #editOverlay .edit-top-row,
            #editOverlay .edit-date-row,
            #editOverlay .edit-finance-row,
            #editOverlay .edit-contact-row {
                grid-template-columns: 1fr !important;
                gap: 10px !important;
            }

            #editOverlay input,
            #editOverlay select,
            #editOverlay textarea,
            #editOverlay .edit-form-group input,
            #editOverlay .edit-form-group select,
            #modalOverlay input,
            #modalOverlay select,
            #modalOverlay textarea {
                font-size: 16px !important;
            }
        }
