/* ============================================================
   Hotelman Web — Modern Theme
   ============================================================ */

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    color: #222;
    background: #f5f6f8;
}

/* ============================================================
   Layout: Sidebar + Content
   ============================================================ */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 120px;
    min-width: 120px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 8px 12px;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    box-sizing: border-box;
}

.sidebar-title {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    font-size: 12px;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.15s;
    flex-shrink: 0;
}
.sidebar-toggle:hover { color: #555; }

/* Collapsed sidebar */
.sidebar.collapsed {
    width: 44px;
    min-width: 44px;
}
.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 8px 0;
}
.sidebar.collapsed .sidebar-title { display: none; }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-nav a {
    justify-content: center;
    padding: 8px 0;
    border-left: 3px solid transparent;
}
.sidebar.collapsed .nav-text { display: none; }
.sidebar.collapsed .sidebar-nav a .icon { margin: 0; }
.sidebar.collapsed .sidebar-footer { display: none; }
.sidebar.collapsed .sidebar-separator { margin: 4px 6px; }

/* Instant collapse on page load (no flash) */
html.sidebar-is-collapsed .sidebar {
    width: 44px;
    min-width: 44px;
}
html.sidebar-is-collapsed .sidebar .sidebar-title { display: none; }
html.sidebar-is-collapsed .sidebar .sidebar-header { justify-content: center; padding: 8px 0; }
html.sidebar-is-collapsed .sidebar .sidebar-toggle { transform: rotate(180deg); }
html.sidebar-is-collapsed .sidebar .nav-text { display: none; }
html.sidebar-is-collapsed .sidebar .sidebar-nav a { justify-content: center; padding: 8px 0; }
html.sidebar-is-collapsed .sidebar .sidebar-footer { display: none; }
html.sidebar-is-collapsed .sidebar .sidebar-separator { margin: 4px 6px; }

/* Transition after load */
.sidebar.animated { transition: width 0.2s, min-width 0.2s; }

.sidebar-nav {
    list-style: none;
    padding: 6px 0;
    flex: 1;
}

.sidebar-nav li {}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #555;
    text-decoration: none;
    font-size: 12px;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
    background: #f5f5f5;
    color: #222;
}

.sidebar-nav a.active {
    background: #f0f4f8;
    border-left-color: #0066CC;
    color: #0066CC;
    font-weight: 600;
}

.sidebar-nav a .icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.sidebar-badge {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
    background: linear-gradient(135deg, #29b6f6, #039BE5);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(142, 36, 170, .35);
    letter-spacing: .3px;
}

.sidebar-separator {
    height: 1px;
    background: #e8e8e8;
    margin: 4px 10px;
}

.sidebar-footer {
    padding: 8px 14px;
    border-top: 1px solid #e0e0e0;
    font-size: 11px;
    color: #888;
}

.sidebar-footer a {
    color: #0066CC;
    text-decoration: none;
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    background: #fff;
    color: #333;
    padding: 7px 16px 8px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    box-sizing: border-box;
    border-bottom: 1px solid #e0e0e0;
}

.content-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.content-header .header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.content-body {
    flex: 1;
    overflow: auto;
    padding: 12px;
}

/* Booking form — compact header, buttons aligned with form */
.page-booking-form .content-header {
    min-height: 25px;
    padding-top: 1px;
    padding-bottom: 2px;
}
.page-booking-form .content-header-inner {
    max-width: 986px;
}

/* Booking form — 10% larger scale (sidebar excluded) */
.page-booking-form .content-body,
.page-booking-form .modal-overlay {
    zoom: 1.1;
}

/* ============================================================
   Buttons — Windows Classic Style
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    font-size: 12px;
    font-family: inherit;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
    min-height: 26px;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

a.btn {
    text-decoration: none;
}
.delete-invoice.btn-sm {
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.btn:active {
    background: #eee;
    border-color: #999;
}

.btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-primary {
    background: #0066CC;
    color: #fff;
    border-color: #0066CC;
}

.btn-primary:hover {
    background: #005bb5;
    border-color: #005bb5;
}

@keyframes pulse-save {
    0%, 100% { box-shadow: 0 0 0 2px rgba(0,102,204,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(0,102,204,0.5); }
}

.btn-danger {
    background: #fff;
    color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #fff5f5;
}

.btn-sm {
    padding: 2px 8px;
    font-size: 11px;
    min-height: 20px;
}

.btn-header {
    background: #fff;
    color: #555;
    border-color: #ccc;
    font-size: 11px;
}

.btn-header:hover {
    background: #e9ecef;
    color: #333;
}

/* ============================================================
   Forms
   ============================================================ */
.form-group {
    margin-bottom: 6px;
}

.form-group label {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    color: #444;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    color: #222;
    min-height: 26px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: #0066CC;
    box-shadow: 0 0 0 2px rgba(0,102,204,0.15);
}

select.form-control {
    padding: 2px 4px;
}

textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

.form-row {
    display: flex;
    gap: 8px;
}

.form-row .form-group {
    flex: 1;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================
   Section Panels
   ============================================================ */
.panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.panel-header {
    background: #f8f9fa;
    color: #333;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 6px 6px 0 0;
}

/* Яркие шапки блоков на странице редактирования/создания брони */
/* ===== Дизайн «Небо» (стекло, мягкий голубой) — страница брони ===== */
.page-booking-form .content-body {
    background: linear-gradient(135deg, #e9eff5, #d8e6f1);
}
.page-booking-form .panel {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(30, 41, 59, 0.07);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
}
/* Поднять панель с открытым меню «Действия» над соседними стеклянными панелями
   (backdrop-filter создаёт контекст наложения, иначе меню перекрывается). */
.page-booking-form .panel:has(.action-menu.open) {
    position: relative;
    z-index: 1000;
}
.page-booking-form .panel-header {
    background: rgba(255, 255, 255, 0.42);
    color: #1f2937;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    border-bottom: 1px solid #4f86bb;
    border-radius: 14px 14px 0 0;
}
.page-booking-form .panel-body input[type="text"],
.page-booking-form .panel-body input[type="number"],
.page-booking-form .panel-body input[type="date"],
.page-booking-form .panel-body input[type="time"],
.page-booking-form .panel-body input[type="email"],
.page-booking-form .panel-body input[type="tel"],
.page-booking-form .panel-body select,
.page-booking-form .panel-body textarea {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(255, 255, 255, 0.8);
}
.page-booking-form #save-booking-top {
    background: #3f72a8;
    border-color: #3f72a8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(63, 114, 168, 0.3);
}

.panel-body {
    padding: 10px 12px;
}

/* ============================================================
   Tables
   ============================================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    background: #f8f9fa;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    color: #666;
}

.data-table td {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 5px 8px;
}

.data-table tr:hover {
    background: #f5f8ff;
}

.data-table tr.selected {
    background: #e8f0fe;
}

.data-table .text-right {
    text-align: right;
}

.data-table .text-center {
    text-align: center;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.data-table th.sortable:hover {
    color: #333;
    background: #eef1f5;
}
.data-table th.sortable .sort-icon {
    font-size: 10px;
    margin-left: 3px;
    color: #bbb;
}
.data-table th.sortable.sorted .sort-icon {
    color: #0066CC;
}

.contact-item {
    cursor: pointer;
    border-radius: 3px;
    padding: 0 2px;
    margin: 0 -2px;
    transition: background 0.15s;
}
.contact-item:hover {
    background: rgba(0,102,204,0.08);
}

/* ============================================================
   Tabs
   ============================================================ */
.tab-bar {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: transparent;
    gap: 2px;
}

.tab-bar .tab {
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #888;
    background: transparent;
    transition: color 0.15s, border-color 0.15s;
}

.tab-bar .tab:hover {
    color: #333;
    background: transparent;
}

.tab-bar .tab.active {
    background: transparent;
    border-bottom-color: #0066CC;
    color: #222;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   Status Badges
   ============================================================ */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    color: #333;
}

.status-badge.not-confirmed { background: #FFA500; }
.status-badge.confirmed     { background: #4CAF50; }
.status-badge.occupied      { background: #2E7D32; }
.status-badge.vacated       { background: #9E9E9E; }
.status-badge.web-pending   { background: #039BE5; }

/* ============================================================
   Flash Messages
   ============================================================ */
.flash {
    padding: 8px 14px;
    margin-bottom: 10px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 12px;
}

.flash-success {
    background: #dff0d8;
    border-color: #3c763d;
    color: #3c763d;
}

.flash-error {
    background: #f2dede;
    border-color: #a94442;
    color: #a94442;
}

.flash-info {
    background: #d9edf7;
    border-color: #31708f;
    color: #31708f;
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #f5f6f8;
}

.login-box {
    width: 340px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.login-box .login-header {
    background: #f8f9fa;
    color: #333;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
}

.login-box .login-body {
    padding: 16px;
}

.login-box .login-body .form-group {
    margin-bottom: 10px;
}

.login-box .login-footer {
    padding: 8px 16px;
    border-top: 1px solid #ccc;
    text-align: right;
}

/* ============================================================
   Toolbar
   ============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: #e0e0e0;
    margin: 0 4px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    gap: 4px;
}

/* ============================================================
   Compact table (services, payments, invoices)
   ============================================================ */
.compact-table {
    font-size: 11px;
}

.compact-table th {
    padding: 4px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.compact-table td {
    padding: 4px 8px;
}

.compact-table tfoot td {
    border-top: 1px solid #e0e0e0;
    border-bottom: none;
    padding-top: 6px;
}

.tbl-action {
    font-size: 10px;
    color: #0066CC;
    text-decoration: none;
    margin-left: 4px;
}

.tbl-action:hover {
    text-decoration: underline;
}

.tbl-action-danger {
    color: #dc3545;
}

/* Table with side buttons (services, payments) */
.table-with-buttons {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.table-with-buttons .table-wrap {
    flex: 1;
    min-width: 0;
}

.table-with-buttons .table-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    padding-top: 2px;
}

.table-with-buttons .table-buttons .btn {
    white-space: nowrap;
    font-size: 11px;
    padding: 3px 10px;
    min-width: 90px;
    text-align: left;
}

.table-total {
    text-align: right;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 6px 2px;
}

/* Selectable rows in services/payments tables */
#services-table tbody tr.selectable { cursor: pointer; }
#services-table tbody tr.selectable:hover { background: #f0f4ff; }
#services-table tbody tr.selectable.row-selected { background: #d0e0ff; }

#payments-table tbody tr.selectable { cursor: pointer; }
#payments-table tbody tr.selectable:hover { background: #f0f4ff; }
#payments-table tbody tr.selectable.row-selected { background: #d0e0ff; }

/* Client actions row */
.client-actions {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 6px;
}

.btn-sm-outline {
    font-size: 11px;
    padding: 2px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}
.btn-sm-outline:hover {
    background: #f5f5f5;
    border-color: #999;
}
.btn-sm-outline.btn-sm-danger {
    color: #dc3545;
    border-color: #dc3545;
}
.btn-sm-outline.btn-sm-danger:hover {
    background: #dc3545;
    color: #fff;
}
.btn-sm-outline.btn-sm-warning {
    color: #e67e22;
    border-color: #e67e22;
}
.btn-sm-outline.btn-sm-warning:hover {
    background: #e67e22;
    color: #fff;
}

.client-card-link {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 11px;
    text-decoration: none;
}
.client-card-link:hover {
    color: #0066CC;
}

/* ============================================================
   Booking info table (panel "Заявка")
   ============================================================ */
.booking-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.booking-info-table td {
    padding: 4px 0;
    vertical-align: top;
}

.booking-info-table .bi-label {
    color: #888;
    font-size: 11px;
    white-space: nowrap;
    width: 55px;
    padding-right: 6px;
}

.booking-info-table a.bi-link {
    color: #0066CC;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-size: 12px;
}

.booking-info-table a.bi-link:hover {
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
}

/* ============================================================
   Two-column layout for booking form
   ============================================================ */
.cols-2 {
    display: flex;
    gap: 8px;
}

.cols-2 > .col {
    flex: 1;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: #888; }
.text-danger { color: #c00; }
.text-success { color: #2E7D32; }
.bold { font-weight: bold; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.p-8 { padding: 8px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* Price display */
.price { font-weight: 600; }
.price-due { color: #c00; font-weight: 600; }
.price-paid { color: #2E7D32; font-weight: 600; }

/* ============================================================
   Modal / Dialog (Windows style)
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    min-width: 300px;
    max-width: 600px;
    overflow: hidden;
}
.modal-dialog.modal-wide {
    width: 800px;
    max-width: 90vw;
}

.modal-header {
    background: #f8f9fa;
    color: #333;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header .close-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    transition: color 0.15s;
}

.modal-header .close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 14px;
    background: #fff;
}

.modal-footer {
    padding: 10px 14px;
    border-top: 1px solid #e8e8e8;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

/* ============================================================
   Autocomplete
   ============================================================ */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 2px;
}

.autocomplete-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: #f0f4f8;
}

/* ============================================================
   Tooltip
   ============================================================ */
.tooltip {
    position: absolute;
    background: #fff;
    border: 1px solid #888;
    padding: 8px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    font-size: 11px;
    z-index: 500;
    min-width: 200px;
    max-width: 360px;
}

.tooltip .tooltip-header {
    font-weight: bold;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.tooltip .tooltip-notes {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #ddd;
    max-height: 150px;
    overflow-y: auto;
}

.tooltip .tooltip-note-text {
    margin-top: 3px;
    white-space: pre-line;
    color: #444;
}

.tooltip .tooltip-comment {
    margin-top: 4px;
    color: #444;
}

.tooltip .tooltip-comment-meta {
    color: #999;
    font-size: 10px;
    display: block;
}

/* ============================================================
   Status badges
   ============================================================ */
.status-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 2px;
    color: #333;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.not-confirmed { background: #FFA500; }
.status-badge.confirmed { background: #4CAF50; }
.status-badge.occupied { background: #2E7D32; }
.status-badge.vacated { background: #9E9E9E; }

/* ============================================================
   Scrollbar styling
   ============================================================ */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #e8e8e8;
}

::-webkit-scrollbar-thumb {
    background: #b0b0b0;
    border: 1px solid #999;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Client note tooltip */
.client-note-tooltip {
    display: none;
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    margin-top: 4px;
    background: #333;
    color: #fff;
    font-size: 11px;
    font-weight: normal;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: pre-line;
    max-width: 280px;
    min-width: 120px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1.4;
}
.client-note-icon:hover .client-note-tooltip {
    display: block;
}

/* ============================================================
   Flatpickr overrides
   ============================================================ */
/* Hide native date/time text until flatpickr replaces them (prevents FOUC) */
input[type="date"],
input[type="time"] {
    color: transparent;
}
.flatpickr-input.form-control[readonly] {
    background: #fff;
    cursor: pointer;
}
/* Time inputs — fixed width for HH:MM */
.time-input,
input.time-input + .flatpickr-input {
    width: 70px;
    flex-shrink: 0;
}
.flatpickr-calendar {
    font-size: 12px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,.1);
    border: none;
    overflow: hidden;
}
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
    display: none;
}
.flatpickr-calendar .flatpickr-months {
    padding: 0;
    background: #f8f9fb;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    height: 39px;
}
.flatpickr-calendar .flatpickr-months .flatpickr-month {
    height: 39px;
    color: #334155;
    display: flex;
    align-items: center;
}
.flatpickr-calendar .flatpickr-current-month {
    font-size: 15px;
    font-weight: 600;
    padding-top: 0;
    color: #1e293b;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    left: 0;
    height: 100%;
    position: relative;
}
.flatpickr-calendar .flatpickr-current-month select.flatpickr-monthDropdown-months {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    appearance: none;
    -webkit-appearance: none;
    background: none;
    padding-right: 0;
    cursor: pointer;
}
.flatpickr-calendar .flatpickr-current-month select.flatpickr-monthDropdown-months:hover {
    color: #4a90c4;
}
.flatpickr-calendar .flatpickr-current-month .cur-year-select {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    border: none;
    background: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding: 0 2px;
}
.flatpickr-calendar .flatpickr-current-month .cur-year-select:hover {
    color: #4a90c4;
}
.flatpickr-calendar.no-year .numInputWrapper {
    display: none;
}
.flatpickr-calendar.no-year .flatpickr-current-month select.flatpickr-monthDropdown-months {
    margin: 0;
    text-align: center;
}
.flatpickr-calendar .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-next-month {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 51px;
    height: 34px;
    padding: 0;
    margin: 0 4px;
    top: 2px !important;
    border-radius: 6px;
    color: #64748b;
    fill: #64748b;
    transition: background .15s, fill .15s;
}
.flatpickr-calendar .flatpickr-prev-month:hover,
.flatpickr-calendar .flatpickr-next-month:hover {
    background: #e8f0fe;
    color: #334155;
}
.flatpickr-calendar .flatpickr-prev-month:hover svg,
.flatpickr-calendar .flatpickr-next-month:hover svg {
    fill: #334155;
}
.flatpickr-calendar .flatpickr-prev-month svg,
.flatpickr-calendar .flatpickr-next-month svg {
    width: 18px;
    height: 18px;
    fill: #334155;
}
.flatpickr-calendar .flatpickr-weekdays {
    height: 24px;
    background: #f0f4f8;
    border-bottom: 1px solid #e2e8f0;
}
.flatpickr-calendar span.flatpickr-weekday {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
}
.flatpickr-calendar .flatpickr-day {
    height: 32px;
    line-height: 32px;
    border-radius: 6px;
    color: #334155;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.flatpickr-calendar .flatpickr-day:hover {
    background: #e8f0fe;
    border-color: transparent;
}
.flatpickr-calendar .flatpickr-day.today {
    border-color: #94b8d4;
}
.flatpickr-calendar .flatpickr-day.today:hover {
    background: #4a90c4;
    color: #fff;
}
.flatpickr-calendar .flatpickr-day.selected {
    background: #4a90c4;
    border-color: #4a90c4;
    border-radius: 6px;
}
.flatpickr-calendar .flatpickr-day.prevMonthDay,
.flatpickr-calendar .flatpickr-day.nextMonthDay {
    color: #cbd5e1;
}
.flatpickr-calendar .flatpickr-innerContainer {
    padding: 4px;
}
.flatpickr-day.selected {
    background: #0066CC;
    border-color: #0066CC;
}
.flatpickr-day.today {
    border-color: #0066CC;
}
.flatpickr-day:hover {
    background: #e0e0e0;
}

/* ============================================================
   Booking Group Tabs (relocation)
   ============================================================ */
.booking-group-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid #0066CC;
    background: #e8e8e8;
    padding: 0 4px;
    padding-top: 4px;
}

.booking-group-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    background: #ddd;
    border: 1px solid #b0b0b0;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 1px;
    cursor: pointer;
    position: relative;
    top: 1px;
}

.booking-group-tab:hover {
    background: #eee;
    color: #0066CC;
}

.booking-group-tab.active {
    background: #fff;
    color: #0066CC;
    border-color: #0066CC;
    border-bottom: 1px solid #fff;
    z-index: 1;
}

.booking-group-tab .tab-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0066CC;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}

.booking-group-tab.active .tab-num {
    background: #0066CC;
}

.booking-group-tab .tab-dates {
    font-weight: 400;
    color: #888;
    font-size: 10px;
}

.booking-group-tab.active .tab-dates {
    color: #666;
}

.booking-group-tab .tab-open-new {
    font-size: 12px;
    color: #888;
    margin-left: 2px;
    cursor: pointer;
}

.booking-group-tab .tab-open-new:hover {
    color: #0066CC;
}

/* ============================================================
   Action Menu (dropdown)
   ============================================================ */
.action-menu-wrapper {
    position: relative;
    display: inline-block;
}

.action-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 100;
    padding: 4px 0;
    margin-top: 4px;
}

.action-menu.open {
    display: block;
}

.action-menu-item {
    display: block;
    width: 100%;
    padding: 5px 14px;
    font-size: 12px;
    color: #222;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.action-menu-item:hover {
    background: #f0f4f8;
}

.action-menu-item.danger {
    color: #c00;
}

.action-menu-item.danger:hover {
    background: #fee;
}

.action-menu-divider {
    height: 1px;
    background: #d0d0d0;
    margin: 3px 8px;
}

/* ============================================================
   Mini Timeline (room occupancy bar)
   ============================================================ */
.mini-timeline-scroll {
    overflow-x: auto;
    border: 1px solid #b0b0b0;
    border-radius: 4px;
    margin: 8px 0;
    scrollbar-width: thin;
}
.mini-timeline-scroll::-webkit-scrollbar { height: 6px; }
.mini-timeline-scroll::-webkit-scrollbar-thumb { background: #bbb; border-radius: 3px; }

.mini-timeline {
    position: relative;
    background: #fafafa;
    user-select: none;
}

.mini-tl-header {
    display: flex;
    height: 18px;
    border-bottom: 1px solid #d0d0d0;
    background: #e8e8e8;
    font-size: 9px;
    color: #666;
}

.mini-tl-header .mini-tl-day {
    text-align: center;
    line-height: 18px;
    border-right: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.mini-tl-header .mini-tl-day.today {
    background: #fff3cd;
    font-weight: 600;
    color: #333;
}

.mini-tl-header .mini-tl-day.month-start {
    border-left: 1px solid #999;
}

.mini-tl-track {
    position: relative;
    height: 22px;
}

.mini-tl-bar {
    position: absolute;
    top: 3px;
    height: 16px;
    border-radius: 2px;
    font-size: 9px;
    color: #fff;
    line-height: 16px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    cursor: default;
    min-width: 2px;
}

.mini-tl-bar.current {
    background: #0066CC;
    z-index: 2;
}

.mini-tl-bar.other {
    background: #999;
    opacity: 0.7;
    z-index: 1;
}

.mini-tl-bar.conflict {
    background: #e53935;
    z-index: 3;
    animation: conflict-blink 0.8s ease-in-out infinite;
}

@keyframes conflict-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Change dates modal specifics */
.date-arrows {
    display: flex;
    gap: 12px;
    margin: 8px 0;
    justify-content: center;
}

.date-arrows .arrow-group {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
}

.date-arrows .arrow-group label {
    font-size: 11px;
    margin: 0 4px;
    font-weight: 600;
    color: #444;
    min-width: auto;
}

/* Search date shift arrows in toolbar */
.search-date-arrows {
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-arrow-group {
    display: flex;
    align-items: center;
    gap: 2px;
}
.search-arrow-label {
    font-size: 10px;
    color: #666;
    margin-right: 2px;
    user-select: none;
}
.search-arrow-group .arrow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 20px;
    background: #f0f0f0;
    border: 1px solid #999;
    cursor: pointer;
    font-size: 10px;
    color: #333;
    padding: 0;
    border-radius: 2px;
}
.search-arrow-group .arrow-btn:hover {
    background: #ddd;
}

.date-arrows .arrow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 22px;
    background: #f0f0f0;
    border: 1px solid #999;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    padding: 0;
}

.date-arrows .arrow-btn:hover {
    background: #ddd;
}

.price-choice {
    margin: 10px 0;
    padding: 8px;
    background: #f8f8f8;
    border: 1px solid #d0d0d0;
}

.price-choice label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 4px;
    font-weight: normal !important;
    color: #222 !important;
}

.price-choice label:last-child {
    margin-bottom: 0;
}

/* ============================================================
   Hour Timeline (check-in/check-out modal)
   ============================================================ */
.hour-timeline-scroll {
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid #b0b0b0;
    border-radius: 4px;
}
.hour-timeline {
    position: relative;
    background: #fafafa;
    user-select: none;
}
.hour-timeline-wide {
    min-width: 950px;
}

/* Полоса с датами суток над часами */
.hour-tl-dateband {
    display: flex;
    height: 18px;
    border-bottom: 1px solid #d0d0d0;
    background: #dfe7f0;
    font-size: 11px;
    font-weight: 700;
    color: #2c3e50;
}
.hour-tl-dateband .hour-tl-dcell {
    text-align: center;
    line-height: 18px;
    border-right: 1px solid #c5d0dd;
}
.hour-tl-dateband .hour-tl-dcell.hour-tl-daybreak {
    border-left: 2px solid #9aa0a6;
}

.hour-tl-header {
    display: flex;
    height: 20px;
    border-bottom: 1px solid #d0d0d0;
    background: #e8e8e8;
    font-size: 9px;
    color: #666;
}

.hour-tl-header .hour-tl-cell {
    flex: 1;
    text-align: center;
    line-height: 20px;
    border-right: 1px solid #e0e0e0;
    min-width: 24px;
}

.hour-tl-header .hour-tl-cell.hour-now {
    background: #fff3cd;
    font-weight: 600;
    color: #333;
}

/* Разделитель суток на двухдневной шкале (на 24:00 → 00:00) */
.hour-tl-header .hour-tl-cell.hour-tl-daybreak {
    border-left: 2px solid #9aa0a6;
}

.hour-tl-track {
    position: relative;
    height: 36px;
}

.hour-tl-bar {
    position: absolute;
    top: 4px;
    height: 28px;
    border-radius: 2px;
    font-size: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    z-index: 1;
}

.hour-tl-bar.prev-booking {
    background: #999;
}

.hour-tl-bar.next-booking {
    background: #999;
}

.hour-tl-bar.current-booking {
    background: #0066CC;
}

.hour-tl-bar.free-zone {
    background: #e8f5e9;
    border: 1px dashed #4CAF50;
    color: #2E7D32;
    cursor: pointer;
    z-index: 2;
}

.hour-tl-bar.free-zone:hover {
    background: #c8e6c9;
}

.hour-tl-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #c00;
    z-index: 5;
}

.hour-tl-marker::after {
    content: attr(data-label);
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #c00;
    font-weight: 600;
    white-space: nowrap;
}

.hour-tl-clickable {
    position: absolute;
    top: 0;
    bottom: 0;
    cursor: pointer;
    z-index: 3;
}

.hour-tl-clickable:hover {
    background: rgba(76, 175, 80, 0.15);
}
.hour-tl-std {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #4CAF50;
    z-index: 4;
    opacity: 0.5;
    border-left: 1px dashed #4CAF50;
}
.hour-tl-std::after {
    content: attr(data-label);
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: #4CAF50;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================================
   Notification Toast (web booking alerts)
   ============================================================ */
.notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 280px;
    max-width: 360px;
    background: linear-gradient(135deg, #29b6f6, #0277BD);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(2, 119, 189, 0.4);
    padding: 14px 40px 14px 16px;
    cursor: pointer;
    z-index: 9999;
    transform: translateX(calc(100% + 30px));
    animation: toast-slide-in 0.35s ease-out forwards;
    transition: opacity 0.3s, transform 0.3s;
}

.notification-toast.toast-dismiss {
    animation: toast-slide-out 0.35s ease-in forwards;
}

.notification-toast .toast-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notification-toast .toast-body {
    font-size: 12px;
    opacity: 0.92;
}

.notification-toast .toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
}

.notification-toast .toast-close:hover {
    color: #fff;
}

@keyframes toast-slide-in {
    from { transform: translateX(calc(100% + 30px)); }
    to   { transform: translateX(0); }
}

@keyframes toast-slide-out {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(calc(100% + 30px)); opacity: 0; }
}

/* ============================================================
   Context Menu (chess grid right-click)
   ============================================================ */
.ctx-menu {
    position: fixed;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    min-width: 200px;
    padding: 4px 0;
}
.ctx-menu-item {
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}
.ctx-menu-item:hover {
    background: #f0f0f0;
}
.ctx-menu-item.disabled {
    color: #999;
    cursor: default;
}
.ctx-menu-item.disabled:hover {
    background: transparent;
}
.ctx-menu-hint {
    padding: 2px 12px 4px;
    font-size: 10px;
    color: #999;
}
.ctx-menu-item.has-submenu {
    position: relative;
    padding-right: 24px;
}
.ctx-menu-item.has-submenu::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 8px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}
.ctx-submenu {
    display: none;
    position: absolute;
    top: -4px;
    left: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    min-width: 140px;
    padding: 4px 0;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
}
.ctx-menu-item.has-submenu:hover > .ctx-submenu {
    display: block;
}
.ctx-submenu-item {
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.ctx-submenu-item:hover {
    background: #f0f0f0;
}
.ctx-submenu-item.disabled {
    color: #ccc;
    cursor: default;
}
.ctx-submenu-item.disabled:hover {
    background: transparent;
}

/* Enable-notifications banner */
.notification-enable-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #0277BD, #29b6f6);
    color: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: banner-slide-down 0.3s ease-out;
}

.notification-enable-banner .banner-btn {
    padding: 4px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 600;
}

.notification-enable-banner .banner-yes {
    background: #fff;
    color: #7b1fa2;
}

.notification-enable-banner .banner-yes:hover {
    background: #f3e5f5;
}

.notification-enable-banner .banner-no {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.4);
}

.notification-enable-banner .banner-no:hover {
    color: #fff;
    border-color: #fff;
}

@keyframes banner-slide-down {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

/* ============================================================
   Mobile Responsive (<768px)
   Desktop is NOT affected — everything below is inside @media
   ============================================================ */

/* Mobile hamburger button (hidden on desktop) */
.mobile-menu-btn,
.sidebar-close-mobile {
    display: none;
}

@media (max-width: 768px) {

    /* ---- Mobile top bar with hamburger ---- */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 44px;
        height: 40px;
        background: #fff;
        border: none;
        border-right: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
        z-index: 1001;
        cursor: pointer;
        font-size: 18px;
        color: #555;
    }
    .mobile-menu-btn:active {
        background: #f0f0f0;
    }

    /* ---- Sidebar as overlay drawer ---- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 200px !important;
        min-width: 200px !important;
        z-index: 1002;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    /* Override collapsed state on mobile — always show full sidebar when open */
    .sidebar.collapsed,
    html.sidebar-is-collapsed .sidebar {
        width: 200px !important;
        min-width: 200px !important;
    }
    .sidebar.collapsed .sidebar-title,
    html.sidebar-is-collapsed .sidebar .sidebar-title,
    .sidebar.collapsed .nav-text,
    html.sidebar-is-collapsed .sidebar .nav-text,
    .sidebar.collapsed .sidebar-footer,
    html.sidebar-is-collapsed .sidebar .sidebar-footer {
        display: block !important;
    }
    .sidebar.collapsed .sidebar-header,
    html.sidebar-is-collapsed .sidebar .sidebar-header {
        justify-content: space-between !important;
        padding: 8px 12px !important;
    }
    .sidebar.collapsed .sidebar-nav a,
    html.sidebar-is-collapsed .sidebar .sidebar-nav a {
        justify-content: flex-start !important;
        padding: 10px 14px !important;
    }
    .sidebar.collapsed .sidebar-toggle,
    html.sidebar-is-collapsed .sidebar .sidebar-toggle {
        transform: none !important;
    }

    /* Sidebar overlay backdrop */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.3);
        z-index: 1001;
    }
    .sidebar-backdrop.active {
        display: block;
    }

    /* Sidebar nav — bigger touch targets */
    .sidebar-nav a {
        padding: 12px 14px !important;
        font-size: 14px;
    }
    .sidebar-nav a .icon {
        font-size: 16px;
    }
    .sidebar-footer {
        font-size: 12px;
        padding: 10px 14px;
    }

    /* Hide desktop sidebar toggle, show close button on mobile */
    .sidebar-toggle {
        display: none;
    }
    .sidebar-close-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        color: #999;
        font-size: 18px;
        padding: 2px 4px;
    }
    .sidebar-close-mobile:active {
        color: #333;
    }

    /* ---- Content area takes full width ---- */
    .app-layout {
        flex-direction: column;
    }
    .content-area {
        width: 100%;
        height: 100vh;
    }

    /* Content header — leave room for hamburger */
    .content-header {
        padding-left: 52px;
        font-size: 13px;
        min-height: 44px;
    }
    .content-header .header-actions {
        flex-wrap: wrap;
        gap: 4px;
    }

    /* Content body padding */
    .content-body {
        padding: 8px;
    }

    /* ---- Booking form zoom off on mobile ---- */
    .page-booking-form .content-body,
    .page-booking-form .modal-overlay {
        zoom: 1 !important;
    }

    /* ---- Two-column layout → stack ---- */
    .cols-2 {
        flex-direction: column;
    }

    /* ---- Form rows → stack ---- */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* ---- Bigger form controls for touch ---- */
    .form-control {
        min-height: 36px;
        font-size: 16px;
        padding: 6px 10px;
    }
    select.form-control {
        padding: 4px 6px;
        min-height: 36px;
        font-size: 16px;
    }
    textarea.form-control {
        font-size: 16px !important;
    }
    .btn {
        min-height: 36px;
        font-size: 13px;
        padding: 6px 14px;
    }
    .btn-sm {
        min-height: 30px;
        font-size: 12px;
        padding: 4px 10px;
    }

    /* ---- Panels ---- */
    .panel-body {
        padding: 8px 10px;
    }

    /* ---- Tables: horizontal scroll wrapper ---- */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-with-buttons .data-table,
    .panel-body > .data-table {
        display: table;
        width: 100%;
    }
    .table-with-buttons .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table thead,
    .data-table tbody,
    .data-table tr,
    .data-table th,
    .data-table td {
        /* keep table layout inside the scrollable container */
    }

    /* ---- Booking filters: full width fields ---- */
    .bk-filters-row {
        flex-direction: column;
    }
    .bk-filters-row .filter-field {
        width: 100% !important;
    }
    .bk-filters-row .filter-field input,
    .bk-filters-row .filter-field select {
        width: 100% !important;
    }
    .bk-filters-actions {
        flex-wrap: wrap;
    }

    /* Search suggest dropdown */
    .search-suggest {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }

    /* ---- Toolbar ---- */
    .toolbar {
        flex-wrap: wrap;
    }
    .toolbar-separator {
        display: none;
    }

    /* ---- Modals: full-width on mobile ---- */
    .modal-dialog {
        min-width: auto !important;
        max-width: calc(100vw - 20px) !important;
        width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    .modal-dialog.modal-wide {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
    }
    /* Disable drag on mobile */
    .modal-header {
        cursor: default !important;
    }

    /* ---- Table with side buttons → keep column layout ---- */
    .table-with-buttons {
        flex-direction: row;
    }

    /* ---- Booking group tabs: scrollable ---- */
    .booking-group-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    .booking-group-tab {
        flex-shrink: 0;
    }

    /* ---- Tab bar: scrollable ---- */
    .tab-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tab-bar .tab {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* ---- Date arrows ---- */
    .date-arrows {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* ---- Notification toast: full width ---- */
    .notification-toast {
        left: 10px;
        right: 10px;
        bottom: 10px;
        min-width: auto;
        max-width: none;
    }

    /* ---- Login page ---- */
    .login-box {
        width: calc(100vw - 32px);
        max-width: 340px;
    }

    /* ---- Notification enable banner ---- */
    .notification-enable-banner {
        flex-wrap: wrap;
        font-size: 12px;
        gap: 8px;
        padding: 8px 12px;
    }

    /* ---- Search date arrows ---- */
    .search-date-arrows {
        flex-wrap: wrap;
    }

    /* ---- Client actions ---- */
    .client-actions {
        flex-wrap: wrap;
    }

    /* ---- Invoice delete button — square ---- */
    .delete-invoice.btn-sm {
        width: 28px !important;
        height: 28px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        vertical-align: middle;
        position: relative;
        top: -1px;
    }

    /* ---- Action menu ---- */
    .action-menu {
        min-width: 180px;
    }

    /* ---- Booking table wrap: allow scroll ---- */
    .bk-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* ---- Compact table scroll (not inside table-with-buttons) ---- */
    .compact-table {
        width: 100%;
    }

    /* ---- Booking info table ---- */
    .booking-info-table .bi-label {
        width: auto;
    }

    /* ---- Context menu ---- */
    .ctx-menu {
        max-width: calc(100vw - 20px);
    }
    .ctx-submenu {
        left: auto;
        right: 100%;
    }

    /* ---- Flatpickr ---- */
    .flatpickr-calendar {
        max-width: calc(100vw - 20px);
    }

    /* ---- Scrollbar — thinner on mobile ---- */
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    /* ---- Toast container ---- */
    #toast-container {
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
    }

    /* ---- Autocomplete ---- */
    .autocomplete-list {
        max-height: 180px;
    }

    /* ---- Price choice ---- */
    .price-choice label {
        font-size: 13px;
    }

    /* ---- Calendar: hide status legend ---- */
    .legend-item {
        display: none !important;
    }

    /* ---- Mini timeline scroll ---- */
    .mini-timeline-scroll,
    .hour-timeline-scroll {
        margin-left: -8px;
        margin-right: -8px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* ============================================================
       Booking form — single column on mobile
       ============================================================ */

    /* Two-column master layout → stack */
    .page-booking-form #col-left,
    .page-booking-form form > div[style*="align-items:flex-start"] > div {
        flex: none !important;
        width: 100% !important;
    }
    /* The parent flex container (two-column layout with align-items:flex-start) */
    .page-booking-form form > div[style*="align-items:flex-start"][style*="max-width:900px"] {
        flex-direction: column !important;
        max-width: 100% !important;
    }


    /* WEB_PENDING banner */
    .page-booking-form form > div[style*="max-width:900px"][style*="background:#F3E5F5"] {
        max-width: 100% !important;
    }

    /* Booking info table: 4-cell rows → 2 rows of 2 on mobile */
    .booking-info-table tr {
        display: flex;
        flex-wrap: wrap;
    }
    .booking-info-table td {
        display: block;
    }
    .booking-info-table .bi-label {
        width: 70px;
        flex-shrink: 0;
    }
    .booking-info-table td:not(.bi-label) {
        flex: 1;
        min-width: calc(100% - 70px);
    }

    /* Price summary bar at bottom */
    .page-booking-form form > div[style*="max-width:900px"][style*="background:#f8f9fa"] {
        max-width: 100% !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Panel header buttons — wrap on small screens */
    .panel-header {
        flex-wrap: wrap;
        gap: 4px;
    }

    /* Client panel header buttons */
    #client-header-buttons {
        display: flex;
        gap: 4px;
        flex-wrap: wrap;
    }

    /* Relocation group summary */
    .page-booking-form div[style*="border-color:#b3d4fc"] div[style*="display:flex"][style*="gap:16px"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
}
