/* =========================================================
   OstadCodeX — Design tokens
   ========================================================= */
:root{
  --navy: #121a2e;
  --navy-2: #1b2745;
  --navy-3: #24325a;
  --bg: #eef1f7;
  --card: #ffffff;
  --ink: #1a2130;
  --muted: #6b7488;
  --line: #e6e9f0;
  --line-soft: #f0f2f7;
  --brand: #c9932f;
  --brand-2: #e0ac45;
  --iris: #5b6cf5;
  --tg-blue: #2aabee;
  --pos: #1f9d6b;
  --pos-bg: #e6f6ef;
  --neg: #d64550;
  --neg-bg: #fbe9ea;
  --warn: #d68a1a;
  --warn-bg: #fdf3e0;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(18,26,46,0.06);
  --shadow-md: 0 8px 24px rgba(18,26,46,0.08);
  --shadow-lg: 0 20px 48px rgba(18,26,46,0.22);
}

html[data-theme="dark"]{
  --bg: #0c1120;
  --card: #161d2f;
  --ink: #e8ecf6;
  --muted: #8f9bbd;
  --line: #283149;
  --line-soft: #1e263a;
  --pos-bg: rgba(31,157,107,0.16);
  --neg-bg: rgba(214,69,80,0.16);
  --warn-bg: rgba(214,138,26,0.16);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.55);
}
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .picker-trigger,
html[data-theme="dark"] #picker-search,
html[data-theme="dark"] .select-wrap select{ background: var(--card); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .mini-item, html[data-theme="dark"] .picker-item, html[data-theme="dark"] .report-row,
html[data-theme="dark"] .invoice-totals, html[data-theme="dark"] .dc-fields{ background: var(--line-soft); }
html[data-theme="dark"] .topbar-right{ background: var(--card); border-color: var(--line); color: var(--ink); box-shadow:none; }
html[data-theme="dark"] .topbar-right .today-date{ color: var(--ink); }
html[data-theme="dark"] .topbar-right .icon-btn{ color: var(--ink); }
html[data-theme="dark"] .topbar-right .bell-btn{ border-right-color: var(--line); }
html[data-theme="dark"] .quick-tile, html[data-theme="dark"] .data-card, html[data-theme="dark"] .card,
html[data-theme="dark"] .stat-card, html[data-theme="dark"] .modal, html[data-theme="dark"] .sheet{ background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .btn-secondary{ background: var(--card); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .btn-edit{ background: var(--line-soft); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .bottom-nav{ background: var(--card); border-color: var(--line); }
html[data-theme="dark"] th{ background: var(--line-soft); color: var(--ink); }
html[data-theme="dark"] .dc-field span{ color: var(--ink); }
html[data-theme="dark"] .branch-chip{ background: var(--line-soft); color: #b9c6dd; }

*{ box-sizing: border-box; margin: 0; padding: 0; font-family: 'Vazirmatn', 'Segoe UI', Tahoma, 'Iranian Sans', sans-serif; }
html{ -webkit-tap-highlight-color: transparent; }
body{
  background:
    radial-gradient(circle at 12% -6%, rgba(201,147,47,0.08), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(91,108,245,0.06), transparent 38%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink); overscroll-behavior-y: none; transition: background .2s, color .2s;
}
html[data-theme="dark"] body{
  background:
    radial-gradient(circle at 12% -6%, rgba(201,147,47,0.10), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(91,108,245,0.10), transparent 38%),
    var(--bg);
  background-attachment: fixed;
}
button, input, select, textarea{ font-family: inherit; }

.hidden{ display: none !important; }
.icon{ width:18px; height:18px; stroke: currentColor; fill:none; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.icon-sm{ width:15px; height:15px; }

/* =========================================================
   Lock screen
   ========================================================= */
.lock-screen{ position: fixed; inset:0; z-index: 200; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); display:flex; align-items:center; justify-content:center; padding: 20px; }
.lock-box{ background:#fff; border-radius: var(--radius-lg); padding: 32px 26px; width:100%; max-width: 340px; text-align:center; box-shadow: var(--shadow-lg); animation: fadeScaleIn .25s ease; }
.lock-logo{ width:56px; height:56px; border-radius:16px; margin:0 auto 12px; background: var(--navy); display:flex; align-items:center; justify-content:center; }
.lock-logo .icon{ width:24px; height:24px; color: var(--brand); }
.lock-box h2{ color: var(--navy); font-size:18px; margin-bottom:4px; }
.lock-box p{ color: var(--muted); font-size:12.5px; margin-bottom:20px; }
.biometric-btn{ display:flex; align-items:center; justify-content:center; gap:8px; width:100%; padding:13px; border-radius: var(--radius-sm); border:1.5px solid var(--brand); background:#fff8ec; color:#8a5a10; font-size:13.5px; font-weight:600; cursor:pointer; margin-bottom:14px; }
.lock-box input{ width:100%; text-align:center; font-size:24px; letter-spacing: 10px; padding:12px; border:1px solid var(--line); border-radius:8px; margin-bottom:12px; }
#lock-userpass-area input, #auth-form input{ font-size:15px; letter-spacing:normal; text-align:right; }
.auth-tabs{ display:flex; gap:6px; margin-bottom:18px; background:var(--line-soft); padding:4px; border-radius:11px; }
.auth-tab{ flex:1; padding:9px; border:none; background:transparent; border-radius:8px; font-size:13px; font-weight:700; color:var(--muted); cursor:pointer; transition: background .15s, color .15s; }
.auth-tab.active{ background:#fff; color:var(--navy); box-shadow: var(--shadow-sm); }
.lock-error{ color: var(--neg); font-size:12px; margin-top:10px; animation: shake .35s ease; }
@keyframes shake{ 10%,90%{transform:translateX(-1px);} 20%,80%{transform:translateX(2px);} 30%,50%,70%{transform:translateX(-4px);} 40%,60%{transform:translateX(4px);} }
.pattern-canvas{ position: relative; width: 220px; height: 220px; margin:0 auto; }
.pattern-dots{ display:grid; grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(3,1fr); width:100%; height:100%; position:relative; z-index:2; }
.pattern-dot{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; }
.pattern-dot::before{ content:''; width:18px; height:18px; border-radius:50%; border:2px solid var(--line); background:#fff; transition: all .12s; }
.pattern-dot.active::before{ background: var(--navy); border-color: var(--navy); transform: scale(1.15); }
.pattern-svg-lines{ position:absolute; inset:0; width:100%; height:100%; z-index:1; pointer-events:none; }
.pattern-svg-lines line{ stroke: var(--navy); stroke-width:3; stroke-linecap:round; }

/* =========================================================
   Layout
   ========================================================= */
.app-shell{ display: flex; min-height: 100vh; }
.sidebar{ width: 264px; flex-shrink: 0; background: linear-gradient(185deg, var(--navy) 0%, var(--navy-2) 60%, var(--navy-3) 100%); color: #dfe6f2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-head{ display:flex; align-items:center; justify-content:space-between; padding: 20px 16px 10px; }
.brand{ display:flex; align-items:center; gap:10px; }
.brand-mark{ width: 40px; height: 40px; border-radius: 12px; overflow:hidden; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #1a1200; display:flex; align-items:center; justify-content:center; font-weight: 800; font-size: 16px; box-shadow: var(--shadow-sm); }
.brand-logo-img{ width:100%; height:100%; object-fit:cover; }
.brand-mark.no-logo::after{ content:'؟'; font-size:16px; }
.brand-text{ display:flex; flex-direction:column; line-height:1.5; }
.brand-text strong{ font-size: 15px; color:#fff; letter-spacing:.3px; }
.brand-text small{ font-size: 11px; color:#9fb0c9; }
.branch-switcher{ padding: 12px 16px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.branch-switcher label{ font-size: 11px; color:#9fb0c9; display:flex; align-items:center; gap:5px; margin-bottom:7px;}
.branch-switcher select{ width:100%; padding:9px 10px; border-radius:9px; border:1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.07); color:#fff; font-size: 13px; cursor:pointer; }
.branch-switcher select option{ color:#1c2530; }
.nav-list{ display:flex; flex-direction:column; padding: 10px 10px 6px; gap:2px; flex:1; overflow-y:auto; }
.nav-item{ display:flex; align-items:center; gap:11px; background: transparent; border:none; color:#b9c6dd; padding: 11px 13px; border-radius: 10px; font-size: 13.5px; cursor:pointer; text-align:right; transition: background .15s, color .15s; }
.nav-item:hover{ background: rgba(255,255,255,0.07); color:#fff; }
.nav-item.active{ background: linear-gradient(135deg, var(--brand), var(--brand-2)); color:#1a1200; font-weight:700; box-shadow: var(--shadow-sm); }
.theme-switcher{ display:flex; gap:8px; padding:14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,0.08); }
.theme-btn{ flex:1; display:flex; align-items:center; justify-content:center; gap:6px; background: rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.1); color:#c4d0e2; padding:9px; border-radius:9px; font-size:12px; cursor:pointer; transition: background .15s, color .15s; }
.theme-btn.active{ background: linear-gradient(135deg, var(--brand), var(--brand-2)); color:#1a1200; font-weight:700; border-color:transparent; }

.main{ flex:1; min-width:0; padding: 0 0 44px; }
.offline-banner{
  position: sticky; top:0; z-index: 65; background: var(--warn); color:#3a2600;
  text-align:center; font-size:12.5px; font-weight:700; padding:9px 14px;
}
.topbar{
  display:flex; align-items:center; gap:14px; margin-bottom: 18px;
  padding: 14px 22px; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  position: sticky; top:0; z-index: 60; box-shadow: 0 4px 16px rgba(18,26,46,0.18);
}
.topbar h1{ font-size: 18px; color:#fff; flex:1; font-weight:800; letter-spacing:.2px; }
.topbar-right{ display:flex; align-items:center; gap:2px; background: rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.16); border-radius:14px; padding:4px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.today-date{ font-size:12px; color:#eaf0fb; background: transparent; border:none; padding:6px 14px; white-space:nowrap; }
.icon-btn{ background: rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.14); border-radius:12px; width:40px; height:40px; cursor:pointer; display:flex; align-items:center; justify-content:center; position:relative; color:#fff; transition: background .15s, transform .12s, box-shadow .15s; }
.icon-btn:hover{ background: rgba(255,255,255,0.16); }
.icon-btn:active{ transform: scale(.9); }
.topbar-right .icon-btn{ width:36px; height:36px; border:none; background:transparent; border-radius:10px; }
.topbar-right .icon-btn:hover{ background: rgba(255,255,255,.16); }
.topbar-right .bell-btn{ border-right:1px solid rgba(255,255,255,.16); border-radius:0; }
.bell-btn .alarm-badge{
  position:absolute; top:-4px; left:-4px; box-shadow: 0 0 0 2px var(--navy);
  min-width:17px; height:17px; font-size:9.5px; padding:0 4px;
  background: var(--neg); color:#fff; font-weight:800; border-radius:20px;
  display:flex; align-items:center; justify-content:center; line-height:1;
}
.only-mobile{ display:none; }
.page-head-row{ margin-bottom:14px; }
.view-container{ padding: 22px 28px 0; }

.view:not(.hidden){ animation: viewFadeIn .28s ease; }
@keyframes viewFadeIn{ from{opacity:0; transform: translateY(8px);} to{opacity:1; transform: translateY(0);} }

/* =========================================================
   Quick access grid
   ========================================================= */
.section-heading{ font-size:13.5px; color: var(--muted); margin: 6px 0 12px; font-weight:700; }
.quick-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap:12px; margin-bottom: 24px; }
.quick-tile{ background: var(--card); border:1px solid var(--line); border-radius: var(--radius); padding: 18px 8px; display:flex; flex-direction:column; align-items:center; gap:10px; cursor:pointer; text-align:center; box-shadow: var(--shadow-sm); transition: transform .14s, box-shadow .14s; }
.quick-tile:hover{ transform: translateY(-3px); box-shadow: var(--shadow-md); }
.quick-tile:active{ transform: translateY(-1px) scale(.98); }
.quick-tile .qt-ico{ width:48px; height:48px; border-radius: 14px; display:flex; align-items:center; justify-content:center; color:#fff; }
.quick-tile .qt-ico .icon{ width:22px; height:22px; }
.quick-tile .qt-label{ font-size:12px; color: var(--ink); font-weight:700; }

/* =========================================================
   Cards / stats
   ========================================================= */
.stat-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap:14px; margin-bottom:22px; }
.stat-card{ background: var(--card); border-radius: var(--radius); padding: 17px 18px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); position:relative; overflow:hidden; }
.stat-card::before{ content:''; position:absolute; top:0; right:0; width:4px; height:100%; background: var(--navy-3); }
.stat-card.pos::before{ background: var(--pos); } .stat-card.neg::before{ background: var(--neg); }
.stat-card .label{ font-size:12px; color: var(--muted); margin-bottom:9px; }
.stat-card .value{ font-size:21px; font-weight:800; color: var(--navy); }
.stat-card.pos .value{ color: var(--pos); } .stat-card.neg .value{ color: var(--neg); }
html[data-theme="dark"] .stat-card .value{ color: var(--ink); }
html[data-theme="dark"] .stat-card.pos .value{ color: var(--pos); } html[data-theme="dark"] .stat-card.neg .value{ color: var(--neg); }

.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
@media (max-width: 800px){ .grid-2{ grid-template-columns: 1fr; } }
.card{
  background: var(--card); border-radius: 18px; padding: 22px; border: 1px solid var(--line);
  margin-bottom:18px; box-shadow: var(--shadow-sm); position:relative; overflow:hidden;
}
.card::before{ content:''; position:absolute; top:0; right:0; width:4px; height:100%; background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
.card h3{ display:flex; align-items:center; gap:8px; font-size:14.5px; color: var(--navy); margin-bottom:14px; font-weight:700; }
html[data-theme="dark"] .card h3{ color: var(--ink); }
.sub-heading{ margin-top:20px !important; padding-top:16px; border-top:1px dashed var(--line); }
.mini-list{ display:flex; flex-direction:column; gap:8px; }
.mini-item{ display:flex; justify-content:space-between; align-items:center; padding:10px 12px; background:#f7f9fc; border-radius:10px; font-size:13px; border:1px solid var(--line-soft); }
.mini-item .tag{ font-size:11px; padding:3px 9px; border-radius:20px; font-weight:600; }
.tag-danger{ background: var(--neg-bg); color: var(--neg); } .tag-warn{ background: var(--warn-bg); color:#8a5a10; }
.empty-note{ display:flex; flex-direction:column; align-items:center; gap:8px; color: var(--muted); font-size:13px; text-align:center; padding: 30px 14px; }
.empty-note .icon{ width:34px; height:34px; opacity:.5; }

/* =========================================================
   Data list / cards (replaces tables — no horizontal scroll)
   ========================================================= */
.data-list{ display:flex; flex-direction:column; gap:12px; }
.data-card{
  background: var(--card); border:1px solid var(--line); border-radius: 18px; padding: 17px 19px;
  box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s, border-color .18s;
  position:relative; overflow:hidden;
}
.data-card::before{ content:''; position:absolute; top:0; left:0; right:0; height:3px; background: linear-gradient(90deg, var(--brand), var(--iris)); opacity:.55; }
.data-card:hover{ transform: translateY(-2px); border-color: rgba(201,147,47,0.35); }
.data-card:hover{ box-shadow: var(--shadow-md); }
.dc-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:13px; flex-wrap:wrap; }
.dc-title-wrap{ display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.dc-title{ font-size:14.5px; font-weight:800; color: var(--ink); }
.dc-title-clickable{ cursor:pointer; text-decoration: underline dotted; text-underline-offset: 4px; text-decoration-color: var(--line); transition: color .15s; }
.dc-title-clickable:hover{ color: var(--tg-blue); text-decoration-color: var(--tg-blue); }
.dc-actions{ display:flex; gap:6px; flex-shrink:0; }
.dc-fields{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(130px,1fr)); gap:11px 16px;
  background: linear-gradient(180deg, #f8f9fc, #f3f5fa); border-radius: 12px; padding:13px 15px;
  border: 1px solid var(--line-soft);
}
.dc-field{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.dc-field label{ font-size:10.5px; color: var(--muted); }
.dc-field span{ font-size:13px; color: var(--ink); font-weight:700; white-space:normal; word-break:break-word; }
.dc-foot{ display:flex; justify-content:space-between; align-items:center; margin-top:13px; flex-wrap:wrap; gap:8px; }
.branch-chip{ font-size:10.5px; padding:4px 10px; border-radius:20px; background:#eef2f8; color: var(--navy-3); font-weight:700; display:inline-flex; align-items:center; gap:4px; }
.branch-chip .icon{ width:11px; height:11px; }

/* =========================================================
   Toolbar / buttons / forms
   ========================================================= */
.toolbar{ display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; align-items:center; }
.btn-primary{ display:inline-flex; align-items:center; gap:7px; background: var(--navy); color:#fff; border:none; padding:11px 20px; border-radius: var(--radius-sm); font-size:13.5px; font-weight:600; cursor:pointer; transition: background .15s, transform .1s; box-shadow: var(--shadow-sm); }
.btn-primary:hover{ background: var(--navy-2); } .btn-primary:active{ transform: scale(.97); }
.btn-secondary{ display:inline-flex; align-items:center; gap:7px; background:#fff; color: var(--navy); border:1px solid var(--line); padding:10px 16px; border-radius: var(--radius-sm); font-size:13px; cursor:pointer; transition: background .15s; }
.btn-secondary:hover{ background:#f5f7fb; }
.file-btn{ display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.btn-delete{ background-color: var(--neg-bg); color: var(--neg); border:1px solid #f4c9cc; padding:7px 12px; border-radius: var(--radius-sm); cursor:pointer; font-size:12px; display:inline-flex; align-items:center; gap:4px; }
.btn-edit{ background-color:#eef1f6; color: var(--navy); border:1px solid var(--line); padding:7px 12px; border-radius: var(--radius-sm); cursor:pointer; font-size:12px; display:inline-flex; align-items:center; gap:4px; }
.btn-share{ background:#eef4ff; color:#1a5bb8; border:1px solid #d3e3fb; padding:7px 12px; border-radius: var(--radius-sm); cursor:pointer; font-size:12px; display:inline-flex; align-items:center; gap:4px; }
.btn-settle{ background: var(--pos-bg); color: var(--pos); border:1px solid #b9e6d1; padding:7px 12px; border-radius: var(--radius-sm); cursor:pointer; font-size:12px; display:inline-flex; align-items:center; gap:4px; font-weight:700; }
.action-cell{ display:flex; gap:6px; flex-wrap:wrap; }

.form-group{ margin-bottom: 15px; }
.form-group label{ display:block; margin-bottom:6px; font-size:13px; color:#555; font-weight:600; }
html[data-theme="dark"] .form-group label{ color: var(--muted); }
.form-group input, .form-group select, .form-group textarea{ width:100%; padding:11px; border:1.3px solid var(--line); border-radius: var(--radius-sm); font-size:14px; outline:none; transition: border .15s, box-shadow .15s; background:#fff; color: var(--ink); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus{ border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(27,39,69,0.08); }
.form-section-title{ font-size:12px; font-weight:800; color: var(--brand); text-transform:uppercase; letter-spacing:.4px; margin: 18px 0 10px; display:flex; align-items:center; gap:6px; }
.form-section-title:first-child{ margin-top:0; }
.select-wrap{ position:relative; }
.select-wrap select{ appearance:none; padding-left: 30px; padding-right:14px; border:1.3px solid var(--line); border-radius: var(--radius-sm); background:#fff; font-size:13.5px; height:100%; cursor:pointer; }
.select-caret{ position:absolute; left:10px; top:50%; transform: translateY(-50%); color: var(--muted); pointer-events:none; }
.form-row{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.inline-form{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
hr{ border:none; border-top:1px solid var(--line); margin: 18px 0; }

/* =========================================================
   Modal / Picker / Sheet
   ========================================================= */
.modal-overlay{ position: fixed; inset:0; background: rgba(12,17,30,0.6); backdrop-filter: blur(2px); display:flex; align-items:flex-start; justify-content:center; padding: 30px 16px; overflow-y:auto; z-index: 100; }
.picker-overlay{ z-index: 120; }
.modal{ background: var(--card); border-radius: var(--radius-lg); padding: 26px; width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); animation: fadeScaleIn .2s cubic-bezier(.2,.8,.2,1); }
@keyframes fadeScaleIn{ from{ opacity:0; transform: scale(.95) translateY(10px); } to{ opacity:1; transform: scale(1) translateY(0); } }
.modal h2{ font-size:17px; color: var(--navy); margin-bottom:18px; font-weight:800; }
html[data-theme="dark"] .modal h2{ color: var(--ink); }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:20px; padding-top:16px; border-top:1px solid var(--line-soft); }
.modal-close{ background:#f3f5f9; border:none; width:34px; height:34px; border-radius:50%; cursor:pointer; color: var(--muted); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
html[data-theme="dark"] .modal-close{ background: var(--line-soft); }
.modal-head{ display:flex; justify-content:space-between; align-items:center; padding-bottom:16px; border-bottom:1px solid var(--line-soft); margin-bottom:18px !important; }
.modal-head h2{ margin-bottom:0; }

.invoice-items-table{ width:100%; border-collapse:collapse; margin: 12px 0; }
.invoice-items-table th, .invoice-items-table td{ padding:9px; font-size:13px; border-bottom:1px solid var(--line-soft); }
.invoice-totals{ margin-top: 12px; display:flex; flex-direction:column; gap:7px; align-items:flex-end; font-size:14px; background:#f7f9fc; padding:14px 16px; border-radius: var(--radius); }
.invoice-totals .grand{ font-size:18px; font-weight:800; color: var(--navy); }
html[data-theme="dark"] .invoice-totals .grand{ color: var(--ink); }
.share-row{ display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }
.share-row button{ flex:1; min-width:100px; padding:12px; border-radius: var(--radius-sm); border:none; cursor:pointer; font-size:13px; color:#fff; display:flex; align-items:center; justify-content:center; gap:6px; font-weight:600; }
.share-whatsapp{ background:#1f9d6b; } .share-telegram{ background:#2f8fd0; } .share-sms{ background:#6b7488; } .share-print{ background: var(--navy); }

.report-summary{ display:grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap:12px; }
.report-row{ background:#f7f9fc; border-radius: var(--radius-sm); padding:13px 15px; font-size:13px; display:flex; justify-content:space-between; border:1px solid var(--line-soft); }

#picker-search{ width:100%; padding:11px; border:1.3px solid var(--line); border-radius: var(--radius-sm); font-size:14px; margin-bottom:12px; background:#fff; color: var(--ink); }
.picker-list{ max-height: 340px; overflow-y:auto; display:flex; flex-direction:column; gap:6px; }
.picker-item{ display:flex; align-items:center; gap:11px; padding:11px; border-radius: var(--radius-sm); background:#f7f9fc; cursor:pointer; transition: background .12s; }
.picker-item:hover{ background:#eef2f8; }
.picker-badge{ width:34px; height:34px; border-radius:11px; background: var(--navy); color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; font-weight:700; }
.picker-info{ display:flex; flex-direction:column; gap:2px; font-size:13px; min-width:0; }
.picker-info small{ color: var(--muted); }
.picker-create-btn{ width:100%; margin-top:12px; padding:12px; border-radius: var(--radius-sm); border:1.5px dashed var(--brand); background:#fff8ec; color:#8a5a10; font-size:13px; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:7px; }
html[data-theme="dark"] .picker-create-btn{ background: rgba(201,147,47,0.12); }
.picker-trigger{ display:flex; align-items:center; justify-content:space-between; width:100%; padding:11px; border:1.3px solid var(--line); border-radius: var(--radius-sm); background:#fff; cursor:pointer; font-size:14px; color: var(--ink); }
.picker-trigger .change-label{ color:#1a5bb8; font-size:12px; font-weight:600; flex-shrink:0; }
.jalali-preview{ display:block; font-size:11.5px; color: var(--muted); margin-top:5px; }
.checkbox-label{ display:flex !important; align-items:center; gap:8px; font-size:13.5px !important; color: var(--ink) !important; }
.checkbox-label input{ width:auto !important; }
.hint-text{ display:block; font-size:11px; color: var(--muted); margin-top:5px; }

.sheet-overlay{ position: fixed; inset:0; background: rgba(12,17,30,0.55); z-index: 130; display:flex; align-items:flex-end; justify-content:center; }
.sheet{ background: var(--card); width:100%; max-width:480px; border-radius: 22px 22px 0 0; padding: 10px 18px 26px; box-shadow: 0 -10px 40px rgba(0,0,0,0.25); animation: sheetSlideUp .24s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetSlideUp{ from{ transform: translateY(100%); } to{ transform: translateY(0); } }
.sheet-handle{ width:40px; height:4px; background: var(--line); border-radius:3px; margin: 6px auto 16px; }
.sheet h3{ font-size:15px; color: var(--ink); margin-bottom:14px; font-weight:800; }
.sheet-item{ display:flex; align-items:center; gap:13px; padding:14px 6px; border-bottom:1px solid var(--line-soft); cursor:pointer; }
.sheet-item:last-child{ border-bottom:none; }
.sheet-item .si-ico{ width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; color:#fff; flex-shrink:0; }
.sheet-item .si-text strong{ display:block; font-size:13.5px; color: var(--ink); }
.sheet-item .si-text small{ font-size:11.5px; color: var(--muted); }

.lock-type-options{ display:flex; flex-direction:column; gap:8px; }
.lock-type-opt{ display:flex; align-items:center; gap:9px; padding:11px 13px; border:1.3px solid var(--line); border-radius: var(--radius-sm); cursor:pointer; font-size:13.5px; }
.lock-type-opt input{ width:auto; }
.pattern-status{ display:block; font-size:12px; color: var(--pos); margin-top:8px; }

/* Status pills */
.status-pill{ padding:4px 11px; border-radius:20px; font-size:11px; font-weight:700; white-space:nowrap; }
.status-progress{ background:#fff4dd; color:#8a5a10; }
.status-cashed{ background: var(--pos-bg); color: var(--pos); }
.status-bounced{ background: var(--neg-bg); color: var(--neg); }
.status-settled{ background: var(--pos-bg); color: var(--pos); }
.status-pending{ background: var(--warn-bg); color:#8a5a10; }

/* Notifications page */
.notif-card{ display:flex; align-items:flex-start; gap:13px; }
.notif-ico{ width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; color:#fff; flex-shrink:0; }
.notif-text{ font-size:13px; color: var(--ink); line-height:1.9; }
.notif-text small{ display:block; color: var(--muted); font-size:11.5px; margin-top:3px; }

/* Print */
.print-area{ display:none; }
@media print{ body *{ visibility: hidden; } .print-area, .print-area *{ visibility: visible; } .print-area{ display:block; position:absolute; top:0; right:0; left:0; padding: 20px; } }

/* =========================================================
   Bottom nav — نوار ناوبری شناور کپسولی شیشه‌ای (Floating Glassmorphism Pill Nav)
   شبیه نسخه‌ی جدید تلگرام: بار جدا از لبه صفحه، بلور پس‌زمینه، هر تب فعال
   یک کپسول نرم پشت خودش دارد، آیکون‌ها outline→fill با پرش انیمیشنی
   ========================================================= */
.bottom-nav{
  display:none;
  position: fixed;
  right: 16px; left: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 85;
  border-radius: 30px;
  padding: 7px 8px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 16px 36px rgba(18,26,46,0.20), 0 2px 10px rgba(18,26,46,0.08);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)){
  .bottom-nav{
    background: rgba(255,255,255,0.68);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
  }
}
html[data-theme="dark"] .bottom-nav{
  background: rgba(22,29,47,0.95);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 16px 36px rgba(0,0,0,0.45), 0 2px 10px rgba(0,0,0,0.25);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)){
  html[data-theme="dark"] .bottom-nav{
    background: rgba(22,29,47,0.62);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
  }
}
.bn-item{
  position: relative; flex:1; background:transparent; border:none; padding:6px 2px 5px; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  color: var(--muted); transition: color .12s linear; z-index:1;
}
.bn-item::before{
  content:''; position:absolute; inset: 0 4px; border-radius:22px;
  background: rgba(42,171,238,0.12); opacity:0; transform: scale(.85);
  transition: opacity .18s ease, transform .18s ease; z-index:-1;
}
.bn-item.active::before{ opacity:1; transform: scale(1); }
html[data-theme="dark"] .bn-item::before{ background: rgba(42,171,238,0.18); }
.bn-ico-wrap{ position:relative; width:24px; height:24px; }
.bn-ico{ position:absolute; inset:0; width:24px; height:24px; transition: opacity .08s linear; }
.bn-ico-outline{ opacity:1; stroke: currentColor; }
.bn-ico-fill{ opacity:0; fill: currentColor; stroke:none; }
.bn-item.active{ color: var(--tg-blue); }
.bn-item.active .bn-ico-outline{ opacity:0; }
.bn-item.active .bn-ico-fill{ opacity:1; }
.bn-item.active .bn-ico-wrap{ animation: tgTabBounce .35s cubic-bezier(.34,1.56,.64,1); }
.bn-item small{ font-size:9.5px; font-weight:500; letter-spacing:.1px; transition: font-weight .1s; }
.bn-item.active small{ font-weight:700; }
@keyframes tgTabBounce{
  0%{ transform: scale(1); }
  40%{ transform: scale(1.3); }
  65%{ transform: scale(.9); }
  100%{ transform: scale(1); }
}

/* =========================================================
   Mobile
   ========================================================= */
.sidebar-overlay{ position: fixed; inset:0; background: rgba(0,0,0,0.45); z-index: 90; }
@media (max-width: 900px){
  .only-mobile{ display:flex; align-items:center; justify-content:center; }
  .sidebar{ position: fixed; right:0; top:0; z-index: 95; transform: translateX(100%); transition: transform .25s ease; box-shadow: -10px 0 30px rgba(0,0,0,0.2); }
  .sidebar.open{ transform: translateX(0); }
  .main{ padding-bottom: calc(88px + env(safe-area-inset-bottom)); width:100%; }
  .topbar{ padding: 12px 14px; }
  .view-container{ padding: 16px 14px 0; }
  .form-row{ grid-template-columns: 1fr; }
  .bottom-nav{ display:flex; }
  .quick-grid{ grid-template-columns: repeat(3, 1fr); }
  .topbar h1{ font-size:16px; }
  .today-date{ display:none; }
  .modal{ padding:18px; border-radius: var(--radius); }
  .dc-fields{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px){
  .quick-grid{ grid-template-columns: repeat(3, 1fr); gap:9px; }
  .quick-tile{ padding:14px 6px; } .quick-tile .qt-ico{ width:42px; height:42px; }
  .stat-grid{ grid-template-columns: repeat(2, 1fr); }
  .landing-inner h1{ font-size:24px; }
  .dc-fields{ grid-template-columns: repeat(2, 1fr); gap:9px 12px; }
}

/* =========================================================
   انتخاب‌گر تاریخ شمسی (روز + ماه فارسی + سال)
   ========================================================= */
.jalali-picker{ display:flex; gap:8px; align-items:stretch; }
.jalali-picker .j-y{ width:80px; flex-shrink:0; }
.jalali-picker .j-d{ width:70px; flex-shrink:0; }
.jalali-picker .j-m{ flex:1; min-width:0; }
.form-group input.j-y, .form-group input.j-d{ text-align:center; }
@media (max-width: 380px){
  .jalali-picker{ flex-wrap:wrap; }
  .jalali-picker .j-y, .jalali-picker .j-d{ width:calc(50% - 4px); }
  .jalali-picker .j-m{ width:100%; flex:none; }
}

/* =========================================================
   کارت‌های اشخاص — هیروی طلب/بستانکاری
   ========================================================= */
.party-card{ padding: 16px 18px; }
.party-avatar{
  width:44px; height:44px; border-radius:14px; flex-shrink:0;
  background: linear-gradient(135deg, var(--navy), var(--navy-3)); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:17px;
}
.party-title{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.party-sub{ font-size:11px; color: var(--muted); }
.balance-hero{
  border-radius: 14px; padding: 14px 16px; margin: 4px 0 12px; cursor:pointer;
  display:flex; flex-direction:column; gap:5px; transition: transform .12s, box-shadow .12s;
}
.balance-hero:hover{ transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.hero-debt{ background: linear-gradient(135deg, var(--pos-bg), rgba(31,157,107,0.30)); border:1px solid rgba(31,157,107,0.35); }
.hero-credit{ background: linear-gradient(135deg, var(--neg-bg), rgba(214,69,80,0.28)); border:1px solid rgba(214,69,80,0.35); }
.hero-zero{ background: var(--line-soft); border:1px dashed var(--line); }
.balance-hero .bh-label{ font-size:11.5px; color: var(--muted); font-weight:600; }
.hero-debt .bh-label{ color:#1c7a53; } .hero-credit .bh-label{ color:#b0303a; }
html[data-theme="dark"] .hero-debt .bh-label{ color:#57c9a0; } html[data-theme="dark"] .hero-credit .bh-label{ color:#ff8b92; }
.balance-hero .bh-amount{ font-size:22px; font-weight:800; line-height:1.2; }
.hero-debt .bh-amount{ color: var(--pos); } .hero-credit .bh-amount{ color: var(--neg); } .hero-zero .bh-amount{ color: var(--muted); }
.balance-hero .bh-amount span{ font-size:12px; font-weight:600; color: var(--muted); }
.party-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.party-addr{ font-size:11.5px; color: var(--muted); }

/* =========================================================
   کارت حساب (Ledger مشتری / تامین‌کننده)
   ========================================================= */
.ledger-list{ display:flex; flex-direction:column; gap:8px; max-height: 52vh; overflow-y:auto; margin-top:14px; }
.ledger-row{ background: var(--line-soft); border:1px solid var(--line); border-radius:12px; padding:11px 13px; }
.ledger-row .lr-top{ display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.ledger-row .lr-badge{ width:26px; height:26px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:800; flex-shrink:0; color:#fff; }
.lrb-invoice{ background:#5b6cf5; } .lrb-cash{ background:#1f9d6b; } .lrb-adjust{ background:#d68a1a; } .lrb-check{ background:#d64550; }
.ledger-row .lr-title{ font-size:13px; font-weight:700; color: var(--ink); flex:1; min-width:0; }
.ledger-row .lr-amt{ font-size:13px; font-weight:800; white-space:nowrap; }
.lra-pos{ color: var(--pos); } .lra-neg{ color: var(--neg); } .lra-info{ color: var(--muted); }
.ledger-row .lr-sub{ font-size:11.5px; color: var(--muted); margin-top:6px; line-height:1.9; }
.ledger-row .lr-run{ font-size:11px; color: var(--navy-3); margin-top:6px; font-weight:700; }
html[data-theme="dark"] .ledger-row .lr-run{ color: var(--iris); }
.info-symbol{ font-size:10px; background: var(--line); padding:2px 6px; border-radius:20px; color: var(--muted); }
.ledger-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }

/* =========================================================
   صندوق — تراکنش جزیی + فروش روزانه
   ========================================================= */
.tx-card .tx-amount{ font-size:24px; font-weight:800; margin-bottom:12px; line-height:1.2; }
.tx-amount.pos{ color: var(--pos); } .tx-amount.neg{ color: var(--neg); }
.tx-amount span{ font-size:12px; color: var(--muted); font-weight:600; }
.party-ref{ font-size:11px; color: #1a5bb8; background:#eef4ff; border:1px solid #d3e3fb; padding:4px 10px; border-radius:20px; font-weight:700; }
html[data-theme="dark"] .party-ref{ background: rgba(42,171,238,0.15); color: var(--tg-blue); border-color: rgba(42,171,238,0.25); }
.daily-sales{ margin-bottom:16px; }
.daily-card{ background: linear-gradient(135deg, var(--navy), var(--navy-3)); border-radius:16px; padding:16px 18px; color:#fff; border:1px solid var(--line); box-shadow: var(--shadow-md); }
.daily-card .daily-total{ font-size:14px; margin-bottom:12px; color:#c7d1e6; }
.daily-card .daily-total strong{ color:#fff; font-size:17px; }
.daily-branches{ display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap:10px; }
.daily-branch{ background: rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.12); border-radius:12px; padding:12px 14px; }
.daily-branch .db-head{ display:flex; justify-content:space-between; align-items:center; font-size:13px; font-weight:700; margin-bottom:9px; }
.daily-branch .db-head strong{ color: var(--brand-2); font-size:14px; }
.daily-branch .db-method{ display:flex; justify-content:space-between; font-size:12px; color:#c7d1e6; padding:4px 0; border-bottom:1px dashed rgba(255,255,255,0.12); }
.daily-branch .db-method:last-of-type{ border-bottom:none; }
.daily-branch .db-method strong{ color:#fff; }
.daily-branch .db-count{ display:block; font-size:10px; color:#9fb0c9; margin-top:7px; }
.daily-card .daily-top{ display:flex; align-items:center; justify-content:space-between; }
.daily-inout{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:13px 0; }
.dio{ background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.14); border-radius:12px; padding:11px 13px; text-align:center; }
.dio small{ display:block; font-size:10.5px; color:#9fb0c9; margin-bottom:4px; }
.dio strong{ font-size:15px; }
.dio-in strong{ color:#7ee2a8; }
.dio-out strong{ color:#ffa8a0; }
.dio-net strong{ color:#ffd77a; }
.daily-empty{ text-align:center; }
@media (max-width:520px){ .daily-inout{ grid-template-columns:1fr; } }

/* =========================================================
   یادآوری‌های روزانه
   ========================================================= */
.daily-reminder{ border-radius:16px; background: linear-gradient(135deg, var(--warn-bg), rgba(214,138,26,0.10)); border:1px solid rgba(214,138,26,0.35); padding:14px 16px; margin-bottom:20px; }
.daily-reminder .dr-head{ display:flex; align-items:center; gap:7px; font-size:13px; font-weight:800; color:#8a5a10; margin-bottom:10px; }
html[data-theme="dark"] .daily-reminder .dr-head{ color: var(--brand-2); }
.daily-reminder .dr-list{ display:flex; flex-direction:column; gap:8px; }
.daily-reminder .dr-item{ display:flex; align-items:flex-start; gap:9px; font-size:12.5px; color:#5a3a08; line-height:1.9; }
html[data-theme="dark"] .daily-reminder .dr-item{ color: var(--ink); }
.daily-reminder .dr-item svg{ flex-shrink:0; margin-top:5px; }
.daily-reminder .dr-item small{ display:block; font-size:10.5px; color: var(--muted); }
.reminder-popup{ display:flex; flex-direction:column; gap:9px; margin-top:6px; }
.reminder-popup .rp-item{ display:flex; align-items:flex-start; gap:9px; font-size:13px; line-height:1.9; background: var(--line-soft); border-radius:12px; padding:11px 13px; }
.reminder-popup .rp-item svg{ flex-shrink:0; margin-top:4px; color: var(--warn); }

/* =========================================================
   اعداد مثبت/منفی
   ========================================================= */
.num-pos{ color: var(--pos); font-weight:700; }
.num-neg{ color: var(--neg); font-weight:700; }
html[data-theme="dark"] .num-pos{ color: var(--pos); }
html[data-theme="dark"] .num-neg{ color: var(--neg); }

/* =========================================================
   کنترل‌های صندوق روزانه
   ========================================================= */
.daily-controls{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.daily-controls .btn{ display:inline-flex; align-items:center; gap:6px; }
.daily-controls .btn.active{ background: var(--navy); color:#fff; border-color: var(--navy); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .daily-controls .btn.active{ background: var(--brand-2); color:#fff; }
.daily-pick{ display:flex; align-items:center; gap:8px; }
.daily-selected{ font-size:13px; font-weight:700; color: var(--ink); min-width:118px; text-align:left; }

/* =========================================================
   گزارش‌ها
   ========================================================= */
.report-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:14px 0 12px; }
.report-quick{ display:flex; gap:8px; flex-wrap:wrap; }
.report-quick .btn.mini{ padding:8px 13px; font-size:12px; }
.btn.mini{ padding:7px 11px; font-size:12px; border-radius: var(--radius-sm); }
.report-range-btn{ display:flex; align-items:center; gap:8px; }
.report-range-btn .picker-trigger{ width:auto; padding:9px 14px; font-size:13px; border-radius:10px; }
.report-range-btn .range-sep{ color: var(--muted); font-size:12px; }
.report-actions{ display:flex; gap:10px; flex-wrap:wrap; padding-top:2px; }
.report-range-badge{ display:inline-flex; align-items:center; gap:7px; background: var(--navy); color:#fff; border-radius:20px; padding:7px 15px; font-size:12.5px; font-weight:700; margin-bottom:14px; }
.report-section{ margin-bottom:14px; }
.report-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
.report-head h3{ font-size:14px; font-weight:800; margin:0; }
.report-head .btn{ white-space:nowrap; }
.report-table-wrap{ overflow-x:auto; border:1px solid var(--line-soft); border-radius:12px; }
.report-table{ width:100%; border-collapse:collapse; font-size:12.5px; min-width:480px; }
.report-table th{ background: var(--line-soft); color: var(--muted); font-size:11.5px; font-weight:800; padding:9px 12px; text-align:right; white-space:nowrap; border-bottom:1px solid var(--line); }
.report-table td{ padding:9px 12px; border-bottom:1px solid var(--line-soft); white-space:nowrap; }
.report-table tbody tr:nth-child(even){ background: var(--bg); }
.report-table tfoot td{ background: var(--line-soft); font-weight:800; padding:10px 12px; border-top:1px solid var(--line); }
.report-table tfoot td:last-child{ text-align:left; }
.report-table .row-total td{ background:#f4f7fb; color:var(--ink); }
.report-table .row-grand td{ background: var(--navy); color:#fff; }
.report-table .row-grand td strong{ color:#fff; }

/* =========================================================
   خلاصه حساب اشخاص (جمع طلب و بدهی)
   ========================================================= */
.parties-summary{ margin-bottom:14px; }
.parties-summary .ps-head{ display:flex; align-items:center; gap:8px; font-size:14px; font-weight:800; margin-bottom:12px; }
.parties-summary .ps-head .icon{ color: var(--brand); }
.parties-summary .ps-head small{ color: var(--muted); font-weight:400; font-size:12px; margin-right:auto; }
.ps-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:10px; }
.ps-item{ border:1px solid var(--line-soft); border-radius:14px; padding:13px 14px; display:flex; flex-direction:column; gap:4px; background: var(--card); }
.ps-item .ps-label{ font-size:12px; color: var(--muted); font-weight:700; }
.ps-item .ps-value{ font-size:17px; font-weight:800; }
.ps-item .ps-value b{ font-size:11px; color: var(--muted); font-weight:400; }
.ps-item small{ font-size:11px; color: var(--muted); }
.ps-pos .ps-value{ color: var(--pos); }
.ps-neg .ps-value{ color: var(--neg); }
.ps-net-pos .ps-value{ color: var(--brand); }
.ps-net-neg .ps-value{ color: var(--neg); }
@media (max-width:520px){ .ps-grid{ grid-template-columns:1fr; } }

/* =========================================================
   چاپ گزارش
   ========================================================= */
.print-area{ display:none; }
.print-head{ text-align:center; margin-bottom:16px; }
.print-head h2{ margin:0 0 4px; font-size:18px; }
.print-head div{ font-size:12px; color: #555; }
@media print{
  body *{ visibility:hidden; }
  .print-area, .print-area *{ visibility:visible; }
  .print-area{ display:block; position:absolute; top:0; right:0; left:0; padding:20px; background:#fff; }
  .print-area .report-section .report-head .btn{ display:none; }
  .print-area .report-range-badge{ background:#234; color:#fff; }
  .print-area .report-table th{ background:#eef2f7; }
  .print-area .report-table tfoot td{ background:#eef2f7; }
  .print-area .num-pos{ color:#0a7d3c; }
  .print-area .num-neg{ color:#c5322a; }
}

/* =========================================================
   تلگرام — فراموشی رمز، اتصال ربات و ارسال فاکتور
   ========================================================= */
.share-bot{ background:#229ed9 !important; }
.auth-forgot-link{ background:none; border:none; color: var(--brand); font-size:12.5px; cursor:pointer; margin-top:12px; text-decoration:none; }
.auth-forgot-link:hover{ text-decoration:underline; }
.auth-forgot-box{ text-align:right; margin-top:14px; border-top:1px dashed var(--line); padding-top:14px; }
.auth-forgot-box .form-group{ margin-bottom:10px; }
.auth-forgot-box .form-group label{ font-size:12.5px; color: var(--muted); margin-bottom:5px; display:block; }
.auth-forgot-box .form-group input{ font-size:14px; letter-spacing:normal; text-align:right; }
.auth-forgot-desc{ font-size:12px; color: var(--muted); margin-bottom:12px !important; }
.auth-forgot-back{ background:none; border:none; color: var(--muted); font-size:12.5px; cursor:pointer; margin-top:12px; }
.tg-status{ display:flex; align-items:center; gap:7px; background: var(--line-soft); border:1px solid var(--line); border-radius:12px; padding:11px 14px; font-size:12.5px; color: var(--ink); }
.tg-status-ok{ background: rgba(31,157,107,.1); border-color: rgba(31,157,107,.35); color: #0a7d3c; }
.tg-status-warn{ background: rgba(214,138,26,.1); border-color: rgba(214,138,26,.35); color: #8a5a10; }
.tg-code-box{ margin-top:14px; padding:14px; border:1.5px dashed var(--brand); border-radius:14px; text-align:center; background: var(--bg); }
.tg-code-hint{ font-size:12px; color: var(--muted); margin-bottom:6px; }
.tg-code{ font-size:26px; font-weight:900; letter-spacing:6px; color: var(--navy); margin:6px 0; }
.tg-link-btn{ display:inline-flex; align-items:center; gap:7px; margin:6px 0 4px; padding:10px 16px; border-radius:11px; background: #229ed9; color:#fff; font-size:13px; font-weight:700; text-decoration:none; }
.tg-link-btn:hover{ filter: brightness(1.07); }

/* =========================================================
   بخش 2.3.0 — امکانات جدید: نمایش مبالغ و بهبود فرم‌ها
   ========================================================= */
input[data-money]{ font-size:1.5em !important; font-weight:700; letter-spacing:.4px; font-variant-numeric: tabular-nums; }
input[data-money]::placeholder{ font-size:.72em; font-weight:400; letter-spacing:0; }

.pp-section-title{ display:flex; align-items:center; gap:7px; font-size:13px; font-weight:800; color:var(--navy); margin:16px 0 8px; }
.pp-section-title small{ color:var(--muted); font-weight:500; font-size:11px; }
.pp-invoices{ display:flex; flex-direction:column; gap:6px; }
.pp-invoice{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 13px; background:var(--bg); border:1px solid var(--line); border-radius:12px; cursor:pointer; transition:.15s; }
.pp-invoice:active{ transform:scale(.985); background:var(--line-soft); }
.ppi-main{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.ppi-num{ font-size:13px; font-weight:800; color:var(--brand); }
.ppi-sub{ font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ppi-amt{ display:flex; flex-direction:column; align-items:flex-end; gap:2px; flex-shrink:0; }
.ppi-total{ font-size:13px; font-weight:800; color:var(--ink); }
.ppi-rest{ font-size:11px; font-weight:600; }
.ppir-pos{ color:var(--pos); }
.ppir-neg{ color:var(--neg); }

.staff-total{ margin:10px 0 6px; padding:12px 14px; border-radius:12px; background:linear-gradient(135deg,var(--navy-2),var(--navy-3)); color:#fff; display:flex; justify-content:space-between; align-items:center; }
.staff-total .st-label{ font-size:12px; opacity:.85; }
.staff-total .st-amount{ font-size:19px; font-weight:900; }
.staff-total .st-amount span{ font-size:11px; font-weight:600; opacity:.85; }
.staff-card .dc-foot{ margin-top:10px; }

.owner-only[hidden], [data-perm][hidden]{ display:none !important; }

.sub-item{ align-items:flex-start; padding:10px 0; border-bottom:1px solid var(--line-soft); }
.sub-info{ display:flex; flex-direction:column; gap:4px; min-width:0; flex:1; }
.sub-info .mono, .cred-row .mono{ font-family:Consolas,Menlo,monospace; direction:ltr; display:inline-block; background:var(--bg); padding:1px 6px; border-radius:6px; color:var(--brand); }
.sub-perms{ display:flex; flex-wrap:wrap; gap:4px; }
.sub-perm-chip{ font-size:10.5px; font-weight:700; color:var(--navy); background:var(--line-soft); border:1px solid var(--line); padding:2px 8px; border-radius:20px; }
.sub-create-box{ margin-top:14px; padding-top:14px; border-top:1.5px dashed var(--line); display:flex; flex-direction:column; gap:8px; }
.sub-perm-pick{ display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.perm-item{ font-size:12px; padding:6px 10px; border:1px solid var(--line); border-radius:20px; background:var(--card); cursor:pointer; user-select:none; }
.perm-item:has(input:checked){ border-color:var(--brand); color:var(--brand); background:var(--warn-bg); }
.muted{ color:var(--muted); font-weight:500; }
.cred-box{ display:flex; flex-direction:column; gap:10px; background:var(--bg); border:1px solid var(--line); border-radius:14px; padding:14px; }
.cred-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:13px; }
.cred-row strong{ text-align:left; }

/* =========================================================
   2.3.1 — جستجو، هدر حرفه‌ای، کارت کالا، فاکتور بدون اقلام
   ========================================================= */
.search-wrap{ position:relative; margin:0 0 12px; }
.search-box{ width:100%; padding:10px 38px 10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--card); font:inherit; font-size:13px; color:var(--ink); outline:none; transition:border-color .15s, box-shadow .15s; }
.search-box:focus{ border-color:var(--brand); box-shadow:0 0 0 3px var(--warn-bg); }
.search-icon{ position:absolute; top:50%; right:12px; transform:translateY(-50%); color:var(--muted); pointer-events:none; }

.dash-hero{ position:relative; overflow:hidden; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:18px 20px; margin-bottom:14px; border-radius:18px; color:#fff; background:linear-gradient(135deg,var(--brand),var(--brand-2,#5055b8) 60%,#3739a0); box-shadow:0 10px 24px rgba(40,45,120,.28); }
.dash-hero::after{ content:''; position:absolute; width:170px; height:170px; border-radius:50%; background:rgba(255,255,255,.08); top:-60px; left:-40px; }
.dh-greet{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.dh-title{ font-size:17px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dh-sub{ font-size:12px; opacity:.85; }
.dh-stats{ display:flex; gap:10px; flex-shrink:0; }
.dh-stat{ display:flex; flex-direction:column; gap:2px; align-items:flex-end; background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.18); padding:8px 14px; border-radius:14px; }
.dh-stat small{ font-size:10.5px; opacity:.85; }
.dh-stat strong{ font-size:14.5px; font-weight:800; font-variant-numeric:tabular-nums; }
.dh-stat b{ font-size:10px; font-weight:600; opacity:.8; }

.product-card .dc-head{ padding-bottom:2px; }
.pc-avatar{ background:linear-gradient(135deg,var(--brand),var(--brand-2,#5055b8)); color:#fff; }
.pc-stock-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin:10px 0 4px; padding:9px 12px; border-radius:12px; background:var(--bg); border:1px solid var(--line); }
.pc-stock{ display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:800; font-variant-numeric:tabular-nums; }
.pc-stock svg{ width:16px; height:16px; }
.pc-stock-ok{ color:var(--pos); }
.pc-stock-low{ color:var(--neg); }
.pc-stock-low svg{ fill:var(--neg); stroke:var(--neg); }
.pc-stock-ok svg{ fill:var(--pos); stroke:var(--pos); }
.pc-prices{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-top:8px; }
.pc-price, .pc-profit{ display:flex; flex-direction:column; gap:3px; padding:9px 11px; border-radius:12px; border:1px solid var(--line); background:var(--card); }
.pc-price small, .pc-profit small{ font-size:10.5px; color:var(--muted); }
.pc-price strong{ font-size:12.5px; font-weight:800; font-variant-numeric:tabular-nums; }
.pc-profit{ background:var(--warn-bg); border-color:transparent; }
.pc-profit small{ color:var(--brand); }
.pc-profit strong{ color:var(--brand); }

.form-hint{ font-size:11px; color:var(--muted); background:var(--warn-bg); border:1px dashed var(--line); border-radius:10px; padding:8px 10px; margin:0 0 12px; line-height:1.7; }
.items-empty{ text-align:center; color:var(--muted); font-size:12px; padding:14px 8px; }

.scan-review {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.scan-review-img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.scan-review-table {
  width: 100%;
  border-collapse: collapse;
}
.scan-review-table th,
.scan-review-table td {
  border: 1px solid var(--line);
  padding: 8px;
  font-size: 12px;
  text-align: right;
}
.scan-review-table th {
  background: var(--bg);
}
.scan-review-table input {
  width: 100%;
  font-size: 12px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.scan-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.scan-info {
  font-size: 12px;
  color: var(--muted);
}
.scan-info-warn {
  color: var(--neg);
  font-weight: 600;
}
.scan-col-check {
  width: 74px;
  text-align: center;
}
.scan-col-check input {
  width: 16px;
  height: 16px;
}
.scan-cell-name {
  font-weight: 600;
}
.scan-review-table .scan-del {
  padding: 4px 8px;
}
.scan-total-sum {
  text-align: left;
  font-size: 13px;
  color: var(--muted);
}
.scan-total-sum strong {
  color: var(--text);
}


/* ============ چک‌ها: نوار جستجو + بازه‌ها + خلاصه ============ */
.checks-search-wrap{ position:relative; display:flex; align-items:center; flex:1; min-width:220px; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:0 12px; transition:border-color .15s, box-shadow .15s; }
.checks-search-wrap:focus-within{ border-color:var(--brand); box-shadow:0 0 0 3px rgba(201,147,47,.14); }
.checks-search-wrap .icon{ color:var(--muted); flex-shrink:0; }
.checks-search-wrap input{ flex:1; border:0; outline:0; background:transparent; padding:11px 8px; font-size:13.5px; color:var(--ink); font-family:inherit; min-width:0; }
.checks-search-wrap input::placeholder{ color:var(--muted); }
.chk-ranges{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.chk-chip{ border:1px solid var(--line); background:var(--card); color:var(--ink); padding:8px 15px; border-radius:24px; font-size:12.5px; font-weight:700; cursor:pointer; transition:all .15s; font-family:inherit; }
.chk-chip:hover{ border-color:var(--brand); color:var(--brand); }
.chk-chip.active{ background:var(--brand); border-color:var(--brand); color:#fff; box-shadow:0 6px 14px rgba(201,147,47,.3); }
.chk-summary{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; margin-bottom:14px; }
.cs-item{ background:var(--card); border:1px solid var(--line); border-radius:14px; padding:11px 14px; display:flex; flex-direction:column; gap:5px; box-shadow:var(--shadow-sm); min-width:0; }
.cs-item small{ font-size:11px; color:var(--muted); font-weight:600; }
.cs-item b{ font-size:15.5px; font-weight:900; color:var(--ink); font-variant-numeric:tabular-nums; }
.cs-item b i{ font-style:normal; font-size:11px; font-weight:700; color:var(--muted); margin-inline-start:3px; }
.cs-item.pos b{ color:var(--pos); }
.cs-item.neg b{ color:var(--neg); }

/* ============ چک‌ها: کارت‌های جمع‌و ============ */
.checks-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(215px,1fr)); gap:12px; }
.checks-grid .empty-note{ grid-column:1 / -1; }
.chk-card{ position:relative; display:flex; flex-direction:column; gap:8px; background:var(--card); border:1px solid var(--line-soft); border-inline-start:4px solid var(--brand); border-radius:16px; padding:13px 14px; cursor:pointer; transition:transform .15s, box-shadow .15s, border-color .15s; min-width:0; }
.chk-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
.chk-card:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }
.chk-card.in{ border-inline-start-color:var(--pos); }
.chk-card.out{ border-inline-start-color:var(--neg); }
.chk-row1{ display:flex; justify-content:space-between; align-items:center; gap:8px; min-width:0; }
.chk-type{ font-size:10.5px; font-weight:800; padding:3px 9px; border-radius:20px; white-space:nowrap; }
.chk-type.in{ background:rgba(31,157,107,.13); color:var(--pos); }
.chk-type.out{ background:rgba(214,69,80,.13); color:var(--neg); }
.chk-amount{ font-size:19.5px; font-weight:900; color:var(--ink); letter-spacing:-.3px; font-variant-numeric:tabular-nums; }
.chk-amount small{ font-size:11px; font-weight:700; color:var(--muted); margin-inline-start:5px; }
.chk-meta{ display:flex; justify-content:space-between; align-items:center; gap:6px; font-size:12px; color:var(--muted); min-width:0; }
.chk-due{ display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }
.chk-due .icon{ width:14px; height:14px; }
.chk-diff{ font-weight:800; font-size:11.5px; white-space:nowrap; }
.chk-diff.over, .chk-diff.today{ color:var(--neg); }
.chk-diff.soon{ color:#c07d14; }
.chk-diff.later{ color:var(--muted); }
.chk-owner{ font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ============ چک‌ها: پاپ‌آپ جزئیات ============ */
.chk-detail-hero{ display:flex; flex-direction:column; align-items:center; gap:7px; padding:20px 16px; border-radius:18px; color:#fff; margin-bottom:14px; }
.chk-detail-hero.in{ background:linear-gradient(135deg,#1f9d6b,#0d7a55); box-shadow:0 10px 22px rgba(31,157,107,.28); }
.chk-detail-hero.out{ background:linear-gradient(135deg,#d64550,#b32f3a); box-shadow:0 10px 22px rgba(214,69,80,.28); }
.chk-detail-hero small{ font-size:12px; opacity:.92; font-weight:700; }
.chk-detail-hero strong{ font-size:24px; font-weight:900; font-variant-numeric:tabular-nums; }
.chk-detail-hero strong i{ font-style:normal; font-size:12px; font-weight:700; opacity:.85; margin-inline-start:4px; }
.chk-detail-hero .status-pill{ background:rgba(255,255,255,.22); color:#fff; }
.chk-fields{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.chk-fields .f{ background:var(--line-soft); border:1px solid var(--line-soft); border-radius:13px; padding:10px 13px; display:flex; flex-direction:column; gap:4px; min-width:0; }
.chk-fields .f small{ font-size:10.5px; color:var(--muted); font-weight:600; }
.chk-fields .f b{ font-size:13.5px; color:var(--ink); word-break:break-word; }
.chk-detail-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:16px; }
.chk-detail-actions .btn-delete.chk-del{ margin-inline-start:auto; background:transparent; color:var(--neg); border:1px solid rgba(214,69,80,.4); }

/* ============ واکنش‌گرایی داشبورد و چک‌ها ============ */
@media (max-width:640px){
  .dash-hero{ flex-wrap:wrap; }
  .checks-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .chk-amount{ font-size:17.5px; }
  .chk-fields{ grid-template-columns:1fr; }
}
@media (max-width:430px){
  .checks-grid{ grid-template-columns:1fr; }
  .chk-summary{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
