/* ==========================================================================
   رصيد (Raseed) — App identity: هادئ ومحاسبي. شريط جانبي أخضر عميق (يمين)،
   خلفية فاتحة، بطاقات بيضاء، أيقونات KPI بمربعات ملوّنة ناعمة، مبالغ بخانتين عشريتين.
   يُحمَّل بعد ../../shared/css/base.css
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Mada:wght@500;700&display=swap");

:root {
  --brand: #1e8049;
  --brand-600: #186c3d;
  --brand-soft: #e6f3eb;
  --accent: #14503c;
  --side-1: #1b5e47;
  --side-2: #14503c;

  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --border: #e3e9e6;
  --border-2: #edf1ef;
  --text: #1c2b25;
  --text-2: #5b6b64;
  --muted: #94a39c;

  --in: #1e8049;   --in-soft: #e5f4ea;
  --out: #dc3545;  --out-soft: #fdecee;
  --bal: #0d6efd;  --bal-soft: #e8f0fe;
  --warn: #b7791f; --warn-soft: #fdf3dc;
  --violet: #7c3aed; --violet-soft: #f1eafe;
  --slate: #64748b; --slate-soft: #eef1f4;
  --amber: #b45309; --amber-soft: #fef0d9;

  --success: var(--in); --success-soft: var(--in-soft);
  --danger: var(--out); --danger-soft: var(--out-soft);
  --warning: var(--warn); --warning-soft: var(--warn-soft);
  --info: var(--bal); --info-soft: var(--bal-soft);

  --radius-sm: 7px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 40, 31, .05);
  --shadow: 0 4px 14px rgba(20, 40, 31, .06);
  --shadow-lg: 0 20px 44px rgba(20, 40, 31, .14);
  --side-w: 270px;
  --top-h: 64px;
}

html { overflow-x: clip; }
body { background: var(--bg); color: var(--text); }
body.modal-open { overflow: hidden; }
a { color: var(--brand); }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.ltr-cell { direction: ltr; text-align: right; unicode-bidi: plaintext; }
.ltr-in { direction: ltr; text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.hidden, [hidden] { display: none !important; }

/* ---------------------------------------------------------------- Utilities */
.text-2 { color: var(--text-2); } .text-muted { color: var(--muted); }
.text-in { color: var(--in) !important; } .text-out { color: var(--out) !important; } .text-bal { color: var(--bal) !important; } .text-warn { color: var(--warn) !important; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fs-16 { font-size: 16px; } .fs-18 { font-size: 18px; } .fs-22 { font-size: 22px; }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.gap-6 { gap: 6px; } .gap-16 { gap: 16px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- Buttons */
.btn { border-radius: var(--radius-sm); padding: 9px 16px; font-size: 14.5px; line-height: 1.4; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-danger { background: var(--out); color: #fff; }
.btn-danger:hover { background: #c22d3c; color: #fff; }
.btn-danger-soft { background: var(--out-soft); color: var(--out); }
.btn-danger-soft:hover { background: var(--out); color: #fff; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-outline-brand { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: var(--brand); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--brand); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-locked, .is-locked { opacity: .5; cursor: not-allowed !important; filter: grayscale(.4); }
.btn-icon, .icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; position: relative; padding: 0; transition: .15s; }
.btn-icon:hover, .icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.btn-icon { width: 34px; height: 34px; border: 0; background: transparent; }
.act-btn { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--border); background: #fff; color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; transition: .15s; padding: 0; }
.act-btn svg { width: 15px; height: 15px; }
.act-btn:hover { border-color: var(--brand); color: var(--brand); }
.act-btn.edit { border-color: #bfdccb; color: var(--brand); }
.act-btn.del { border-color: #f3c2c8; color: var(--out); }
.act-btn.del:hover { background: var(--out); color: #fff; }
.act-btn.warn { border-color: #f1d9a0; color: var(--warn); }
.row-actions { display: inline-flex; gap: 6px; }

/* ---------------------------------------------------------------- Shell: sidebar (right in RTL) */
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side-w); z-index: 40;
  background: linear-gradient(180deg, var(--side-1) 0%, var(--side-2) 100%); color: #fff;
  display: flex; flex-direction: column; transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: #fff; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.brand-mark svg { width: 38px; height: 38px; }
.brand-name { font-size: 23px; font-weight: 800; line-height: 1.15; display: flex; flex-direction: column; min-width: 0; }
.brand-name small { font-size: 12px; font-weight: 500; opacity: .78; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 8px 12px 14px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav-section { font-size: 11.5px; color: rgba(255,255,255,.55); padding: 14px 12px 6px; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: rgba(255,255,255,.92); font-size: 15px; font-weight: 500; margin-bottom: 3px; transition: background .15s; }
.nav-link svg { width: 19px; height: 19px; opacity: .9; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.17); color: #fff; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.nav-label { flex: 1; min-width: 0; }
.nav-link .count { background: #fff; color: var(--side-2); font-size: 11.5px; font-weight: 800; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.12); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.sf-user { display: flex; align-items: center; gap: 10px; }
.sf-user .avatar { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.6); }
.sf-user b { display: block; font-size: 14px; }
.sf-user small { display: block; font-size: 11.5px; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-logout { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(255,255,255,.55); border-radius: 8px; color: #fff; padding: 7px 10px; font-size: 14px; font-weight: 600; transition: .15s; }
.sf-logout:hover { background: #fff; color: var(--side-2); }
.sf-logout svg { width: 16px; height: 16px; }
.sf-by { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 11.5px; color: rgba(255,255,255,.6); }
.sf-by img { width: 16px; height: 16px; border-radius: 4px; background: #fff; padding: 1px; }
.sf-by:hover { color: #fff; }
.sidebar-overlay { display: none; }

/* ---------------------------------------------------------------- Shell: main + header */
.main { margin-inline-start: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.topbar-app { position: sticky; top: 0; z-index: 30; height: var(--top-h); background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 24px; }
.menu-toggle { display: none; }
.page-title { min-width: 0; }
.page-title h1 { font-size: 21px; font-weight: 800; margin: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-title small { font-size: 12px; color: var(--muted); }
.top-search { flex: 1; max-width: 380px; margin-inline-start: auto; position: relative; }
.top-search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--muted); }
.top-search input { width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); padding: 0 40px 0 14px; font: inherit; font-size: 13.5px; color: var(--text); outline: none; transition: .15s; }
.top-search input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.top-search + .header-actions { margin-inline-start: 0; }
.sync-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--in-soft); color: var(--in); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.sync-chip svg { width: 16px; height: 16px; }
.sync-chip.bad { background: var(--out-soft); color: var(--out); }
.ro-badge { height: 30px; padding: 0 12px; }
.icon-btn .dot-count { position: absolute; top: -5px; inset-inline-end: -5px; background: var(--out); color: #fff; font-size: 10.5px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center; border: 2px solid #fff; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 3px 4px 3px 12px; cursor: pointer; font: inherit; color: var(--text); }
.user-btn .meta { display: flex; flex-direction: column; text-align: right; line-height: 1.2; }
.user-btn .meta b { font-size: 13px; } .user-btn .meta small { font-size: 11px; color: var(--muted); }
.user-btn > svg { width: 16px; color: var(--muted); }

.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 290px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; display: none; z-index: 50; }
.dropdown.open .dropdown-menu { display: block; animation: pop .15s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border-2); margin: 6px 0; }
.dropdown-menu a, .dropdown-menu .item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; color: var(--text); font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: right; }
.dropdown-menu a:hover, .dropdown-menu .item:hover { background: var(--surface-2); color: var(--brand); }
.dropdown-menu .danger { color: var(--out); }
.dropdown-menu svg { width: 17px; height: 17px; color: var(--muted); }
.dd-level { font-size: 12.5px; color: var(--text-2); padding: 0 10px 6px; display: flex; align-items: center; gap: 6px; }
.notif-menu { width: 360px; padding: 6px; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex !important; align-items: flex-start !important; gap: 10px; padding: 10px !important; border-radius: 10px; }
.notif-item.unread { background: #f3faf6; }
.notif-item b { display: block; font-size: 13.5px; }
.notif-item p { margin: 2px 0; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.notif-item small { font-size: 11.5px; color: var(--muted); }
.n-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.n-ic svg { width: 17px; height: 17px; color: inherit !important; }
.t-success { background: var(--in-soft); color: var(--in); } .t-danger { background: var(--out-soft); color: var(--out); }
.t-warning { background: var(--warn-soft); color: var(--warn); } .t-info { background: var(--bal-soft); color: var(--bal); }
.search-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }

.content { padding: 24px; flex: 1; min-width: 0; width: 100%; max-width: 1480px; }
.app-foot { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 18px 16px 24px; font-size: 12.5px; color: var(--muted); }
.app-foot a { color: var(--brand); }
.app-foot a b { font-weight: 700; }
.app-foot .sep { opacity: .5; }

/* ---------------------------------------------------------------- Page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { font-size: 20px; font-weight: 800; margin: 0 0 2px; }
.page-head p { margin: 0; color: var(--text-2); font-size: 14px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.actions-bar .group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Grids */
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); }
.span-2 { grid-column: span 2; }

/* ---------------------------------------------------------------- Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.card-head h3 { font-size: 16px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { width: 18px; height: 18px; color: var(--text-2); }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card-head .count-pill { font-size: 13px; color: var(--text-2); font-weight: 700; }
.card-body { padding: 16px 18px; }
.card-pad { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- KPI cards (soft-tinted icon square) */
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.kpi-grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); color: var(--text); min-width: 0; transition: .15s; }
a.kpi:hover { border-color: var(--brand); box-shadow: var(--shadow); color: var(--text); }
.kpi-ic { width: 54px; height: 54px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-ic svg { width: 26px; height: 26px; stroke-width: 1.8; }
.kpi-body { min-width: 0; display: flex; flex-direction: column; }
.kpi-body small { font-size: 14px; color: var(--text-2); }
.kpi-body { container-type: inline-size; flex: 1 1 0; }
.kpi-body b { font-size: clamp(15px, 11cqi, 25px); font-weight: 800; line-height: 1.3; white-space: normal; letter-spacing: -.2px; }
.kpi-foot { font-size: 12px; color: var(--muted); margin-top: 2px; }
.k-in .kpi-ic { background: var(--in-soft); color: var(--in); }
.k-out .kpi-ic { background: var(--out-soft); color: var(--out); }
.k-bal .kpi-ic { background: var(--bal-soft); color: var(--bal); }
.k-bal .kpi-body b { color: var(--in); }
.k-bal.neg .kpi-body b { color: var(--out); }
.k-warn .kpi-ic { background: var(--warn-soft); color: var(--warn); }
.k-violet .kpi-ic { background: var(--violet-soft); color: var(--violet); }
.k-slate .kpi-ic { background: var(--slate-soft); color: var(--slate); }
.kpi.sm { padding: 14px 16px; gap: 12px; border-radius: 12px; }
.kpi.sm .kpi-ic { width: 42px; height: 42px; border-radius: 11px; }
.kpi.sm .kpi-ic svg { width: 21px; height: 21px; }
.kpi.sm .kpi-body small { font-size: 12.5px; }
.kpi.sm .kpi-body b { font-size: clamp(13px, 11cqi, 18px); }

/* mini compare stats */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.stat-strip > div { padding: 14px 18px; border-inline-start: 1px solid var(--border-2); min-width: 0; }
.stat-strip > div:first-child { border-inline-start: 0; }
.stat-strip small { display: block; font-size: 12.5px; color: var(--text-2); }
.stat-strip > * { container-type: inline-size; }
.stat-strip b { display: block; font-size: clamp(13px, 11cqi, 18px); font-weight: 800; white-space: normal; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.trend svg { width: 13px; height: 13px; }
.trend.up { background: var(--in-soft); color: var(--in); } .trend.down { background: var(--out-soft); color: var(--out); } .trend.flat { background: var(--slate-soft); color: var(--slate); }

/* ---------------------------------------------------------------- Badges, chips, amounts */
.badge { border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.badge-in, .badge-success { background: var(--in-soft); color: var(--in); }
.badge-out, .badge-danger { background: var(--out-soft); color: var(--out); }
.badge-warning { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--bal-soft); color: var(--bal); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-slate { background: var(--slate-soft); color: var(--slate); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-brand { background: var(--brand); color: #fff; }
.badge-solid-in { background: var(--in); color: #fff; }
.badge-lg { font-size: 13px; padding: 4px 12px; }
.tag-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag-chip { --tc: var(--slate); display: inline-flex; align-items: center; gap: 4px; border: 1px solid color-mix(in srgb, var(--tc) 35%, #d6dcd9); background: #fff; color: var(--text); border-radius: 6px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; line-height: 1.7; box-shadow: 0 1px 0 rgba(0,0,0,.03); }
.tag-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tc); flex-shrink: 0; }
a.tag-chip:hover { border-color: var(--tc); color: var(--tc); }
.amt { font-weight: 800; white-space: nowrap; direction: rtl; unicode-bidi: isolate; }
.amt-in { color: var(--text); } .amt-out { color: var(--text); }
.amt.colored.amt-in, .colored .amt-in { color: var(--in); }
.amt.colored.amt-out, .colored .amt-out { color: var(--out); }
.state-له { color: var(--in); } .state-عليه { color: var(--out); } .state-مسدّد { color: var(--slate); }

/* ---------------------------------------------------------------- Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: var(--surface-2); color: var(--text-2); font-weight: 700; font-size: 13.5px; text-align: right; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #f7faf8; }
.table .num { text-align: right; }
.table td.note-cell { color: var(--text); max-width: 260px; }
.table .att-ic, .table .sync-ic { width: 14px; height: 14px; vertical-align: -2px; color: var(--muted); }
.table .sync-ic { color: var(--out); }
.table tfoot td { background: var(--surface-2); font-weight: 800; border-top: 1px solid var(--border); }
.table.compact td, .table.compact th { padding: 8px 12px; }
.table tr.row-new td { animation: rowFlash 2.4s ease; }
@keyframes rowFlash { 0%, 40% { background: #fff6d6; } 100% { background: transparent; } }
.table tr.selected td { background: #f0f8f3; }
.op-id { font-weight: 700; color: var(--brand); }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination button { min-width: 34px; height: 34px; border: 1px solid var(--border); background: #fff; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); }
.pagination button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination span { align-self: center; color: var(--muted); }

/* ---------------------------------------------------------------- Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .req { color: var(--out); }
.field .opt, .opt { font-size: 12px; font-weight: 500; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-width: 0; border: 1px solid #d5ddd9; border-radius: var(--radius-sm); background: #fff; padding: 9px 12px; font: inherit; font-size: 14.5px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 128, 73, .14); }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--muted); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6b64' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 34px; }
.textarea { resize: vertical; min-height: 70px; }
.input-sm { padding: 6px 10px; font-size: 13.5px; }
.field.err .input, .field.err .select { border-color: var(--out); box-shadow: 0 0 0 3px var(--out-soft); }
.hint { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.input-suffix { position: relative; }
.input-suffix .input { padding-left: 46px; }
.input-suffix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); font-weight: 700; }
.check { width: 17px; height: 17px; accent-color: var(--brand); }
.filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 14px; align-items: end; }
.filters .field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.filters .input, .filters .select { padding: 7px 10px; font-size: 13.5px; }
.filters .span-2 { grid-column: span 2; }
.filter-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.filter-actions .group { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm); }
.btn-group .btn:last-child { border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); }
.btn-group .btn + .btn { margin-inline-start: -1px; }

/* type toggle (إيراد / مصروف) */
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-toggle button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 10px; border: 1.5px solid var(--border); background: #fff; font: inherit; font-weight: 700; color: var(--text-2); cursor: pointer; transition: .15s; }
.type-toggle button[data-type="income"].active { border-color: var(--in); background: var(--in-soft); color: var(--in); }
.type-toggle button[data-type="expense"].active { border-color: var(--out); background: var(--out-soft); color: var(--out); }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

/* multi-select tag chips */
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pick { --tc: var(--slate); display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: .15s; }
.chip-pick svg { width: 14px; height: 14px; color: var(--tc); }
.chip-pick:hover { border-color: var(--tc); }
.chip-pick.on { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 10%, #fff); color: var(--text); }
.chip-pick.locked { cursor: default; box-shadow: inset 0 0 0 1px var(--tc); }
.new-tag { display: flex; gap: 8px; margin-top: 8px; max-width: 420px; }

/* toggle rows & switch */
.toggles { display: flex; flex-direction: column; gap: 10px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.toggle-row > span:first-child { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.toggle-row > span:first-child svg { grid-row: span 2; color: var(--brand); width: 20px; height: 20px; }
.toggle-row b { font-size: 14px; } .toggle-row small { font-size: 12px; color: var(--muted); }
.toggle-row.is-off { cursor: not-allowed; opacity: .7; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cfd8d3; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; right: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(-20px); }
.switch input:disabled + span { cursor: not-allowed; opacity: .6; }
.switch.sm { width: 36px; height: 20px; }
.switch.sm span::after { width: 14px; height: 14px; }
.switch.sm input:checked + span::after { transform: translateX(-16px); }

.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 18px; border: 1.5px dashed #c6d3cc; border-radius: 12px; background: var(--surface-2); text-align: center; cursor: pointer; transition: .15s; }
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone svg { width: 26px; height: 26px; color: var(--brand); }
.dropzone b { font-size: 14px; } .dropzone small { font-size: 12px; color: var(--muted); }
.dropzone .dz-name { font-size: 12.5px; color: var(--brand); font-weight: 700; }
.dropzone.has-file { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.form-actions .btn-save { flex: 1; }
.op-form .custody-note { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.op-form .custody-note svg { color: var(--warn); }
.note-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; font-size: 13.5px; color: var(--text-2); line-height: 1.75; }
.note-box.info { background: #e8f7fb; border-color: #b9e5ef; color: #0b5d70; }
.note-box.warn { background: #fff8e6; border-color: #f3dfa6; color: #8a5a00; }
.note-box.ok { background: var(--in-soft); border-color: #bfe0cc; color: #145c34; }
.note-box.bad { background: var(--out-soft); border-color: #f4c3c8; color: #9b1c2a; }

/* ---------------------------------------------------------------- Lists, bars, misc */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-2); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow b { display: block; font-size: 14px; }
.list-row .grow small { font-size: 12px; color: var(--muted); }
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row .bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.bar-row .bar-top b { font-weight: 800; white-space: nowrap; }
.progress { height: 8px; border-radius: 999px; background: #edf1ef; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--pc, var(--brand)); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 360px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.person b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; font-size: 12px; color: var(--muted); }
.avatar { --av: var(--brand); width: 38px; height: 38px; border-radius: 50%; background: var(--av); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; line-height: 1; }
.avatar-sm { width: 32px; height: 32px; font-size: 12.5px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-xl { width: 72px; height: 72px; font-size: 25px; margin-inline: auto; }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.info-list > div { padding: 10px 14px; border-bottom: 1px solid var(--border-2); min-width: 0; }
.info-list > div:nth-child(odd) { border-inline-end: 1px solid var(--border-2); }
.info-list small { display: block; font-size: 12px; color: var(--muted); }
.info-list b { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.op-hero { text-align: center; padding: 18px; border-radius: 14px; background: var(--in-soft); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.op-hero.expense { background: var(--out-soft); }
.op-hero b { font-size: 28px; font-weight: 800; color: var(--in); }
.op-hero.expense b { color: var(--out); }
.op-hero small { color: var(--text-2); }
.perm-list { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; background: var(--in-soft); color: var(--in); padding: 3px 9px; border-radius: 6px; }
.perm-pill svg { width: 13px; height: 13px; }
.perm-pill.off { background: var(--slate-soft); color: var(--muted); text-decoration: line-through; }
.status-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font-size: 13px; color: var(--text); min-width: 0; }
.status-chip svg { width: 17px; height: 17px; }
.status-chip.ok svg { color: var(--in); } .status-chip.bad svg { color: var(--out); } .status-chip.warn svg { color: var(--warn); }
.status-chip small { color: var(--muted); font-size: 12px; }
.qr { display: grid; grid-template-columns: repeat(21, 1fr); width: 120px; height: 120px; background: #fff; padding: 6px; border-radius: 8px; }
.qr i { display: block; } .qr i.on { background: #14281f; }

/* empty states */
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-2); }
.empty-state .empty-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty-state h3 { font-size: 16px; color: var(--text); }
.empty-mini { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 12px; color: var(--muted); text-align: center; }
.empty-mini span { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.empty-mini b { color: var(--text-2); font-size: 14px; }
.empty-mini small { font-size: 12.5px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); border-bottom: 2.5px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; } .tab-panel.active { display: block; }

/* ---------------------------------------------------------------- Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 30, 23, .45); z-index: 100; display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .18s; overflow-y: auto; }
.modal-backdrop.show { opacity: 1; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); transform: translateY(10px); transition: transform .18s; max-height: calc(100vh - 40px); display: flex; flex-direction: column; min-width: 0; }
.modal-backdrop.show .modal { transform: none; }
.modal.sm { max-width: 420px; } .modal.lg { max-width: 720px; } .modal.xl { max-width: 960px; }
.modal.t-income { border-top: 4px solid var(--in); } .modal.t-expense { border-top: 4px solid var(--out); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border-2); }
.modal-head h3 { font-size: 17px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.modal-head h3 svg { color: var(--brand); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-body .form-actions { position: sticky; bottom: -18px; background: #fff; padding: 12px 0 2px; margin-bottom: -2px; }
.modal-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border-2); flex-wrap: wrap; }
.success-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--in-soft); color: var(--in); display: grid; place-items: center; margin: 0 auto 14px; }
.success-mark svg { width: 32px; height: 32px; }

/* ---------------------------------------------------------------- Toast */
.toast-wrap { position: fixed; bottom: 22px; left: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: #14281f; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; line-height: 1.6; animation: tIn .22s ease; }
.toast small { opacity: .8; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: .25s; }
.t-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--in); }
.t-icon svg { width: 15px; height: 15px; }
.toast.error .t-icon { background: var(--out); } .toast.warning .t-icon { background: #d39e00; } .toast.info .t-icon { background: var(--bal); }
@keyframes tIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Tab bar (phone-first roles: viewer, field) */
.tabbar { display: none; }

/* ---------------------------------------------------------------- Print (statement & reports) */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .sidebar, .sidebar-overlay, .topbar-app, .app-foot, .tabbar, .toast-wrap, .no-print, .filters, .filter-actions, .actions-bar, .page-actions, .row-actions, .actions-cell, .pagination, .btn { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .print-only { display: block !important; }
  .print-head { display: flex !important; justify-content: space-between; align-items: center; border-bottom: 2px solid #1e8049; padding-bottom: 8px; margin-bottom: 12px; }
  .table th, .table td { padding: 5px 8px; font-size: 11px; }
  .table th:last-child.act, .table td:last-child.act { display: none; }
  .table-wrap { overflow: visible; }
  .kpi { box-shadow: none; padding: 10px; }
  .kpi-ic { display: none; }
  .kpi-body b { font-size: clamp(13px, 11cqi, 16px); }
  .amt-in { color: #1e8049 !important; } .amt-out { color: #dc3545 !important; }
  a { color: inherit; }
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1280px) {
  .kpi-grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-body b { font-size: clamp(15px, 11cqi, 22px); }
}
@media (max-width: 1100px) {
  .sidebar { transform: translateX(100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(10, 25, 18, .4); z-index: 35; }
  .main { margin-inline-start: 0; }
  .menu-toggle { display: inline-grid; }
  .grid-main, .grid-side { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-btn .meta { display: none; }
  .user-btn { padding: 3px; }
  .user-btn > svg { display: none; }
}
@media (max-width: 860px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > div:nth-child(3) { border-inline-start: 0; }
  .stat-strip > div:nth-child(n+3) { border-top: 1px solid var(--border-2); }
  .top-search { display: none; }
}
@media (max-width: 720px) {
  :root { --top-h: 58px; }
  .topbar-app { padding: 0 14px; gap: 10px; }
  .page-title h1 { font-size: 18px; }
  .page-title small { display: none; }
  .hide-sm { display: none !important; }
  .content { padding: 16px; }
  .kpi { padding: 16px; }
  .kpi-ic { width: 46px; height: 46px; }
  .kpi-body b { font-size: clamp(15px, 11cqi, 21px); }
  .grid { gap: 14px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .span-2 { grid-column: 1 / -1; }
  .info-list { grid-template-columns: minmax(0, 1fr); }
  .info-list > div:nth-child(odd) { border-inline-end: 0; }
  .notif-menu { width: min(340px, calc(100vw - 24px)); }
  .dropdown-menu { position: fixed; top: calc(var(--top-h) + 6px); inset-inline-end: 12px; width: min(300px, calc(100vw - 24px)); }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { max-height: calc(100vh - 20px); border-radius: 16px 16px 12px 12px; }
  .toast-wrap { left: 12px; right: 12px; bottom: 14px; max-width: none; }
  .actions-bar .group { width: 100%; }
  .actions-bar .group .btn { flex: 1; }
  .ro-badge { display: none; }

  /* Tables → stacked cards (label / value), like the real product on phones */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tbody tr { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin: 0 0 12px; padding: 6px 14px; box-shadow: var(--shadow-sm); }
  .table-cards tbody tr:hover td { background: transparent; }
  .table-cards td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border-2); text-align: right; max-width: none !important; }
  .table-cards td:last-child { border-bottom: 0; }
  .table-cards td::before { content: attr(data-label); font-size: 12.5px; color: var(--muted); font-weight: 600; flex-shrink: 0; }
  .table-cards td[data-label=""]::before, .table-cards td:not([data-label])::before { content: none; }
  .table-cards td > * { min-width: 0; }
  .table-cards td.num { text-align: left; }
  .table-cards tr.empty-row { border: 0; box-shadow: none; padding: 0; }
  .table-cards tr.empty-row td { display: block; border: 0; }
  .table-cards tr.empty-row td::before { content: none; }
  .card .table-cards { padding: 12px 12px 0; }
  .card .table-wrap:has(.table-cards) { overflow: visible; }

  /* Bottom tab bar */
  body.has-tabbar .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 45; background: #fff; border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(20, 40, 31, .07); }
  body.has-tabbar .main { padding-bottom: 74px; }
  body.has-tabbar .toast-wrap { bottom: 86px; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; color: var(--muted); font-size: 11.5px; font-weight: 700; border-radius: 10px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--brand); }
  .tabbar a.active .tb-ic { background: var(--brand-soft); }
  .tabbar .tb-ic { width: 44px; height: 28px; border-radius: 999px; display: grid; place-items: center; }
  .tabbar a.fab .tb-ic { width: 48px; height: 48px; margin-top: -22px; background: var(--out); color: #fff; box-shadow: 0 6px 16px rgba(220, 53, 69, .35); border: 3px solid #fff; }
  .tabbar a.fab.active .tb-ic { background: var(--out); }
  .tabbar a.fab small { color: var(--out); }
}
@media (max-width: 420px) {
  .filters { grid-template-columns: minmax(0, 1fr); }
  .sync-chip span { display: none; }
  .header-actions { gap: 6px; }
  .form-actions { flex-direction: column; }
}

/* Phones: icon above the numbers so amounts get the full card width */
@media (max-width: 720px) {
  .kpi { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; }
  .kpi-ic { width: 38px; height: 38px; border-radius: 11px; }
  .kpi-ic svg { width: 20px; height: 20px; }
  .kpi-body { flex: 0 0 auto; width: 100%; }
}

/* ==========================================================================
   Ledger refinement (light polish — identity unchanged)
   Mada للعناوين والأرقام فقط · أرقام جدولية · خط سفلي ملوّن للمؤشرات
   تخطيط دفتري خفيف للجداول · مؤشر نشط أوضح في الشريط الجانبي · شريط أخضر هادئ أعلى الصفحة
   كل القواعد محصورة في body.app حتى لا تتأثر صفحة التعريف أو الدخول.
   ========================================================================== */
body.app { --font-num: "Mada", var(--font); }

/* Headings & numbers → Mada */
body.app .page-title h1,
body.app .page-head h2,
body.app .card-head h3,
body.app .modal-head h3,
body.app .brand-name { font-family: var(--font-num); font-weight: 700; letter-spacing: 0; }
body.app .brand-name small { font-family: var(--font); font-weight: 500; }
body.app .kpi-body b,
body.app .stat-strip b,
body.app .op-hero b,
body.app .amt,
body.app .table .num,
body.app .table tfoot td,
body.app .bar-row .bar-top b { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
body.app .kpi-body b, body.app .stat-strip b, body.app .op-hero b { font-weight: 700; letter-spacing: 0; }

/* Calm green strip under the page header */
body.app .topbar-app { background: linear-gradient(180deg, #fff 0%, #fbfdfc 100%); }
body.app .topbar-app::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: linear-gradient(to left, var(--side-1) 0%, var(--brand) 38%, rgba(30, 128, 73, .12) 100%); pointer-events: none; }
body.app .page-head { padding: 14px 18px; border-radius: var(--radius); background: linear-gradient(to left, var(--brand-soft) 0%, rgba(230, 243, 235, .35) 55%, rgba(230, 243, 235, 0) 100%); border-inline-start: 3px solid var(--brand); }

/* KPI: thin colored underline under the figure */
body.app .kpi { --kc: var(--brand); }
body.app .k-in { --kc: var(--in); }
body.app .k-out { --kc: var(--out); }
body.app .k-bal { --kc: var(--bal); }
body.app .k-warn { --kc: var(--warn); }
body.app .k-violet { --kc: var(--violet); }
body.app .k-slate { --kc: var(--slate); }
body.app .kpi-body b::after { content: ""; display: block; width: 30px; height: 2px; border-radius: 2px; margin-top: 6px; background: var(--kc); opacity: .75; }
body.app .kpi.sm .kpi-body b::after { width: 22px; margin-top: 4px; }
body.app .kpi-body small { letter-spacing: 0; }

/* Ledger tables: subtle striping + emphasized amount column */
body.app .table tbody tr:nth-child(even) td { background: #fafcfb; }
body.app .table tbody tr:hover td { background: #f2f8f4; }
body.app .table tr.selected td { background: #f0f8f3; }
body.app .table th.num { color: var(--text); }
body.app .table td.num { background-color: rgba(30, 128, 73, .028); box-shadow: inset 1px 0 0 var(--border-2), inset -1px 0 0 var(--border-2); }
body.app .table th.num { box-shadow: inset 1px 0 0 var(--border), inset -1px 0 0 var(--border); }
body.app .table tbody tr:nth-child(even) td.num { background-color: rgba(30, 128, 73, .045); }
body.app .table tfoot td { border-top: 2px solid var(--border); }

/* Sidebar: clearer active indicator */
body.app .nav-link { position: relative; gap: 13px; }
body.app .nav-link svg { opacity: .78; }
body.app .nav-link:hover svg, body.app .nav-link.active svg { opacity: 1; }
body.app .nav-link.active { background: rgba(255, 255, 255, .15); }
body.app .nav-link.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 9px; bottom: 9px; width: 3px; border-start-end-radius: 3px; border-end-end-radius: 3px; background: #fff; }
body.app .nav-section { display: flex; align-items: center; gap: 8px; }
body.app .nav-section::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .1); }

@media (max-width: 720px) {
  body.app .page-head { padding: 12px 14px; }
  /* stacked-card tables: no stripes / column rules inside the cards */
  body.app .table-cards tbody tr:nth-child(even) td,
  body.app .table-cards td.num { background: transparent; box-shadow: none; }
}
@media print {
  body.app .table tbody tr:nth-child(even) td, body.app .table td.num { background: transparent; box-shadow: none; }
  body.app .page-head { background: none; border: 0; padding: 0; }
}

/* ---------------------------------------------------------------- Product logo (image) */
.brand-mark.has-logo { background: #fff; border-radius: 11px; padding: 4px; box-shadow: 0 6px 16px -8px rgba(0,0,0,.45); }
.brand-mark .brand-logo { width: 100%; height: 100%; object-fit: contain; display: block; }
.app-foot .af-brand { display: inline-flex; align-items: center; gap: 6px; }
.app-foot .af-brand .brand-logo { width: 20px; height: 20px; object-fit: contain; }
/* product page + login logo */
.mk-logo { width: 46px; height: 46px; object-fit: contain; flex-shrink: 0; display: block; }
.mk-logo.sm { width: 24px; height: 24px; }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; }
