:root{--royal:#2457d6;--royal-dark:#173c9a;--silver:#c7cbd3;--gray:#eef1f5}
body{background:#f5f6f8;font-family:"Vazirmatn",Tahoma,Arial,sans-serif;color:#29313d}.topbar{background:linear-gradient(110deg,#173c9a,#2457d6);box-shadow:0 3px 14px rgba(23,60,154,.18)}.fw-800{font-weight:800}.card,.table-wrap{border:0;border-radius:16px;box-shadow:0 3px 18px rgba(40,50,70,.07);background:#fff}.btn-primary{background:var(--royal);border-color:var(--royal)}.btn-primary:hover{background:var(--royal-dark);border-color:var(--royal-dark)}.table{margin-bottom:0}.table thead th{background:#eef1f5;color:#4b5563;white-space:nowrap}.money{font-variant-numeric:tabular-nums;white-space:nowrap}.stat{border-right:4px solid var(--royal)}.badge-status{font-size:.8rem}.form-control,.form-select{border-radius:10px}.nav-link{font-weight:500}.nav-link:hover{color:#fff}.page-title{font-weight:800}.soft{color:#687386}.thumb{width:82px;height:60px;object-fit:cover;border-radius:8px}

.auth-card{width:min(100%,440px);margin:clamp(20px,8vh,70px) auto;padding:clamp(20px,5vw,32px)!important}.auth-card .form-control{min-height:46px}.table-wrap{overflow-x:auto}.table-wrap .table{min-width:760px}@media(max-width:576px){.container-fluid.px-4{padding-left:12px!important;padding-right:12px!important}.topbar .container-fluid{padding-left:10px!important;padding-right:10px!important}.navbar-brand{font-size:1rem}.auth-card{margin:20px 8px;padding:20px!important}.page-title{font-size:1.35rem}.card.p-4{padding:1rem!important}.btn{min-height:42px}.row.g-3>[class*="col-"]{width:100%}.table-wrap{padding:.65rem!important}.form-control,.form-select{min-height:44px}}
/* ------------------------------------------------------------------
   Mobile / offline-first UI hardening
   Bootstrap is served locally so the application does not depend on a
   CDN being reachable from the server or the user's phone.
   ------------------------------------------------------------------ */
html{font-size:16px;overflow-x:hidden}
html,body{width:100%;min-width:0}
body{margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%}
img{max-width:100%;height:auto}

/* The local Bootstrap stylesheet is Bootstrap 5.x LTR; these overrides
   keep the application consistently RTL. */
[dir="rtl"] .navbar-nav{padding-right:0}
[dir="rtl"] .dropdown-menu{text-align:right}
[dir="rtl"] .form-check{padding-right:1.5em;padding-left:0}
[dir="rtl"] .form-check .form-check-input{float:right;margin-right:-1.5em;margin-left:0}

.topbar{width:100%;max-width:100%;overflow:visible}
.topbar .container-fluid{width:100%;max-width:100%;box-sizing:border-box}
.navbar-brand{min-width:0;max-width:100%;white-space:normal;line-height:1.35}
.navbar-brand img{flex:0 0 auto}

main.container-fluid{width:100%;max-width:100%;box-sizing:border-box}
.card,.table-wrap{max-width:100%;box-sizing:border-box}
.table-responsive,.table-wrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.table{width:100%;max-width:none}

/* Do not let long Persian/English strings push a mobile page wider. */
h1,h2,h3,h4,h5,h6,p,div,span,a,label,td,th{overflow-wrap:anywhere}
.form-control,.form-select,.input-group{max-width:100%;box-sizing:border-box}
.input-group{display:flex;flex-wrap:nowrap}
.input-group>.form-control,.input-group>.form-select{min-width:0}
.btn{white-space:normal}

/* Login */
.auth-card{box-sizing:border-box;width:min(440px,calc(100vw - 24px));margin-left:auto;margin-right:auto}
.auth-card form{width:100%}
.auth-card label.form-label{display:block;width:100%;margin-bottom:.4rem}
.auth-card .form-control{display:block;width:100%;height:auto;min-height:46px}
.auth-card .form-check{display:flex;align-items:center;gap:.45rem;padding-right:0;padding-left:0}
.auth-card .form-check-input{float:none!important;margin:0!important;flex:0 0 auto}

@media (max-width:991.98px){
  .topbar .container-fluid{padding-left:12px!important;padding-right:12px!important}
  .navbar-brand{font-size:1rem;flex:1 1 auto}
  .navbar-toggler{flex:0 0 auto;margin-right:.5rem}
  .navbar-collapse{width:100%;padding-top:.5rem}
  .navbar-nav{width:100%}
  .navbar-nav .nav-link{padding:.65rem .75rem;border-radius:.5rem}
  .navbar-nav .nav-link:hover{background:rgba(255,255,255,.12)}
  .dropdown-menu{width:100%;border:0;border-radius:.75rem}
  .dropdown-item{white-space:normal;padding:.6rem .9rem}
  .topbar form{display:block;margin:.5rem 0 0}
  .topbar form .btn{width:100%}
  .topbar .text-white-50{display:block;margin:.5rem 0 0!important}
}

@media (max-width:767.98px){
  main.container-fluid{padding-left:12px!important;padding-right:12px!important;padding-top:16px!important}
  .page-title{font-size:1.25rem}
  .card.p-4{padding:1rem!important}
  .row{--bs-gutter-x:1rem}
  .table-wrap{padding:.5rem!important}
  .table-wrap .table{min-width:720px}
  .table-responsive .table{min-width:720px}
  .form-control,.form-select{font-size:1rem}
  .btn{min-height:42px}
  .auth-card{margin-top:20px;margin-bottom:20px;padding:20px!important;border-radius:16px}
  .auth-card h3{font-size:1.25rem;line-height:1.6}
}

@media (max-width:575.98px){
  .topbar .container-fluid{min-height:58px}
  .navbar-brand{font-size:.95rem;line-height:1.45}
  .navbar-brand img{width:32px!important;height:32px!important}
  .auth-card{width:calc(100vw - 24px);margin-left:auto;margin-right:auto}
  .auth-card .soft{font-size:.95rem;line-height:1.8}
  .row.g-3>[class*="col-"],.row.g-2>[class*="col-"]{width:100%;flex:0 0 100%;max-width:100%}
  .d-flex.justify-content-between{flex-wrap:wrap;gap:.75rem}
  .input-group{width:100%}
}

/* Final RTL navbar alignment */
[dir="rtl"] .navbar .me-auto{margin-right:auto!important;margin-left:0!important}
[dir="rtl"] .navbar .ms-auto{margin-left:auto!important;margin-right:0!important}
[dir="rtl"] .navbar .ms-2{margin-right:.5rem!important;margin-left:0!important}
[dir="rtl"] .navbar .ms-3{margin-right:1rem!important;margin-left:0!important}
/* Jalali date picker */
.jalali-picker{position:absolute;z-index:3000;display:none;width:300px;max-width:calc(100vw - 16px);background:#fff;border:1px solid #d9dee8;border-radius:14px;padding:10px;direction:rtl}.jp-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.jp-head button,.jp-foot button{border:0;background:#eef1f5;border-radius:8px;padding:5px 10px}.jp-week,.jp-days{display:grid;grid-template-columns:repeat(7,1fr);gap:3px;text-align:center}.jp-week span{font-size:.78rem;color:#687386;padding:5px}.jp-days button{border:0;background:transparent;border-radius:8px;padding:7px 0}.jp-days button:hover,.jp-days button.selected{background:#2457d6;color:#fff}.jp-foot{display:flex;justify-content:space-between;margin-top:8px}.persian-date-input{cursor:pointer;background-color:#fff!important}

.required-star{color:#dc3545;font-weight:800;margin-right:3px}
.settings-section{border:1px solid #e5e7eb;border-radius:14px;padding:1rem 1.1rem;margin-bottom:1rem;background:#fff}
.settings-section-title{font-weight:800;font-size:1.05rem;margin-bottom:1rem;padding-bottom:.7rem;border-bottom:1px solid #e5e7eb}

/* v38 - main navigation with RTL dropdowns */
.topbar .main-nav{gap:.15rem;align-items:center}
.topbar .main-nav .nav-link.btn{border:0;text-decoration:none;color:rgba(255,255,255,.88);font:inherit;padding:.6rem .65rem;white-space:nowrap}
.topbar .main-nav .nav-link.btn:hover,.topbar .main-nav .nav-link.btn:focus{color:#fff;background:rgba(255,255,255,.10)}
.topbar .dropdown-menu{text-align:right;min-width:220px;max-height:min(80vh,620px);overflow-y:auto}
.topbar .dropdown-item{line-height:1.65}
.topbar .account-menu{margin-inline-start:auto}
@media(max-width:991.98px){.topbar .main-nav{align-items:stretch}.topbar .main-nav .nav-link.btn{width:100%;text-align:right}.topbar .account-menu{width:100%;margin-top:.7rem}.topbar .account-menu>button{width:100%}}

/* v40: Windows Explorer-inspired RTL sidebar, shared by desktop and mobile. */
:root{--app-header-h:64px;--app-sidebar-w:272px;--app-sidebar-bg:#fff;--app-sidebar-line:#e7ebf3}
.app-header{height:var(--app-header-h);position:sticky;top:0;z-index:1050;background:linear-gradient(110deg,#173c9a,#2457d6);color:#fff;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 18px;box-shadow:0 3px 14px rgba(23,60,154,.18)}
.app-header-main,.app-header-actions{display:flex;align-items:center;gap:12px;min-width:0}
.app-brand{display:inline-flex;align-items:center;gap:10px;min-width:0;text-decoration:none;font-size:1.05rem;font-weight:800;color:#fff;line-height:1.5}
.app-brand:hover,.app-brand:focus{color:#fff}
.app-brand span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-brand-logo{height:36px;width:36px;object-fit:contain;flex-shrink:0}
.app-menu-toggle,.app-sidebar-close{border:1px solid rgba(255,255,255,.4);background:rgba(255,255,255,.1);color:inherit;border-radius:9px;display:grid;place-items:center;width:40px;height:40px;cursor:pointer;flex-shrink:0;font-size:1.35rem;line-height:1}
.app-menu-toggle:hover{background:rgba(255,255,255,.2)}
.app-header-home{color:#eef3ff;text-decoration:none;font-size:.9rem}
.app-header-home:hover{color:#fff;text-decoration:underline}
.app-header-user{border:1px solid rgba(255,255,255,.25);padding:6px 10px;border-radius:10px;font-size:.85rem;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-sidebar{position:fixed;right:0;top:var(--app-header-h);bottom:0;width:var(--app-sidebar-w);background:var(--app-sidebar-bg);border-left:1px solid var(--app-sidebar-line);box-shadow:-2px 0 14px rgba(20,34,65,.06);display:flex;flex-direction:column;z-index:1040;overflow:hidden;transition:transform .22s ease}
.app-sidebar-heading{height:52px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;padding:10px 18px;font-weight:800;color:#263d68;border-bottom:1px solid var(--app-sidebar-line)}
.app-sidebar-close{background:#eef3fc;color:#254f9c;border:0;display:none;width:32px;height:32px}
.explorer-tree{overflow-y:auto;overflow-x:hidden;flex:1;padding:12px 9px 22px;scrollbar-width:thin;overscroll-behavior:contain}
.explorer-group{margin:3px 0;border-radius:9px}
.explorer-group>summary{display:flex;align-items:center;gap:10px;padding:11px 12px;min-height:44px;cursor:pointer;color:#34465e;font-weight:700;list-style:none;border-radius:9px;user-select:none;outline-offset:2px;transition:background .15s}
.explorer-group>summary::-webkit-details-marker{display:none}
.explorer-group>summary:hover{background:#eff4ff;color:#1746a0}
.explorer-group[open]>summary{background:#eaf1ff;color:#1746a0}
.explorer-folder-icon{display:inline-grid;place-items:center;font-size:.95rem;width:18px;flex-shrink:0;transform:rotate(0deg);transition:transform .18s ease;color:#647caa}
.explorer-group[open] .explorer-folder-icon{transform:rotate(-90deg)}
.explorer-children{margin-right:21px;border-right:1px solid #d8e3f7;padding:4px 9px 7px 0;display:flex;flex-direction:column;gap:2px}
.explorer-leaf{display:flex;align-items:center;gap:9px;width:100%;min-height:39px;padding:8px 10px;border:0;border-radius:8px;background:transparent;text-decoration:none;text-align:right;color:#45536b;font-size:.9rem;line-height:1.55;cursor:pointer;overflow-wrap:break-word}
.explorer-leaf:hover,.explorer-leaf:focus-visible{background:#eef4ff;color:#1d52ae;text-decoration:none}
.explorer-leaf.is-active{background:#dfeaff;color:#163f92;font-weight:800;box-shadow:inset -3px 0 0 #2457d6}
.explorer-home{font-weight:700;margin-bottom:6px}
.explorer-leaf-icon{font-size:1.3rem;width:18px;flex-shrink:0;text-align:center}
.explorer-logout-form{margin:0;padding:0}
.explorer-logout{color:#ad2737}
.explorer-logout:hover{background:#fff0f0;color:#ad2737}
.app-sidebar-footer{font-size:.78rem;color:#718097;padding:13px 18px;border-top:1px solid var(--app-sidebar-line);overflow-wrap:anywhere}
.app-content{margin-right:var(--app-sidebar-w);min-width:0;transition:margin-right .22s ease}
.app-public .app-content{margin-right:0}
.app-sidebar-backdrop{display:none}
.app-mobile-bottom{display:none}
body.sidebar-collapsed .app-sidebar{transform:translateX(100%)}
body.sidebar-collapsed .app-content{margin-right:0}
/* Keep the main area contained: large report/price tables scroll inside their cards. */
.app-content main{min-width:0;width:100%;max-width:100%;box-sizing:border-box}
.app-content .table-wrap,.app-content .table-responsive{max-width:100%;overflow-x:auto}
@media(max-width:991.98px){
  :root{--app-header-h:60px;--app-sidebar-w:min(84vw,310px)}
  .app-header{padding:0 12px}
  .app-brand{font-size:.94rem}
  .app-header-user,.app-header-home{display:none}
  .app-sidebar{z-index:1102;transform:translateX(102%);box-shadow:-8px 0 30px rgba(20,34,65,.16);top:0}
  .app-sidebar-heading{height:60px}
  .app-sidebar-close{display:grid}
  .app-content,body.sidebar-collapsed .app-content{margin-right:0}
  body.sidebar-open .app-sidebar,body.sidebar-open.sidebar-collapsed .app-sidebar{transform:translateX(0)}
  body.sidebar-open{overflow:hidden}
  body.sidebar-open .app-sidebar-backdrop{display:block;position:fixed;inset:0;background:rgba(12,22,42,.5);z-index:1101}
  .app-mobile-bottom{display:flex;position:fixed;bottom:0;right:0;left:0;height:62px;z-index:1050;background:#fff;border-top:1px solid #dae3f0;align-items:stretch;justify-content:space-evenly;box-shadow:0 -4px 14px rgba(22,45,80,.06);padding-bottom:env(safe-area-inset-bottom,0px);box-sizing:content-box}
  .app-mobile-bottom a,.app-mobile-bottom button{flex:1;border:0;background:transparent;text-decoration:none;color:#52627c;display:flex;align-items:center;justify-content:center;flex-direction:column;font-size:.75rem;gap:0;line-height:1.3;padding:6px 0;cursor:pointer}
  .app-mobile-bottom a span,.app-mobile-bottom button span{font-size:1.5rem;line-height:1.1}
  .app-mobile-bottom a:hover,.app-mobile-bottom button:hover{background:#edf3ff;color:#19479c}
  .app-content{padding-bottom:calc(70px + env(safe-area-inset-bottom,0px))}
}
@media(min-width:992px){.app-sidebar{top:var(--app-header-h)}}
@media(prefers-reduced-motion:reduce){.app-sidebar,.app-content,.explorer-folder-icon{transition:none}}
/* Explorer cues: folder glyphs and branch dots without external icon dependencies. */
.explorer-group>summary::before{content:"📁";font-size:.94rem;line-height:1;flex-shrink:0}
.explorer-group[open]>summary::before{content:"📂"}
.explorer-children>a.explorer-leaf::before,.explorer-logout-form>.explorer-leaf::before{content:"•";font-size:1rem;color:#90a1bc;flex-shrink:0}

/* v42 compact presentation (also embedded as critical CSS in the shared layout). */
html{font-size:15px}body{font-size:.92rem;line-height:1.58}
.app-brand{font-size:.94rem}.app-sidebar{font-size:.85rem}
.app-sidebar-heading{font-size:.85rem;height:46px;padding:8px 14px}
.explorer-tree{padding:7px 7px 15px}
.explorer-group>summary{min-height:35px;padding:7px 9px;gap:7px;font-size:.86rem;font-weight:600}
.explorer-children{margin-right:15px;padding:2px 7px 4px 0}
.explorer-leaf{min-height:32px;padding:5px 9px;font-size:.81rem;gap:6px;line-height:1.45}
.explorer-leaf-icon{font-size:1rem}.app-sidebar-footer{padding:9px 12px;font-size:.73rem}
.page-title{font-size:1.45rem;line-height:1.4}
h1{font-size:1.7rem}h2{font-size:1.45rem}h3{font-size:1.28rem}h4{font-size:1.12rem}h5{font-size:1rem}
.table{font-size:.88rem}.form-label,.form-check-label{font-size:.87rem}
.btn{font-size:.86rem}.form-control,.form-select{font-size:.9rem}
.app-top-logout-form{margin:0;display:flex;align-items:center}
.app-top-logout{font-family:inherit;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.35);border-radius:8px;color:#fff;padding:7px 13px;font-size:.85rem;cursor:pointer;white-space:nowrap}
.app-top-logout:hover,.app-top-logout:focus-visible{background:rgba(255,255,255,.25)}
@media(max-width:767.98px){html{font-size:15px}.form-control,.form-select{font-size:16px}.app-header{gap:7px}.app-brand{font-size:.87rem}.app-content main{padding:12px}.app-top-logout{padding:7px 9px;font-size:.8rem}.app-header-actions{gap:5px}}
