/* styles-tabulator.css */
/* Override Tabulator CDN theme (tabulator_simple.min.css) */
/* All visual properties need !important to beat CDN specificity */

/* === BUG FIX: Hide resize handles — columns are fixed width === */
.tabulator .tabulator-col-resize-handle,
.tabulator-host .tabulator .tabulator-col-resize-handle {
    display: none !important;
    width: 0 !important;
    pointer-events: none !important;
}

/* === BASE CONTAINER === */
.tabulator-host .tabulator {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background-color: #ffffff !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 13px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

/* === HEADER === */
.tabulator-host .tabulator .tabulator-header {
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.tabulator-host .tabulator .tabulator-header .tabulator-col {
    background-color: #f8fafc !important;
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-right: 1px solid #edf0f4 !important;
    padding: 10px 8px !important;
}

.tabulator-host .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {
    color: #64748b !important;
    font-weight: 600 !important;
}

/* === FROZEN NAME COLUMN === */
.tabulator-host .tabulator .tabulator-col.tabulator-frozen {
    background-color: #f1f5f9 !important;
    border-right: 2px solid #e2e8f0 !important;
}

.tabulator-host .tabulator .tabulator-cell.tabulator-frozen {
    background-color: inherit !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #1f2937 !important;
    border-right: 2px solid #e2e8f0 !important;
    padding-left: 12px !important;
}

/* === GROUP HEADERS === */
.tabulator-host .tabulator .tabulator-group {
    background: #e0e7ff !important;
    border-bottom: 1px solid #c7d2fe !important;
    color: #3730a3 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
    min-height: 36px !important;
}

/* === ROWS === */
.tabulator-host .tabulator .tabulator-tableholder .tabulator-table .tabulator-row {
    border-bottom: none !important;
    min-height: 44px !important;
}

.tabulator-host .tabulator .tabulator-row:nth-child(even) {
    background-color: #fafbfd !important;
}

.tabulator-host .tabulator .tabulator-row:hover {
    background-color: #eef4ff !important;
}

/* === CELLS === */
.tabulator-host .tabulator .tabulator-cell {
    border-right: 1px solid #f0f2f5 !important;
    border-bottom: 1px solid #edf0f4 !important;
    padding: 6px 4px !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    min-height: 44px !important;
}

.tabulator-host .tabulator .tabulator-cell:hover {
    background-color: rgba(59, 130, 246, 0.04) !important;
}

/* === SHIFT CELL PILLS === */
.tab-shift-cell {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 6px !important;
    border-radius: 6px !important;
    min-height: 36px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    cursor: pointer !important;
    transition: transform 0.1s, box-shadow 0.15s !important;
}

.tab-shift-cell:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Published shift — green accent with shadow */
.tab-shift-published {
    background-color: #f0fdf4 !important;
    border-left: 3px solid #16a34a !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.15) !important;
}

/* Concept shift — amber dashed border with shadow */
.tab-shift-concept {
    background-color: #fffbeb !important;
    border: 1.5px dashed #f59e0b !important;
    border-left: 3px dashed #f59e0b !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    opacity: 0.9 !important;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.12) !important;
}

/* Status shifts */
.tab-shift-status {
    border-radius: 6px !important;
    padding: 4px 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    min-height: 32px !important;
}

/* Shift time text — bold, readable, tabular nums */
.tab-shift-time {
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px !important;
    color: #1e40af !important;
    font-variant-numeric: tabular-nums !important;
}

.tab-shift-task {
    font-size: 10px !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
}

.tab-shift-code {
    font-weight: 700 !important;
    font-size: 14px !important;
}

/* === DARK MODE === */
[data-theme="dark"] .tabulator-host .tabulator {
    border-color: rgba(255, 255, 255, 0.08) !important;
    background-color: var(--bg-card, #141E30) !important;
    box-shadow: none !important;
}

[data-theme="dark"] .tabulator-host .tabulator .tabulator-header .tabulator-col {
    background-color: var(--bg-main, #0C1220) !important;
    color: var(--text-secondary, #7E8FA6) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .tabulator-host .tabulator .tabulator-cell {
    border-color: rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] .tabulator-host .tabulator .tabulator-cell.tabulator-frozen {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .tabulator-host .tabulator .tabulator-row:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

[data-theme="dark"] .tabulator-host .tabulator .tabulator-row:hover {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

[data-theme="dark"] .tabulator-host .tabulator .tabulator-group {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .tab-shift-time {
    color: #93c5fd !important;
}

[data-theme="dark"] .tab-shift-published {
    background-color: rgba(22, 163, 74, 0.15) !important;
}

[data-theme="dark"] .tab-shift-concept {
    background-color: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

/* === FULL-WIDTH CONTAINER === */
.tabulator-host {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.schedule-container {
    padding: 0 !important;
    max-width: 100% !important;
}

/* === DAY HEADER — date + day name + today badge === */
.tab-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 0;
}

.tab-day-name {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    text-transform: none;
    letter-spacing: 0;
}

.tab-day-date {
    font-size: 10px;
    font-weight: 400;
    color: #94a3b8;
    letter-spacing: 0;
    text-transform: none;
}

.tab-today-badge {
    font-size: 9px;
    font-weight: 700;
    color: #ffffff;
    background: #2563eb;
    padding: 1px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
}

/* Today header gets blue accent */
.tab-day-header.tab-today .tab-day-name {
    color: #2563eb;
}

.tab-day-header.tab-today .tab-day-date {
    color: #3b82f6;
    font-weight: 600;
}

/* Today column cells — subtle blue highlight */
.tabulator-host .tabulator .tabulator-cell.tab-col-today {
    background-color: rgba(37, 99, 235, 0.03) !important;
}

.tabulator-host .tabulator .tabulator-row:hover .tabulator-cell.tab-col-today {
    background-color: rgba(37, 99, 235, 0.07) !important;
}

/* Today column header */
.tabulator-host .tabulator .tabulator-header .tabulator-col.tab-col-today {
    background-color: rgba(37, 99, 235, 0.06) !important;
    border-bottom: 3px solid #2563eb !important;
}

/* === EMPLOYEE NAME COLUMN === */
.tab-employee-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 155px;
    display: block;
}

.tab-header-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === PREVENT STYLE BLEED === */
.tabulator-host .tabulator input,
.tabulator-host .tabulator select {
    all: revert;
    font-family: inherit;
    font-size: 12px;
}

/* === PUBLISHED FLASH ANIMATION === */
@keyframes tab-published-flash {
    0%   { background-color: #fff7ed; }
    30%  { background-color: #fed7aa; }
    100% { background-color: inherit; }
}
.tab-published-flash {
    animation: tab-published-flash 0.8s ease-out;
}

/* === DARK MODE — day headers === */
[data-theme="dark"] .tab-day-name {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .tab-day-date {
    color: #64748b !important;
}

[data-theme="dark"] .tab-today-badge {
    background: #3b82f6 !important;
}

[data-theme="dark"] .tab-day-header.tab-today .tab-day-name {
    color: #60a5fa !important;
}

[data-theme="dark"] .tabulator-host .tabulator .tabulator-cell.tab-col-today {
    background-color: rgba(59, 130, 246, 0.06) !important;
}

[data-theme="dark"] .tabulator-host .tabulator .tabulator-header .tabulator-col.tab-col-today {
    background-color: rgba(59, 130, 246, 0.1) !important;
    border-bottom-color: #3b82f6 !important;
}

[data-theme="dark"] .tab-employee-name {
    color: #e2e8f0 !important;
}
