#authGate{position:fixed;inset:0;background:#101d28;z-index:1000;display:grid;place-items:center;padding:20px}#authGate form{width:min(390px,100%);background:#fff;border-radius:16px;padding:28px;box-shadow:0 25px 70px #0005}#authGate h2{margin:0}#authGate p{color:#69788a;font-size:12px}#authGate label{display:block;font-size:11px;margin-top:14px}#authGate input{display:block;width:100%;padding:11px;border:1px solid #d3dce5;border-radius:9px;margin-top:6px}#authGate button{width:100%;border:0;border-radius:9px;padding:11px;background:#0f766e;color:#fff;margin-top:18px}#authGate small{display:block;color:#c4321e;margin-top:10px}.is-expert .manager-only{display:none!important}
#nav .nav-group{font-size:10px;font-weight:700;letter-spacing:.02em;color:#8ea2ad;opacity:.75;padding:14px 13px 5px;margin-top:4px;text-transform:none;pointer-events:none;user-select:none}
#nav .nav-group:first-child{margin-top:0;padding-top:2px}
.app-loading .app-shell{visibility:hidden}.app-loading body::before{content:"در حال آماده‌سازی پرونده‌ها…";position:fixed;inset:0;z-index:3000;display:grid;place-items:center;background:#f2f6f8;color:#245f61;font:600 14px/1.8 "Vazirmatn",Tahoma,sans-serif}.app-loading body::after{content:"";position:fixed;z-index:3001;top:calc(50% + 34px);right:calc(50% - 16px);width:28px;height:28px;border:3px solid #cfe2e1;border-top-color:#147d78;border-radius:50%;animation:saribar-spin .8s linear infinite}@keyframes saribar-spin{to{transform:rotate(360deg)}}
.health-badge{display:flex;align-items:center;gap:7px;border:1px solid #d8e1e8;border-radius:999px;background:#fff;padding:7px 10px;color:#607080;font:inherit;font-size:11px;cursor:pointer}.health-badge i{width:8px;height:8px;border-radius:50%;background:#e0a52b}.health-badge.ok{color:#147a55;border-color:#b9e6d4;background:#f2fbf7}.health-badge.ok i{background:#24a872}.health-badge.failed{color:#b7352b;border-color:#f0c5c1;background:#fff6f5}.health-badge.failed i{background:#d84b3e}@media(max-width:780px){.health-badge span{display:none}}
.runtime-status{position:fixed;left:18px;bottom:18px;z-index:2000;max-width:440px;border:1px solid #efb8b2;border-radius:10px;background:#fff2f0;color:#a52e23;padding:10px 14px;font:12px/1.8 "Vazirmatn",Tahoma,sans-serif;box-shadow:0 8px 30px #0002}
#dashboard .stats article[data-page-link]{cursor:pointer;transition:transform .15s,box-shadow .15s}#dashboard .stats article[data-page-link]:hover{transform:translateY(-2px);box-shadow:0 8px 24px #24364a18}.case-edit-open{white-space:nowrap}
.account-menu{position:relative}.account-popover{position:absolute;top:52px;left:0;z-index:100;width:190px;padding:7px;border:1px solid #dfe5eb;border-radius:10px;background:#fff;box-shadow:0 14px 38px #17263a24}.account-popover button,.account-popover a{display:block;width:100%;border:0;border-radius:7px;background:transparent;padding:10px;text-align:right;color:#435064;cursor:pointer;text-decoration:none;box-sizing:border-box}.account-popover button:hover,.account-popover a:hover{background:#f2f6f8}.account-popover #logoutButton{color:#bd3b33}.account-popover #backupLink{color:#0f766e;font-weight:700}.health-badge span::before{content:"↻ ";font-weight:700}
.modal-backdrop{overflow-y:auto;padding:20px;box-sizing:border-box}.modal{max-height:calc(100vh - 40px);overflow-y:auto;overflow-x:hidden}.modal .modal-head{position:sticky;top:0;background:#fff;z-index:3;border-top-left-radius:14px;border-top-right-radius:14px}.modal .modal-actions{position:sticky;bottom:0;background:#fff;z-index:3}
#finance .stats article#financePendingCard{cursor:pointer;transition:transform .15s,box-shadow .15s}#finance .stats article#financePendingCard:hover{transform:translateY(-2px);box-shadow:0 8px 24px #24364a18}#finance .settlement.only-pending tbody tr[data-receipt="done"]{display:none}#finance .settlement.only-pending .panel-head::after{content:"فیلتر: فقط ناقص‌ها — برای نمایش همه دوباره روی کارت کلیک کنید";display:block;width:100%;margin-top:6px;font-size:11px;color:#b7352b}
.stats article>div:last-child{flex:1;min-width:0}
#customersTable .muted-note{display:block;margin-top:3px;font-size:10px;color:#8a93a2}#customersTable td{vertical-align:middle}
.sync-btn{display:inline-flex;align-items:center;gap:5px;border:1px solid #0f766e;background:#0f766e;color:#fff;border-radius:999px;padding:7px 13px;font:inherit;font-size:11px;font-weight:700;cursor:pointer;white-space:nowrap;transition:background .15s}
.sync-btn:hover{background:#0b5e57}
.sync-btn:disabled{opacity:.6;cursor:default}
@media(max-width:600px){.sync-btn{padding:7px 9px;font-size:0}.sync-btn::before{content:"⟳ ذخیره";font-size:11px}}
.manager-notice{display:flex;align-items:center;gap:8px;width:100%;margin:0 0 18px;padding:11px 15px;border:1px solid #f0c98a;background:#fff8ec;color:#8a5a12;border-radius:11px;font:inherit;font-size:12px;font-weight:600;cursor:pointer;text-align:right}
.manager-notice:hover{background:#fdf1da}
.manager-notice span{background:#f0a63b;color:#fff;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto}
.filter-check{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#556;white-space:nowrap;cursor:pointer}
.filter-check input{width:auto}
.case-history{margin-top:6px;border:1px solid #e6eaf0;border-radius:10px;padding:12px 14px;background:#fafbfc}
.case-history h4{margin:0 0 8px;font-size:12px;color:#2c3a4c}
.hist-row{display:flex;align-items:center;gap:8px;padding:6px 0;border-top:1px solid #eef1f5;font-size:11px}
.hist-row:first-of-type{border-top:0}
.hist-row span{font-weight:700;color:#2c3a4c}
.hist-row small{color:#667483;flex:1}
.hist-row time{color:#8a93a2;font-size:10px}
input.jdate{cursor:pointer;background:#fff}
.jdp{width:250px;background:#fff;border:1px solid #dbe2ea;border-radius:12px;box-shadow:0 18px 48px #16233a2e;padding:10px;z-index:200;font-family:inherit}
.jdp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.jdp-head span{font-weight:700;font-size:13px;color:#243244}
.jdp-title{display:flex;gap:4px}
.jdp-title select{border:1px solid #dbe2ea;background:#fff;border-radius:8px;padding:4px 6px;font-family:inherit;font-size:12px;font-weight:700;color:#243244;cursor:pointer}
.jdp-title select:hover{border-color:#0f766e}
.jdp-head button{border:0;background:#f1f5f8;width:30px;height:30px;border-radius:8px;cursor:pointer;font-size:16px;color:#38506a}
.jdp-head button:hover{background:#e2ebf1}
.jdp-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:3px}
.jdp-grid b{font-size:10px;color:#8a93a2;text-align:center;padding:4px 0;font-weight:600}
.jdp-grid i{visibility:hidden}
.jdp-day{border:0;background:transparent;border-radius:8px;padding:7px 0;cursor:pointer;font-size:12px;color:#2c3a4c;font-family:inherit}
.jdp-day:hover{background:#eef4f8}
.jdp-day.sel{background:#0f766e;color:#fff;font-weight:700}
.jdp-foot{display:flex;justify-content:space-between;margin-top:8px;border-top:1px solid #eef1f5;padding-top:8px}
.jdp-foot button{border:0;background:transparent;cursor:pointer;font-size:11px;font-weight:600;color:#0f766e;font-family:inherit}
.jdp-foot button:last-child{color:#b7352b}
@media(max-width:600px){
  header{padding:0 14px;gap:8px}
  .header-actions{gap:8px}
  #accountMenu>div:not(.avatar):not(.account-popover){display:none}
  #accountMenu #accountToggle{margin-right:0}
  .content{padding:18px 12px 44px}
  .page-title{flex-direction:column;align-items:stretch}
  .page-title>button,.page-title .primary{white-space:nowrap;width:100%}
  .stats{grid-template-columns:1fr 1fr;gap:10px}
  .stats article{padding:13px;flex-direction:column;align-items:flex-start;gap:8px}
  .stats article strong{font-size:20px}
  .stats article .stat-icon{order:-1}
  .toolbar{flex-wrap:wrap}
  .toolbar input,.panel-head input{min-width:0;width:100%;flex:1 1 100%}
  .toolbar select,.toolbar button{flex:1 1 auto}
  .table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .table-scroll table{min-width:620px}
  .service-item{flex-wrap:wrap}
  .modal-backdrop{padding:10px}
  .modal{max-height:calc(100vh - 20px)}
  .sidebar{width:min(280px,84vw)}
}
.case-actions{display:flex;gap:6px}.case-delete{border:1px solid #efc3bf;border-radius:8px;background:#fff5f4;color:#b6372f;padding:8px 10px;cursor:pointer}
.customer-tab-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:16px}.customer-tab-grid article{border:1px solid #e4e9ee;border-radius:10px;padding:13px}.customer-tab-grid span,.customer-tab-grid strong{display:block}.customer-tab-grid span{font-size:10px;color:#7d8997;margin-bottom:5px}
.v34-price-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:18px;align-items:start}.v34-price-form{overflow:hidden}.v34-section{padding:18px 20px;border-bottom:1px solid #edf0f4}.v34-section h3{margin:0 0 13px;font-size:13px}.v34-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.v34-grid label,.heavy-rate-grid label,.rate-group label,.route-rate-row label{display:grid;gap:5px;color:#596574;font-size:10px;font-weight:600}.v34-grid input,.v34-grid select,.heavy-rate-grid input,.heavy-rate-grid select,.rate-group input,.route-rate-row input{width:100%;min-width:0;border:1px solid #dce3ea;border-radius:8px;padding:9px;background:#fff;font:inherit}.v34-grid .check{display:flex;align-items:center;gap:7px;padding-top:22px}.v34-grid .check input{width:auto}.heavy-rate-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.heavy-rate-grid label{border:1px solid #e3e8ee;border-radius:9px;padding:9px}.heavy-rate-grid span{display:grid;grid-template-columns:1fr 1fr;gap:5px}.v34-invoice{position:sticky;top:88px}.v34-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:0 14px 16px}.rate-settings-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.rate-group{padding:15px}.rate-group h4{margin:0 0 10px}.rate-group label{margin-top:8px}.route-rate-panel{margin-top:16px;padding-bottom:12px}.route-rate-row{display:grid;grid-template-columns:1fr 1fr repeat(5,minmax(100px,1fr)) 36px;gap:7px;align-items:end;padding:10px 14px;border-top:1px solid #edf0f4}.route-rate-row>button{height:38px;border:0;border-radius:8px;background:#ffeaed;color:#c43b4c}.rate-save-bar{position:sticky;bottom:10px;display:flex;justify-content:space-between;align-items:center;margin-top:14px;padding:12px 15px;border:1px solid #dce4ea;border-radius:11px;background:#fff;box-shadow:0 8px 28px #24364a22}.rate-save-bar span{font-size:11px;color:#667483}@media(max-width:1100px){.v34-price-layout{grid-template-columns:1fr}.v34-invoice{position:static}.v34-grid,.heavy-rate-grid,.rate-settings-grid{grid-template-columns:repeat(2,1fr)}.route-rate-row{grid-template-columns:1fr 1fr repeat(2,1fr)}}@media(max-width:700px){.v34-grid,.heavy-rate-grid,.rate-settings-grid,.route-rate-row{grid-template-columns:1fr}}
/* v39: case form progressive disclosure + in-case expenses */
.case-more-toggle{background:transparent;border:1px dashed #b9c4cf;color:#0f766e;font-weight:600;padding:9px;border-radius:8px;cursor:pointer;margin:2px 0}
.case-more-toggle:hover{background:#f0f9f7}
.case-expenses{border-top:1px solid #e5e9ee;margin-top:8px;padding-top:12px}
.case-expenses-head h4{margin:0 0 2px}
.case-expenses-head small{color:#667483}
.case-expenses-list{display:flex;flex-direction:column;gap:6px;margin:10px 0}
.case-expense-row{display:grid;grid-template-columns:1fr auto auto auto;gap:10px;align-items:center;background:#f7f9fb;border:1px solid #eceff3;border-radius:8px;padding:8px 10px}
.case-expense-row.out b{color:#c0392b}
.case-expense-row.in b{color:#1e874b}
.case-expense-row small{color:#8090a0}
.case-expense-add{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:8px;align-items:center;margin-top:6px}
@media(max-width:700px){.case-expense-add{grid-template-columns:1fr 1fr}.case-expense-row{grid-template-columns:1fr auto}}
/* v39: global alarm bar */
.saribar-alarm-bar{position:sticky;top:0;z-index:60;display:none;align-items:center;gap:12px;background:linear-gradient(90deg,#b91c1c,#dc2626);color:#fff;padding:10px 16px;font-weight:600;box-shadow:0 2px 10px rgba(0,0,0,.15)}
.saribar-alarm-bar.show{display:flex}
.saribar-alarm-bar .alarm-icon{font-size:18px;animation:alarmPulse 1s infinite}
@keyframes alarmPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.25)}}
.saribar-alarm-bar .alarm-body{flex:1;display:flex;flex-direction:column;line-height:1.4;min-width:0}
.saribar-alarm-bar .alarm-body strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.saribar-alarm-bar .alarm-body small{font-weight:400;opacity:.92}
.saribar-alarm-bar button{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.55);color:#fff;border-radius:8px;padding:6px 12px;cursor:pointer;font-weight:600;white-space:nowrap}
.saribar-alarm-bar button:hover{background:rgba(255,255,255,.32)}
/* v39: expert-restricted warehouse (only stock) */
.is-expert #warehouse .inventory-summary article:nth-child(1),.is-expert #warehouse .inventory-summary article:nth-child(3),.is-expert #warehouse .inventory-summary article:nth-child(5){display:none}
.is-expert #warehouse .inventory-tabs [data-inventory-tab="movements"],
.is-expert #warehouse .inventory-tabs [data-inventory-tab="partners"],
.is-expert #warehouse [data-inventory-action="warehouse"],
.is-expert #warehouse [data-inventory-action="supplier"],
.is-expert #warehouse [data-inventory-action="product"],
.is-expert #warehouse [data-inventory-action="stocktake"],
.is-expert #warehouse [data-inventory-action="export"]{display:none}
.is-expert #warehouse .inventory-table th.col-cost,
.is-expert #warehouse .inventory-table td.col-cost,
.is-expert #warehouse .inventory-table th.col-value,
.is-expert #warehouse .inventory-table td.col-value,
.is-expert #warehouse .inventory-table th.col-actions,
.is-expert #warehouse .inventory-table td.col-actions{display:none}
/* v39: operational list groups + expert filter */
.ops-group{margin-bottom:18px}
.ops-group>h3{display:flex;align-items:center;gap:8px;margin:0 0 8px;font-size:14px;color:#334}
.ops-group>h3 .count{background:#eef2f6;color:#556;border-radius:20px;padding:1px 9px;font-size:12px}
.ops-group.past>h3{color:#b45309}
.ops-toolbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.ops-toolbar input,.ops-toolbar select{padding:8px 10px;border:1px solid #d5dbe2;border-radius:8px}
.calendar-expert-filter{display:flex;align-items:center;gap:6px}
.calendar-expert-filter select{padding:6px 10px;border:1px solid #d5dbe2;border-radius:8px}
.ops-group-row td{background:#eef3f8;font-weight:600;padding:6px 12px!important;border-top:2px solid #dde5ee}
.ops-group-row .count{background:#d7e2ee;border-radius:20px;padding:1px 9px;font-size:12px;color:#3a4a5a;font-weight:600}
.ops-group-row.past td{background:#fff3e6;border-top-color:#f0d6b0}
/* v39: custom searchable case picker (combobox) */
.saribar-case-input{background:#fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat left 10px center;padding-left:32px!important}
.scf-panel{position:fixed;z-index:4000;background:#fff;border:1px solid #dbe2ea;border-radius:12px;box-shadow:0 14px 38px rgba(20,40,70,.20);max-height:290px;overflow-y:auto;padding:6px;animation:scfIn .12s ease}
@keyframes scfIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.scf-opt{display:grid;grid-template-columns:auto 1fr;gap:1px 9px;align-items:center;padding:7px 9px;border-radius:9px;cursor:pointer}
.scf-opt:hover,.scf-opt.active{background:#eaf5f2}
.scf-code{grid-row:1/3;align-self:center;background:#0f766e;color:#fff;font-weight:700;font-size:12px;line-height:1;padding:5px 8px;border-radius:7px;white-space:nowrap}
.scf-name{font-weight:600;color:#17202a;font-size:13.5px}
.scf-meta{grid-column:2;color:#7a8798;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scf-opt.scf-clear{display:block;color:#8a97a6;font-size:13px;border-bottom:1px solid #eef2f6;border-radius:0;margin-bottom:3px;padding-bottom:9px}
.scf-opt.scf-clear:hover,.scf-opt.scf-clear.active{background:#f2f6f9}
.scf-empty{padding:14px;color:#8a97a6;text-align:center;font-size:13px}
@media(prefers-color-scheme:dark){.scf-panel{background:#1c2530;border-color:#33404f}.scf-opt:hover,.scf-opt.active{background:#263341}.scf-name{color:#eef2f6}.scf-opt.scf-clear{border-color:#33404f}}
/* v39: stop the RTL page from bidi-mirroring the nav chevrons. Right button (قبلی) shows ❯ pointing right, left button (بعدی) shows ❮ pointing left. */
#calendarPrev,#calendarNext,.jdp-head button{direction:ltr;unicode-bidi:isolate}
