/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #1d1d1f; background: #ffffff; -webkit-font-smoothing: antialiased; }

/* ── Login ── */
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; background: #ffffff; }
.login-card { background: #fafafc; border-radius: 18px; padding: 48px 40px; width: 380px; box-shadow: 0 4px 24px rgba(0,0,0,0.3); text-align: center; }
.login-logo { margin-bottom: 16px; }
.login-card h1 { font-size: 22px; font-weight: 600; margin-bottom: 28px; color: #1d1d1f; }
.form-group { margin-bottom: 14px; }
.form-group input { width: 100%; padding: 12px 16px; border: 1px solid #d2d2d7; border-radius: 10px; font-size: 15px; background: #f5f5f7; color: #1d1d1f; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: #007AFF; background: #fafafc; }
.form-error { color: #ff3b30; font-size: 13px; margin-bottom: 12px; }
.btn-primary { width: 100%; padding: 12px; border: none; border-radius: 10px; background: #007AFF; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-primary:hover { background: #0066d6; }
.btn-primary:disabled { background: #d2d2d7; cursor: not-allowed; }

/* ── App Layout ── */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Nav Rail ── */
.nav-rail { width: 68px; min-width: 68px; background: #fafafc; border-right: 1px solid #ececf1; display: flex; flex-direction: column; align-items: center; padding: 12px 0; }
.nav-rail-top { margin-bottom: 8px; }
.nav-rail-tabs { flex: 1; display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0 6px; }
.nav-rail-bottom { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0 6px; }
.nav-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border: none; background: transparent; color: #86868b; cursor: pointer; border-radius: 10px; transition: all 0.15s; font-size: 10px; width: 100%; }
.nav-tab:hover { background: #f5f5f7; color: #1d1d1f; }
.nav-tab.active { background: #007AFF; color: #fff; }
.nav-tab.active svg { stroke: #fff; }

/* App Switcher */
.app-switcher-wrap { position: relative; }
.app-switcher-dropdown { display: none; position: absolute; top: 44px; left: 0; background: #fafafc; border: 1px solid #d2d2d7; border-radius: 12px; padding: 8px; width: 180px; z-index: 100; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.app-switcher-wrap.open .app-switcher-dropdown { display: block; }
.app-switcher-title { font-size: 11px; color: #86868b; padding: 4px 8px 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.app-switcher-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: #1d1d1f; font-size: 13px; }
.app-switcher-item:hover { background: #f5f5f7; }
.app-switcher-item.active { background: #007AFF; color: #fff; }
.app-switcher-icon { font-size: 16px; width: 24px; text-align: center; }

/* ── Main Content ── */
.main-content { flex: 1; overflow-y: auto; background: #ffffff; }

.view { display: none; height: 100%; overflow-y: auto; }
.view.active { display: flex; flex-direction: column; }

.view-header { padding: 20px 24px; border-bottom: 1px solid #ececf1; display: flex; align-items: center; gap: 16px; background: #fafafc; flex-shrink: 0; }
.view-header h2 { font-size: 20px; font-weight: 700; color: #1d1d1f; }
.view-header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.select-input { padding: 8px 12px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; background: #f5f5f7; color: #1d1d1f; outline: none; }
.select-input:focus { border-color: #007AFF; }
.select-sm { padding: 6px 10px; font-size: 12px; }
.client-search-input { width: 180px; }

.text-muted { color: #aeaeb2; font-size: 13px; }
.empty-state { display: flex; align-items: center; justify-content: center; padding: 60px 20px; color: #aeaeb2; font-size: 15px; }

/* ── Client List ── */
.client-list { flex: 1; overflow: hidden; padding: 0; }

/* ── Kanban Board ── */
.kanban-board { display: flex; gap: 10px; height: 100%; overflow-x: auto; padding: 12px; }
.kanban-col { min-width: 260px; max-width: 320px; flex: 1; flex-shrink: 0; display: flex; flex-direction: column; background: #fafafc; border-radius: 12px; border: 1px solid #ececf1; overflow: hidden; }
.kanban-col-header { padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #ececf1; background: #fafafc; flex-shrink: 0; }
.kanban-col-stripe { display: inline-block; width: 4px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.kanban-col-title { font-size: 12px; font-weight: 700; color: #1d1d1f; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.kanban-col-body { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.kanban-card { background: #ffffff; border: 1px solid #ececf1; border-radius: 8px; padding: 10px; cursor: pointer; transition: all 0.15s; }
.kanban-card:hover { border-color: #007AFF; background: #f5f5f7; }
.kanban-card-name { font-size: 13px; font-weight: 600; color: #1d1d1f; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-card-tss { font-size: 11px; color: #86868b; margin-bottom: 4px; }
.kanban-card-task { font-size: 11px; color: #aeaeb2; margin-bottom: 4px; padding: 2px 6px; background: rgba(0,122,255,0.10); border: 1px solid rgba(0,122,255,0.25); border-radius: 4px; display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-card-footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban-card-docs { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: #86868b; margin-bottom: 4px; }
.kanban-card-doc { white-space: nowrap; }
.doc-status-text { font-weight: 600; }
.doc-status-text.doc-pass { color: #34c759; }
.doc-status-text.doc-pending { color: #ff9500; }
.doc-status-text.doc-fail { color: #ff3b30; }
.doc-status-text.doc-none { color: #86868b; }
.kanban-empty { color: #d2d2d7; font-size: 12px; text-align: center; padding: 16px 0; }

/* Tester Status chip — color-coded so admins can scan the board */
.status-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; margin-bottom: 4px; }
.status-chip-on-hold { background: rgba(255,159,10,0.18); color: #ff9500; border: 1px solid rgba(255,159,10,0.45); }
.status-chip-stuck { background: rgba(255,69,58,0.18); color: #ff3b30; border: 1px solid rgba(255,69,58,0.45); }
.status-chip-ready { background: rgba(48,209,88,0.18); color: #34c759; border: 1px solid rgba(48,209,88,0.45); }
.status-chip-in-progress { background: rgba(10,132,255,0.18); color: #007AFF; border: 1px solid rgba(10,132,255,0.45); }
.status-chip-done { background: rgba(48,209,88,0.25); color: #34c759; border: 1px solid rgba(48,209,88,0.55); }
.status-chip-terminated { background: rgba(157,80,221,0.18); color: #7c3aed; border: 1px solid rgba(157,80,221,0.45); }
.status-chip-no-show { background: rgba(142,142,147,0.18); color: #86868b; border: 1px solid rgba(142,142,147,0.45); }

/* Legacy client card styles (used in admin) */
.client-card { background: #fafafc; border: 1px solid #ececf1; border-radius: 12px; padding: 16px; cursor: pointer; transition: all 0.15s; }
.client-card:hover { border-color: #007AFF; background: #f0f0f2; }
.client-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.client-card-name { font-size: 16px; font-weight: 600; color: #1d1d1f; }
.client-card-tss { font-size: 12px; color: #86868b; }
.client-card-progress { display: flex; align-items: center; gap: 12px; }
.client-card-stage { font-size: 13px; color: #aeaeb2; }
.progress-bar { flex: 1; height: 6px; background: #f5f5f7; border-radius: 3px; overflow: hidden; max-width: 200px; }
.progress-fill { height: 100%; background: #007AFF; border-radius: 3px; transition: width 0.3s; }
.client-card-meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-blue { background: rgba(0,122,255,0.2); color: #007AFF; }
.badge-green { background: rgba(52,199,89,0.2); color: #34c759; }
.badge-orange { background: rgba(255,159,10,0.2); color: #ff9500; }
.badge-red { background: rgba(255,69,58,0.2); color: #ff3b30; }
.badge-gray { background: rgba(142,142,147,0.2); color: #86868b; }

.timer-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer-running { background: rgba(52,199,89,0.15); color: #34c759; animation: pulse-glow 2s ease-in-out infinite; }
.timer-paused { background: rgba(255,159,10,0.15); color: #ff9500; }
.timer-over { background: rgba(255,69,58,0.15); color: #ff3b30; }

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Client Detail ── */
.btn-icon { background: none; border: none; color: #007AFF; font-size: 20px; cursor: pointer; padding: 4px 8px; }
.btn-icon:hover { color: #0066d6; }

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

/* Stage Stepper */
.stage-stepper { display: flex; flex-direction: column; gap: 0; }
.stage-step { display: flex; gap: 16px; position: relative; }
.stage-step:not(:last-child) { padding-bottom: 0; }
.stage-step:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: #ececf1; }
.stage-step.completed:not(:last-child)::before { background: #34c759; }

.stage-dot-wrap { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; z-index: 1; }
.stage-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.stage-dot.pending { background: #f5f5f7; color: #86868b; border: 2px solid #d2d2d7; }
.stage-dot.in_progress { background: #007AFF; color: #fff; }
.stage-dot.completed { background: #34c759; color: #fff; }
.stage-dot.waiting { background: #ff9500; color: #fff; }

.stage-body { flex: 1; padding-bottom: 20px; min-width: 0; }
.stage-header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; cursor: pointer; }
.stage-title { font-size: 15px; font-weight: 600; color: #1d1d1f; }
.stage-title.muted { color: #86868b; }
.stage-time-info { font-size: 12px; color: #86868b; margin-left: auto; display: flex; align-items: center; gap: 8px; }

.stage-expanded { background: #fafafc; border: 1px solid #ececf1; border-radius: 12px; padding: 16px; margin-top: 8px; }

/* Timer Display */
.timer-display { display: flex; align-items: center; gap: 16px; padding: 16px; background: #ffffff; border-radius: 10px; margin-bottom: 16px; }
.timer-clock { font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.timer-clock.green { color: #34c759; }
.timer-clock.yellow { color: #ff9500; }
.timer-clock.red { color: #ff3b30; }
.timer-target { font-size: 13px; color: #86868b; }
.timer-actions { margin-left: auto; display: flex; gap: 8px; }

.btn { padding: 8px 16px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.btn-green { background: #34c759; color: #fff; }
.btn-green:hover { background: #34c759; }
.btn-orange { background: #ff9500; color: #fff; }
.btn-orange:hover { background: #856404; }
.btn-blue { background: #007AFF; color: #fff; }
.btn-blue:hover { background: #0066d6; }
.btn-red { background: #ff3b30; color: #fff; }
.btn-red:hover { background: #ff3b30; }
.btn-outline { background: transparent; border: 1px solid #d2d2d7; color: #1d1d1f; }
.btn-outline:hover { background: #f5f5f7; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Instructions */
.instructions-panel { background: #ffffff; border-radius: 10px; padding: 16px; margin-bottom: 16px; max-height: 400px; overflow-y: auto; }
.instructions-panel h4 { font-size: 13px; font-weight: 600; color: #86868b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.instructions-content { font-size: 14px; line-height: 1.7; color: #1d1d1f; }
.instructions-content strong { color: #1d1d1f; }
.instructions-content code { background: #f5f5f7; padding: 2px 6px; border-radius: 4px; font-size: 13px; color: #ff9500; }
.instructions-content ol, .instructions-content ul { padding-left: 20px; }
.instructions-content li { margin-bottom: 6px; }

/* Notes */
.notes-section { margin-top: 16px; }
.notes-textarea { width: 100%; min-height: 80px; padding: 12px; border: 1px solid #d2d2d7; border-radius: 8px; background: #ffffff; color: #1d1d1f; font-size: 14px; font-family: inherit; resize: vertical; outline: none; }
.notes-textarea:focus { border-color: #007AFF; }

/* Wait countdown */
.wait-banner { background: rgba(255,159,10,0.1); border: 1px solid rgba(255,159,10,0.3); border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.wait-banner-icon { font-size: 20px; }
.wait-banner-text { font-size: 14px; color: #ff9500; }

/* ── Admin ── */
.admin-tabs { display: flex; gap: 4px; margin-left: auto; }
.admin-tab { padding: 6px 14px; border: 1px solid #d2d2d7; border-radius: 8px; background: transparent; color: #86868b; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.admin-tab:hover { background: #f5f5f7; color: #1d1d1f; }
.admin-tab.active { background: #007AFF; color: #fff; border-color: #007AFF; }

.admin-content { flex: 1; overflow-y: auto; padding: 20px 24px; }
.admin-section { display: none; }
.admin-section.active { display: block; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600; color: #86868b; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #ececf1; }
.data-table td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid #fafafc; color: #1d1d1f; }
.data-table tr:hover td { background: #fafafc; }

/* Forms */
.form-row { display: flex; gap: 12px; align-items: end; margin-bottom: 16px; }
.form-row .form-group { flex: 1; margin-bottom: 0; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: #86868b; margin-bottom: 6px; }

/* Card panels */
.panel { background: #fafafc; border: 1px solid #ececf1; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.panel-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #1d1d1f; }

/* Variance colors */
.var-green { color: #34c759; }
.var-yellow { color: #ff9500; }
.var-red { color: #ff3b30; }

/* ── Modal ── */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: #fafafc; border: 1px solid #d2d2d7; border-radius: 16px; padding: 24px; min-width: 400px; max-width: 500px; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.modal-large { min-width: 600px; max-width: 90vw; }

/* ── Intake Board Groups ── */
.intake-board-group { margin-bottom: 4px; }
.intake-group-header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; border-radius: 8px; transition: background 0.15s; user-select: none; }
.intake-group-header:hover { background: #fafafc; }
.intake-group-color { width: 4px; height: 20px; border-radius: 2px; flex-shrink: 0; }
.intake-group-label { font-size: 13px; font-weight: 700; color: #1d1d1f; text-transform: uppercase; letter-spacing: 0.3px; }
.intake-group-count { font-size: 12px; font-weight: 600; color: #86868b; background: #f5f5f7; padding: 1px 8px; border-radius: 10px; min-width: 22px; text-align: center; }
.intake-group-chevron { font-size: 14px; color: #86868b; margin-left: auto; transition: transform 0.2s; }
.intake-group-chevron.collapsed { transform: rotate(-90deg); }
.intake-group-body { padding: 0 0 4px 14px; display: flex; flex-direction: column; gap: 6px; }
.intake-group-body.collapsed { display: none; }
.intake-group-empty { color: #d2d2d7; font-size: 12px; padding: 8px 16px; }

/* ── Intake Board Cards ── */
.intake-board-card { background: #fafafc; border: 1px solid #ececf1; border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: all 0.15s; }
.intake-board-card:hover { border-color: #007AFF; background: #f0f0f2; }
.intake-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.intake-card-name { font-size: 14px; font-weight: 600; color: #1d1d1f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intake-card-ghl-link { font-size: 11px; font-weight: 600; color: #007AFF; text-decoration: none; white-space: nowrap; padding: 2px 6px; border-radius: 4px; transition: background 0.15s; }
.intake-card-ghl-link:hover { background: rgba(0,122,255,0.15); }
.intake-doc-boxes { display: flex; gap: 3px; margin-bottom: 6px; flex-wrap: wrap; }
.intake-doc-box { padding: 2px 5px; border-radius: 4px; transition: background 0.2s; cursor: default; font-size: 9px; font-weight: 600; letter-spacing: 0.3px; color: rgba(255,255,255,0.7); text-align: center; line-height: 1.4; }
.intake-doc-box.doc-none { background: #f5f5f7; }
.intake-doc-box.doc-pending { background: #ff9500; }
.intake-doc-box.doc-pass { background: #34c759; }
.intake-doc-box.doc-fail { background: #ff3b30; }
.intake-card-footer { display: flex; align-items: center; justify-content: space-between; }
.intake-card-date { font-size: 11px; color: #86868b; }
.intake-card-note { font-size: 12px; color: #86868b; margin-bottom: 6px; line-height: 1.4; word-break: break-word; white-space: pre-wrap; }

/* ── Intake ── */
.intake-docs-grid { display: flex; flex-direction: column; gap: 12px; }
.intake-doc-card { display: flex; gap: 16px; align-items: center; background: #ffffff; border: 1px solid #ececf1; border-radius: 10px; padding: 12px; }
.intake-doc-preview { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; cursor: pointer; flex-shrink: 0; background: #f5f5f7; display: flex; align-items: center; justify-content: center; }
.intake-doc-preview img { width: 100%; height: 100%; object-fit: cover; }
.intake-doc-pdf { font-size: 14px; font-weight: 700; color: #86868b; }
.intake-doc-info { flex: 1; min-width: 0; }
.intake-doc-type { font-size: 14px; font-weight: 600; color: #1d1d1f; }
.intake-doc-file { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intake-doc-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.intake-preview-container { display: flex; align-items: center; justify-content: center; background: #ffffff; border-radius: 8px; padding: 12px; }

/* ── Review Popup (Full-Screen) ── */
.review-popup-overlay { z-index: 2000; }
.review-popup { width: 96vw; height: 92vh; background: #fafafc; border: 1px solid #d2d2d7; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 16px 60px rgba(0,0,0,0.6); }
.review-popup-header { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid #ececf1; flex-shrink: 0; }
.review-popup-header h3 { font-size: 16px; font-weight: 600; margin: 0; white-space: nowrap; }
.review-popup-nav { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #86868b; }
.review-popup-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.review-popup-body { display: flex; flex: 1; overflow: hidden; }
.review-popup-left { flex: 3; display: flex; flex-direction: column; border-right: 1px solid #ececf1; overflow: hidden; }
.review-popup-right { flex: 2; overflow-y: auto; padding: 16px; }
.review-popup-image-scroll { flex: 1; overflow: auto; background: #ffffff; }
.review-popup-image-stage { display: flex; align-items: center; justify-content: center; min-width: 100%; min-height: 100%; box-sizing: border-box; }
.review-popup-image-scroll img { transition: transform 0.2s; transform-origin: center center; max-width: 100%; max-height: 100%; user-select: none; }
.zoom-controls { display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid #ececf1; flex-shrink: 0; }
.zoom-controls button { padding: 4px 12px; border: 1px solid #d2d2d7; border-radius: 6px; background: transparent; color: #86868b; font-size: 12px; cursor: pointer; }
.zoom-controls button.active { background: #007AFF; color: #fff; border-color: #007AFF; }
.zoom-controls button:hover:not(.active) { background: #f5f5f7; }
.review-popup-instructions { font-size: 13px; line-height: 1.6; color: #1d1d1f; margin-bottom: 20px; }
.review-popup-instructions h4 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.review-popup-instructions ul { padding-left: 18px; margin: 0; }
.review-popup-instructions li { margin-bottom: 4px; }
.review-popup-instructions p { margin: 8px 0; }

/* ── Example Grids ── */
.example-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 16px; }
.example-grid img { width: 100%; border-radius: 6px; cursor: pointer; border: 2px solid transparent; aspect-ratio: 4/3; object-fit: cover; }
.example-grid.good img { border-color: rgba(48,209,88,0.4); }
.example-grid.bad img { border-color: rgba(255,69,58,0.4); }
.example-grid img:hover { opacity: 0.8; transform: scale(1.02); transition: all 0.15s; }

/* ── Reviewer Checklist Panel ── */
.review-checklist { display: flex; flex-direction: column; gap: 12px; }
.review-checklist-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: #ffffff; border-radius: 10px; border: 1px solid #ececf1; }
.review-checklist-item > input[type="checkbox"] { margin-top: 3px; accent-color: #34c759; width: 18px; height: 18px; flex-shrink: 0; }
.review-checklist-item strong { font-size: 14px; display: block; margin-bottom: 2px; }
.review-checklist-item .fields { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.review-checklist-item .fields input[type="text"],
.review-checklist-item .fields input[type="date"],
.review-checklist-item .fields select {
    padding: 6px 10px; border: 1px solid #d2d2d7; border-radius: 8px; background: #fafafc; color: #1d1d1f; font-size: 13px; outline: none;
}
.review-checklist-item .fields input:focus,
.review-checklist-item .fields select:focus { border-color: #007AFF; }
.review-checklist-item .fields label { font-size: 13px; color: #1d1d1f; }

/* Popup task fields inside review popup right panel */
.popup-task-section { margin-top: 20px; border-top: 1px solid #d2d2d7; padding-top: 8px; }
.popup-task-group { margin-bottom: 12px; padding: 10px; background: #ffffff; border-radius: 8px; border: 1px solid #ececf1; }
.popup-task-label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 4px; }
.popup-task-label input[type="checkbox"] { accent-color: #34c759; width: 16px; height: 16px; flex-shrink: 0; }
.popup-task-fields { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.popup-task-fields input[type="text"],
.popup-task-fields input[type="date"],
.popup-task-fields select { padding: 6px 10px; background: #fafafc; border: 1px solid #d2d2d7; border-radius: 6px; color: #1d1d1f; font-size: 13px; }
.popup-task-fields input:focus,
.popup-task-fields select:focus { border-color: #007AFF; outline: none; }

/* Intake-list filter chip: "ID Mismatch" toggle next to the search input. */
.intake-filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #d2d2d7; border-radius: 999px; background: #fafafc; color: #1d1d1f; font-size: 12px; cursor: pointer; user-select: none; }
.intake-filter-chip input[type="checkbox"] { accent-color: #007AFF; width: 14px; height: 14px; margin: 0; }
.intake-filter-chip:hover { border-color: #007AFF; }
.intake-filter-chip.active { background: rgba(10,132,255,0.15); border-color: #007AFF; color: #007AFF; }
.intake-filter-chip-count { font-weight: 600; padding: 1px 6px; border-radius: 10px; background: rgba(0,0,0,0.05); font-size: 11px; min-width: 18px; text-align: center; }
.intake-filter-chip.active .intake-filter-chip-count { background: rgba(10,132,255,0.25); color: #007AFF; }

/* AI-suggested field badges inside review popup. Hidden until populated by
   POST /api/intake/submissions/{sub_id}/ai-analysis. flex-basis:100% forces
   the badge onto its own line below its sibling input within
   .popup-task-fields' flex-wrap layout. */
.popup-task-fields .ai-badge { display: none; flex-basis: 100%; align-items: center; gap: 6px; font-size: 11px; color: #007AFF; margin-top: 2px; }
.popup-task-fields .ai-badge.has-value { display: flex; }
.popup-task-fields .ai-badge .ai-value { font-weight: 600; word-break: break-word; }
.popup-task-fields .ai-badge .ai-use-btn { padding: 2px 8px; font-size: 11px; background: transparent; border: 1px solid #007AFF; color: #007AFF; border-radius: 4px; cursor: pointer; }
.popup-task-fields .ai-badge .ai-use-btn:hover { background: rgba(10,132,255,0.15); }

/* Address autocomplete search */
.addr-search-wrap { position: relative; width: 100%; margin-bottom: 4px; }
.addr-search-wrap input { width: 100%; padding: 6px 10px 6px 30px; background: #fafafc; border: 1px solid #d2d2d7; border-radius: 6px; color: #1d1d1f; font-size: 13px; }
.addr-search-wrap input:focus { border-color: #007AFF; outline: none; }
.addr-search-wrap input::placeholder { color: #86868b; }
.addr-search-icon { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: #86868b; pointer-events: none; display: flex; }
.addr-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 100; background: #fafafc; border: 1px solid #d2d2d7; border-top: none; border-radius: 0 0 6px 6px; max-height: 200px; overflow-y: auto; display: none; }
.addr-results.visible { display: block; }
.addr-result-item { padding: 8px 10px; font-size: 13px; color: #1d1d1f; cursor: pointer; border-bottom: 1px solid #ececf1; }
.addr-result-item:last-child { border-bottom: none; }
.addr-result-item:hover { background: rgba(0,122,255,0.15); }
.addr-result-sub { font-size: 11px; color: #86868b; margin-top: 1px; }

/* Preview badges next to checklist items */
.rd-field-preview { font-size: 12px; color: #34c759; font-weight: 500; }

/* ── Contact Info Panel ── */
.contact-fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px; }
.contact-field { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: #ffffff; border-radius: 8px; cursor: pointer; transition: background 0.15s; }
.contact-field:hover { background: #f5f5f7; }
.contact-field-label { font-size: 11px; font-weight: 600; color: #86868b; text-transform: uppercase; letter-spacing: 0.3px; }
.contact-field-value { font-size: 14px; color: #1d1d1f; min-height: 20px; }
.contact-field-input { width: 100%; padding: 6px 8px; background: #fafafc; border: 1px solid #007AFF; border-radius: 6px; color: #1d1d1f; font-size: 14px; outline: none; }
.contact-edit-bar { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid #ececf1; }

/* ── Intake Messaging Panel ── */
.intake-msg-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 900; }
.intake-msg-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 90vw; background: #fafafc; border-left: 1px solid #ececf1; z-index: 950; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s ease; box-shadow: -4px 0 24px rgba(0,0,0,0.3); }
.intake-msg-panel.open { transform: translateX(0); }
.intake-msg-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #ececf1; flex-shrink: 0; }
.intake-msg-tabs { display: flex; gap: 2px; }
.intake-msg-tab { padding: 4px 10px; border: 1px solid #d2d2d7; border-radius: 6px; background: transparent; color: #86868b; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.intake-msg-tab:hover { background: #f5f5f7; color: #1d1d1f; }
.intake-msg-tab.active { background: #007AFF; color: #fff; border-color: #007AFF; }
.intake-msg-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.intake-msg-bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.intake-msg-bubble.outbound { align-self: flex-end; background: #007AFF; color: #fff; border-bottom-right-radius: 4px; }
.intake-msg-bubble.inbound { align-self: flex-start; background: #f5f5f7; color: #1d1d1f; border-bottom-left-radius: 4px; }
.intake-msg-body { white-space: pre-wrap; }
.intake-msg-body a { color: inherit; text-decoration: underline; }
.intake-msg-meta { font-size: 10px; opacity: 0.7; margin-top: 4px; }
.intake-msg-compose { padding: 12px 16px; border-top: 1px solid #ececf1; flex-shrink: 0; }
.intake-msg-compose-toggle { display: flex; gap: 4px; margin-bottom: 8px; }
.intake-msg-ch { padding: 4px 12px; border: 1px solid #d2d2d7; border-radius: 6px; background: transparent; color: #86868b; font-size: 12px; font-weight: 600; cursor: pointer; }
.intake-msg-ch:hover { background: #f5f5f7; }
.intake-msg-ch.active { background: #007AFF; color: #fff; border-color: #007AFF; }

/* Popup sub-tabs for paired docs (selfie/POA) */
.popup-subtabs { display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid #ececf1; }
.popup-subtab { padding: 6px 16px; border-radius: 8px; border: 1px solid #d2d2d7; background: transparent; color: #86868b; font-size: 13px; font-weight: 600; cursor: pointer; position: relative; transition: all 0.15s; }
.popup-subtab:hover { background: #f5f5f7; color: #1d1d1f; }
.popup-subtab.active { background: #007AFF; color: #fff; border-color: #007AFF; }
.popup-subtab .reviewed-dot { width: 8px; height: 8px; border-radius: 50%; position: absolute; top: -2px; right: -2px; }
.popup-subtab .reviewed-dot.done { background: #34c759; }
.popup-subtab .reviewed-dot.pending { background: #86868b; }

/* Quality checklist in review popup */
.quality-checklist { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #ececf1; }
.quality-checklist h5 { margin-bottom: 4px; }

/* Negative-flag quality check items */
.qc-flag-item { border-radius: 8px; transition: background 0.15s; }
.qc-flag-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #1d1d1f; cursor: pointer; padding: 7px 10px; border-radius: 8px; transition: background 0.1s; user-select: none; }
.qc-flag-label:hover { background: rgba(0,0,0,0.03); }
.qc-flag-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 13px; font-weight: 700; flex-shrink: 0; background: rgba(48,209,88,0.15); color: #34c759; transition: all 0.15s; }
.qc-flag-icon.flagged { background: rgba(255,69,58,0.2); color: #ff3b30; }
.qc-flag-text { font-size: 13px; }
.qc-flag-text.flagged { color: #ff3b30; text-decoration: line-through; }
.qc-flag-note { max-height: 0; overflow: hidden; transition: max-height 0.2s ease, padding 0.2s ease; padding: 0 10px; }
.qc-flag-note.visible { max-height: 60px; padding: 0 10px 8px 40px; }
.qc-note-input { width: 100%; padding: 6px 10px; background: #ffffff; border: 1px solid #ff3b30; border-radius: 6px; color: #1d1d1f; font-size: 12px; outline: none; }
.qc-note-input:focus { border-color: #ff3b30; }

/* Flagged issues list on document cards */
.flagged-issues-list { margin: 6px 0 0 0; padding: 0; list-style: none; }
.flagged-issues-list li { font-size: 11px; padding: 2px 0; color: #ff3b30; }
.flagged-issue-name { font-weight: 600; }
.flagged-issue-note { color: #aeaeb2; font-style: italic; }

/* Previous review context for resubmitted docs */
.prev-review-context { margin-top: 8px; padding: 8px 10px; background: rgba(255,159,10,0.08); border: 1px solid rgba(255,159,10,0.2); border-radius: 6px; }
.prev-review-label { font-size: 11px; font-weight: 600; color: #ff9500; margin-bottom: 2px; }
.prev-review-context .flagged-issues-list { margin-top: 2px; }
.prev-review-context .flagged-issues-list li { color: #aeaeb2; }
.prev-review-context .flagged-issue-name { color: #aeaeb2; font-weight: 500; }

/* Legacy (kept for backward compat) */
.quality-check-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #1d1d1f; cursor: pointer; padding: 5px 8px; border-radius: 6px; transition: background 0.1s; }
.quality-check-item:hover { background: rgba(0,0,0,0.03); }
.quality-check-item input[type="checkbox"] { accent-color: #34c759; width: 16px; height: 16px; flex-shrink: 0; }
.quality-notes { width: 100%; min-height: 48px; padding: 10px 12px; background: #ffffff; border: 1px solid #d2d2d7; border-radius: 8px; color: #1d1d1f; font-size: 13px; font-family: inherit; resize: vertical; outline: none; }
.quality-notes:focus { border-color: #007AFF; }

/* Quality summary badges on document cards */
.quality-summary { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; text-align: center; }
.quality-summary.quality-pass { background: rgba(48,209,88,0.15); color: #34c759; }
.quality-summary.quality-fail { background: rgba(255,69,58,0.15); color: #ff3b30; }
.quality-summary.quality-pending { background: rgba(142,142,147,0.15); color: #86868b; }

/* Bank status badges */
.bank-status-badge { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.bank-status-badge.optimal { background: rgba(48,209,88,0.15); color: #34c759; }
.bank-status-badge.sub-optimal { background: rgba(255,159,10,0.15); color: #ff9500; }
.bank-status-badge.not-optimal { background: rgba(255,69,58,0.15); color: #ff3b30; }
.bank-status-badge.tbd { background: rgba(142,142,147,0.15); color: #86868b; }
.bank-notes { font-size: 12px; color: #ff9500; margin-top: 4px; font-style: italic; }

/* Complete button in review popup */
.popup-complete-btn { margin-top: 16px; padding: 10px 20px; background: #34c759; color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; transition: all 0.15s; }
.popup-complete-btn:hover { background: #34c759; }
.popup-complete-btn:disabled { background: #d2d2d7; color: #86868b; cursor: not-allowed; }

/* ── Tech Setup v2 (3-column client detail) ── */
.view.client-detail-v2 {
    display: none;
    grid-template-columns: 240px 1fr 340px;
    height: 100%;
    overflow: hidden;
}
.view.client-detail-v2.active { display: grid; }
.cd-col { height: 100%; overflow-y: auto; background: #ffffff; }
.cd-col-left { border-right: 1px solid #ececf1; background: #fafafc; display: flex; flex-direction: column; }
.cd-col-center { display: flex; flex-direction: column; min-width: 0; }
.cd-col-right { border-left: 1px solid #ececf1; background: #fafafc; display: flex; flex-direction: column; }
.cd-col-header { padding: 14px 16px; font-weight: 600; font-size: 13px; color: #1d1d1f; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #ececf1; background: #fafafc; position: sticky; top: 0; z-index: 2; }
.cd-col-header .btn-icon { font-size: 18px; padding: 2px 8px; }

/* Left column: mini client list */
.cd-list-search { margin: 10px 16px; width: calc(100% - 32px); }
.cd-client-mini-list { flex: 1; overflow-y: auto; padding: 0 8px 16px; }
.cd-mini-row { padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background 0.15s; }
.cd-mini-row:hover { background: #f5f5f7; }
.cd-mini-row.active { background: #007AFF; color: #fff; }
.cd-mini-row.active .text-muted, .cd-mini-row.active .cd-mini-sub { color: rgba(255,255,255,0.7); }
.cd-mini-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-mini-sub { font-size: 11px; margin-top: 2px; }

/* Center column */
.cd-stage-header { padding: 16px 24px 8px; border-bottom: 1px solid #ececf1; background: #fafafc; flex-shrink: 0; }
.cd-stage-header h2 { font-size: 20px; font-weight: 700; color: #1d1d1f; margin: 0; }
.cd-eta { margin-top: 4px; font-size: 12px; color: #ff9500; font-weight: 500; }

.cd-stage-stepper { display: flex; gap: 6px; padding: 14px 24px; background: #fafafc; overflow-x: auto; border-bottom: 1px solid #ececf1; flex-shrink: 0; }
.cd-stage-pill { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid #d2d2d7; background: #f5f5f7; color: #1d1d1f; font-size: 12px; cursor: pointer; transition: all 0.15s; font-weight: 500; }
.cd-stage-pill:hover { background: #d2d2d7; }
.cd-stage-pill.active { background: #007AFF; color: #fff; border-color: #007AFF; }
.cd-stage-pill.status-completed { background: rgba(48,209,88,0.15); color: #34c759; border-color: rgba(48,209,88,0.3); }
.cd-stage-pill.status-completed.active { background: #34c759; color: #fff; border-color: #34c759; }
.cd-stage-pill.status-in_progress { background: rgba(10,132,255,0.15); color: #007AFF; border-color: rgba(10,132,255,0.3); }
.cd-stage-pill.status-in_progress.active { background: #007AFF; color: #fff; border-color: #007AFF; }
.cd-stage-pill.terminal { opacity: 0.7; }
.cd-pill-idx { font-weight: 700; font-size: 11px; opacity: 0.7; }
.cd-pill-name { font-weight: 600; }

.cd-stage-panel { flex: 1; overflow-y: auto; padding: 20px 24px; }

.cd-group-header { margin-bottom: 14px; }
.cd-group-title { font-size: 16px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.cd-group-meta { margin-top: 4px; font-size: 12px; }

/* Subitem card */
.cd-subitem-card { background: #fafafc; border: 1px solid #ececf1; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.cd-subitem-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cd-subitem-title { font-size: 14px; font-weight: 600; color: #1d1d1f; }
.cd-subitem-status { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; background: rgba(142,142,147,0.15); color: #86868b; }
.cd-subitem-status.status-ready { background: rgba(142,142,147,0.2); color: #1d1d1f; }
.cd-subitem-status.status-in-progress { background: rgba(10,132,255,0.2); color: #007AFF; }
.cd-subitem-status.status-done { background: rgba(48,209,88,0.2); color: #34c759; }
.cd-subitem-status.status-stuck { background: rgba(255,69,58,0.2); color: #ff3b30; }
.cd-subitem-body { display: flex; flex-direction: column; gap: 10px; }
.cd-subitem-row { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 10px; }
.cd-subitem-row label { font-size: 12px; color: #86868b; }
.cd-subitem-textarea { width: 100%; padding: 8px 10px; background: #f5f5f7; border: 1px solid #d2d2d7; border-radius: 8px; color: #1d1d1f; font-family: inherit; font-size: 13px; resize: vertical; }
.cd-subitem-textarea:focus { outline: none; border-color: #007AFF; }

/* Substage cards */
.cd-substages { margin-top: 10px; }
.cd-substages-hd { font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; color: #aeaeb2; font-weight: 700; margin-bottom: 8px; }
.cd-substage-card { background: #fafafc; border: 1px solid #ececf1; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.cd-substage-card.status-completed { opacity: 0.75; border-color: rgba(48,209,88,0.2); }
.cd-substage-card.status-in_progress { border-color: rgba(10,132,255,0.3); }
.cd-substage-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cd-substage-num { width: 26px; height: 26px; border-radius: 50%; background: #f5f5f7; color: #1d1d1f; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.cd-substage-card.status-completed .cd-substage-num { background: #34c759; color: #fff; }
.cd-substage-card.status-in_progress .cd-substage-num { background: #007AFF; color: #fff; }
.cd-substage-title { flex: 1; font-size: 13px; font-weight: 600; color: #1d1d1f; }
.cd-substage-badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(142,142,147,0.2); color: #86868b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.cd-substage-badge.status-completed { background: rgba(48,209,88,0.2); color: #34c759; }
.cd-substage-badge.status-in_progress { background: rgba(10,132,255,0.2); color: #007AFF; }
.cd-substage-wait { padding: 6px 10px; background: rgba(255,159,10,0.15); border-radius: 8px; color: #ff9500; font-size: 12px; margin: 8px 0; }
.cd-substage-timer { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.cd-timer-clock { font-family: "SF Mono", Menlo, monospace; font-size: 15px; font-weight: 600; color: #1d1d1f; padding: 4px 10px; background: #f5f5f7; border-radius: 8px; }
.cd-timer-clock.running { color: #34c759; }
.cd-timer-target { color: #86868b; font-size: 11px; margin-left: 4px; }
.cd-substage-btns { margin-left: auto; display: flex; gap: 6px; }
.cd-substage-done { color: #34c759; font-size: 12px; font-weight: 600; }
.cd-substage-instructions { margin-top: 12px; padding-top: 12px; border-top: 1px solid #ececf1; }
.cd-substage-instructions-hd { color: #1d1d1f; font-size: 12px; font-weight: 700; padding: 2px 0 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.cd-substage-instructions .cd-md { padding: 4px 0 0; font-size: 13px; color: #1d1d1f; line-height: 1.6; }
.cd-substage-instructions .cd-md strong { color: #1d1d1f; }
.cd-substage-instructions .cd-md ol, .cd-substage-instructions .cd-md ul { padding-left: 20px; margin: 6px 0; }
.cd-substage-instructions .cd-md li { margin: 4px 0; }
.cd-substage-instructions .cd-md p { margin: 6px 0; }
.cd-substage-instructions .cd-md code { background: #f5f5f7; padding: 1px 5px; border-radius: 4px; font-size: 12px; color: #ff9500; }

/* Hyperlinks in the Tech Setup detail view — bright cyan for legibility on the
   dark cards. These anchors (markdown instruction links, the "Open in GHL"
   header link, read-only link fields, and the "open ↗" buttons next to URL
   inputs) set no color of their own, so without this they fell back to the
   browser-default dark blue, which was nearly invisible on the dark theme. */
.client-detail-v2 a { color: #007AFF; }
.client-detail-v2 a:hover { color: #007AFF; }

.cd-substage-notes { margin-top: 8px; }
.cd-substage-notes label { font-size: 12px; color: #aeaeb2; font-weight: 600; display: block; margin-bottom: 4px; }
.cd-substage-notes textarea { width: 100%; padding: 6px 10px; background: #f5f5f7; border: 1px solid #d2d2d7; border-radius: 8px; color: #1d1d1f; font-family: inherit; font-size: 12px; resize: vertical; }
.cd-substage-notes textarea:focus { outline: none; border-color: #007AFF; }

.cd-group-actions { margin-top: 16px; padding-top: 12px; border-top: 1px solid #ececf1; display: flex; gap: 10px; }
.cd-group-admin-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

/* Right column: fields sidebar */
.cd-sync-summary { margin-left: auto; font-size: 11px; color: #86868b; font-weight: 500; }
.cd-sync-summary.has-pending { color: #007AFF; }
.cd-sync-summary.has-error { color: #ff3b30; }
.cd-fields-sidebar { flex: 1; overflow-y: auto; padding: 8px 0 40px; }
.cd-field-section { border-bottom: 2px solid #ececf1; margin-bottom: 6px; border-left: 3px solid transparent; }
.cd-field-section[open] .cd-field-section-hd { color: #1d1d1f; }
/* Per-category left-border colors so the sidebar reads as distinct workflow
 * stages instead of one flat list. Colors track the workflow group palette in
 * tech_setup_schema.GROUPS — Banking is the Bank Link group's orange,
 * Credentials/Device are the Device Setup green, etc. */
.cd-field-section[data-category="Identity"] { border-left-color: #86868b; }
.cd-field-section[data-category="Personal"] { border-left-color: #86868b; }
.cd-field-section[data-category="Address"] { border-left-color: #86868b; }
.cd-field-section[data-category="Credentials"] { border-left-color: #2e7d32; }
.cd-field-section[data-category="Device"] { border-left-color: #2e7d32; }
.cd-field-section[data-category="Banking"] { border-left-color: #ff9500; }
.cd-field-section[data-category="Casino"] { border-left-color: #ff9500; }
.cd-field-section[data-category="Assignment"] { border-left-color: #007AFF; }
.cd-field-section[data-category="Status"] { border-left-color: #ff9500; }
.cd-field-section[data-category="Dates"] { border-left-color: #7c3aed; }
.cd-field-section[data-category="TimeTracking"] { border-left-color: #7c3aed; }
.cd-field-section[data-category="Notes"] { border-left-color: #7c3aed; }
.cd-field-section[data-category="Admin"] { border-left-color: #7c3aed; }
.cd-field-section-hd { padding: 10px 16px; cursor: pointer; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; color: #86868b; display: flex; align-items: center; justify-content: space-between; list-style: none; }
.cd-field-section-hd::-webkit-details-marker { display: none; }
.cd-field-section-hd::before { content: "\25b8"; margin-right: 6px; font-size: 10px; transition: transform 0.15s; display: inline-block; }
.cd-field-section[open] .cd-field-section-hd::before { transform: rotate(90deg); }
.cd-field-section-count { font-size: 11px; color: #d2d2d7; font-weight: 600; }
.cd-field-section-body { padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.cd-field-row { display: flex; flex-direction: column; gap: 4px; transition: background 0.3s ease; border-radius: 6px; padding: 2px 0; }
.cd-field-row.cd-field-flash { background: rgba(255,69,58,0.18); box-shadow: 0 0 0 1px rgba(255,69,58,0.55); }
.cd-field-label { font-size: 12px; color: #aeaeb2; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cd-field-required-mark { color: #ff3b30; font-weight: 700; margin-left: -2px; }
.cd-sync-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #d2d2d7; }
.cd-sync-dot.idle { background: #d2d2d7; }
.cd-sync-dot.pending { background: #007AFF; animation: cd-pulse 1s ease-in-out infinite; }
.cd-sync-dot.synced { background: #34c759; }
.cd-sync-dot.error { background: #ff3b30; }
@keyframes cd-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }
.cd-field-input { display: flex; }
.cd-field-input > * { flex: 1; }
.cd-field-input .select-input { width: 100%; padding: 6px 10px; font-size: 12px; }
.cd-field-textarea { width: 100%; padding: 6px 10px; background: #f5f5f7; border: 1px solid #d2d2d7; border-radius: 8px; color: #1d1d1f; font-family: inherit; font-size: 12px; resize: vertical; }
.cd-field-textarea:focus { outline: none; border-color: #007AFF; }
.cd-field-readonly { padding: 6px 10px; background: #fafafc; border: 1px solid #ececf1; border-radius: 8px; color: #aeaeb2; font-size: 12px; min-height: 28px; }

/* Client Rating — multi-category star form (type: client_rating) */
.cd-field-rating { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.cd-rating-category { padding-bottom: 12px; border-bottom: 1px solid #ececf1; }
.cd-rating-category:last-child { padding-bottom: 0; border-bottom: none; }
.cd-rating-title { font-size: 13px; font-weight: 600; color: #1d1d1f; }
.cd-rating-desc { font-size: 11px; color: #86868b; margin: 2px 0 6px; }
.cd-star-picker { display: flex; gap: 4px; }
.cd-star-picker .cd-star { font-size: 22px; line-height: 1; color: #d2d2d7; cursor: pointer; user-select: none; transition: color 0.1s; }
.cd-star-picker .cd-star.filled { color: #ff9500; }
.cd-star-picker .cd-star:hover { color: #ff9500; }
.cd-rating-comment { margin-top: 6px; }
.cd-rating-comment textarea { width: 100%; padding: 6px 10px; background: #f5f5f7; border: 1px solid #d2d2d7; border-radius: 8px; color: #1d1d1f; font-family: inherit; font-size: 12px; resize: vertical; outline: none; }
.cd-rating-comment textarea:focus { border-color: #007AFF; }

.btn { padding: 8px 16px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; color: #fff; }
.btn:hover { opacity: 0.9; }
.btn:disabled { background: #d2d2d7 !important; color: #86868b !important; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-blue { background: #007AFF; }
.btn-green { background: #34c759; }
.btn-yellow { background: #ff9500; }
.btn-red { background: #ff3b30; }

/* ── Tech Setup v3 (global action bar + inline fields) ── */

/* Per-substage progress bar */
.cd-progress-mini-wrap { margin-bottom: 14px; }
.cd-progress-mini { height: 4px; background: #ececf1; border-radius: 2px; overflow: hidden; }
.cd-progress-mini-fill { height: 100%; background: #34c759; transition: width 0.3s ease; }
.cd-progress-mini-text { font-size: 12px; color: #aeaeb2; margin-top: 6px; font-weight: 500; }

/* Sticky action bar */
.cd-action-bar { position: sticky; top: 0; z-index: 3; background: #ffffff;
    border-bottom: 1px solid #ececf1; padding: 12px 0; margin-bottom: 14px;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cd-action-bar-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cd-action-bar-status { margin-left: auto; font-size: 13px; color: #aeaeb2;
    font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; font-weight: 500; }
.cd-action-bar-label { color: #1d1d1f; font-weight: 600; }
.cd-timer-clock.action-bar { font-size: 14px; padding: 4px 10px; }
.cd-timer-clock.paused { color: #ff9500; }

/* Substage card states */
.cd-substage-card.is-active { border: 2px solid #007AFF;
    box-shadow: 0 0 12px rgba(0,122,255,0.15); }
.cd-substage-card.is-paused { border-color: rgba(255,159,10,0.5); }
.cd-substage-card.is-future { opacity: 0.78; }
.cd-substage-card.is-future input,
.cd-substage-card.is-future select,
.cd-substage-card.is-future textarea,
.cd-substage-card.is-future button { pointer-events: none; }
.cd-substage-card.is-completed { padding: 8px 14px; opacity: 0.75; }
.cd-substage-card.is-completed .cd-substage-timer,
.cd-substage-card.is-completed .cd-substage-instructions,
.cd-substage-card.is-completed .cd-substage-notes,
.cd-substage-card.is-completed .cd-substage-inline-fields,
.cd-substage-card.is-completed .cd-substage-wait { display: none; }
.cd-substage-card.is-completed .cd-substage-hd { margin-bottom: 0; }
.cd-substage-elapsed { font-size: 11px; font-variant-numeric: tabular-nums; margin-left: auto; padding: 2px 8px;
    background: rgba(48,209,88,0.12); color: #34c759; border-radius: 999px; }

/* Inline fields inside a substage card */
.cd-substage-inline-fields { display: grid;
    grid-template-columns: minmax(140px, auto) 1fr; gap: 8px 12px;
    margin-top: 12px; padding: 12px; background: #ffffff; border-radius: 8px;
    border: 1px solid #ececf1; }
.cd-substage-inline-fields .cd-field-row { display: contents; }
.cd-substage-inline-fields .cd-field-label { font-size: 12px; align-self: center;
    color: #aeaeb2; flex-direction: row; gap: 6px; }
.cd-substage-inline-fields .cd-field-input { display: flex; }
.cd-substage-inline-fields .cd-field-input > * { flex: 1; width: 100%; }
.cd-substage-inline-fields .cd-field-readonly { font-size: 12px; }

/* Email aggregator connection check (Final Verification / "Set up Laptop") */
.cd-substage-card.is-completed .cd-aggregator-panel { display: none; }
.cd-aggregator-panel { margin-top: 12px; padding: 12px; background: #ffffff;
    border: 1px solid #ececf1; border-radius: 8px; }
.cd-aggregator-hd { color: #1d1d1f; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; }
.cd-aggregator-actions { margin-top: 10px; }
.cd-aggregator-btn { background: #007AFF; color: #fff; border: none; }
.cd-aggregator-btn:hover:not(:disabled) { background: #0066d6; }
.cd-aggregator-btn:disabled { background: #d2d2d7; cursor: not-allowed; }
.cd-aggregator-badge { margin-top: 10px; display: inline-block; font-size: 13px;
    font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.cd-aggregator-badge.is-ok { background: rgba(48,209,88,0.12); color: #34c759; }
.cd-aggregator-badge.is-warn { background: rgba(255,69,58,0.12); color: #ff3b30; }
.cd-aggregator-badge.is-error { background: rgba(255,159,10,0.12); color: #ff9500; }
.cd-aggregator-meta { margin-top: 6px; font-size: 12px; }

/* Toast (wait-gate notification) — multiple toasts stack vertically */
.cd-toast { position: fixed; left: 50%; transform: translateX(-50%);
    background: #fafafc; color: #1d1d1f; border: 1px solid #ff9500;
    padding: 12px 20px; border-radius: 10px; font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 5000; max-width: 480px;
    transition: opacity 0.4s ease; }
.cd-toast { bottom: 24px; }
.cd-toast ~ .cd-toast { bottom: 80px; }
.cd-toast ~ .cd-toast ~ .cd-toast { bottom: 136px; }
.cd-toast.cd-toast-fade { opacity: 0; }

/* Persistent wait-gate banner under the action bar */
.cd-wait-banner { padding: 12px 16px; background: rgba(255,159,10,0.12);
    border: 1px solid rgba(255,159,10,0.35); border-radius: 10px;
    color: #ff9500; font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cd-wait-banner-icon { font-size: 18px; }

/* Cross-group running-timer chip */
.cd-jump-active { display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px;
    background: rgba(48,209,88,0.15); color: #34c759;
    border: 1px solid rgba(48,209,88,0.4); cursor: pointer;
    font-size: 12px; font-weight: 600; margin-bottom: 12px;
    animation: pulse-glow 2s ease-in-out infinite; }
.cd-jump-active:hover { background: rgba(48,209,88,0.25); }

/* Confirm-armed button (Next Step / Complete Group click-to-confirm) */
.btn.btn-armed { background: #ff9500 !important; color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255,159,10,0.25);
    animation: pulse-glow 1s ease-in-out infinite; }

/* ── Tech Setup Editor ── */
.tse-assigned-list { display: flex; flex-direction: column; gap: 6px; }
.tse-field-row { display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; background: #fafafc; border: 1px solid #ececf1;
    border-radius: 8px; }
.tse-field-row.tse-dragging { opacity: 0.4; }
.tse-drag { cursor: grab; user-select: none; color: #86868b;
    font-size: 18px; padding: 0 4px; }
.tse-field-label { flex: 1; display: flex; flex-direction: column;
    gap: 2px; min-width: 0; color: #1d1d1f; font-size: 13px; }
.tse-cat { margin-bottom: 12px; }
.tse-cat-title { font-size: 11px; font-weight: 600; color: #86868b;
    text-transform: uppercase; margin-bottom: 6px; padding: 0 4px; }
.tse-cat-item { display: block; width: 100%; text-align: left;
    padding: 6px 10px; background: #fafafc; border: 1px solid #ececf1;
    border-radius: 6px; color: #1d1d1f; font-size: 12px; cursor: pointer;
    margin-bottom: 4px; }
.tse-cat-item:hover:not(:disabled) { background: #007AFF; border-color: #007AFF; }
.tse-cat-item:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Contact Panel Editor ── */
.cpe-section-card { margin-bottom: 16px; }
.cpe-section-hd { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px;
    border-bottom: 1px solid #fafafc; margin-bottom: 10px; cursor: grab; }
.cpe-section-hd:active { cursor: grabbing; }
.cpe-section-hd input, .cpe-section-hd button, .cpe-section-hd label,
.cpe-section-hd select, .cpe-section-hd textarea { cursor: auto; }
.cpe-section-hd label { cursor: pointer; }
.cpe-section-hd button { cursor: pointer; }
.cpe-section-drag { color: #86868b; font-size: 16px; padding: 0 4px;
    user-select: none; line-height: 1; pointer-events: none; }
.cpe-section-type-badge { font-size: 10px; text-transform: uppercase;
    padding: 2px 6px; border-radius: 4px; background: #fafafc; color: #86868b;
    letter-spacing: 0.3px; font-weight: 600; }
.cpe-section-type-badge.is-docs { background: #007AFF; color: #fff; }
.cpe-field-row { display: flex; align-items: center; gap: 10px;
    padding: 6px 10px; background: #fafafc; border: 1px solid #ececf1;
    border-radius: 6px; margin-bottom: 4px; cursor: grab; }
.cpe-field-row:active { cursor: grabbing; }
.cpe-field-row.cpe-dragging { opacity: 0.4; }
.cpe-field-drag { color: #86868b; font-size: 14px; user-select: none; }
.cpe-field-list { min-height: 40px; }
.cpe-catalog { background: #ffffff; padding: 8px; border-radius: 6px; }

/* Right-sidebar Intake Documents section grid */
.cd-intake-docs-grid { display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px; padding: 4px 0; }
.cd-intake-doc-thumb { aspect-ratio: 1; background: #fafafc;
    border: 1px solid #ececf1; border-radius: 6px; overflow: hidden;
    cursor: pointer; position: relative; transition: border-color 0.15s; }
.cd-intake-doc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cd-intake-doc-thumb.is-pdf { display: flex; align-items: center; justify-content: center;
    color: #86868b; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; }
.cd-intake-doc-thumb-label { position: absolute; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.88), transparent);
    color: #fff; font-size: 9px; padding: 14px 4px 3px; text-align: center;
    line-height: 1.1; letter-spacing: 0.2px; }
.cd-intake-doc-thumb:hover { border-color: #007AFF; }
.cd-intake-docs-empty { padding: 12px; color: #86868b; font-size: 12px;
    text-align: center; border: 1px dashed #d2d2d7; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* Hidden archive link at the bottom of the Intake board. Reaches the
   auto-archived "Not Started" pile. */
.intake-archive-link-wrap { margin-top: 24px; padding: 16px 0; text-align: center; }
.intake-archive-link { font-size: 11px; color: #86868b; text-decoration: none;
    letter-spacing: 0.3px; }
.intake-archive-link:hover { color: #86868b; text-decoration: underline; }

/* ── Device Delivery: parcel builder (inside the DEVICE DELIVERY step) ── */
/* Stays visible even after the substage is completed so the TSS can keep
   managing the parcel while the client is still in the delivery phase. */
.cd-parcel-panel { margin-top: 12px; padding: 12px; background: #ffffff;
    border: 1px solid #ececf1; border-radius: 8px; }
.cd-parcel-hd { color: #1d1d1f; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.cd-parcel-err { color: #ff3b30; font-size: 13px; }
.cd-parcel-intro, .cd-parcel-note { font-size: 12px; margin: 4px 0 10px; }
.cd-parcel-status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cd-parcel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px; }
.cd-parcel-field { display: flex; flex-direction: column; gap: 4px; }
.cd-parcel-label { font-size: 12px; color: #aeaeb2; font-weight: 600; }
.cd-field-required-mark { color: #ff9500; margin-left: 3px; }
.cd-parcel-field input, .cd-parcel-field select { width: 100%; }
.cd-parcel-sender { font-size: 12px; margin-top: 10px; }
.cd-parcel-subhd { font-size: 12px; font-weight: 700; color: #1d1d1f; margin: 14px 0 6px; }
.cd-parcel-items { margin-top: 6px; }
.cd-parcel-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px;
    background: #fafafc; border: 1px solid #ececf1; border-radius: 7px; margin-bottom: 6px; }
.cd-parcel-item.is-current { border-color: #007AFF; }
.cd-pi-name { font-size: 13px; color: #1d1d1f; font-weight: 500; }
.cd-pi-dev { font-size: 12px; margin-left: auto; }
.cd-pi-remove { background: none; border: none; color: #ff3b30; cursor: pointer;
    font-size: 14px; padding: 0 4px; margin-left: 8px; }
.cd-parcel-picker { position: relative; margin-top: 4px; }
.cd-parcel-picker input { width: 100%; }
.cd-parcel-picker-results { margin-top: 4px; max-height: 220px; overflow-y: auto;
    border: 1px solid #ececf1; border-radius: 7px; }
.cd-parcel-picker-results:empty { display: none; }
.cd-parcel-picker-row { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px;
    cursor: pointer; border-bottom: 1px solid #fafafc; }
.cd-parcel-picker-row:hover { background: #fafafc; }
.cd-pp-name { font-size: 13px; color: #1d1d1f; }
.cd-pp-meta { font-size: 11px; }
.cd-parcel-picker-empty { padding: 8px 10px; font-size: 12px; }
.cd-parcel-form-actions, .cd-parcel-altadd-row { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.cd-parcel-danger { margin-top: 14px; padding-top: 10px; border-top: 1px solid #ececf1; }
.cd-parcel-ro-line { display: flex; gap: 10px; font-size: 13px; padding: 3px 0; }
.cd-parcel-ro-line .cd-parcel-label { min-width: 130px; }

/* ── Deliveries tab (mark parcels delivered) ── */
.delivery-scope-toggle { display: inline-flex; gap: 4px; }
.delivery-scope-toggle .btn.active { background: #007AFF; color: #fff; border-color: #007AFF; }
.delivery-parcel-list { display: flex; flex-direction: column; gap: 10px; }
.delivery-section-hd { font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: #aeaeb2; margin: 10px 0 2px; }
.delivery-section-hd.delivered { color: #86868b; }
.delivery-parcel-card { background: #ffffff; border: 1px solid #ececf1; border-radius: 10px;
    padding: 14px 16px; }
.delivery-parcel-card.is-delivered { opacity: 0.75; }
.delivery-parcel-hd { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.delivery-parcel-title { display: flex; align-items: center; gap: 10px; }
.delivery-parcel-quant { font-size: 16px; font-weight: 700; color: #1d1d1f; }
.delivery-parcel-sub { font-size: 12px; color: #86868b; }
.delivery-status-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: 0.4px; }
.delivery-status-badge.pending { background: rgba(255,159,10,0.14); color: #ff9500; }
.delivery-status-badge.delivered { background: rgba(48,209,88,0.14); color: #34c759; }
.delivery-parcel-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 16px; margin-bottom: 12px; }
.dp-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dp-meta-k { font-size: 11px; color: #86868b; }
.dp-meta-v { font-size: 13px; color: #1d1d1f; word-break: break-word; }
.delivery-parcel-items { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.dp-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px;
    background: #fafafc; border-radius: 7px; }
.dp-item.reassign-error { border: 1px solid rgba(255,69,58,0.5); }
.dp-item.reassign-ok { border: 1px solid rgba(48,209,88,0.35); }
.dp-item-name { font-size: 13px; color: #1d1d1f; font-weight: 500; }
.dp-item-dev { font-size: 12px; color: #86868b; }
.dp-item-flag { font-size: 11px; font-weight: 600; margin-left: auto; }
.dp-item-flag.ok { color: #34c759; }
.dp-item-flag.err { color: #ff3b30; }
.delivery-parcel-actions { display: flex; align-items: center; gap: 10px; }
.delivery-reassign-summary { font-size: 12px; color: #86868b; }
@media (max-width: 720px) {
    .delivery-parcel-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cd-parcel-grid { grid-template-columns: 1fr; }
}
.cd-parcel-history { font-size: 12px; color: #ff9500; background: rgba(255,159,10,0.1);
    border: 1px solid rgba(255,159,10,0.3); border-radius: 7px; padding: 7px 10px; margin-bottom: 8px; }


/* ==========================================================================
   VANTORA LIGHT RESKIN — final parity overrides (match dev-team style.css)
   Applied after the dark->light palette transform; keep at END of file.
   ========================================================================== */

/* Login — exact dev-team card */
.login-body { background: #f5f5f7; }
.login-card { background: #fff; box-shadow: 0 2px 16px rgba(0,0,0,0.07); }
.form-group input:focus { background: #fff; }

/* Nav rail — dev-team exact: grey active pill, not blue */
.nav-tab.active { background: #e4e4e9; color: #1d1d1f; }
.nav-tab.active svg { stroke: #1d1d1f; }
.nav-tab { font-weight: 500; position: relative; }
.nav-tab svg { stroke-width: 1.8; }
.nav-tab:hover { background: #ececf1; color: #1d1d1f; }

/* App switcher — dev-team exact: light dropdown, blue text for active app */
.app-switcher-dropdown { background: #fff; border-color: #ececf1; box-shadow: 0 12px 40px rgba(0,0,0,0.14); }
.app-switcher-item:hover { background: #f5f5f7; }
.app-switcher-item.active { background: transparent; color: #007AFF; font-weight: 600; }

/* Light scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d2d2d7; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aeaeb2; }
::-webkit-scrollbar-track { background: transparent; }

/* Selection + focus ring parity */
::selection { background: rgba(0,122,255,0.18); }

/* Vantora brand accents: primary buttons keep #007AFF (Vantora accent); the
   brand gradient is reserved for the logo tile + app-switcher. */
