/* One Talibon: procurement and budget. Every selector is prefixed .proc */
.proc { display: flex; flex-direction: column; gap: var(--s5); max-width: 1240px; }
.proc .page-intro, .proc > :first-child { max-width: none; }
.proc-id { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; color: var(--muted); font-variant-numeric: tabular-nums; }
.proc-lbl { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }

/* tools and summary */
.proc-tools { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-end; }
.proc-tools .field { min-width: 260px; }
.proc-search { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; max-width: 420px; }
.proc-search-lbl { font-size: var(--fs-sm); font-weight: 650; }
.proc-summary { margin: calc(var(--s2) * -1) 0 0; color: var(--ink-2); line-height: 1.55; }
.proc-summary b { color: var(--head); font-variant-numeric: tabular-nums; }

/* the chain of stages: also the stage switcher on phones */
.proc-chain { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.proc-step {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 12px; min-height: 124px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); cursor: pointer; font: inherit;
  box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s;
}
.proc-step:hover { border-color: var(--sea-300); }
.proc-step:not(:last-child)::after {
  content: ""; position: absolute; right: -9px; top: 50%; width: 8px; height: 8px; margin-top: -4px; z-index: 1;
  border-top: 2px solid var(--line-strong); border-right: 2px solid var(--line-strong); transform: rotate(45deg);
}
.proc-step-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proc-step-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sand); color: var(--head); font-size: 12.5px; font-weight: 700; }
.proc-step-count { font-size: 28px; font-weight: 700; line-height: 1; color: var(--head); font-variant-numeric: tabular-nums; }
.proc-step-label { font-size: var(--fs-sm); font-weight: 650; line-height: 1.25; color: var(--ink); }
.proc-step-amt { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.proc-step-flag { display: none; align-items: center; gap: 4px; margin-top: auto; font-size: 12px; font-weight: 600; color: var(--due-ink); line-height: 1.3; }
.proc-step-flag.show { display: flex; }
.proc-step.is-on { background: var(--sea-900); border-color: var(--head); color: #fff; }
.proc-step.is-on .proc-step-count, .proc-step.is-on .proc-step-label { color: #fff; }
.proc-step.is-on .proc-step-n { background: rgba(255, 255, 255, .18); color: #fff; }
.proc-step.is-on .proc-step-amt { color: #b9dce5; }
.proc-step.is-on .proc-step-flag { color: #f6d28b; }

/* the board: all seven stages side by side, scrolling sideways when the window is narrow */
.proc-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding: 2px 2px 14px; align-items: start; scroll-snap-type: x proximity; }
.proc-col { background: var(--sand); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 12px; scroll-snap-align: start; min-width: 0; }
.proc-col.is-on { box-shadow: inset 0 0 0 2px var(--sea-300); }
.proc-col-head { display: flex; gap: 10px; align-items: flex-start; padding: 2px 2px 0; }
.proc-col-head h3 { font-size: var(--fs-md); margin: 0; line-height: 1.25; color: var(--head); }
.proc-col-n { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sea-900); color: #fff; font-size: 13px; font-weight: 700; }
.proc-col-sum { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.proc-cards { display: flex; flex-direction: column; gap: 12px; }
.proc-col-empty { padding: 22px 12px; text-align: center; color: var(--muted); font-size: var(--fs-sm); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }

.proc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 14px 14px 16px; display: flex; flex-direction: column; gap: 8px;
  cursor: pointer; box-shadow: var(--shadow-sm); position: relative; transition: box-shadow .15s, border-color .15s;
}
.proc-card:hover { box-shadow: var(--shadow-md); border-color: var(--sea-300); }
.proc-card.is-waiting::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--due); }
.proc-c-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; min-height: 24px; }
.proc-c-title { margin: 0; font-size: var(--fs-base); line-height: 1.35; font-weight: 650; color: var(--head); }
.proc-c-open { all: unset; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; border-radius: 4px; }
.proc-c-open:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.proc-c-office { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.35; }
.proc-c-office .icon { flex: none; margin-top: 2px; color: var(--muted); }
.proc-c-amount { font-size: var(--fs-md); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.proc-c-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
.proc-c-days { display: flex; align-items: center; gap: 5px; }
.proc-c-prj { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--link); font-weight: 600; line-height: 1.35; padding-top: 8px; border-top: 1px solid var(--line); }
.proc-c-prj .icon { flex: none; margin-top: 1px; }
.proc-c-act { padding-top: 4px; }
.proc-c-act .btn { width: 100%; justify-content: center; }

/* detail */
.proc-detail { display: flex; flex-direction: column; gap: var(--s5); }
.proc-d-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.proc-d-title { margin: 10px 0 6px; font-size: var(--fs-xl); line-height: 1.2; color: var(--head); }
.proc-d-amount { margin-top: 12px; font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.proc-d-cols { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
.proc-d-side .proc-bal-fig { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.proc-d-side .proc-bal-fig > div:not(.proc-bal-bar) { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.proc-d-side .proc-bal-fig .proc-lbl { margin: 0; }
.proc-d-side { display: flex; flex-direction: column; gap: var(--s5); }
.proc-d-sec h4 { margin: 0 0 var(--s3); font-size: var(--fs-md); color: var(--head); }
.proc-d-prj { display: flex; justify-content: space-between; gap: var(--s4); align-items: center; flex-wrap: wrap; padding: 14px 16px; background: var(--sand); border-radius: var(--r-md); }
.proc-bal-fig, .proc-overall-fig { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px var(--s4); }
.proc-bal-fig b, .proc-overall-fig b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; color: var(--ink); }
.proc-bal-fig .proc-bal-left { color: var(--link); }
.proc-bal-bar { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--sand-200); overflow: hidden; margin-top: 6px; }
.proc-bal-bar span { display: block; height: 100%; background: var(--sea-500); border-radius: 0 4px 4px 0; }
.proc-bal-note { grid-column: 1 / -1; margin: 6px 0 0; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; }
.proc-bal-note:empty { display: none; }

/* new request form */
.proc-bal-panel { background: var(--sand); border-radius: var(--r-md); padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: 10px; }
.proc-bal-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.proc-bal-title b { color: var(--head); }
.proc-notice { display: none; padding: 10px 12px; border-radius: var(--r-sm); background: var(--overdue-bg); color: var(--overdue-ink); font-weight: 600; font-size: var(--fs-sm); line-height: 1.45; border: 1px solid #f1c3ba; }
.proc-notice.show { display: block; }
.proc-bal-panel.is-refused .proc-notice { display: none; }
.proc-form .proc-bal-panel .proc-bal-note { margin: 0; }

/* budget */
.proc-budget { display: flex; flex-direction: column; gap: var(--s4); scroll-margin-top: 80px; }
.proc-budget .section-head, .proc-budget > :first-child { margin-bottom: 0; }
.proc-overall { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); grid-template-areas: "pct fig" "bar bar"; gap: var(--s4) var(--s6); align-items: center; padding: var(--s5); border-radius: var(--r-lg); background: linear-gradient(160deg, var(--sea-900), var(--sea-700)); color: var(--deep-text); }
.proc-overall-pct { grid-area: pct; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.proc-overall-pct b { font-family: var(--font-serif); font-size: 52px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.proc-overall-fig { grid-area: fig; }
.proc-overall-fig .proc-lbl { color: #a9c6cf; }
.proc-overall-fig b { color: #fff; font-size: var(--fs-lg); }
.proc-overall > .proc-bar { grid-area: bar; }
.proc-bar { height: 10px; border-radius: 5px; background: var(--sand-200); overflow: hidden; flex: 1 1 auto; min-width: 60px; }
.proc-bar span { display: block; height: 100%; background: var(--sea-500); border-radius: 0 4px 4px 0; }
.proc-bar.big { height: 14px; background: rgba(255, 255, 255, .18); border-radius: 7px; }
.proc-bar.big span { background: var(--gold); border-radius: 0 6px 6px 0; }

.proc-btable { padding: 0; overflow: hidden; }
.proc-brow { display: grid; grid-template-columns: minmax(0, 1.7fr) 150px 150px 150px minmax(190px, 1.1fr); gap: var(--s4); align-items: center; padding: 14px var(--s5); border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.proc-brow.proc-bhead { border-top: 0; background: var(--sand); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 12px; padding-bottom: 12px; }
.proc-brow .num { text-align: right; }
.proc-b-name { font-weight: 600; color: var(--head); line-height: 1.3; }
.proc-b-bal { font-weight: 650; color: var(--link); }
.proc-b-bar { display: flex; align-items: center; gap: 12px; }
.proc-b-bar b { min-width: 52px; text-align: right; font-size: var(--fs-sm); }
.proc-btotal { background: var(--sand); border-top: 2px solid var(--line-strong); font-weight: 700; }
.proc-btotal .proc-b-name { font-size: var(--fs-md); }

@media (max-width: 760px) { .proc-d-cols { grid-template-columns: minmax(0, 1fr); gap: var(--s5); } }
@media (max-width: 1100px) {
  .proc-brow { grid-template-columns: minmax(0, 1.5fr) 130px 130px 130px minmax(150px, 1fr); gap: var(--s3); }
}

/* phones: one stage at a time */
@media (max-width: 820px) {
  .proc { gap: var(--s4); }
  .proc-tools { flex-direction: column; align-items: stretch; gap: var(--s3); }
  .proc-tools .field, .proc-search { max-width: none; min-width: 0; flex: none; }
  .proc-chain-host { margin: 0 calc(var(--s4) * -1); }
  .proc-chain { display: flex; overflow-x: auto; padding: 4px var(--s4) 8px; gap: 10px; scroll-snap-type: x proximity; scroll-padding: 0 var(--s4); scrollbar-width: none; }
  .proc-chain::-webkit-scrollbar { display: none; }
  .proc-step { flex: 0 0 150px; min-height: 118px; scroll-snap-align: start; }
  .proc-step:not(:last-child)::after { display: none; }
  .proc-board { display: block; overflow: visible; padding: 0; }
  .proc-col { display: none; padding: 0; background: transparent; }
  .proc-col.is-on { display: flex; box-shadow: none; }
  .proc-col-head { display: none; }
  .proc-card { padding: 16px 16px 16px 18px; gap: 10px; }
  .proc-c-title { font-size: var(--fs-md); }
  .proc-c-act .btn { min-height: 44px; }
  .proc-overall { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pct" "fig" "bar"; padding: var(--s4); gap: var(--s4); }
  .proc-overall-pct b { font-size: 44px; }
  .proc-overall-fig { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .proc-overall-fig > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .proc-overall-fig .proc-lbl { margin: 0; }
  .proc-overall-fig b { font-size: var(--fs-md); }
  .proc-bal-fig { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .proc-bal-fig > div:not(.proc-bal-bar) { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .proc-bal-fig .proc-lbl { margin: 0; }
  .proc-d-title, .proc-d-amount { margin-top: 12px; font-size: var(--fs-lg); }
  /* budget rows become small cards */
  .proc-bhead { display: none; }
  .proc-brow { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "name name name" "bar bar bar" "ap ob bal"; gap: 8px 6px; padding: 16px var(--s4); }
  .proc-brow .proc-b-name { grid-area: name; }
  .proc-brow .proc-b-bar { grid-area: bar; }
  .proc-brow .proc-b-ap { grid-area: ap; } .proc-brow .proc-b-ob { grid-area: ob; } .proc-brow .proc-b-bal { grid-area: bal; }
  .proc-brow .num[data-label] { text-align: left; font-size: 12.5px; letter-spacing: -.01em; white-space: nowrap; }
  .proc-brow .num[data-label]::before { content: attr(data-label); display: block; font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .proc-bal-panel { padding: var(--s4); }
}

/* ---------------------------------------------------------------- approvals (CONTRACT section 13): one plain line per card, the trail in the open card */
.proc-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); margin-top: 5px; }
.proc-c-wait { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); font-weight: 560; }
.proc-c-wait.is-ready .proc-dot, .proc-d-wait.is-ready .proc-dot { background: var(--ok); }
.proc-c-wait.is-wait .proc-dot, .proc-d-wait.is-wait .proc-dot { background: var(--muted); opacity: .55; }
.proc-c-wait.is-done { color: var(--muted); font-weight: 500; }
.proc-c-wait.is-mine { color: var(--ink); font-weight: 650; }
.proc-c-wait.is-mine .proc-dot { background: var(--gold); opacity: 1; box-shadow: 0 0 0 3px var(--gold-100); }
.proc-card.is-mine { border-color: var(--gold-600); }
.proc-c-act { display: flex; flex-direction: column; gap: 8px; }
.proc-c-why { margin: 0; font-size: 12px; line-height: 1.4; color: var(--overdue-ink); }
.proc-mine-n { color: var(--gold-ink); }

.proc-d-wait { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0 0; font-size: var(--fs-md); font-weight: 600; color: var(--ink); line-height: 1.4; }
.proc-d-wait .proc-dot { margin-top: 7px; }
.proc-d-blocked { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--sand); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; }
.proc-d-blocked .icon { flex: none; margin-top: 2px; color: var(--muted); }
.proc-d-main { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.proc-ap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.proc-ap { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); }
.proc-ap > .icon { flex: none; margin-top: 1px; }
.proc-ap b { display: block; font-size: var(--fs-sm); font-weight: 620; color: var(--ink-2); line-height: 1.35; }
.proc-ap-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.proc-ap.is-done > .icon { color: var(--ok); }
.proc-ap.is-done b { color: var(--ink); }
.proc-ap.is-next > .icon { color: var(--gold-600); }
.proc-ap.is-next b { color: var(--ink); }
.proc-ap-head { margin: var(--s4) 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.proc-ap-none { margin: 0 0 var(--s2); }
.proc-ap-clear { display: flex; align-items: center; gap: 8px; margin: var(--s4) 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ok-ink); }

/* the office is shown, not chosen */
.proc-own { display: flex; gap: 12px; align-items: flex-start; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.proc-own > .icon { flex: none; margin-top: 3px; color: var(--link); }
.proc-own .proc-lbl { margin-bottom: 0; }
.proc-own b { display: block; color: var(--ink); font-size: var(--fs-md); }
.proc-own-note { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }

/* the office whose budget just changed */
.proc-brow.is-just { background: var(--gold-100); box-shadow: inset 3px 0 0 var(--gold); }
.proc-brow.is-just .proc-b-ob { color: var(--gold-ink); font-weight: 700; }
