﻿/* ============================================
   Booking Grid (Shahmatka) тАФ Table-based v3
   Google Calendar style
   ============================================ */

/* --- Wrapper --- */
.bk-grid-wrap {
    position: relative;
    overflow: auto;
    border: 1px solid var(--border, #E3E4E5);
    border-radius: 12px;
    background: var(--bg-surface, #fff);
    max-height: calc(100vh - 260px);
}

/* --- Table --- */
.bk-grid-wrap table.bk-table {
    width: 100%;
    border-collapse: collapse !important;
    table-layout: fixed;
}

/* Override dashboard.css global th rules */
.bk-grid-wrap th.bk-table__corner {
    width: 50px !important;
    min-width: 50px !important;
    position: sticky !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 30 !important;
    background: var(--bg-surface, #fff) !important;
    color: inherit !important;
    border-bottom: 2px solid var(--border, #E3E4E5) !important;
    border-right: 1px solid var(--border, #E3E4E5) !important;
    padding: 0 !important;
}

/* --- Date headers --- */
.bk-grid-wrap th.bk-table__date-th {
    position: sticky !important;
    top: 0 !important;
    z-index: 25 !important;
    background: var(--bg-surface, #fff) !important;
    color: var(--text, #111827) !important;
    border-bottom: 2px solid var(--border, #E3E4E5) !important;
    border-right: 1px solid var(--border, #E3E4E5) !important;
    padding: 10px 4px !important;
    text-align: center !important;
    font-weight: 600 !important;
    user-select: none;
    vertical-align: middle !important;
}

.bk-grid-wrap th.bk-table__date-th--today {
    color: var(--primary, #3390EC) !important;
    background: rgba(51, 144, 236, 0.04) !important;
}

.bk-grid-wrap th.bk-table__date-th--dayoff {
    background: rgba(0,0,0,0.04) !important;
    color: var(--text-muted, #9ca3af) !important;
    opacity: 0.65;
}

.bk-th-day {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #9ca3af);
}

.bk-th-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text, #111827);
}

.bk-grid-wrap th.bk-table__date-th--today .bk-th-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary, #3390EC);
    color: #fff;
    border-radius: 50%;
}

.bk-grid-wrap th.bk-table__date-th--today .bk-th-day {
    color: var(--primary, #3390EC);
}

/* --- Time labels --- */
.bk-grid-wrap td.bk-table__time {
    position: sticky !important;
    left: 0 !important;
    z-index: 20 !important;
    background: var(--bg-surface, #fff) !important;
    border-right: 1px solid var(--border, #E3E4E5) !important;
    border-bottom: 1px solid var(--border-light, #EEEFF0) !important;
    padding: 0 4px 0 0 !important;
    text-align: right !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    color: var(--text-muted, #9ca3af) !important;
    vertical-align: top !important;
    line-height: 1 !important;
    user-select: none;
    width: 50px !important;
    min-width: 50px !important;
}

/* --- Cells: OVERRIDE dashboard.css td rules --- */
.bk-grid-wrap td.bk-table__cell {
    border-right: 1px solid var(--border, #E3E4E5) !important;
    border-bottom: 1px solid var(--border-light, #EEEFF0) !important;
    height: 48px !important;
    padding: 0 !important;
    vertical-align: top !important;
    cursor: pointer;
    transition: background 0.1s;
    overflow: visible !important;
    color: inherit !important;
    background: transparent;
}

/* Override dashboard.css tr:hover td rule */
.bk-grid-wrap tr:hover td.bk-table__cell {
    background: transparent !important;
}

/* Full hour rows */
.bk-grid-wrap td.bk-table__cell--hour {
    border-bottom: 1px solid var(--border, #E3E4E5) !important;
}

/* Nonwork hours тАФ clearly gray, not clickable */
.bk-grid-wrap td.bk-table__cell--nonwork {
    background: rgba(0,0,0,0.06) !important;
    cursor: not-allowed !important;
}
.bk-grid-wrap tr:hover td.bk-table__cell--nonwork,
.bk-grid-wrap td.bk-table__cell--nonwork:hover {
    background: rgba(0,0,0,0.06) !important;
    outline: none !important;
    cursor: not-allowed !important;
}

/* Day off тАФ striped pattern, clearly distinct */
.bk-grid-wrap td.bk-table__cell--off {
    background: repeating-linear-gradient(135deg, rgba(0,0,0,0.03), rgba(0,0,0,0.03) 4px, rgba(0,0,0,0.07) 4px, rgba(0,0,0,0.07) 8px) !important;
    cursor: not-allowed !important;
}
.bk-grid-wrap tr:hover td.bk-table__cell--off,
.bk-grid-wrap td.bk-table__cell--off:hover {
    background: repeating-linear-gradient(135deg, rgba(0,0,0,0.03), rgba(0,0,0,0.03) 4px, rgba(0,0,0,0.07) 4px, rgba(0,0,0,0.07) 8px) !important;
    outline: none !important;
    cursor: not-allowed !important;
}

/* Drag-over */
.bk-grid-wrap td.bk-table__cell--dragover {
    background: rgba(51, 144, 236, 0.12) !important;
    box-shadow: inset 0 0 0 2px var(--primary, #3390EC);
}

/* --- Event blocks --- */
.bk-ev {
    margin: 1px 2px 0 2px;
    border-radius: 6px;
    padding: 3px 8px 3px 10px;
    font-size: 11px;
    line-height: 1.35;
    cursor: grab;
    overflow: visible;
    border-left: 4px solid transparent;
    position: relative;
    transition: box-shadow 0.15s, transform 0.1s;
    user-select: none;
    z-index: 5;
    display: block;
}

.bk-ev:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.18);
    z-index: 10;
    transform: scale(1.01);
}

.bk-ev:active {
    cursor: grabbing;
    transform: scale(0.98);
}

/* --- Status colors --- */
.bk-ev.bk-ev--pending,
.bk-ev--pending {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    border-left-color: #ef4444 !important;
    color: #991b1b !important;
}

.bk-ev.bk-ev--confirmed,
.bk-ev--confirmed {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    border-left-color: #22c55e !important;
    color: #166534 !important;
}

.bk-ev.bk-ev--completed,
.bk-ev--completed {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    border-left-color: #3b82f6 !important;
    color: #1e40af !important;
}

.bk-ev.bk-ev--cancelled,
.bk-ev--cancelled {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    border-left-color: #000000 !important;
    color: #e5e7eb !important;
    opacity: 0.65;
}

.bk-ev.bk-ev--no_show,
.bk-ev--no_show {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
    border-left-color: #6b7280 !important;
    color: #374151 !important;
    opacity: 0.55;
}

.bk-ev__dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.7);
}

.bk-ev__time {
    font-size: 10px;
    opacity: 0.7;
    line-height: 1.2;
}

.bk-ev__name {
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.bk-ev__svc {
    font-size: 10px;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
    display: block;
}

/* Resize handle */
.bk-ev__resize {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    cursor: s-resize;
    background: transparent;
    border-radius: 0 0 4px 4px;
}

.bk-ev__resize:hover {
    background: rgba(0,0,0,0.08);
}

/* --- Current time line --- */
.bk-timeline {
    position: absolute;
    left: 50px;
    right: 0;
    height: 2px;
    background: #ef4444;
    z-index: 15;
    pointer-events: none;
}

.bk-timeline::before {
    content: '';
    position: absolute;
    left: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
}

/* --- Month view --- */
.bk-grid { display: grid; position: relative; min-width: 100%; }
.bk-grid--month { grid-template-columns: repeat(7, 1fr); }

.bk-month-wday {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #9ca3af);
    padding: 8px 0;
    border-bottom: 2px solid var(--border, #E3E4E5);
    border-right: 1px solid var(--border, #E3E4E5);
    background: var(--bg-surface, #fff);
    position: sticky;
    top: 0;
    z-index: 25;
}

/* --- Rental Grid (Hotel-style ╤И╨░╤Е╨╝╨░╤В╨║╨░) --- */
.bk-rental-grid {
    position: relative;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    border: 1px solid var(--border, #E3E4E5);
    border-radius: 8px;
    background: var(--bg-surface, #fff);
}
.bk-rental-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
}
.bk-rental-corner {
    position: sticky !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 30 !important;
    background: var(--bg-surface, #fff) !important;
    border-right: 2px solid var(--border, #E3E4E5) !important;
    border-bottom: 1px solid var(--border, #E3E4E5) !important;
    width: 160px !important; min-width: 160px !important; max-width: 160px !important;
    padding: 8px 12px !important;
    font-size: 12px !important; font-weight: 600 !important;
    color: var(--text-muted, #6b7280) !important;
    text-align: left; vertical-align: middle !important;
}
.bk-rental-month-th {
    position: sticky; top: 0; z-index: 25;
    background: var(--bg-surface, #fff);
    text-align: center; font-size: 13px; font-weight: 700;
    color: var(--text, #111827);
    padding: 6px 0;
    border-bottom: 1px solid var(--border, #E3E4E5);
    border-right: 2px solid var(--border, #E3E4E5);
}
.bk-rental-day-th {
    position: sticky; top: 32px; z-index: 25;
    background: var(--bg-surface, #fff);
    text-align: center;
    width: 36px; min-width: 36px; max-width: 36px;
    padding: 2px 0; font-size: 10px;
    color: var(--text-muted, #6b7280);
    border-bottom: 2px solid var(--border, #E3E4E5);
    border-right: 1px solid var(--border-light, #EEEFF0);
}
.bk-rental-day-th--today { background: rgba(51,144,236,0.08) !important; }
.bk-rental-day-th--today .bk-rental-day-num {
    background: var(--primary, #3b82f6); color: #fff;
    border-radius: 50%; width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.bk-rental-day-th--weekend { background: rgba(0,0,0,0.03); }
.bk-rental-day-name { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; }
.bk-rental-day-num { display: block; font-size: 11px; font-weight: 600; margin-top: 1px; }
.bk-rental-label {
    position: sticky !important; left: 0 !important; z-index: 20 !important;
    background: var(--bg-surface, #fff) !important;
    border-right: 2px solid var(--border, #E3E4E5) !important;
    border-bottom: 1px solid var(--border-light, #EEEFF0) !important;
    padding: 6px 8px 6px 12px !important;
    font-size: 12px !important; font-weight: 600 !important;
    color: var(--text, #111827) !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    width: 160px !important; min-width: 160px !important; max-width: 160px !important;
    vertical-align: middle !important; cursor: default !important;
}
.bk-rental-label__link {
    color: inherit;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
}
.bk-rental-label__link:hover {
    color: var(--primary, #6366f1);
    text-decoration: underline;
}
.bk-rental-cell {
    border-right: 1px solid var(--border-light, #EEEFF0) !important;
    border-bottom: 1px solid var(--border-light, #EEEFF0) !important;
    height: 40px !important; min-height: 40px !important;
    padding: 0 !important; vertical-align: top !important;
    cursor: pointer; background: transparent; transition: background 0.1s;
}
.bk-rental-cell:hover { background: rgba(51,144,236,0.08) !important; }
.bk-rental-cell--dragover { background: rgba(51,144,236,0.18) !important; outline: 2px solid rgba(51,144,236,0.4); outline-offset: -2px; }
.bk-rental-cell--weekend { background: rgba(0,0,0,0.02) !important; }
.bk-rental-cell--today { background: rgba(51,144,236,0.04) !important; }
.bk-rental-bar {
    position: absolute; border-radius: 4px;
    display: flex; align-items: center; gap: 4px;
    padding: 2px 8px; font-size: 11px;
    cursor: grab; user-select: none;
    overflow: visible; white-space: nowrap;
    z-index: 5; transition: box-shadow 0.15s;
}
.bk-rental-bar:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
/* Tooltip — скрыт по умолчанию, JS переводит в position:fixed при наведении */
.bk-bar-tt {
    display: none;
    position: fixed;
    z-index: 99999;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 200px;
    max-width: 280px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    pointer-events: none;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
}
.bk-bar-tt::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 16px;
    border: 5px solid transparent;
    border-top-color: #1e293b;
}
.bk-bar-tt.bk-tt--below::after { display: none; }
.bk-bar-tt.bk-tt--below::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 16px;
    border: 5px solid transparent;
    border-bottom-color: #1e293b;
}
.bk-bar-tt__name { font-weight: 700; font-size: 13px; color: #f8fafc; margin-bottom: 5px; }
.bk-bar-tt__row { display: flex; align-items: flex-start; gap: 5px; color: #94a3b8; margin: 2px 0; }
.bk-bar-tt__note { color: #64748b; font-style: italic; margin-top: 4px; }
.bk-bar-tt__status {
    display: inline-block; margin-top: 6px; padding: 2px 8px;
    border-radius: 100px; font-size: 11px; font-weight: 600; text-transform: capitalize;
    background: rgba(255,255,255,0.1);
}
.bk-bar-tt__status--pending { background: rgba(239,68,68,0.2); color: #fca5a5; }
.bk-bar-tt__status--confirmed { background: rgba(34,197,94,0.2); color: #86efac; }
.bk-bar-tt__status--completed { background: rgba(59,130,246,0.2); color: #93c5fd; }
.bk-bar-tt__status--cancelled { background: rgba(100,116,139,0.2); color: #94a3b8; }
.bk-bar-tt__status--no_show { background: rgba(100,116,139,0.15); color: #cbd5e1; }
.bk-rental-bar__name { font-weight: 600; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.bk-rental-bar__price { font-size: 10px; opacity: 0.7; margin-left: auto; flex-shrink: 0; }
.bk-rental-bar__resize-r {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 8px; cursor: ew-resize; border-radius: 0 4px 4px 0;
}
.bk-rental-bar__resize-r:hover { background: rgba(0,0,0,0.12); }
.bk-rental-today-line { pointer-events: none; }
/* Dark */
[data-theme="dark"] .bk-rental-cell:hover, .dark .bk-rental-cell:hover { background: rgba(51,144,236,0.15) !important; }
[data-theme="dark"] .bk-rental-cell--weekend, .dark .bk-rental-cell--weekend { background: rgba(255,255,255,0.02) !important; }
[data-theme="dark"] .bk-rental-day-th--weekend, .dark .bk-rental-day-th--weekend { background: rgba(255,255,255,0.03); }

/* --- Side Panel (╨и╨░╤Е╨╝╨░╤В╨║╨░ #2 тАФ slide-in detail panel) --- */
.bk-sidepanel-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,0.3);
    display: flex; justify-content: flex-end;
}
.bk-sidepanel {
    width: 50%; max-width: 600px; min-width: 360px;
    height: 100%; background: var(--bg-surface, #fff);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    display: flex; flex-direction: column;
    animation: bkSlideIn 0.25s ease-out;
}
@keyframes bkSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.bk-sidepanel__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border, #E3E4E5);
}
.bk-sidepanel__close {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 20px; color: var(--text-muted, #6b7280);
    cursor: pointer; border: none; background: transparent;
}
.bk-sidepanel__close:hover { background: var(--bg, #f3f4f6); }
.bk-sidepanel__body {
    flex: 1; overflow-y: auto; padding: 20px;
}
.bk-sidepanel__footer {
    padding: 16px 20px; border-top: 1px solid var(--border, #E3E4E5);
    display: flex; flex-direction: column; gap: 8px;
}
.bk-sp-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light, #EEEFF0);
}
.bk-sp-section:last-child { border-bottom: none; }
.bk-sp-section__title {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted, #6b7280); margin-bottom: 8px;
}
.bk-sp-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.bk-sp-field { display: flex; flex-direction: column; gap: 2px; }
.bk-sp-field__label { font-size: 11px; color: var(--text-muted, #6b7280); }
.bk-sp-field__value { font-size: 13px; font-weight: 600; color: var(--text, #111827); }

@media (max-width: 768px) {
    .bk-sidepanel { width: 100%; max-width: 100%; }
}

.bk-month-cell {
    min-height: 100px;
    border-right: 1px solid var(--border, #E3E4E5);
    border-bottom: 1px solid var(--border, #E3E4E5);
    padding: 4px;
    cursor: pointer;
    transition: background 0.1s;
}
.bk-month-cell:hover { background: rgba(51,144,236,0.03); }
.bk-month-cell--today { background: rgba(51,144,236,0.05); }
.bk-month-cell--dayoff { background: rgba(0,0,0,0.015); }
.bk-month-cell--outside { opacity: 0.35; }

.bk-month-cell__num {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #111827);
    margin-bottom: 2px;
}

.bk-month-cell--today .bk-month-cell__num {
    color: #fff;
    background: var(--primary, #3390EC);
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

.bk-month-bar {
    display: flex; align-items: center; gap: 3px;
    padding: 2px 5px; border-radius: 4px;
    font-size: 10px; line-height: 1.4; margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: pointer; font-weight: 500;
}
.bk-month-bar--pending   { background: rgba(245,158,11,0.2);  color: #92400e; }
.bk-month-bar--confirmed { background: rgba(34,197,94,0.2);   color: #166534; }
.bk-month-bar--completed { background: rgba(59,130,246,0.18); color: #1e40af; }
.bk-month-bar--cancelled { background: rgba(239,68,68,0.14);  color: #991b1b; opacity: 0.7; }
.bk-month-bar--no_show   { background: rgba(107,114,128,0.14);color: #374151; opacity: 0.7; }

.bk-month-more { font-size: 10px; color: var(--primary, #3390EC); cursor: pointer; padding: 0 4px; font-weight: 600; }

/* --- Toolbar --- */
.bk-toolbar__group {
    display: inline-flex;
    border: 1px solid var(--border, #E3E4E5);
    border-radius: 8px;
    overflow: hidden;
}

.bk-toolbar__btn {
    padding: 6px 12px; font-size: 13px; font-weight: 500;
    background: var(--bg-surface, #fff); color: var(--text-secondary, #6b7280);
    border: none; cursor: pointer; transition: background 0.1s; white-space: nowrap;
}
.bk-toolbar__btn:not(:last-child) { border-right: 1px solid var(--border, #E3E4E5); }
.bk-toolbar__btn:hover { background: var(--bg, #f9fafb); }
.bk-toolbar__btn--active { background: var(--primary, #3390EC) !important; color: #fff !important; }
.bk-toolbar__btn--active:hover { background: var(--primary-dark, #2B7FD5) !important; }

.bk-nav-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--border, #E3E4E5);
    background: var(--bg-surface, #fff); color: var(--text-secondary, #6b7280);
    cursor: pointer; font-size: 14px;
}
.bk-nav-btn:hover { background: var(--bg, #f9fafb); }

.bk-period-label { font-size: 15px; font-weight: 600; color: var(--text, #111827); min-width: 140px; text-align: center; user-select: none; }

.bk-filter-pill {
    padding: 4px 10px; font-size: 12px; font-weight: 500; border-radius: 16px;
    cursor: pointer; transition: all 0.1s;
    border: 1px solid transparent;
    background: var(--bg, #f9fafb); color: var(--text-secondary, #6b7280);
}
.bk-filter-pill:hover { background: var(--bg-surface, #fff); border-color: var(--border, #E3E4E5); }
.bk-filter-pill--active { background: var(--primary, #3390EC) !important; color: #fff !important; border-color: var(--primary, #3390EC) !important; }

/* --- Modal --- */
.bk-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.bk-modal { background: var(--bg-surface, #fff); border-radius: 16px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.bk-modal__header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-light, #EEEFF0); }
.bk-modal__title { font-size: 16px; font-weight: 700; color: var(--text, #111827); }
.bk-modal__close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; color: var(--text-muted, #9ca3af); background: none; border: none; font-size: 18px; }
.bk-modal__close:hover { background: var(--bg, #f9fafb); }
.bk-modal__body { padding: 16px 20px; }
.bk-modal__footer { padding: 12px 20px; border-top: 1px solid var(--border-light, #EEEFF0); display: flex; justify-content: flex-end; gap: 8px; }

/* --- Cell hover highlight (clearly visible) --- */
.bk-grid-wrap td.bk-table__cell:hover:not(.bk-table__cell--nonwork):not(.bk-table__cell--off) {
    background: rgba(51, 144, 236, 0.12) !important;
    outline: 2px solid rgba(51, 144, 236, 0.4) !important;
    outline-offset: -2px;
}

/* --- Notify Prompt --- */
.bk-notify-prompt {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 150;
    animation: bk-toast-in 0.2s ease;
}
.bk-notify-prompt__box {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border, #E3E4E5);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 340px;
}
.bk-notify-prompt__text {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text, #111827);
    line-height: 1.4;
}
.bk-notify-prompt__btns {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.bk-notify-prompt__btn {
    padding: 5px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}
.bk-notify-prompt__btn--no {
    background: var(--bg, #f9fafb);
    color: var(--text-secondary, #6b7280);
    border: 1px solid var(--border, #E3E4E5) !important;
}
.bk-notify-prompt__btn--yes {
    background: var(--primary, #3390EC);
    color: #fff;
}
.bk-notify-prompt__btn--yes:hover { opacity: 0.9; }
.bk-notify-prompt__btn--no:hover { background: var(--bg-surface, #fff); }

/* --- Toast --- */
.bk-toast { position: fixed; bottom: 24px; right: 24px; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #fff; z-index: 200; box-shadow: 0 4px 16px rgba(0,0,0,0.15); animation: bk-toast-in 0.25s ease; }
.bk-toast--ok { background: #22c55e; }
.bk-toast--err { background: #ef4444; }
@keyframes bk-toast-in { from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);} }

/* --- Dark theme --- */

/* Cell hover in dark */
[data-theme="dark"] .bk-grid-wrap td.bk-table__cell:hover:not(.bk-table__cell--nonwork):not(.bk-table__cell--off),
.dark .bk-grid-wrap td.bk-table__cell:hover:not(.bk-table__cell--nonwork):not(.bk-table__cell--off) {
    background: rgba(51, 144, 236, 0.18) !important;
    outline: 2px solid rgba(51, 144, 236, 0.5) !important;
}

/* Nonwork hours in dark тАФ visible gray */
[data-theme="dark"] .bk-grid-wrap td.bk-table__cell--nonwork,
.dark .bk-grid-wrap td.bk-table__cell--nonwork {
    background: rgba(255,255,255,0.06) !important;
}
[data-theme="dark"] .bk-grid-wrap tr:hover td.bk-table__cell--nonwork,
[data-theme="dark"] .bk-grid-wrap td.bk-table__cell--nonwork:hover,
.dark .bk-grid-wrap tr:hover td.bk-table__cell--nonwork,
.dark .bk-grid-wrap td.bk-table__cell--nonwork:hover {
    background: rgba(255,255,255,0.06) !important;
    outline: none !important;
}

/* Day off in dark тАФ clearly striped */
[data-theme="dark"] .bk-grid-wrap td.bk-table__cell--off,
.dark .bk-grid-wrap td.bk-table__cell--off {
    background: repeating-linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02) 4px, rgba(255,255,255,0.08) 4px, rgba(255,255,255,0.08) 8px) !important;
}
[data-theme="dark"] .bk-grid-wrap tr:hover td.bk-table__cell--off,
[data-theme="dark"] .bk-grid-wrap td.bk-table__cell--off:hover,
.dark .bk-grid-wrap tr:hover td.bk-table__cell--off,
.dark .bk-grid-wrap td.bk-table__cell--off:hover {
    background: repeating-linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02) 4px, rgba(255,255,255,0.08) 4px, rgba(255,255,255,0.08) 8px) !important;
    outline: none !important;
}

/* Day-off header in dark */
[data-theme="dark"] .bk-grid-wrap th.bk-table__date-th--dayoff,
.dark .bk-grid-wrap th.bk-table__date-th--dayoff {
    background: rgba(255,255,255,0.04) !important;
    color: var(--text-muted, #6b7280) !important;
    border-bottom-color: rgba(255,255,255,0.12) !important;
}

[data-theme="dark"] .bk-ev.bk-ev--pending,
.dark .bk-ev.bk-ev--pending     { background: linear-gradient(135deg, rgba(248,113,113,0.3) 0%, rgba(239,68,68,0.22) 100%) !important; color: #fca5a5 !important; }
[data-theme="dark"] .bk-ev.bk-ev--confirmed,
.dark .bk-ev.bk-ev--confirmed   { background: linear-gradient(135deg, rgba(52,211,153,0.3) 0%, rgba(34,197,94,0.22) 100%) !important; color: #86efac !important; }
[data-theme="dark"] .bk-ev.bk-ev--completed,
.dark .bk-ev.bk-ev--completed   { background: linear-gradient(135deg, rgba(96,165,250,0.28) 0%, rgba(59,130,246,0.2) 100%) !important; color: #93c5fd !important; }
[data-theme="dark"] .bk-ev.bk-ev--cancelled,
.dark .bk-ev.bk-ev--cancelled   { background: linear-gradient(135deg, #111827 0%, #0a0f1a 100%) !important; color: #6b7280 !important; }
[data-theme="dark"] .bk-ev.bk-ev--no_show,
.dark .bk-ev.bk-ev--no_show     { background: linear-gradient(135deg, rgba(156,163,175,0.22) 0%, rgba(107,114,128,0.15) 100%) !important; color: #d1d5db !important; }

[data-theme="dark"] .bk-grid-wrap td.bk-table__cell--dragover,
.dark .bk-grid-wrap td.bk-table__cell--dragover { background: rgba(51,144,236,0.15) !important; }

/* ============================================
   Air Datepicker тАФ Dark Mode Override
   ============================================ */
[data-theme="dark"] .air-datepicker,
.dark .air-datepicker {
    --adp-background-color: var(--bg-surface, #1e2433);
    --adp-color: var(--text, #e2e8f0);
    --adp-color-secondary: var(--text-muted, #9ca3af);
    --adp-accent-color: var(--primary, #3390EC);
    --adp-background-color-hover: var(--bg, #2d3748);
    --adp-border-color: var(--border, #2d3748);
    --adp-cell-background-color-selected: var(--primary, #3390EC);
    --adp-color-current-date: var(--primary, #3390EC);
    --adp-cell-background-color-selected-hover: var(--primary-hover, #2980d9);
    --adp-background-color-active-cell: var(--primary, #3390EC);
    --adp-nav-arrow-color: var(--text, #e2e8f0);
}
[data-theme="dark"] .air-datepicker-global-container .air-datepicker,
.dark .air-datepicker-global-container .air-datepicker {
    --adp-background-color: var(--bg-surface, #1e2433);
    --adp-color: var(--text, #e2e8f0);
    --adp-color-secondary: var(--text-muted, #9ca3af);
    --adp-accent-color: var(--primary, #3390EC);
    --adp-background-color-hover: var(--bg, #2d3748);
    --adp-border-color: var(--border, #2d3748);
    --adp-cell-background-color-selected: var(--primary, #3390EC);
    --adp-color-current-date: var(--primary, #3390EC);
    --adp-nav-arrow-color: var(--text, #e2e8f0);
}

/* ============================================
   Air Datepicker — time slider track fix
   ============================================ */
.air-datepicker-time--row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #d1d5db;
    outline: none;
    margin: 8px 0;
}
.air-datepicker-time--row input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: #d1d5db;
}
.air-datepicker-time--row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--adp-accent-color, var(--primary, #3390EC));
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    margin-top: -7px;
}
.air-datepicker-time--row input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: #d1d5db;
}
.air-datepicker-time--row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--adp-accent-color, var(--primary, #3390EC));
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
[data-theme="dark"] .air-datepicker-time--row input[type="range"],
.dark .air-datepicker-time--row input[type="range"] {
    background: #4b5563;
}
[data-theme="dark"] .air-datepicker-time--row input[type="range"]::-webkit-slider-runnable-track,
.dark .air-datepicker-time--row input[type="range"]::-webkit-slider-runnable-track {
    background: #4b5563;
}
[data-theme="dark"] .air-datepicker-time--row input[type="range"]::-webkit-slider-thumb,
.dark .air-datepicker-time--row input[type="range"]::-webkit-slider-thumb {
    border-color: #374151;
}
[data-theme="dark"] .air-datepicker-time--row input[type="range"]::-moz-range-track,
.dark .air-datepicker-time--row input[type="range"]::-moz-range-track {
    background: #4b5563;
}
[data-theme="dark"] .air-datepicker-time--row input[type="range"]::-moz-range-thumb,
.dark .air-datepicker-time--row input[type="range"]::-moz-range-thumb {
    border-color: #374151;
}

/* ============================================
   Air Datepicker — range selection styling
   ============================================ */
.air-datepicker-cell.-in-range- {
    background: rgba(51, 144, 236, 0.1);
    color: var(--adp-color, #333);
}
.air-datepicker-cell.-range-from-,
.air-datepicker-cell.-range-to- {
    background: var(--adp-accent-color, var(--primary, #3390EC));
    color: #fff;
    border-radius: 50%;
}

/* ============================================
   Responsive
   ============================================ */
/* --- Responsive --- */
@media (max-width: 768px) {
    .bk-grid-wrap th.bk-table__corner,
    .bk-grid-wrap td.bk-table__time { width: 40px !important; min-width: 40px !important; font-size: 9px !important; }
    .bk-grid-wrap td.bk-table__cell { height: 40px !important; }
    .bk-ev { font-size: 10px; padding: 2px 5px; }
    .bk-ev__name { font-size: 10px; }
    .bk-month-cell { min-height: 70px; }
    .bk-toolbar__btn { padding: 4px 8px; font-size: 12px; }
    .bk-period-label { font-size: 13px; min-width: 100px; }
    .bk-timeline { left: 40px; }
}
