@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --primary: #1010d2;
  --primary-dark: #09099f;
  --secondary: #d6dfe6;
  --surface: #ffffff;
  --background: #f3f6f8;
  --text: #151829;
  --muted: #5a6572;
  --border: #d6dfe6;
  --success: #087a51;
  --warning: #9a5b00;
  --danger: #b42318;
  --focus: #2f7cff;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(21, 24, 41, .07);
}
* { box-sizing: border-box; }
html { font-size: 16px; background: var(--background); }
body { margin: 0; color: var(--text); background: var(--background); font-family: "Yekan", "IRANYekan", "Yekan Bakh", "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif; line-height: 1.65; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a, summary, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link { position: fixed; z-index: 100; inset-inline-start: 12px; top: -60px; background: #fff; color: var(--primary); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.sidebar { min-height: 100vh; background: #11122a; color: #fff; padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; background: var(--primary); color: #fff; border-radius: 12px; font: 700 14px/1 "Vazirmatn", sans-serif; letter-spacing: .04em; }
.brand strong, .brand small, td strong, td small, .user-chip strong, .user-chip small { display: block; }
.brand small, .user-chip small { color: #aeb7ca; font-size: .76rem; }
.nav-list { display: grid; gap: 4px; margin-top: 32px; }
.nav-link { color: #dce1ed; text-decoration: none; padding: 11px 12px; border-radius: 9px; transition: background-color .18s ease, color .18s ease; }
.nav-link:hover { background: #202249; color: #fff; }
.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); }
.user-chip { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #d6dfe6; color: #11122a; font-weight: 800; }
.main-content { min-width: 0; padding: 28px clamp(16px, 3vw, 44px) 48px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-header h1 { font-size: clamp(1.55rem, 2.5vw, 2.2rem); margin: 1px 0 4px; letter-spacing: -.025em; }
.page-header p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--primary) !important; font-size: .76rem; font-weight: 800; letter-spacing: .035em; margin: 0 0 3px !important; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 1.08rem; }
.panel p { color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; font: 750 clamp(1.8rem, 4vw, 2.65rem)/1.2 "Vazirmatn", sans-serif; color: var(--primary); margin: 7px 0 2px; }
.metric small { font-size: .75rem; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.compact-list { display: grid; }
.compact-row { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--border); text-decoration: none; }
.compact-row:first-child { border-top: 0; }
.compact-row small { display: block; color: var(--muted); font-size: .76rem; }
.grow { flex: 1; min-width: 0; }
.numeric { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #8994a3; flex: none; }
.status-approved { background: var(--success); }.status-new { background: var(--primary); }.status-rejected { background: var(--danger); }.status-reviewing { background: var(--warning); }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; text-decoration: none; transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease; }
.button-primary { background: var(--primary); color: #fff; }.button-primary:hover { background: var(--primary-dark); }
.button-secondary { background: #fff; color: var(--primary); border-color: var(--primary); }.button-secondary:hover { background: #f1f1ff; }
.button-quiet { background: transparent; color: inherit; border-color: var(--border); }.sidebar .button-quiet { color: #fff; border-color: #434663; }.button-quiet:hover { background: rgba(16,16,210,.07); }
.button-block { width: 100%; }.button-small { min-height: 36px; padding: 6px 10px; font-size: .82rem; }
.text-link { color: var(--primary); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }
label { display: grid; gap: 5px; font-size: .85rem; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; min-height: 44px; color: var(--text); background: #fff; border: 1px solid #aab6c1; border-radius: 8px; padding: 9px 11px; transition: border-color .18s ease, box-shadow .18s ease; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16,16,210,.12); outline: none; }
.required { color: var(--danger); }.form-stack { display: grid; gap: 14px; }.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.full { grid-column: 1 / -1; }.form-actions { display: flex; justify-content: flex-start; }.compact-form { margin-top: 14px; }
.check { display: flex; grid: none; align-items: center; gap: 8px; font-weight: 500; }.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px; } legend { font-weight: 800; padding: 0 7px; }.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 14px; }
.filter-panel { margin-bottom: 12px; }.filter-grid { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(140px, 1fr)) auto; gap: 10px; align-items: end; }
.upload-panel { margin: 0 0 14px; }.upload-panel summary, details > summary { font-weight: 800; padding: 3px; }.upload-grid { display: grid; grid-template-columns: 1fr 2fr auto; gap: 12px; align-items: end; margin-top: 14px; }
.receipt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.receipt-card { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.receipt-image { display: block; aspect-ratio: 16/10; background: var(--secondary); overflow: hidden; }.receipt-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }.receipt-image:hover img { transform: scale(1.02); }
.receipt-body { padding: 14px; }.receipt-body h2 { font-size: 1rem; margin: 8px 0 4px; }.receipt-body h2 a { text-decoration: none; }.receipt-body > p { color: var(--muted); min-height: 48px; margin: 4px 0 10px; font-size: .83rem; }
.receipt-meta { display: flex; flex-wrap: wrap; gap: 5px; }.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: #edf0f3; color: #4b5662; }.badge-approved, .badge-completed { background: #e1f5ed; color: #05603f; }.badge-new, .badge-processing { background: #e7e7ff; color: #09099f; }.badge-rejected, .badge-failed { background: #fee9e7; color: #912018; }.badge-reviewing, .badge-retry, .badge-needs_information { background: #fff1d6; color: #7a4600; }.badge-neutral, .badge-pending { background: #edf0f3; color: #4b5662; }
.mini-details { display: grid; gap: 7px; margin: 0; }.mini-details div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 6px; }.mini-details dt { color: var(--muted); font-size: .72rem; }.mini-details dd { margin: 0; font-size: .75rem; font-weight: 700; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.detail-grid { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr); gap: 18px; align-items: start; margin-bottom: 18px; }.image-panel { padding: 10px; position: sticky; top: 18px; }.image-panel img { display: block; width: 100%; max-height: 78vh; object-fit: contain; border-radius: 8px; background: #eef2f5; }.detail-column { min-width: 0; }.detail-list { margin: 0; }.detail-list div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; border-top: 1px solid var(--border); padding: 9px 0; }.detail-list div:first-child { border-top: 0; }.detail-list dt { color: var(--muted); }.detail-list dd { margin: 0; font-weight: 700; }.preserve-lines { white-space: pre-wrap; }.ocr-text { direction: rtl; text-align: right; white-space: pre-wrap; overflow-wrap: anywhere; font-family: "Yekan", "IRANYekan", "Yekan Bakh", "Vazirmatn", Tahoma, sans-serif; background: #f6f8fa; padding: 14px; border-radius: 8px; border: 1px solid var(--border); max-height: 430px; overflow: auto; }
.narrow-panel { max-width: 820px; }.table-panel { padding: 0; overflow: hidden; }.table-wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; min-width: 760px; } th, td { text-align: right; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; } th { color: var(--muted); background: #f7f9fa; font-size: .76rem; } td { font-size: .83rem; }.inline-form { display: flex; align-items: center; gap: 7px; }.inline-form select { width: auto; min-width: 150px; min-height: 36px; }
.role-grid, .model-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 14px; }.role-grid .panel, .model-grid .panel { margin-top: 0; }.model-category { display: inline-block; color: var(--primary); font: 700 .7rem/1 "Vazirmatn", sans-serif; text-transform: uppercase; margin-bottom: 7px; }.model-card code { display: block; background: #f1f3f6; padding: 8px; border-radius: 7px; overflow-wrap: anywhere; }.model-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.alert { padding: 11px 13px; border-radius: 8px; margin-bottom: 13px; border: 1px solid; }.alert-error { background: #fff1ef; color: #7d1d15; border-color: #f2b8b2; }.alert-info { background: #eeeeff; color: #09099f; border-color: #b8b8f4; }
.empty-state { color: var(--muted); padding: 24px; text-align: center; }.error-panel { max-width: 650px; margin: 10vh auto 0; text-align: center; }.error-panel .button { margin-top: 8px; }.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 85% 10%, rgba(16,16,210,.17), transparent 30%), #f3f6f8; }.auth-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: clamp(22px, 5vw, 36px); box-shadow: 0 20px 55px rgba(21,24,41,.12); }.brand-auth { color: var(--text); margin-bottom: 30px; }.brand-auth small { color: var(--muted); }.auth-copy h1 { font-size: 1.55rem; margin: 4px 0; }.auth-copy > p:last-child { color: var(--muted); margin-top: 4px; }
@media (max-width: 1100px) { .metric-grid { grid-template-columns: repeat(2, 1fr); }.receipt-grid { grid-template-columns: repeat(2, 1fr); }.filter-grid { grid-template-columns: repeat(2, 1fr); }.filter-grid .wide { grid-column: 1/-1; }.filter-grid .button { align-self: end; }.detail-grid { grid-template-columns: 1fr; }.image-panel { position: static; }.dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .app-shell { display: block; }.sidebar { position: static; width: 100%; height: auto; min-height: 0; padding: 14px; }.nav-list { display: flex; overflow-x: auto; margin-top: 14px; padding-bottom: 5px; }.nav-link { white-space: nowrap; }.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 10px; }.sidebar-footer form { width: auto; }.user-chip { margin: 0; }.main-content { padding: 20px 14px 36px; }.page-header { align-items: stretch; flex-direction: column; }.page-header > .button { align-self: flex-start; }.receipt-grid, .role-grid, .model-grid, .form-grid, .permission-grid, .upload-grid { grid-template-columns: 1fr; }.full { grid-column: auto; }.filter-grid { grid-template-columns: 1fr; }.filter-grid .wide { grid-column: auto; }.detail-list div { grid-template-columns: 1fr; gap: 2px; }.inline-form { flex-wrap: wrap; }.upload-grid .button { width: 100%; } }
@media (max-width: 440px) { .metric-grid, .receipt-grid { grid-template-columns: 1fr; }.metric strong { font-size: 2rem; }.brand strong { font-size: .9rem; }.sidebar .brand { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ================= Bank reconciliation (spreadsheet compare) ================= */
.recon-summary{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:10px 0 6px}
.recon-chip{background:#f1f5f9;border-radius:999px;padding:6px 14px;font-size:.85rem;color:#334155}
.recon-chip b{color:#0f172a;margin-inline-start:4px}
.recon-chip.ok{background:rgba(16,185,129,.15)}
.recon-chip.fee{background:rgba(245,158,11,.18)}
.recon-chip.miss{background:rgba(239,68,68,.15)}
.recon-chip.toggle{cursor:pointer;background:#e2e8f0;display:inline-flex;gap:6px;align-items:center}
.recon-chip.toggle select{border:0;background:transparent;font:inherit;color:inherit;cursor:pointer}
.recon-sec-title{margin:18px 0 6px;font-size:1.05rem}

.xls-scroll{overflow:auto;max-height:74vh;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow)}
table.xls{border-collapse:separate;border-spacing:0;width:100%;font-size:.92rem;font-variant-numeric:tabular-nums;background:#fff}
table.xls th,table.xls td{border-bottom:1px solid #c3ccd9;border-inline-start:1px solid #ccd3de;padding:8px 12px;text-align:right;white-space:nowrap}
table.xls thead th{position:sticky;z-index:2}
.xls-sheet-head th{top:0;font-size:.86rem;font-weight:800;padding:10px;text-align:center;letter-spacing:.01em}
.xls-sheet-head .sheet.bank{background:#1e3a8a;color:#fff}
.xls-sheet-head .sheet.wh{background:#14532d;color:#fff}
.xls-sheet-head .sheet-gap{background:#e2e8f0;width:78px}
.xls-sheet-head .sheet-note{background:#e2e8f0;color:#334155}
.xls-col-head th{top:38px;background:#f1f5f9;color:#334155;font-size:.78rem;font-weight:700;border-bottom:2px solid #94a3b8}
.c-idx{width:38px;text-align:center;color:#94a3b8;font-size:.76rem;font-weight:700}
.num{font-family:ui-monospace,'SF Mono',Consolas,monospace;font-weight:800;font-size:1.06rem;direction:ltr;text-align:left;letter-spacing:-.01em}
td.bankamt{color:#1e3a8a}
td.whamt{color:#14532d}
td.c-date,td.c-ref{color:#3f4b5c;font-size:.82rem;direction:ltr;text-align:left}
td.c-date{font-weight:600}
.blank{color:var(--danger);font-style:italic;font-weight:700;text-align:center;background:rgba(180,35,24,.07)!important}
td.c-mid{text-align:center;padding-inline:6px}
.pill{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:24px;padding:0 9px;border-radius:7px;font-weight:800;font-size:.78rem;color:#fff;box-shadow:0 1px 2px rgba(16,24,40,.2)}
.pill.ok{background:#0e9f6e}
.pill.fee{background:#d97706;font-family:ui-monospace,monospace}
.pill.warn{background:#d97706}
.pill.miss{background:#dc2626}
.pill.pending{background:#6366f1}
.pill.manual{background:#2f7cff}

/* Row identity = a state colour (what happened) composited with a zebra band
   (which row you're on), layered as background-image over background-color so
   neither erases the other — a long run of same-state rows still alternates
   instead of reading as one undifferentiated block. This used to be done with
   `filter:brightness` on the row, which also darkens the row's own borders
   (filter rasterises the whole element, gridlines included) enough to make
   them disappear on every other row; a background layer never touches
   borders, so the grid stays crisp everywhere. */
tbody tr{background-color:#fff}
tbody tr:nth-child(even){background-image:linear-gradient(rgba(15,23,42,.09),rgba(15,23,42,.09))}
tr.row-ok{background-color:rgba(14,159,110,.12)}
tr.row-fee{background-color:rgba(217,119,6,.13)}
tr.row-warn{background-color:rgba(217,119,6,.13)}
tr.row-manual{background-color:rgba(47,124,255,.12)}
tr.row-pending{background-color:rgba(99,102,241,.13)}
tr.row-miss{background-color:rgba(220,38,38,.09)}
table.xls tbody tr:hover{outline:2px solid rgba(47,124,255,.45);outline-offset:-2px}

/* a colour-coded gutter on the row's leading cell names the state at a glance,
   independent of direction (RTL/LTR) via logical border-inline-start */
tr.row-ok>td:first-child{border-inline-start:4px solid #0e9f6e}
tr.row-fee>td:first-child{border-inline-start:4px solid #d97706}
tr.row-warn>td:first-child{border-inline-start:4px solid #d97706}
tr.row-manual>td:first-child{border-inline-start:4px solid #2f7cff}
tr.row-pending>td:first-child{border-inline-start:4px solid #6366f1}
tr.row-miss>td:first-child{border-inline-start:4px solid #dc2626}

tr.is-resolved{opacity:.62}
tr.is-resolved .num{text-decoration:line-through}
/* Already reviewed via a checkpoint: recede visually so open work stands out */
tr.is-checked{filter:none!important;background-color:#dcfce7!important;background-image:none!important}
tr.is-checked>td{border-color:#a7d8b5}
tr.is-checkpoint{outline:2px solid var(--success);outline-offset:-2px}

.xls-total td{background:#eef2f7;font-weight:800;border-top:2px solid #94a3b8;position:sticky;bottom:0;z-index:1}
.xls-note{display:flex;gap:5px;align-items:center;flex-wrap:wrap}
.xls-note input[type=text]{width:150px;padding:4px 8px;border:1px solid #cbd5e1;border-radius:6px;font-size:.82rem;font-family:inherit}
.recon-wrap:has(.only-miss:checked) tbody tr.is-matched{display:none}
.recon-sec-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:20px 0 8px;padding-inline-start:12px;border-inline-start:4px solid var(--border)}
.recon-sec-title.sec-deposit{border-inline-start-color:#0e9f6e}
.recon-sec-title.sec-withdraw{border-inline-start-color:#dc2626}
.bulk-save{display:inline-flex;gap:8px;align-items:center;margin:0}
@media (max-width:900px){table.xls{font-size:.82rem}.xls-note input[type=text]{width:90px}.num{font-size:.92rem}}

/* ---- banners: expected-not-yet (pending) and set-aside (returned cheques) ---- */
.recon-banner{border-radius:var(--radius);padding:12px 16px;margin:10px 0;font-size:.88rem;line-height:1.9}
.recon-banner.pending{background:rgba(99,102,241,.10);border-inline-start:4px solid #6366f1;color:#312e81}
.recon-banner.returned{background:rgba(100,116,139,.10);border-inline-start:4px solid #64748b;color:#334155}
.recon-banner.stale{background:rgba(245,158,11,.10);border-inline-start:4px solid #f59e0b;color:#7a4600}
.recon-banner.stale tr.is-checked{background:rgba(16,185,129,.10)}
/* Simple view keeps only still-open late documents — flag the section and each
   open row red, because there they are unresolved discrepancies. */
.recon-banner.stale.stale-open{background:rgba(220,38,38,.09);border-inline-start-color:#dc2626;color:#7f1d1d}
.recon-banner.stale tr.stale-row-open>td:first-child{box-shadow:inset 3px 0 0 #dc2626}
/* «make whole day green» — offered on a day whose two balances already agree. */
.day-green-form{display:inline-flex;margin:0}
.day-green-form .button{padding:3px 10px;font-size:.72rem}
/* simple-view top action row: save-all + refresh-from-mirror. */
.simple-top-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 8px}
.simple-top-actions .bulk-save,.simple-top-actions .refresh-form{margin:0}
.refresh-hint{font-size:.76rem;color:var(--muted)}
/* «show related transactions» chip in the simple table's status cell. */
.group-trigger{display:inline-flex;align-items:center;gap:3px;margin-inline-start:6px;
  padding:2px 8px;font-size:.72rem;font-weight:700;color:#1e3a8a;background:#eef4ff;
  border:1px solid #c7dbff;border-radius:20px;cursor:pointer}
.group-trigger:hover{background:#dbe8ff}
.group-dialog .dialog-table-scroll{overflow-x:auto;max-height:60vh;overflow-y:auto}
/* POS terminal → branch section: inline Shamsi date pickers and reassign forms. */
.pos-date{display:flex;gap:6px}
.pos-date select{min-width:68px}
.xls-scroll{overflow-x:auto}
.recon-banner.warn{background:rgba(220,38,38,.10);border-inline-start:4px solid #dc2626;color:#7f1d1d;font-weight:600}
.recon-banner.warn .upload-warning-list,.recon-banner.pending .upload-warning-list{margin:6px 0;padding-inline-start:20px;font-weight:400}
.recon-banner.warn .upload-warning-list li,.recon-banner.pending .upload-warning-list li{margin-bottom:4px}
.recon-banner details{margin-top:6px}
.rc-pending{margin:0;font-size:.8rem;color:#4338ca;background:rgba(99,102,241,.10);border-radius:8px;padding:8px 10px;line-height:1.8}

/* ---- reconciliation overview cards ---- */
.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:6px}
.recon-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}
.recon-card{display:flex;flex-direction:column;gap:12px;background:var(--surface);border:1px solid var(--border);border-inline-start:5px solid var(--success);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow);text-decoration:none;color:var(--text);transition:transform .15s ease,box-shadow .15s ease}
.recon-card:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(21,24,41,.12)}
.recon-card.has-miss{border-inline-start-color:var(--danger)}
.recon-card-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.recon-card-head h2{margin:0;font-size:1.05rem}
.recon-status{font-size:.72rem;font-weight:800;padding:3px 10px;border-radius:999px;white-space:nowrap}
.recon-status.ok{background:#e1f5ed;color:#05603f}
.recon-status.miss{background:#fee9e7;color:#912018}
.recon-card-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;text-align:center}
.rc-stat{background:#f1f5f9;border-radius:9px;padding:8px 4px;display:flex;flex-direction:column;gap:2px}
.rc-stat b{font-size:1.3rem;font-variant-numeric:tabular-nums}
.rc-stat span{font-size:.72rem;color:var(--muted)}
.rc-stat.ok{background:rgba(16,185,129,.14)}
.rc-stat.fee{background:rgba(245,158,11,.16)}
.rc-stat.miss{background:rgba(239,68,68,.13)}
.recon-card-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:.8rem;color:var(--muted);border-top:1px solid var(--border);padding-top:10px;margin-top:auto}
.rc-open{font-weight:700;color:var(--primary);white-space:nowrap}
.shamsi-picker{display:grid;grid-template-columns:1.2fr 1.4fr 1fr;gap:8px}
.shamsi-picker select{width:100%}
.muted-note{color:var(--muted);font-size:.82rem;margin:4px 0 0}
/* ---- Shamsi calendar ---- */
.cal-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.cal-title{margin:0;font-size:1.15rem}
table.cal{border-collapse:separate;border-spacing:6px;width:100%;table-layout:fixed}
table.cal th{color:var(--muted);font-size:.8rem;font-weight:700;padding:4px}
td.cal-empty{background:transparent}
td.cal-day{height:64px;border-radius:10px;border:1px solid var(--border);vertical-align:top;background:#fafbfc}
td.cal-day a{display:flex;flex-direction:column;height:100%;padding:7px;text-decoration:none;color:inherit}
td.cal-day a:focus-visible{outline:3px solid var(--primary);outline-offset:2px;border-radius:7px}
.cal-num{font-weight:700;font-variant-numeric:tabular-nums}
.cal-mark{position:absolute;inset-inline-end:7px;bottom:5px;font-size:.72rem;font-weight:900;line-height:1}
td.cal-green .cal-mark{color:#087a54}
td.cal-red .cal-mark{color:#b42318}
.cal-dot{margin-top:auto;align-self:flex-start;width:10px;height:10px;border-radius:50%}
td.cal-green{background:#e1f5ed;border-color:#8fd7bb}
td.cal-green .cal-dot{background:var(--success)}
td.cal-red{background:#fee9e7;border-color:#f3b6ad}
td.cal-red .cal-dot{background:var(--danger)}
td.cal-day:hover{box-shadow:var(--shadow)}
td.cal-none{color:#b8c0ca}
.cal-legend{display:flex;gap:18px;margin-top:14px;color:var(--muted);font-size:.82rem}
.cal-legend{flex-wrap:wrap}
.cal-legend .dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-inline-end:5px;vertical-align:middle}
.cal-legend .dot.green{background:var(--success)}.cal-legend .dot.red{background:var(--danger)}.cal-legend .dot.none{background:#cbd5e1}
/* ---- editable detail extras ---- */
/* Per-side description chips in the simple table's شرح cell: each labelled so
   staff can tell a bank note from a WebHesab note at a glance. */
.desc-box{display:block;direction:rtl;text-align:right;font-size:.78rem;line-height:1.35;
  white-space:normal;max-width:400px;margin:0 0 3px;padding:2px 7px;border-radius:6px;
  border:1px solid transparent}
.desc-box .lbl{display:inline-block;font-size:.64rem;font-weight:800;margin-inline-end:5px;
  padding:0 5px;border-radius:5px;vertical-align:1px;opacity:.95}
.desc-box.is-bank{background:#eef4ff;border-color:#c7dbff;color:#1e3a8a}
.desc-box.is-bank .lbl{background:#1e3a8a;color:#fff}
.desc-box.is-web{background:#eefaf1;border-color:#c2e8cf;color:#14532d}
.desc-box.is-web .lbl{background:#14532d;color:#fff}
.desc-box.is-reason{background:#f6f7f9;border-color:#dfe3ea;color:#3f4b5c}
.desc-box.is-reason .lbl{background:#64748b;color:#fff}
.desc-box.is-override{background:#fff4e6;border-color:#ffd9a8;color:#7a4600}
.desc-box.is-override .lbl{background:#b45309;color:#fff}
.desc-box.is-bale{background:#fdf2ff;border-color:#f0cffb;color:#6b21a8}
.desc-box.is-bale .lbl{background:#7e22ce;color:#fff}
.tx-desc{font-size:.78rem;color:#293449;white-space:normal;max-width:220px;margin-bottom:2px}
.tx-bale{font-size:.74rem;color:#7a4600;white-space:normal;max-width:220px;margin-top:3px}
.tx-branch{font-size:.82rem;font-weight:800;color:#1e3a8a;margin-bottom:4px}
.tx-branch span{color:#475569;font-weight:600}
.corrected{color:#9a5b00;text-decoration:underline dotted}
.tx-edit{margin:2px 0;max-width:100%}
.tx-edit summary{cursor:pointer;font-size:.72rem;color:var(--muted)}
.tx-edit input{display:block;width:150px;margin:4px 0;padding:3px 6px;border:1px solid #cbd5e1;border-radius:6px;font-size:.78rem;font-family:inherit}

/* Active-terminals invoice drawer ("N فاکتور"). Replaces a bare <details>
   whose nested table had no width limit of its own — a row of long customer
   names pushed the whole outer table wider than the panel and spilled past
   its left edge in this RTL layout — with a proper toggle chip and a
   bordered, independently-scrolling panel. */
.act-inv{max-width:100%}
.act-inv-toggle{display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;padding:5px 10px;border-radius:999px;background:#eef1f5;color:var(--text);font-size:.78rem;font-weight:700;transition:background-color .15s ease}
.act-inv-toggle::-webkit-details-marker{display:none}
.act-inv-toggle:hover{background:#e2e6ec}
.act-inv-chevron{width:7px;height:7px;border-inline-end:2px solid var(--muted);border-block-end:2px solid var(--muted);transform:rotate(45deg);transition:transform .15s ease;flex:none}
.act-inv[open] .act-inv-chevron{transform:rotate(-135deg)}
.act-inv-panel{margin-top:8px;padding:10px;border:1px solid var(--border);border-radius:10px;background:#fafbfc;overflow-x:auto;max-width:min(80vw,640px)}
.act-inv-table{width:100%;border-collapse:collapse;font-size:.79rem}
.act-inv-table th{text-align:start;padding:6px 8px;color:var(--muted);font-weight:700;border-bottom:1px solid var(--border);white-space:nowrap}
.act-inv-table td{padding:6px 8px;border-bottom:1px solid #eef1f5;white-space:nowrap}
.act-inv-table tbody tr:last-child td{border-bottom:0}
.act-inv-table tbody tr:nth-child(even){background:#f5f7f9}
.act-inv-unmatched{color:var(--muted)}
.act-inv-note{font-size:.74rem;font-style:italic}

/* Active-terminals report: bank accounts, صندوق/تنخواه cash boxes, and
   حضوری/آنلاین credit fund boxes each get their own section with a distinct
   accent so staff can tell them apart at a glance, per WebHesab's own
   chart-of-accounts split (account_code 101002 = real bank; among the rest,
   a حضوری/آنلاین name pair = a credit/electronic fund, anything else = a
   real cash box). */
.act-term-group{border-inline-start:4px solid transparent}
.act-term-bank{border-inline-start-color:#7c3aed}
.act-term-cash{border-inline-start-color:#15803d}
.act-term-credit{border-inline-start-color:#c2410c}
.act-term-badge-bank{background:#f1e9fe;color:#5b21b6;display:inline-flex;align-items:center;min-height:26px;padding:3px 8px;border-radius:999px;font-size:.72rem;font-weight:800}
.act-term-badge-cash{background:#dcfce7;color:#15803d;display:inline-flex;align-items:center;min-height:26px;padding:3px 8px;border-radius:999px;font-size:.72rem;font-weight:800}
.act-term-badge-credit{background:#ffedd5;color:#c2410c;display:inline-flex;align-items:center;min-height:26px;padding:3px 8px;border-radius:999px;font-size:.72rem;font-weight:800}
.act-term-account{padding-top:16px;margin-top:16px;border-top:1px solid var(--border)}
.act-term-account:first-of-type{padding-top:0;margin-top:0;border-top:0}
.act-term-account-heading h3{margin:0;font-size:.98rem}
.xls-note.match-form{margin-top:5px}
.xls-note select{max-width:180px;padding:4px 6px;border:1px solid #cbd5e1;border-radius:6px;font-size:.78rem;font-family:inherit}
td.c-note{min-width:210px;white-space:normal}

/* --- reconciliation v2: explained discrepancies, grouped settlements --- */
.tx-reason{font-size:.72rem;color:#6b4e00;background:rgba(245,158,11,.12);
  border-radius:6px;padding:3px 6px;margin-top:3px;white-space:normal;max-width:240px}
.row-ok .tx-reason{color:#065f46;background:rgba(16,185,129,.12)}
.tx-time{color:#94a3b8;font-size:.7rem;margin-inline-start:4px}
.tx-group{margin-top:3px;font-size:.72rem}
.tx-group summary{cursor:pointer;color:#2f7cff}
.tx-group ul{margin:4px 0 0;padding-inline-start:14px;color:#475569;max-height:150px;overflow:auto}
.recon-warn{margin:0 0 14px;padding:10px 14px;border-radius:10px;
  background:rgba(239,68,68,.1);color:#991b1b;font-size:.85rem}

/* --- group drill-down: the individual sales behind an aggregated match --- */
.tx-group-table{border-collapse:collapse;margin-top:4px;font-size:.72rem;width:100%}
.tx-group-table th{background:#f1f5f9;color:#475569;font-weight:600;padding:3px 6px;
  text-align:right;white-space:nowrap}
.tx-group-table td{padding:3px 6px;border-top:1px solid #e2e8f0;color:#334155;
  white-space:nowrap;max-width:150px;overflow:hidden;text-overflow:ellipsis}
.tx-group-table td.num{font-family:ui-monospace,monospace}
.tx-group details.elsewhere summary{color:#b45309}
.sync-freshness{font-size:.75rem;color:#64748b;display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.reset-row-btn{color:#b45309;border-color:#fcd9a8}
.reset-row-btn:hover{background:#fff7ed}

/* Notification settings */
.notify-flash{background:#ecfdf5;border:1px solid #6ee7b7;color:#065f46;padding:8px 12px;border-radius:8px;font-size:.85rem;margin:6px 0}
.notify-warn{background:#fef2f2;border:1px solid #fca5a5;color:#991b1b;padding:8px 12px;border-radius:8px;font-size:.85rem;margin:6px 0}
.notify-hint{font-size:.78rem;color:#64748b;margin:2px 0}
.notify-check{display:flex;align-items:center;gap:8px;padding:4px 0}
.notify-check input{margin:0}
.notify-chats{border:1px solid #e2e8f0;border-radius:10px;padding:10px 14px;margin:8px 0}
.notify-chats legend{font-weight:600;padding:0 6px}
.notify-actions{margin-top:8px}
.notify-test{margin-top:14px;border-top:1px solid #e2e8f0;padding-top:12px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}

/* Floating AI assistant */
#canny-assistant{position:fixed;bottom:18px;left:18px;z-index:1200;direction:rtl}
.ca-toggle{width:54px;height:54px;border-radius:50%;border:none;background:#2f7cff;color:#fff;
  font-size:26px;line-height:1;cursor:pointer;box-shadow:0 8px 24px rgba(47,124,255,.45);transition:transform .15s,background .15s}
.ca-toggle:hover{transform:translateY(-2px)}
.ca-toggle.open{background:#1e5fd0}
.ca-panel{position:absolute;bottom:66px;left:0;width:350px;max-width:calc(100vw - 36px);
  height:470px;max-height:calc(100vh - 130px);background:#fff;border:1px solid #e2e8f0;border-radius:16px;
  box-shadow:0 16px 48px rgba(2,6,23,.28);display:flex;flex-direction:column;overflow:hidden}
/* `display:flex` above overrides the [hidden] attribute, so hidden must be made
   explicit — otherwise the panel shows by default and the close/toggle buttons
   (which set `hidden`) have no visual effect. */
.ca-panel[hidden]{display:none}
.ca-head{background:#2f7cff;color:#fff;padding:11px 14px;font-weight:600;display:flex;
  justify-content:space-between;align-items:center;font-size:.9rem}
.ca-close{background:transparent;border:none;color:#fff;font-size:16px;cursor:pointer;padding:2px 6px;border-radius:6px}
.ca-close:hover{background:rgba(255,255,255,.2)}
.ca-msgs{flex:1;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:8px;background:#f8fafc}
.ca-msg{max-width:88%;padding:8px 12px;border-radius:13px;font-size:.85rem;line-height:1.8;
  white-space:pre-wrap;word-break:break-word}
.ca-bot{background:#eef2ff;color:#1e293b;align-self:flex-start;border-bottom-right-radius:4px}
.ca-user{background:#2f7cff;color:#fff;align-self:flex-end;border-bottom-left-radius:4px}
.ca-pending{opacity:.6;font-style:italic}
.ca-form{display:flex;gap:6px;padding:10px;border-top:1px solid #e2e8f0;background:#fff}
#ca-input{flex:1;border:1px solid #cbd5e1;border-radius:9px;padding:9px 11px;font:inherit;min-width:0}
.ca-send{border:none;background:#2f7cff;color:#fff;border-radius:9px;padding:9px 15px;cursor:pointer;font:inherit;white-space:nowrap}
.ca-send:hover{background:#1e5fd0}
.tx-group{max-width:420px}
.branch-sales{margin:0 0 14px;font-size:.85rem}
.branch-sales summary{cursor:pointer;color:#2f7cff;margin-bottom:6px}
.branch-sales .tx-group-table{max-width:520px}

/* --- running balance columns --- */
td.c-bal{color:#5c6b80;font-family:ui-monospace,'SF Mono',Consolas,monospace;font-size:.8rem;font-weight:600}

/* --- reconciliation checkpoint: "reviewed through this transaction" (row
   state colours + zebra are defined earlier, alongside .row-*) --- */
.recon-banner.checkpoint{background:rgba(16,185,129,.08);border-inline-start:4px solid var(--success);color:#065f46;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.checkpoint-clear,.checkpoint-set{display:inline-flex;margin:0}
tr.is-checkpoint td.c-idx{position:relative}
tr.is-checkpoint td.c-idx::after{content:'✔';position:absolute;inset-inline-start:-1px;top:-15px;font-size:.68rem;color:var(--success);font-weight:800}
td.cal-checked{box-shadow:inset 0 -4px 0 0 var(--success)}
.cal-legend .dot.checked{background:var(--success);box-shadow:0 0 0 2px rgba(16,185,129,.25)}
.cal-lock{position:absolute;top:5px;inset-inline-end:6px;font-size:.85rem;line-height:1}
td.cal-day{position:relative}
td.cal-drift{border-color:#e8a91d;box-shadow:inset 0 0 0 2px #fbbf24}
.cal-day.cal-selected{outline:3px solid #1d4ed8;outline-offset:2px}

.drift-audit{margin-top:18px;padding:18px;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow)}
.drift-audit-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
.drift-audit-head h3{margin:3px 0 0}
.drift-summary{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 10px}
.drift-chip,.drift-state{display:inline-flex;align-items:center;min-height:28px;padding:4px 9px;border-radius:999px;font-size:.78rem;font-weight:800;border:1px solid transparent}
.drift-chip.changed,.drift-state.changed{color:#854d0e;background:#fef9c3;border-color:#fde047}
.drift-chip.added,.drift-state.added{color:#166534;background:#dcfce7;border-color:#86efac}
.drift-chip.removed,.drift-state.removed{color:#991b1b;background:#fee2e2;border-color:#fca5a5}
.drift-table td{vertical-align:top}
.drift-row.drift-changed{background:#fffdf1}
.drift-row.drift-added{background:#f4fff7}
.drift-row.drift-removed{background:#fff7f7}
.drift-desc{display:block;margin-top:5px;color:var(--muted);line-height:1.55}
.drift-clear{padding:12px;border:1px solid #a7d8b5;border-radius:8px;background:#f0fdf4;color:#166534}

/* --- reconciliation view switcher (detailed / simple / focus) --- */
.recon-view-tabs{display:flex;gap:6px;margin:4px 0 16px;flex-wrap:wrap}
.recon-view-tabs a{padding:7px 14px;border-radius:999px;font-size:.84rem;font-weight:700;
  color:#334155;background:#f1f5f9;text-decoration:none;border:1px solid transparent}
.recon-view-tabs a:hover{background:#e2e8f0}
.recon-view-tabs a.active{background:#1e3a8a;color:#fff}

/* --- simple / focus views: one merged table, single amount pair per row --- */
table.simple-table{border-collapse:separate;border-spacing:0;width:100%;font-size:.92rem;
  font-variant-numeric:tabular-nums;background:#fff}
table.simple-table th,table.simple-table td{border-bottom:1px solid #c3ccd9;
  border-inline-start:1px solid #ccd3de;padding:8px 12px;text-align:right;white-space:nowrap}
table.simple-table thead th{position:sticky;top:0;z-index:2;background:#f1f5f9;color:#334155;
  font-size:.78rem;font-weight:700;border-bottom:2px solid #94a3b8}
table.simple-table td.c-ref{white-space:normal;max-width:420px}
.status-text{font-size:.78rem;color:#475569;margin-inline-start:4px}
.recon-day-separator td{padding:0!important;border:0!important;background:#fff4c2!important;color:#5b4500;white-space:normal!important}
.recon-day-band{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px;border-top:3px solid #d4a017;border-bottom:3px solid #d4a017;font-size:.78rem;line-height:1.6;font-weight:600}
.recon-day-band strong{font-size:.95rem;margin-inline-end:4px;color:#493700;font-weight:800}
.recon-day-band span{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:999px;background:rgba(255,255,255,.72);white-space:nowrap}
.recon-day-band .day-fixed{color:#087443}.recon-day-band .day-issues{color:#a02622}.recon-day-band .day-fees,.recon-day-band .day-fees-total{color:#9a5300;background:#ffedd0}
.recon-day-band .day-balance{color:#14527d;background:#e0f2fe}.recon-day-band .day-balance-diff{color:#8b2c12;background:#ffeadf;font-weight:800}
.recon-day-band .day-pos{color:#5b4500;background:#fff4d6}
.recon-day-band .day-checked{color:#087443;background:#dcfce7;font-weight:800;border:1px solid #a7d8b5}
.recon-day-band .day-balance-match{color:#087443;background:#dcfce7;font-weight:800;border:1px solid #a7d8b5}
.recon-day-band .day-locked{color:#087443;background:#dcfce7;font-weight:800;border:1px solid #a7d8b5}
.recon-day-band .day-locked .drift-warn{color:#9a5300}
.day-lock-form{display:inline-flex;margin:0}
.day-lock-form .button{padding:3px 10px;font-size:.72rem}
.day-checkpoint-form{display:inline-flex;align-items:center;margin:0}
.recon-month-separator td{padding:0!important;border:0!important;background:#dbeafe!important;color:#1e3a5f;white-space:normal!important}
.recon-month-band{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px;border-top:3px solid #3b82f6;border-bottom:3px solid #3b82f6;font-size:.8rem;line-height:1.6;font-weight:600}
.recon-month-band strong{font-size:1rem;margin-inline-end:4px;color:#1e3a5f;font-weight:800}
.recon-month-band span{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:999px;background:rgba(255,255,255,.75);white-space:nowrap}
.recon-month-band .month-fees{color:#9a5300;background:#ffedd0}
.recon-month-band .month-net{color:#087443;background:#dcfce7}
.recon-month-band .month-issues{color:#a02622}
.recon-month-band .month-fixed{color:#087443;background:#dcfce7}
.fund-deposit-band{border-top:1px dashed #93c5fd}
.fund-deposit-band .deposit-carry{color:#9a5300;background:#ffedd0;font-weight:700}
.fund-deposit-band .deposit-note{color:#334155;background:transparent;padding:0}
.fund-deposit-form{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;background:transparent}
.fund-deposit-form label{display:inline-flex;align-items:center;gap:5px;font-size:.78rem;color:#334155;white-space:nowrap}
.fund-deposit-form input[type=text]{width:150px;padding:4px 8px;border:1px solid #cbd5e1;border-radius:7px;font-size:.78rem}
.recon-branch-list{display:flex;flex-wrap:wrap;gap:4px;margin-top:2px}
.recon-branch-list span{background:rgba(255,255,255,.6);border-radius:999px;padding:1px 6px;font-size:.72rem}
.day-checkpoint-form label{display:inline-flex;align-items:center;gap:4px;color:#5b4500;cursor:pointer;white-space:nowrap}
.day-checkpoint-form input[type=checkbox]{width:18px;height:18px;accent-color:#169c62}
.day-checkpoint-submit{padding:3px 8px;font-size:.72rem}
.simple-table-tools{display:flex;justify-content:flex-end;margin:0 0 8px}
.simple-menu-state{position:absolute;inline-size:1px;block-size:1px;opacity:0;pointer-events:none}
.simple-menu-toggle{cursor:pointer}
.recon-wrap:has(#simple-menu-state:checked) .page-header,.recon-wrap:has(#simple-menu-state:checked) .recon-view-tabs,.recon-wrap:has(#simple-menu-state:checked) .panel-heading,.recon-wrap:has(#simple-menu-state:checked) .recon-summary,.recon-wrap:has(#simple-menu-state:checked) .recon-banner,.recon-wrap:has(#simple-menu-state:checked) .branch-sales{display:none}
.recon-wrap:has(#simple-menu-state:checked) .simple-table-tools{justify-content:flex-start}
body:has(#simple-menu-state:checked) .app-shell{grid-template-columns:0 minmax(0,1fr)}
body:has(#simple-menu-state:checked) .sidebar{width:0;overflow:hidden;padding-inline:0;border:0}
.quick-resolve-form{display:inline-flex;margin:0}
.quick-resolve{appearance:none;width:28px;height:28px;padding:0;border:1px solid #b9c6d8;border-radius:7px;background:#fff;color:#168653;font-size:1.05rem;font-weight:900;cursor:pointer;line-height:1;position:relative}
.quick-resolve::after{content:'✓';position:absolute;inset:0;display:grid;place-items:center;color:transparent}
.quick-resolve:checked{background:#dcfce7;border-color:#67b889}.quick-resolve:checked::after{color:#168653}
.simple-table tbody tr:has(.quick-resolve:checked){background-color:#dcfce7!important;background-image:none!important;filter:none!important}
.simple-table tbody tr:has(.quick-resolve:checked)>td{border-color:#a7d8b5!important}
.quick-resolve:hover{background:#dcfce7;border-color:#67b889}
.simple-menu-collapsed .page-header,.simple-menu-collapsed .recon-view-tabs,.simple-menu-collapsed .panel-heading,.simple-menu-collapsed .recon-summary,.simple-menu-collapsed .recon-banner,.simple-menu-collapsed .branch-sales{display:none}
.simple-menu-collapsed .simple-table-tools{justify-content:flex-start}
.recon-day-band b{font-variant-numeric:tabular-nums}
table.simple-table th.c-action,table.simple-table td.c-action{width:1%;text-align:center;padding:5px 8px}
.simple-edit-trigger{min-height:36px;display:inline-flex;align-items:center;justify-content:center;gap:5px;
  padding:5px 9px;border:1px solid #aebbd0;border-radius:8px;background:#fff;color:#1e3a8a;
  font-family:inherit;font-size:.76rem;font-weight:700;white-space:nowrap;cursor:pointer;
  transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease}
.simple-edit-trigger:hover{background:#eef2ff;border-color:#8093b2}
.simple-edit-trigger:focus-visible,.simple-dialog-close:focus-visible{outline:3px solid rgba(47,124,255,.35);outline-offset:2px}

/* Simple view keeps the ledger dense; row details and edit controls live in a
   native dialog so keyboard focus, Escape-to-close and focus restoration are
   handled by the browser. */
.simple-edit-dialog{width:min(720px,calc(100vw - 32px));max-height:86dvh;margin:auto;padding:0;
  border:0;border-radius:16px;background:#fff;color:var(--text);box-shadow:0 24px 70px rgba(15,23,42,.3);overflow:auto}
.simple-edit-dialog[open]{display:block;position:fixed;inset:7vh 0 auto;margin:auto;z-index:50}
.simple-edit-dialog::backdrop{background:rgba(15,23,42,.5);backdrop-filter:blur(2px)}
.simple-edit-head{position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;
  gap:16px;padding:16px 20px;border-bottom:1px solid var(--border);background:rgba(255,255,255,.97)}
.simple-edit-head .eyebrow{margin:0 0 2px}.simple-edit-head h2{margin:0;font-size:1.08rem}
.simple-dialog-close{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;
  flex:0 0 auto;border:1px solid var(--border);border-radius:10px;background:#fff;color:#475569;cursor:pointer}
.simple-dialog-close:hover{background:#f1f5f9;color:#0f172a}
.simple-edit-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:16px 20px 0}
.simple-edit-summary>div{display:flex;flex-direction:column;gap:3px;padding:9px 10px;border-radius:9px;background:#f1f5f9;min-width:0}
.simple-edit-summary span{font-size:.7rem;color:var(--muted)}
.simple-edit-summary b{font-size:.82rem;overflow-wrap:anywhere}
.simple-edit-body{padding:16px 20px 22px;line-height:1.8}
.simple-edit-body .tx-reason,.simple-edit-body .tx-desc,.simple-edit-body .tx-bale,.simple-edit-body .tx-group{max-width:none}
.simple-edit-body .tx-desc,.simple-edit-body .tx-bale{font-size:.84rem;margin-top:6px}
.simple-edit-controls{margin-top:16px;padding-top:14px;border-top:1px solid var(--border)}
.simple-edit-controls>.xls-note{margin-top:0}
.simple-edit-controls .tx-edit input{width:min(260px,100%)}
.dialog-table-scroll{overflow-x:auto}

/* --- fund settlement-group accordion (row-{{cls}} orange/"warn" items) --- */
.accordion-toggle{appearance:none;border:1px solid #d97706;background:#fff7ec;color:#9a5300;
  border-radius:6px;width:22px;height:22px;line-height:1;font-size:.85rem;font-weight:800;
  cursor:pointer;margin-inline-start:4px;transition:transform .15s ease}
.accordion-toggle:hover{background:#ffedd0}
.accordion-toggle.is-open{transform:rotate(180deg)}
tr.fund-group-row{background:#fffaf0}
tr.fund-group-row td{padding:10px 14px;border-top:1px dashed #e8c95f}
.fund-group-accordion .fund-group-caption{margin:0 0 6px;font-size:.8rem;color:#5b4500}
.fund-filter-status{color:var(--muted);font-size:.78rem}

@media (max-width:640px){
  table.cal{min-width:0;border-spacing:3px}
  table.cal th{font-size:.7rem;padding:2px}
  td.cal-day{height:56px;padding:0}
  td.cal-day a{padding:5px}
  .cal-nav{align-items:stretch}
  .cal-nav .button{min-height:44px}
  .drift-audit{padding:13px}
  .drift-audit-head .button{width:100%;min-height:44px}
}

/* --- focus view: needs-review is always open, the rest collapse behind a count --- */
.recon-sec-title.focus-need{border-inline-start-color:#dc2626}
details.focus-group{margin:20px 0;border:1px solid var(--border);border-radius:12px;
  padding:10px 16px;background:#fafbfc}
details.focus-group summary{cursor:pointer;font-weight:800;font-size:.95rem;
  display:flex;align-items:center;gap:8px}
details.focus-group[open] summary{margin-bottom:10px}

@media (max-width:900px){
  table.simple-table{font-size:.82rem}
  .simple-edit-trigger{min-width:44px;min-height:44px;padding:6px}
  .simple-edit-trigger span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
  .simple-edit-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:520px){
  .simple-edit-dialog{width:calc(100vw - 16px);max-height:92dvh;border-radius:13px}
  .simple-edit-head,.simple-edit-body{padding-inline:14px}
  .simple-edit-summary{padding-inline:14px}
}
