/* ============================================================
   Money Approval — house style
   Ink, ivory and brass. Serif for money, sans for everything else.
   ============================================================ */

:root {
  --ink:        #0E1116;
  --ink-deep:   #070A0E;
  --ink-soft:   #1A1F27;
  --ink-line:   #262D38;

  --paper:      #F6F3ED;
  --paper-warm: #FBF9F5;
  --card:       #FFFFFF;
  --rule:       #E6E0D4;
  --rule-soft:  #F0EBE1;

  --text:       #14171C;
  --text-mid:   #4A5260;
  --text-dim:   #7C8494;
  --text-invert:#EFE9DC;

  --brass:      #A8823F;
  --brass-lift: #C9A45F;
  --brass-pale: #F2E8D3;
  --brass-deep: #7A5D28;

  --emerald:    #2C6A51;
  --emerald-pale:#E4EEE8;
  --garnet:     #8E2F3B;
  --garnet-pale:#F5E4E5;
  --indigo:     #3C4D80;
  --indigo-pale:#E5E9F3;
  --slate:      #5D6470;
  --slate-pale: #ECEDEF;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;

  --radius: 4px;
  --radius-lg: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 20, 28, .05), 0 1px 1px rgba(16, 20, 28, .03);
  --shadow-md: 0 4px 20px rgba(16, 20, 28, .07), 0 1px 3px rgba(16, 20, 28, .05);
  --shadow-lg: 0 18px 50px rgba(16, 20, 28, .14);
  --sidebar-w: 252px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }

/* ---------------------------- shell ---------------------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--ink);
  color: var(--text-invert);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--ink-line);
}

.sidebar::after {
  /* the brass hairline that runs the height of the rail */
  content: '';
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(168,130,63,.55) 18%, rgba(168,130,63,.55) 82%, transparent);
}

.brand {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--ink-line);
}
.brand-mark {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #FFF;
  line-height: 1.1;
}
.brand-mark em {
  font-style: normal;
  color: var(--brass-lift);
}
.brand-sub {
  margin-top: 7px;
  font-size: 10.5px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: #8B93A3;
}

.nav { padding: 18px 14px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #6C7486;
  padding: 14px 10px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius);
  color: #C4CAD6;
  font-size: 13.5px;
  margin-bottom: 1px;
  transition: background .15s ease, color .15s ease;
  position: relative;
}
.nav-item:hover { background: var(--ink-soft); color: #FFF; }
.nav-item.is-active {
  background: var(--ink-soft);
  color: #FFF;
  font-weight: 500;
}
.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: -14px; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 20px;
  background: var(--brass-lift);
  border-radius: 0 2px 2px 0;
}
.nav-item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .85; }
.nav-count {
  margin-left: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  background: var(--brass);
  color: #14171C;
  min-width: 20px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-foot {
  border-top: 1px solid var(--ink-line);
  padding: 16px 18px;
}
.who { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  color: #14171C;
  background: linear-gradient(145deg, var(--brass-lift), var(--brass-deep));
  flex: 0 0 34px;
}
.who-name { font-size: 13px; color: #FFF; font-weight: 500; line-height: 1.25; }
.who-role {
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-lift);
}
.signout {
  margin-top: 13px;
  width: 100%;
  background: none;
  border: 1px solid var(--ink-line);
  color: #97A0B0;
  padding: 7px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s ease;
}
.signout:hover { border-color: #3A4250; color: #FFF; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 40px 0;
}
.topbar-titles { flex: 1; min-width: 0; }
.eyebrow {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 6px;
}
.page-title {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.page-sub { color: var(--text-dim); font-size: 13px; margin-top: 5px; }

.content { padding: 26px 40px 56px; flex: 1; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 17px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  line-height: 1.4;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: var(--ink);
  color: #FFF;
  border-color: var(--ink);
}
.btn-primary:hover { background: #000; box-shadow: var(--shadow-md); }
.btn-brass {
  background: linear-gradient(160deg, var(--brass-lift), var(--brass));
  color: #191307;
  border-color: var(--brass-deep);
  font-weight: 600;
}
.btn-brass:hover { filter: brightness(1.06); box-shadow: 0 4px 16px rgba(168,130,63,.32); }
.btn-ghost {
  background: var(--card);
  border-color: var(--rule);
  color: var(--text-mid);
}
.btn-ghost:hover { border-color: #CFC6B4; color: var(--text); }
.btn-danger {
  background: var(--card);
  border-color: #E2C3C6;
  color: var(--garnet);
}
.btn-danger:hover { background: var(--garnet); color: #FFF; border-color: var(--garnet); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------------------------- cards ---------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 17px 22px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  align-items: center;
  gap: 14px;
}
.card-title {
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-mid);
  font-weight: 600;
}
.card-body { padding: 22px; }
.card-foot {
  padding: 13px 22px;
  border-top: 1px solid var(--rule-soft);
  background: var(--paper-warm);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.spacer { margin-left: auto; }

/* --------------------------- stat row -------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 19px 20px 17px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--rule);
}
.stat.is-brass::before   { background: linear-gradient(90deg, var(--brass), var(--brass-lift)); }
.stat.is-emerald::before { background: var(--emerald); }
.stat.is-garnet::before  { background: var(--garnet); }
.stat.is-indigo::before  { background: var(--indigo); }
.stat-label {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 9px;
}
.stat-value {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.stat-value.is-sm { font-size: 24px; }
.stat-note { font-size: 12px; color: var(--text-dim); margin-top: 7px; }
.stat-note strong { color: var(--text-mid); font-weight: 500; }

/* ---------------------------- pills ---------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.pill.no-dot::before { display: none; }
.pill-brass   { background: var(--brass-pale);  color: var(--brass-deep); border-color: #E4D4B2; }
.pill-emerald { background: var(--emerald-pale); color: var(--emerald);   border-color: #CCE0D5; }
.pill-garnet  { background: var(--garnet-pale);  color: var(--garnet);    border-color: #EBCED1; }
.pill-indigo  { background: var(--indigo-pale);  color: var(--indigo);    border-color: #CFD7E9; }
.pill-slate   { background: var(--slate-pale);   color: var(--slate);     border-color: #DDDFE3; }

.tag {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2px 7px;
}

/* ---------------------------- table ---------------------------- */

.table-wrap { overflow-x: auto; }
table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.grid th {
  text-align: left;
  font-size: 9.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  padding: 0 18px 11px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.grid td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
table.grid tbody tr { transition: background .12s ease; }
table.grid tbody tr:hover { background: var(--paper-warm); }
table.grid tbody tr:last-child td { border-bottom: none; }
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.amount-cell {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.ref {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.row-title { font-weight: 500; color: var(--text); }
.row-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.link-row:hover .row-title { color: var(--brass-deep); }

/* --------------------------- progress -------------------------- */

.meter {
  height: 5px;
  background: var(--rule-soft);
  border-radius: 3px;
  overflow: hidden;
  min-width: 70px;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--emerald), #3E8A6B);
}
.meter.is-brass > span { background: linear-gradient(90deg, var(--brass), var(--brass-lift)); }
.meter.is-garnet > span { background: var(--garnet); }

.bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: baseline;
  margin-bottom: 14px;
}
.bar-track {
  grid-column: 1 / -1;
  height: 6px;
  background: var(--rule-soft);
  border-radius: 3px;
  overflow: hidden;
}
.bar-track > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--brass-deep), var(--brass-lift));
  border-radius: 3px;
}
.bar-name { font-size: 13px; }
.bar-value { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-mid); }

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

.field { margin-bottom: 18px; }
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 18px;
}
label.lbl {
  display: block;
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-mid);
  font-weight: 600;
  margin-bottom: 7px;
}
.lbl .opt { color: var(--text-dim); font-weight: 400; letter-spacing: .06em; text-transform: none; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(168,130,63,.13);
}
input::placeholder, textarea::placeholder { color: #AEB4BE; }
textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%237C8494' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.hint { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; }

.money-input { position: relative; }
.money-input .cur {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-dim);
  pointer-events: none;
  font-weight: 500;
}
.money-input input {
  padding-left: 46px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.words-preview {
  margin-top: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--brass-deep);
  min-height: 20px;
}

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  cursor: pointer;
  background: var(--card);
  transition: all .15s ease;
  display: block;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: #CFC6B4; }
.choice-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.choice-desc { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.45; }
.choice input:checked ~ .choice-title { color: var(--brass-deep); }
.choice:has(input:checked) {
  border-color: var(--brass);
  background: linear-gradient(180deg, #FDFBF6, var(--card));
  box-shadow: 0 0 0 3px rgba(168,130,63,.12);
}
.choice-check {
  position: absolute;
  top: 14px; right: 14px;
  width: 16px; height: 16px;
  border: 1px solid var(--rule);
  border-radius: 50%;
}
.choice:has(input:checked) .choice-check {
  border-color: var(--brass);
  background: var(--brass);
  box-shadow: inset 0 0 0 3px var(--card);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-warm);
}
.check input { margin: 2px 0 0; accent-color: var(--brass); width: 15px; height: 15px; }
.check-title { font-weight: 500; }
.check-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

fieldset { border: none; margin: 0; padding: 0; }
.legend {
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--brass-deep);
  font-weight: 600;
  padding-bottom: 11px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 10px;
}
.legend .n {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--brass-lift);
  display: grid; place-items: center;
  font-size: 10px;
  letter-spacing: 0;
}

/* ---------------------------- alerts --------------------------- */

.alert {
  display: flex;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid;
  align-items: flex-start;
}
.alert-success { background: var(--emerald-pale); border-color: #C6DCD0; color: #1F4F3B; }
.alert-error   { background: var(--garnet-pale);  border-color: #EBCED1; color: #6F242E; }
.alert svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------------------------- misc ----------------------------- */

.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-dim);
}
.empty-mark {
  font-family: var(--serif);
  font-size: 40px;
  color: var(--rule);
  margin-bottom: 10px;
}
.empty h3 { font-family: var(--serif); font-size: 20px; color: var(--text-mid); margin-bottom: 6px; }
.empty p { margin: 0 0 18px; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }
.stack { display: grid; gap: 22px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rule { height: 1px; background: var(--rule-soft); margin: 20px 0; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 11px 22px; font-size: 13px; }
.dl dt {
  color: var(--text-dim);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding-top: 2px;
}
.dl dd { margin: 0; color: var(--text); }
.dl dd.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.filters select, .filters input { width: auto; min-width: 150px; padding: 8px 12px; font-size: 13px; }
.filters input[type=search] { min-width: 230px; }

.seg {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.seg a {
  padding: 8px 15px;
  font-size: 12.5px;
  color: var(--text-mid);
  border-right: 1px solid var(--rule);
  transition: all .15s ease;
}
.seg a:last-child { border-right: none; }
.seg a:hover { background: var(--paper-warm); }
.seg a.is-on { background: var(--ink); color: #FFF; font-weight: 500; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 4px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--rule);
}
.tl-item { position: relative; padding-bottom: 18px; font-size: 13px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -22px; top: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--rule);
}
.tl-item.is-mark::before { border-color: var(--brass); background: var(--brass); }
.tl-when { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 24px; font-size: 13px; }
.pagination a, .pagination span {
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-mid);
}
.pagination .is-on { background: var(--ink); color: #FFF; border-color: var(--ink); }
.pagination .muted { opacity: .45; }

.file-list { display: grid; gap: 8px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--paper-warm);
}
.file-item svg { width: 16px; height: 16px; color: var(--text-dim); flex: 0 0 16px; }
.file-size { margin-left: auto; font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ------------------------ decision panel ----------------------- */

.decision {
  background: linear-gradient(168deg, var(--ink), var(--ink-deep));
  color: var(--text-invert);
  border-radius: var(--radius-lg);
  padding: 26px;
  border: 1px solid var(--ink-line);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.decision::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass-lift), transparent);
}
.decision .lbl { color: #8B93A3; }
.decision h3 {
  font-family: var(--serif);
  font-size: 22px;
  color: #FFF;
  margin-bottom: 6px;
}
.decision p.lede { color: #9BA3B2; font-size: 13px; margin: 0 0 20px; }
.decision input, .decision textarea, .decision select {
  background: rgba(255,255,255,.05);
  border-color: var(--ink-line);
  color: #FFF;
}
.decision input::placeholder, .decision textarea::placeholder { color: #6C7486; }
.decision input:focus, .decision textarea:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(168,130,63,.2);
}
.decision .money-input .cur { color: #8B93A3; }
.decision .rule { background: var(--ink-line); }

.verdict {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid;
  margin-bottom: 22px;
}
.verdict-approved { background: var(--emerald-pale); border-color: #C6DCD0; }
.verdict-rejected { background: var(--garnet-pale); border-color: #EBCED1; }
.verdict-pending  { background: var(--brass-pale); border-color: #E4D4B2; }
.verdict-cancelled{ background: var(--slate-pale); border-color: #DDDFE3; }
.verdict-seal {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: 0 0 44px;
  border: 1.5px solid currentColor;
}
.verdict-seal svg { width: 20px; height: 20px; }
.verdict h4 { font-family: var(--serif); font-size: 19px; }
.verdict p { margin: 2px 0 0; font-size: 12.5px; opacity: .85; }
.verdict-approved, .verdict-approved h4 { color: var(--emerald); }
.verdict-rejected, .verdict-rejected h4 { color: var(--garnet); }
.verdict-pending,  .verdict-pending h4  { color: var(--brass-deep); }
.verdict-cancelled,.verdict-cancelled h4{ color: var(--slate); }

.hero-amount {
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-words {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--brass-deep);
  margin-top: 8px;
}

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

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--ink);
}
.login-art {
  position: relative;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-invert);
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(168,130,63,.20), transparent 62%),
    radial-gradient(760px 420px at 92% 105%, rgba(60,77,128,.24), transparent 60%),
    linear-gradient(158deg, #0E1116, #070A0E);
}
.login-art::after {
  content: '';
  position: absolute;
  inset: 34px;
  border: 1px solid rgba(168,130,63,.22);
  border-radius: 3px;
  pointer-events: none;
}
.login-art .brand-mark { font-size: 32px; }
.login-quote {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.32;
  max-width: 15em;
  color: #F1ECE1;
  font-weight: 400;
}
.login-quote span { color: var(--brass-lift); }
.login-meta { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #6C7486; }

.login-form-wrap {
  background: var(--paper);
  display: grid;
  place-items: center;
  padding: 40px;
}
.login-card { width: 100%; max-width: 370px; }
.login-card h1 {
  font-family: var(--serif);
  font-size: 32px;
  margin-bottom: 6px;
}
.login-card .lede { color: var(--text-dim); font-size: 13.5px; margin: 0 0 30px; }
.login-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
}

/* ------------------------ phone chrome ------------------------- */
/* Rendered on every page; revealed only under the phone breakpoint. */

.mtop, .mtabs { display: none; }

.mtop {
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  gap: 12px;
  background: rgba(14, 17, 22, .94);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ink-line);
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}
.mtop-brand {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #FFF;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mtop-brand em { font-style: normal; color: var(--brass-lift); }
.mtop-avatar {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #14171C;
  background: linear-gradient(145deg, var(--brass-lift), var(--brass-deep));
  cursor: pointer;
}
.mtop-sheet {
  position: absolute;
  top: calc(100% + 8px);
  right: 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  min-width: 190px;
}
.mtop-sheet-name { font-weight: 600; font-size: 14px; }
.mtop-sheet-role {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brass-deep); margin-bottom: 12px;
}

.mtabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  justify-content: space-around;
  align-items: stretch;
  background: rgba(14, 17, 22, .95);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--ink-line);
  padding-bottom: env(safe-area-inset-bottom);
}
.mtab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 2px 8px;
  min-height: 52px;
  color: #7E8797;
  font-size: 9.5px;
  letter-spacing: .04em;
  position: relative;
  text-align: center;
}
.mtab svg { width: 21px; height: 21px; }
.mtab span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mtab.is-on { color: var(--brass-lift); }
.mtab.is-on::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 2px;
  background: var(--brass-lift);
  border-radius: 0 0 2px 2px;
}
.mtab-add {
  flex: 0 0 58px;
  color: #191307;
}
.mtab-add svg {
  width: 40px; height: 40px;
  padding: 9px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--brass-lift), var(--brass));
  box-shadow: 0 3px 12px rgba(168,130,63,.4);
  stroke-width: 2;
}
.mtab-dot {
  position: absolute;
  top: 5px;
  left: 50%;
  margin-left: 4px;
  background: var(--garnet);
  color: #FFF;
  font-style: normal;
  font-size: 9px;
  font-weight: 600;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* --------------------- language switcher ----------------------- */

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 20px;
  overflow: hidden;
  background: var(--card);
}
.lang-switch a {
  padding: 5px 11px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  color: var(--text-dim);
  min-width: 38px;
  text-align: center;
}
.lang-switch a.is-on { background: var(--ink); color: var(--brass-lift); }
.lang-switch.on-dark { border-color: var(--ink-line); background: transparent; }
.lang-switch.on-dark a { color: #7E8797; }
.lang-switch.on-dark a.is-on { background: var(--ink-soft); color: var(--brass-lift); }
.sidebar-foot .lang-switch { display: flex; width: 100%; margin-bottom: 14px; }
.sidebar-foot .lang-switch a { flex: 1; }
.lang-switch.compact a { padding: 5px 9px; min-width: 34px; }

/* ------------------ MacBook and large screens ------------------ */
/* The default rules above are the desktop layout. */

@media (min-width: 1400px) {
  .content, .topbar { padding-left: 56px; padding-right: 56px; }
  .content { max-width: 1500px; }
}

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

/* ---------- Foldable unfolded / small tablet: icon rail --------- */
/* 700-1023px. A Z Fold's inner screen in portrait lands here, as does a
   half-width window on a laptop. Labels go, icons stay. */

@media (min-width: 700px) and (max-width: 1023px) {
  :root { --sidebar-w: 74px; }
  .sidebar { align-items: center; }
  .brand { padding: 20px 8px; text-align: center; width: 100%; }
  .brand-mark { font-size: 0; letter-spacing: 0; }
  .brand-mark::before {
    content: '';
    display: block;
    width: 30px; height: 30px;
    margin: 0 auto;
    background: no-repeat center/contain url("/static/img/mark.svg");
  }
  .brand-sub { display: none; }
  .nav { padding: 14px 10px; width: 100%; }
  .nav-label {
    font-size: 0;
    padding: 12px 0 6px;
    border-top: 1px solid var(--ink-line);
    margin-top: 8px;
  }
  .nav-item { justify-content: center; padding: 12px 0; }
  .nav-item .nav-text { display: none; }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-item.is-active::before { left: -10px; }
  .nav-count {
    position: absolute;
    top: 5px; right: 9px;
    margin: 0;
    font-size: 9.5px;
    min-width: 17px;
    padding: 0 4px;
  }
  .sidebar-foot { padding: 12px 8px; width: 100%; }
  .sidebar-foot .lang-switch { flex-direction: column; border-radius: var(--radius); }
  .sidebar-foot .lang-switch a { padding: 6px 2px; min-width: 0; }
  .who { justify-content: center; }
  .who > div:last-child { display: none; }
  .signout { font-size: 0; padding: 9px 0; }
  .signout::before { content: '\2192'; font-size: 15px; }

  .grid-2 { grid-template-columns: 1fr; }
  .topbar, .content { padding-left: 24px; padding-right: 24px; }
  .page-title { font-size: 29px; }
  /* Stop iOS/Android zooming a field on focus. */
  input, select, textarea { font-size: 16px; }
}

/* ---------------- Phones and folded cover screens --------------- */

@media (max-width: 699px) {
  .sidebar { display: none; }
  .mtop { display: flex; }
  .mtabs { display: flex; }

  .shell { display: block; min-height: 100vh; min-height: 100dvh; }
  .main { display: block; }

  .topbar {
    display: block;
    padding: 18px 16px 0;
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
  }
  .topbar > .btn { display: none; }  /* the + tab covers this on a phone */
  .content {
    padding: 18px 16px 24px;
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .page-title { font-size: 25px; }
  .page-sub { font-size: 12.5px; }
  .eyebrow { font-size: 9.5px; }

  /* One firm column everywhere. */
  .grid-2, .field-row, .choice-grid, .stat-grid { grid-template-columns: 1fr; }
  .stat-grid { gap: 11px; margin-bottom: 20px; }
  .stat { padding: 15px 16px 14px; }
  .stat-value { font-size: 25px; }
  .stat-value.is-sm { font-size: 21px; }

  /* Two stats abreast still read fine on a 390px screen. */
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid > .stat:only-child { grid-column: 1 / -1; }

  .card { border-radius: 8px; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 16px; }
  .card-foot { padding: 12px 16px; }

  /* Tables become stacked cards — no sideways scrolling on a phone. */
  table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
  table.grid thead { display: none; }
  table.grid tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--rule-soft);
    position: relative;
  }
  table.grid tr:last-child { border-bottom: none; }
  table.grid tr:active { background: var(--paper-warm); }
  table.grid td { padding: 0; border: none !important; }
  table.grid td + td { margin-top: 9px; }
  table.grid td.num, table.grid td { text-align: left; }
  table.grid td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 9px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 3px;
  }
  /* The amount is the thing you scan for, so it goes top-right. */
  table.grid td.cell-amount {
    position: absolute;
    top: 14px; right: 16px;
    width: auto;
    margin: 0;
    text-align: right;
  }
  table.grid td.cell-amount[data-label]::before { display: none; }
  table.grid td.cell-main { padding-right: 34%; }
  table.grid td.cell-hide-sm { display: none; }
  .amount-cell { font-size: 16px; }

  .filters { gap: 8px; }
  .filters form.filters { width: 100%; }
  .filters select, .filters input, .filters input[type=search] {
    min-width: 0;
    width: 100%;
    flex: 1 1 46%;
  }
  .filters .btn { flex: 1 1 100%; }
  .seg { width: 100%; }
  .seg a { flex: 1; text-align: center; padding: 10px 6px; font-size: 12px; }

  /* iOS refuses to honour anything under 16px without zooming. */
  input[type=text], input[type=email], input[type=password], input[type=number],
  input[type=date], input[type=search], input[type=tel], select, textarea {
    font-size: 16px;
    padding: 12px 14px;
  }
  .money-input input { font-size: 24px; padding-left: 48px; }
  .btn { padding: 12px 18px; min-height: 44px; }
  .btn-sm { padding: 9px 14px; min-height: 38px; }
  .choice { padding: 16px; }
  .check { padding: 14px; }

  .hero-amount { font-size: 33px; }
  .verdict { flex-wrap: wrap; padding: 16px; }
  .verdict .btn { width: 100%; }
  .dl { grid-template-columns: 1fr; gap: 3px 0; }
  .dl dt { padding-top: 10px; }
  .dl dt:first-child { padding-top: 0; }

  /* On a phone the CEO should meet the decision before the detail.
     `display: contents` flattens both columns into one flex flow, so the
     decision panel can jump the queue without the history card coming
     along with it. */
  .grid-2 > .stack:last-child { margin-top: 22px; }
  .grid-2.decide-first { display: flex; flex-direction: column; gap: 22px; }
  .grid-2.decide-first > .stack { display: contents; }
  .grid-2.decide-first > .stack:last-child { margin-top: 0; }
  .grid-2.decide-first .decision { order: -1; }

  .decision { padding: 20px 18px; }
  .empty { padding: 40px 18px; }
  .alert { font-size: 13px; padding: 12px 14px; }
  .timeline { padding-left: 20px; }
}

/* Very narrow: a folded cover screen, or a split window. A 390px iPhone
   still gets two tiles abreast — only genuinely narrow screens stack. */
@media (max-width: 359px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 23px; }
  .mtab span { font-size: 9px; }
  table.grid td.cell-main { padding-right: 30%; }
}

/* Unfolded in landscape, or a laptop in a short window. */
@media (max-height: 520px) and (orientation: landscape) {
  .topbar { padding-top: 14px; }
  .content { padding-top: 16px; padding-bottom: 28px; }
  .page-title { font-size: 24px; }
  .sidebar .brand { padding: 14px 18px; }
  .nav { padding: 8px 12px; }
  .nav-item { padding: 7px 11px; }
}

/* ------------------------ touch & motion ----------------------- */

@media (hover: none) {
  /* Hover styling misfires on touch — keep the pressed state instead. */
  .btn:hover { box-shadow: none; filter: none; }
  table.grid tbody tr:hover { background: transparent; }
  .btn:active { transform: scale(.985); opacity: .9; }
  .nav-item:active, .mtab:active, .file-item:active { opacity: .65; }
}

* { -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
.table-wrap { -webkit-overflow-scrolling: touch; }
input, select, textarea, button { -webkit-appearance: none; appearance: none; border-radius: var(--radius); }
input[type=checkbox], input[type=radio] { -webkit-appearance: auto; appearance: auto; }
input[type=date] { min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .sidebar, .topbar, .mtop, .mtabs, .btn, .filters, .decision, .lang-switch { display: none !important; }
  body { background: #FFF; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #DDD; break-inside: avoid; }
}

/* --------------------- login & error pages --------------------- */

.login-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.login-mark {
  width: 40px; height: 40px;
  background: no-repeat center/contain url("/static/img/mark.svg");
}

.error-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.error-box { max-width: 440px; text-align: center; }
.error-mark {
  width: 52px; height: 52px;
  margin: 0 auto 18px;
  opacity: .8;
  background: no-repeat center/contain url("/static/img/mark.svg");
}
.error-box h1 { font-family: var(--serif); font-size: 29px; margin-bottom: 10px; }
.error-box p { color: var(--text-dim); font-size: 14px; margin: 0 0 26px; line-height: 1.6; }

@media (max-width: 699px) {
  .login-form-wrap {
    padding: 28px 20px;
    padding-top: calc(28px + env(safe-area-inset-top));
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    align-items: start;
  }
  .login-card h1 { font-size: 27px; }
}

/* The summary rail follows the form on a laptop, and leads on a phone. */
.summary-rail { position: sticky; top: 24px; }
@media (max-width: 699px) {
  .summary-rail { position: static; }
  .summary-rail .hero-amount { font-size: 30px; }
}

.inset-form {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

/* --------------------------- payee book ------------------------ */

.payee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}
.payee-head { display: flex; align-items: center; gap: 13px; }
.payee-name {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.payee-edit { margin-top: 18px; }
.payee-edit > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.payee-edit > summary::-webkit-details-marker { display: none; }
.payee-edit[open] > summary { border-color: var(--brass); color: var(--brass-deep); }

@media (max-width: 699px) {
  .payee-grid { grid-template-columns: 1fr; gap: 12px; }
  .filters .spacer { display: none; }
  #addPayeeBtn { width: 100%; }
}

/* Table column behaviour: keep short facts on one line, clip long names. */
table.grid td.nowrap, table.grid th.nowrap { white-space: nowrap; }
table.grid td.clip > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 699px) {
  /* Stacked cards have the full width, so nothing needs clipping. */
  table.grid td.clip > div { white-space: normal; overflow: visible; }
}

/* "or" divider between the password form and the passkey button. */
.or-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.or-rule::before, .or-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}
