/* ==========================================================================
   Fintrix Technology Sdn Bhd — Simple Claim System
   Single shared stylesheet. No external assets, no build step.
   ========================================================================== */

:root {
  --brand: #0f4c81;
  --brand-dark: #0b3a63;
  --brand-soft: #e8f1fb;
  --ink: #1f2937;
  --ink-soft: #475569;
  --ink-mute: #64748b;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ok: #166534;
  --ok-bg: #dcfce7;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --neutral-bg: #eef2f7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must win over component display rules. */
[hidden] { display: none !important; }

html { height: 100%; }
body { min-height: 100%; } /* not height: a fixed-height body stops the sticky .topnav after one screen */

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 650; line-height: 1.25; }

/* ---------------------------------------------------------------- top nav */

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 56px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topnav__brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  color: var(--brand);
  margin-right: 14px;
  white-space: nowrap;
}

.topnav__brand small {
  font-weight: 500;
  color: var(--ink-mute);
  font-size: 12px;
}

.topnav__links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }

.topnav__links a {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 7px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.topnav__links a:hover { background: var(--line-soft); color: var(--ink); }
.topnav__links a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; }

.topnav__spacer { flex: 1; }

.topnav__user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-mute);
  font-size: 13px;
  white-space: nowrap;
}

.topnav__user b { color: var(--ink); font-weight: 600; }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}

/* -------------------------------------------------------------- container */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 18px 72px;
}

.container--wide { max-width: 1320px; }
.container--narrow { max-width: 560px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-head h1 { font-size: 22px; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-mute); font-size: 13px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumbs { font-size: 12.5px; color: var(--ink-mute); margin-bottom: 8px; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------- card */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.card__title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
}

.card--flush { padding: 0; overflow: hidden; }
.card--flush .card__head { padding: 16px 20px 0; margin-bottom: 10px; }
.card--flush .table-wrap { padding: 0 0 4px; }

/* ------------------------------------------------------------------ forms */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 14px;
  align-items: end;
}

.form-grid--3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--full { grid-column: 1 / -1; }

.field > label {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.field .hint { font-size: 11.5px; color: var(--ink-mute); }

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="month"], input[type="url"], input[type="email"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  min-width: 0;
}

textarea { resize: vertical; min-height: 64px; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(15, 76, 129, 0.35);
  outline-offset: 1px;
  border-color: var(--brand);
}

input:disabled, select:disabled, textarea:disabled { background: #f8fafc; color: var(--ink-mute); }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover { background: #f8fafc; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn--danger { background: #fff; border-color: #f0b4b4; color: var(--danger); }
.btn--danger:hover { background: #fef2f2; }

.btn--ok { background: #fff; border-color: #a7d8b4; color: var(--ok); }
.btn--ok:hover { background: #f0fdf4; }

.btn--ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn--ghost:hover { background: var(--line-soft); }

.btn--sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn--block { width: 100%; }

.btn-row { display: inline-flex; gap: 4px; }

/* ----------------------------------------------------------------- tables */

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

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 700;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  white-space: nowrap;
}

table.data td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

table.data tbody tr:hover { background: #fbfcfe; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .actions { text-align: right; white-space: nowrap; }
table.data tfoot td { font-weight: 700; border-top: 1px solid var(--line); }

.muted { color: var(--ink-mute); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 2px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.right { text-align: right; }
.strong { font-weight: 650; }

.empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 13.5px;
}

.loading { padding: 22px; text-align: center; color: var(--ink-mute); }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(15, 76, 129, 0.25);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- badges */

.badge {
  display: inline-block;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--neutral-bg);
  color: var(--ink-soft);
  white-space: nowrap;
}

.badge--draft { background: var(--neutral-bg); color: var(--ink-soft); }
.badge--submitted { background: var(--warn-bg); color: var(--warn); }
.badge--approved { background: var(--ok-bg); color: var(--ok); }
.badge--rejected { background: var(--danger-bg); color: var(--danger); }
.badge--pending { background: var(--neutral-bg); color: var(--ink-soft); }
.badge--info { background: var(--brand-soft); color: var(--brand-dark); }

/* ----------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  max-width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  background: #111827;
  color: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
  animation: toast-in 0.16s ease-out;
  overflow-wrap: anywhere;
}

.toast--error { background: #b91c1c; }
.toast--ok { background: #15803d; }

@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- banners */

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 16px;
}

.banner__main { display: flex; flex-direction: column; gap: 4px; }
.banner__title { font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner__meta { color: var(--ink-mute); font-size: 12.5px; }
.banner__note {
  margin-top: 6px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
  max-width: 640px;
}
.banner__note b { color: var(--ink); }

.banner--approved { border-left-color: #16a34a; }
.banner--rejected { border-left-color: #dc2626; }
.banner--submitted { border-left-color: #f59e0b; }
.banner--draft { border-left-color: #94a3b8; }

.callout {
  padding: 11px 13px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.callout--warn { background: #fffbeb; border-color: #fcd34d; color: #78350f; }
.callout--error { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
.callout--ok { background: #f0fdf4; border-color: #86efac; color: #14532d; }
.callout b { color: inherit; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.kv dt { color: var(--ink-mute); }
.kv dd { margin: 0; font-weight: 600; }

/* ------------------------------------------------------------ ESMF-01 form */

.esmf {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px 28px 30px;
  margin: 0 auto 20px;
  max-width: 940px;
  color: #0f172a;
}

.esmf__code { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; color: #0f172a; }

.esmf__head { text-align: center; margin: 2px 0 18px; }
.esmf__head h1 { font-size: 19px; margin: 0 0 2px; letter-spacing: 0.01em; }
.esmf__head h2 { font-size: 14px; font-weight: 600; margin: 0; color: #1f2937; }

.esmf__meta {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 13px;
}

.esmf__meta td { padding: 3px 4px; vertical-align: bottom; }
.esmf__meta .lbl { white-space: nowrap; font-weight: 600; width: 1%; }
.esmf__meta .val {
  border-bottom: 1px solid #94a3b8;
  padding-left: 6px;
  min-width: 90px;
  font-weight: 600;
}
.esmf__meta .gap { width: 18px; }

table.esmf__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.esmf__table th {
  border: 1px solid #94a3b8;
  padding: 6px 9px;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  background: #f1f5f9;
  font-weight: 700;
}

table.esmf__table th.amt, table.esmf__table td.amt {
  text-align: right;
  width: 150px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.esmf__table td { border: 1px solid #94a3b8; padding: 6px 9px; vertical-align: top; }

.esmf__cat { font-weight: 600; }
.esmf__sub td:first-child { padding-left: 26px; }
.esmf__subsub td:first-child { padding-left: 44px; }

.esmf__items { margin-top: 3px; font-size: 11.5px; color: #475569; line-height: 1.45; }
.esmf__items span { display: block; }
.esmf__items .it-amt { display: inline; color: #64748b; }
.esmf__items .line__text, .esmf__items .line__amt, .esmf__items .line__why { display: inline; }

.esmf__tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
}

.esmf__tag--approved { background: var(--ok-bg); color: var(--ok); }
.esmf__tag--rejected { background: var(--danger-bg); color: var(--danger); }
.esmf__tag--pending { background: var(--neutral-bg); color: var(--ink-soft); }

tr.esmf__net td { font-weight: 700; background: #f8fafc; font-size: 13.5px; }
tr.esmf__subtotal td { font-weight: 600; }
tr.esmf__less td { color: var(--danger); font-weight: 600; }
.esmf__items .line--rejected .line__text, .esmf__items .line--rejected .line__amt, .esmf__items .line--rejected .it-amt { text-decoration: line-through; color: #94a3b8; }
.esmf__items .line__why { color: var(--danger); font-weight: 600; font-size: 11.5px; }
.esmf__net-label { text-align: right; letter-spacing: 0.03em; }

.esmf__note { margin-top: 6px; font-size: 12px; color: #475569; }

.esmf__section-title {
  margin-top: 22px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

table.esmf__docs {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 8px;
}

table.esmf__docs th {
  border: 1px solid #94a3b8;
  background: #f1f5f9;
  padding: 5px 8px;
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

table.esmf__docs td { border: 1px solid #94a3b8; padding: 5px 8px; vertical-align: top; }
table.esmf__docs .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.esmf__docs .docno { width: 52px; text-align: center; white-space: nowrap; }
table.esmf__docs .soft { width: 110px; white-space: nowrap; }

table.esmf__sig {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 11.5px;
}

table.esmf__sig th {
  border: 1px solid #94a3b8;
  background: #f8fafc;
  padding: 5px 8px;
  font-size: 11px;
  text-align: left;
}

table.esmf__sig td {
  border: 1px solid #94a3b8;
  height: 74px;
  vertical-align: bottom;
  padding: 6px 8px;
  color: #475569;
  font-size: 11.5px;
}

table.esmf__sig td .sigline { display: block; border-top: 1px solid #cbd5e1; margin-top: 26px; padding-top: 3px; }

/* ----------------------------------------------------- item review panel */

.items-review { display: flex; flex-direction: column; gap: 12px; }

.item-row {
  border: 1px solid var(--line);
  border-left: 4px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.item-row--approved { border-left-color: #16a34a; }
.item-row--rejected { border-left-color: #dc2626; }

.item-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.item-row__title { font-weight: 650; font-size: 13.5px; }
.item-row__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; }
.item-row__grid .field--wide { grid-column: span 2; }
.item-row__foot { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.item-row__foot .field { flex: 1 1 260px; }

.seg { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 7px; overflow: hidden; }
.seg button {
  border: none;
  background: #fff;
  padding: 6px 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.seg button + button { border-left: 1px solid #cbd5e1; }
.seg button.is-on-ok { background: var(--ok-bg); color: var(--ok); }
.seg button.is-on-no { background: var(--danger-bg); color: var(--danger); }
.seg button.is-on-pending { background: var(--neutral-bg); color: var(--ink); }

/* ------------------------------------------------------------- upload UI */

.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 22px 18px;
  text-align: center;
  color: var(--ink-mute);
  background: #fbfcfe;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.dropzone strong { color: var(--ink); display: block; margin-bottom: 3px; }
.dropzone .small { font-size: 12px; }

.extract {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfcfe;
}

.extract__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.extract__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; font-size: 12.5px; }
.extract__grid dt { color: var(--ink-mute); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.extract__grid dd { margin: 0 0 6px; font-weight: 600; overflow-wrap: anywhere; }

.receipt-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.receipt-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  flex-wrap: wrap;
}

.receipt-list .name { font-weight: 600; overflow-wrap: anywhere; }
.receipt-list .grow { flex: 1 1 auto; }

.thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  flex: 0 0 auto;
}

/* ------------------------------------------------------------ login page */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background: linear-gradient(180deg, #eef4fb 0%, var(--bg) 55%);
}

.auth__card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.09);
  padding: 28px 26px;
}

.auth__brand { text-align: center; margin-bottom: 20px; }
.auth__brand h1 { font-size: 19px; margin: 0; }
.auth__brand p { margin: 4px 0 0; color: var(--ink-mute); font-size: 12.5px; }

.auth__logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  margin: 0 auto 12px;
}

.auth form { display: flex; flex-direction: column; gap: 13px; }



/* ---------------------------------------------------------------- dialog */

dialog.modal {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
  color: var(--ink);
}

dialog.modal::backdrop { background: rgba(15, 23, 42, 0.45); }
dialog.modal .modal__head { padding: 16px 20px 0; }
dialog.modal .modal__title { font-size: 16px; font-weight: 650; margin: 0; }
dialog.modal .modal__body { padding: 16px 20px; }
dialog.modal .modal__foot {
  padding: 12px 20px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------- utilities */

.split-2 { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; align-items: start; }

@media (max-width: 980px) {
  .split-2 { grid-template-columns: 1fr; }
}

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.total-strip {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  font-size: 13px;
}

.total-strip div { display: flex; flex-direction: column; }
.total-strip dt, .total-strip .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-mute); }
.total-strip .val { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }

.fuel-calc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 12px;
  align-items: end;
}

.fuel-calc__result {
  grid-column: 1 / -1;
  font-size: 13px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 7px;
  padding: 8px 11px;
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------------- print */

@media print {
  @page { size: A4 portrait; margin: 12mm; }

  html, body { background: #fff; }

  .topnav, .no-print, .toasts, .page-head__actions, .print-hide, .breadcrumbs { display: none !important; }

  .container, .container--wide, .container--narrow { max-width: none; padding: 0; margin: 0; }

  .card { border: none; box-shadow: none; padding: 0; margin: 0 0 6mm; }

  .esmf {
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-width: none;
    margin: 0 0 6mm;
  }

  table.esmf__table th, table.esmf__table td,
  table.esmf__docs th, table.esmf__docs td,
  table.esmf__sig th, table.esmf__sig td { border: 1px solid #000; }

  table.esmf__table th, table.esmf__docs th, table.esmf__sig th { background: #fff !important; }
  tr.esmf__net td { background: #fff !important; }

  .esmf__meta .val { border-bottom: 1px solid #000; }

  .badge, .esmf__tag {
    background: none !important;
    color: #000 !important;
    border: 1px solid #000;
  }

  a { color: #000; text-decoration: none; }

  .banner { border: 1px solid #000; border-left: 4px solid #000; padding: 6px 8px; margin-bottom: 4mm; }
  .banner__note { border: none; background: none; padding: 0; }
  .banner .total-strip { padding: 4px 0; border: none; background: none; gap: 16px; }
  .banner .total-strip .val { font-size: 12px; }

  table.esmf__sig td { height: 46px; }
  table.esmf__sig td .sigline { margin-top: 18px; }
  .esmf__section-title { margin-top: 3mm; }
  table.esmf__docs { margin-top: 3mm; }
  .esmf__note { margin-top: 2px; }

  tr, .esmf__sig, table.esmf__docs tr { page-break-inside: avoid; }

  .esmf__section-title { margin-top: 5mm; }
  table.esmf__docs .soft { display: none; } /* on-screen "View" column only */
  .print-attachments { display: block !important; }
  .att-page { break-before: page; page-break-before: always; page: attachment; }
  .att-page__img { display: block; max-width: 100%; max-height: 284mm; margin: 0 auto; object-fit: contain; }
  .att-sheet { width: 100%; border-collapse: collapse; font-size: 7.5pt; }
  .att-sheet th, .att-sheet td { border: 1px solid #94a3b8; padding: 1.2mm 1.5mm; text-align: left; vertical-align: top; }
  .att-sheet th { background: #eef2f7 !important; }
  .att-sheet tr { break-inside: avoid; }
  table.esmf__table tr, table.esmf__docs tr { break-inside: avoid; }

  .print-only { display: block !important; }
}

.print-only { display: none; }
.print-attachments { display: none; }

/* ------------------------------------------------ multi-select item table */

th.sel, td.sel { width: 34px; padding-right: 0; text-align: center; }
th.sel input, td.sel input { width: 15px; height: 15px; margin: 0; cursor: pointer; accent-color: var(--brand); }
th.sel.sel--off input, td.sel:empty { visibility: hidden; }
tr.row-selected > td { background: var(--brand-soft); }
tr.row-editing select { min-width: 84px; }
tr.row-editing td:nth-child(3) select { min-width: 150px; }
tr.row-editing td:nth-child(4) input { min-width: 160px; }
tr.row-editing td:nth-child(7) input, tr.row-editing td:nth-child(8) input { min-width: 72px; }

.bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 20px 10px;
  padding: 8px 12px;
  border: 1px solid #bfd4ea;
  border-radius: 8px;
  background: var(--brand-soft);
  position: sticky;
  top: 64px;
  z-index: 5;
}
.bulk-bar select, .bulk-bar input { width: auto; min-width: 0; padding-top: 4px; padding-bottom: 4px; }
.bulk-bar select { max-width: 230px; }
.bulk-bar__fx { width: 90px !important; }
.bulk-bar__sep { width: 1px; align-self: stretch; background: #bfd4ea; }
.bulk-bar__spacer { flex: 1; }

/* ------------------------------------------------------ FX policy (prices) */

.fx-policy { margin: 0 0 14px; padding-left: 20px; color: var(--ink-soft); font-size: 13px; }
.fx-policy li + li { margin-top: 3px; }
.fx-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { width: auto; margin-top: 3px; accent-color: var(--brand); }
.choice > span { display: flex; flex-direction: column; gap: 2px; }
.bnm-cache { max-height: 260px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 8px; }
.fx-src { display: block; font-size: 11px; color: var(--ink-mute); white-space: nowrap; }
.fx-src--estimate, .fx-src--unknown { color: var(--warn); font-weight: 600; }
.fx-src--statement { color: var(--ok); font-weight: 600; }
@media (max-width: 760px) { .fx-choice { grid-template-columns: 1fr; } }

/* ------------------------------------------------------ attachment chips */

.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: 26px;
  padding: 0 8px 0 6px;
  border: 1px solid #bfd4ea;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: zoom-in;
  max-width: 100%;
  vertical-align: middle;
}
.doc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-chip:hover, .doc-chip:focus-visible { background: #d6e6f7; border-color: var(--brand); outline: none; }
.doc-chip--icon { width: 26px; padding: 0; justify-content: center; }
.doc-chip__icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.desc-cell { display: flex; align-items: center; gap: 8px; }
.doc-name { display: flex; align-items: center; gap: 10px; }
.item-row__docs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.item-row__docs .doc-chip { max-width: 260px; }
.assistant__file > .doc-chip { align-self: center; }
.assistant__retry { align-self: center; flex: none; }

.doc-pop {
  position: fixed;
  z-index: 300;
  width: 300px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
  pointer-events: none;
}
.doc-pop__frame {
  display: grid;
  place-items: center;
  min-height: 120px;
  max-height: 380px;
  overflow: hidden;
  border-radius: 6px;
  background: #f1f4f8;
}
.doc-pop__img { display: block; max-width: 100%; max-height: 380px; object-fit: contain; }
.doc-pop__cap { display: flex; flex-direction: column; gap: 1px; padding: 6px 2px 0; font-size: 12px; color: var(--ink-mute); }
.doc-pop__cap b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-pop__hint { color: var(--brand); }

.doc-modal {
  width: min(1000px, 94vw);
  height: min(92vh, 1100px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
}
.doc-modal[open] { display: flex; flex-direction: column; }
.doc-modal::backdrop { background: rgba(15, 23, 42, 0.55); }
.doc-modal__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
}
.doc-modal__heading { flex: 1; min-width: 0; }
.doc-modal__title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-modal__sub { font-size: 12px; color: var(--ink-mute); }
.doc-modal__close { font-size: 16px; }
.doc-modal__body { position: relative; flex: 1; min-height: 0; background: #e9edf2; }
.doc-modal__stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: auto; }
.doc-modal__pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.doc-modal__img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; background: #fff; box-shadow: 0 2px 12px rgba(15, 23, 42, 0.15); }
.doc-modal__img.is-zoomed { max-width: none; max-height: none; cursor: zoom-out; align-self: start; justify-self: start; }
.doc-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 64px;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.doc-modal__nav:hover { background: rgba(15, 23, 42, 0.75); }
.doc-sheet { align-self: stretch; justify-self: stretch; display: flex; flex-direction: column; min-height: 0; width: 100%; height: 100%; background: #fff; }
.doc-sheet__tabs { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc-sheet__body { flex: 1; overflow: auto; }
.doc-sheet__table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.doc-sheet__table th, .doc-sheet__table td { border: 1px solid #d5dce5; padding: 5px 9px; white-space: nowrap; text-align: left; }
.doc-sheet__table th { position: sticky; top: 0; background: #eef2f7; font-weight: 650; }
.doc-sheet__rownum { color: var(--ink-mute); background: #f7f9fb; text-align: right !important; }
.doc-modal__nav--prev { left: 10px; }
.doc-modal__nav--next { right: 10px; }

/* ------------------------------------------------------ claims assistant */

/* Docked on the right of every staff page; body makes room while it is open. */
:root { --assistant-w: 400px; }
body.assistant-open { padding-right: var(--assistant-w); }
body.assistant-open .topnav { margin-right: calc(-1 * var(--assistant-w)); }
body.assistant-open .toasts { right: calc(var(--assistant-w) + 18px); }

.assistant {
  position: fixed;
  top: 56px;
  right: 0;
  bottom: 0;
  width: var(--assistant-w);
  z-index: 35;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
}
.assistant[hidden] { display: none; }

.assistant-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 6px;
  border: 0;
  border-radius: 99px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.22);
}
.assistant-launcher:hover { background: var(--brand-dark); }
.assistant-launcher .assistant__avatar { width: 30px; height: 30px; background: #fff; color: var(--brand); }

.assistant__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.assistant__avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: 0.03em;
}
.assistant__head-text { flex: 1; min-width: 0; }
.assistant__title { font-weight: 650; }
.assistant__hide { font-size: 16px; }
.assistant__sub { font-size: 12px; color: var(--ink-mute); }

.assistant__log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafbfd;
}

.assistant__msg {
  max-width: 92%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  animation: assistant-in 0.18s ease-out;
}
.assistant__msg--bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.assistant__msg--user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.assistant__msg--job { width: 92%; }
.assistant__msg--warn { background: #fffbeb; border-color: #fcd34d; color: #78350f; }
.assistant__msg--error { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
@keyframes assistant-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.assistant__rich p { margin: 0 0 6px; }
.assistant__rich p:last-child { margin-bottom: 0; }
.assistant__rich ul { margin: 2px 0 6px; padding-left: 18px; }
.assistant__steps { list-style: none; margin: 0 0 6px; padding: 0; font-size: 12.5px; color: var(--ink-soft); }
.assistant__steps li { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; }
.assistant__steps li .spinner { width: 11px; height: 11px; flex: none; align-self: center; }
.assistant__steps li.is-done .assistant__step-mark { color: var(--ok); font-weight: 700; }
.assistant__steps li.is-failed .assistant__step-mark { color: var(--danger); font-weight: 700; }
.assistant__steps li.is-note { font-style: italic; color: var(--ink-mute); display: block; }
.assistant__trace { margin-bottom: 6px; font-size: 12px; }
.assistant__trace summary { cursor: pointer; color: var(--ink-mute); }
.assistant__trace .assistant__steps { margin-top: 4px; }
.assistant__table { overflow-x: auto; margin: 4px 0 8px; }
.assistant__table table { border-collapse: collapse; font-size: 12px; width: 100%; }
.assistant__table th, .assistant__table td { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
.assistant__table th { background: var(--neutral-bg); font-weight: 650; }
.assistant__rich code { font-family: var(--mono); font-size: 12px; background: var(--neutral-bg); padding: 0 4px; border-radius: 4px; }

.assistant__thumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.assistant__thumb {
  width: 38px; height: 38px; flex: none;
  object-fit: cover;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
}
.assistant__thumb--doc { display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--danger); }
.assistant__thumb--sheet { color: var(--ok); }
.assistant__thumb--more { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-soft); }

.assistant__bar { height: 5px; margin: 8px 0 4px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; }
.assistant__bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.3s ease; }

.assistant__files { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.assistant__file {
  display: flex;
  gap: 9px;
  padding: 7px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: #fbfcfe;
  transition: background 0.3s, border-color 0.3s;
}
.assistant__file.is-queued { opacity: 0.6; }
.assistant__file.is-reading { border-color: #bfd4ea; background: var(--brand-soft); }
.assistant__file.is-ok { border-color: #bbf7d0; background: #f0fdf4; }
.assistant__file.is-warn { border-color: #fde68a; background: #fffbeb; }
.assistant__file.is-error { border-color: #fecaca; background: #fef2f2; color: var(--danger); }
.assistant__file-body { min-width: 0; flex: 1; font-size: 12.5px; }
.assistant__file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assistant__file-status .spinner { width: 11px; height: 11px; vertical-align: -1px; }
.assistant__file-status { color: var(--ink-soft); }
.assistant__file-desc { color: var(--ink); }
.assistant__file-dup { color: var(--warn); font-weight: 600; }

.assistant__claim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.assistant__note { margin-top: 8px; color: var(--warn); font-weight: 600; font-size: 12.5px; }

.assistant__typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.assistant__typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-mute);
  animation: assistant-dot 1s infinite ease-in-out;
}
.assistant__typing i:nth-child(2) { animation-delay: 0.15s; }
.assistant__typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes assistant-dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.assistant__composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}
.assistant__composer textarea { flex: 1; resize: none; min-height: 34px; max-height: 140px; padding: 7px 10px; font: inherit; line-height: 1.4; }
.assistant__attach { font-size: 15px; padding-left: 9px; padding-right: 9px; }

.assistant__drop {
  position: absolute;
  inset: 8px;
  z-index: 5;
  display: grid;
  place-items: center;
  border: 2px dashed var(--brand);
  border-radius: 12px;
  background: rgba(232, 241, 251, 0.94);
  pointer-events: none;
}
.assistant__drop-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--brand-dark); text-align: center; }
.assistant__drop-inner span { font-size: 12px; color: var(--ink-mute); }
.assistant__drop-icon { font-size: 34px; line-height: 1; }

tr.row-flash > td { animation: row-flash 2.2s ease-out; }
@keyframes row-flash { 0%, 30% { background: #fff4c2; } 100% { background: transparent; } }

/* Narrow screens: the panel overlays the page instead of squeezing it. */
@media (max-width: 1100px) {
  body.assistant-open { padding-right: 0; }
  body.assistant-open .topnav { margin-right: 0; }
  body.assistant-open .toasts { right: 18px; }
  .assistant { width: min(var(--assistant-w), 100vw); box-shadow: -8px 0 24px rgba(15, 23, 42, 0.18); }
}

@media print {
  .assistant, .assistant-launcher { display: none !important; }
  body.assistant-open { padding-right: 0; }
  body.assistant-open .topnav { margin-right: 0; }
}
