/* ---------- login + users ---------- */
.loginwrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, #EAF1FE 0%, #F8FAFE 60%, #FFFFFF 100%); }
.logincard { width: 100%; max-width: 420px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: var(--r-lg); padding: 28px 24px; box-shadow: 0 16px 40px rgba(62, 116, 224, .14); }
.logincard .brand { color: var(--accent); justify-content: center; margin-bottom: 4px; }
.logincard .brand svg { color: var(--gold); }
.logincard h1 { font-size: 1.2rem; text-align: center; }
.logincard .sub { text-align: center; color: var(--ink-2); font-size: .88rem; margin: 4px 0 20px; }
.pwrow { position: relative; }
.pwrow input { padding-inline-end: 44px; }
.pwrow .eye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-3); border-radius: 8px; }
.pwrow .eye:hover { background: var(--accent-soft); color: var(--ink); }
input[type="password"], input[type="tel"], input[type="email"] { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
input[type="password"]:focus, input[type="tel"]:focus, input[type="email"]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); outline: none; }
input.ltr { direction: ltr; text-align: start; }
.loginerr { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: .88rem; margin-bottom: 14px; }
.demobox { margin-top: 20px; border: 1px dashed var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.demobox h4 { font-size: .82rem; color: var(--ink-3); margin-bottom: 8px; }
.demobox button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border: 0; background: transparent; border-radius: 8px; text-align: start; font-size: .86rem; }
.demobox button:hover { background: var(--gold-soft); }
.uchip { display: inline-flex; align-items: center; gap: 10px; padding: 3px 4px 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.uchip .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--icon-soft); color: var(--accent); font-weight: 700; }
.uchip .un { display: grid; line-height: 1.2; font-size: .84rem; }
.uchip .un small { color: var(--ink-3); font-size: .72rem; }
.uchip button { border: 0; background: #FFFFFF; border: 1px solid var(--line); color: var(--ink); padding: 6px 12px; min-height: 32px; border-radius: 999px; font-weight: 500; }
.uchip button:hover { background: var(--icon-soft); }
.ustats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.ustat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow); }
.ustat b { display: block; font: 600 1.5rem var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.ustat span { color: var(--ink-3); font-size: .8rem; }
.uform { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 16px; }
.uform .field { margin-bottom: 12px; }
.pwgen { display: flex; gap: 8px; }
.pwgen .pwrow { flex: 1; }
.tempbox { border: 1px solid var(--gold); background: var(--gold-soft); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.tempbox .mono { font-size: 1.05rem; font-weight: 700; padding: 4px 10px; background: var(--surface); border-radius: 8px; border: 1px solid var(--line); }
.confirmbar { border: 1px solid var(--bad); background: var(--bad-soft); color: var(--bad); border-radius: var(--r-md); padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 600; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: start; font-weight: 600; }
.yes { color: var(--ok); font-weight: 700; } .no { color: var(--ink-3); }
.checkrow { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.checkrow input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- users page: flat, fewer boxes ---------- */
.userspage { gap: 20px; }
.userspage .ustats { display: flex; flex-wrap: wrap; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 0; box-shadow: none; }
.userspage .ustat { flex: 1 1 110px; background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 8px 18px; border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; gap: 0; }
.userspage .ustat:last-child { border-inline-start: 0; }
.userspage .ustat b { font-size: 1.45rem; line-height: 1.3; }
.userspage .ustat span { font-size: .8rem; }
.uformwrap { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 18px 0 4px; }
.uformwrap > h3 { font-size: 1.05rem; margin-bottom: 14px; }
.userspage .uform { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; align-items: start; }
@media (max-width: 900px) { .userspage .uform { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .userspage .uform { grid-template-columns: minmax(0, 1fr); } }
.userspage .uform .field { align-content: start; align-self: start; margin-bottom: 14px; }
.userspage .uform input[type="text"], .userspage .uform input[type="password"], .userspage .uform select { background: var(--surface-2); border-color: transparent; }
.userspage .uform input:focus, .userspage .uform select:focus { background: var(--surface); border-color: var(--gold); }
.userspage .formactions { padding-top: 6px; }
.userspage .tablewrap { background: var(--surface); border: 1px solid #CBD5E6; border-radius: var(--r-md); overflow-x: auto; box-shadow: 0 1px 2px rgba(29, 42, 68, .06); }
.userspage table { border-collapse: separate; border-spacing: 0; }
.userspage th { background: #EEF3FC; color: var(--ink-2); font-size: .8rem; padding: 10px 12px; border-bottom: 1px solid #CBD5E6; border-inline-end: 1px solid var(--line); }
.userspage td { padding: 12px; border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); }
.userspage th:last-child, .userspage td:last-child { border-inline-end: 0; }
.userspage tbody tr:last-child td { border-bottom: 0; }
.userspage tbody tr:nth-child(even) td { background: #FAFBFE; }
.userspage tbody tr:hover td { background: var(--accent-soft); }
.userspage .thf { background: var(--surface) !important; border: 1px solid #CBD5E6 !important; }
.userspage .thf:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
.rowacts { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px; }
.linkbtn { border: 0; background: transparent; color: var(--accent); font-weight: 600; font-size: .86rem; padding: 6px 10px; min-height: 36px; border-radius: 8px; white-space: nowrap; }
.linkbtn:hover { background: var(--accent-soft); }
.linkbtn.danger { color: var(--bad); }
.linkbtn.danger:hover { background: var(--bad-soft); }
.userspage .matrix th, .userspage .matrix td { text-align: center; }
.userspage .matrix th:first-child, .userspage .matrix td:first-child { text-align: start; }
@media (max-width: 640px) { .userspage .ustat { flex-basis: 45%; border-inline-start: 0; } .rowacts { flex-wrap: wrap; } }

.load.top .track i { background: var(--c-ok); }
.load.top li.first { font-weight: 700; }
.load.top .crown { margin-inline-start: 8px; padding: 1px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: .72rem; font-weight: 600; }

/* ---------- users list ---------- */
.ulist { display: grid; gap: 12px; }
.utools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.utools select { width: auto; min-width: 150px; min-height: 42px; }
.usearch { position: relative; flex: 1 1 260px; max-width: 420px; }
.usearch .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.usearch input { padding-inline-start: 38px; min-height: 42px; }
.ucount { margin-inline-start: auto; }
.utable td { padding: 14px 14px; vertical-align: middle; }
.utable th { padding: 11px 14px; }
.utable tr.off td { background: #FBFBFD; color: var(--ink-3); }
.utable tr.off .uav { filter: grayscale(1); opacity: .7; }
.ucell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.uav { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 600 1.05rem var(--f-display); background: var(--accent-soft); color: var(--accent); }
.uav.manager { background: #EFE9FC; color: #6B43C8; }
.uav.matcher { background: var(--ok-soft); color: var(--ok); }
.uav.supplier { background: var(--warn-soft); color: var(--warn); }
.utxt { display: grid; gap: 1px; min-width: 0; line-height: 1.45; }
.utxt strong { font-weight: 600; color: var(--ink); }
.unum, .usub { color: var(--ink-3); font-size: .8rem; }
.you { margin-inline-start: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .7rem; font-weight: 600; }
.rolepill { display: inline-block; padding: 3px 12px; border-radius: 8px; font-size: .8rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.rolepill.manager { background: #EFE9FC; color: #6B43C8; }
.rolepill.matcher { background: var(--ok-soft); color: var(--ok); }
.rolepill.supplier { background: var(--warn-soft); color: var(--warn); }
.utable .actcell { white-space: nowrap; }
@media (max-width: 760px) {
  .utools { gap: 8px; }
  .usearch { flex: 1 1 100%; max-width: none; }
  .utools select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .ucount { margin-inline-start: 0; width: 100%; }
  .userspage .utable { display: block; border: 0; }
  .userspage .tablewrap:has(.utable) { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .utable thead { display: none; }
  .utable tbody { display: grid; gap: 10px; }
  .utable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "a d" "b e" "c c" "f f"; gap: 8px 12px; align-items: center;
    padding: 14px; background: var(--surface); border: 1px solid #CBD5E6; border-radius: var(--r-md); box-shadow: 0 1px 2px rgba(29, 42, 68, .05); }
  .utable td, .userspage .utable td { display: block; padding: 0; border: 0 !important; background: transparent !important; min-width: 0; }
  .utable td::before { content: none; }
  .utable td:nth-child(1) { grid-area: a; }
  .utable td:nth-child(2) { grid-area: b; }
  .utable td:nth-child(3) { grid-area: c; }
  .utable td:nth-child(4) { grid-area: d; justify-self: end; }
  .utable td:nth-child(5) { grid-area: e; justify-self: end; color: var(--ink-3); font-size: .8rem; }
  .utable td:nth-child(5)::before { content: 'آخر دخول: '; }
  .utable td:nth-child(6) { grid-area: f; padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line) !important; }
  .utable .rowacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
  .utable .linkbtn { text-align: center; border: 1px solid var(--line); background: var(--surface-2); padding: 6px 4px; font-size: .82rem; white-space: normal; line-height: 1.3; }
  .utable .linkbtn.danger { border-color: var(--bad-soft); background: var(--bad-soft); }
  .utable tr.off { background: #FBFBFD; }
  .utable tr.off td { background: transparent !important; }
}

/* ---------- permissions matrix ---------- */
.permwrap { display: grid; gap: 12px; padding-top: 6px; }
.permhead { display: grid; gap: 2px; }
.permhead h3 { font-size: 1.05rem; }
.userspage .matrix th, .userspage .matrix td { text-align: center; padding: 11px 10px; }
.userspage .matrix th:first-child, .userspage .matrix td:first-child { text-align: start; font-weight: 600; color: var(--ink); }
.userspage .matrix th { white-space: nowrap; }
.userspage .matrix tbody tr:hover td { background: var(--accent-soft); }
.perm { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .9rem; line-height: 1; }
.perm.yes { background: var(--ok-soft); color: var(--ok); }
.perm.yes .ic { display: block; }
.perm.no { color: #B4BCCB; }
@media (max-width: 560px) {
  .userspage .matrix th, .userspage .matrix td { padding: 10px 4px; font-size: .78rem; }
  .userspage .matrix th:first-child, .userspage .matrix td:first-child { padding-inline-start: 10px; }
  .userspage .matrix .rolepill { padding: 2px 6px; font-size: .7rem; white-space: normal; display: inline-block; line-height: 1.25; }
  .perm { width: 24px; height: 24px; }
}

/* ---------- navigation column: account chip and page buttons on small screens ---------- */
@media (max-width: 860px) {
  .seg button { flex: 1 1 0; min-width: 0; padding: 6px 6px; font-size: .86rem; line-height: 1.25; }
  .uchip .un { max-width: 120px; }
  .uchip .un span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .uchip button { padding: 4px 10px; min-height: 30px; }
}
@media (max-width: 440px) {
  .uchip .un { display: none; }
  .uchip { padding-inline-start: 3px; }
}

/* ---------- every data table: bordered grid on desktop, cards on phones ---------- */
.dtm { display: none; }
.dtbox .tablewrap { background: var(--surface); border: 1px solid #CBD5E6; border-radius: var(--r-md); overflow-x: auto; box-shadow: 0 1px 2px rgba(29, 42, 68, .06); }
.dtbox .dt { border-collapse: separate; border-spacing: 0; }
.dtbox .dt th { background: #EEF3FC; color: var(--ink-2); font-size: .8rem; padding: 10px 12px; border-bottom: 1px solid #CBD5E6; border-inline-end: 1px solid var(--line); }
.dtbox .dt td { padding: 12px; border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); }
.dtbox .dt th:last-child, .dtbox .dt td:last-child { border-inline-end: 0; }
.dtbox .dt tbody tr:last-child td { border-bottom: 0; }
.dtbox .dt tbody tr:nth-child(even) td { background: #FAFBFE; }
.dtbox .dt tbody tr:hover td { background: var(--accent-soft); }
.dtbox .dt tbody tr.unread td { background: color-mix(in srgb, var(--c-bad) 7%, var(--surface)); }
.dtbox .thf { background: var(--surface) !important; border: 1px solid #CBD5E6 !important; }
/* desktop tables: every column fits the content width, compact cells, the action column is never clipped */
.dtbox .dt { width: 100%; table-layout: auto; }
.dtbox .dt th { padding: 8px 6px; font-size: .78rem; line-height: 1.35; vertical-align: middle; }
.dtbox .dt .thbtn, .dtbox .dt .thlabel { white-space: normal; text-align: start; line-height: 1.3; }
.dtbox .dt td { padding: 8px 6px; font-size: .84rem; line-height: 1.4; vertical-align: middle; }
@media (max-width: 1280px) { .dtbox .dt td { font-size: .8rem; padding-inline: 5px; } .dtbox .dt th { padding-inline: 5px; font-size: .74rem; } }
@media (max-width: 1180px) { .dtbox .dt td, .dtbox .dt th { padding-inline: 4px; } .dtbox .thf { padding-inline: 4px !important; } }
/* narrower screens: the search box above the table does the filtering, so the header filter cells are hidden to keep every column in view */
@media (max-width: 1280px) { .dtbox .thslot { display: none; } }
.dtbox .dt td:first-child, .dtbox .dt td:last-child { white-space: nowrap; }
.dtbox .dt td .rowacts { gap: 4px; }
.dtbox .dt td .btn.sm, .dtbox .dt td .abtn { min-height: 32px; padding-inline: 8px; }
.dtbox .dt td .abl { display: none; }
.dtbox .thslot { min-width: 0; width: 100%; }
.dtsearch { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-bottom: 8px; }
.dtsearch .dtq { flex: 1 1 240px; max-width: 420px; }
.dtsearch .dtxl { flex: none; min-height: 36px; }
.dtq { width: min(320px, 100%); min-height: 36px; padding: 6px 12px; border: 1px solid #B7C9E8; border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; }
.dtq:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dtbox .dt td.rownum, .dtbox .dt th:first-child { width: 34px; min-width: 0; padding-inline: 2px; text-align: center; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dtbox .dt td.rownum { font-size: .78rem; }
/* the filter takes the width of its column: a 1px base keeps its own width out of the column sizing */
.dtbox .thf { width: 1px; min-width: 100%; padding: 4px 6px; font-size: .8rem; }
@media (max-width: 760px) {
  .dtm { display: grid; gap: 10px; }
  .dtm-toggle { justify-self: start; gap: 8px; }
  .dtm-n { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; line-height: 18px; text-align: center; }
  .dtm-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
  .dtm-panel .tfield { min-width: 0; }
  .dtm-panel .thf { min-height: 40px !important; font-size: .9rem; }
  .dtbox .tablewrap { background: transparent; border: 0; box-shadow: none; overflow: visible; border-radius: 0; }
  .dtbox .dt, .dtbox .dt tbody { display: block; }
  .dtbox .dt thead { display: none; }
  .dtbox .dt tbody { display: grid; gap: 10px; }
  .dtbox .dt tr { display: grid; gap: 6px; padding: 14px; background: var(--surface); border: 1px solid #CBD5E6; border-radius: var(--r-md); box-shadow: 0 1px 2px rgba(29, 42, 68, .05); }
  .dtbox .dt tbody tr.unread { background: color-mix(in srgb, var(--c-bad) 7%, var(--surface)); }
  .dtbox .dt td, .dtbox .dt tbody tr:nth-child(even) td, .dtbox .dt tbody tr:hover td, .dtbox .dt tbody tr.unread td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0; border: 0; background: transparent; min-width: 0; text-align: end; }
  .dtbox .dt td[data-label]::before { content: attr(data-label); flex: none; color: var(--ink-3); font-size: .78rem; text-align: start; }
  .dtbox .dt td[data-col="id"], .dtbox .dt td[data-col="supplier"] { font-weight: 600; }
  .dtbox .dt td[data-col="open"] { padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line); }
  .dtbox .dt td[data-col="open"]::before { content: none; }
  .dtbox .dt td[data-col="open"] .btn { width: 100%; }
  .dtbox .dt td .abl { display: inline; }
  .dtbox .dt td.empty { display: block; text-align: center; padding: 20px 0; }
  .dtbox .pager { justify-content: space-between; }
}

/* ---------- account chip in the top bar ---------- */
.uchip { gap: 10px; padding: 3px 3px 3px 4px; background: var(--surface); border-color: #D5DDEC; box-shadow: 0 1px 2px rgba(29, 42, 68, .06); }
.uchip .av { width: 34px; height: 34px; font: 600 .95rem var(--f-display); }
.uchip .av.manager { background: #EFE9FC; color: #6B43C8; }
.uchip .av.matcher { background: var(--ok-soft); color: var(--ok); }
.uchip .av.supplier { background: var(--warn-soft); color: var(--warn); }
.uchip .un { gap: 0; line-height: 1.25; }
.uchip .un span { font-weight: 600; color: var(--ink); }
.uchip button { border: 0; background: var(--surface-2); color: var(--ink-2); padding: 6px 14px; min-height: 34px; font-weight: 600; transition: background-color .15s, color .15s; }
.uchip button:hover { background: var(--bad-soft); color: var(--bad); }
.uchip button:focus-visible { outline-offset: 1px; }
@media (max-width: 860px) { .sideuser { padding: 2px 2px 2px 3px; gap: 8px; } .uchip .av { width: 32px; height: 32px; } .uchip button { padding: 4px 12px; min-height: 32px; } }

/* ---------- statement reconciliation page ---------- */
.rc-side { background: var(--surface); }
.sidetitle { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.stepno { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 700 .85rem var(--f-display); }
.dz { background: var(--surface-2); }
@media (max-width: 640px) {
  .recon .sechead { align-items: flex-start; }
  .recon > p.muted { font-size: .9rem; line-height: 1.65; }
  .rc-side { padding: 14px; gap: 10px; }
  .rc-side .dz { min-height: 108px; padding: 14px 10px; }
  .rc-side select { font-size: .84rem; padding-inline: 10px; }
  .rc-bar { padding: 12px; }
  .rc-bar .tfield { min-width: 0; flex: 1 1 100%; }
  .rc-bar-acts { margin-inline-start: 0; width: 100%; }
  .rc-bar-acts .btn { flex: 1 1 0; }
}

.stmt tr.sec td { background: #EEF3FC !important; font-weight: 700; color: var(--ink); display: table-cell; padding: 9px 12px; border-bottom: 1px solid #CBD5E6; }
.stmt tr.sec .stepno { display: inline-grid; margin-inline-end: 10px; vertical-align: middle; }
.stmt td.num { text-align: end; white-space: nowrap; }
@media (max-width: 640px) { .stmt td { padding: 10px 12px; font-size: .88rem; } }

/* ---------- formal reconciliation statement ---------- */
.rc-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid #CBD5E6; border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.rc-meta > div { display: grid; gap: 1px; padding: 9px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.rc-meta > div:nth-child(odd) { border-inline-end: 1px solid var(--line); }
.rc-meta > div:nth-last-child(-n+2) { border-bottom: 0; }
.rc-meta span { color: var(--ink-3); font-size: .76rem; }
.rc-meta strong { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.stmt { border-radius: var(--r-md); }
.stmt table { width: 100%; }
.stmt th { background: #EEF3FC; font-size: .78rem; padding: 8px 12px; }
.stmt th.cnt, .stmt td.cnt { text-align: center; width: 70px; color: var(--ink-3); font-size: .8rem; font-variant-numeric: tabular-nums; }
.stmt th.num, .stmt td.num { text-align: end; width: 150px; white-space: nowrap; }
.stmt td { padding: 8px 12px; font-size: .88rem; }
.stmt .mono { font-variant-numeric: tabular-nums; }
.stmt tr.strong td { font-weight: 700; }
.stmt tr.total td { border-top: 1px solid var(--ink); }
.stmt tr.total td.num { border-bottom: 3px double var(--ink); }
.stmt tr.sec td { background: #F4F7FD !important; font-size: .84rem; padding: 7px 12px; }
.stmt tr.dtl { display: none; }
.stmt tr.dtl.open { display: table-row; }
.stmt tr.dtl td { color: var(--ink-2); font-size: .82rem; padding-block: 5px; }
.stmt tr.dtl td:first-child { padding-inline-start: 34px; }
.dtl-toggle { border: 0; background: transparent; color: var(--accent); padding: 0; margin-inline-end: 8px; width: 22px; height: 22px; border-radius: 6px; vertical-align: middle; }
.dtl-toggle:hover { background: var(--accent-soft); }
@media (max-width: 640px) {
  .rc-meta { grid-template-columns: minmax(0, 1fr); }
  .rc-meta > div:nth-child(odd) { border-inline-end: 0; }
  .rc-meta > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .stmt th.num, .stmt td.num { width: auto; }
  .stmt th.cnt, .stmt td.cnt { width: 44px; }
  .stmt td { padding: 8px 8px; font-size: .84rem; }
}
@media print { .stmt tr.dtl { display: table-row !important; } .dtl-toggle { display: none; } }
/* uploaded files take less room once they are read */
.dz.ready { min-height: 0; padding: 10px 12px; grid-auto-flow: column; justify-content: start; align-content: center; gap: 12px; text-align: start; }
.dz.ready .dz-t { text-align: start; }
@media (max-width: 760px) { .dtbox .dt td .rc-reason { min-width: 0; max-width: 100%; text-align: start; } .dtbox .dt td[data-col="reason"] { align-items: flex-start; flex-direction: column; gap: 2px; } }

/* ---------- reconciliation result: tabs, formal report, spreadsheet ---------- */
.rc-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; justify-self: start; }
.rc-tabs button { border: 0; background: transparent; color: var(--ink-2); padding: 8px 18px; min-height: 38px; border-radius: 9px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.rc-tabs button:hover { background: var(--icon-soft); }
.rc-tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 0 0 1px #CBD5E6, 0 1px 2px rgba(29, 42, 68, .08); }
.rc-tabn { min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .74rem; line-height: 20px; text-align: center; }

.rc-doc { background: #fff; border: 1px solid #CBD5E6; border-radius: 6px; padding: clamp(16px, 4vw, 40px); box-shadow: 0 6px 24px rgba(29, 42, 68, .08); display: grid; gap: 16px; max-width: 900px; width: 100%; justify-self: center; }
.rc-letter { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 14px; border-bottom: 3px double var(--ink); }
.rc-org { display: grid; gap: 2px; }
.rc-org strong { font: 700 1.35rem var(--f-display); color: var(--ink); }
.rc-org span { color: var(--ink-2); font-size: .85rem; }
.rc-ref { display: grid; gap: 4px; text-align: end; }
.rc-ref > div { display: flex; gap: 8px; justify-content: flex-end; align-items: baseline; }
.rc-ref span { color: var(--ink-3); font-size: .76rem; }
.rc-ref strong { font-size: .86rem; }
.rc-title { text-align: center; display: grid; gap: 4px; padding-block: 4px; }
.rc-title h2 { font-size: 1.35rem; letter-spacing: 0; }
.rc-title p { color: var(--ink-2); font-size: .86rem; }
.rc-doc .rc-meta { border-radius: 4px; border-color: #B8C3D8; }
.rc-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #B8C3D8; border-radius: 4px; }
.rc-sum > div { display: grid; gap: 2px; padding: 10px 12px; text-align: center; border-inline-start: 1px solid var(--line); }
.rc-sum > div:first-child { border-inline-start: 0; }
.rc-sum span { color: var(--ink-3); font-size: .74rem; }
.rc-sum strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.rc-h { font-size: 1rem; padding-top: 6px; border-top: 1px solid var(--line); }
.rc-doc .stmt { border-radius: 4px; border-color: #B8C3D8; box-shadow: none; }
.rc-note-text { color: var(--ink-2); font-size: .86rem; line-height: 1.8; }
.rc-sign { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-top: 18px; }
.rc-sign > div { display: grid; gap: 34px; font-size: .84rem; font-weight: 600; text-align: center; }
.rc-line { border-bottom: 1px solid var(--ink-2); }
@media (max-width: 640px) {
  .rc-letter { flex-direction: column; }
  .rc-ref { text-align: start; }
  .rc-ref > div { justify-content: flex-start; }
  .rc-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-sum > div:nth-child(odd) { border-inline-start: 0; }
  .rc-sum > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .rc-sign { gap: 10px; }
}

.rc-sheetbox { display: grid; gap: 10px; }
.rc-sheetbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rc-sheetbar select { width: auto; min-width: 190px; min-height: 42px; }
.rc-grid { overflow: auto; max-height: 70vh; background: #fff; border: 1px solid #9FB0CC; border-radius: 4px; }
.rc-grid table { border-collapse: collapse; min-width: 1100px; width: 100%; font-size: .8rem; }
.rc-grid th, .rc-grid td { border: 1px solid #D5DDEC; padding: 5px 9px; white-space: nowrap; text-align: start; vertical-align: middle; }
.rc-grid thead th { position: sticky; top: 0; z-index: 2; background: #E6EDF9; color: var(--ink); font-weight: 700; border-color: #B8C3D8; }
.rc-grid .rn { width: 44px; min-width: 44px; text-align: center; background: #F1F4FA; color: var(--ink-3); position: sticky; inset-inline-start: 0; z-index: 1; }
.rc-grid thead .rn { z-index: 3; background: #E6EDF9; }
.rc-grid .n { text-align: end; font-variant-numeric: tabular-nums; }
.rc-grid .c { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; }
.rc-grid .why { white-space: normal; min-width: 280px; color: var(--ink-2); font-size: .78rem; }
.rc-grid tbody tr:nth-child(even) td:not(.rn) { background: #FAFBFE; }
.rc-grid tbody tr:hover td:not(.rn) { background: var(--accent-soft); }
.rc-grid .st { font-weight: 600; }
.rc-grid .st.t-ok { color: var(--ok); } .rc-grid .st.t-warn { color: var(--warn); } .rc-grid .st.t-bad { color: var(--bad); } .rc-grid .st.t-work { color: var(--accent); }
.rc-grid tfoot td { position: sticky; bottom: 0; background: #E6EDF9; font-weight: 700; border-color: #B8C3D8; z-index: 2; }
.rc-grid td.empty { text-align: center; padding: 24px; color: var(--ink-3); }
.rc-more { justify-self: center; }
@media print { .rc-doc { box-shadow: none; border: 0; padding: 0; max-width: none; } .rc-tabs, .rc-sheetbox { display: none !important; } }
.rc-warn { padding: 12px 14px; border: 1px solid var(--bad); background: var(--bad-soft); color: var(--bad); border-radius: var(--r-md); font-weight: 600; font-size: .9rem; line-height: 1.7; }
.stmt td.rc-sub { color: var(--ink-3); font-size: .76rem; padding-block: 3px 7px; }

/* ---------- tracking page ---------- */
.thead { border-color: #CBD5E6; box-shadow: 0 1px 2px rgba(29, 42, 68, .05); }
.tmain { min-width: 0; }
.tmain .muted { overflow-wrap: anywhere; }
.step h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.step .now { padding: 1px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 600 .72rem var(--f-body); }
.step.current { }
.step .when { margin-top: 1px; }
.step.todo .desc { color: var(--ink-3); }
.step.current .desc { color: var(--ink); }
@media (max-width: 640px) {
  .thead { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 12px; align-items: center; }
  .thead .tback { min-height: 40px; padding: 6px 12px; }
  .thead .tbacktxt { display: none; }
  .thead .tdue { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); text-align: start; font-size: .86rem; }
  .ttitle .big { font-size: 1.05rem; }
  .panel { padding: 14px; }
  .step { grid-template-columns: 30px minmax(0, 1fr); gap: 0 12px; padding-bottom: 18px; }
  .step::before { inset-inline-start: 14px; top: 30px; }
  .mark { width: 30px; height: 30px; font-size: .8rem; }
  .step h4 { font-size: .96rem; padding-top: 3px; }
}

/* back button: a coloured, clearly clickable control */
.thead .tback { background: var(--accent-soft); color: var(--accent); border-color: #BFD1F5; font-weight: 700; transition: background-color .15s, color .15s, border-color .15s; }
.thead .tback .ic { color: inherit; }
.thead .tback:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- brighter, higher-contrast palette (replaces the washed-out greys) ---------- */
:root {
  --bg: #EDF3FF;
  --surface-2: #E8F0FE;
  --line: #CFDBF0;
  --ink-2: #34405A;
  --ink-3: #55607A;
  --accent: #2F6FEB;
  --accent-soft: #DCE9FF;
  --gold: #4F86F0; --gold-soft: #DAE7FF;
  --icon: #4F86F0; --icon-soft: #E0ECFF;
  --shadow: 0 1px 2px rgba(29, 42, 68, .06), 0 8px 24px rgba(47, 111, 235, .10);
}
input[type="text"], input[type="search"], input[type="password"], select, textarea { border-color: #B7C9E8; }
.btn.ghost { background: #fff; border-color: #B7C9E8; color: var(--accent); font-weight: 700; }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.pill.idle { background: #E1EBFF; color: #25479E; }
.field > label, .field > .lbl, .tfield label { color: var(--ink); }
.tfield label { font-size: .84rem; font-weight: 600; }

/* reconciliation: the two statements get their own colour so they are never mixed up */
.rc-side { border-top: 4px solid var(--accent); background: #fff; }
.rc-sides > .rc-side:nth-child(2) { border-top-color: #0E9F8E; }
.rc-sides > .rc-side:nth-child(2) .stepno { background: #0E9F8E; }
.stepno { background: var(--accent); color: #fff; }
.dz { background: #EAF2FF; border: 2px dashed #7FA6F5; color: var(--accent); }
.dz .ic { color: var(--accent); }
.dz:hover, .dz.over, .dz:focus-within { background: #DDEAFF; border-color: var(--accent); }
.dz.ready { background: #DDF5E7; border: 2px solid #1E9B62; color: #0F6B43; }
.dz.ready .dz-t small { color: #1B6B49; }
.dz.bad { background: #FDE4E1; border-color: #D8392F; color: #A3231B; }
.rc-note { background: #E4EEFF; color: var(--ink-2); border: 1px solid #CFDDF7; }
.rc-det > summary { color: var(--accent); }
.rc-det { background: #F7FAFF; border-color: #CFDBF0; }
.rc-bar { border-color: #CFDBF0; background: #fff; }
.sechead h2, .recon .sechead h2 { color: #14203A; }

/* document numbers in the details grid: one chip per number */
.rc-grid td.docs { white-space: normal; min-width: 170px; max-width: 280px; line-height: 1.9; }
.dchip { display: inline-block; direction: ltr; margin: 1px 3px 1px 0; padding: 0 7px; border: 1px solid #C3D2EE; border-radius: 6px; background: #F3F7FF; color: var(--ink-2); font: 500 .74rem ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.dchip.hit { background: #DDF5E7; border-color: #1E9B62; color: #0F6B43; font-weight: 700; }
.rc-grid .st { white-space: nowrap; }

/* active tab / cell: solid colour so the current page is unmistakable */
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 8px rgba(47, 111, 235, .35); font-weight: 700; }
.seg button[aria-pressed="true"]:hover { background: var(--accent); }
.seg button[aria-pressed="true"] .rbadge { box-shadow: 0 0 0 2px var(--accent); }
.rc-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 8px rgba(47, 111, 235, .35); }
.rc-tabs button[aria-selected="true"] .rc-tabn { background: rgba(255, 255, 255, .25); color: var(--accent-ink); }
.fchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- add / edit user form ---------- */
.uformwrap { background: #fff; border: 1px solid #CFDBF0; border-top: 4px solid var(--accent); border-radius: var(--r-lg); padding: 20px clamp(16px, 3vw, 28px) 22px; box-shadow: var(--shadow); }
.uformhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.uformhead h3 { font-size: 1.1rem; margin: 0; }
.uformclose { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.uformclose:hover { background: var(--bad-soft); color: var(--bad); }
.userspage .uform { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.userspage .uform .field.wide { grid-column: 1 / -1; }
.userspage .uform .field { margin-bottom: 16px; }
.userspage .uform .field > label, .userspage .uform .field > .lbl { font-size: .86rem; font-weight: 700; color: var(--ink); }
.userspage .uform input[type="text"], .userspage .uform input[type="password"], .userspage .uform select { background: #fff; border: 1px solid #B7C9E8; }
.userspage .uform input:focus, .userspage .uform select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pwgen .pwrow input:placeholder-shown { direction: rtl; text-align: right; }
.pwgen .btn { flex: none; min-width: 84px; }
.optrow { display: flex; flex-wrap: wrap; gap: 10px; }
.optrow .checkrow { min-height: 44px; padding: 0 14px; gap: 10px; border: 1px solid #B7C9E8; border-radius: 10px; background: #fff; font-size: .9rem; font-weight: 600; cursor: pointer; }
.optrow .checkrow:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.userspage .formactions { justify-content: flex-start; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .userspage .uform { grid-template-columns: minmax(0, 1fr); } .userspage .formactions .btn { flex: 1 1 0; } }
/* supplier address: a compact 3-column block inside the supplier form */
.userspage .addrgrid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; align-items: start; margin-bottom: 14px; padding: 10px 12px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.userspage .addrgrid .addrtitle { grid-column: 1 / -1; font-size: .84rem; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.userspage .addrgrid .field { margin-bottom: 8px; gap: 4px; }
.userspage .addrgrid .field > label { font-size: .8rem; }
.userspage .addrgrid input[type="text"] { min-height: 36px; padding-block: 6px; font-size: .88rem; }
@media (max-width: 640px) { .userspage .addrgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* password field: keep the text clear of the eye button (the generic password rule was resetting the padding) */
.pwrow input[type] { padding-inline-end: 52px; }
.pwrow .eye { inset-inline-end: 6px; width: 40px; height: 40px; border-radius: 8px; }
.pwrow input:placeholder-shown { text-overflow: ellipsis; }

/* users table: filters in the header, selects in the toolbar only on phones */
.utools .tool-mobile { display: none; }
.utable th { vertical-align: top; }
.utable .thcell { gap: 8px; }
.utable .thf { width: 100%; min-width: 96px; }
.utable .rowacts { flex-wrap: wrap; gap: 2px 4px; }
.utable .actcell { white-space: normal; min-width: 150px; }
@media (max-width: 760px) {
  .utools .tool-mobile { display: block; }
  .utools .btn.sm { order: 5; }
}

/* table headers: solid brand blue with white text */
.userspage .utable th, .userspage .matrix th, .dtbox .dt th {
  background: #2F6FEB; color: #fff; border-bottom: 0; border-inline-end-color: rgba(255, 255, 255, .25);
}
.userspage .utable th .thbtn, .dtbox .dt th .thbtn, .userspage .utable th .thlabel, .dtbox .dt th .thlabel, .userspage .utable th[aria-sort] { color: #fff; font-weight: 700; }
.userspage .utable th .thbtn:hover, .dtbox .dt th .thbtn:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.userspage .utable th .thbtn .ic, .dtbox .dt th .thbtn .ic { color: rgba(255, 255, 255, .85); }
.userspage .utable th[aria-sort="ascending"] .thbtn .ic, .userspage .utable th[aria-sort="descending"] .thbtn .ic,
.dtbox .dt th[aria-sort="ascending"] .thbtn .ic, .dtbox .dt th[aria-sort="descending"] .thbtn .ic { color: #fff; background: rgba(255, 255, 255, .22); border-radius: 4px; }
.userspage .utable .thf, .dtbox .thf { border: 0 !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.userspage .matrix th:first-child { color: #fff; }
.userspage .matrix .rolepill { box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }

/* row actions as real buttons: icon-only in the table, icon + label on phone cards */
.abtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 36px; min-height: 36px; padding: 0 9px; border: 1px solid; border-radius: 9px; font: 700 .82rem var(--f-body); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s, transform .1s; }
.abtn:active { transform: translateY(1px); }
.abtn .ic { color: inherit; flex: none; }
.abtn.edit { background: var(--accent-soft); border-color: #B5CBF7; color: var(--accent); }
.abtn.edit:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.abtn.pw { background: #FFF3D6; border-color: #F2D48B; color: #8A5200; }
.abtn.pw:hover { background: #E8A317; border-color: #E8A317; color: #fff; }
.abtn.stop { background: var(--bad-soft); border-color: #F1B9B4; color: var(--bad); }
.abtn.stop:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.abtn.go { background: var(--ok-soft); border-color: #A9DCC1; color: var(--ok); }
.abtn.go:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.utable .rowacts { display: flex; flex-wrap: nowrap; gap: 6px; }
.utable .abl { display: none; }
.utable .actcell { min-width: 0; white-space: nowrap; }
@media (max-width: 760px) {
  .utable .rowacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .utable .abtn { padding: 0 6px; font-size: .8rem; line-height: 1.25; min-height: 40px; }
  .utable .abl { display: inline; }
}

.cust { margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; background: #FFF3D6; color: #8A5200; font-size: .7rem; font-weight: 700; vertical-align: middle; }
.optrow .btn.sm { align-self: center; }

/* ---------- review fixes: touch, sticky bar, skip link, dashboard groups ---------- */
html { scroll-padding-top: 140px; }
button, a, summary, select, label, input[type="checkbox"], input[type="radio"], [role="tab"], [tabindex="0"] { touch-action: manipulation; }
body { -webkit-tap-highlight-color: rgba(47, 111, 235, .18); }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; transition: top .15s; }
.skip:focus { top: 8px; }
#main:focus { outline: none; }
.kgroup { display: flex; align-items: center; gap: 10px; font-size: 1rem; color: var(--ink); margin-top: 6px; }
.kgroup::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .btn, .abtn, .skip, .linkbtn, .seg button, .fchip { transition: none !important; } }

/* a record this account has not opened yet: light red */
.dtbox .dt tbody tr.fresh td, .dtbox .dt tbody tr.fresh:nth-child(even) td { background: #FFF1EF; }
.dtbox .dt tbody tr.fresh:hover td { background: #FFE2DE; }
.dtbox .dt tbody tr.fresh td:first-child { box-shadow: inset -4px 0 0 var(--c-bad); }
@media (max-width: 760px) { .dtbox .dt tbody tr.fresh { background: #FFF1EF; border-color: #F2B8B2; box-shadow: inset -4px 0 0 var(--c-bad); } .dtbox .dt tbody tr.fresh td:first-child { box-shadow: none; } }

/* header filters keep their whole text; the table scrolls sideways instead of squeezing them */
.dtbox .dt th { min-width: 0; }
.dtbox .dt th .thf { min-width: 100%; width: 1px; text-overflow: ellipsis; }

.dtbox .dt td .mono { white-space: nowrap; }
.utable th { min-width: 108px; }
.utable th .thf { min-width: 92px; }
@media (max-width: 760px) { .dtbox .dt th, .dtbox .dt th:first-child, .utable th { min-width: 0; } }

/* statement direction: two readable choices instead of a clipped select */
.persp { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.persp legend { padding: 0; margin-bottom: 6px; font-size: .84rem; font-weight: 600; color: var(--ink); }
.radiocard { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid #B7C9E8; border-radius: 10px; background: #fff; font-size: .88rem; line-height: 1.55; cursor: pointer; transition: background-color .15s, border-color .15s; }
.radiocard input { flex: none; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.radiocard.on { background: var(--accent-soft); border-color: var(--accent); color: #17306B; font-weight: 600; }
.radiocard:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }

/* support supervisor role colour + the assignment control on the request path */
.rolepill.supervisor { background: #DDF3F8; color: #0B6B82; }
.uav.supervisor, .uchip .av.supervisor { background: #DDF3F8; color: #0B6B82; }
.step .act { display: flex; flex-wrap: wrap; gap: 8px; }
.assign { flex: 1 1 100%; width: 100%; display: grid; gap: 12px; margin-top: 6px; padding: 14px; border: 1px solid #B7C9E8; border-inline-start: 4px solid var(--accent); border-radius: 12px; background: #F4F8FF; }
.assign-head { display: flex; align-items: flex-start; gap: 10px; }
.assign-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: #fff; }
.assign-head label { display: block; font-size: .92rem; font-weight: 700; color: var(--ink); }
.assign-head .hint { display: block; margin-top: 1px; line-height: 1.5; }
.assign-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.assign-row select { background: #fff; border: 1px solid #B7C9E8; min-height: 46px; }
.assign-row .btn { min-height: 46px; width: 100%; padding-inline: 14px; white-space: normal; line-height: 1.35; }
.assign-row .btn:disabled { background: #D5DDEC; color: #5A6680; box-shadow: none; opacity: 1; cursor: not-allowed; }

/* assignment panel: compact */
.assign { flex: 0 1 auto; width: 100%; max-width: 330px; gap: 8px; margin-top: 4px; padding: 10px 12px; border-radius: 10px; border-inline-start-width: 3px; }
.assign-head { gap: 8px; align-items: center; }
.assign-ic { width: 26px; height: 26px; border-radius: 8px; }
.assign-ic .ic { width: 15px; height: 15px; }
.assign-head label { font-size: .86rem; }
.assign-head .hint { display: none; }
.assign-row { gap: 6px; }
.assign-row select { min-height: 38px; padding-block: 5px; font-size: .88rem; }
.assign-row .btn { min-height: 38px; padding: 4px 12px; font-size: .86rem; gap: 6px; }

/* new request: from / to dates side by side */
.daterange { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.daterange label { display: block; margin-bottom: 4px; font-size: .84rem; font-weight: 700; }
.daterange input { width: 100%; }
@media (max-width: 420px) { .daterange { grid-template-columns: 1fr; } }

/* reconciliation result as a diagnosis */
.rcd { display: grid; gap: 16px; }
.rcd-sum, .rcd-bridge { border: 1px solid var(--line); border-radius: var(--r-md, 14px); background: var(--surface); padding: 16px; box-shadow: var(--shadow); }
.rcd-sum { border-top: 3px solid var(--c-bad); display: grid; gap: 14px; }
.rcd-sumhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rcd-sumhead h3 { margin: 0; }
.rcd-verdict { font-size: .82rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.rcd-verdict.ok { background: var(--ok-soft); color: var(--ok); }
.rcd-verdict.warn { background: var(--warn-soft); color: var(--warn); }
.rcd-verdict.bad { background: var(--bad-soft); color: var(--bad); }
.rcd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rcd-grid > div { display: grid; gap: 2px; min-width: 0; }
.rcd-grid span { color: var(--ink-3); font-size: .78rem; }
.rcd-grid strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.rcd-grid .big.off { color: #9A6200; }
.rcd-why { margin: 0; line-height: 1.9; font-size: .92rem; }
.rcd-todo ol { margin: 6px 0 4px; padding-inline-start: 22px; display: grid; gap: 4px; font-size: .9rem; line-height: 1.7; }
.rcd-bridge { padding: 0; overflow: hidden; }
.rcd-brow { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.rcd-brow.main { background: var(--surface-2); font-weight: 600; }
.rcd-brow.total { border-top: 2px solid var(--ink); font-weight: 700; }
.rcd-n { margin-inline-start: 8px; color: var(--ink-3); font-size: .78rem; }
.rcd-unexp { display: grid; gap: 4px; padding: 14px 16px; }
.rcd-unexp .big { font-size: 1.8rem; font-weight: 800; color: var(--ok); }
.rcd-unexp.off .big { color: var(--bad); }
.rcd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.rcd-kpi { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rcd-kpi strong { font-size: 1.5rem; }
.rcd-kpi span { color: var(--ink-3); font-size: .8rem; }
.rcd-kpi.warn strong { color: #9A6200; }
.rcd-list { display: grid; gap: 10px; }
.rcd-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.rcd-card { border: 1px solid var(--line); border-inline-start: 4px solid #D9A441; border-radius: 12px; background: var(--surface); padding: 12px 14px; display: grid; gap: 4px; }
.rcd-card.blue { border-inline-start-color: var(--c-work); }
.rcd-card.red { border-inline-start-color: var(--c-bad); }
.rcd-card p { margin: 0; font-size: .88rem; line-height: 1.7; }
.rcd-chead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rcd-chead h4 { margin: 0; font-size: 1rem; }
.rcd-amt { font-weight: 800; font-size: 1.05rem; }
.rcd-meta { color: var(--ink-3); font-size: .78rem; overflow-wrap: anywhere; }
.rcd-more { justify-self: center; }
@media (max-width: 720px) { .rcd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.rcd .mono { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* each figure sits right under its title (the isolated number must not drift to the far side) */
.rcd-grid > div { align-content: start; justify-items: start; text-align: start; }
.rcd-grid strong { justify-self: start; }

/* figures inside the sentences: red, left-to-right, never split from their sign */
.rcd .rcd-num { color: var(--bad); font-weight: 700; white-space: nowrap; margin-inline: 3px; }

/* the official letter */
.rcl { display: grid; gap: 14px; }
.rcl-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; max-width: 900px; width: 100%; justify-self: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rcl-f { display: grid; gap: 4px; min-width: 0; }
.rcl-f:first-child, .rcl-f.wide { grid-column: 1 / -1; }
.rcl-f label { font-size: .82rem; font-weight: 700; }
.rcl-acts { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rcl-chk { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; }
.rcl-doc { line-height: 1.9; font-size: .95rem; }
.rcl-doc p { margin: 0; }
.rcl-to p { margin: 0; font-size: 1.02rem; }
.rcl-subject { font-size: 1.02rem; }
.rcl-group { display: grid; gap: 6px; }
.rcl-group h4 { margin: 4px 0 0; font-size: .95rem; }
.rcl-note { padding: 8px 12px; border-inline-start: 3px solid var(--ink-3); background: var(--surface-2); }
.rcl-ack { margin-top: 10px; padding: 14px; border: 1.5px dashed var(--ink-2); border-radius: 6px; display: grid; gap: 10px; break-inside: avoid; }
.rcl-ack h4 { margin: 0; }
.rcl-blank { display: inline-block; min-width: 140px; border-bottom: 1px solid var(--ink); }
.rcl-annex { break-before: page; display: grid; gap: 8px; }
@media (max-width: 720px) { .rcl-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { .rcl-form { display: none !important; } .rcl-doc { font-size: 12pt; } .rcl-group, .rc-sign { break-inside: avoid; } }

/* ---------- supplier notices: the form and the printed simple tax invoice ---------- */
.nt-grid2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nt-items-ed { display: grid; gap: 8px; margin-block: 8px; }
.nt-itrow { display: grid; grid-template-columns: 90px minmax(160px, 1fr) 80px 100px 90px 100px 40px; gap: 6px; align-items: center; }
.nt-itrow input { width: 100%; min-width: 0; }
.nt-lt { text-align: end; font-weight: 700; }
.nt-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin-block: 8px; }
.nt-sum div { display: grid; gap: 2px; }
.nt-sum span { color: var(--ink-3); font-size: .78rem; }
.nt-sum .tot strong { color: var(--accent); font-size: 1.2rem; }
@media (max-width: 760px) { .nt-grid2 { grid-template-columns: 1fr; } .nt-itrow { grid-template-columns: 1fr 1fr; } .nt-itrow .wide { grid-column: 1 / -1; } .nt-sum { grid-template-columns: 1fr 1fr; } }

.nt-sheet { background: #fff; color: #000; border: 1px solid #000; padding: 18px 20px; max-width: 900px; width: 100%; margin-inline: auto; display: grid; gap: 10px; font-family: Arial, 'IBM Plex Sans Arabic', Tahoma, sans-serif; font-size: 12.5px; line-height: 1.5; }
.nt-top { display: grid; grid-template-columns: 1.25fr 1fr 150px; gap: 14px; align-items: start; }
.nt-co { display: grid; gap: 2px; margin-bottom: 8px; }
.nt-co strong { font-size: 14px; }
.nt-meta > div:not(.nt-co) { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; }
.nt-k { font-weight: 700; font-size: 13px; white-space: nowrap; }
.nt-no { color: #8B0000; font-size: 15px; }
.nt-pm { background: #DFF7FA; padding: 1px 8px; }
.nt-mid { display: grid; gap: 10px; justify-items: center; align-content: end; padding-top: 40px; }
.nt-title { display: grid; justify-items: center; gap: 4px; background: #DFF7FA; padding: 8px 18px; width: 100%; text-align: center; font-size: 16px; }
.nt-page { display: flex; gap: 8px; font-weight: 700; color: #1F2A8A; }
.nt-qr svg { width: 150px; height: 150px; display: block; }
.nt-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nt-box { border: 2.5px solid #555; display: grid; align-content: start; }
.nt-bh { display: flex; justify-content: space-between; background: #E4E4E4; padding: 3px 8px; font-weight: 700; }
.nt-row { display: grid; grid-template-columns: 34% 1fr 22%; align-items: center; min-height: 22px; font-size: 12px; }
.nt-a { background: #E4E4E4; padding: 1px 8px; font-weight: 700; height: 100%; display: flex; align-items: center; }
.nt-l { background: #E4E4E4; padding: 1px 8px; font-weight: 700; direction: ltr; height: 100%; display: flex; align-items: center; }
.nt-v { text-align: center; padding: 1px 6px; overflow-wrap: anywhere; }
.nt-desc { display: grid; grid-template-columns: 140px 1fr; background: #E4E4E4; padding: 4px 10px; gap: 10px; min-height: 30px; }
.nt-dk { font-weight: 700; }
.nt-items { width: 100%; border-collapse: collapse; border: 1.5px solid #000; table-layout: fixed; font-size: 12px; min-width: 0; }
.nt-items th { background: #E4E4E4; border: 1px solid #000; padding: 4px; text-align: center; font-weight: 700; }
.nt-items td { border-inline: 1px solid #000; padding: 3px 6px; vertical-align: top; }
.nt-items td.num { text-align: center; direction: ltr; }
.nt-items th:nth-child(6), .nt-items td:nth-child(6) { width: 34%; text-align: start; }
.nt-words { display: grid; grid-template-columns: 1fr 70px 190px; gap: 8px; align-items: center; border: 1px dotted #555; padding: 6px 10px; }
.nt-ar { font-size: 13px; }
.nt-sar { text-align: center; border: 1px solid #000; font-weight: 700; padding: 1px 0; }
.nt-amt { border: 1.5px solid #000; text-align: center; font-weight: 700; font-size: 15px; color: #8B0000; padding: 3px 0; direction: ltr; order: 3; }
.nt-tot { display: grid; grid-template-columns: 1fr 160px; gap: 14px; align-items: end; border-top: 1.5px solid #000; padding-top: 8px; }
.nt-qty { display: grid; gap: 6px; justify-items: center; font-weight: 700; }
.nt-ln { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; font-weight: 600; }
.nt-ln strong { color: #8B0000; direction: ltr; }
.nt-ln.last { background: #E4E4E4; padding: 3px 8px; }
@media screen and (max-width: 760px) { .nt-sheet { font-size: 11px; padding: 10px; } .nt-top { grid-template-columns: 1fr; } .nt-mid { padding-top: 0; } .nt-parties { grid-template-columns: 1fr; } .nt-words { grid-template-columns: 1fr; } .nt-tot { grid-template-columns: 1fr; } }
@media print { .nt-sheet { border: 1px solid #000; padding: 8mm; max-width: none; font-size: 11pt; } .nt-top { grid-template-columns: 1.25fr 1fr 150px !important; } .nt-parties { grid-template-columns: 1fr 1fr !important; } .nt-items th, .nt-ln.last, .nt-bh, .nt-a, .nt-l, .nt-desc, .nt-title, .nt-pm { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

.nt-page { direction: ltr; }
.nt-meta strong { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.nt-row { grid-template-columns: 29% 1fr 24%; font-size: 11px; }
.nt-a, .nt-l { white-space: nowrap; }
.nt-words { grid-template-columns: 1fr 70px 170px; }
.nt-amt { order: 0; }
@media print {
  .nt-sheet { gap: 6px; padding: 6mm; font-size: 10.5pt; }
  .nt-row { min-height: 18px; font-size: 9.5pt; }
  .nt-mid { padding-top: 20px; }
  .nt-qr svg { width: 120px; height: 120px; }
  .nt-top { grid-template-columns: 1.3fr 1fr 120px !important; }
}

/* editing a notice in place */
.nt-in { width: 100%; min-width: 0; padding: 3px 6px; border: 1px dashed #4B7BEC; border-radius: 4px; background: #F4F8FF; color: #000; font: inherit; text-align: center; }
textarea.nt-in { text-align: start; resize: vertical; }
.nt-items .nt-in.num { direction: ltr; }
.nt-sub { display: block; margin-top: 2px; font-size: .72rem; color: #444; direction: rtl; }
.nt-xcol { width: 36px; border: 0 !important; background: transparent !important; }
.nt-add { justify-self: start; }
.nt-sheet.editing .nt-row { min-height: 28px; }
.nt-meta .nt-in { width: auto; max-width: 180px; }
@media print { .nt-xcol { display: none; } }

/* the new-notice form: every line is a small card with labelled fields, and it never overflows the page */
.nt-form { min-width: 0; }
.nt-form input[type="date"] { direction: ltr; text-align: start; }
.nt-itrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); align-items: end; }
.nt-itrow .nt-c { display: grid; gap: 3px; min-width: 0; font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.nt-itrow .nt-c.wide { grid-column: span 2; }
.nt-itrow .nt-c input { width: 100%; min-width: 0; }
.nt-itrow .nt-tl strong { font-size: 1rem; color: var(--ink); padding-block: 8px; }
.nt-itrow .nt-rm { justify-self: start; }
@media (max-width: 520px) { .nt-itrow .nt-c.wide { grid-column: 1 / -1; } .nt-sum { grid-template-columns: 1fr 1fr; } }

/* supplier details card (users form, notice form): name, code, tax number, mobile */
.sinfo { background: var(--icon-soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 12px; }
.sinfo dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; }
.sinfo-row { display: grid; gap: 1px; min-width: 0; }
.sinfo dt { color: var(--ink-3); font-size: .76rem; }
.sinfo dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.uform .sinfo.wide { grid-column: 1 / -1; }

.rc-grid td.desc { white-space: normal; min-width: 260px; max-width: 380px; line-height: 1.6; font-size: .78rem; }
.rc-grid td.desc .sub { color: var(--ink-3); }
