/* ===== Global Reset & Base ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-body: #f3f4f6;
  --bg-card: #ffffff;
  --bg-card-soft: #f9fafb;
  --border-subtle: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;
  --brand-primary: #19719a;
  --brand-primary-dark: #19719a;
  --brand-primary-soft: #e0ebff;
  --brand-accent: #0891b2;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius-lg: 0.9rem;
  --radius-pill: 999px;
  --transition-fast: 0.15s ease;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e5edff 0, #f3f4f6 45%, #f9fafb 90%);
  color: var(--text-main);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Layout Helpers ===== */

.content {
  width: 100%;
  max-width: 1200px;
  margin: 1.8rem auto 2.5rem;
  padding: 0 1.2rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  border: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.7rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* ===== Topbar ===== */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.7rem;
  background: linear-gradient(90deg, #19719a, #020617 40%, #0b1220 100%);
  color: #e5e7eb;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.5);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.topbar .app-title {
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  margin: 0;
}

.topbar a {
  color: #e5e7eb;
  text-decoration: none;
}
/* Logo inside dashboard topbar */
.topbar-left img {
  height: 32px;      /* or 28px / 36px if you prefer */
  width: auto;
  max-width: 180px;  /* safety so huge PNGs don't overflow */
  object-fit: contain;
  display: block;
}

/* ===== Auth Screen ===== */

.page-auth {
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-container {
  max-width: 430px;
  width: 100%;
}

.auth-header h1 {
  margin: 0 0 0.3rem;
  font-size: 1.4rem;
}

.auth-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.small-text {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auth-logo {
  text-align: center;
  margin-bottom: 1rem;
}

.auth-logo img {
  width: 190px;
  max-width: 85%;
  height: auto;
}

/* ===== Form Elements ===== */

.form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

label {
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-main);
}

input,
select,
textarea {
  padding: 0.65rem 0.8rem;
  border-radius: 0.65rem;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  transition: 0.15s ease;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  background: #ffffff;
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(15, 90, 215, 0.22);
}

textarea {
  resize: vertical;
}

.helper-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Buttons ===== */

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  transition: 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: white;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45);
}
/* Upload button when document is present */
.doc-upload-btn.uploaded {
  background: #dcfce7;          /* light green */
  border-color: #16a34a;
  color: #166534;               /* dark green text */
}

/* optional: make text a bit bolder */
.doc-upload-btn.uploaded {
  font-weight: 600;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--brand-primary-dark), var(--brand-accent));
}

.btn-secondary {
  background: #e5e7eb;
  color: var(--text-main);
}

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

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #e5e7eb;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.full-width {
  width: 100%;
}

/* ===== Pills ===== */

.pill {
  background: var(--brand-primary-soft);
  padding: 0.22rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.4);
  font-size: 0.82rem;
  color: var(--brand-primary);
}

.user-pill {
  background: rgba(15, 23, 42, 0.85);
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.8rem;
}

/* ===== Toolbar ===== */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

.toolbar label {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
}

/* ===== Grid Helpers ===== */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: minmax(0, 0.35fr) minmax(0, 0.65fr);
  }
}

/* ===== KPI ===== */

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.kpi-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 600;
}

/* ===== Tables ===== */

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 0.5rem;
}

td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

tbody tr:hover td {
  background: #f3f4f6;
}

/* ===== Claim Page Layout ===== */

.page-claim .claim-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.4rem;
}

@media (max-width: 900px) {
  .page-claim .claim-layout {
    grid-template-columns: 1fr;
  }
}

/* Header meta + Claim Overview containers */
.meta-grid,
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.meta-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meta-value {
  font-size: 0.9rem;
  font-weight: 500;
}

/* === Claim Overview tweaks (compact 2-column, key–value layout) === */

/* Force overview to 2 columns on desktop */
.details-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Key–value rows for header + overview */
.meta-item,
.detail-item {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: baseline;
  column-gap: 0.45rem;
}

/* Right-aligned labels with colon */
.meta-label,
.detail-label {
  text-align: right;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
}

.detail-label::after {
  content: ":";
  margin-left: 0.15rem;
}

/* Values */
.detail-value {
  font-size: 0.9rem;
  color: var(--text-main);
}

/* ===== Step 4 Workflow – single column ===== */

.step-section {
  margin-top: 2rem;
}

.step-section h3 {
  margin-bottom: 0.4rem;
}

.step-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.3rem;
  margin-top: 0.9rem;
}

.step-card {
  background: var(--bg-card-soft);
  border-radius: 0.9rem;
  border: 1px solid rgba(209, 213, 219, 0.9);
  padding: 1.2rem 1.3rem;
}

.step-card h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.step-card h5 {
  margin: 0.8rem 0 0.4rem;
  font-size: 0.86rem;
}

.step-card p {
  margin: 0 0 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.step-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
  font-size: 0.86rem;
}

.step-row.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

/* inputs take full width inside card */
.step-card input,
.step-card select,
.step-card textarea {
  width: 100%;
  max-width: 100%;
}

/* ✅ FIX: checkboxes inside cards use natural width so tick & label align nicely */
.step-card input[type="checkbox"] {
  width: auto;
  max-width: none;
}

/* document status table */
.doc-status-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  font-size: 0.82rem;
}

.doc-status-table th,
.doc-status-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.step-actions {
  margin-top: 0.9rem;
  display: flex;
  justify-content: flex-end;
}

/* ===== Timeline ===== */

.timeline {
  border-left: 2px solid var(--border-subtle);
  margin: 0;
  padding: 0 0 0 0.8rem;
}

.timeline li {
  position: relative;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 0.3rem;
  width: 0.6rem;
  height: 0.6rem;
  background: var(--brand-primary);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

/* ===== Documents sidebar ===== */

.doc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.84rem;
}

.doc-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

/* ===== Public Claim Form ===== */

.page-public {
  align-items: stretch;
}

.public-header,
.public-footer {
  text-align: center;
  padding: 1.3rem 1rem 0.6rem;
}

.public-header h1 {
  margin-bottom: 0.4rem;
  font-size: 1.55rem;
}

.public-header p {
  margin-top: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.public-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

/* ===== Links ===== */

a {
  color: var(--brand-primary);
}

a:hover {
  text-decoration: underline;
}

/* Wizard helpers */
.hidden { display: none; }
.step-card.completed { border-color: #16a34a; }

/* ===== Bank verification UI ===== */

.bank-verify-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.bank-verify-status-block {
  flex: 1 1 180px;
}

.bank-verify-button-block {
  flex: 0 0 auto;
}

.verify-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.verify-status-pill.in-progress {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.verify-status-pill.verified {
  background: #ecfdf3;
  border-color: #4ade80;
  color: #166534;
}

/* simple "loading" state for button */
.btn-loading {
  opacity: 0.7;
  cursor: default;
}

/* ===== Document validation rows (Step 1) ===== */

.doc-validate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed #e5e7eb;
}

.doc-validate-label {
  flex: 1 1 auto;
  font-size: 0.85rem;
  color: #111827;
}

.doc-validate-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-compact {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  border-radius: 999px;
}

.doc-validate-status {
  min-width: 140px;
  font-size: 0.82rem;
}

/* Bank verification UI (existing, if not already added) */
.bank-verify-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.bank-verify-status-block {
  flex: 1 1 180px;
}

.bank-verify-button-block {
  flex: 0 0 auto;
}

.verify-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.verify-status-pill.in-progress {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.verify-status-pill.verified {
  background: #ecfdf3;
  border-color: #4ade80;
  color: #166534;
}

.btn-loading {
  opacity: 0.7;
  cursor: default;
}

/* ===== Fraud & compliance rows (Step 3) ===== */

.fraud-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px dashed #e5e7eb;
}

.fraud-check-main {
  flex: 1 1 220px;
  font-size: 0.85rem;
  color: #111827;
}

.fraud-check-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fraud-upload-input {
  max-width: 210px;
  font-size: 0.8rem;
}

.fraud-verified-label {
  font-size: 0.82rem;
  color: #111827;
}

/* ===== Responsive tweaks for overview ===== */

@media (max-width: 640px) {
  .details-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .meta-item,
  .detail-item {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}
.review-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.review-value-text {
  flex: 1 1 auto;
}

.review-validate-btn.is-reviewed {
  background: #ecfdf3;
  border: 1px solid #4ade80;
  color: #166534;
}
/* === Reviewer summary layout === */

.review-summary-table {
  width: 100%;
  border-collapse: collapse;
}

/* ONE full-width line per row */
.review-summary-table tr {
  border-bottom: 1px solid #eee;
}

.review-summary-table tr:last-child {
  border-bottom: none;
}

/* Just spacing now – no borders on individual cells */
.review-summary-table td {
  padding: 8px 0;
  vertical-align: middle;
}


/* Keep the left column neat and stop labels wrapping onto multiple lines */
.review-label {
  width: 220px;
  white-space: nowrap;
  font-weight: 500;
  color: #374151;
}

/* Right column: value + pill button on one line */
.review-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.review-value-text {
  flex: 1 1 auto;
  min-width: 0;
  color: #111827;
}

/* Default "Mark reviewed" pill */
.review-validate-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #4b5563;
  font-size: 12px;
  line-height: 1;
}

/* Hover state */
.review-validate-btn:hover {
  background: #e5e7eb;
}

/* When row is marked as reviewed */
.review-validate-btn.is-reviewed {
  background: #ecfdf3;
  border-color: #4ade80;
  color: #166534;
  font-weight: 500;
}
/* === POLISHED REVIEWER SECTION === */

.review-section-card.polished {
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.6rem;
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.review-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.review-section-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.review-count-badge {
  background: #eef2ff;
  color: #3730a3;
  padding: 4px 12px;
  font-size: 0.78rem;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  font-weight: 600;
}

/* Spacing inside tables */
.review-summary-table.polished td {
  padding: 10px 0;
}

/* Hover highlight on rows */
.review-summary-table.polished tr:hover {
  background: #fafafa;
}

/* Button enhancements */
.review-validate-btn {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
}

.review-validate-btn:hover {
  background: #e5e7eb;
}

.review-validate-btn.is-reviewed {
  background: #ecfdf3;
  border-color: #4ade80;
  color: #166534;
  font-weight: 600;
}
.review-summary-table td {
  border-bottom: none !important;
}
/* Final Decision spacing */
#review-decision-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem; /* spacing between dropdown, input, and button */
  align-items: center;
}

#review-decision-form button {
  margin-top: 0.5rem; /* gives breathing room */
}
/* === Overall review completeness bar === */

.review-completion {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem 1rem;
  border-radius: 0.9rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.review-completion-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.review-completion-label {
  font-weight: 600;
  color: #111827;
}

.review-completion-percent {
  font-weight: 600;
  font-size: 0.82rem;
  color: #111827;
}

.review-completion-bar {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.review-completion-bar-fill {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #3b82f6);
  transition: width 0.25s ease-out;
}

.review-completion-subtext {
  font-size: 0.75rem;
  color: #4b5563;
}
/* Reports page */

.reports-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.report-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.report-main h3 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
}

.report-description {
  margin: 0;
  font-size: 0.85rem;
  color: #4b5563;
}

.report-actions {
  flex-shrink: 0;
}
/* ===== Locked input styling ===== */

.input-locked {
  background: #f3f4f6 !important;
  color: #374151;
  border: 1px solid #d1d5db;
  cursor: not-allowed;
  font-weight: 600;
}

/* Remove blue focus glow */
.input-locked:focus {
  outline: none;
  box-shadow: none;
  border-color: #d1d5db;
}

/* Optional: subtle lock icon effect using padding */
.input-locked {
  padding-right: 2.2rem;
  background-image: linear-gradient(#f3f4f6, #f3f4f6);
}
.validation-error {
  border: 1px solid #dc2626 !important;
  background: #fef2f2 !important;
}
/* ===== System inline alerts (in-app) ===== */
.system-alert {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0 16px;
}

.system-alert__title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 14px;
}

.system-alert__body {
  color: #374151;
  line-height: 1.4;
  font-size: 13px;
  max-width: 900px;
}

/* Error variant */
.system-alert--error {
  border-color: #dc2626;
  background: #fef2f2;
}

/* Ensure hidden works even if other rules exist */
.system-alert.hidden {
  display: none !important;
}

/* Highlight failed document validation dropdown */
.validation-error {
  border: 1px solid #dc2626 !important;
  background: #fef2f2 !important;
}
/* Locked / read-only fields */
.locked-field {
  background-color: #f3f4f6;
  border-color: #e5e7eb;
  color: #6b7280;
  cursor: not-allowed;
}

.locked-field:focus {
  outline: none;
  box-shadow: none;
}

/* Locked select fields (system controlled) */
.select-locked {
  background: #f3f4f6 !important;
  color: #374151;
  border: 1px solid #d1d5db;
  cursor: not-allowed;
  font-weight: 600;
}

.select-locked:focus {
  outline: none;
  box-shadow: none;
  border-color: #d1d5db;
}

.select-locked:disabled {
  opacity: 1;
  -webkit-text-fill-color: #374151;
}
