/* /home/host1/web/xpms.ru/public_html/css/chessboard.css */

.chessboard-container {
    padding: 24px;
    max-width: 1920px;
    margin: 0 auto;
}

.cell-empty:hover { background-color: #f8fafc; cursor: pointer; }
/* РўРѕС‡РєР° РЅР° РєРЅРѕРїРєРµ В«Р¤РёР»СЊС‚СЂС‹В», РєРѕРіРґР° СЃРєСЂС‹С‚С‹ РЅРµ РІСЃРµ СЃС‚Р°С‚СѓСЃС‹/Р»РѕРєР°С†РёРё */
#filtersBtn { position: relative; }
.filter-active-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3b82f6;
}

.booking-bar { transition: all 0.2s ease; height: 100%; max-height: 48px; min-height: 0; overflow: hidden; }
.booking-bar:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* РџРѕРґСЃРІРµС‚РєР° В«СЃРµРіРѕРґРЅСЏВ» РІ С€Р°РїРєРµ */
/* РџРѕРґСЃРІРµС‚РєСѓ В«СЃРµРіРѕРґРЅСЏВ» Рё Р»РёРЅРёСЋ СЂРёСЃСѓРµС‚ РѕРґРёРЅ СЃР»РѕР№ .today-overlay вЂ”
   РѕС‚ СЃС‚СЂРѕРєРё РґР°С‚ РґРѕ РєРѕРЅС†Р° С‚Р°Р±Р»РёС†С‹, С‡С‚РѕР±С‹ Р»РёРЅРёСЏ РЅРµ СЂР°СЃС…РѕРґРёР»Р°СЃСЊ РЅР° РїРёРєСЃРµР»СЊ */
.today-col {
    background-color: transparent !important;
    border-left: 0 !important;
}

/* РљРѕР»РѕРЅРєР° В«СЃРµРіРѕРґРЅСЏВ» РІ С‚РµР»Рµ С‚Р°Р±Р»РёС†С‹: СЃРїР»РѕС€РЅРѕР№ СЃР»РѕР№ РїРѕРІРµСЂС… РІСЃРµС… СЏС‡РµРµРє,
   РІРєР»СЋС‡Р°СЏ Р±СЂРѕРЅРё, Р±Р»РѕРєРёСЂРѕРІРєРё Рё СЃС‚СЂРѕРєРё Р»РѕРєР°С†РёР№. Р РёСЃСѓРµС‚СЃСЏ РІ _renderTodayOverlay(). */
#chessboardScroll { position: relative; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
#chessboardScroll::-webkit-scrollbar { display: none; }
.today-overlay {
    position: absolute;
    pointer-events: none;
    background: rgba(59, 130, 246, 0.08);
    border-left: 2px solid #3b82f6;
    z-index: 5;
}

/* РћС‚РјРµРЅС‘РЅРЅР°СЏ Р±СЂРѕРЅСЊ: РґРёР°РіРѕРЅР°Р»СЊРЅР°СЏ С€С‚СЂРёС…РѕРІРєР°, РєР°Рє РІ РјР°РєРµС‚Рµ */
.booking-cancelled {
    background: repeating-linear-gradient(45deg, #ef4444 0 6px, #dc2626 6px 12px) !important;
    color: #fff !important;
}

/* РџСѓР·С‹СЂРё С‡Р°С‚Р° РІ РєР°СЂС‚РѕС‡РєРµ Р±СЂРѕРЅРё */
.chat-bubble-in { background: #f1f5f9; border-radius: 12px 12px 12px 4px; }
.chat-bubble-out { background: #dbeafe; border-radius: 12px 12px 4px 12px; }

.chessboard-table { table-layout: fixed; width: 100%; }
/* РћРґРёРЅР°РєРѕРІР°СЏ РІС‹СЃРѕС‚Р° СЃС‚СЂРѕРє: РёРЅР°С‡Рµ Р±Р»РѕРєРёСЂРѕРІРєР° РІС‹РіР»СЏРґРёС‚ РЅРёР¶Рµ Р±СЂРѕРЅРё */
.chessboard-table tbody tr { height: 52px; }\n.chessboard-table tbody td { height: 52px; max-height: 52px; overflow: hidden; }
/* РЇРІРЅС‹Р№ С†РІРµС‚ СЂР°РјРѕРє, С‡С‚РѕР±С‹ РЅРµ РїСЂРѕСЃС‚СѓРїР°Р»Рё С‡С‘СЂРЅС‹Рµ Р»РёРЅРёРё РѕС‚ preflight */
.chessboard-table td, .chessboard-table th { border-color: #e2e8f0; }
.chessboard-table td:last-child, .chessboard-table th:last-child { border-right: none; }

.sticky-obj { position: sticky; left: 0; z-index: 10; }
.stat-card { transition: all 0.2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

.btn-primary {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    transition: all 0.2s;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30,41,59,0.3);
}

.nav-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 20;
    width: 30px;
    height: 100%;
    background: linear-gradient(180deg, #f8fafc, #eef2f7);
    border: 1px solid #e2e8f0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}
.nav-arrow:hover { background: #e2e8f0; box-shadow: inset 0 0 0 1px #cbd5e1; }
.nav-arrow.left { left: 0; border-left: 0; z-index: 30; }
.nav-arrow.right { right: auto; left: auto; border-right: 0; z-index: 30; }
.nav-arrow-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #475569;
}
.nav-arrow.left .nav-arrow-label { transform: rotate(180deg); }
#chessboardScroll { cursor: grab; }
#chessboardScroll.is-dragging { cursor: grabbing; user-select: none; }

.chessboard-scroll {
    overflow: hidden;
    position: relative;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.3);
}

.special-price-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    font-weight: 600;
    color: #f59e0b;
}

/* Р Р°Р·Р±РёРІРєР° РїРѕ РґРЅСЏРј */
.price-breakdown {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}
.price-day-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}
.price-day-row:last-child { border-bottom: none; }
.price-day-row.has-special { background: #fef3c7; }
.price-day-row .day-name { font-weight: 500; color: #334155; }
.price-day-row .day-price { font-weight: 600; color: #1e293b; }
.price-day-row .day-price.special { color: #d97706; }
.price-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 700;
    border-top: 2px solid #e2e8f0;
}

/* РњРѕР±РёР»СЊРЅР°СЏ Р°РґР°РїС‚Р°С†РёСЏ */
@media (max-width: 1024px) {
    .chessboard-container { padding: 16px; }
    .chessboard-container > div:first-child { margin-bottom: 12px; }
}

@media (max-width: 640px) {
    .chessboard-container { padding: 8px 8px 28px; }
    .chessboard-container > div:first-child { margin-bottom: 8px; gap: 6px; }

    /* РљРѕРјРїР°РєС‚РЅР°СЏ С€Р°РїРєР°: РјРµСЃСЏС† Рё РёРєРѕРЅРєРё РґРµР№СЃС‚РІРёР№ СѓРєР»Р°РґС‹РІР°СЋС‚СЃСЏ РІ РѕРґРЅСѓ СЃС‚СЂРѕРєСѓ */
    .chessboard-container > div:first-child { flex-wrap: nowrap; align-items: center; }
    .chessboard-container > div:first-child > div:last-child { flex: 0 0 auto; gap: 4px; }
    #monthPickerBtn { font-size: 14px; padding: 6px 8px; gap: 2px; max-width: 145px; min-width: 0; }
    #monthPickerBtn #monthLabel { display: block; max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #todayBtn, #filtersBtn { padding: 8px; }
    .chessboard-container .btn-primary { padding: 8px 10px; }

    #todayBtn span { display: none; }

    /* РЇС‡РµР№РєРё Рё СЃС‚СЂРѕРєРё: Р±РѕР»СЊС€Рµ РґРЅРµР№ РЅР° СЌРєСЂР°РЅРµ */
    .chessboard-table tbody tr { height: 40px; }
    .chessboard-table tbody td { height: 40px; max-height: 40px; overflow: hidden; }
    .chessboard-table .sticky-obj { padding-left: 8px !important; padding-right: 6px !important; padding-top: 4px !important; padding-bottom: 4px !important; }
    .chessboard-table .sticky-obj .w-8 { display: none; }
    .chessboard-table thead th { padding-top: 4px; padding-bottom: 4px; }
    #monthHeader th { padding-top: 2px; padding-bottom: 2px; font-size: 10px; line-height: 1.2; }
    #monthHeader th.sticky-obj { font-size: 0; }

    /* РРјРµРЅР° РѕР±СЉРµРєС‚РѕРІ Рё Р»РѕРєР°С†РёР№ вЂ” РІ РѕРґРЅСѓ СЃС‚СЂРѕРєСѓ СЃ РјРЅРѕРіРѕС‚РѕС‡РёРµРј */
    .chessboard-table .sticky-obj { overflow: hidden; }
    .chessboard-table .sticky-obj .flex { min-width: 0; }
    .chessboard-table .sticky-obj .flex > div { min-width: 0; }
    .chessboard-table .sticky-obj .text-sm { font-size: 12px; min-width: 0; max-width: 100%; }
    .chessboard-table .sticky-obj .text-sm.block { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .chessboard-table .sticky-obj .truncate { min-width: 0; max-width: 100%; display: block; }
    .chessboard-table .sticky-obj .text-xs { font-size: 10px; }

    /* Р¦РµРЅР° РґРЅСЏ Рё РјРёРЅРёРјР°Р»СЊРЅС‹Р№ СЃСЂРѕРє РїСЂРѕР¶РёРІР°РЅРёСЏ РІ РїСѓСЃС‚РѕР№ СЏС‡РµР№РєРµ */
    .chessboard-table .cell-empty div { white-space: nowrap; }
    .chessboard-table .cell-empty > div > div:first-child { font-size: 9px; }

    /* РњРёРЅРёРјР°Р»СЊРЅС‹Р№ СЃСЂРѕРє РїСЂРѕР¶РёРІР°РЅРёСЏ вЂ” РєРѕРјРїР°РєС‚РЅРѕ, РЅРѕ РІРёРґРЅРѕ */
    .chessboard-table .special-price-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 1px;
        margin-top: 1px;
        font-size: 8px;
        line-height: 1;
        color: #94a3b8;
    }
    .chessboard-table .special-price-badge svg { width: 8px; height: 8px; }

    /* Р‘Р°СЂС‹ Р±СЂРѕРЅРµР№: РєР°Рє РЅР° РґРµСЃРєС‚РѕРїРµ вЂ” РёСЃС‚РѕС‡РЅРёРє, РёРјСЏ Рё РѕРїР»Р°С‚Р°.
       РўРµРЅСЊ СѓР±РёСЂР°РµРј вЂ” РїСЂРё РіРѕСЂРёР·РѕРЅС‚Р°Р»СЊРЅРѕРј СЃРєСЂРѕР»Р»Рµ РѕРЅР° РІС‹РµР·Р¶Р°РµС‚ РЅР° РєРѕР»РѕРЅРєСѓ РѕР±СЉРµРєС‚РѕРІ */
    .chessboard-table .booking-bar { padding: 3px 4px !important; border-radius: 7px; box-shadow: none !important; max-height: 36px; }
    .chessboard-table .booking-bar > div:first-child { gap: 3px; }
    .chessboard-table .booking-bar .source-badge { width: 14px; height: 14px; font-size: 8px; border-radius: 3px; }
    .chessboard-table .booking-bar .text-xs { font-size: 9.5px; line-height: 1.1; }
    .chessboard-table .booking-bar .bar-sub { font-size: 8px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* РљРѕР»РѕРЅРєР° РѕР±СЉРµРєС‚РѕРІ РІСЃРµРіРґР° РЅРµРїСЂРѕР·СЂР°С‡РЅР°СЏ Рё РІС‹С€Рµ Р±Р°СЂРѕРІ вЂ” РёРЅР°С‡Рµ РїСЂРё СЃРєСЂРѕР»Р»Рµ
       РёР·-РїРѕРґ РЅРµС‘ РІС‹РіР»СЏРґС‹РІР°СЋС‚ С†РІРµС‚РЅС‹Рµ РєСЂР°СЏ Р±СЂРѕРЅРµР№ */
    .chessboard-table .sticky-obj { z-index: 30; }
    .chessboard-table tbody td.sticky-obj { background-color: #fff; }
    .chessboard-table tbody tr.bg-slate-50 td.sticky-obj { background-color: #f8fafc; }
    .chessboard-table thead th.sticky-obj { background-color: #f8fafc; }

    /* РЎС‚СЂРµР»РєРё РЅРµРґРµР»СЊ: РєРѕРјРїР°РєС‚РЅС‹Рµ, РїРѕРІРµСЂС… СЃРµС‚РєРё Сѓ РєСЂР°С‘РІ */
    .nav-arrow {
        display: flex;
        width: 26px;
        height: 100%;
        background: rgba(255,255,255,0.94);
        border-color: #cbd5e1;
        z-index: 40;
    }
    .nav-arrow i, .nav-arrow svg { width: 16px; height: 16px; }
    .nav-arrow.left { left: calc(var(--obj-col-width, 108px) + 10px); }
    .nav-arrow.right { right: 0; }

    /* РЎРµС‚РєР° С€РёСЂРµ СЌРєСЂР°РЅР°: СЃРІРѕР±РѕРґРЅРѕРµ РіРѕСЂРёР·РѕРЅС‚Р°Р»СЊРЅРѕРµ РґРІРёР¶РµРЅРёРµ СЃ РёРЅРµСЂС†РёРµР№,
       РєРѕР»РѕРЅРєР° РѕР±СЉРµРєС‚РѕРІ РїСЂРёР»РёРїР°РµС‚ СЃР»РµРІР° */
    #chessboardScroll {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }
    #chessboardScroll::-webkit-scrollbar { display: none; }
    .chessboard-scroll { overflow-x: auto; }
    .chessboard-table { width: auto; min-width: 0; }

    .chessboard-container .mt-6 { margin-top: 12px; }
    .chessboard-container .mt-6.flex { gap: 10px; font-size: 11px; }
}

/* РўРµРјРЅР°СЏ С‚РµРјР° (РЅРµ РёРЅРІРµСЂС‚РёСЂСѓРµРј С‚Р°Р±Р»РёС†Сѓ, С‡С‚РѕР±С‹ С†РІРµС‚Р° РѕСЃС‚Р°РІР°Р»РёСЃСЊ С‡РёС‚Р°РµРјС‹РјРё) */
html[data-theme="dark"] .chessboard-container {
    background: #f8fafc !important;
}
html[data-theme="dark"] .chessboard-container .bg-white {
    background-color: #ffffff !important;
}
html[data-theme="dark"] .chessboard-container .text-dark {
    color: #1e293b !important;
}

/* РРЅРґРёРєР°С‚РѕСЂ В«РЅСѓР¶РЅР° СѓР±РѕСЂРєР°В» РІ СЃС‚СЂРѕРєРµ РѕР±СЉРµРєС‚Р° */
.cb-clean {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fef3c7;
    color: #b45309;
    flex-shrink: 0;
}

/* РљР°СЂС‚РѕС‡РєР° Р±СЂРѕРЅРё: РґР°С‚С‹, РіРѕСЃС‚СЊ, РєРЅРѕРїРєРё */
.dt-dates { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px 14px; }
.dt-date-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 2px 0; }
.dt-date-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.dt-date-value { font-size: 20px; font-weight: 800; color: #0f172a; line-height: 1.2; }
.dt-nights { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: #475569; text-align: right; }
.dt-guest { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dt-phone { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: #0f172a; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.dt-phone:hover { color: #2563eb; }
.dt-guests { font-size: 12px; color: #64748b; font-weight: 600; }
.dt-actions-main { display: flex; gap: 8px; width: 100%; }
.dt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 700; border: 1px solid transparent; cursor: pointer; transition: background .15s, color .15s; }
.dt-btn-edit { flex: 0 0 auto; background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.dt-btn-edit:hover { background: #e2e8f0; }
.dt-btn-primary { flex: 1 1 0; background: #2563eb; color: #fff; }
.dt-btn-primary:hover { background: #1d4ed8; }
.dt-btn-link { flex: 1 1 0; background: #0ea5e9; color: #fff; }
.dt-btn-link:hover { background: #0284c7; }
@media (max-width: 480px) {
  .chessboard-container > div:first-child { gap: 4px; }
  #monthPickerBtn { max-width: 128px; }
  #monthPickerBtn #monthLabel { max-width: 90px; }
  .chessboard-container .btn-primary span { display: none; }

  .dt-actions-main { flex-wrap: wrap; }
  .dt-btn-edit { flex: 1 1 100%; }
}
.avito-mini { display: inline-block; font-size: 9px; font-weight: 800; padding: 0 4px; border-radius: 4px; background: #dbeafe; color: #1d4ed8; vertical-align: 1px; }
.avito-sent-mini { color: #1d4ed8; font-weight: 700; }

.dt-extra-phone { font-size: 12px; color: #64748b; font-weight: 600; }

/* Непрозрачная колонка объектов — чтобы при прокрутке не просвечивали даты */
.chessboard-table .sticky-obj { background-color: #fff; background-clip: padding-box; }
.chessboard-table thead .sticky-obj { background-color: #f8fafc; }

/* Стрелки — отдельные колонки в потоке таблицы */
.board-track { display: flex; align-items: stretch; width: max-content; min-width: 100%; }
.board-track > .chessboard-table { flex: 0 0 auto; width: auto !important; }
#chessboardScroll .nav-arrow { position: relative; top: auto; bottom: auto; left: auto; right: auto; height: auto; align-self: stretch; z-index: 1; }

/* Колонки-распорки под стрелки: не перекрывают объекты и даты */
.arrow-spacer { padding: 0 !important; border: 0 !important; background: transparent !important; }
#chessboardScroll .nav-arrow { position: absolute; top: 0; bottom: 0; height: auto; z-index: 5; align-self: auto; }

/* Колонка объектов не должна уезжать при горизонтальном скролле */
.chessboard-table .sticky-obj {
    position: sticky !important;
    left: 0 !important;
    z-index: 40 !important;
    background-clip: padding-box;
    box-shadow: 2px 0 0 #E2E8F0;
}
html[data-theme="dark"] .chessboard-table .sticky-obj {
    background-color: #0F172A !important;
    box-shadow: 2px 0 0 #334155;
}
html[data-theme="dark"] .chessboard-table tbody tr.bg-slate-50 td.sticky-obj,
html[data-theme="dark"] .chessboard-table thead th.sticky-obj {
    background-color: #1E293B !important;
}

/* Стрелки не должны перекрывать названия объектов */
.chessboard-table .sticky-obj { z-index: 60 !important; }
#chessboardScroll .nav-arrow { z-index: 35; }

/* Обрезанные края броней, выходящих за видимую область */
.booking-bar.clip-left,
.bg-slate-400\/20.clip-left {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.booking-bar.clip-right,
.bg-slate-400\/20.clip-right {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Выбор месяца должен быть выше закреплённой колонки объектов */
#monthPickerDropdown {
    z-index: 100 !important;
}

/* Высота строки локации фиксирована, длинное название обрезается */
.chessboard-table tbody tr.location-row td {
    height: 52px;
    max-height: 52px;
    overflow: hidden;
}
.chessboard-table .location-name {
    display: block;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 640px) {
    .chessboard-table tbody tr.location-row td { height: 40px; max-height: 40px; }
}

.chessboard-table tbody tr.location-row td > .flex { min-width: 0; }
.chessboard-table tbody tr.location-row td > .flex > div:last-child { min-width: 0; flex: 1; }

/* Пересекающиеся заявки на активной брони */
.overlap-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
}

/* Кнопки навигации по неделям — заметнее */
#chessboardScroll .nav-arrow {
    width: 36px;
    background: linear-gradient(180deg, #334155, #0f172a);
    border-color: #0f172a;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.28);
}
#chessboardScroll .nav-arrow:hover {
    background: linear-gradient(180deg, #475569, #1e293b);
    box-shadow: 0 3px 14px rgba(15, 23, 42, 0.38);
}
#chessboardScroll .nav-arrow .nav-arrow-label {
    color: #f8fafc;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
}
@media (max-width: 640px) {
    #chessboardScroll .nav-arrow { width: 32px; }
}

.overlap-badge-pending { background: #f59e0b; }
.overlap-badge-cancelled { background: #ef4444; }

#overlapMenu {
    position: fixed;
    z-index: 300;
    width: 270px;
    max-height: 320px;
    overflow: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    padding: 6px;
    font-size: 12px;
}
#overlapMenu.hidden { display: none; }
.overlap-menu-title {
    padding: 6px 8px 5px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.overlap-menu-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.overlap-menu-row:hover { background: #f8fafc; }
.overlap-menu-status {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    flex-shrink: 0;
}
.overlap-menu-status.pending { background: #f59e0b; }
.overlap-menu-status.cancelled { background: #ef4444; }
.overlap-menu-body { display: flex; flex-direction: column; min-width: 0; }
.overlap-menu-body b { color: #1e293b; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overlap-menu-body small { color: #94a3b8; font-size: 10px; }

.overlap-badge-block { background: #64748b; }

/* Конфликт дат в шахматке */
.booking-bar.has-conflict {
    outline: 2px solid #dc2626;
    outline-offset: -2px;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18), 0 2px 8px rgba(220, 38, 38, 0.25);
}
.conflict-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    flex-shrink: 0;
}

/* Кнопка конфликта на брони */
.conflict-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 5px;
    border: 0;
    border-radius: 5px;
    background: #dc2626;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 15px;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}
.conflict-btn:hover { background: #b91c1c; }

/* Просьбы к заезду на брони */
.booking-bar { position: relative; }
.booking-request-badge {
    position: absolute;
    right: 5px;
    bottom: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #FFFFFF;
    color: #0369A1;
    border: 1px solid #BAE6FD;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    z-index: 3;
    box-shadow: 0 1px 3px rgba(15,23,42,.18);
}
.overlap-badge { min-width: 16px !important; height: 16px !important; padding: 0 3px !important; font-size: 9px !important; }
.chessboard-table .booking-bar .bar-sub { padding-right: 20px; }
.booking-request-item {
    background: #EFF6FF !important;
    border-color: #BFDBFE !important;
}
.booking-request-item:hover { background: #DBEAFE !important; }
.booking-request-item b { color: #1E3A8A; }
html[data-theme="dark"] .booking-request-badge { background: #0C4A6E; color: #BAE6FD; border-color: #075985; }
html[data-theme="dark"] .booking-request-item { background: #0F2A43 !important; border-color: #1E4D6B !important; }
html[data-theme="dark"] .booking-request-item b { color: #BAE6FD; }

/* Компактная строка локации: одна строка вместо двух */
.chessboard-table tbody tr.location-row td {
    height: 34px !important;
    max-height: 34px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}
.cb-location-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    height: 100%;
}
.cb-location-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    color: #356a8a;
}
.chessboard-table .cb-location-line .location-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
}
.cb-location-count {
    flex: 0 0 auto;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 99px;
    background: #e8eef0;
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}
html[data-theme="dark"] .chessboard-table .cb-location-line .location-name { color: #eaf1f2; }
html[data-theme="dark"] .cb-location-count { background: #1e3137; color: #9db4ba; }
@media (max-width: 640px) {
    .chessboard-table tbody tr.location-row td { height: 30px !important; max-height: 30px !important; }
    .cb-location-icon { width: 12px; height: 12px; }
    .chessboard-table .cb-location-line .location-name { font-size: 11px; }
    .cb-location-count { min-width: 14px; height: 14px; line-height: 14px; font-size: 8px; padding: 0 4px; }
}


/* Слой фона внутри неподвижной ячейки: выше подвижных баров, ниже текста */
.chessboard-table tbody td.sticky-obj { overflow: hidden; }
.cb-sticky-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #fff;
    pointer-events: none;
}
.chessboard-table tbody tr.location-row .cb-sticky-bg { background: #f8fafc; }
.cb-sticky-content { position: relative; z-index: 2; min-width: 0; }
html[data-theme="dark"] .cb-sticky-bg { background: #0f172a; }
html[data-theme="dark"] .chessboard-table tbody tr.location-row .cb-sticky-bg { background: #1e293b; }
.chessboard-table tbody tr.location-row { height: 34px !important; }
@media (max-width: 640px) {
    .chessboard-table tbody tr.location-row { height: 30px !important; }
}

/* Шахматка: отдельная неподвижная колонка и прокручиваемая сетка дат */
.cb-board { display: flex; align-items: flex-start; width: 100%; min-width: 0; }
.cb-pinned {
    flex: 0 0 auto;
    width: var(--obj-col-width, 200px);
    background: #fff;
    border-right: 1px solid #e2e8f0;
    overflow: hidden;
}
.cb-pinned-head {
    display: flex;
    align-items: flex-end;
    box-sizing: border-box;
    padding: 0 16px 8px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.cb-pinned-row {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-width: 0;
    padding: 0 16px;
    border-bottom: 1px solid #e2e8f0;
}
.cb-pinned-location { height: 34px; background: #f8fafc; }
.cb-pinned-object { height: 52.5px; background: #fff; }
.cb-pinned-object:hover { background: #f8fafc; }
.cb-pinned .cb-location-line { width: 100%; }
#chessboardScroll { flex: 1 1 auto; min-width: 0; }
html[data-theme="dark"] .cb-pinned { background: #0f172a; border-right-color: #334155; }
html[data-theme="dark"] .cb-pinned-head { background: #1e293b; border-bottom-color: #334155; color: #8fa7ad; }
html[data-theme="dark"] .cb-pinned-row { border-bottom-color: #243a40; }
html[data-theme="dark"] .cb-pinned-location { background: #1e293b; }
html[data-theme="dark"] .cb-pinned-object { background: #0f172a; }
html[data-theme="dark"] .cb-pinned-object:hover { background: #17282d; }
@media (max-width: 640px) {
    .cb-pinned-head { padding: 0 8px 4px; font-size: 9px; letter-spacing: .02em; }
    .cb-pinned-row { padding: 0 8px; }
    .cb-pinned-location { height: 30px; }
    .cb-pinned-object { height: 40.5px; }
    .cb-pinned-object .w-8 { display: none; }
    .cb-pinned-object .text-sm { font-size: 11px; }
}
.cb-pinned .cb-location-line { min-width: 0; }
.cb-pinned .cb-location-line .location-name {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* «Ещё» — отдельная первая колонка перед датами */
#chessboardScroll .nav-arrow.left {
    left: 0 !important;
    width: 34px !important;
    z-index: 35;
}
#chessboardScroll .nav-arrow.right {
    right: 0 !important;
    left: auto !important;
    width: 34px !important;
    z-index: 35;
}
.chessboard-table .arrow-spacer {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

/* «Дальше» — отдельная последняя колонка справа, вне области дат */
.cb-right-nav {
    position: absolute;
    top: 0;
    width: 34px;
    z-index: 50;
    background: #356a8a;
    border-left: 1px solid #356a8a;
}
.cb-right-nav .nav-arrow {
    position: absolute !important;
    inset: 0 !important;
    width: 34px !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
}
html[data-theme="dark"] .cb-right-nav { background: #4c87a0; border-left-color: #4c87a0; }


/* Подпись месяца: стоит по центру видимой части, затем уезжает вместе с месяцем */
#monthHeader .cb-month-th { position: relative; height: 32px; overflow: hidden; }
.cb-month-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    pointer-events: none;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    line-height: 1;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}
html[data-theme="dark"] .cb-month-label { color: #eaf1f2; }
@media (max-width: 640px) {
    #monthHeader .cb-month-th { height: 28px; }
    .cb-month-label { font-size: 10px; }
}


/* Единый блок бейджей брони */
.booking-main { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; width: 100%; }
.booking-name-cell { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1 1 auto; }
.booking-badges { display: flex; align-items: center; justify-content: flex-end; gap: 3px; flex: 0 0 auto; min-width: 0; }
.booking-badges .conflict-btn { font-size: 8px; padding: 2px 4px; }
.booking-request-badge {
    position: static;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #fff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
    flex-shrink: 0;
}
.chessboard-table .booking-bar .bar-sub { padding-right: 0; }

/* Компактная бронь на одну клетку: без текста, только цвет, источник и бейджи */
.booking-bar-compact { padding: 2px !important; align-items: center; justify-content: center; }
.booking-bar-compact .booking-main { justify-content: center; height: 100%; }
.booking-bar-compact .booking-title-text,
.booking-bar-compact .bar-sub,
.booking-bar-compact .conflict-btn { display: none !important; }
.booking-bar-compact .booking-badges { position: absolute; right: 2px; bottom: 2px; gap: 1px; }
.booking-bar-compact .source-badge { width: 18px; height: 18px; }

@media (max-width: 640px) {
    .chessboard-table .booking-bar .source-badge { width: 14px; height: 14px; font-size: 8px; }
    .overlap-badge,
    .booking-request-badge { min-width: 14px !important; height: 14px !important; padding: 0 3px !important; font-size: 8px !important; }
    .booking-badges { gap: 2px; }
    .booking-bar-compact .source-badge { width: 16px; height: 16px; }
    .booking-bar-compact .booking-badges { right: 1px; bottom: 1px; }
}

/* Одинаковый размер всех круглых бейджей */
.booking-request-badge { min-width: 16px !important; height: 16px !important; padding: 0 3px !important; font-size: 9px !important; }
.chessboard-table .booking-bar .source-badge { width: 16px; height: 16px; font-size: 9px; }
@media (max-width: 640px) {
    .booking-request-badge { min-width: 14px !important; height: 14px !important; font-size: 8px !important; }
    .chessboard-table .booking-bar .source-badge { width: 14px; height: 14px; font-size: 8px; }
}
/* Все круглые бейджи строго одного диаметра */
.overlap-badge,
.booking-request-badge {
    width: 16px !important;
    min-width: 16px !important;
    height: 16px !important;
    padding: 0 !important;
    box-sizing: border-box;
    font-size: 9px !important;
}
.chessboard-table .booking-bar .source-badge {
    box-sizing: border-box;
    width: 16px;
    height: 16px;
}
@media (max-width: 640px) {
    .overlap-badge,
    .booking-request-badge {
        width: 14px !important;
        min-width: 14px !important;
        height: 14px !important;
        font-size: 8px !important;
    }
    .chessboard-table .booking-bar .source-badge {
        width: 14px;
        height: 14px;
    }
    .booking-bar-compact .overlap-badge,
    .booking-bar-compact .booking-request-badge {
        width: 12px !important;
        min-width: 12px !important;
        height: 12px !important;
        font-size: 7px !important;
    }
}

/* Две строки брони: верх — источник/имя/пересечения, низ — оплата/просьбы */
.booking-main { min-width: 0; }
.booking-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    margin-top: 1px;
    min-height: 10px;
}
.booking-sub .bar-sub {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.booking-sub .booking-request-badge { flex: 0 0 auto; }


/* Одиночная клетка: та же структура из двух строк, только компактнее */
.booking-bar-single { padding: 3px 4px !important; }
.booking-bar-single .booking-name-cell { gap: 2px; }
.booking-bar-single .booking-title-text { font-size: 8px; }
.booking-bar-single .booking-badges { gap: 2px; }
.booking-bar-single .booking-sub { margin-top: 0; min-height: 8px; }
.booking-bar-single .booking-sub .bar-sub { font-size: 8px; }
.booking-bar-single .conflict-btn { display: none; }

.booking-bar-single { min-height: 42px; }
@media (max-width: 640px) {
    .booking-bar-single { min-height: 34px; }
}