/* ===== Claims (top-nav Claims) — claims.js, claim-intake.js, claim-details.js,
 * claim-pane.js =====
 * Only what the views add. Tables, badges, cards, header band, breadcrumb,
 * banners and the source badge come from styles.css and policies.css
 * (.data-table, .worklist-*, .status-badge, .ls-card, .policy-header,
 * .pol-warning, .pol-source), so a claim reads like the rest of the workbench.
 * The top-nav highlight (.topnav-links a.active) is in policies.css. */

/* ---- List ---- */
.cl-list-header { display: flex; align-items: center; gap: 12px; }
.cl-list-header .cl-new-claim { margin-left: auto; }
.cl-new-claim[disabled] { opacity: .5; cursor: not-allowed; }
#claims-view .worklist-body { position: relative; }
#claims-view.cl-dragover .worklist-body { outline: 2px dashed #2a9d8f; outline-offset: -8px; }
#claims-view.cl-dragover .worklist-body::after {
  content: 'Drop FNOL PDFs to upload'; position: absolute; inset: 8px; display: flex; align-items: center; justify-content: center;
  background: rgba(233, 247, 244, .85); color: #1a6f64; font-size: 18px; font-weight: 700; pointer-events: none; border-radius: 6px;
}
.status-badge.cl-status-queued { background: #eef2f6; color: #415061; border: 1px solid #dde2e8; }
.status-badge.cl-status-failed { background: #fdecec; color: #b32525; border: 1px solid #f0c4c4; }
.cl-queue-row td { background: #fbfcfe; }

.cl-banner-error { border-left-color: #b32525; background: #fbeaea; color: #8a1f1f; }
.cl-banner-text { white-space: pre-line; }

.cl-list-table td { vertical-align: top; }
.cl-list-table .cl-claim-no { font-weight: 600; color: #1a3a5c; white-space: nowrap; }
.cl-list-table .cl-doc { color: #6b7a8d; font-size: 12px; }
.cl-list-table td .status-badge { white-space: nowrap; }
.cl-muted { color: #8a9bb0; font-style: italic; }
.cl-retry { margin-left: 6px; }

.status-badge.cl-status-uploading,
.status-badge.cl-status-predicting,
.status-badge.cl-status-sorting { background: #fff6e6; color: #9a6b1a; border: 1px solid #f0e2b8; }
.status-badge.cl-status-ready   { background: #eef4fb; color: #2a5d8f; border: 1px solid #cfe0f0; }
.status-badge.cl-status-setup   { background: #e6f7f2; color: #1a7a5a; border: 1px solid #b3e6d4; }
.status-badge.cl-status-reviewed { background: #f1ecfb; color: #5a3d99; border: 1px solid #d9ccf2; }
.status-badge.cl-status-unknown { background: #eef2f6; color: #415061; border: 1px solid #dde2e8; }

.cl-mini-spinner {
  display: inline-block; width: 8px; height: 8px; margin-right: 5px; vertical-align: -1px;
  border: 2px solid #f0e2b8; border-top-color: #9a6b1a; border-radius: 50%;
  animation: spin .8s linear infinite;   /* @keyframes spin: styles.css */
}

/* ---- Intake ---- */
.ci-header {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
  background: #fff; border-bottom: 1px solid #dde2e8; padding: 12px 24px;
}
.ci-client .ci-field { min-width: 320px; }
.ci-client .ci-input { font-size: 17px; font-weight: 600; padding: 6px 8px; }
.ci-header-meta { display: flex; align-items: center; gap: 14px; color: #415061; font-size: 13px; }
.ci-claim-no { font-weight: 700; color: #1a3a5c; font-size: 15px; }
#ci-warning { margin: 12px 24px 0; }

/* Form ~27%, SortSpoke the rest; the footer stays on screen. */
.ci-split { display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(0, 2.2fr); gap: 16px; padding: 16px 24px 80px; }
.ci-form { min-width: 0; }
.ci-pane {
  min-height: 640px; height: calc(100vh - 230px);
  position: sticky; top: 12px;   /* sticky is positioned, so the pane's absolute children anchor to it */
  background: #f6f8fb; border: 1px solid #dde2e8; border-radius: 6px; overflow: hidden;
}
.ci-group { background: #fff; border: 1px solid #e3e8ef; border-radius: 6px; padding: 12px 14px; margin-bottom: 12px; }
.ci-group-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; cursor: pointer; user-select: none; }
.ci-group-title { font-size: 13px; font-weight: 700; color: #1a3a5c; margin: 0; text-transform: uppercase; letter-spacing: .03em; }
.ci-group-toggle { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ci-group-toggle::before { content: '▾'; display: inline-block; width: 14px; color: #6b7a8d; transition: transform .15s; }
.ci-collapsed .ci-group-toggle::before { transform: rotate(-90deg); }
.ci-group.ci-collapsed { padding-bottom: 12px; }
.ci-group.ci-collapsed > .ci-group-head { margin-bottom: 0; }
.ci-form:not(.ci-mode-review) .ci-group.ci-collapsed > :not(.ci-group-head) { display: none; }
.ci-group-state { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.ci-state-accepted { background: #e6f7f2; color: #1a7a5a; border: 1px solid #b3e6d4; }
.ci-state-review   { background: #fff6e6; color: #9a6b1a; border: 1px solid #f0e2b8; }
.ci-state-missing  { background: #fdecec; color: #b32525; border: 1px solid #f0c4c4; }
.ci-more > summary .ci-group-state { float: right; }
.ci-extra > summary .ci-group-state { margin-left: 6px; }
.ci-extra.ci-extra-flagged > summary { background: #fff6e6; border: 1px solid #f0e2b8; border-radius: 4px; padding: 4px 8px; color: #7a5410; }

/* A field to review, or a required one that is empty: tinted, with a tag. */
/* The tint bleeds outward so the label, input and ⌖ line up with unflagged fields. */
.ci-field.ci-review, .ci-field.ci-missing { padding: 6px 8px 8px 10px; margin: 0 -8px 0 -10px; }
.ci-field.ci-review { background: #fff8e6; box-shadow: inset 3px 0 0 #e0a100; }
.ci-field.ci-review .ci-input { border-color: #e0b44a; }
.ci-field.ci-missing { background: #fdf0f0; box-shadow: inset 3px 0 0 #c94040; }
.ci-field.ci-review .ci-label::after, .ci-field.ci-missing .ci-label::after {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px;
  font-size: 10px; font-weight: 700; line-height: 16px; text-transform: uppercase; letter-spacing: .03em;
}
.ci-field.ci-review .ci-label::after { content: 'Review'; background: #f5d98a; color: #6b4a00; }
.ci-field.ci-missing .ci-label::after { content: 'Required'; background: #f3c1c1; color: #8a1c1c; }

/* View switch above the form. */
.ci-modes { display: flex; margin-bottom: 12px; background: #e9edf3; border-radius: 6px; padding: 3px; gap: 3px; }
.ci-mode { flex: 1; border: 0; background: none; padding: 6px 10px; border-radius: 4px; font: inherit; font-size: 13px; font-weight: 600; color: #4a5a6b; cursor: pointer; }
.ci-mode.active { background: #fff; color: #1a3a5c; box-shadow: 0 1px 2px rgba(20,40,60,.15); }
.ci-review-count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: #e0a100; color: #fff; font-size: 11px; line-height: 18px; }
.ci-review-count.ci-count-zero { background: #1a9a6a; }
.ci-review-empty { background: #e6f7f2; color: #1a7a5a; border: 1px solid #b3e6d4; border-radius: 6px; padding: 12px 14px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }

/* Fields to review: one flat list of the flagged fields, each with its place in the form. */
.ci-mode-review .ci-group-head, .ci-mode-review .ci-card-title, .ci-mode-review .ci-extra > summary,
.ci-mode-review .ci-more > summary, .ci-mode-review .ci-more-title { display: none; }
.ci-mode-review .ci-field:not(.ci-keep) { display: none; }
.ci-mode-review .ci-group, .ci-mode-review .ci-card, .ci-mode-review .ci-more, .ci-mode-review .ci-group.ci-missing {
  background: none; border: 0; padding: 0; margin: 0;
}
.ci-mode-review .ci-group:not(.ci-missing) > .ci-message { display: none; }
.ci-mode-review .ci-group.ci-missing > .ci-message { background: #fdf0f0; box-shadow: inset 3px 0 0 #c94040; color: #8a1c1c; border-radius: 4px; padding: 8px 10px; margin-bottom: 10px; }
.ci-mode-review .ci-grid { display: block; }
.ci-mode-review .ci-extra, .ci-mode-review .ci-extra > .ci-grid { margin: 0; }
.ci-mode-review .ci-field.ci-keep { background: #fff; border: 1px solid #e3e8ef; border-radius: 6px; padding: 8px 10px 10px; margin: 0 0 8px; }
.ci-mode-review .ci-field.ci-keep.ci-review { background: #fff8e6; border-color: #f0e2b8; }
.ci-mode-review .ci-field.ci-keep.ci-missing { background: #fdf0f0; border-color: #f0c4c4; }
.ci-mode-review .ci-field[data-context]::before {
  content: attr(data-context); font-size: 10px; font-weight: 700; color: #6b7a8d; text-transform: uppercase; letter-spacing: .04em;
}
/* One field per line, so the form fits its narrow column. */
.ci-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ci-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; border-radius: 4px; }
.ci-field-head { display: flex; align-items: center; gap: 5px; min-height: 18px; }
.ci-label { font-size: 12px; color: #4a5a6b; background: none; border: 0; padding: 0; text-align: left; font-family: inherit; }
button.ci-label { cursor: pointer; }
button.ci-label:hover { color: #1a3a5c; text-decoration: underline; }
.ci-required { color: #b32525; margin-left: 2px; }
.ci-marker { font-size: 10px; line-height: 1; }
.ci-marker-high { color: #1a9a6a; }
.ci-marker-low { color: #cc8a00; }
.ci-marker-verified { color: #1a7a5a; font-weight: 700; }
/* Show-in-SortSpoke: a 26px button, pulled into the label row's height. */
.ci-target {
  margin: -5px 0 -5px auto; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 5px; background: none; color: #6b7a8d; cursor: pointer; padding: 0;
}
.ci-target svg { display: block; }
.ci-field:hover .ci-target { color: #2a9d8f; border-color: #cfe7e3; background: #f2faf8; }
.ci-target:hover, .ci-target:focus-visible { color: #fff !important; background: #2a9d8f !important; border-color: #2a9d8f !important; outline: none; }
.ci-field-active .ci-target { color: #fff; background: #2a9d8f; border-color: #2a9d8f; }
.ci-input {
  width: 100%; box-sizing: border-box; padding: 5px 7px; font-size: 13px; font-family: inherit;
  border: 1px solid #c5cdd8; border-radius: 4px; background: #fff; color: #1a2a3a;
}
textarea.ci-input { resize: vertical; }
.ci-field-active .ci-input { border-color: #2a9d8f; box-shadow: 0 0 0 2px rgba(42,157,143,.15); }
.ci-missing .ci-input, .ci-group.ci-missing { border-color: #d98c8c; }
.ci-missing .ci-label { color: #b32525; }
.ci-flash .ci-input { animation: ci-flash 1.2s ease-out; }
@keyframes ci-flash { from { background: #fff4c2; } to { background: #fff; } }

.ci-card { border: 1px solid #edf1f7; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; background: #fbfcfe; }
.ci-card-vehicle { margin: 10px 0 0; background: #fff; }
.ci-card-title { font-size: 12px; font-weight: 700; color: #415061; margin-bottom: 8px; }
.ci-extra { margin-top: 8px; font-size: 12px; }
.ci-extra > summary, .ci-more > summary { cursor: pointer; color: #1a3a5c; font-weight: 600; }
.ci-extra > .ci-grid { margin-top: 8px; }
.ci-more { background: #fff; border: 1px solid #e3e8ef; border-radius: 6px; padding: 10px 14px; }
.ci-more-title { font-size: 12px; font-weight: 700; color: #415061; margin: 12px 0 6px; }
.ci-message { color: #6b7a8d; font-size: 13px; padding: 12px 0; }
.ci-message.ci-error { color: #b32525; }

.ci-footer {
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  padding: 10px 24px; background: #fff; border-top: 1px solid #dde2e8; z-index: 5;
}
.ci-missing-text { font-size: 12px; color: #6b7a8d; }
#ci-complete[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Pane ---- */
.ci-pane-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.ci-pane-card {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 32px; text-align: center; color: #6b7a8d; font-size: 13px;
}
.ci-pane-file { font-weight: 600; color: #1a2a3a; overflow-wrap: anywhere; }
.ci-pane-config { color: #6b4e00; background: #fdf8e8; }

/* ---- Claim Details ---- */
.cd-banner { display: flex; align-items: center; justify-content: space-between; margin: 12px 24px 0;
  border-left-color: #1a7a5a; background: #e6f7f2; color: #1a5a44; }
.cd-banner-close { border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; }
.cd-client { font-size: 15px; color: #415061; }
.cd-doc-state { font-size: 12px; color: #6b7a8d; }
.cd-meta-line { font-size: 12px; color: #6b7a8d; margin-bottom: 10px; }
.cd-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.cd-chip { background: #fff; border: 1px solid #e3e8ef; border-radius: 14px; padding: 4px 12px; font-size: 13px; color: #1a2a3a; }
.cd-chip-label { color: #6b7a8d; margin-right: 6px; font-size: 12px; }
.cd-section { margin-top: 18px; }
.cd-panel { background: #fff; border: 1px solid #e3e8ef; border-radius: 6px; padding: 8px 14px; }
.cd-field { display: grid; grid-template-columns: minmax(140px, 32%) 1fr 26px; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid #f0f3f7; font-size: 13px; }
.cd-field .cd-target { margin: -4px 0; grid-column: 3; }
.cd-field:hover .cd-target { color: #2a9d8f; border-color: #cfe7e3; background: #f2faf8; }
.ci-missing-text.ci-error-text { color: #b32525; font-weight: 600; }
.cd-field:first-child { border-top: 0; }
.cd-label { color: #4a5a6b; }
.cd-value { color: #1a2a3a; overflow-wrap: anywhere; }
button.cd-value { border: 0; background: none; padding: 0; font: inherit; text-align: left; cursor: pointer; }
button.cd-value:hover { color: #2a9d8f; text-decoration: underline; }
.cd-edited { margin-left: 8px; font-size: 10px; font-weight: 600; color: #5a3da0; background: #f0edfb; border: 1px solid #ddd4f2; border-radius: 3px; padding: 0 5px; }
.cd-card { border: 1px solid #edf1f7; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; background: #fff; }
.cd-card-title { font-size: 12px; font-weight: 700; color: #415061; margin: 4px 0 6px; }
.cd-subtitle { font-size: 12px; font-weight: 700; color: #415061; margin: 10px 0 4px; }
