/* ── ClaimLens AI — UI Components ────────────────────────────────────────── */

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; text-decoration: none; white-space: nowrap; font-family: inherit; }
.btn-primary { background: var(--blue-500); color: white; } .btn-primary:hover { background: var(--blue-700); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); } .btn-secondary:hover { background: var(--gray-200); }
.btn-ghost { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-200); } .btn-ghost:hover { background: var(--gray-50); }
.btn-success { background: var(--success); color: white; } .btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; } .btn-danger:hover { background: #DC2626; }
.btn-warning { background: var(--warning); color: white; } .btn-warning:hover { background: #D97706; }
.btn-navy { background: var(--navy-900); color: white; } .btn-navy:hover { background: var(--navy-800); }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 15px; font-weight: 600; color: var(--navy-900); }
.card-body { padding: 24px; }

/* ── Stats ───────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); padding: 22px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.stat-icon.blue { background: rgba(59,130,246,.1); color: var(--blue-500); }
.stat-icon.green { background: rgba(16,185,129,.1); color: var(--success); }
.stat-icon.red { background: rgba(239,68,68,.1); color: var(--danger); }
.stat-icon.amber { background: rgba(245,158,11,.1); color: var(--warning); }
.stat-value { font-size: 30px; font-weight: 800; color: var(--navy-900); letter-spacing: -1px; line-height: 1; }
.stat-label { font-size: 13px; color: var(--gray-500); font-weight: 500; margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--gray-400); margin-top: 6px; }

/* ── Risk & Status Badges ────────────────────────────────────────────────── */
.risk-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.risk-badge.low { background: var(--success-light); color: var(--success-dark); }
.risk-badge.medium { background: var(--warning-light); color: var(--warning-dark); }
.risk-badge.high { background: var(--danger-light); color: var(--danger-dark); }
.risk-dot { width: 5px; height: 5px; border-radius: 50%; }
.risk-badge.low .risk-dot { background: var(--success); }
.risk-badge.medium .risk-dot { background: var(--warning); }
.risk-badge.high .risk-dot { background: var(--danger); }

.status-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.status-approved { background: var(--success-light); color: var(--success-dark); }
.status-rejected { background: var(--danger-light); color: var(--danger-dark); }
.status-pending-review { background: var(--warning-light); color: var(--warning-dark); }
.status-analyzing { background: var(--blue-100); color: #1E40AF; }
.status-info-requested { background: var(--gray-100); color: var(--gray-600); }
.status-low-risk { background: var(--success-light); color: var(--success-dark); }

/* ── Confidence Pill ─────────────────────────────────────────────────────── */
.confidence-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; margin-left: 6px; }
.confidence-pill.high-conf { background: rgba(239,68,68,.12); color: #991B1B; }
.confidence-pill.med-conf { background: rgba(245,158,11,.12); color: #92400E; }
.confidence-pill.low-conf { background: var(--gray-100); color: var(--gray-600); }

/* ── Table ───────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); white-space: nowrap; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: background .1s; }
.data-table tbody tr:hover td { background: var(--gray-50); }
.data-table .sort-btn { background: none; border: none; cursor: pointer; color: inherit; font: inherit; padding: 0; display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 14px; color: var(--gray-800); background: var(--white); transition: border-color .15s, box-shadow .15s; font-family: inherit; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-section-title { font-size: 15px; font-weight: 700; color: var(--navy-900); margin-bottom: 4px; }
.form-section-desc { font-size: 13px; color: var(--gray-500); margin-bottom: 16px; }

/* ── Claim Type Selector ─────────────────────────────────────────────────── */
.type-card { border: 2px solid var(--gray-200); border-radius: 10px; padding: 16px; text-align: center; cursor: pointer; transition: all .2s; }
.type-card.active { border-color: var(--blue-500); background: #EFF6FF; }
.type-card:hover:not(.active) { border-color: var(--gray-400); }

/* ── File Upload ─────────────────────────────────────────────────────────── */
.file-upload-area { border: 2px dashed var(--gray-300); border-radius: var(--radius-lg); padding: 32px 24px; text-align: center; cursor: pointer; transition: all .2s; background: var(--gray-50); }
.file-upload-area:hover, .file-upload-area.drag-over { border-color: var(--blue-400); background: #EFF6FF; }
.file-upload-area h4 { font-size: 15px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.file-upload-area p { font-size: 13px; color: var(--gray-500); }
.file-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-100); border: 1px solid #BFDBFE; border-radius: 6px; padding: 5px 10px; font-size: 12px; font-weight: 500; color: #1E40AF; margin: 4px; }
.file-tag button { background: none; border: none; cursor: pointer; color: #94A3B8; padding: 0; line-height: 1; }
.file-tag button:hover { color: var(--danger); }
.file-tags-container { margin-top: 12px; }

/* ── Postcode Lookup ─────────────────────────────────────────────────────── */
.postcode-lookup { display: flex; gap: 10px; }
.postcode-input { flex: 1; text-transform: uppercase; }
.postcode-btn { white-space: nowrap; flex-shrink: 0; }
.postcode-error { font-size: 13px; color: var(--danger); margin-top: 6px; }
.postcode-dropdown { border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--white); margin-top: 8px; box-shadow: var(--shadow-md); overflow: hidden; }
.postcode-dropdown-header { padding: 10px 14px; font-size: 12px; color: var(--gray-500); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.postcode-option { padding: 11px 14px; font-size: 14px; color: var(--gray-700); cursor: pointer; border-bottom: 1px solid var(--gray-100); transition: background .1s; }
.postcode-option:last-child { border-bottom: none; }
.postcode-option:hover { background: var(--blue-100); color: var(--navy-900); }
.postcode-option-manual { color: var(--gray-500); font-size: 13px; font-style: italic; }
.postcode-option-manual:hover { color: var(--gray-700); background: var(--gray-50); }
@media (max-width: 480px) {
  .postcode-lookup { flex-direction: column; }
  .postcode-btn { width: 100%; justify-content: center; }
}

/* ── Fraud Score Gauge ───────────────────────────────────────────────────── */
.gauge-container { text-align: center; padding: 8px 0; }

/* ── Risk Chart ──────────────────────────────────────────────────────────── */
.risk-chart { display: flex; flex-direction: column; gap: 14px; }
.risk-bar-row { display: flex; align-items: center; gap: 10px; }
.risk-bar-label { width: 48px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.risk-bar-track { flex: 1; height: 10px; background: var(--gray-100); border-radius: 5px; overflow: hidden; }
.risk-bar-fill { height: 100%; border-radius: 5px; transition: width .8s ease; }
.risk-bar-fill.low { background: var(--success); }
.risk-bar-fill.medium { background: var(--warning); }
.risk-bar-fill.high { background: var(--danger); }
.risk-bar-count { width: 24px; font-size: 13px; font-weight: 600; text-align: right; }

/* ── Score Colors ────────────────────────────────────────────────────────── */
.score-low { color: var(--success); } .score-medium { color: var(--warning); } .score-high { color: var(--danger); }

/* ── Analysis Components ─────────────────────────────────────────────────── */
.indicator-item { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--gray-200); border-radius: var(--radius); margin-bottom: 10px; }
.indicator-bar { width: 4px; border-radius: 2px; flex-shrink: 0; }
.indicator-bar.high { background: var(--danger); } .indicator-bar.medium { background: var(--warning); } .indicator-bar.low { background: var(--success); }
.indicator-content h5 { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 3px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.indicator-content p { font-size: 13px; color: var(--gray-600); line-height: 1.55; }
.severity-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 1px 7px; border-radius: 10px; margin-top: 5px; }
.severity-tag.high { background: var(--danger-light); color: var(--danger-dark); }
.severity-tag.medium { background: var(--warning-light); color: var(--warning-dark); }
.severity-tag.low { background: var(--success-light); color: var(--success-dark); }
.analysis-summary { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; font-size: 14px; line-height: 1.75; color: var(--gray-700); white-space: pre-wrap; }
.factors-list { display: flex; flex-direction: column; gap: 8px; }
.factor-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--gray-700); }
.factor-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.factor-dot.pos { background: var(--success); } .factor-dot.neg { background: var(--danger); }

/* ── Escalation Notices ──────────────────────────────────────────────────── */
.escalation-notice { border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 22px; display: flex; align-items: flex-start; gap: 14px; }
.escalation-notice.medium { background: linear-gradient(135deg,#FEF3C7,#FDE68A); border: 1px solid var(--warning); }
.escalation-notice.high { background: linear-gradient(135deg,#FEE2E2,#FECACA); border: 1px solid var(--danger); }
.escalation-notice.low { background: linear-gradient(135deg,#D1FAE5,#A7F3D0); border: 1px solid var(--success); }
.escalation-title { font-size: 14px; font-weight: 700; color: var(--gray-800); margin-bottom: 3px; }
.escalation-text { font-size: 13px; color: var(--gray-700); }

/* ── Queue Cards ─────────────────────────────────────────────────────────── */
.queue-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow .2s, border-color .2s; }
.queue-card:hover { box-shadow: var(--shadow-md); border-color: var(--blue-300); }
.queue-card-footer { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--gray-100); }
.queue-meta { display: flex; flex-direction: column; gap: 2px; }
.queue-meta-label { font-size: 10px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .4px; }
.queue-meta-value { font-size: 14px; font-weight: 600; color: var(--gray-800); }

/* ── Reviewer Panel ──────────────────────────────────────────────────────── */
.reviewer-panel { background: var(--navy-900); border-radius: var(--radius-lg); padding: 28px; color: white; }
.reviewer-panel h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.reviewer-panel > p { color: var(--gray-400); font-size: 13px; margin-bottom: 20px; }
.reviewer-textarea { width: 100%; padding: 10px 14px; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); background: rgba(255,255,255,.05); color: white; font-size: 14px; font-family: inherit; resize: vertical; min-height: 80px; margin-bottom: 14px; transition: border-color .15s; }
.reviewer-textarea::placeholder { color: var(--gray-500); }
.reviewer-textarea:focus { outline: none; border-color: var(--blue-400); }
.reviewer-input { width: 100%; padding: 10px 14px; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); background: rgba(255,255,255,.05); color: white; font-size: 14px; font-family: inherit; margin-bottom: 12px; }
.reviewer-input::placeholder { color: var(--gray-500); }
.reviewer-input:focus { outline: none; border-color: var(--blue-400); }
.reviewer-select { width: 100%; padding: 10px 14px; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); background: var(--navy-800); color: white; font-size: 14px; font-family: inherit; margin-bottom: 14px; }
.reviewer-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.audit-entry { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.audit-entry:last-child { border-bottom: none; }
.audit-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.audit-dot.submitted { background: var(--blue-400); }
.audit-dot.escalated { background: var(--warning); }
.audit-dot.approved { background: var(--success); }
.audit-dot.rejected { background: var(--danger); }
.audit-dot.assigned { background: var(--blue-300); }
.audit-dot.request-info { background: var(--gray-400); }

/* ── Info List ───────────────────────────────────────────────────────────── */
.info-item { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--gray-100); gap: 16px; }
.info-item:last-child { border-bottom: none; }
.info-key { font-size: 13px; color: var(--gray-500); font-weight: 500; white-space: nowrap; }
.info-val { font-size: 13px; color: var(--gray-800); font-weight: 500; text-align: right; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* ── Filter / Search Bar ─────────────────────────────────────────────────── */
.filters-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; align-items: center; }
.filter-select { padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 13px; background: white; color: var(--gray-700); font-family: inherit; }
.search-input { padding: 8px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 13px; width: 220px; font-family: inherit; }
.search-input:focus, .filter-select:focus { outline: none; border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.filter-tabs { display: flex; gap: 4px; background: var(--gray-100); padding: 4px; border-radius: 10px; width: fit-content; }
.filter-tab { padding: 6px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--gray-600); border: none; background: none; font-family: inherit; transition: all .15s; }
.filter-tab.active { background: white; color: var(--navy-900); box-shadow: var(--shadow-sm); }

/* ── Settings ────────────────────────────────────────────────────────────── */
.settings-section { margin-bottom: 32px; }
.settings-section h3 { font-size: 16px; font-weight: 700; color: var(--navy-900); margin-bottom: 4px; }
.settings-section .desc { font-size: 13px; color: var(--gray-500); margin-bottom: 18px; }
.threshold-display { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.threshold-val { font-size: 24px; font-weight: 800; color: var(--navy-900); min-width: 36px; }
.threshold-range { flex: 1; }
input[type="range"] { width: 100%; accent-color: var(--blue-500); }
.reviewer-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.reviewer-row:last-child { border-bottom: none; }
.api-status { display: flex; align-items: center; gap: 10px; padding: 16px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); }

/* ── Loading Overlay ─────────────────────────────────────────────────────── */
.loading-overlay { position: fixed; inset: 0; background: rgba(10,22,40,.85); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); }
.loading-card { background: white; border-radius: 20px; padding: 44px; text-align: center; max-width: 380px; width: 90%; }
.loading-spinner { width: 52px; height: 52px; border: 4px solid var(--gray-200); border-top-color: var(--blue-500); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 22px; }
.loading-steps { margin-top: 22px; text-align: left; }
.loading-step { display: flex; align-items: center; gap: 12px; padding: 7px 0; color: var(--gray-300); font-size: 13px; transition: color .3s; }
.loading-step.active { color: var(--blue-500); font-weight: 600; }
.loading-step.done { color: var(--success); }
.step-indicator { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 9px; font-weight: 700; }

/* ── Toast Notifications ─────────────────────────────────────────────────── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: white; border-radius: 10px; padding: 14px 18px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; min-width: 280px; border-left: 4px solid; animation: slideIn .3s ease; pointer-events: all; }
.toast-success { border-color: var(--success); } .toast-error { border-color: var(--danger); } .toast-info { border-color: var(--blue-400); }
.toast-msg { font-size: 14px; font-weight: 500; color: var(--gray-800); flex: 1; }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--gray-200); margin: 22px 0; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--gray-500); font-size: 14px; font-weight: 500; cursor: pointer; margin-bottom: 20px; background: none; border: none; padding: 0; transition: color .15s; font-family: inherit; }
.back-btn:hover { color: var(--navy-900); }
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state svg { width: 52px; height: 52px; margin: 0 auto 14px; color: var(--gray-300); }
.empty-state h3 { font-size: 17px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--gray-400); }
.demo-notice { background: var(--blue-100); border: 1px solid #BFDBFE; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; font-size: 13px; color: #1E40AF; display: flex; align-items: center; gap: 8px; }
.section-header { margin-bottom: 22px; }
.section-header h2 { font-size: 22px; font-weight: 700; color: var(--navy-900); letter-spacing: -.4px; }
.section-header p { font-size: 14px; color: var(--gray-500); margin-top: 3px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 20px; }
.page-btn { padding: 6px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: white; cursor: pointer; font-size: 13px; font-family: inherit; transition: all .15s; }
.page-btn:hover { border-color: var(--blue-400); color: var(--blue-500); }
.page-btn.active { background: var(--blue-500); color: white; border-color: var(--blue-500); }
