/* validation.css - Extracted from inline <style> | 2026-03-11 | BB */

/* ========== VALIDATION BAR ========== */
.validation-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #F1F5F9;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    min-height: 40px;
}
.validation-bar.hidden { display: none; }
.validation-bar-label {
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}
.validation-bar-label svg { color: #6B7280; }
.validation-counts {
    display: flex;
    gap: 10px;
    flex: 1;
}
.validation-count {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.validation-count:hover { transform: scale(1.05); }
.validation-count.critical {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}
.validation-count.warning {
    background: #FEF3C7;
    color: #D97706;
    border: 1px solid #FDE68A;
}
.validation-count.info {
    background: #DBEAFE;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}
.validation-count.success {
    background: #D1FAE5;
    color: #059669;
    border: 1px solid #A7F3D0;
}
.validation-count .count-icon { font-size: 14px; }
.validation-toggle-btn {
    margin-left: auto;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}
.validation-toggle-btn:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}
.validation-toggle-btn.active {
    background: #1E293B;
    color: #fff;
    border-color: #1E293B;
}
.validation-run-btn {
    padding: 5px 12px;
    background: #3B82F6;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s;
}
.validation-run-btn:hover { background: #2563EB; }
.validation-run-btn:disabled {
    background: #94A3B8;
    cursor: not-allowed;
}


/* ========== VALIDATION DRAWER (BB Left-Side Pattern) ========== */
.validation-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.validation-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}
.validation-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    height: 100dvh;
    background: #ffffff;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}
.validation-panel.open { transform: translateX(0); }
.validation-drawer-resize {
    position: absolute;
    right: 0;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    z-index: 10;
    transition: background 0.15s;
}
.validation-drawer-resize:hover,
.validation-drawer-resize.active {
    background: rgba(200,16,46,0.5);
}
.validation-panel-header {
    padding: 10px 16px;
    background: linear-gradient(135deg, #b83a3a 0%, #a33232 100%);
    border-bottom: 2px solid #C8102E;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.validation-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: white;
}
.validation-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.validation-panel-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 20px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.validation-panel-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.validation-summary-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
}
.val-severity-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 12px; font-weight: 600;
    cursor: pointer; transition: opacity 0.15s; user-select: none;
}
.val-severity-chip:hover { opacity: 0.8; }
.val-severity-chip.critical { background: #fee2e2; color: #dc2626; }
.val-severity-chip.warning { background: #fef3c7; color: #92400e; }
.val-severity-chip.info { background: #dbeafe; color: #1d4ed8; }
.val-severity-chip.zero { opacity: 0.5; cursor: default; }
.validation-pull-tab {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 24px;
    height: 80px;
    background: #C8102E;
    border-radius: 0 8px 8px 0;
    z-index: 1098;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    transition: opacity 0.3s ease, visibility 0.3s ease, background 0.15s;
    opacity: 0;
    visibility: hidden;
}
.validation-pull-tab.visible {
    opacity: 1;
    visibility: visible;
}
.validation-pull-tab:hover { background: #a50d25; }
.validation-pull-tab-icon {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    user-select: none;
}
.validation-panel-filters {
    padding: 12px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.validation-expand-all-btn {
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s;
    margin-left: auto;
}
.validation-expand-all-btn:hover { background: #f3f4f6; color: #374151; }
.validation-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
}
/* BB Pane Sections (matches CHK drawer) */
.bb-pane {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.9);
}
.bb-pane-header {
    background: linear-gradient(135deg, #b83a3a, #a33232);
    font-size: 12px;
    font-weight: 700;
    color: white;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: opacity 0.15s;
}
.bb-pane-header:hover { opacity: 0.92; }
.bb-pane-header.severity-critical { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.bb-pane-header.severity-warning { background: linear-gradient(135deg, #d97706, #b45309); }
.bb-pane-header.severity-info { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.bb-pane-body { padding: 4px 8px; }
.bb-pane.collapsed .bb-pane-body { display: none; }
.bb-category-group { margin: 4px 0; }
.bb-category-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 8px; background: #f8fafc; border-left: 3px solid #94a3b8;
    font-size: 11px; font-weight: 600; color: #475569;
    cursor: pointer; border-radius: 0 4px 4px 0; transition: background 0.15s;
}
.bb-category-header:hover { background: #f1f5f9; }
.bb-category-body { padding: 2px 0 2px 4px; }
.bb-category-group.collapsed .bb-category-body { display: none; }
.bb-category-toggle { font-size: 9px; color: #9ca3af; margin-left: 6px; }
.severity-critical .bb-category-header { border-left-color: #dc2626; }
.severity-warning .bb-category-header { border-left-color: #d97706; }
.severity-info .bb-category-header { border-left-color: #2563eb; }
.bb-pane-toggle { font-size: 11px; color: rgba(255,255,255,0.8); margin-left: 8px; }
.bb-section-icon { display: flex; align-items: center; }

/* BB Status Badges */
.bb-status-badge { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; }
.bb-status-badge.pass { background: #dcfce7; color: #16a34a; }
.bb-status-badge.fail { background: #fee2e2; color: #dc2626; }

/* BB Check Items (matches CHK drawer) */
.bb-check-item { padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.bb-check-item:last-child { border-bottom: none; }
.bb-check-item .bb-check-errors { display: block; }
.bb-check-item.collapsed .bb-check-errors { display: none; }
.bb-check-item .bb-check-row { cursor: pointer; }
.bb-check-item .bb-check-toggle {
    font-size: 9px;
    color: #9ca3af;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.bb-check-item .bb-check-toggle:hover { color: #6b7280; background: rgba(0,0,0,0.05); }
.bb-check-item .bb-check-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; color: #374151; }
.bb-check-item.collapsed .bb-check-toggle::after { content: "[+]"; }
.bb-check-item:not(.collapsed) .bb-check-toggle::after { content: "[-]"; }
.bb-check-row { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.bb-check-spacer { flex: 1; }
.bb-check-icon-svg { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 16px; height: 16px; }
.bb-check-icon-svg svg { display: block; }
.bb-check-label { font-size: 11px; color: #374151; }
.bb-check-counter { font-size: 10px; color: #9ca3af; font-weight: 400; margin-left: 8px; }
.bb-check-errors { margin-left: 24px; margin-top: 4px; }

/* Error lines (RED - critical) */
.bb-error-line {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    background: #fef2f2;
    border-left: 2px solid #dc2626;
    margin-bottom: 2px;
    font-size: 10px;
    color: #991b1b;
    border-radius: 0 3px 3px 0;
    min-height: 18px;
}
.bb-error-line:hover { filter: brightness(0.97); }
.bb-error-line-num {
    background: #dc2626;
    color: white;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 700;
    font-size: 9px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.bb-line-spacer { display: block; width: 22px; min-width: 22px; flex-shrink: 0; }
.bb-col { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Warning lines (YELLOW) */
.bb-pending-line { background: #fef3c7; border-left: 2px solid #f59e0b; color: #92400e; }
.bb-pending-line .bb-error-line-num { background: #f59e0b; }

/* Info/Note lines (BLUE) */
.bb-note-line { background: #eff6ff; border-left-color: #3b82f6; color: #1e40af; }
.bb-note-line .bb-error-line-num { background: #3b82f6; }

/* Match lines (GREEN) */
.bb-match-line { background: #f0fdf4; border-left-color: #16a34a; color: #166534; }
.bb-match-line .bb-error-line-num { background: #16a34a; }

/* Scrollable error list for 5+ items */
.bb-check-errors.scrollable { max-height: 144px; overflow-y: scroll; border: 1px solid #e5e7eb; border-radius: 4px; padding: 4px; }
.bb-check-errors.scrollable.expanded { max-height: 288px; }
.validation-issue-fix {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}
.validation-fix-btn {
    padding: 4px 10px;
    background: #10B981;
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.validation-fix-btn:hover { background: #059669; }
.validation-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.validation-empty svg {
    width: 48px;
    height: 48px;
    color: #D1D5DB;
    margin-bottom: 12px;
}


/* Action Buttons */
.validation-panel-actions {
    padding: 12px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.validation-action-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s;
}
.validation-action-btn.export {
    background: #3B82F6;
    color: #fff;
}
.validation-action-btn.export:hover { background: #2563EB; }
.validation-action-btn.dismiss {
    background: #64748B;
    color: #fff;
}
.validation-action-btn.dismiss:hover { background: #475569; }

/* Go to row button */
.validation-goto-btn {
    padding: 3px 8px;
    background: #E2E8F0;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.validation-goto-btn:hover {
    background: #3B82F6;
    color: #fff;
}


/* Row highlighting for validation issues */
.timesheet-row.has-issue { position: relative; }
.timesheet-row.has-issue::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}
.timesheet-row.has-critical::before { background: #DC2626; }
.timesheet-row.has-warning::before { background: #D97706; }
.timesheet-row.has-info::before { background: #2563EB; }
.timesheet-row.validation-highlight {
    animation: validationPulse 1.5s ease-out;
}
/* validationPulse keyframe lives in animations.css */
