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

/* ========== PRE-FLIGHT MODAL ========== */
.preflight-modal {
    background: var(--bg-dark);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}
.preflight-modal .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.preflight-modal .modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    color: #fff;
}
.preflight-modal .modal-header h2 svg {
    width: 22px;
    height: 22px;
    color: #22C55E;
}
.preflight-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
}
.preflight-stat {
    text-align: center;
}
.preflight-stat .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.preflight-stat .value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
}
.preflight-payload {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    max-height: 350px;
}
.preflight-payload-header {
    padding: 12px 20px;
    background: rgba(0,0,0,0.3);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.preflight-entry {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 12px;
    align-items: start;
}
.preflight-entry:hover {
    background: rgba(255,255,255,0.03);
}
.preflight-entry .entry-num {
    width: 24px;
    height: 24px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.preflight-entry .entry-info {
    flex: 1;
}
.preflight-entry .entry-name {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
}
.preflight-entry .entry-details {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.preflight-entry .entry-transform {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    margin-top: 6px;
}
.preflight-entry .entry-transform .from {
    color: #EF4444;
    background: rgba(239,68,68,0.15);
    padding: 2px 8px;
    border-radius: 4px;
}
.preflight-entry .entry-transform .arrow {
    color: #6B7280;
}
.preflight-entry .entry-transform .to {
    color: #22C55E;
    background: rgba(34,197,94,0.15);
    padding: 2px 8px;
    border-radius: 4px;
}
.preflight-entry .entry-rate {
    text-align: right;
}
.preflight-entry .entry-rate .rate {
    font-size: 11px;
    color: #9CA3AF;
}
.preflight-entry .entry-rate .amount {
    font-weight: 700;
    color: #fff;
}
/* v2 | 2026-02-06 | BB - Automated pre-flight checklist (replaced manual checkboxes) */
.preflight-checklist {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
}
.preflight-checklist-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.preflight-check-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.15);
    transition: background 0.2s;
}
.preflight-check-step:last-child { margin-bottom: 0; }
.preflight-check-step .check-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    position: relative;
    margin-top: 2px;
}
.preflight-check-step .check-icon svg {
    width: 22px;
    height: 22px;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}
/* Pending state */
.preflight-check-step[data-status="pending"] .icon-pending { display: block; color: #6B7280; }
/* Running state */
.preflight-check-step[data-status="running"] .icon-running { display: block; color: #60A5FA; animation: spin-check 1s linear infinite; }
.preflight-check-step[data-status="running"] { background: rgba(59,130,246,0.08); }
/* Pass state */
.preflight-check-step[data-status="pass"] .icon-pass { display: block; color: #22C55E; }
.preflight-check-step[data-status="pass"] { background: rgba(34,197,94,0.08); }
/* Fail state */
.preflight-check-step[data-status="fail"] .icon-fail { display: block; color: #EF4444; }
.preflight-check-step[data-status="fail"] { background: rgba(239,68,68,0.08); }
/* Warn state */
.preflight-check-step[data-status="warn"] .icon-warn { display: block; color: #F59E0B; }
.preflight-check-step[data-status="warn"] { background: rgba(245,158,11,0.08); }
.preflight-check-step .check-label {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.preflight-check-step .check-detail {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.preflight-check-step[data-status="pass"] .check-detail { color: #4ADE80; }
.preflight-check-step[data-status="fail"] .check-detail { color: #F87171; }
.preflight-check-step[data-status="warn"] .check-detail { color: #FBBF24; }
@keyframes spin-check {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* v2 | 2026-03-18 | BB - Expandable details for pre-flight check steps */
.check-expand { margin-top: 6px; }
.check-expand-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: inherit;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s, background 0.15s;
}
.check-expand-toggle:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.preflight-check-step[data-status="fail"] .check-expand-toggle { border-color: rgba(239,68,68,0.3); color: #F87171; }
.preflight-check-step[data-status="warn"] .check-expand-toggle { border-color: rgba(245,158,11,0.3); color: #FBBF24; }
.check-expand-list {
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(0,0,0,0.25);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    max-height: 150px;
    overflow-y: auto;
}
.check-expand-item {
    font-size: 11px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-muted);
    line-height: 1.4;
}
.check-expand-item:last-child { border-bottom: none; }
.check-expand-item strong { color: #fff; font-weight: 600; }
.preflight-check-step[data-status="fail"] .check-expand-item { color: #FCA5A5; }
.preflight-check-step[data-status="warn"] .check-expand-item { color: #FDE68A; }

/* Express button */
.console-actions .btn-express {
    padding: 8px 16px;
    background: rgba(34,197,94,0.15);
    border: 1px solid #22C55E;
    color: #22C55E;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
}
.console-actions .btn-express:hover { background: rgba(34,197,94,0.25); }
.console-actions .btn-express.active { background: #22C55E; color: #fff; }

/* Summary verification badge */
.summary-verification {
    padding: 12px 20px;
    text-align: center;
}
.verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.verification-badge svg { width: 18px; height: 18px; }
.verification-badge.verified {
    background: rgba(34,197,94,0.15);
    color: #22C55E;
    border: 1px solid rgba(34,197,94,0.3);
}
.verification-badge.partial {
    background: rgba(245,158,11,0.15);
    color: #F59E0B;
    border: 1px solid rgba(245,158,11,0.3);
}
.verification-badge.unverified {
    background: rgba(107,114,128,0.15);
    color: #9CA3AF;
    border: 1px solid rgba(107,114,128,0.3);
}

.preflight-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.preflight-actions .btn-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}
.preflight-actions .btn-cancel:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.preflight-actions .btn-confirm {
    padding: 10px 24px;
    background: #22C55E;
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.preflight-actions .btn-confirm:hover:not(:disabled) {
    background: #16A34A;
}
.preflight-actions .btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.preflight-actions .btn-confirm svg {
    width: 16px;
    height: 16px;
}


/* ========== CONSOLE MODAL ========== */
.console-modal {
    background: var(--bg-dark);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}
.console-modal .modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
}
.console-modal .modal-header h2 {
    font-size: 14px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.console-modal .modal-header h2 svg {
    width: 18px;
    height: 18px;
    color: #22C55E;
}
.console-progress {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
}
.console-progress-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.console-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22C55E 0%, #16A34A 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.console-progress-text {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}
.console-log {
    flex: 1;
    overflow-y: scroll;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    background: #0D1117;
    height: 350px;
    min-height: 350px;
    max-height: 350px;
}
.console-log-entry {
    padding: 4px 0;
    display: flex;
    gap: 8px;
    line-height: 1.5;
}
.console-log-entry .timestamp,
.console-log-entry .time {
    color: #9CA3AF;
    flex-shrink: 0;
}
.console-log-entry .message {
    color: #E5E7EB;
}
.console-log-entry.info,
.console-log-entry.info .message {
    color: #93C5FD;
}
.console-log-entry.success,
.console-log-entry.success .message {
    color: #4ADE80;
}
.console-log-entry.warn,
.console-log-entry.warn .message {
    color: #FBBF24;
}
.console-log-entry.error,
.console-log-entry.error .message {
    color: #F87171;
}
.console-log-entry .indent {
    padding-left: 20px;
    color: #D1D5DB;
}
.console-log-entry .check-pass {
    color: #22C55E;
}
.console-log-entry .check-fail {
    color: #EF4444;
}
.console-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
}
.console-actions .action-group {
    display: flex;
    gap: 8px;
}
.console-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.console-actions .btn-pause {
    background: #F59E0B;
    border: none;
    color: #fff;
}
.console-actions .btn-pause:hover {
    background: #D97706;
}
.console-actions .btn-pause.paused {
    background: #22C55E;
}
.console-actions .btn-cancel-upload {
    background: transparent;
    border: 1px solid #EF4444;
    color: #EF4444;
}
.console-actions .btn-cancel-upload:hover {
    background: rgba(239,68,68,0.1);
}
.console-actions .btn-close {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.console-actions .btn-close:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.console-actions .btn-audit {
    background: rgba(59,130,246,0.2);
    border: 1px solid rgba(59,130,246,0.5);
    color: #60A5FA;
}
.console-actions .btn-audit:hover {
    background: rgba(59,130,246,0.3);
}


/* ========== BATCH MODE SELECTION MODAL ========== */
.batch-mode-modal {
    background: var(--bg-dark);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}
.batch-mode-modal .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
}
.batch-mode-modal .modal-header h2 {
    font-size: 16px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}
.batch-mode-modal .modal-header h2 svg {
    width: 20px;
    height: 20px;
    color: #22C55E;
}
.batch-mode-summary {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.1);
}
.batch-mode-summary p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--text-muted);
}
.batch-mode-summary p strong {
    color: #fff;
}
.batch-mode-daterange, .batch-mode-snapshot {
    font-size: 12px !important;
    color: #9CA3AF !important;
}
.batch-mode-selection {
    padding: 16px 20px;
}
.batch-mode-selection h3 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}
.batch-mode-selection .settings-hint {
    font-weight: 400;
    font-size: 11px;
    color: #6B7280;
}
.batch-mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.batch-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.batch-mode-option:hover {
    border-color: #4B5563;
    background: rgba(255,255,255,0.02);
}
.batch-mode-option.selected,
.batch-mode-option:has(input:checked) {
    border-color: #22C55E;
    background: rgba(34,197,94,0.05);
}
.batch-mode-option input[type="radio"] {
    margin-top: 3px;
    accent-color: #22C55E;
}
.batch-mode-option .option-content {
    flex: 1;
}
.batch-mode-option .option-title {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
}
.batch-mode-option .option-title .default-badge {
    font-size: 11px;
    font-weight: 400;
    color: #22C55E;
}
.batch-mode-option .option-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}
.batch-mode-locked-info {
    margin: 0 20px 16px;
    padding: 10px 12px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #FBBF24;
}
.batch-mode-locked-info svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.batch-mode-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(0,0,0,0.2);
}
.batch-mode-actions .btn-cancel {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.batch-mode-actions .btn-cancel:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.batch-mode-actions .btn-confirm {
    padding: 10px 20px;
    border: none;
    background: #22C55E;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.batch-mode-actions .btn-confirm:hover {
    background: #16A34A;
}
.batch-mode-actions .btn-confirm svg {
    width: 16px;
    height: 16px;
}


/* ========== BATCH CONSOLE MODAL ========== */
.batch-console-modal {
    background: var(--bg-dark);
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}
.batch-console-modal .modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
}
.batch-console-modal .modal-header h2 {
    font-size: 14px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.batch-console-modal .mode-badge {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(34,197,94,0.2);
    color: #22C55E;
    border-radius: 4px;
}
.batch-console-modal .complete-badge {
    color: #22C55E;
    font-weight: 500;
}
.batch-console-modal .paused-badge {
    color: #FBBF24;
    font-size: 11px;
    margin-left: 8px;
}
.batch-console-progress {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
}
.batch-progress-bar-container {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.batch-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #22C55E 0%, #16A34A 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.batch-progress-text {
    font-size: 13px;
    color: #fff;
    margin-bottom: 4px;
}
.batch-progress-stats {
    font-size: 12px;
    display: flex;
    gap: 16px;
}
.batch-progress-stats .stat-success { color: #4ADE80; }
.batch-progress-stats .stat-failed { color: #F87171; }
.batch-progress-stats .stat-skipped { color: #9CA3AF; }
.batch-current-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(34,197,94,0.05);
}
.batch-current-item .current-item-header {
    font-size: 11px;
    font-weight: 600;
    color: #22C55E;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.batch-current-item .current-item-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 16px;
}
.batch-current-item .item-field {
    font-size: 12px;
    color: var(--text-muted);
}
.batch-current-item .item-field label {
    color: #9CA3AF;
    margin-right: 6px;
}
.batch-current-item .item-field span {
    color: #fff;
}
.batch-log-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    background: #0D1117;
    min-height: 250px;
    max-height: 350px;
}
.batch-log-entry {
    padding: 3px 0;
    line-height: 1.5;
}
.batch-log-entry .log-time {
    color: #6B7280;
    margin-right: 8px;
}
.batch-log-entry.log-info { color: #93C5FD; }
.batch-log-entry.log-success { color: #4ADE80; }
.batch-log-entry.log-warn { color: #FBBF24; }
.batch-log-entry.log-error { color: #F87171; }
.batch-console-controls {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.3);
}
.batch-console-controls .control-group-left,
.batch-console-controls .control-group-right {
    display: flex;
    gap: 8px;
}
.batch-console-controls button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.batch-console-controls .btn-proceed {
    background: #22C55E;
    border: none;
    color: #fff;
}
.batch-console-controls .btn-proceed:hover {
    background: #16A34A;
}
.batch-console-controls .btn-skip {
    background: transparent;
    border: 1px solid #9CA3AF;
    color: #9CA3AF;
}
.batch-console-controls .btn-skip:hover {
    background: rgba(156,163,175,0.1);
    color: #fff;
}
.batch-console-controls .btn-next {
    background: #3B82F6;
    border: none;
    color: #fff;
}
.batch-console-controls .btn-next:hover {
    background: #2563EB;
}
.batch-console-controls .btn-express {
    background: rgba(34,197,94,0.2);
    border: 1px solid #22C55E;
    color: #22C55E;
}
.batch-console-controls .btn-express:hover {
    background: rgba(34,197,94,0.3);
}
.batch-console-controls .btn-pause {
    background: #F59E0B;
    border: none;
    color: #fff;
}
.batch-console-controls .btn-pause:hover {
    background: #D97706;
}
.batch-console-controls .btn-resume {
    background: #22C55E;
    border: none;
    color: #fff;
}
.batch-console-controls .btn-resume:hover {
    background: #16A34A;
}
.batch-console-controls .btn-cancel {
    background: transparent;
    border: 1px solid #EF4444;
    color: #EF4444;
}
.batch-console-controls .btn-cancel:hover {
    background: rgba(239,68,68,0.1);
}
.batch-console-controls .btn-close {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.batch-console-controls .btn-close:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}


/* ========== SUMMARY MODAL ========== */
/* Audit Trail Viewer — dark-theme hardcoded (modal bg is #2D2D2D) */
.audit-trail-modal {
    background: #2D2D2D;
    border-radius: 12px;
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    border: 1px solid #444;
}
.audit-trail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #444;
}
.audit-trail-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--bb-red);
    margin: 0;
}
.audit-trail-header .modal-close-btn {
    background: none;
    border: 1px solid #555;
    color: #D4D4D4;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.audit-trail-header .modal-close-btn:hover { background: #444; color: #fff; }
.audit-trail-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
    border-bottom: 1px solid #444;
}
.audit-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 500;
    color: #9CA3AF;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.audit-tab:hover { color: #E5E7EB; }
.audit-tab.active {
    color: #F5A65B;
    border-bottom-color: #F5A65B;
}
.audit-trail-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 200px;
    max-height: 60vh;
}
.audit-loading, .audit-empty {
    text-align: center;
    color: #9CA3AF;
    font-size: 13px;
    padding: 40px 0;
}
.audit-period {
    margin-bottom: 12px;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
}
.audit-period-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #363636;
    cursor: pointer;
    user-select: none;
    width: 100%;
    border: none;
    border-radius: 0;
    font: inherit;
    color: inherit;
    text-align: left;
}
.audit-period-header:hover { background: #3E3E3E; }
.audit-period-title {
    font-size: 12px;
    font-weight: 600;
    color: #E5E7EB;
}
.audit-period-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #9CA3AF;
}
.audit-period-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}
.audit-period-badge.complete { background: rgba(34,197,94,0.15); color: #22C55E; }
.audit-period-badge.incomplete { background: rgba(245,166,91,0.15); color: #F5A65B; }
.audit-period-detail {
    display: none;
    padding: 10px 14px;
    border-top: 1px solid #444;
    background: #333;
}
.audit-period.expanded .audit-period-detail { display: block; }
.audit-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.audit-detail-table th {
    text-align: left;
    padding: 6px 8px;
    color: #9CA3AF;
    font-weight: 600;
    border-bottom: 1px solid #555;
}
.audit-detail-table td {
    padding: 5px 8px;
    color: #D4D4D4;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.audit-detail-table tr:last-child td { border-bottom: none; }
.audit-status-ok { color: #22C55E; }
.audit-status-fail { color: #EF4444; }
.audit-status-skip { color: #9CA3AF; }
.audit-period-toggle {
    font-size: 10px;
    color: #9CA3AF;
    transition: transform 0.2s;
}
.audit-period.expanded .audit-period-toggle { transform: rotate(180deg); }

.summary-modal {
    background: var(--bg-dark);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}
.summary-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}
.summary-modal .modal-header .icon-success {
    width: 48px;
    height: 48px;
    background: rgba(34,197,94,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}
.summary-modal .modal-header .icon-success svg {
    width: 28px;
    height: 28px;
    color: #22C55E;
}
.summary-modal .modal-header h2 {
    font-size: 20px;
    color: #fff;
}
.summary-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
}
.summary-stat-item {
    text-align: center;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}
.summary-stat-item .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.summary-stat-item .value {
    font-size: 24px;
    font-weight: 700;
}
.summary-stat-item .value.success {
    color: #22C55E;
}
.summary-stat-item .value.fail {
    color: #EF4444;
}
.summary-stat-item .value.neutral {
    color: #fff;
}
.summary-failures {
    padding: 0 20px 20px;
}
.summary-failures-header {
    font-size: 12px;
    font-weight: 600;
    color: #EF4444;
    margin-bottom: 8px;
}
.summary-failure-item {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 12px;
    background: rgba(239,68,68,0.1);
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 3px solid #EF4444;
}
.summary-audit-path {
    padding: 12px 20px;
    background: rgba(0,0,0,0.2);
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.summary-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.summary-actions button {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.summary-actions .btn-audit {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.summary-actions .btn-audit:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.summary-actions .btn-undo {
    background: transparent;
    border: 1px solid #F59E0B;
    color: #F59E0B;
}
.summary-actions .btn-undo:hover {
    background: rgba(245,158,11,0.1);
}
.summary-actions .btn-done {
    background: #22C55E;
    border: none;
    color: #fff;
}
.summary-actions .btn-done:hover {
    background: #16A34A;
}

.toolbar-spacer {
    height: 48px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

/* Settings gear button */
.settings-gear-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-muted);
}
.settings-gear-btn:hover {
    background: var(--bg-dark);
    color: #fff;
}


/* ========== SETTINGS MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Detached mode - no backdrop */
.modal-overlay.detached {
    background: transparent;
    pointer-events: none;
}
.modal-overlay.detached .settings-modal {
    pointer-events: all;
}

.settings-modal {
    background: var(--bg-white);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s;
    overflow: hidden;
}

.modal-overlay.active .settings-modal {
    transform: scale(1) translateY(0);
}

/* Detached/Floating mode styles */
.modal-overlay.detached .settings-modal {
    position: absolute;
    width: 650px;
    height: 600px;
    min-width: 400px;
    min-height: 300px;
    max-width: none;
    max-height: none;
    resize: both;
    border: 2px solid var(--bb-red);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 1px rgba(200,16,46,0.3);
}

.modal-overlay.detached .modal-header {
    cursor: move;
    user-select: none;
    background: linear-gradient(135deg, var(--bb-red) 0%, var(--bb-red-hover) 100%);
    color: white;
    border-radius: 10px 10px 0 0;
}

.modal-overlay.detached .modal-header h2 {
    color: white;
}

.modal-overlay.detached .modal-header h2 svg {
    fill: white;
}

.modal-overlay.detached .modal-close {
    background: rgba(255,255,255,0.2);
    color: white;
}

.modal-overlay.detached .modal-close:hover {
    background: rgba(255,255,255,0.3);
    color: white;
}

.modal-overlay.detached .modal-detach-btn {
    background: rgba(255,255,255,0.2);
    color: white;
}

.modal-overlay.detached .modal-detach-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Resize handle indicator */
.modal-overlay.detached .settings-modal::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, transparent 50%, var(--bb-red) 50%);
    opacity: 0.5;
    pointer-events: none;
    border-radius: 0 0 4px 0;
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 svg {
    width: 20px;
    height: 20px;
}

.modal-header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-detach-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #F3F4F6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.2s;
}

.modal-detach-btn:hover {
    background: #E5E7EB;
    color: var(--text-dark);
}

.modal-detach-btn svg {
    width: 16px;
    height: 16px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #F3F4F6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #E5E7EB;
    color: var(--text-dark);
}

.modal-close svg {
    width: 16px;
    height: 16px;
}

/* Tabs */
.tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    background: #F9FAFB;
}

.tab-btn {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-btn:hover { color: var(--text-dark); }
.tab-btn.active { color: var(--bb-red); }

/* Neon-managed tab: muted style to signal read-only content */
.tab-btn.readonly-tab {
    opacity: 0.72;
    font-style: italic;
}
.tab-btn.readonly-tab:hover { opacity: 0.9; }
.tab-btn.readonly-tab.active { opacity: 1; font-style: normal; }

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--bb-red);
}

.status-dot {
    /* INCREASED SIZE 150% */
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9CA3AF;
}

.status-dot.connected { background: #22C55E; }
.status-dot.error { background: #EF4444; }

.tabs-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.tab-panel {
    display: none;
}

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

/* Settings Form */
/* Override accessibility 44px touch targets for checkboxes/radios inside settings modal */
.settings-modal input[type="checkbox"],
.settings-modal input[type="radio"] {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B7280;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.settings-group {
    margin-bottom: 14px;
}

.settings-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: #374151;
}

.settings-hint {
    font-size: 10px;
    color: #6B7280;
    margin-top: 4px;
}

.settings-input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-white);
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    color: var(--text-dark);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.settings-input:focus {
    outline: 2px solid var(--bb-red);
    outline-offset: 2px;
    border-color: var(--bb-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.settings-input.mono {
    font-family: monospace;
    font-size: 12px;
}

.settings-input[readonly] {
    background: #F3F4F6;
}

/* Validation states */
.settings-input.valid {
    border-color: #22C55E;
    background: #F0FDF4;
}
.settings-input.valid:focus {
    border-color: #22C55E;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}
.settings-input.invalid {
    border-color: #EF4444;
    background: #FEF2F2;
}
.settings-input.invalid:focus {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.validation-msg {
    font-size: 11px;
    margin-top: 4px;
    display: none;
}
.validation-msg.error {
    color: #EF4444;
    display: block;
}
.validation-msg.success {
    color: #22C55E;
    display: block;
}
.settings-group .validation-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: none;
}
.settings-group.has-validation {
    position: relative;
}
.settings-group.has-validation .settings-input {
    padding-right: 36px;
}
.settings-group.validated .validation-icon {
    display: block;
}
.validation-icon.valid {
    color: #22C55E;
}
.validation-icon.invalid {
    color: #EF4444;
}

/* Spin animation for loading states */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin, .spinning { animation: spin 1s linear infinite; }

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--bb-red);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: var(--bb-red-hover);
}

.btn-secondary {
    background: #E5E7EB;
    color: var(--text-dark);
    border: none;
}

.btn-secondary:hover {
    background: #D1D5DB;
}

/* v2026-02-04 | BB - Save button styles */
.btn-success {
    background: #10B981;
    color: #fff;
    border: none;
}
.btn-success:hover {
    background: #059669;
}
.btn-unsaved {
    animation: pulse-unsaved 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.5);
}
@keyframes pulse-unsaved {
    0%, 100% { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.3); }
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

/* Settings Footer */

/* ========== CUSTOM ALERT/CONFIRM MODAL ========== */
/* v2025-12-26: Replace browser dialogs with styled modals */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.custom-modal {
    background: #1F2937;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.2s;
    overflow: hidden;
}
.custom-modal-overlay.active .custom-modal {
    transform: scale(1) translateY(0);
}
.custom-modal-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #374151;
    display: flex;
    align-items: center;
    gap: 10px;
}
.custom-modal-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.custom-modal-icon.info { color: #3B82F6; }
.custom-modal-icon.success { color: #22C55E; }
.custom-modal-icon.warning { color: #F59E0B; }
.custom-modal-icon.error { color: #EF4444; }
.custom-modal-icon.confirm { color: #8B5CF6; }
.custom-modal-title {
    font-size: 14px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.custom-modal-body {
    padding: 20px;
    color: #F3F4F6;
    font-size: 15px;
    line-height: 1.5;
}
.custom-modal-footer {
    padding: 12px 20px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.custom-modal-btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}
.custom-modal-btn.primary {
    background: #3B82F6;
    color: #fff;
}
.custom-modal-btn.primary:hover {
    background: #2563EB;
}
.custom-modal-btn.secondary {
    background: #374151;
    color: #D1D5DB;
}
.custom-modal-btn.secondary:hover {
    background: #4B5563;
}
.custom-modal-btn.danger {
    background: #EF4444;
    color: #fff;
}
.custom-modal-btn.danger:hover {
    background: #DC2626;
}

/* v7 | 2026-02-07 | BB - Dark themed scrollbars for modals */
.custom-modal-body,
.summary-modal,
.settings-modal .modal-body,
.modal-overlay .modal-content,
.preflight-steps,
.console-log,
#summaryFailuresList {
    scrollbar-width: thin;
    scrollbar-color: #555 #1F2937;
}
.custom-modal-body::-webkit-scrollbar,
.summary-modal::-webkit-scrollbar,
.settings-modal .modal-body::-webkit-scrollbar,
.modal-overlay .modal-content::-webkit-scrollbar,
.preflight-steps::-webkit-scrollbar,
.console-log::-webkit-scrollbar,
#summaryFailuresList::-webkit-scrollbar {
    width: 8px;
}
.custom-modal-body::-webkit-scrollbar-track,
.summary-modal::-webkit-scrollbar-track,
.settings-modal .modal-body::-webkit-scrollbar-track,
.modal-overlay .modal-content::-webkit-scrollbar-track,
.preflight-steps::-webkit-scrollbar-track,
.console-log::-webkit-scrollbar-track,
#summaryFailuresList::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}
.custom-modal-body::-webkit-scrollbar-thumb,
.summary-modal::-webkit-scrollbar-thumb,
.settings-modal .modal-body::-webkit-scrollbar-thumb,
.modal-overlay .modal-content::-webkit-scrollbar-thumb,
.preflight-steps::-webkit-scrollbar-thumb,
.console-log::-webkit-scrollbar-thumb,
#summaryFailuresList::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
.custom-modal-body::-webkit-scrollbar-thumb:hover,
.summary-modal::-webkit-scrollbar-thumb:hover,
.settings-modal .modal-body::-webkit-scrollbar-thumb:hover,
.modal-overlay .modal-content::-webkit-scrollbar-thumb:hover,
.preflight-steps::-webkit-scrollbar-thumb:hover,
.console-log::-webkit-scrollbar-thumb:hover,
#summaryFailuresList::-webkit-scrollbar-thumb:hover {
    background: #666;
}
