/* Goromonzi RDC requisitions. Bootstrap 5 underneath; the look is light, with the crest's green as the one
   strong colour and its gold used only to draw the eye to something waiting. System fonts only. */
:root {
  --green: #1f5a36;
  --green-dark: #17452a;
  --green-tint: #e8f1eb;
  --gold: #b98a12;
  --gold-text: #7a5a06; /* gold dark enough for text and small badges (≥ 4.5:1 on white) */
  --gold-tint: #fbf3dc;
  --ink: #1c2420;
  --muted: #64706a;
  --line: #e4e8e2;
  --page: #f6f7f4;
  --surface: #ffffff;
  --danger: #b3261e;
  --radius: 14px;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--ink);
  --bs-primary: var(--green);
  --bs-primary-rgb: 31, 90, 54;
  --bs-link-color: var(--green);
  --bs-link-color-rgb: 31, 90, 54;
  --bs-link-hover-color: var(--green-dark);
  --bs-link-hover-color-rgb: 23, 69, 42;
  --bs-border-color: var(--line);
}

body { background: var(--page); color: var(--ink); font-size: .95rem; }
main { min-height: calc(100vh - 140px); max-width: 1120px; }
a { text-underline-offset: 2px; }
h1, .page-title { font-size: 1.5rem; font-weight: 650; letter-spacing: -.01em; margin: 0; }
h2, .section-title { font-size: 1rem; font-weight: 650; margin: 0 0 .9rem; }
.subtle { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .15rem; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.crumb { font-size: .82rem; color: var(--muted); margin-bottom: .35rem; }
.crumb a { color: var(--muted); }

/* ---- top bar ---- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--green); padding-top: .65rem; padding-bottom: .5rem; }
.topbar .container-xl { max-width: 1120px; }
.topbar .navbar-brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 650; font-size: 1.02rem; }
.topbar .navbar-brand img { height: 38px; width: 38px; object-fit: contain; }
.topbar .navbar-brand small { display: block; font-weight: 400; font-size: .7rem; color: var(--muted); line-height: 1.1; }
.topbar .nav-link { color: #3b4640; font-weight: 500; padding: .45rem .85rem !important; border-radius: 999px; }
.topbar .nav-link:hover { background: var(--page); color: var(--ink); }
.topbar .nav-link.active { background: var(--green-tint); color: var(--green-dark); }
.count-badge { display: inline-block; min-width: 1.35rem; padding: 0 .4rem; margin-left: .3rem; border-radius: 999px; background: var(--gold-text); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.35rem; text-align: center; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--green-tint); color: var(--green-dark); font-weight: 700; font-size: .78rem; }
.dropdown-menu { border-color: var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(28, 36, 32, .12); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; }
.dropdown-item:active { background: var(--green); }

/* ---- buttons ---- */
.btn { border-radius: 10px; font-weight: 550; padding: .5rem 1rem; }
.btn-sm { border-radius: 8px; padding: .3rem .7rem; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1rem; }
.btn-primary { --bs-btn-bg: var(--green); --bs-btn-border-color: var(--green); --bs-btn-hover-bg: var(--green-dark); --bs-btn-hover-border-color: var(--green-dark);
  --bs-btn-active-bg: var(--green-dark); --bs-btn-active-border-color: var(--green-dark); --bs-btn-disabled-bg: #9db3a5; --bs-btn-disabled-border-color: #9db3a5; }
.btn-quiet { --bs-btn-color: var(--ink); --bs-btn-bg: var(--surface); --bs-btn-border-color: #cfd6cd; --bs-btn-hover-bg: var(--page); --bs-btn-hover-border-color: #b3bdb2; --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: var(--page); --bs-btn-active-border-color: #b3bdb2; --bs-btn-active-color: var(--ink); --bs-btn-disabled-color: #9aa39d; --bs-btn-disabled-border-color: var(--line); --bs-btn-disabled-bg: var(--surface); }
.btn-quiet-danger { --bs-btn-color: var(--danger); --bs-btn-bg: var(--surface); --bs-btn-border-color: #e5c4c1; --bs-btn-hover-bg: #fbeceb; --bs-btn-hover-border-color: var(--danger); --bs-btn-hover-color: var(--danger);
  --bs-btn-active-bg: #fbeceb; --bs-btn-active-color: var(--danger); --bs-btn-active-border-color: var(--danger); }
.btn-link { font-weight: 500; text-decoration: none; }
.btn .spinner-border { width: .9rem; height: .9rem; border-width: .14em; margin-right: .45rem; vertical-align: -.1em; }

/* ---- surfaces ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > .panel-pad { padding: 1.25rem; }
.panel-action { border-color: #c9dccf; box-shadow: 0 6px 22px rgba(31, 90, 54, .08); }
.panel hr { border-color: var(--line); opacity: 1; margin: 1.1rem 0; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem 1.5rem; }
.fact-grid .wide { grid-column: 1 / -1; }

.alert { border-radius: 12px; border: 0; }
.alert-danger { background: #fbeceb; color: #7d1a14; }
.alert-warning { background: var(--gold-tint); color: #5f4708; }
.alert-info { background: var(--green-tint); color: var(--green-dark); }
/* Bottom corner, so a confirmation never covers the menu or the page heading. */
.toast-container { z-index: 1090; }
.toast { border: 0; border-radius: 12px; background: var(--green-dark); color: #fff; box-shadow: 0 10px 30px rgba(28, 36, 32, .25); font-size: .92rem; }
.toast .btn-close { filter: invert(1); }

/* ---- forms ---- */
.form-label { font-weight: 550; font-size: .86rem; margin-bottom: .3rem; }
.form-control, .form-select { border-color: #cfd6cd; border-radius: 10px; padding: .5rem .75rem; }
.form-control-sm, .form-select-sm { border-radius: 8px; padding: .35rem .55rem; }
/* Room for the drop-down arrow, which the padding above would otherwise run text into. */
.form-select { padding-right: 2.25rem; }
.form-select-sm { padding-right: 2rem; }
.input-group-text:empty { display: none; }
.input-group > .form-control:has(+ .input-group-text:empty) { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.input-group-text { border-color: #cfd6cd; background: var(--page); border-radius: 10px; }
.form-control:focus, .form-select:focus, .form-check-input:focus, .btn:focus-visible { border-color: #6f9b7f; box-shadow: 0 0 0 .2rem rgba(31, 90, 54, .18); }
.form-check-input:checked { background-color: var(--green); border-color: var(--green); }
.optional { font-weight: 400; color: var(--muted); font-size: .8rem; }
.input-validation-error, .form-control.is-invalid { border-color: var(--danger) !important; }
.field-validation-error { display: block; color: var(--danger); font-size: .82rem; margin-top: .25rem; }
.field-validation-valid { display: none; }
.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }

/* ---- status chips ---- */
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: #eef0ec; color: #47524c; }
.chip::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .75; }
.chip-draft { background: #eef0ec; color: #47524c; }
.chip-progress { background: #e6eef9; color: #1d4f8f; }
.chip-attention { background: var(--gold-tint); color: #7a5a06; }
.chip-stopped { background: #fbeceb; color: #8f1f18; }
.chip-good { background: var(--green-tint); color: var(--green-dark); }
.chip-done { background: var(--green); color: #fff; }
.chip-muted { background: #f1f2ef; color: #7b857f; }

/* ---- home ---- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; color: inherit; text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.tile:hover { border-color: #b9cbbf; box-shadow: 0 6px 20px rgba(28, 36, 32, .07); color: inherit; }
.tile .count { font-size: 2.1rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .name { font-weight: 600; }
.tile .hint { color: var(--muted); font-size: .84rem; }
.tile.waiting { border-color: #e6d19a; background: linear-gradient(180deg, var(--gold-tint), var(--surface) 70%); }
.tile.waiting .count { color: #7a5a06; }
.choice { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; color: inherit; text-decoration: none; height: 100%; }
.choice:hover { border-color: var(--green); color: inherit; }
.choice .go { margin-left: auto; color: var(--green); font-weight: 700; }

/* ---- requisition list ---- */
.segments { display: inline-flex; background: #eceee9; border-radius: 999px; padding: 3px; }
.segments a { padding: .38rem 1rem; border-radius: 999px; color: #47524c; font-weight: 550; text-decoration: none; font-size: .9rem; white-space: nowrap; }
.segments a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(28, 36, 32, .15); }
.req-list { list-style: none; margin: 0; padding: 0; }
.req-row { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr) 13rem 9.5rem; gap: .25rem 1.25rem; align-items: center; padding: .85rem 1.25rem; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.req-list li:first-child .req-row { border-top: 0; }
.req-row:hover { background: #fafbf9; color: inherit; }
.req-row.mine-to-act { box-shadow: inset 4px 0 0 var(--gold); }
.req-row .number { font-weight: 650; color: var(--green-dark); font-variant-numeric: tabular-nums; }
.req-row .purpose { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-row .meta { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-row .amount { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.req-row .amount + .meta { text-align: right; }
.empty { text-align: center; padding: 3rem 1.25rem; }
.empty .mark { width: 3.25rem; height: 3.25rem; border-radius: 50%; background: var(--green-tint); color: var(--green); display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: .75rem; }
.empty p { color: var(--muted); max-width: 26rem; margin: .25rem auto 1rem; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .85rem 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }

/* ---- step tracker ---- */
.tracker { display: flex; list-style: none; margin: 0; padding: .25rem 0 0; overflow-x: auto; }
.tracker li { flex: 1 1 0; min-width: 5.6rem; position: relative; text-align: center; padding: 0 .25rem; }
.tracker li::before { content: ""; position: absolute; top: .8rem; left: -50%; width: 100%; height: 2px; background: var(--line); }
.tracker li:first-child::before { display: none; }
.tracker .dot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--surface); border: 2px solid #c9d0c7; color: #fff; font-size: .8rem; font-weight: 700; }
.tracker .name { font-size: .8rem; font-weight: 600; margin-top: .35rem; line-height: 1.2; }
.tracker .caption { font-size: .72rem; color: var(--muted); line-height: 1.2; }
.tracker .is-done::before, .tracker .is-current::before, .tracker .is-returned::before, .tracker .is-stopped::before { background: var(--green); }
.tracker .is-done .dot { background: var(--green); border-color: var(--green); }
.tracker .is-current .dot { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-tint); }
.tracker .is-current .dot::after { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--green); }
.tracker .is-current .name { color: var(--green-dark); }
.tracker .is-returned .dot { background: var(--gold); border-color: var(--gold); }
.tracker .is-stopped .dot { background: var(--danger); border-color: var(--danger); }
.tracker .is-upcoming .name { color: var(--muted); font-weight: 500; }
/* Skipped: progress passed through it, but nobody approved here, so no tick. */
.tracker .is-skipped::before { background: var(--green); }
.tracker .is-skipped .dot { background: #eef0ec; border-color: #c9d0c7; border-style: dashed; color: var(--muted); }
.tracker .is-skipped .name { color: var(--muted); font-weight: 500; text-decoration: line-through; }

/* ---- approval history ---- */
.history { list-style: none; margin: 0; padding: 0; }
.history li { position: relative; padding: 0 0 1.1rem 1.6rem; }
.history li::before { content: ""; position: absolute; left: .3rem; top: 1rem; bottom: -.15rem; width: 2px; background: var(--line); }
.history li:last-child { padding-bottom: 0; }
.history li:last-child::before { display: none; }
.history .pin { position: absolute; left: 0; top: .28rem; width: .72rem; height: .72rem; border-radius: 50%; background: #c9d0c7; }
.history .is-done .pin { background: var(--green); }
.history .is-current .pin { background: var(--surface); border: 2px solid var(--green); }
.history .is-returned .pin { background: var(--gold); }
.history .is-stopped .pin { background: var(--danger); }
.history .is-skipped .pin { background: var(--surface); border: 2px dashed #b3bdb2; }
.history .is-skipped .fw-semibold { color: var(--muted); }
.history .who { font-size: .86rem; }
.history .when { font-size: .78rem; color: var(--muted); }
.history .comment { background: var(--page); border-radius: 8px; padding: .4rem .6rem; margin-top: .35rem; font-size: .86rem; }
.signature-image { display: block; max-width: 11rem; max-height: 4rem; margin-top: .35rem; border-bottom: 1px solid #b9c2b8; padding-bottom: 2px; }

/* ---- tables and line grids ---- */
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .65rem .75rem; border-color: var(--line); vertical-align: middle; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom-width: 1px; }
.panel.flush .table > :not(caption) > * > *:first-child { padding-left: 1.25rem; }
.panel.flush .table > :not(caption) > * > *:last-child { padding-right: 1.25rem; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tfoot td { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 600; }
.line-grid > :not(caption) > * > * { padding: .4rem .35rem; border: 0; vertical-align: top; }
.line-grid thead th { padding-bottom: .5rem; }
.line-grid input[type=number] { text-align: right; }
.line-grid .col-amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: .75rem; font-weight: 550; }
.line-grid tfoot td { border-top: 1px solid var(--line); padding-top: .7rem; }
.row-remove { color: var(--muted); border: 0; background: none; font-size: 1.25rem; line-height: 1; padding: .3rem .5rem; border-radius: 8px; }
.row-remove:hover { color: var(--danger); background: #fbeceb; }
.totals { max-width: 22rem; margin-left: auto; }
.totals > div { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; }
.totals .grand { font-size: 1.15rem; font-weight: 700; border-top: 2px solid var(--ink); margin-top: .4rem; padding-top: .5rem; }
.grid-hint { font-size: .8rem; color: var(--muted); }

.gl-picker { position: relative; }
.gl-results { position: absolute; z-index: 20; left: 0; top: 100%; min-width: 19rem; max-width: 90vw; max-height: 16rem; overflow-y: auto; background: var(--surface); border: 1px solid #cfd6cd; border-radius: 10px; box-shadow: 0 10px 30px rgba(28, 36, 32, .15); padding: .3rem; }
.gl-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .6rem; font-size: .9rem; border-radius: 7px; }
.gl-results button:hover, .gl-results button.active { background: var(--green-tint); }
.gl-results .empty-note { padding: .45rem .6rem; color: var(--muted); font-size: .85rem; }

/* ---- signature pad ---- */
.signature-pad { position: relative; border: 1.5px dashed #b3bdb2; border-radius: 12px; background: #fff; }
.signature-pad.has-ink { border-style: solid; border-color: var(--green); }
/* touch-action none: the finger or stylus draws; it never scrolls or zooms the page from inside the pad. */
.signature-pad canvas { display: block; width: 100%; height: 190px; border-radius: 12px; touch-action: none; cursor: crosshair; }
.signature-pad .baseline { position: absolute; left: 8%; right: 8%; bottom: 26%; border-bottom: 1px solid #d5dbd3; pointer-events: none; }
.signature-pad .placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9aa39d; pointer-events: none; font-size: .92rem; }
.signature-pad.has-ink .placeholder { display: none; }
.modal-content { border: 0; border-radius: 16px; }
.modal-header, .modal-footer { border-color: var(--line); }

/* ---- pay ---- */
.statement { background: var(--surface); border: 1px solid #c9dccf; border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 6px 22px rgba(31, 90, 54, .08); }
.statement .amount { font-size: 2rem; font-weight: 700; line-height: 1.15; }

/* ---- sign-in ---- */
.signin { max-width: 24rem; margin: 7vh auto 0; }
.signin img { width: 104px; height: auto; }

footer.site-footer { font-size: .78rem; color: #5f6b64; max-width: 1120px; }

/* ---- phone ---- */
@media (max-width: 767.98px) {
  h1, .page-title { font-size: 1.25rem; }
  main { padding-left: 1rem !important; padding-right: 1rem !important; }
  .panel { padding: 1rem; border-radius: 12px; }
  .panel.flush > .panel-pad { padding: 1rem; }
  .tiles { grid-template-columns: 1fr; gap: .6rem; }
  .tile { display: grid; grid-template-columns: 3.2rem 1fr; column-gap: .75rem; align-items: center; padding: .85rem 1rem; }
  .tile .count { grid-row: span 2; font-size: 1.8rem; text-align: center; }
  .topbar .navbar-nav { padding-top: .5rem; }
  .topbar .nav-link { border-radius: 10px; padding: .65rem .75rem !important; }
  .segments { display: flex; }
  .segments a { flex: 1; text-align: center; padding: .45rem .5rem; }

  .req-row { grid-template-columns: minmax(0, 1fr) auto; padding: .85rem 1rem; row-gap: .15rem; }
  .req-row .c-number { grid-column: 1; grid-row: 1; }
  .req-row .c-amount { grid-column: 2; grid-row: 1; }
  .req-row .c-purpose { grid-column: 1 / -1; grid-row: 2; }
  .req-row .c-status { grid-column: 1 / -1; grid-row: 3; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .2rem; }
  .req-row .c-number .meta, .req-row .c-amount .meta { display: none; }
  .pager { padding: .85rem 1rem; }
  /* Read-only line tables fit a phone: tighter cells, long text wraps instead of pushing Amount off screen. */
  .table-responsive > .table { font-size: .875rem; }
  .table-responsive > .table th, .table-responsive > .table td { padding: .5rem .35rem; white-space: normal; }
  .table-responsive > .table .text-end { white-space: nowrap; } /* never split an amount or a quantity */
  .table-responsive > .table th:first-child, .table-responsive > .table td:first-child { padding-left: 1rem; }

  /* Each grid row becomes a small labelled block instead of a cramped table row. */
  .line-grid thead { display: none; }
  .line-grid, .line-grid tbody, .line-grid tfoot, .line-grid tr, .line-grid td { display: block; width: 100%; }
  .line-grid tbody tr { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .7rem; margin-bottom: .7rem; background: #fcfcfb; }
  .line-grid td { padding: .25rem 0; }
  .line-grid td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .1rem; }
  .line-grid .col-amount { text-align: left; padding-top: .25rem; }
  .line-grid input[type=number] { text-align: left; }
  .line-grid td.col-remove { position: absolute; top: .2rem; right: .2rem; width: auto; padding: 0; }
  .line-grid tfoot tr { display: flex; justify-content: space-between; }
  .line-grid tfoot td { width: auto; }
  .line-grid tfoot td:empty { display: none; }
  .line-grid tfoot td[data-label]::before { display: none; }
  .tracker li { min-width: 5.2rem; }
  .statement { padding: 1.1rem; }
  .statement .amount { font-size: 1.7rem; }
  .btn-block-phone { width: 100%; }
  .signature-pad canvas { height: 170px; }
}
