:root, [data-theme="green"] {
  --ink: #142f48;
  --muted: #5d7286;
  --line: #d3e2ee;
  --bg: #eef3f8;
  --white: #fff;
  --accent: #1a4369;
  --accent-2: #24588a;
  --teal: #1a4369;
  --teal-soft: #e4eef6;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --sky: #3b82f6;
  --sky-soft: #eff6ff;
  --soft: #e4eef6;
  --ok: #0f766e;
  --red: #ef4444;
  --rose: #fef2f2;
  --violet-soft: #f5f3ff;
  --banner-1: #1a4369;
  --banner-2: #24588a;
  --shadow: 0 1px 2px #0c3a5c0f, 0 12px 28px #0c3a5c14;
  --shadow-lg: 0 16px 36px #0c3a5c18;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 14px;
  --ease: cubic-bezier(.22, .9, .28, 1);
}
[data-theme="blue"] {
  --accent: #1e4d7b;
  --accent-2: #2f6ea5;
  --teal: #1e4d7b;
  --teal-soft: #dbeafe;
  --banner-1: #1e4d7b;
  --banner-2: #2f6ea5;
  --ok: #2563eb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Vazirmatn, Tahoma, system-ui, sans-serif;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  outline: none;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  border-color: #7fa0c9;
  box-shadow: 0 0 0 3px #dfe8f4;
}
textarea { resize: vertical; min-height: 72px; }

.logo {
  width: 42px; height: 42px;
  display: block;
  object-fit: cover;
  border-radius: 14px;
  flex: none;
  background: transparent;
}
.logo.big { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 12px; }

.btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.soft { background: var(--soft); border: 0; color: var(--accent); }
.btn.danger { color: var(--red); background: var(--rose); border: 0; }
.btn.small { padding: 7px 10px; font-size: 12px; }
.btn.block { width: 100%; display: block; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.login {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 15% 0%, #dfe8f4 0%, transparent 50%),
    radial-gradient(ellipse at 90% 100%, #e8edf4 0%, transparent 45%),
    var(--bg);
}
.login-card {
  width: min(380px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .sub { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.login-card input { margin: 0 0 10px; text-align: center; }
.err { color: var(--red); font-size: 12px; margin: 10px 0 0; }

#appView {
  max-width: 520px; width: 100%; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column; padding-bottom: 0;
  box-sizing: border-box; position: relative; overflow-x: clip;
}
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px 10px; position: sticky; top: 0; z-index: 5;
  background: #fffffff2; backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 11px; align-items: center; }
.brand h1 { font-size: 18px; margin: 0; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.wrap { padding: 12px 14px 20px; }

.heading { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 12px; gap: 10px; }
.heading h2 { font-size: 17px; margin: 0; }
.sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.title { font-size: 13px; font-weight: 700; margin: 14px 0 8px; color: var(--ink); }

.grid { display: grid; gap: 10px; }
.stats { grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
.stats.three { grid-template-columns: 1fr 1fr 1fr; }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.card-title {
  font-size: 13px; font-weight: 700; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.stat { position: relative; overflow: hidden; margin-bottom: 0; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 18px; font-weight: 800; margin: 7px 0 2px; }
.stat .unit { font-size: 11px; color: var(--muted); }
.stat-icon {
  position: absolute; left: 12px; top: 12px;
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--soft); color: var(--accent);
  display: grid; place-items: center; font-size: 13px;
}
.stat.out .stat-icon { background: var(--rose); color: var(--red); }
.positive, .pos { color: var(--ok); }
.negative, .neg { color: var(--red); }
.muted { color: var(--muted); }
.amt { font-weight: 700; white-space: nowrap; }

.voice-cta {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: right;
  border: 0; border-radius: 16px; padding: 14px 16px; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; box-shadow: 0 10px 24px #2f4f7a35;
}
.voice-cta .mic-ico {
  width: 46px; height: 46px; border-radius: 50%;
  background: #ffffff22; display: grid; place-items: center; font-size: 20px; flex: none;
}
.voice-cta b { display: block; font-size: 15px; }
.voice-cta small { display: block; opacity: .88; font-size: 11px; margin-top: 3px; line-height: 1.5; }

.banner {
  width: 100%; border: 0; background: #eef3fb; color: #3d5680;
  border-radius: 12px; padding: 11px 13px; margin-bottom: 10px; font-weight: 600; text-align: right;
}

/* Simple ledger table */
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; min-width: 360px; }
.table th {
  text-align: right; color: var(--muted); font-size: 11px; font-weight: 600;
  padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td {
  padding: 11px 6px; border-bottom: 1px solid #eef1f5; font-size: 13px; white-space: nowrap;
}
.table tr:last-child td { border-bottom: 0; }
.table button.linkish {
  border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0; text-align: right;
}
.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #eef1f5;
}
.pager .info { font-size: 11px; color: var(--muted); }

.mini-list { display: grid; gap: 0; }
.item {
  display: flex; align-items: center; gap: 10px; padding: 11px 0;
  border-bottom: 1px solid #eef1f5; background: none; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: right; color: inherit;
}
.item:last-child { border-bottom: 0; }
.item .l { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.item .l b { display: block; font-size: 13px; }
.item .l small { display: block; margin-top: 2px; }
.item.void { opacity: .45; text-decoration: line-through; }
.av {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.empty { text-align: center; color: var(--muted); padding: 22px 10px; }
.footer-note { color: var(--muted); font-size: 11px; margin-top: 8px; line-height: 1.7; }
.hint { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 8px 0; }
.notice {
  padding: 10px 12px; background: #eef3fb; color: #3d5680;
  border-radius: 11px; font-size: 12px; margin: 10px 0; line-height: 1.7;
}
.warn { color: #8a6a18; background: #fff8e8; border-radius: 10px; padding: 10px 12px; font-size: 12px; margin: 10px 0 0; }
.search, .select {
  width: 100%; margin-bottom: 10px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--white);
}
.row.gap { display: flex; gap: 8px; margin: 8px 0; }
.row.gap > * { flex: 1; }
.stack { display: grid; gap: 8px; }
.person-card { margin-bottom: 0; }
.person-top { display: flex; align-items: center; gap: 10px; }
.person-top .info { flex: 1; min-width: 0; }
.person-top .info strong { display: block; }
.metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: #f6f8fb; border-radius: 12px; padding: 10px; margin: 10px 0;
}
.metrics small { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.metrics b { font-size: 12px; }
.person-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.person-actions button { flex: 1; min-width: 70px; }
.ps-balance { font-size: 24px; font-weight: 800; margin: 4px 0 12px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.date-chip { color: var(--accent); font-weight: 700; }

.bottom-nav {
  display: flex; justify-content: space-around;
  background: #fffffff2; backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 7px 4px calc(7px + var(--safe-b)); z-index: 10;
}
.bottom-nav button {
  border: 0; background: none; color: #7a8494;
  display: grid; gap: 2px; justify-items: center; font-size: 10px; padding: 5px 6px; min-width: 52px;
}
.bottom-nav button span { font-size: 18px; }
.bottom-nav button.active { color: var(--accent); font-weight: 700; }
.bottom-nav .nav-add {
  background: var(--accent); color: #fff !important; border-radius: 16px;
  padding: 8px 12px; margin-top: -10px; box-shadow: 0 8px 18px #2f4f7a35;
}

body.sheet-open { overflow: hidden; }
.entry-back {
  position: fixed; inset: 0; z-index: 50;
  background: #1c243099; backdrop-filter: blur(5px);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.entry-sheet {
  background: #fff; width: min(520px, 100%); max-height: min(94vh, 920px);
  overflow: auto; border-radius: 24px 24px 0 0;
  padding: 10px 18px max(18px, var(--safe-b));
  box-shadow: 0 -18px 60px #1c243028;
  animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet-grip { width: 42px; height: 5px; border-radius: 9px; background: #d7dde6; margin: 0 auto 14px; }
.entry-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.entry-head h2 { font-size: 17px; margin: 0; }
.entry-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.entry-close {
  border: 0; background: #eef1f5; width: 38px; height: 38px; border-radius: 12px; font-size: 16px; flex: none;
}
.entry-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 5px; background: #eef1f5; border-radius: 14px; margin-bottom: 14px;
}
.entry-tab {
  border: 0; border-radius: 11px; background: transparent; padding: 10px 4px;
  color: #667384; font-weight: 600; font-size: 12px;
}
.entry-tab.active { background: #fff; color: var(--accent); box-shadow: 0 2px 10px #1c243012; }

.voice-stage {
  text-align: center;
  background: linear-gradient(155deg, #f5f8fc, #f8fafc);
  border: 1px solid #e4eaf2; border-radius: 20px; padding: 18px 14px 16px;
}
.voice-stage h3 { margin: 0; font-size: 16px; }
.waveform {
  height: 40px; display: flex; align-items: center; justify-content: center; gap: 4px;
  margin: 12px auto; color: #9bb0c9;
}
.waveform i { display: block; width: 4px; height: 8px; border-radius: 9px; background: currentColor; }
.entry-sheet.recording .waveform i,
.entry-sheet.processing .waveform i { animation: wave .7s ease-in-out infinite alternate; }
.entry-sheet.recording .waveform i:nth-child(3n) { animation-delay: .2s; }
.entry-sheet.recording .waveform i:nth-child(2n) { animation-delay: .4s; }
@keyframes wave { to { height: 32px; } }
.record-btn {
  width: 78px; height: 78px; border: 7px solid #dfe8f4; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 27px; box-shadow: 0 8px 18px #2f4f7a30;
}
.record-btn.recording { background: var(--red); border-color: #ffeaed; animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px #fbdfe3; } }
.record-time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); margin: 6px 0; }
.voice-stage.compact { padding: 12px 10px 10px; }
.voice-stage.compact .waveform { height: 28px; margin: 6px auto; }
.field.tight { margin: 8px 0; }
.field.tight textarea { min-height: 52px; }
.entry-sheet.voice-fit {
  max-height: min(88dvh, 720px);
  display: flex;
  flex-direction: column;
}
.entry-sheet.voice-fit #entryForm { flex: 1; min-height: 0; }
@media (max-width: 480px) {
  .entry-sheet { padding: 8px 14px max(12px, var(--safe-b)); max-height: 92dvh; }
  .entry-head { margin-bottom: 10px; }
  .entry-head h2 { font-size: 16px; }
  .entry-head p { font-size: 11px; }
  .entry-tabs { margin-bottom: 10px; }
  .record-btn { width: 64px; height: 64px; border-width: 5px; font-size: 22px; }
  .voice-stage.compact { padding: 10px 8px; }
  .entry-primary { margin-top: 8px; padding: 11px; }
}
.entry-primary { width: 100%; margin-top: 12px; padding: 12px; border-radius: 13px; }
.field { margin: 10px 0; }
.field label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 6px; }
.file-drop {
  display: block; border: 1.5px dashed #b8c7da; background: #f7f9fc;
  border-radius: 16px; padding: 22px 12px; text-align: center; color: var(--muted); cursor: pointer;
}
.file-drop strong { display: block; color: var(--ink); margin: 7px 0; }
.file-input { display: none; }
.confirm-card {
  background: #f7f9fc; border: 1px solid var(--line); padding: 14px 15px; border-radius: 16px;
}
.confirm-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; margin-bottom: 10px;
}
.confirm-head span { color: var(--accent); font-size: 12px; }
.entry-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.entry-fields .wide { grid-column: 1 / -1; }
.confirm-actions { display: flex; gap: 9px; margin-top: 12px; }
.confirm-actions button { flex: 1; }
#reviewBox .k { font-weight: 700; margin-bottom: 4px; }
#reviewBox .a { font-size: 26px; font-weight: 800; margin: 6px 0 2px; }
#reviewBox .p { margin: 8px 0; font-weight: 600; }

.tg-sheet { display: flex; flex-direction: column; max-height: min(94vh, 920px); }
.tg-chat {
  flex: 1; min-height: 260px; max-height: 46vh; overflow: auto;
  background: #e8eef5; border-radius: 16px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.tg-bubble {
  max-width: 88%; padding: 10px 12px; border-radius: 14px;
  font-size: 13px; line-height: 1.6; white-space: pre-wrap;
}
.tg-bubble.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.tg-bubble.me { align-self: flex-end; background: var(--accent); color: #fff; }
.tg-compose { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.tg-compose input { flex: 1; }
.tg-mic {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--soft); color: var(--accent); font-size: 18px; flex: none;
}
.tg-mic.recording { background: var(--rose); color: var(--red); animation: pulse 1s infinite; }

.toast {
  position: fixed; bottom: calc(90px + var(--safe-b)); left: 50%;
  transform: translateX(-50%); background: #1c2430; color: #fff;
  padding: 11px 17px; border-radius: 12px; z-index: 80;
  box-shadow: var(--shadow); max-width: 90%; text-align: center; font-size: 13px;
}

@keyframes sheetUp {
  from { transform: translateY(35px); opacity: .7; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 700px) {
  .entry-back { align-items: center; padding: 18px; }
  .entry-sheet { border-radius: 24px; max-height: 88vh; }
}
@media (max-width: 420px) {
  .entry-tab { font-size: 11px; padding: 9px 2px; }
  .entry-fields { grid-template-columns: 1fr; }
  .entry-fields .wide { grid-column: auto; }
  .stats.three { grid-template-columns: 1fr 1fr; }
  .stats.three .stat:last-child { grid-column: span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: "IBM Plex Sans Arabic", Vazirmatn, Tahoma, sans-serif;
  font-size: 15px;
}
.page-entry .entry-sheet {
  max-height: none; border-radius: 18px; border: 1px solid var(--line);
  box-shadow: var(--shadow); margin: 0; padding: 16px 16px max(16px, var(--safe-b));
}
.page-back { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0 0 10px; font-size: 13px; }
.person-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.list-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--soft); color: var(--accent);
  border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700;
}
.money-box {
  background: linear-gradient(145deg, #2f4f7a, #3a6296); color: #fff; border-radius: 16px;
  padding: 12px 14px; text-align: left; box-shadow: 0 10px 22px #2f4f7a33;
}
.money-box.loan {
  background: linear-gradient(145deg, #fff, #f7fafc); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.money-box .lbl { font-size: 11px; opacity: .85; }
.money-box .val { font-size: 18px; font-weight: 800; margin-top: 4px; }
.money-box .edit-amt {
  margin-top: 8px; border: 0; background: #ffffff33; color: inherit;
  border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700;
}
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.action-btn {
  display: flex; align-items: center; gap: 10px; text-align: right;
  border: 1px solid var(--line); background: var(--white); border-radius: 16px;
  padding: 12px; box-shadow: var(--shadow); font-weight: 700; color: var(--ink);
}
.action-btn .ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--soft); color: var(--accent); font-size: 18px; flex: none;
}
.action-btn.loan .ico { background: #fff4e8; color: #9a6700; }
.action-btn small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; margin-top: 2px; }
.seg {
  display: flex; gap: 6px; background: #eef2f7; padding: 5px; border-radius: 14px; margin-bottom: 12px;
}
.seg button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  border-radius: 11px; padding: 10px 8px; font-weight: 700; font-size: 13px;
}
.seg button.active { background: #fff; color: var(--accent); box-shadow: 0 2px 10px #1c243012; }
.status-pill {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 3px 9px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.status-pill.ok { background: #e7f6ee; color: var(--ok); }
.status-pill.bad { background: var(--rose); color: var(--red); }
.status-pill.warn { background: #fff6e0; color: #9a6700; }
.status-pill.wait { background: #eef2f6; color: #5c6b80; }
.status-pill.none { background: #f3f5f8; color: var(--muted); }
.home-cta { display: flex; gap: 8px; margin: 12px 0; }
.home-cta .btn { flex: 1; }
.tx-line { display: block; color: var(--accent); font-weight: 600; background: none; border: 0; padding: 0; text-align: right; }
.side-debt { color: var(--red); font-weight: 700; }
.side-cred { color: var(--ok); font-weight: 700; }
#appView {
  max-width: 520px; width: 100%; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 100% 0%, #dfe8f4 0%, transparent 42%), var(--bg);
  padding-bottom: 0; box-sizing: border-box; overflow-x: clip;
}
.wrap { flex: 1; display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; min-height: 0; }
.bottom-nav {
  position: sticky; bottom: 0; left: auto; right: auto;
  width: 100%; max-width: none; margin: 0; transform: none;
  flex-shrink: 0; box-sizing: border-box;
}
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:active { background: #f4f7fb; }
.detail-grid { display: grid; gap: 8px; }
.detail-grid .row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.detail-grid .row:last-child { border-bottom: 0; }
.detail-grid .row span { color: var(--muted); }
.detail-grid .row b { font-weight: 700; text-align: left; }
.writer-only[hidden] { display: none !important; }
button.linkish, .linkish { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0; cursor: pointer; }
.card.hero-card { overflow: hidden; padding: 0; }
.card-head {
  background: linear-gradient(120deg, #2f4f7a, #456892); color: #fff; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.card-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.card-head .sub { color: #d7e3f2; margin: 0; }
.card-body { padding: 14px; }
.count-strip {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow);
}
.count-strip .ico {
  width: 46px; height: 46px; border-radius: 14px; background: var(--soft); color: var(--accent);
  display: grid; place-items: center; font-size: 22px;
}
.count-strip .val { font-size: 26px; font-weight: 800; line-height: 1; }
.count-strip .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }
.person-top { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.person-top .name-box {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
}
.person-top .name-box h1 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.25; }
.person-top .money-box { min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.person-top .money-box .val { font-size: 22px; }
.person-actions-bottom {
  position: sticky; bottom: calc(72px + var(--safe-b));
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 12px;
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
}
.tx-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.tx-row:last-child { border-bottom: 0; }
.tx-actions { display: flex; gap: 6px; flex: none; }
.tx-actions .btn { padding: 5px 8px; font-size: 11px; }
.modal-root {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
}
.modal-back { position: absolute; inset: 0; background: #1c243099; backdrop-filter: blur(4px); }
.modal-card {
  position: relative; z-index: 1; width: min(400px, 100%); background: #fff;
  border-radius: 18px; padding: 16px 14px;
  box-shadow: 0 16px 48px #1c243035; max-height: min(88dvh, 720px); overflow: auto;
}
.suggest {
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  margin-top: 6px; max-height: 160px; overflow: auto;
}
.suggest button {
  display: block; width: 100%; text-align: right; border: 0; background: none;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover { background: var(--soft); }
.report-hero {
  background: linear-gradient(125deg, #243b5c, #3a6296); color: #fff; border-radius: 18px;
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.report-hero h2 { margin: 0 0 4px; font-size: 20px; }
.report-hero p { margin: 0; opacity: .88; font-size: 13px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.report-tile {
  border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 14px;
  text-align: right; box-shadow: var(--shadow); font-weight: 700;
}
.report-tile.active { border-color: var(--accent); background: var(--soft); color: var(--accent); }
.report-tile small { display: block; color: var(--muted); font-weight: 500; margin-top: 4px; }
.month-chip {
  display: inline-flex; flex-direction: column; gap: 4px; min-width: 84px; padding: 8px;
  border-radius: 12px; background: #f7f9fc; border: 1px solid var(--line); text-align: center;
}
.month-chip .m { font-size: 11px; color: var(--muted); }
.person-month-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
@media (max-width: 520px) {
  .person-top { grid-template-columns: 1fr 1fr; }
  .person-top .name-box { grid-column: 1 / -1; }
}

/* —— v16 visual system —— */
body {
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, #cfe4f7 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 0% 0%, #d4f0ea 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, #ffe8c8 0%, transparent 45%),
    var(--bg);
}
#appView {
  background: transparent;
  max-width: 520px;
}
.screen-in {
  animation: screenIn .38s var(--ease) both;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.logo {
  background: linear-gradient(145deg, #1e4d7b, #0f8a7a);
  box-shadow: 0 8px 18px #1e4d7b33;
}
.btn {
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, #1e4d7b, #2a6ea8);
  border: 0;
  box-shadow: 0 8px 18px #1e4d7b30;
}
.btn.primary.glow { box-shadow: 0 10px 24px #1e4d7b40; }
.btn.soft { background: var(--sky-soft); color: var(--sky); }
.btn.danger { background: var(--rose); color: var(--red); }
.card {
  border: 1px solid #ffffffaa;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.card.lift:hover { box-shadow: var(--shadow-lg); }
.card-head {
  background: linear-gradient(120deg, #163a5f 0%, #1e4d7b 55%, #1a7a6e 140%);
  position: relative;
  overflow: hidden;
}
.card-head::after {
  content: "";
  position: absolute; inset: auto -20% -60% auto; width: 140px; height: 140px;
  background: radial-gradient(circle, #ffffff28, transparent 70%);
  pointer-events: none;
}
.card-head.tint-teal { background: linear-gradient(120deg, #0f5f56, #0f8a7a 60%, #2a7fc4); }
.card-head.tint-navy { background: linear-gradient(120deg, #163a5f, #1e4d7b 55%, #2a7fc4); }
.head-badge {
  background: #ffffff22; border: 1px solid #ffffff33; border-radius: 999px;
  padding: 5px 10px; font-size: 12px; font-weight: 700;
}
.eyebrow {
  margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: var(--teal); text-transform: none;
}
.eyebrow.light { color: #b7e8df; }

.home-hero {
  display: grid; gap: 12px;
  background: linear-gradient(135deg, #163a5f, #1e5a8a 50%, #12786a);
  color: #fff; border-radius: 22px; padding: 16px;
  box-shadow: 0 16px 36px #163a5f33; position: relative; overflow: hidden;
}
.home-hero::before {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: #ffffff14; left: -40px; top: -60px;
}
.home-hero-text { position: relative; z-index: 1; }
.home-hero h2 { margin: 0; font-size: 22px; font-weight: 800; }
.home-hero .sub { color: #d7e8f5; margin: 4px 0 0; }
.home-kpi {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.kpi {
  background: #ffffff18; border: 1px solid #ffffff22; border-radius: 14px;
  padding: 10px 8px; text-align: center; backdrop-filter: blur(4px);
}
.kpi .k { display: block; font-size: 20px; font-weight: 800; line-height: 1.1; }
.kpi small { color: #d7e8f5; font-size: 11px; }
.kpi.k-debt .k { color: #ffd0d6; }
.kpi.k-ok .k { color: #b8f5d8; }
.kpi.k-people .k { color: #fff; }

.search-wrap { position: relative; margin-bottom: 10px; }
.search-wrap .search { margin: 0; padding-right: 38px; background: #f7fafc; border-color: #d5e0ec; }
.search-wrap .search:focus { background: #fff; }
.search-ico {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: #7e91a8; font-size: 16px; pointer-events: none;
}

.people-list { display: grid; gap: 8px; }
.people-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  width: 100%; text-align: right; border: 1px solid #e7eef6; background: #fbfcfe;
  border-radius: 16px; padding: 11px 12px; color: inherit;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.people-row:hover {
  background: #fff; border-color: #c9dbeb; box-shadow: 0 8px 20px #1e4d7b12;
  transform: translateY(-1px);
}
.people-row:active { transform: scale(.99); }
.people-meta { min-width: 0; }
.people-meta b { display: block; font-size: 14px; font-weight: 700; }
.people-meta small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.people-side { font-size: 12px; white-space: nowrap; }
.av {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none;
  color: #fff;
}
.av.tone-a { background: linear-gradient(145deg, #1e4d7b, #2a7fc4); }
.av.tone-b { background: linear-gradient(145deg, #0f8a7a, #2bb3a0); }
.av.tone-c { background: linear-gradient(145deg, #c47a12, #e0a03a); }
.av.tone-d { background: linear-gradient(145deg, #b8456a, #d86a8c); }
.av.tone-e { background: linear-gradient(145deg, #4b5f9a, #7084c4); }
.list-chip.mini { padding: 2px 8px; font-size: 10px; background: var(--sky-soft); color: var(--sky); }
.list-chip { background: var(--teal-soft); color: var(--teal); }
.name-row { display: flex; align-items: center; gap: 10px; }
.name-row .av { width: 44px; height: 44px; }

.home-cta .btn { padding: 12px 14px; border-radius: 14px; font-weight: 700; }

.person-top .name-box {
  background: linear-gradient(180deg, #fff, #f4f9fd);
  border: 1px solid #e0ebf5;
}
.money-box {
  background: linear-gradient(145deg, #1e4d7b, #2a7fc4);
  box-shadow: 0 12px 26px #1e4d7b30;
}
.money-box.loan {
  background: linear-gradient(145deg, #fff, #fff8ef);
  border-color: #f0e0c4;
}
.money-box.loan.is-debt {
  background: linear-gradient(145deg, #fff5f6, #ffe8eb);
  border-color: #f3c4cb;
}
.money-box.loan.is-cred {
  background: linear-gradient(145deg, #f2fbf7, #e6f7f0);
  border-color: #bfe8d4;
}
.action-btn {
  transition: transform .15s var(--ease), box-shadow .2s;
  border: 0; background: #fff;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.action-btn .ico {
  background: linear-gradient(145deg, var(--sky-soft), #dceeff); color: var(--sky);
}
.action-btn.loan .ico {
  background: linear-gradient(145deg, var(--amber-soft), #ffe8b8); color: var(--amber);
}

.report-hero {
  background: linear-gradient(125deg, #122033, #1e4d7b 55%, #0f6e64);
  border-radius: 20px; padding: 14px 16px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
  position: relative; overflow: hidden;
}
.report-hero.compact { min-height: 78px; }
.report-hero h2 { margin: 0; font-size: 18px; }
.report-hero p { margin: 2px 0 0; opacity: .88; font-size: 12px; }
.report-orb {
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7ed9c8, #2a7fc466 55%, transparent 70%);
  filter: blur(0); animation: orbFloat 4s ease-in-out infinite;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0); opacity: .9; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.report-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px;
  -webkit-overflow-scrolling: touch;
}
.rtab {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 700;
  transition: all .18s var(--ease);
}
.rtab:hover { transform: translateY(-1px); }
.rtab.active { color: #fff; border-color: transparent; box-shadow: 0 6px 14px #12203318; }
.rtab.c1.active { background: linear-gradient(135deg, #1e4d7b, #2a7fc4); }
.rtab.c2.active { background: linear-gradient(135deg, #0f8a7a, #2bb3a0); }
.rtab.c3.active { background: linear-gradient(135deg, #c47a12, #e0a03a); }
.rtab.c4.active { background: linear-gradient(135deg, #b8456a, #d86a8c); }
.report-person {
  background: #f8fafc; border: 1px solid #e7eef6; border-radius: 16px;
  padding: 12px; margin: 0;
  transition: border-color .2s, box-shadow .2s;
}
.report-person:hover { border-color: #c9dbeb; box-shadow: 0 8px 18px #1e4d7b10; }
.stack-gap { display: grid; gap: 10px; }
.month-chip {
  background: #fff; min-width: 88px;
  transition: transform .15s var(--ease);
}
.month-chip:hover { transform: translateY(-2px); }
.month-chip.st-paid { background: #eefaf4; border-color: #bfe8d4; }
.month-chip.st-waiting { background: var(--sky-soft); border-color: #c5dff3; }
.month-chip.st-short, .month-chip.st-unpaid { background: var(--rose); border-color: #f3c4cb; }
.month-chip.st-over { background: var(--amber-soft); border-color: #f0d39a; }

.status-pill.ok { background: #d9f5e8; color: var(--ok); }
.status-pill.bad { background: #fde3e7; color: var(--red); }
.status-pill.warn { background: #ffe9c2; color: #9a5b00; }
.status-pill.wait { background: #dceeff; color: #1d5f96; }

.bottom-nav {
  background: #ffffffd8; border-top: 1px solid #dbe5f0;
  box-shadow: 0 -8px 24px #1220330a;
}
.bottom-nav button.active { color: var(--teal); }
.bottom-nav .nav-add {
  background: linear-gradient(145deg, #1e4d7b, #0f8a7a);
  box-shadow: 0 10px 22px #1e4d7b40;
  animation: fabPulse 2.8s ease-in-out infinite;
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 10px 22px #1e4d7b40; }
  50% { box-shadow: 0 12px 28px #0f8a7a55; }
}
.top {
  background: #ffffffd0;
  border-bottom: 1px solid #dbe5f0;
}
.toast {
  border-radius: 14px; padding: 12px 18px; font-weight: 600;
  animation: toastIn .28s var(--ease);
  box-shadow: 0 12px 30px #12203330;
}
.toast.toast-ok { background: linear-gradient(135deg, #163a5f, #0f8a7a); }
.toast.toast-err { background: linear-gradient(135deg, #8f2f3a, #c23b4a); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.entry-tabs { background: #e7eef6; }
.entry-tab.active { color: var(--teal); }
.modal-card {
  animation: sheetUp .3s var(--ease);
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #1e4d7b, #0f8a7a, #c47a12) 1;
}
.login {
  background:
    radial-gradient(ellipse at 20% 0%, #cfe4f7 0%, transparent 50%),
    radial-gradient(ellipse at 90% 100%, #c8efe6 0%, transparent 45%),
    var(--bg);
}
.login-card {
  border: 1px solid #ffffffcc;
  box-shadow: var(--shadow-lg);
  animation: screenIn .45s var(--ease);
}
.spread { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  .screen-in, .report-orb, .bottom-nav .nav-add, .toast { animation: none !important; }
}
/* —— v17 —— */
.mini-strip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; box-shadow: var(--shadow); margin-bottom: 4px; font-size: 13px;
}
.mini-strip-label { color: var(--muted); font-weight: 600; }
.mini-strip strong { font-size: 16px; font-weight: 800; color: var(--accent); }
.home-hero { display: none !important; }
.data-table tbody tr { transition: background .15s var(--ease); }
.data-table tbody tr:hover, .data-table tbody tr:active { background: #eef6ff; }
.table th { font-size: 11px; }
.person-top.compact { grid-template-columns: 1.4fr .9fr; gap: 10px; align-items: stretch; }
.person-top.compact .name-box { padding: 14px; }
.person-top.compact .name-box h1 { font-size: 22px; text-align: center; }
.money-stack { display: grid; gap: 8px; }
.money-box.soft-box {
  background: linear-gradient(180deg, #f7fafc, #eef4fa); color: var(--ink);
  border: 1px solid #d7e3ef; box-shadow: none; text-align: center; padding: 10px 12px;
}
.money-box.soft-box .lbl { font-size: 12px; font-weight: 700; opacity: 1; color: var(--muted); text-align: center; }
.money-box.soft-box .val { font-size: 18px; text-align: center; margin-top: 2px; }
.money-box.soft-box.loan { background: linear-gradient(180deg, #fffaf2, #fff3e0); border-color: #f0d9a8; }
.money-box.soft-box .edit-amt { background: #dfeaf5; color: var(--accent); margin: 8px auto 0; display: inline-block; }
.name-actions { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.year-pager { display: inline-flex; align-items: center; gap: 6px; }
.action-btn { justify-content: center; text-align: center; flex-direction: column; gap: 6px; padding: 14px 10px; }
.action-btn .txt { display: block; }
.action-btn small { text-align: center; }
.action-btn.pay { background: linear-gradient(180deg, #eef6ff, #e3f0fc); border: 1px solid #c5dbf0; }
.action-btn.pay .ico { background: #2a7fc4; color: #fff; margin: 0 auto; }
.action-btn.loan { background: linear-gradient(180deg, #fff8ec, #ffefd2); border: 1px solid #f0d39a; }
.action-btn.loan .ico { margin: 0 auto; }
.page-entry { width: 100%; max-width: none; }
.page-entry .entry-sheet.entry-full {
  width: 100%; max-width: none; margin: 0; border-radius: 16px; padding: 14px;
}
.entry-head { flex-direction: column; align-items: stretch; gap: 4px; }
.entry-title h2 { font-size: 18px; margin: 0; text-align: center; }
.entry-title p { text-align: center; margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.entry-tabs { gap: 4px; }
.entry-tab { font-size: 12px; padding: 9px 4px; }
.report-bar {
  background: linear-gradient(120deg, #163a5f, #1e5a8a 60%, #12786a);
  color: #fff; border-radius: 16px; padding: 10px 12px 12px; margin-bottom: 10px;
  box-shadow: 0 10px 24px #163a5f28;
}
.report-bar-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.report-bar h2 { margin: 0; font-size: 16px; }
.report-bar .year-pager b { color: #fff; }
.report-bar .btn.soft { background: #ffffff22; color: #fff; }
.report-tabs.in-header { padding: 0; gap: 5px; }
.report-tabs.in-header .rtab {
  background: #ffffff18; border-color: #ffffff28; color: #e8f2fa; padding: 6px 10px; font-size: 11px;
}
.report-tabs.in-header .rtab.active { color: #fff; }
.rtab.c0.active { background: linear-gradient(135deg, #0f8a7a, #2bb3a0); }
.rtab.c5.active { background: linear-gradient(135deg, #4b5f9a, #7084c4); }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ov-grid.row4 { grid-template-columns: repeat(4, 1fr); }
.ov-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  box-shadow: var(--shadow);
}
.ov-card small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.ov-card b { font-size: 18px; font-weight: 800; }
.ov-card.c-pay { border-top: 3px solid #2a7fc4; }
.ov-card.c-loan { border-top: 3px solid #c47a12; }
.ov-card.c-cover { border-top: 3px solid #0f8a7a; }
.ov-card.c-n { border-top: 3px solid #6a7585; }
.matrix-wrap { overflow: auto; max-width: 100%; }
.matrix th, .matrix td { text-align: center; font-size: 11px; padding: 8px 6px; min-width: 42px; }
.matrix .sticky-col {
  position: sticky; right: 0; background: #fff; z-index: 1; text-align: right; min-width: 96px;
}
.matrix tbody tr:hover .sticky-col { background: #eef6ff; }
.mcell.st-paid { background: #e8f8ef; color: var(--ok); font-weight: 700; }
.mcell.st-short, .mcell.st-unpaid { background: #fdecef; color: var(--red); }
.mcell.st-over { background: #fff4e0; color: #9a5b00; }
.mcell.st-waiting { background: #e8f3fc; color: #1d5f96; }
@media (max-width: 520px) {
  .person-top.compact { grid-template-columns: 1fr; }
  .ov-grid { grid-template-columns: 1fr 1fr; }
}
/* —— v18 readable tables + short bands —— */
.card-head { padding: 8px 14px; }
.card-head h2, .band h2, .report-bar h2 { font-size: 17px; font-weight: 800; }
.band, .entry-head.band, .report-bar {
  background: linear-gradient(120deg, #163a5f 0%, #1e4d7b 58%, #12786a 140%);
  color: #fff;
  border-radius: 16px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  box-shadow: 0 8px 18px #163a5f28;
  margin-bottom: 10px;
}
.band h2, .entry-head.band h2, .report-bar h2 { margin: 0; color: #fff; }
.band p, .entry-head.band p, .report-bar p { margin: 2px 0 0; color: #d5e6f4; font-size: 12px; }
.band-back, .entry-head.band .page-back {
  border: 0; background: #ffffff24; color: #fff; border-radius: 10px;
  padding: 6px 10px; font-weight: 700; font-size: 12px;
}
.entry-title, .band-title { flex: 1; }
.entry-head.band { flex-direction: row; align-items: center; }
.entry-head.band .entry-title h2, .entry-head.band .entry-title p { text-align: right; color: #fff; }
.report-bar { flex-direction: column; align-items: stretch; padding: 8px 10px 10px; }
.report-tabs.in-header { justify-content: center; flex-wrap: wrap; gap: 6px; }
.report-tabs.in-header .rtab { padding: 8px 12px; font-size: 13px; font-weight: 800; }
.table th { font-size: 13px; font-weight: 800; padding: 12px 8px; }
.table td { font-size: 14px; font-weight: 650; padding: 13px 8px; }
.table .amt { font-size: 16px; font-weight: 800; }
.row-no { color: #5f6f84; font-weight: 800; text-align: center; width: 36px; }
.data-table tbody tr:hover { background: #e7f2ff; }
.monthly-hot {
  background: linear-gradient(145deg, #1e4d7b, #2a7fc4) !important;
  color: #fff !important; border: 0 !important;
}
.monthly-hot .lbl { color: #d7e8f5 !important; }
.monthly-hot .val { color: #fff; font-size: 22px !important; }
.monthly-hot .edit-amt { background: #ffffff33 !important; color: #fff !important; }
.bottom-nav.nav-5 { display: grid; grid-template-columns: repeat(5, 1fr); justify-content: stretch; }
.bottom-nav.nav-5 button { min-width: 0; font-size: 10px; }
.ov-card.c-extra { border-top: 3px solid #6a4cc2; }
.ov-grid { grid-template-columns: 1fr 1fr; }
.year-pager.light b, .report-bar .year-pager b { color: #fff; }
.matrix th, .matrix td { font-size: 13px; padding: 10px 7px; min-width: 52px; }
/* —— v19 mock-inspired polish —— */
body {
  background: #e2e8f0;
  font-family: Vazirmatn, Tahoma, sans-serif;
}
#appView {
  max-width: 28rem;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 25px 50px #0f172a22;
}
.top {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  box-shadow: 0 1px 2px #0f172a08;
}
.brand h1 { font-size: 17px; font-weight: 800; color: var(--ink); }
.brand p { color: var(--muted); }
img.logo {
  background: transparent;
  box-shadow: none;
  border-radius: 12px;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  box-shadow: 0 8px 18px #0f766e33;
}
.btn.outline {
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn.settle {
  background: #10b981;
  border: 0;
  color: #fff;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  font-weight: 800;
}
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 999px;
  background: var(--soft); color: var(--muted);
  display: grid; place-items: center; font-size: 16px;
}
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.kpi-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 8px; text-align: center; box-shadow: var(--shadow);
}
.kpi-card small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.kpi-card b { font-size: 15px; font-weight: 800; color: var(--ink); }
.kpi-card.warn b { color: #e11d48; }
.kpi-card.ok b { color: #059669; }
.card.clean {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 0; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 10px;
}
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--line);
}
.section-head h2 { margin: 0; font-size: 13px; font-weight: 800; color: #334155; }
.page-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.page-bar.soft .page-bar-text h2 { font-size: 17px; font-weight: 800; margin: 0; }
.page-bar.soft .page-bar-text p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.page-bar-text { flex: 1; min-width: 0; }
.person-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.money-box.monthly-hot {
  background: linear-gradient(145deg, #0f766e, #115e59) !important;
  color: #fff !important; border: 0 !important; border-radius: 14px;
  padding: 14px; box-shadow: 0 10px 22px #0f766e33;
}
.money-box.soft-box.loan {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  box-shadow: var(--shadow); text-align: right;
}
.money-box.soft-box.loan .val { color: #e11d48; font-size: 20px; font-weight: 800; }
.money-box .lbl { font-size: 11px; margin-bottom: 4px; }
.report-tabs.pills {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px;
}
.report-tabs.pills .rtab {
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  border-radius: 10px; padding: 8px 12px; font-size: 12px; font-weight: 800;
}
.report-tabs.pills .rtab.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 12px #0f766e33;
}
.bottom-nav {
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px #0f172a0d;
  padding-top: 6px;
  position: sticky !important;
  bottom: 0 !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  transform: none !important;
  flex-shrink: 0;
  box-sizing: border-box;
}
.bottom-nav button { color: #94a3b8; font-weight: 700; }
.bottom-nav button.active { color: var(--accent); }
.bottom-nav .nav-ico { font-size: 18px; line-height: 1; }
.bottom-nav .nav-add {
  width: 52px; height: 52px; border-radius: 999px; margin-top: -18px;
  background: linear-gradient(145deg, #0f766e, #115e59);
  color: #fff !important; border: 4px solid #f8fafc;
  box-shadow: 0 10px 22px #0f766e55;
  display: grid; place-items: center; font-size: 22px; padding: 0;
  animation: none;
}
.bottom-nav .nav-add span { font-size: 22px; }
.table thead { background: #f8fafc; }
.table th { color: #64748b; font-weight: 700; }
.table td { border-bottom-color: #f1f5f9; }
.search-wrap .search { background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.report-bar, .band, .home-hero, .mini-strip { display: none !important; }
.card.hero-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; padding: 0; }
.card.hero-card .card-body { padding: 0; }
.status-pill.ok { background: #d1fae5; color: #047857; }
.status-pill.warn { background: #fef3c7; color: #b45309; }
.status-pill.bad { background: #fee2e2; color: #b91c1c; }
.status-pill.wait { background: #e0f2fe; color: #0369a1; }
.list-chip.mini { background: #eff6ff; color: #2563eb; }
.toast.toast-ok { background: #059669; }
.toast.toast-err { background: #dc2626; }
.entry-bar { margin-bottom: 12px; }
.page-entry .entry-sheet.entry-full {
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  background: #fff; padding: 14px;
}

/* —— اشخاص / جداول / شخص —— */
.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pill-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 28%, transparent);
}
.pill-btn.soft {
  background: var(--teal-soft);
  color: var(--accent);
  box-shadow: none;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #fff);
}
.people-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--banner-1), var(--banner-2));
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}
.people-banner h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.people-banner .sub {
  margin: 2px 0 0;
  color: #ccfbf1;
  font-size: 11px;
}
.people-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  background: #ffffff22;
}
.people-count span {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.people-count small {
  font-size: 11px;
  opacity: .9;
}
.grid-table,
.people-grid {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}
.grid-table th,
.grid-table td,
.people-grid th,
.people-grid td {
  text-align: center;
  vertical-align: middle;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid #e2e8f0;
  font-size: 13px;
}
.grid-table th:last-child,
.grid-table td:last-child,
.people-grid th:last-child,
.people-grid td:last-child { border-left: 0; }
.grid-table thead th,
.people-grid thead th {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.grid-table tbody td b,
.people-grid tbody td b { font-weight: 700; }
.people-grid .list-chip.mini {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 800;
}
.grid-table .amt, .people-grid .amt { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; }
.grid-table .tx-ops {
  display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; white-space: nowrap;
}
.grid-table .tx-ops .btn { padding: 4px 7px; font-size: 10px; font-weight: 700; }
.type-chip {
  display: inline-block; padding: 3px 8px; border-radius: 8px;
  font-size: 10px; font-weight: 800; white-space: nowrap;
}
.type-chip.pay { background: #e0f2fe; color: #0369a1; }
.type-chip.loan { background: #d1fae5; color: #047857; }
.type-chip.cover { background: #ffe4e6; color: #be123c; }
.type-chip.extra { background: #fef3c7; color: #b45309; }
.nav-ico.nav-people {
  display: grid;
  place-items: center;
  line-height: 0;
}
.nav-ico.nav-people svg { display: block; }

.amt.loan-pos, .loan-pos .val, td.loan-pos, .stat-tile.loan-pos .val { color: #059669 !important; }
.amt.loan-neg, .loan-neg .val, td.loan-neg, .stat-tile.loan-neg .val { color: #e11d48 !important; }
.amt.loan-soft { color: #f87171 !important; font-weight: 700; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 800; color: #1e293b; }
.modal-form .title { margin-top: 10px; }
.modal-form .btn.block { margin-top: 14px; }
.modal-form .btn.soft.block { margin-top: 8px; }

.person-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
  align-items: stretch;
}
.person-profile {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.person-profile-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.person-profile .av {
  width: 48px; height: 48px; border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #fff;
  background: #2563eb; flex: none;
}
.person-profile-main { flex: 1; min-width: 0; text-align: right; }
.person-profile-main h2 {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
}
.person-profile-main .list-chip {
  display: inline-block;
  margin-top: 8px;
}
.person-actions {
  display: grid;
  gap: 6px;
  margin-top: auto;
}
.person-actions.three { grid-template-columns: repeat(3, 1fr); }
.person-actions.two { grid-template-columns: 1fr 1fr; }
.person-actions .pact {
  border: 0;
  border-radius: 10px;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.person-actions .pact.edit {
  background: #ecfdf5;
  color: #0f766e;
  border: 1px solid #99f6e4;
}
.person-actions .pact.del {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.person-actions .pact.settle {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.warn-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  margin: 8px 0 4px;
}
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.user-row.off { opacity: 0.55; }
.user-row .sub { display: block; margin-top: 2px; font-size: 12px; }
.user-ops { display: flex; gap: 6px; flex: none; }
.person-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}
.stat-tile {
  position: relative;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 2px;
  min-height: 52px;
}
.stat-tile.compact {
  min-height: 48px;
  padding: 7px 10px 8px;
  gap: 6px;
}
.stat-tile .lbl {
  font-size: 12px; font-weight: 800; opacity: .95; letter-spacing: -0.01em;
}
.stat-tile .val {
  font-size: 18px; font-weight: 800; line-height: 1.1;
}
.stat-tile.teal {
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2));
  color: #fff;
}
.stat-tile.cream {
  background: #fffaf0;
  border: 1px solid #f0d9a8;
  color: var(--ink);
}
.stat-tile.cream .lbl { color: #78716c; }
.stat-tile.cream .val { color: var(--ok); }
.entry-page {
  background: transparent;
  padding: 0;
}
.entry-page .entry-tabs {
  margin-bottom: 12px;
  border-radius: 12px;
}
.entry-page .entry-primary { width: 100%; margin-top: 12px; }
.entry-review-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
}
.review-summary {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  text-align: center;
}
.review-summary .k { font-size: 13px; font-weight: 700; color: var(--muted); }
.review-summary .a { font-size: 26px; font-weight: 800; margin: 6px 0; color: var(--ink); }
.review-summary .p { font-size: 14px; font-weight: 700; margin-top: 4px; }

.report-banner.row-bar {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  min-height: 0;
}
.report-banner .rb-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  flex: none;
  white-space: nowrap;
}
.report-seg {
  display: flex;
  flex: 1;
  min-width: 0;
  background: #0b122033;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  overflow-x: auto;
}
.report-seg .rseg {
  flex: 1;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  min-width: 0;
}
.report-seg .rseg.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 8px #0f172a22;
}
.ov-grid.row4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.ov-grid.row4 .ov-card {
  padding: 14px 6px;
  border-radius: 12px;
  text-align: center;
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.ov-grid.row4 .ov-card small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
}
.ov-grid.row4 .ov-card b {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  word-break: break-word;
}
.list-cards {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
}
.list-person-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.lpc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.lpc-head b { font-size: 14px; font-weight: 800; }
.lpc-meta { font-size: 12px; font-weight: 700; color: var(--muted); }
.lpc-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.lpc-m {
  border-radius: 8px;
  padding: 5px 2px;
  text-align: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.lpc-m small {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
}
.lpc-m em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}
.lpc-m.st-paid { background: #d1fae5; border-color: #a7f3d0; }
.lpc-m.st-paid em { color: #047857; }
.lpc-m.st-short, .lpc-m.st-unpaid { background: #fee2e2; border-color: #fecaca; }
.lpc-m.st-short em, .lpc-m.st-unpaid em { color: #b91c1c; }
.lpc-m.st-over { background: #fef3c7; border-color: #fde68a; }
.lpc-m.st-over em { color: #b45309; }
.lpc-m.st-waiting { background: #e0f2fe; border-color: #bae6fd; }
.lpc-m.st-waiting em { color: #0369a1; }
.lpc-m.st-none { background: #f8fafc; }
.theme-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.theme-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 10px;
  font-weight: 800;
  font-size: 13px;
  color: var(--ink);
}
.theme-opt.active {
  border-color: var(--accent);
  background: var(--teal-soft);
  color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}
.theme-opt .swatch {
  width: 18px; height: 18px; border-radius: 999px; flex: none;
}
.theme-opt .swatch.green { background: linear-gradient(135deg, #0c3a5c, #18527e); }
.theme-opt .swatch.blue { background: linear-gradient(135deg, #1e4d7b, #2f6ea5); }
.bottom-nav .nav-add {
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2)) !important;
}
.logo {
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2)) !important;
}
.year-pager.on-dark {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ffffff22; border-radius: 999px; padding: 4px 8px;
}
.year-pager.on-dark b { color: #fff; font-size: 13px; }
.year-pager.on-dark .btn {
  background: #ffffff33; color: #fff; border: 0; min-width: 28px;
}
.stat-tile.indigo {
  background: linear-gradient(145deg, #e0e7ff, #eef2ff) !important;
  border: 1px solid #c7d2fe;
}
.stat-tile.indigo .lbl { color: #4338ca !important; }
.stat-tile.indigo .val { color: #312e81 !important; }
.entry-hero {
  background: linear-gradient(135deg, var(--banner-1), var(--banner-2));
  color: #fff;
  border-radius: 18px;
  padding: 16px 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--banner-1) 35%, transparent);
}
.entry-hero h2 { margin: 0; font-size: 22px; font-weight: 900; color: #fff; }
.entry-hero p { margin: 6px 0 0; color: #e2e8f0; font-size: 13px; font-weight: 600; }
.entry-page.voice-first .voice-stage.big {
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 14px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.voice-status {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.5;
}
.voice-fab {
  width: 96px; height: 96px;
  border-radius: 999px;
  border: 0;
  margin: 12px auto;
  display: grid; place-items: center;
  font-size: 36px;
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2));
  color: #fff;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--banner-1) 40%, transparent);
  cursor: pointer;
}
.entry-page.recording .voice-fab {
  animation: pulseMic 1.2s ease-in-out infinite;
  background: linear-gradient(145deg, #b91c1c, #dc2626);
}
@keyframes pulseMic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.voice-timer { font-size: 20px; font-weight: 900; color: var(--muted); margin: 4px 0 10px; }
.voice-stage.big textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  min-height: 84px;
  box-sizing: border-box;
}
.btn.entry-primary.big {
  min-height: 52px;
  font-size: 17px;
  font-weight: 900;
  border-radius: 14px;
}
.waveform.big { gap: 5px; height: 36px; margin: 8px 0; }
.waveform.big i { width: 5px; border-radius: 4px; }
.table.clickable tbody tr.row-open { cursor: pointer; }
.table.clickable tbody tr.row-open:active { background: #e0f2fe; }
.section-head.year-head h2 { font-size: 14px; }

/* —— v27 reports + nav —— */
.report-seg.below-banner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0 0 12px;
  padding: 6px;
  background: linear-gradient(180deg, #fff, #f1f5f9);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: visible;
  flex: none;
}
.report-seg.below-banner .rseg {
  flex: none;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 12px 6px;
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
}
.report-seg.below-banner .rseg.active {
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2));
  color: #fff;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--banner-1) 35%, transparent);
}
.ov-grid.row3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.ov-grid.row3 .ov-card.tall.pack {
  min-height: 118px;
  padding: 12px 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-top-width: 4px;
  box-shadow: 0 10px 22px #0f172a12;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.ov-pack-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e2e8f0;
}
.ov-pack-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.ov-pack-row span {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}
.ov-pack-row b {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
  word-break: break-word;
  text-align: center;
}
.ov-card.c-all { border-top-color: #334155; background: linear-gradient(180deg, #f1f5f9 0%, #fff 48%) !important; }
.ov-card.c-pay { border-top-color: #2a7fc4; }
.ov-card.c-loan { border-top-color: #c47a12; }
.ov-card.c-cover { border-top-color: #0f8a7a; }
.ov-card.c-extra { border-top-color: #6a4cc2; }
.ov-grid.row3 .ov-card.c-pay { background: linear-gradient(180deg, #eef6fc 0%, #fff 48%); }
.ov-grid.row3 .ov-card.c-cover { background: linear-gradient(180deg, #eaf8f5 0%, #fff 48%); }
.btn.is-locked,
.btn.is-locked:hover {
  opacity: 0.45;
  filter: grayscale(0.2);
  cursor: not-allowed;
}
.bottom-nav.nav-5 {
  display: grid !important;
  grid-template-columns: 1fr 1fr 56px 1fr 1fr !important;
  align-items: end;
  justify-items: center;
  gap: 0;
  padding: 8px 2px calc(8px + var(--safe-b));
}
.bottom-nav.nav-6 {
  display: grid !important;
  grid-template-columns: 1fr 1fr 52px 1fr 1fr 1fr !important;
  align-items: end;
  justify-items: center;
  gap: 0;
  padding: 8px 1px calc(8px + var(--safe-b));
}
.bottom-nav.nav-5 > button,
.bottom-nav.nav-6 > button {
  width: 100%;
  min-width: 0 !important;
  max-width: none;
  justify-items: center;
  padding: 4px 1px;
  font-size: 10px;
  box-sizing: border-box;
}
.bottom-nav.nav-6 > button { font-size: 9px; }
.bottom-nav.nav-5 > .nav-add,
.bottom-nav.nav-6 > .nav-add {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  justify-self: center;
  align-self: center;
  margin: -18px 0 0 !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center;
}
@media (max-width: 380px) {
  .person-hero { grid-template-columns: 1fr; }
  .person-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .report-seg.below-banner .rseg { font-size: 11px; padding: 10px 4px; }
  .ov-pack-row b { font-size: 12px; }
  .ov-grid.row3 { gap: 6px; }
}

/* —— کارمندان / حقوق —— */
.emp-sheet .table-wrap { overflow: hidden; }
.emp-sheet table { table-layout: fixed; width: 100%; }
.emp-sheet th, .emp-sheet td {
  font-size: 11px;
  padding: 7px 3px;
  white-space: normal;
}
.emp-act { width: 34px; padding-left: 2px !important; padding-right: 2px !important; }
.emp-act .btn {
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 26px;
  height: 26px;
  margin: 2px 0 0;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}
.emp-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}
.emp-actions .btn {
  margin: 0;
  min-height: 44px;
  font-weight: 800;
  border-radius: 14px;
}
.emp-arrears-note { margin: 0 0 12px; }
.emp-name-cell { min-width: 140px; }
.emp-name-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  text-align: right;
  cursor: pointer;
  font: inherit;
}
.emp-name-link span { display: grid; gap: 2px; min-width: 0; }
.emp-name-link b { font-size: 13px; color: var(--text); }
.emp-name-link .sub { font-size: 11px; color: var(--muted); }
.emp-name-link:hover b { color: var(--accent); }
.emp-detail-banner { flex-direction: column; align-items: stretch; gap: 10px; }
.emp-detail-top { display: flex; justify-content: space-between; gap: 8px; }
.btn.on-banner {
  background: #ffffff22;
  color: #fff;
  border: 1px solid #ffffff44;
}
.btn.on-banner:hover { background: #ffffff33; }
.emp-detail-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.emp-detail-identity .av {
  width: 48px; height: 48px; border-radius: 16px;
  background: #ffffff28; color: #fff; font-size: 18px;
}
.emp-detail-identity h2 { margin: 0; font-size: 20px; }
.pay-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 12px;
}
.pay-stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.pay-stat span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}
.pay-stat b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.pay-stat.ok b { color: #0f766e; }
.pay-stat.warn b { color: #b45309; }
.pay-row { cursor: pointer; }
.pay-row:hover { background: #eef6ff; }
.pay-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 10px;
  padding: 4px;
  background: #eef2f7;
  border-radius: 14px;
}
.pay-tab {
  border: 0;
  background: transparent;
  border-radius: 11px;
  padding: 11px 8px;
  font-weight: 800;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
}
.pay-tab.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
.pay-panel { overflow: hidden; }
.pay-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 0;
}
.pay-panel-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.pay-preview {
  min-width: 110px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, #fff), #fff);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, #fff);
}
.pay-preview small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}
.pay-preview b {
  font-size: 16px;
  color: var(--accent);
}
.pay-form { padding: 12px 14px 14px; }
.pay-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.pay-form-grid label {
  display: grid;
  gap: 5px;
  margin: 0;
}
.pay-form-grid label.wide { grid-column: 1 / -1; }
.pay-form-grid label span {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.pay-form-grid input,
.pay-form-grid select {
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  font: inherit;
}
.pay-form-grid input:focus,
.pay-form-grid select:focus {
  outline: none;
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 55%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
@media (max-width: 520px) {
  .pay-stats { grid-template-columns: 1fr 1fr; }
  .pay-form-grid { grid-template-columns: 1fr; }
  .pay-panel-head { flex-direction: column; }
  .pay-preview { width: 100%; }
}

/* v38 — هدر بلند + تب tabular مثل عکس کارفرما */
.app-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  padding: 0 0 8px;
}
.top {
  position: relative !important;
  top: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  padding: 18px 16px 22px !important;
  background: #1a4369 !important;
  border-bottom: 0 !important;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 10px 24px #1a436933 !important;
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: flex-start;
}
.brand .logo {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  background: #123552 !important;
}
.brand h1 {
  margin: 0;
  font-size: 20px !important;
  font-weight: 800;
  color: #fff !important;
  letter-spacing: -0.02em;
}
.brand p, #whoami {
  margin: 3px 0 0 !important;
  color: #d7e6f4 !important;
  opacity: 1 !important;
  font-size: 12px !important;
}
.company-switch {
  margin-inline-start: auto;
  flex: 0 0 auto;
}
.company-switch-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  color: #d7e6f4;
  font-size: 10px;
}
.company-switch select {
  width: auto;
  min-width: 110px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #ffffff44;
  background: #123552;
  color: #fff;
  font-size: 12px;
}
.top-actions { display: none !important; }

.bottom-nav,
.bottom-nav.nav-5,
.bottom-nav.nav-6,
.bottom-nav.top-tabs {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
  max-width: none !important;
  margin: 10px 12px 0 !important;
  transform: none !important;
  display: grid !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  gap: 6px !important;
  padding: 8px !important;
  background: #e4eef6 !important;
  border: 0 !important;
  border-radius: 18px !important;
  box-shadow: none !important;
  overflow: visible !important;
  z-index: 6;
}
.bottom-nav.nav-5 { grid-template-columns: repeat(5, 1fr) !important; }
.bottom-nav.nav-6 { grid-template-columns: repeat(6, 1fr) !important; }
.bottom-nav.nav-5 > button,
.bottom-nav.nav-6 > button,
.bottom-nav button,
.bottom-nav .nav-add,
.bottom-nav.nav-5 > .nav-add,
.bottom-nav.nav-6 > .nav-add {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 58px;
  margin: 0 !important;
  padding: 8px 2px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  color: #1a4369 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.15;
  box-shadow: none !important;
  animation: none !important;
  place-items: center;
  align-self: stretch;
}
.bottom-nav button em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}
.bottom-nav button.active,
.bottom-nav .nav-add.active {
  background: #1a4369 !important;
  color: #fff !important;
  box-shadow: 0 8px 16px #1a436940 !important;
}
.bottom-nav .nav-ico,
.bottom-nav .nav-add span {
  font-size: 17px !important;
  line-height: 1;
  display: grid;
  place-items: center;
}
.bottom-nav .nav-people svg {
  width: 18px;
  height: 18px;
  display: block;
}

.wrap {
  padding: 10px 12px 16px !important;
  gap: 10px !important;
}
.people-banner,
.entry-hero {
  min-height: 0 !important;
  padding: 12px 14px !important;
  margin-bottom: 8px !important;
  border-radius: 16px !important;
  background: #e4eef6 !important;
  color: #1a4369 !important;
  box-shadow: none !important;
  border: 1px solid #d3e2ee;
}
.people-banner h2,
.entry-hero h2 {
  margin: 0 !important;
  font-size: 17px !important;
  font-weight: 800;
  color: #1a4369 !important;
}
.people-banner .sub,
.entry-hero p {
  margin: 2px 0 0 !important;
  color: #3e5a72 !important;
  font-size: 12px !important;
  font-weight: 600;
}
.people-count {
  background: #fff !important;
  color: #1a4369 !important;
  padding: 4px 10px !important;
}
.people-count span { font-size: 20px !important; }
.year-pager.on-dark { background: #fff !important; }
.year-pager.on-dark b { color: #1a4369 !important; }
.year-pager.on-dark .btn {
  background: #e4eef6 !important;
  color: #1a4369 !important;
}
.btn.on-banner {
  background: #fff !important;
  color: #1a4369 !important;
  border: 1px solid #c5d6e4 !important;
}
.money-box.monthly-hot {
  background: #e4eef6 !important;
  color: #1a4369 !important;
  box-shadow: none !important;
}
.card.clean {
  border-radius: 16px !important;
  margin-bottom: 8px !important;
}
.search-wrap { margin-bottom: 8px !important; }
.search-wrap .search {
  border-radius: 14px !important;
  padding: 11px 12px 11px 36px !important;
}
.section-head { padding: 9px 12px !important; }
.section-head h2 { font-size: 13px !important; }
.footer-note {
  margin: 6px 0 0 !important;
  padding: 0 4px 8px !important;
  font-size: 11px !important;
  color: var(--muted);
}
.btn.primary { box-shadow: 0 8px 16px #1a436928 !important; }
.login {
  background:
    radial-gradient(ellipse at 20% 0%, #d5e6f3 0%, transparent 50%),
    #eef3f8 !important;
}
.entry-tabs {
  background: #e4eef6 !important;
  border-radius: 14px;
  padding: 4px;
}
.entry-tab.active {
  background: #fff !important;
  color: #1a4369 !important;
  box-shadow: 0 2px 8px #1a436918;
}
.voice-fab {
  background: #1a4369 !important;
}
@media (max-width: 380px) {
  .bottom-nav button em { font-size: 10px; }
  .bottom-nav.nav-5 > button,
  .bottom-nav.nav-6 > button { min-height: 54px; padding: 6px 1px !important; }
  .brand h1 { font-size: 18px !important; }
}