/* ── Brand colours ──────────────────────────────────────── */
:root {
  --charcoal:    #323e48;
  --charcoal-dk: #252d35;
  --charcoal-lt: #3e4d59;
  --red:         #dc2b26;
  --light-grey:  #97a4ad;
  --orange:      #ea7631;
  --yellow:      #f5d74f;
  --white:       #ffffff;
  --bg:          #f0f2f4;
  --card-bg:     #ffffff;
  --border:      #dde2e6;
  --green:       #2e8b57;
  --text:        #1a2229;
  --text-muted:  #5a6772;
  --topbar-h:    56px;
  --tabbar-h:    44px;
  --shell-h:     calc(var(--topbar-h) + var(--tabbar-h));
  --sidebar-w:   240px;
  --font-display: 'Neusa Next Std', 'Segoe UI', Arial, sans-serif;
}

/* ── Brand font (Neusa Next Std) ─────────────────────────── */
@font-face {
  font-family: 'Neusa Next Std';
  src: url('/static/fonts/The Northern Block Ltd - Neusa Next Std Regular.otf') format('opentype');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'Neusa Next Std';
  src: url('/static/fonts/The Northern Block Ltd - Neusa Next Std Medium.otf') format('opentype');
  font-weight: 500; font-style: normal;
}
@font-face {
  font-family: 'Neusa Next Std';
  src: url('/static/fonts/The Northern Block Ltd - Neusa Next Std Bold.otf') format('opentype');
  font-weight: 700; font-style: normal;
}

/* ── Reset / base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', Arial, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); }
button { cursor: pointer; border: none; background: none; font: inherit; }
h1 { font-family: var(--font-display); }

/* ── Top bar ────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: var(--charcoal); color: var(--white);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 24px; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.topbar-left  { display: flex; align-items: center; }
.topbar-center { display: flex; align-items: center; justify-content: center; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; }
.topbar-logo-img {
  height: 32px; width: auto; flex-shrink: 0;
}
.topbar-logo {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--white);
}

.topbar-home-link { display: flex; align-items: center; transition: opacity .15s; }
.topbar-home-link:hover { opacity: .8; }

.topbar-right { gap: 10px; }

/* ── App tabs (persistent nav row below the topbar) ─────── */
.app-tabs {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; height: var(--tabbar-h);
  background: var(--charcoal-dk); display: flex; align-items: stretch;
  padding: 0 24px; gap: 4px; z-index: 99;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.app-tab {
  display: flex; align-items: center; padding: 0 16px;
  color: rgba(255,255,255,.6); font-size: 13px; font-weight: 600;
  text-decoration: none; border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.app-tab:hover { color: var(--white); }
.app-tab.active { color: var(--white); border-bottom-color: var(--orange); }

/* ── Home screen (Dorset Finance Portal landing page) ───── */
.home-main {
  max-width: 1100px; margin: 0 auto; padding: 64px 24px;
  display: flex; flex-direction: column; align-items: center;
}
.home-title {
  font-size: 26px; font-weight: 700; color: var(--charcoal);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}
.home-subtitle {
  font-size: 14px; color: var(--text-muted); margin-bottom: 48px;
}
.home-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  width: 100%;
}
@media (max-width: 900px) {
  .home-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .home-cards { grid-template-columns: 1fr; }
}
.home-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 32px 28px; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  border-color: var(--charcoal-lt);
}
.home-card.disabled { opacity: .55; cursor: default; }
.home-card.disabled:hover { transform: none; box-shadow: none; border-color: var(--border); }
.home-card-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--white); margin-bottom: 18px;
}
.home-card-icon.eom-lock,
.home-card-icon.cashflow,
.home-card-icon.billmgmt,
.home-card-icon.modelling { background: var(--charcoal); }
.home-card-title {
  font-size: 17px; font-weight: 700; color: var(--charcoal); margin-bottom: 8px;
}
.home-card-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.5;
}

/* ── Layout ─────────────────────────────────────────────── */
.layout {
  display: flex;
  margin-top: var(--shell-h);
  min-height: calc(100vh - var(--shell-h));
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--charcoal); color: var(--white);
  padding: 20px 0;
  display: flex; flex-direction: column;
  position: fixed; top: var(--shell-h); bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 50;   /* above scrolling content (incl. sticky table columns), below topbar/tabs */
}
.sidebar-period-wrap {
  padding: 14px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.sidebar-period {
  font-size: 20px; font-weight: 700; color: var(--white);
  text-align: center; letter-spacing: .5px;
  flex: 1 1 auto; min-width: 0;
  border-radius: 6px; padding: 4px 8px;
  transition: background .15s;
}
.sidebar-period:hover {
  background: rgba(255,255,255,.12);
}
.sidebar-period.dashboard-active {
  background: rgba(255,255,255,.15);
  outline: 2px solid rgba(255,255,255,.25);
  outline-offset: 1px;
}
.sidebar-period-cal {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  color: var(--light-grey);
  border: 1px solid rgba(255,255,255,.15); border-radius: 6px;
  transition: color .15s, background .15s, border-color .15s;
}
.sidebar-period-cal:hover {
  color: var(--white); background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.25);
}
.sidebar-period-cal.dashboard-active {
  color: var(--white); background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.35);
}
.sidebar-section-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--light-grey); padding: 0 20px 10px;
  text-transform: uppercase;
}
.sidebar-expand-all-btn {
  font-size: 14px; color: var(--light-grey); line-height: 1;
  padding: 2px 5px; border-radius: 3px;
  transition: color .15s, background .15s;
}
.sidebar-expand-all-btn:hover { color: var(--white); background: rgba(255,255,255,.12); }

/* ── Sidebar groups (parent + children) ─────────────────── */
.sidebar-group { }

.sidebar-parent {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; width: 100%;
  color: rgba(255,255,255,.75); text-align: left;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}
.sidebar-parent:hover:not(.disabled) {
  background: var(--charcoal-lt); color: var(--white);
}
.sidebar-parent.disabled { opacity: .4; cursor: not-allowed; }

.sidebar-num {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.15); border-radius: 3px;
  padding: 2px 6px; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.sidebar-num.outstanding { background: var(--orange); color: #fff; }
.sidebar-num.complete    { background: var(--green);  color: #fff; }
.sidebar-name { font-size: 15px; flex: 1; font-weight: 600; }

.child-status {
  margin-left: auto; flex-shrink: 0; line-height: 1;
}
.child-status.done {
  display: inline-block;
  width: 16px; height: 16px; line-height: 16px; text-align: center;
  background: var(--green); border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 700;
  margin-left: auto; vertical-align: middle;
}
.child-status.flag { color: var(--orange); font-size: 16px; line-height: 1; vertical-align: middle; }

.sidebar-chevron {
  font-size: 10px; color: var(--light-grey);
  transition: transform .2s; margin-left: auto;
}
.sidebar-group.expanded > .sidebar-parent .sidebar-chevron {
  transform: rotate(180deg);
}

/* ── Sidebar: active parent group ───────────────────────── */
.sidebar-group.has-active > .sidebar-parent {
  background: var(--charcoal-lt);
  color: var(--white);
  border-left-color: var(--red);
}

/* ── Sidebar children (sub-tabs) ────────────────────────── */
.sidebar-children { display: none; background: rgba(0,0,0,.22); }
.sidebar-group.expanded > .sidebar-children { display: block; }

.sidebar-child {
  display: flex; align-items: center;
  padding: 9px 20px 9px 44px; width: 100%;
  color: rgba(255,255,255,.55); text-align: left; font-size: 13px;
  border-left: 3px solid transparent;
  transition: background .1s, color .1s;
}
.sidebar-child::before {
  content: '–'; font-size: 10px; color: var(--light-grey);
  margin-right: 8px; flex-shrink: 0;
}
.sidebar-child:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.85); }
.sidebar-child.active {
  color: var(--white);
  background: rgba(234, 118, 49, .45);
  border-left-color: var(--orange);
  font-weight: 600;
}

/* ── Sidebar: mid-level tabs ─────────────────────────────── */
.sidebar-mid {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 20px; width: 100%;
  color: rgba(255,255,255,.65); text-align: left; font-size: 13px;
  font-weight: 600; letter-spacing: .2px;
  border-left: 3px solid transparent;
}
.sidebar-mid:hover:not(.sidebar-mid-disabled) {
  background: rgba(255,255,255,.04); color: rgba(255,255,255,.9);
}
.sidebar-mid-disabled { opacity: .35; cursor: not-allowed; }
.sidebar-mid-chevron {
  font-size: 9px; color: var(--light-grey);
  transition: transform .2s; flex-shrink: 0;
}
.sidebar-midgroup.mid-expanded > .sidebar-mid .sidebar-mid-chevron {
  transform: rotate(180deg);
}
.sidebar-mid-children { display: none; }
.sidebar-midgroup.mid-expanded > .sidebar-mid-children { display: block; }
.sidebar-mid-children .sidebar-child { padding-left: 52px; }

/* ── Sidebar resize handle ───────────────────────────────── */
.sidebar-resize-handle {
  position: fixed; top: var(--shell-h); bottom: 0;
  left: var(--sidebar-w); width: 7px; margin-left: -3.5px;
  cursor: col-resize; z-index: 150;
}
.sidebar-resize-handle::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px;
  background: transparent; transition: background .15s;
}
.sidebar-resize-handle:hover::after,
body.sidebar-resizing .sidebar-resize-handle::after {
  background: var(--orange);
}
body.sidebar-resizing { cursor: col-resize; user-select: none; }

/* ── Main content ───────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-w);
  flex: 1; padding: 32px 36px;
  max-width: 1400px;
  min-width: 0;   /* allow the flex item to shrink so wide tables scroll inside their own cards, not the page */
}

/* ── Section header ─────────────────────────────────────── */
.section-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
}
.section-title { font-size: 22px; font-weight: 700; color: var(--charcoal); }
.section-subtitle { margin-top: 4px; font-size: 13px; color: var(--text-muted); }

/* ── Progress badge ─────────────────────────────────────── */
.section-progress {
  font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 20px;
  background: var(--charcoal); color: var(--white);
  white-space: nowrap; margin-top: 4px;
}
.section-progress.all-done { background: var(--green); }
.section-progress.has-outstanding { background: var(--red); }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 6px;
  margin-bottom: 20px; font-size: 13px; line-height: 1.5;
}
.alert-warning { background: #fff8e1; border: 1px solid var(--yellow); color: #5a4a00; }
.alert-error   { background: #fdecea; border: 1px solid var(--red);    color: #7a1010; }
.alert code { background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 3px; font-size: 12px; }

.dep-warning {
  background: #fff8e1; border: 1px solid var(--yellow); color: #5a4a00;
  padding: 12px 16px; border-radius: 6px;
  margin-bottom: 20px; font-size: 13px; line-height: 1.5;
  font-weight: 500;
}

/* ── Loading ────────────────────────────────────────────── */
.loading {
  color: var(--text-muted); font-size: 14px; padding: 40px 0;
  text-align: center;
}

/* ── Bank rec account list ───────────────────────────────── */
#br-groups { margin-top: 4px; }

.subsidiary-header {
  font-size: 10px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--light-grey);
  padding: 20px 0 7px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}
#br-groups > .subsidiary-block:first-child .subsidiary-header { padding-top: 0; }

.account-list { margin-bottom: 4px; }

.account-row {
  display: grid;
  grid-template-columns: 32px 76px minmax(160px, 1fr) minmax(300px, 2fr);
  align-items: center;
  padding: 6px 2px;
  border-bottom: 1px solid var(--border);
  gap: 0 10px;
  transition: background .1s;
}
.account-row:hover { background: rgba(50,62,72,.03); }
.account-row.checked { background: rgba(46,139,87,.05); }
.account-row:last-child { border-bottom: none; }

.acct-check {
  display: flex; justify-content: center; align-items: center;
}
.acct-check input[type=checkbox] {
  width: 15px; height: 15px; cursor: pointer;
  accent-color: var(--green);
}

.acct-num {
  font-size: 13px; font-weight: 700; color: var(--charcoal);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.acct-name-col { min-width: 0; }
.acct-name {
  font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-hint {
  font-size: 11px; color: var(--orange); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.acct-note-col {
  display: flex; align-items: center; gap: 6px;
}
.note-inline {
  flex: 1; height: 26px; font-size: 12px;
  padding: 0 8px; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); font-family: inherit;
  transition: border-color .15s;
  min-width: 0;
}
.note-inline:focus { outline: none; border-color: var(--charcoal-lt); }
.note-inline::placeholder { color: var(--light-grey); }
.note-saved-inline {
  font-size: 12px; color: var(--green); min-width: 14px;
  opacity: 0; transition: opacity .3s;
}
.note-saved-inline.show { opacity: 1; }

/* ── Statements Uploaded (checkbox-only rows) ───────────── */
#stmt-groups { margin-top: 4px; }

.stmt-row {
  display: grid;
  grid-template-columns: 32px 76px 1fr;
  align-items: center;
  padding: 7px 2px;
  border-bottom: 1px solid var(--border);
  gap: 0 10px;
  transition: background .1s;
}
.stmt-row:hover { background: rgba(50,62,72,.03); }
.stmt-row.checked { background: rgba(46,139,87,.05); }
.stmt-row:last-child { border-bottom: none; }

/* ── AP Bills table ──────────────────────────────────────── */
.bills-allclear {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 24px; border-radius: 8px;
  background: rgba(46,139,87,.08); border: 1px solid rgba(46,139,87,.25);
  color: var(--green); font-size: 14px; font-weight: 600;
  margin-top: 8px;
}
.bills-allclear-icon { font-size: 20px; }

.bills-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 6px;
  background: #fff8e1; border: 1px solid var(--yellow);
  color: #5a4a00; font-size: 13px; margin-bottom: 16px;
}

.bills-error {
  padding: 12px 16px; border-radius: 6px;
  background: #fdecea; border: 1px solid var(--red);
  color: #7a1010; font-size: 13px; margin-top: 8px;
}
.fxfwd-retry-btn {
  margin-left: 10px; padding: 4px 12px; border-radius: 4px;
  background: var(--red); color: var(--white); font-size: 12px; font-weight: 600;
}
.fxfwd-retry-btn:hover { background: #b82320; }

.bills-table-wrap { margin-top: 8px; overflow-x: auto; }
.bills-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.bills-table th {
  text-align: left; padding: 8px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.bills-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.bills-table tr:last-child td { border-bottom: none; }
.bills-table tbody tr:hover td { background: rgba(50,62,72,.03); }
.bills-table .col-date  { white-space: nowrap; width: 100px; }
.bills-table .col-vendor { }
.bills-table .col-po    { white-space: nowrap; font-weight: 600; }
.bills-table .col-ir    { white-space: nowrap; }
.bills-table .col-status { }
.bills-status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  background: #fff3cd; color: #856404;
}

/* ── Supplier Statement Reconciliation ──────────────────── */
.stmt-rec-header,
.stmt-rec-row,
.stmt-rec-totals {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) 110px 66px 130px 110px minmax(200px, 3fr);
  align-items: center;
  gap: 0 10px;
}
.stmt-rec-header {
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 8px 2px; border-bottom: 2px solid var(--border);
}
.stmt-rec-row {
  padding: 5px 2px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.stmt-rec-row:hover { background: rgba(50,62,72,.03); }
.stmt-rec-row.matched { background: rgba(46,139,87,.05); }

.stmt-rec-totals {
  padding: 7px 2px;
  border-top: 2px solid var(--border);
  margin-top: 2px;
  font-weight: 700;
}
.totals-label {
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-muted);
}

.col-right  { text-align: right; }
.col-center { text-align: center; }

.stmt-rec-vendor { font-size: 13px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stmt-rec-ns-bal { font-size: 13px; font-weight: 600; color: var(--charcoal); text-align: right; font-variant-numeric: tabular-nums; }
.stmt-rec-nostmt-col { display: flex; justify-content: center; align-items: center; }

.stmt-rec-stmt-col { }
.stmt-amount-input {
  width: 100%; height: 26px; font-size: 12px;
  padding: 0 8px; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); font-family: inherit; text-align: right;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s;
}
.stmt-amount-input:focus { outline: none; border-color: var(--charcoal-lt); }
.stmt-amount-input::placeholder { color: var(--light-grey); text-align: right; }

.stmt-rec-variance {
  font-size: 12px; font-weight: 600; text-align: center;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.variance-empty { color: var(--light-grey); }
.variance-match { color: var(--green); }
.variance-diff  { color: var(--red); }

.stmt-rec-note-col { display: flex; align-items: center; gap: 6px; min-width: 0; }

/* ── Realized G/L balance hero ──────────────────────────── */
.balance-hero {
  display: flex; align-items: center; gap: 20px;
  padding: 20px 24px; border-radius: 8px; margin-bottom: 20px;
  border: 2px solid var(--border);
}
.balance-hero.ok   { border-color: rgba(46,139,87,.4); background: rgba(46,139,87,.06); }
.balance-hero.warn { border-color: rgba(220,43,38,.3);  background: rgba(220,43,38,.04); }
.balance-hero-label  { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.balance-hero-amount { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.balance-hero.ok   .balance-hero-amount { color: var(--green); }
.balance-hero.warn .balance-hero-amount { color: var(--red);   }
.balance-hero-actions {
  margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.review-check-area {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted);
}
.review-check-area input[type=checkbox] {
  width: 15px; height: 15px; accent-color: var(--green); cursor: pointer;
}
.review-note-input {
  width: 260px; height: 28px; font-size: 12px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); font-family: inherit;
}
.review-note-input:focus { outline: none; border-color: var(--charcoal-lt); }

/* ── Realized G/L: 3-month balance tiles ───────────────── */
.rgl-months-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.rgl-month-tile {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px 24px;
}
.rgl-month-review { border-color: var(--charcoal); border-width: 2px; }
.rgl-month-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}
.rgl-month-amount {
  font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--charcoal);
}
.rgl-bal-neg  { color: var(--text); }
.rgl-bal-zero { color: var(--green); }
.rgl-review-area {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
  flex-wrap: wrap;
}

/* ── Forward Reconcile FX Accounts ─────────────────────── */
.fxfwd-account-panel  { margin-bottom: 36px; }
.fxfwd-account-title  {
  font-size: 14px; font-weight: 700; color: var(--charcoal);
  margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.fxfwd-currency-badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  background: var(--charcoal); color: var(--white);
}

.fxfwd-header,
.fxfwd-row {
  display: grid;
  grid-template-columns: 80px 110px 110px 130px 130px 90px 90px minmax(160px, 2fr);
  align-items: center; gap: 0 8px;
}
.fxfwd-header {
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 6px 2px; border-bottom: 2px solid var(--border);
}
.fxfwd-row {
  padding: 4px 2px; border-bottom: 1px solid var(--border); transition: background .1s;
}
.fxfwd-row:hover { background: rgba(50,62,72,.03); }
.fxfwd-row.fxfwd-matched { background: rgba(46,139,87,.05); }

.fxfwd-month { font-size: 13px; font-weight: 600; color: var(--charcoal); }
.fxfwd-bal   {
  font-size: 13px; text-align: right; font-variant-numeric: tabular-nums;
  padding-right: 4px;
}
.fxfwd-bal.neg { color: var(--red); }
.fxfwd-exp-input {
  width: 100%; height: 26px; font-size: 12px; text-align: right;
  padding: 0 6px; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); font-family: inherit; font-variant-numeric: tabular-nums;
}
.fxfwd-exp-input:focus { outline: none; border-color: var(--charcoal-lt); }
.fxfwd-variance {
  font-size: 12px; font-weight: 600; text-align: center;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.fxfwd-note-col { display: flex; align-items: center; gap: 6px; min-width: 0; }

/* ── Other Checks (manual saved-search checklist) ───────── */
.other-check-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 20px; margin-bottom: 14px;
}
.other-check-card.complete { background: rgba(46,139,87,.05); border-color: rgba(46,139,87,.3); }
.other-check-body { flex: 1; min-width: 0; }
.other-check-header {
  font-size: 14px; font-weight: 700; color: var(--charcoal); margin-bottom: 6px;
}
.other-check-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px;
}
.btn-other-check-link {
  display: inline-block; font-size: 13px; font-weight: 600;
  color: var(--white); background: var(--charcoal);
  padding: 7px 14px; border-radius: 6px; text-decoration: none;
}
.btn-other-check-link:hover { background: var(--charcoal-lt); }
.other-check-complete {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); white-space: nowrap; flex-shrink: 0; padding-top: 2px; cursor: pointer;
}
.other-check-complete input[type=checkbox] {
  width: 16px; height: 16px; accent-color: var(--green); cursor: pointer;
}

/* ── Dashboard ──────────────────────────────────────────── */
.dashboard-refresh-panel {
  padding: 28px 0 0;
}
.dashboard-refresh-panel p {
  color: var(--text-muted); margin-bottom: 16px; font-size: 14px;
}
.btn-refresh-all {
  background: var(--orange); color: #fff; border: none;
  padding: 10px 22px; border-radius: 6px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-refresh-all:hover { opacity: .88; }
.btn-refresh-all:disabled { opacity: .55; cursor: default; }
.refresh-status { margin-top: 12px; font-size: 13px; color: var(--text-muted); }

.refresh-progress-wrap { margin-top: 16px; max-width: 420px; }
.refresh-progress-bar {
  width: 100%; height: 10px; border-radius: 6px;
  background: var(--border); overflow: hidden;
}
.refresh-progress-fill {
  height: 100%; width: 0%; background: var(--orange); border-radius: 6px;
  transition: width .25s ease;
}
.refresh-progress-label { margin-top: 6px; font-size: 12px; color: var(--text-muted); }

/* ── Coming soon placeholder ────────────────────────────── */
.coming-soon {
  color: var(--text-muted); font-size: 15px;
  padding: 60px 0; text-align: center;
  border: 2px dashed var(--border); border-radius: 8px;
}

/* ── Periods Dashboard (year/month overview grid) ───────── */
.periods-year-block { margin-bottom: 32px; }
.periods-year-label {
  font-size: 15px; font-weight: 700; color: var(--charcoal);
  margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid var(--border);
}
.periods-month-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; max-width: 640px;
}
.period-tile {
  padding: 22px 10px; border-radius: 8px; text-align: center;
  font-size: 14px; font-weight: 700; color: var(--white);
  border: none; transition: opacity .12s, transform .12s;
}
.period-tile:not(.period-tile-empty):hover { opacity: .85; transform: translateY(-1px); }
.period-tile-not_started { background: var(--light-grey); }
.period-tile-outstanding { background: var(--orange); }
.period-tile-complete    { background: var(--green); }
.period-tile-empty {
  background: transparent; border: 2px dashed var(--border);
  color: var(--light-grey); cursor: default;
}

/* ── Dashboard per-check status summary ─────────────────── */
.dash-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-top: 22px; }
.dash-summary-loading { color: var(--text-muted); font-size: 13px; }
.dash-grp { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.dash-grp-head { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.dash-check { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); }
.dash-check:nth-of-type(2) { border-top: none; }  /* first check row (after the header div) */
.dash-check-label { font-size: 13px; color: var(--text); line-height: 1.3; }
.dash-badge { position: relative; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.dash-badge.done    { background: rgba(46,139,87,.15);  color: var(--green); }
.dash-badge.flag    { background: rgba(234,118,49,.18); color: var(--orange); cursor: help; }
.dash-badge.unknown { background: rgba(151,164,173,.22); color: var(--light-grey); cursor: help; }
.dash-tip {
  position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 20; white-space: nowrap;
  background: #fdeede; border: 1px solid var(--orange); color: #9a4a13;
  font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.14); opacity: 0; visibility: hidden;
  transition: opacity .12s; pointer-events: none;
}
.dash-badge:hover .dash-tip, .dash-badge:focus .dash-tip { opacity: 1; visibility: visible; }
.dash-badge.unknown .dash-tip { background: #eef1f3; border-color: var(--light-grey); color: var(--text-muted); }

/* ── Clearing Accounts ──────────────────────────────────── */
.clearing-table .col-clearing-name   { text-align: left; }
.clearing-table .col-clearing-status { text-align: right; white-space: nowrap; }
.clearing-row-flag td { background: rgba(234,118,49,.06); }
.clearing-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; }
.clearing-badge.cleared    { background: rgba(46,139,87,.15);  color: var(--green); }
.clearing-badge.notcleared { background: rgba(234,118,49,.18); color: var(--orange); }

.clearing-table .col-clearing-reg,
.clearing-table .col-clearing-chk { text-align: center; white-space: nowrap; width: 1%; }
.clearing-reg-link { color: var(--orange); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.clearing-reg-link:hover { text-decoration: underline; }
.clearing-table input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--charcoal); }
.clearing-table input[type=checkbox]:disabled { cursor: default; opacity: .4; }
.clearing-badge.checked { background: rgba(50,62,72,.10); color: var(--charcoal-lt); }
