
:root{
  --teal:#1abc9c; --teal-d:#16a085;
  --amber:#f39c12; --violet:#9b59b6; --green:#2ecc71; --red:#e74c3c;
  --r-sm:10px; --r-md:16px; --r-lg:14px;
  --mono:'Vazirmatn',sans-serif;
}
html[data-theme="dark"]{
  --bg:#1b2631; --bg2:#212f3d; --bg3:#283747;
  --glass: rgba(255,255,255,.04); --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.14);
  --ink:#ecf0f1; --sub:#95a5a6; --sub2:#5c6b73;
}
html[data-theme="oled"]{
  --bg:#000000; --bg2:#000000; --bg3:#000000;
  --glass: rgba(255,255,255,.05); --line: rgba(255,255,255,.12); --line2: rgba(255,255,255,.18);
  --ink:#f2f2f2; --sub:#8a8a8a; --sub2:#5a5a5a;
}
html[data-theme="light"]{
  --bg:#eef1f2; --bg2:#ffffff; --bg3:#f5f7f8;
  --glass: rgba(0,0,0,.03); --line: #e1e6e8; --line2: #ccd3d6;
  --ink:#26333d; --sub:#69777f; --sub2:#8b979e;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html{scroll-behavior:smooth; overflow-x:hidden; width:100%;}
body{
  margin:0; font-family:'Vazirmatn',sans-serif; background:var(--bg);
  color:var(--ink); min-height:100vh; padding-bottom:24px; transition:background .2s,color .2s;
  overflow-x:hidden; width:100%;
}
::selection{background:var(--teal); color:#fff;}
.num{font-variant-numeric:tabular-nums;}
.code{font-family:var(--mono); direction:ltr; unicode-bidi:plaintext; display:inline-block;}
::-webkit-scrollbar{width:8px;height:8px;} ::-webkit-scrollbar-thumb{background:var(--line2); border-radius:8px;}

.p-2{padding:14px;} .p-3{padding:20px;}
.mb-2{margin-bottom:12px;} .mb-3{margin-bottom:18px;}
.g-2 > *{margin:5px;}

/* ---------- shell: sidebar + full-width content ---------- */
.shell{display:flex; min-height:100vh; width:100%; align-items:stretch;}
.sidebar{width:252px; flex-shrink:0; background:var(--bg2); border-inline-end:1px solid var(--line); display:flex; flex-direction:column; position:sticky; top:0; height:100vh; overflow-y:auto; padding:20px 16px;}
.sidebar .brand{padding:4px 6px 18px;}
.sidebar-nav{display:flex; flex-direction:column; gap:3px; margin-top:6px;}
.sidebar-link{display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:11px; color:var(--sub); text-decoration:none; font-size:.86rem; font-weight:600; transition:.15s;}
.sidebar-link svg{width:19px;height:19px; flex-shrink:0;}
.sidebar-link:hover{background:var(--glass); color:var(--ink);}
.sidebar-link.active{background:var(--teal); color:#fff;}

.acc-group{margin-bottom:2px;}
.acc-head{display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:11px; cursor:pointer; color:var(--ink); font-size:.86rem; font-weight:700; transition:.15s; user-select:none;}
.acc-head:hover{background:var(--glass);}
.acc-head svg.chev{width:14px;height:14px; margin-inline-start:auto; transition:.2s; color:var(--sub); flex-shrink:0;}
.acc-head svg.gicon{width:18px;height:18px; flex-shrink:0; color:var(--sub);}
.acc-group.open .acc-head svg.chev{transform:rotate(-90deg);}
.acc-group.open .acc-head{color:var(--teal);}
.acc-group.open .acc-head svg.gicon{color:var(--teal);}
.acc-body{max-height:0; overflow:hidden; transition:max-height .25s ease;}
.acc-group.open .acc-body{max-height:600px;}
.acc-item{display:block; padding:9px 14px 9px 12px; margin-inline-start:14px; border-inline-start:1px solid var(--line2); font-size:.8rem; color:var(--sub); text-decoration:none; cursor:pointer; transition:.15s;}
.acc-item:hover{color:var(--ink);}
.acc-item.active{color:var(--teal); font-weight:700; border-inline-start-color:var(--teal);}
.sidebar-foot{margin-top:auto; padding-top:14px; border-top:1px solid var(--line); display:flex; align-items:center; gap:10px;}
.sidebar-foot .who{flex:1; min-width:0;}
.sidebar-foot .who .n{font-size:.8rem; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.sidebar-foot .who .r{font-size:.68rem; color:var(--sub);}

.theme-switch{display:flex; align-items:center; gap:2px; background:var(--glass); border:1px solid var(--line); border-radius:10px; padding:3px;}
.theme-switch button, .theme-switch .tbtn{width:30px;height:28px; border-radius:8px; border:none; background:transparent; color:var(--sub); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:.15s; font-size:.85rem; text-decoration:none; flex:1;}
.theme-switch button.active, .theme-switch .tbtn.active{background:var(--teal); color:#fff;}
.theme-switch button svg{width:15px;height:15px;}

.main{flex:1; min-width:0; display:flex; flex-direction:column;}
.main-header{display:flex; align-items:center; gap:12px; padding:14px 20px; background:var(--bg2); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:40;}
.d-lg-none{display:flex;}
@media(min-width:992px){ .d-lg-none{display:none !important;} }

/* content */
.wrap{width:100%; padding:26px 32px;}
@media(max-width:575.98px){ .wrap{padding:16px 14px;} .main-header{padding:10px 14px;} }
.view{animation:viewIn .38s cubic-bezier(.2,.8,.2,1);}
@keyframes viewIn{from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)}}
.stagger > *{animation:itemIn .42s cubic-bezier(.2,.8,.2,1) both;}
.stagger > *:nth-child(1){animation-delay:.02s} .stagger > *:nth-child(2){animation-delay:.06s}
.stagger > *:nth-child(3){animation-delay:.10s} .stagger > *:nth-child(4){animation-delay:.14s}
.stagger > *:nth-child(5){animation-delay:.18s} .stagger > *:nth-child(6){animation-delay:.22s}
@keyframes itemIn{from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:translateY(0)}}

.brand{display:flex; align-items:center; gap:12px; flex-shrink:0;}
.brand-mark{width:36px;height:36px;border-radius:11px;background:var(--teal); display:flex;align-items:center;justify-content:center; font-weight:900; color:#ffffff; font-size:14px;}
.brand-name{font-weight:800; font-size:.92rem; line-height:1.1;}
.brand-sub{font-size:.65rem; color:var(--sub);}

/* omnisearch */
.omni-wrap{position:relative; flex:1; max-width:520px;}
.omni{display:flex; align-items:center; gap:8px; background:var(--glass); border:1px solid var(--line); border-radius:999px; padding:8px 14px; transition:.25s; cursor:text;}
.omni:focus-within{border-color:var(--teal); box-shadow:0 0 0 3px rgba(26,188,156,.15);}
.omni input{background:transparent; border:none; outline:none; color:var(--ink); font-family:inherit; font-size:.86rem; flex:1; min-width:0;}
.omni input::placeholder{color:var(--sub2);}
.omni svg{width:17px;height:17px; color:var(--sub); flex-shrink:0;}
.omni kbd{font-family:var(--mono); font-size:.65rem; color:var(--sub); background:rgba(255,255,255,.06); border:1px solid var(--line); border-radius:6px; padding:1px 6px;}
@media(max-width:991.98px){ .kbd-hint{display:none;} }
.omni-results{position:absolute; inset-inline:0; top:calc(100% + 8px); background:var(--bg3); border:1px solid var(--line2); border-radius:var(--r-md); box-shadow:0 24px 48px -18px rgba(0,0,0,.6); overflow:hidden; opacity:0; transform:translateY(-6px) scale(.98); pointer-events:none; transition:.18s ease; max-height:min(60vh,460px); overflow-y:auto; z-index:50;}
.omni-results.show{opacity:1; transform:translateY(0) scale(1); pointer-events:auto;}
.omni-group-label{font-size:.68rem; color:var(--sub); padding:10px 14px 4px; letter-spacing:.02em;}
.omni-item{display:flex; align-items:center; gap:10px; padding:9px 14px; cursor:pointer; transition:.12s;}
.omni-item:hover, .omni-item.active{background:rgba(26,188,156,.08);}
.omni-item .ic{width:30px;height:30px;border-radius:9px;display:flex;align-items:center;justify-content:center; flex-shrink:0; font-size:.75rem;}
.omni-item .meta{flex:1; min-width:0;}
.omni-item .t1{font-size:.85rem; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.omni-item .t2{font-size:.7rem; color:var(--sub);}
.omni-empty{padding:22px; text-align:center; color:var(--sub); font-size:.82rem;}
.skeleton-row{display:flex; gap:10px; padding:9px 14px; align-items:center;}
.sk{border-radius:8px; background:rgba(255,255,255,.07); animation:pulse 1.1s ease-in-out infinite;}
@keyframes pulse{0%,100%{opacity:.5} 50%{opacity:1}}

/* nav */
.avatar{width:34px;height:34px;border-radius:50%; background:var(--bg3); display:flex;align-items:center;justify-content:center; font-size:.75rem; font-weight:700; border:1px solid var(--line2); flex-shrink:0;}

.stagger > *:nth-child(5){animation-delay:.18s} .stagger > *:nth-child(6){animation-delay:.22s}
@keyframes itemIn{from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:translateY(0)}}

.card{background:var(--bg2); border:1px solid var(--line); border-radius:var(--r-lg); min-width:0; overflow-wrap:break-word;}
.section-title{font-weight:800; font-size:1rem; display:flex; align-items:center; gap:9px; margin-bottom:4px;}
.section-title .dot{width:7px;height:7px;border-radius:50%; background:var(--teal); box-shadow:0 0 0 4px rgba(26,188,156,.18);}

/* stat cards */
.stat{border-radius:var(--r-lg); padding:22px; position:relative; overflow:hidden; border:1px solid var(--line2); transition:.2s; min-width:0; overflow-wrap:break-word;}
.stat:hover{border-color:var(--line2);}
.stat .icon{width:36px;height:36px;border-radius:10px; display:flex;align-items:center;justify-content:center; margin-bottom:14px; font-size:16px;}
.stat small{color:var(--sub); font-size:.74rem; display:block; margin-bottom:6px;}
.stat .val{font-size:1.5rem; font-weight:800; line-height:1.3;}
.stat .trend{font-size:.68rem; margin-top:10px; display:inline-flex; align-items:center; gap:3px; padding:3px 9px; border-radius:999px;}

/* buttons */
.btn{border-radius:12px; font-weight:700; font-size:.84rem; border:none; padding:10px 16px; transition:.15s; display:inline-flex; align-items:center; gap:6px; cursor:pointer;}
.btn:active{transform:scale(.96);}
.btn-teal{background:var(--teal); color:#ffffff;}
.btn-teal:hover{filter:brightness(1.08);}
.btn-ghost{background:var(--glass); color:var(--ink); border:1px solid var(--line2);}
.btn-ghost:hover{background:rgba(255,255,255,.08);}
.btn-sm{padding:7px 12px; font-size:.76rem; border-radius:10px;}

/* table */
.tbl{width:100%; border-collapse:separate; border-spacing:0; font-size:.83rem;}
.tbl th{text-align:right; color:var(--sub); font-weight:600; font-size:.7rem; padding:12px 16px; border-bottom:1px solid var(--line);}
.tbl td{padding:14px 16px; border-bottom:1px solid var(--line); vertical-align:middle;}
.tbl tr:last-child td{border-bottom:none;}
.tbl tbody tr{transition:.15s;}
.tbl tbody tr:hover{background:rgba(255,255,255,.03);}

.badge{display:inline-flex; align-items:center; gap:5px; padding:4px 11px; border-radius:999px; font-size:.68rem; font-weight:700;}
.b-teal{background:rgba(26,188,156,.14); color:var(--teal);}
.b-violet{background:rgba(155,89,182,.16); color:var(--violet);}
.b-amber{background:rgba(243,156,18,.15); color:var(--amber);}
.b-green{background:rgba(46,204,113,.15); color:var(--green);}
.b-red{background:rgba(231,76,60,.15); color:var(--red);}
.b-soft{background:var(--glass); color:var(--sub); border:1px solid var(--line);}

.imei-chip{font-family:var(--mono); font-size:.72rem; background:rgba(155,89,182,.12); color:#e4d3ec; border:1px solid rgba(155,89,182,.28); padding:2px 8px; border-radius:7px; display:inline-block; margin:2px;}

/* bottom nav (mobile) */
.bottomnav{position:fixed; bottom:0; inset-inline:0; z-index:45; background:rgba(10,14,24,.85); backdrop-filter:blur(16px); border-top:1px solid var(--line); padding:6px 4px calc(6px + env(safe-area-inset-bottom)); display:flex; justify-content:space-between;}
.bottomnav .nl{flex:1; color:var(--sub); font-size:.62rem; display:flex; flex-direction:column; align-items:center; gap:3px; padding:7px 2px; border-radius:12px; transition:.2s; text-decoration:none;}
.bottomnav .nl svg{width:19px;height:19px;}
.bottomnav .nl.active{color:var(--teal);}
.bottomnav .nl.active svg{filter:drop-shadow(0 0 6px rgba(26,188,156,.6));}

.fab{position:fixed; bottom:78px; left:16px; z-index:46; width:56px;height:56px;border-radius:18px; background:var(--teal); color:#ffffff; display:flex;align-items:center;justify-content:center; font-size:26px; border:none; transition:.2s;}
.fab:active{transform:scale(.92) rotate(90deg);}

/* bottom sheet / modal */
.sheet-overlay{position:fixed; inset:0; background:rgba(4,6,12,.6); backdrop-filter:blur(2px); z-index:60; opacity:0; pointer-events:none; transition:.25s;}
.sheet-overlay.show{opacity:1; pointer-events:auto;}
.sheet{position:fixed; z-index:61; background:var(--bg2); border:1px solid var(--line2); box-shadow:0 -20px 60px rgba(0,0,0,.5); transition:.32s cubic-bezier(.2,.8,.2,1);
  inset-inline:0; bottom:0; border-radius:22px 22px 0 0; max-height:88vh; overflow:hidden; transform:translateY(100%); display:flex; flex-direction:column;}
.sheet.show{transform:translateY(0);}
.sheet-handle{width:40px;height:4px;background:var(--line2); border-radius:99px; margin:10px auto 4px;}
.sheet-head{display:flex; justify-content:space-between; align-items:center; padding:10px 18px 14px; border-bottom:1px solid var(--line);}
.sheet-body{padding:14px 18px; overflow-y:auto;}
.sheet-foot{padding:14px 18px; border-top:1px solid var(--line); background:var(--bg2);}
@media(min-width:768px){
  .sheet{inset-inline:auto; right:50%; top:50%; bottom:auto; transform:translate(50%,-46%) scale(.96); width:min(640px,92vw); border-radius:22px; opacity:0;}
  .sheet.show{transform:translate(50%,-50%) scale(1); opacity:1;}
  .sheet-handle{display:none;}
}

.field label{font-size:.72rem; color:var(--sub); margin-bottom:5px; display:block;}
.field input, .field select, .input{width:100%; background:rgba(255,255,255,.04); border:1px solid var(--line2); color:var(--ink); border-radius:11px; padding:9px 12px; font-family:inherit; font-size:.85rem; outline:none; transition:.15s;}
.field input:focus, .field select:focus{border-color:var(--teal); box-shadow:0 0 0 3px rgba(26,188,156,.14);}

.chip-row{display:flex; flex-wrap:wrap; gap:6px;}
.line-item{display:flex; align-items:center; gap:10px; background:var(--glass); border:1px solid var(--line); border-radius:14px; padding:10px 12px; margin-bottom:8px; animation:itemIn .3s ease both;}
.line-item .qty-box{display:flex; align-items:center; gap:4px; background:rgba(255,255,255,.05); border-radius:9px; padding:2px;}
.line-item .qty-box button{width:24px;height:24px;border:none;background:transparent;color:var(--ink);border-radius:7px; font-weight:800; cursor:pointer;}
.line-item .qty-box button:hover{background:rgba(255,255,255,.1);}
.line-item .qty-box .q{width:24px; text-align:center; font-family:var(--mono); font-size:.82rem;}

.toast{position:fixed; top:14px; left:50%; transform:translateX(-50%) translateY(-140%); z-index:99; background:var(--bg3); border:1px solid var(--line2); color:var(--ink); padding:10px 18px; border-radius:12px; font-size:.82rem; display:flex; align-items:center; gap:8px; box-shadow:0 16px 32px -12px rgba(0,0,0,.5); transition:.3s cubic-bezier(.2,.8,.2,1);}

/* ---------- حالت خصوصی ---------- */
body.privacy-active .shell{filter:blur(22px) brightness(.5); pointer-events:none; user-select:none; transition:filter .35s ease;}
body.privacy-active .demo-ribbon{filter:blur(22px) brightness(.5);}
body.privacy-active .fab, body.privacy-active .bottomnav{filter:blur(22px) brightness(.5); pointer-events:none;}
.privacy-overlay{position:fixed; inset:0; z-index:300; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,.35); padding:16px;}
.privacy-overlay.show{display:flex;}
.privacy-card{background:var(--bg2); border:1px solid var(--line2); border-radius:20px; padding:32px 28px; width:min(360px,100%); text-align:center; box-shadow:0 30px 60px -20px rgba(0,0,0,.6);}
.toast.show{transform:translateX(-50%) translateY(0);}

.demo-ribbon{background:var(--bg3); color:var(--sub); font-size:.7rem; text-align:center; padding:8px; letter-spacing:.02em; border-bottom:1px solid var(--line);}

/* ---------- data grid list (invoices index) ---------- */
.list-toolbar{display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:16px;}
.list-title{font-size:1.15rem; font-weight:800; display:flex; align-items:center; gap:8px;}
.icon-btn{width:36px;height:36px; border-radius:10px; background:var(--glass); border:1px solid var(--line2); color:var(--sub); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:.15s; flex-shrink:0;}
.icon-btn:hover{background:rgba(255,255,255,.08); color:var(--ink);}
.icon-btn.danger:hover{background:rgba(231,76,60,.15); color:var(--red);}
.icon-toolbar{display:flex; align-items:center; gap:8px;}

.status-pills{display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px;}
.status-pill{display:flex; align-items:center; gap:9px; padding:9px 16px; border-radius:13px; background:var(--bg2); border:1px solid var(--line); cursor:pointer; transition:.18s; font-size:.82rem;}
.status-pill:hover{border-color:var(--line2);}
.status-pill.active{border-color:var(--teal); background:rgba(26,188,156,.08);}
.status-pill .dot{width:8px;height:8px;border-radius:50%;}
.status-pill .cnt{font-weight:800; font-family:inherit;}
.status-pill .lbl{color:var(--sub);}
.status-pill.active .lbl{color:var(--ink);}

.dgrid-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:var(--r-lg);}
table.dgrid{width:100%; border-collapse:collapse; min-width:920px; font-size:.82rem;}
table.dgrid thead tr.labels th{background:rgba(255,255,255,.03); color:var(--sub); font-weight:700; font-size:.72rem; padding:13px 14px; border-bottom:1px solid var(--line); white-space:nowrap; text-align:right;}
table.dgrid thead tr.filters th{padding:8px 10px; border-bottom:1px solid var(--line2); background:rgba(255,255,255,.015);}
table.dgrid thead tr.filters .fctrl{display:flex; align-items:center; gap:6px; background:rgba(255,255,255,.035); border:1px solid var(--line); border-radius:9px; padding:6px 9px;}
table.dgrid thead tr.filters .fctrl input{background:transparent; border:none; outline:none; color:var(--ink); font-family:inherit; font-size:.76rem; width:100%; min-width:60px;}
table.dgrid thead tr.filters .fctrl svg{width:13px;height:13px; color:var(--sub2); flex-shrink:0;}
table.dgrid tbody td{padding:14px; border-bottom:1px solid var(--line); vertical-align:middle; white-space:nowrap;}
table.dgrid tbody tr{transition:.12s;}
table.dgrid tbody tr:hover{background:rgba(255,255,255,.025);}
table.dgrid tbody tr:last-child td{border-bottom:none;}
.dgrid-link{color:var(--teal); font-weight:700; cursor:pointer;}
.dgrid-link:hover{text-decoration:underline;}
.row-actions{display:flex; gap:6px;}
.row-actions .icon-btn{width:30px;height:30px; border-radius:8px;}

.dgrid-foot{display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; padding:14px 16px; border-top:1px solid var(--line);}
.pg-sizes{display:flex; gap:5px;}
.pg-sizes button{width:30px;height:30px; border-radius:8px; border:1px solid var(--line2); background:transparent; color:var(--sub); font-size:.72rem; cursor:pointer;}
.pg-sizes button.active{background:var(--teal); color:#ffffff; border-color:var(--teal); font-weight:800;}
.pg-pages{display:flex; align-items:center; gap:5px; color:var(--sub); font-size:.78rem;}
.pg-pages button{width:30px;height:30px; border-radius:8px; border:1px solid var(--line2); background:transparent; color:var(--sub); cursor:pointer; font-size:.78rem;}
.pg-pages button.active{background:rgba(26,188,156,.14); color:var(--teal); border-color:rgba(26,188,156,.4); font-weight:800;}
.pg-nav{width:30px;height:30px; border-radius:8px; border:1px solid var(--line2); background:transparent; color:var(--sub); cursor:pointer; display:flex; align-items:center; justify-content:center;}

.accent-swatch{width:100%; aspect-ratio:1.6; border-radius:12px; cursor:pointer; border:2px solid transparent; display:flex; align-items:flex-end; justify-content:center; padding-bottom:8px; color:#fff; font-size:.72rem; font-weight:700; transition:.15s; position:relative;}
.accent-swatch:hover{transform:translateY(-2px);}
.accent-swatch.on{border-color:var(--ink);}
.accent-swatch.on::after{content:'✓'; position:absolute; top:6px; left:6px; background:rgba(255,255,255,.9); color:#111; width:18px; height:18px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.65rem;}
.status-color-row{display:flex; align-items:center; justify-content:space-between; padding:10px 4px; border-bottom:1px solid var(--line);}
.status-color-row input[type=color]{width:38px; height:30px; border:1px solid var(--line2); border-radius:8px; background:none; cursor:pointer; padding:2px;}

/* ---------- reports hub ---------- */
.rep-grid{display:grid; grid-template-columns:1fr; gap:16px;}
.rep-cat{padding:6px 0 10px;}
.rep-cat-title{font-weight:800; font-size:.92rem; padding:12px 18px 10px;}
.rep-row{display:flex; align-items:center; justify-content:space-between; padding:11px 18px; border-top:1px solid var(--line); cursor:pointer; transition:.15s; font-size:.84rem;}
.rep-row:hover{background:var(--glass); color:var(--teal);}
.rep-star{color:var(--line2); font-size:.95rem; cursor:pointer; transition:.15s;}
.rep-star.on{color:var(--amber);}
.rep-star:hover{color:var(--amber);}
.ledger-tbl{width:100%; border-collapse:collapse; font-size:.82rem;}
.ledger-tbl th{text-align:right; color:var(--sub); font-weight:700; font-size:.7rem; padding:10px 12px; border-bottom:1px solid var(--line2);}
.ledger-tbl td{padding:10px 12px; border-bottom:1px solid var(--line);}
.ledger-tbl tfoot td{font-weight:800; border-top:2px solid var(--line2); border-bottom:none;}
.rep-select{background:var(--glass); border:1px solid var(--line2); color:var(--ink); border-radius:10px; padding:8px 12px; font-family:inherit; font-size:.82rem; margin-bottom:14px;}
.acc-code{color:var(--sub); font-size:.72rem;}
.rep-subtitle{font-weight:700; font-size:.82rem; color:var(--sub); margin:16px 0 8px; padding-top:10px; border-top:1px dashed var(--line2);}
.rep-subtitle:first-child{margin-top:0; padding-top:0; border-top:none;}
@media(min-width:900px){ .rep-grid{grid-template-columns:1fr 1fr;} }

.inv-head{display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin-bottom:16px;}
.inv-field label{font-size:.68rem; color:var(--sub); margin-bottom:5px; display:flex; align-items:center; gap:3px;}
.inv-field label .req{color:var(--red);}
.inv-field .ctrl{display:flex; align-items:center; gap:6px; background:rgba(255,255,255,.04); border:1px solid var(--line2); border-radius:11px; padding:8px 10px; transition:.15s;}
.inv-field .ctrl:focus-within{border-color:var(--teal); box-shadow:0 0 0 3px rgba(26,188,156,.12);}
.inv-field .ctrl input, .inv-field .ctrl select{background:transparent; border:none; outline:none; color:var(--ink); font-family:inherit; font-size:.82rem; width:100%;}
.inv-field .ctrl .ic{color:var(--sub); font-size:.85rem; flex-shrink:0;}
.inv-field .add-btn{width:26px;height:26px;border-radius:8px; background:rgba(26,188,156,.14); color:var(--teal); border:none; font-weight:800; flex-shrink:0; cursor:pointer;}
.today-chip{font-size:.68rem; background:rgba(26,188,156,.14); color:var(--teal); padding:2px 8px; border-radius:7px; flex-shrink:0;}

.grid-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:14px;}
table.inv-grid{width:100%; border-collapse:collapse; min-width:820px; font-size:.8rem;}
table.inv-grid thead th{background:rgba(255,255,255,.035); color:var(--sub); font-weight:700; font-size:.68rem; padding:9px 8px; border-bottom:1px solid var(--line2); white-space:nowrap; position:sticky; top:0;}
table.inv-grid td{padding:5px 6px; border-bottom:1px solid var(--line); vertical-align:middle;}
table.inv-grid tbody tr:hover{background:rgba(255,255,255,.02);}
table.inv-grid input, table.inv-grid select{width:100%; background:transparent; border:1px solid transparent; border-radius:8px; padding:7px 8px; color:var(--ink); font-family:inherit; font-size:.8rem; outline:none; transition:.12s;}
table.inv-grid input:hover, table.inv-grid select:hover{background:rgba(255,255,255,.03);}
table.inv-grid input:focus, table.inv-grid select:focus{background:rgba(26,188,156,.06); border-color:var(--teal);}
table.inv-grid input.num-cell{font-family:var(--mono); direction:ltr; text-align:left;}
.row-idx{color:var(--sub2); font-size:.72rem; text-align:center; width:26px;}
.row-del{width:30px; text-align:center;}
.row-del button{background:rgba(231,76,60,.1); color:var(--red); border:none; width:26px;height:26px;border-radius:8px; cursor:pointer; transition:.15s;}
.row-del button:hover{background:rgba(231,76,60,.22);}
.item-cell{position:relative; min-width:190px;}
.item-cell-results{position:absolute; top:calc(100% + 2px); right:0; left:0; background:var(--bg3); border:1px solid var(--line2); border-radius:10px; box-shadow:0 16px 32px -12px rgba(0,0,0,.55); z-index:20; overflow:hidden; display:none; max-height:220px; overflow-y:auto;}
.item-cell-results.show{display:block;}
.serial-cell{min-width:170px;}
.serial-chip{font-family:var(--mono); font-size:.66rem; background:rgba(155,89,182,.14); color:#e4d3ec; border:1px solid rgba(155,89,182,.28); padding:1px 6px; border-radius:6px; display:inline-flex; align-items:center; gap:4px; margin:1px;}
.serial-chip button{background:none;border:none;color:inherit;cursor:pointer; font-size:.8rem; line-height:1; padding:0;}
.serial-add-btn{font-size:.68rem; color:var(--teal); background:rgba(26,188,156,.1); border:1px dashed rgba(26,188,156,.4); border-radius:7px; padding:3px 8px; cursor:pointer;}

.inv-toolbar{display:flex; flex-wrap:wrap; gap:7px; align-items:center; padding:12px; border-top:1px solid var(--line); background:rgba(255,255,255,.015);}
.tb-btn{display:inline-flex; align-items:center; gap:5px; font-size:.72rem; font-weight:700; padding:7px 11px; border-radius:9px; border:1px solid var(--line2); background:rgba(255,255,255,.03); color:var(--ink); cursor:pointer; transition:.15s;}
.tb-btn:hover{background:rgba(255,255,255,.07);}
.tb-btn.on{background:rgba(26,188,156,.16); color:var(--teal); border-color:rgba(26,188,156,.4);}
.tb-btn.accent{background:var(--teal); color:#ffffff; border:none;}
.tb-btn.warn{background:rgba(231,76,60,.14); color:var(--red); border-color:rgba(231,76,60,.3);}

.inv-summary{display:flex; justify-content:space-between; align-items:center; padding:12px 16px; flex-wrap:wrap; gap:10px;}
.inv-summary .qty-total{font-size:.78rem; color:var(--sub);}
.inv-summary .grand{font-size:1.15rem; font-weight:800;}

@media(min-width:768px){
  .inv-head{grid-template-columns:repeat(5,1fr);}
}

@media(max-width:991.98px){
  .sidebar{display:none;}
  .sidebar.mobile-open{
    display:flex; position:fixed; inset-inline-start:0; top:0; bottom:0; z-index:70; width:78vw; max-width:300px;
    box-shadow:0 0 40px rgba(0,0,0,.4); animation:slideIn .22s ease;
  }
}
@keyframes slideIn{from{transform:translateX(100%)} to{transform:translateX(0)}}
.mobile-sidebar-overlay{display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:65;}
.mobile-sidebar-overlay.show{display:block;}
@media(min-width:992px){
  body{padding-bottom:0;}
  .bottomnav, .fab{display:none;}
}

/* ================= فیلد و تقویم شمسی ================= */
.jdate-field{position:relative;}
.jdate-input-group{display:flex; gap:6px;}
.jdate-input-group .jdate-input{flex:1; font-family:var(--mono);}
.jdate-btn{flex-shrink:0; width:40px; border-radius:10px; border:1px solid var(--line); background:var(--bg3); color:var(--sub); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:.15s;}
.jdate-btn:hover{color:var(--teal); border-color:var(--teal);}
.jdate-words{margin-top:5px; font-size:.72rem; color:var(--sub);}
.jpicker-popup{position:absolute; z-index:500; width:250px; background:var(--bg2); border:1px solid var(--line2); border-radius:14px; box-shadow:0 20px 40px -10px rgba(0,0,0,.5); padding:12px;}
.jpicker-head{display:flex; align-items:center; justify-content:space-between; font-weight:700; font-size:.85rem; margin-bottom:10px;}
.jpicker-nav{width:28px; height:28px; border-radius:8px; border:none; background:var(--glass); color:var(--ink); font-size:1rem; cursor:pointer;}
.jpicker-nav:hover{background:var(--teal); color:#fff;}
.jpicker-weekdays{display:grid; grid-template-columns:repeat(7,1fr); text-align:center; font-size:.68rem; color:var(--sub); margin-bottom:4px;}
.jpicker-days{display:grid; grid-template-columns:repeat(7,1fr); gap:2px;}
.jpicker-days button{aspect-ratio:1; border:none; background:transparent; color:var(--ink); border-radius:8px; cursor:pointer; font-size:.78rem; font-family:var(--mono);}
.jpicker-days button:hover{background:var(--teal); color:#fff;}
.jpicker-foot{margin-top:8px; text-align:center;}
.jpicker-today{background:var(--glass); border:none; color:var(--teal); font-size:.74rem; padding:6px 14px; border-radius:8px; cursor:pointer; font-family:inherit;}
