/* مدیریار — بستهٔ تکفایلی CSS (ساختهشده توسط build-css.php) */
/* ── style.css ── */
:root{--paper: #eef1f4;--surface: #ffffff;--ink: #1c2733;--ink-dim: #5b6b7b;--line: #d5dde4;--accent: #e8611a;--accent-dim: #fdeee4;--teal: #177a7a;--teal-dim: #d7e8e8;--green: #2f7d4f;--green-dim: #dcefe2;--red: #c23b3b;--red-dim: #f7dede;--blue: #3a7bc8;--blue-dim: #e8f0fe;--purple: #7a3fb8;--purple-dim: #efe6f7;--font-body: "Vazirmatn", system-ui, sans-serif;--font-display: "Lalezar", "Vazirmatn", sans-serif;--font-mono: "Courier New", ui-monospace, monospace;--text-xs: .6875rem;--text-sm: .8125rem;--text-base: .9375rem;--text-md: 1.2rem;--text-lg: 1.25rem;--text-xl: 1.5rem;--text-2xl: 1.875rem;--text-3xl: 2.25rem;--radius: 10px;--radius-lg: 16px;--shadow: none;--shadow-lg: none;--z-base: 1;--z-topbar: 100;--z-taskbar: 100;--z-notif-panel: 200;--z-overlay: 500;--z-modal: 600;--z-toast: 900;--topbar-h: 64px;--taskbar-h: 72px;--chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b6b7b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") }@font-face{font-family:Vazirmatn;src:url(font/Vazirmatn.woff2) format("woff2");font-weight:400 900;font-style:normal;font-display:swap}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;font-size:16px}body{font-family:var(--font-body);font-size:var(--text-base);color:var(--ink);direction:rtl;min-height:100vh;line-height:1.7;-webkit-tap-highlight-color:transparent;background:radial-gradient(1000px 480px at 88% -10%,rgba(232,97,26,.07),transparent 60%),radial-gradient(800px 500px at -10% 110%,rgba(23,122,122,.06),transparent 55%),linear-gradient(180deg,#f2f5f8,var(--paper))}body:before{content:"";position:fixed;inset:0;pointer-events:none;z-index:0;background-image:linear-gradient(rgba(23,122,122,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(23,122,122,.04) 1px,transparent 1px);background-size:28px 28px;-webkit-mask-image:linear-gradient(#000 50%,transparent);mask-image:linear-gradient(#000 50%,transparent)}button,input,select,textarea{font-family:inherit;font-size:inherit}button{cursor:pointer;border:none;background:none}a{color:inherit;text-decoration:none}[hidden]{display:none!important}img{max-width:100%;display:block}::selection{background:var(--accent-dim);color:var(--ink)}input::placeholder,textarea::placeholder{color:#9aa7b3}input[type=checkbox],input[type=radio]{accent-color:var(--accent)}select{cursor:pointer}details summary{cursor:pointer;font-size:var(--text-sm);color:var(--teal);font-weight:700}details pre{margin-top:6px;padding:8px 10px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);font-size:.7rem;max-width:320px;overflow:auto;direction:ltr;text-align:left}*::-webkit-scrollbar{width:8px;height:8px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:var(--line);border-radius:99px}*::-webkit-scrollbar-thumb:hover{background:var(--accent)}:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}.muted{color:var(--ink-dim);font-size:var(--text-sm)}.mono,.mono-link{font-family:var(--font-mono);font-size:.85em}.mono-link{color:var(--teal);font-weight:700}.mono-link:hover{text-decoration:underline}.display{font-family:var(--font-display);font-size:var(--text-2xl);line-height:1.2;font-weight:400}.hint{font-size:var(--text-xs);color:var(--ink-dim);margin-top:4px;line-height:1.6}.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:11px 20px;border-radius:var(--radius);font-weight:800;font-size:var(--text-base);background:var(--paper);border:2px solid var(--line);color:var(--ink);transition:transform .15s,box-shadow .15s,background .15s,color .15s,border-color .15s;white-space:nowrap;line-height:1.3}.btn:hover{transform:translateY(-2px);box-shadow:var(--shadow)}.btn:active{transform:translateY(0) scale(.98)}.btn:disabled{opacity:.5;transform:none;box-shadow:none;cursor:not-allowed}.btn.loading{pointer-events:none;animation:btnPulse 1s ease-in-out infinite}.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 4px 14px #e8611a40}.btn-primary:hover{box-shadow:0 8px 22px #e8611a59}.btn-teal{background:var(--teal);border-color:var(--teal);color:#fff}.btn-teal:hover{box-shadow:0 8px 22px #177a7a4d}.btn-danger{background:var(--red);border-color:var(--red);color:#fff}.btn-danger-o{background:var(--red-dim);border-color:transparent;color:var(--red)}.btn-danger-o:hover{background:var(--red);color:#fff}.btn-ghost{background:var(--paper);color:var(--ink-dim)}.btn-ghost:hover{background:#e3e9ee;color:var(--ink)}.btn-block{width:100%}.btn-tall{min-height:54px;font-size:var(--text-md)}.btn-sm{padding:8px 14px;font-size:var(--text-sm);min-height:auto}.link-btn{background:none;color:var(--teal);font-size:var(--text-sm);font-weight:700;text-decoration:underline;transition:color .15s}.link-btn:hover{color:var(--accent)}.field{margin-bottom:16px}.field label{display:block;font-size:var(--text-sm);font-weight:700;color:var(--ink-dim);margin-bottom:6px}.field input,.field select,.field textarea,.search-input,#order-status-filter{width:100%;min-height:48px;padding:0 14px;border:2px solid var(--line);border-radius:var(--radius);font-size:var(--text-base);background:var(--paper);transition:border-color .2s,box-shadow .2s,background .2s}.field textarea{padding:12px 14px;min-height:80px;resize:vertical;line-height:1.6}.field select,.search-input,#order-status-filter{appearance:none;background-image:var(--chevron);background-repeat:no-repeat;background-position:left 14px center;background-size:12px;padding-left:36px}.field input:focus,.field select:focus,.field textarea:focus,.search-input:focus,#order-status-filter:focus{outline:none;border-color:var(--accent);background:#fff;box-shadow:0 0 0 3px #e8611a1f}.check-field label{display:flex;align-items:center;gap:10px;font-weight:500;color:var(--ink);font-size:var(--text-base)}.check-field input{width:auto;min-height:auto}.search-input,#order-status-filter{width:auto;min-width:220px}#order-status-filter{min-width:180px}.form-row-inline{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.form-row-inline input,.form-row-inline select{flex:1;min-width:160px;min-height:48px;padding:0 14px;border:2px solid var(--line);border-radius:var(--radius);background:var(--paper);font-size:var(--text-base);transition:border-color .2s,background .2s}.form-row-inline input:focus,.form-row-inline select:focus{outline:none;border-color:var(--accent);background:#fff}.form-row-inline .btn{min-height:48px}#settings-form .field{max-width:640px}.login-wrap{min-height:100vh;display:grid;place-items:center;padding:24px;position:relative;z-index:var(--z-base)}.login-card{width:min(440px,100%);background:var(--surface);border-radius:var(--radius-lg);border-top:6px solid var(--accent);box-shadow:var(--shadow-lg);padding:2.4rem 2rem;animation:cardIn .5s ease backwards}.login-card.shake{animation:shake .4s}.login-head{text-align:center;margin-bottom:1.6rem}.login-stamp{width:60px;height:60px;margin:0 auto 14px;border:3px solid var(--accent);border-radius:50%;display:grid;place-items:center;font-weight:900;font-size:1.5rem;color:var(--accent);transform:rotate(-8deg);transition:transform .3s}.login-card:hover .login-stamp{transform:rotate(4deg) scale(1.05)}.login-head h1{font-family:var(--font-display);font-size:var(--text-3xl);font-weight:400}.login-head p{font-size:var(--text-sm);color:var(--ink-dim);margin-top:4px}.sys-ok{display:inline-flex;align-items:center;gap:7px;font-size:var(--text-xs);color:var(--green);background:var(--green-dim);padding:5px 14px;border-radius:99px;margin-top:14px}.sys-ok .dot{width:8px;height:8px;border-radius:50%;background:var(--green);animation:pulse 2s infinite}.login-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:1.6rem}.login-tab{padding:12px;border-radius:var(--radius);border:2px solid var(--line);background:var(--paper);font-weight:700;font-size:var(--text-base);color:var(--ink-dim);transition:all .18s}.login-tab:hover{border-color:var(--ink-dim)}.login-tab.active{background:var(--ink);border-color:var(--ink);color:#fff}.login-pane{display:none}.login-pane.active{display:block;animation:fadeUp .3s ease}.code-input{text-align:center;letter-spacing:12px;font-size:1.5rem!important;font-weight:900;font-family:var(--font-display)!important}.topbar{position:sticky;top:0;z-index:var(--z-topbar);background:var(--ink);color:#fff;box-shadow:0 4px 18px #00000038;border-bottom:3px solid var(--accent)}.topbar-inner{max-width:1320px;margin:auto;padding:0 24px;height:var(--topbar-h);display:flex;align-items:center;gap:18px;justify-content:space-between}.brand{display:flex;align-items:center;gap:10px;flex-shrink:0}.brand-stamp{width:36px;height:36px;border:2px solid var(--accent);border-radius:50%;display:grid;place-items:center;color:var(--accent);font-weight:900;transform:rotate(-8deg);transition:transform .3s}.brand:hover .brand-stamp{transform:rotate(6deg) scale(1.06)}.brand-name{font-family:var(--font-display);font-size:var(--text-xl)}.topnav{display:flex;gap:2px;overflow-x:auto;flex:1;scrollbar-width:none}.topnav::-webkit-scrollbar{display:none}.nav-link{display:flex;align-items:center;gap:6px;padding:10px 14px;border-radius:var(--radius);color:#b9c4ce;font-size:var(--text-sm);font-weight:600;white-space:nowrap;transition:all .18s;border-bottom:3px solid transparent}.nav-link:hover{color:#fff;background:#ffffff14}.nav-link.active{color:var(--accent);background:#e8611a24;border-bottom-color:var(--accent)}.nav-ic{font-size:1.1rem}.user-chip{display:flex;align-items:center;gap:14px;flex-shrink:0}.me-box{text-align:left}.me-name{display:block;font-size:var(--text-sm);font-weight:800}.me-role{display:block;font-size:var(--text-xs);color:#93a1ad}#logout-btn{background:#ffffff1a;border:2px solid rgba(255,255,255,.2);color:#fff;font-size:var(--text-sm)}#logout-btn:hover{background:var(--red);border-color:var(--red)}.notif-wrap{position:relative}.notif-btn{position:relative;background:#ffffff1a;width:44px;height:44px;border-radius:50%;font-size:1.15rem;transition:background .2s,transform .2s}.notif-btn:hover{background:#fff3;transform:rotate(-12deg)}.notif-badge{position:absolute;top:-4px;left:-4px;background:var(--red);color:#fff;font-size:var(--text-xs);font-weight:800;min-width:18px;height:18px;border-radius:99px;display:grid;place-items:center;padding:0 4px;animation:fadeUp .25s ease}.notif-panel{position:absolute;top:calc(100% + 10px);left:0;width:350px;max-height:420px;overflow:auto;background:var(--surface);color:var(--ink);border-radius:14px;box-shadow:var(--shadow-lg);border:1px solid var(--line);z-index:var(--z-notif-panel);animation:fadeUp .2s ease}.notif-head{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--surface);z-index:1;font-size:var(--text-base)}.notif-item{padding:12px 16px;border-bottom:1px dashed var(--line);font-size:var(--text-sm);cursor:pointer;transition:background .15s}.notif-item:hover{background:var(--paper)}.notif-item.unread{background:var(--accent-dim);border-inline-start:3px solid var(--accent)}.notif-item time{display:block;font-size:var(--text-xs);color:var(--ink-dim);margin-top:4px}.container{max-width:1320px;margin:auto;padding:28px 24px calc(var(--taskbar-h) + 40px + env(safe-area-inset-bottom));position:relative;z-index:var(--z-base)}.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:24px;flex-wrap:wrap}.head-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow);padding:22px;margin-bottom:20px}.panel-title{font-size:var(--text-md);font-weight:800;margin-bottom:16px;display:flex;align-items:center;gap:8px}.panel-head-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.panel-head-row .panel-title{margin-bottom:0}.table-panel{padding:0;overflow:hidden}.tb-btn{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 18px;border-radius:12px;color:#93a1ad;font-size:var(--text-xs);font-weight:700;transition:all .2s;min-width:80px}.job-ticket-title{font-weight:800;font-size:var(--text-md);line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.ceo-alert span{color:var(--ink)}.ceo-quick-panel{margin-top:18px}.ceo-quick-links{display:flex;flex-wrap:wrap;gap:8px}.ceo-quick-link{display:inline-flex;align-items:center;gap:7px;padding:10px 13px;border:1px solid var(--line);border-radius:var(--radius);background:var(--paper);font-weight:800}.ceo-quick-link:hover{border-color:var(--accent);background:var(--accent-dim)}.ceo-quick-link span{font-size:1.1rem}.ceo-system-details{margin-top:16px;border-top:1px dashed var(--line);padding-top:12px}.ceo-system-details summary{font-weight:800;color:var(--ink-dim)}.ceo-system-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.ceo-system-links a{padding:7px 10px;color:var(--ink-dim);font-size:var(--text-sm)}.invoice-total{font-size:var(--text-md);font-weight:900;color:var(--teal);margin-top:12px}.invoice-field-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;margin-bottom:8px;background:var(--surface)}.invoice-field-row .if-name{flex:1}.invoice-field-row .if-name small{display:block;font-size:.7rem;color:var(--ink-dim)}.invoice-field-row .if-section{width:140px;padding:6px 10px;border:1px solid var(--line);border-radius:6px;font-size:.8rem}.invoice-field-row .if-label{flex:1;padding:6px 10px;border:1px solid var(--line);border-radius:6px;font-size:.8rem}.invoice-field-row .if-req-label{display:flex;align-items:center;gap:4px;font-size:.75rem;color:var(--ink-dim);white-space:nowrap}.invoice-item-row input{padding:8px 12px;border:1px solid var(--line);border-radius:6px;font-size:.85rem}.spec-edit-row{display:flex;align-items:center;gap:10px;padding:6px 0}.spec-edit-row b{min-width:120px;font-size:.85rem}.spec-edit-row input{padding:6px 10px;border:1px solid var(--line);border-radius:6px;font-size:.85rem}.invoice-field-row span{display:flex;flex-direction:column}.invoice-field-row small{color:var(--ink-dim);font-size:var(--text-xs)}.invoice-input-row{gap:12px}.invoice-input-row .field{flex:1;margin-bottom:0}.invoice-order-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px;margin:6px 0;background:var(--paper);border-radius:var(--radius)}.invoice-order-item label{flex:1}.invoice-order-item input[type=number]{width:180px;min-height:42px;padding:0 10px;border:2px solid var(--line);border-radius:var(--radius)}.job-ticket-desc{font-size:var(--text-sm);color:var(--ink-dim);margin-top:6px;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.table-wrap{overflow:auto;max-height:600px;-webkit-overflow-scrolling:touch}table{width:100%;border-collapse:collapse;min-width:600px}th{background:var(--paper);color:var(--ink-dim);font-size:var(--text-sm);font-weight:700;text-align:right;padding:14px 16px;border-bottom:2px solid var(--line);position:sticky;top:0;z-index:3;white-space:nowrap}td{padding:14px 16px;border-bottom:1px solid #e8edf2;font-size:var(--text-base);vertical-align:middle;line-height:1.5}tbody tr{transition:background .15s}tbody tr:hover{background:#fdf3ec}tbody tr:last-child td{border-bottom:none}.row-actions{display:flex;gap:6px;flex-wrap:wrap}.table-panel th:first-child,.table-panel td:first-child{position:sticky;inset-inline-start:0;z-index:2;background:var(--surface)}.table-panel th:first-child{background:var(--paper);z-index:4}tbody tr:hover td:first-child{background:#fdf3ec}.stat-strip{display:flex;flex-wrap:wrap;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow);overflow:hidden;margin-bottom:22px}.stat{flex:1 1 160px;padding:22px 24px;position:relative;transition:background .25s}.stat+.stat{border-inline-start:1px dashed var(--line)}.stat:hover{background:#fdf3ec}.stat b{display:block;font-family:var(--font-display);font-size:var(--text-3xl);line-height:1.1;color:var(--ink);font-weight:400;transition:color .25s}.stat:hover b{color:var(--accent)}.stat span{display:block;font-size:var(--text-sm);color:var(--ink-dim);font-weight:600;margin-top:4px}.stat:after{content:"";position:absolute;inset-inline-start:0;bottom:0;height:3px;width:0;background:var(--accent);transition:width .35s}.stat:hover:after{width:100%}.app-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:14px;margin-bottom:24px}.app-tile{display:flex;flex-direction:column;align-items:center;gap:8px;padding:22px 10px 18px;background:var(--surface);border:2px solid var(--line);border-radius:var(--radius-lg);transition:all .2s cubic-bezier(.2,.9,.3,1.1);position:relative;overflow:hidden}.app-tile:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 50% 0%,rgba(232,97,26,.08),transparent 70%);opacity:0;transition:opacity .25s}.app-tile:hover{transform:translateY(-4px) scale(1.03);border-color:var(--accent);box-shadow:0 10px 28px #e8611a26}.app-tile:hover:before{opacity:1}.app-tile:active{transform:translateY(-1px) scale(.98)}.app-ic{font-size:2.1rem;line-height:1;filter:drop-shadow(0 2px 4px rgba(0,0,0,.1));transition:transform .25s}.app-tile:hover .app-ic{transform:scale(1.15) rotate(-4deg)}.app-label{font-size:var(--text-sm);font-weight:800;color:var(--ink-dim);text-align:center;transition:color .2s}.app-tile:hover .app-label{color:var(--accent)}.taskbar{position:fixed;bottom:0;inset-inline:0;z-index:var(--z-taskbar);display:flex;align-items:stretch;justify-content:center;gap:6px;padding:10px 16px calc(10px + env(safe-area-inset-bottom));background:var(--ink);box-shadow:0 -4px 20px #00000040;border-top:2px solid rgba(232,97,26,.4)}.tb-btn{display:flex;flex-direction:column;align-items:center;gap:3px;padding:0 18px;border-radius:12px;color:#93a1ad;font-size:var(--text-xs);font-weight:700;transition:all .2s;min-width:80px}.tb-btn:hover{color:#fff;background:#ffffff14}.tb-btn.active{color:var(--accent);background:#e8611a26}.tb-ic{font-size:1.3rem;line-height:1}.tb-txt{font-size:var(--text-xs)}.tb-spacer{min-width:80px}.tb-home{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 24px;margin-top:-20px;border-radius:50% 50% 14px 14px;background:var(--accent);color:#fff;box-shadow:0 4px 16px #e8611a66;transition:all .2s;min-width:72px}.tb-home:hover{transform:translateY(-3px);box-shadow:0 8px 24px #e8611a80}.tb-home:active{transform:translateY(0) scale(.95)}.tb-home.active{background:#b34a12}.tb-home-ic{font-size:1.5rem;line-height:1;padding-top:4px}.tb-home .tb-txt{font-size:var(--text-xs);font-weight:800}.badge{display:inline-flex;align-items:center;gap:6px;padding:5px 13px;border-radius:99px;font-size:var(--text-xs);font-weight:700}.badge .dot{width:7px;height:7px;border-radius:50%}.badge.role{background:var(--teal-dim);color:var(--teal)}.badge.ok{background:var(--green-dim);color:var(--green)}.badge.ok .dot{background:var(--green);animation:pulse 2s infinite}.badge.off{background:var(--red-dim);color:var(--red)}.badge.off .dot{background:var(--red)}.mat-badge{display:inline-flex;align-items:center;gap:4px;padding:5px 13px;border-radius:99px;font-size:var(--text-xs);font-weight:800}.mat-customer{background:var(--blue-dim);color:var(--blue)}.mat-workshop{background:var(--accent-dim);color:var(--accent)}.mat-mixed{background:var(--purple-dim);color:var(--purple)}.mat-none{background:var(--paper);color:var(--ink-dim);border:1px dashed var(--line)}.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:18px}.job-ticket{background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow);border-inline-start:6px solid var(--accent);position:relative;overflow:hidden;transition:transform .2s,box-shadow .2s}.job-ticket:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg)}.job-ticket.priority-urgent{border-inline-start-color:var(--red)}.job-ticket.priority-urgent:hover{box-shadow:0 12px 32px #c23b3b2e}.job-ticket.status-done{border-inline-start-color:var(--green)}.job-ticket-body{padding:20px 22px 16px}.job-ticket-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:8px}.job-ticket-title{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.job-ticket-id{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--ink-dim);white-space:nowrap}.job-ticket-client{font-size:var(--text-md);color:var(--teal);font-weight:800}.job-ticket-client strong{display:block}.task-specs{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.task-spec{padding:5px 9px;border-radius:7px;background:var(--blue-dim);color:var(--ink);font-size:var(--text-sm)}.task-spec b{color:var(--teal)}.task-detail-specs{margin-top:14px}.task-detail-specs>b{display:block;margin-bottom:8px}.task-customer-focus{padding:14px 16px;border-radius:var(--radius);background:var(--teal-dim);border-inline-start:5px solid var(--teal);margin-bottom:14px}.task-customer-focus span{display:block;color:var(--ink-dim);font-size:var(--text-sm)}.task-customer-focus strong{display:block;color:var(--teal);font-size:var(--text-xl);line-height:1.4}.task-detail-files{margin-top:16px;padding-top:14px;border-top:1px dashed var(--line)}.task-file-list{display:grid;gap:8px;margin-top:10px}.task-file-download{display:flex;align-items:center;gap:10px;min-height:52px;padding:10px 12px;border:2px solid var(--line);border-radius:var(--radius);background:var(--paper);color:var(--ink)}.task-file-download:hover{border-color:var(--teal);background:var(--teal-dim)}.task-file-download strong{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.task-file-download small{color:var(--ink-dim);white-space:nowrap}.file-edit-section{margin-top:12px}.file-edit-section>b{display:block;margin-bottom:8px}.file-edit-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;margin-bottom:7px;border:1px solid var(--line);border-radius:var(--radius);background:var(--paper)}.file-edit-row>a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--teal);font-weight:700}.file-edit-actions{display:flex;gap:5px;flex-shrink:0}.report-form-intro{display:flex;justify-content:space-between;gap:10px;padding:10px 12px;margin-bottom:16px;border-radius:var(--radius);background:var(--teal-dim);color:var(--ink);font-size:var(--text-sm)}.report-form-intro span,.optional-label{color:var(--ink-dim);font-size:var(--text-xs)}.required-label{color:var(--red);font-size:var(--text-xs)}.form-error{color:var(--red);background:var(--red-dim);border-radius:var(--radius);padding:10px 12px;margin-top:10px;font-size:var(--text-sm)}.report-field.optional-field{opacity:.9}.field-invalid{border-color:var(--red)!important;background:var(--red-dim)!important;box-shadow:0 0 0 3px #dc262626!important}.operator-app-grid{display:none}.ceo-dashboard{margin-bottom:18px}.ceo-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:10px}.ceo-section-head h2{font-size:var(--text-md);font-weight:900}.ceo-section-head span{color:var(--ink-dim);font-size:var(--text-sm)}.ceo-system-section{padding-top:4px}.ceo-system-grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}.ceo-system-grid .app-tile{padding:14px 8px 12px;opacity:.82}.ceo-alerts-panel{border-inline-start:5px solid var(--red)}.ceo-alert-list{display:grid;gap:8px}.ceo-alert{display:grid;grid-template-columns:1fr 1.5fr auto;gap:12px;align-items:center;padding:10px 12px;border-radius:var(--radius);background:var(--red-dim);color:var(--ink)}.ceo-alert strong{color:var(--red)}.ceo-alert b{color:var(--red);font-size:var(--text-sm)}.operator-workspace .stat-strip{margin-bottom:16px}.operator-primary-panel{order:-1}.job-ticket-desc{display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.job-ticket-meta{display:flex;gap:6px;flex-wrap:wrap;margin-top:14px;align-items:center}.job-ticket-actions{display:flex;gap:8px;padding:16px 22px 20px;border-top:2px dashed var(--line);margin-top:4px}.job-ticket-actions .btn{min-height:48px;font-size:var(--text-base)}.stamp-done{position:absolute;top:14px;left:14px;border:3px solid var(--green);color:var(--green);border-radius:8px;padding:2px 10px;font-weight:900;font-size:var(--text-xs);font-family:var(--font-display);letter-spacing:1px;transform:rotate(-10deg);opacity:.9;background:#dcefe299;z-index:2}.stage-group{border:2px dashed var(--line);border-radius:var(--radius-lg);padding:18px;margin-bottom:14px;background:#fbfcfd;transition:border-color .2s,box-shadow .2s}.stage-group:hover{border-color:var(--teal);box-shadow:var(--shadow)}.stage-group-head{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap}.stage-num{width:36px;height:36px;border-radius:50%;background:var(--ink);color:#fff;font-family:var(--font-display);font-size:var(--text-md);display:grid;place-items:center;flex-shrink:0}.stage-title{flex:1;min-width:180px;min-height:44px;padding:0 14px;border:2px solid var(--line);border-radius:var(--radius);background:#fff;font-size:var(--text-base);transition:border-color .2s,box-shadow .2s}.stage-title:focus{outline:none;border-color:var(--teal);box-shadow:0 0 0 3px #177a7a1f}.stage-tasks{border-inline-start:2px solid var(--line);margin-inline-start:18px;padding-inline-start:16px;margin-bottom:10px}.stage-track{display:flex;flex-direction:column;gap:10px}.stage-item{border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;background:var(--paper);transition:transform .15s,box-shadow .15s,border-color .2s,opacity .2s}.stage-item:hover{transform:translate(-3px);box-shadow:var(--shadow)}.stage-item.active{border-color:var(--accent);border-inline-start:4px solid var(--accent);background:#fff}.stage-item.done{border-color:var(--green);border-inline-start:4px solid var(--green)}.stage-item.waiting{opacity:.72}.stage-item-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}.stage-chip{min-width:28px;height:28px;padding:0 8px;border-radius:99px;background:var(--ink);color:#fff;font-family:var(--font-display);font-size:var(--text-base);display:inline-grid;place-items:center}.stage-chip.sm{min-width:22px;height:22px;font-size:var(--text-sm)}.stage-count{margin-inline-start:auto;font-size:var(--text-xs);color:var(--ink-dim)}.stage-bar{height:6px;border-radius:99px;background:var(--line);overflow:hidden}.stage-bar i{display:block;height:100%;border-radius:99px;background:var(--green);transition:width .6s cubic-bezier(.2,.9,.3,1)}.stage-item.active .stage-bar i{background:var(--accent)}.devices-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px;justify-items:center}.device-card{background:var(--paper);width:120px;height:120px;border:2px solid transparent;border-radius:var(--radius);padding:14px;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;transition:transform .2s,border-color .2s,box-shadow .2s;font-family:inherit}.device-card:hover{transform:translateY(-2px);box-shadow:var(--shadow)}.device-card.free{border-color:var(--green)}.device-card.busy{border-color:var(--red)}.device-card.maintenance{border-color:var(--accent)}.device-icon{font-size:1.8rem}.device-name{font-size:var(--text-sm);font-weight:700}.device-status{font-size:var(--text-xs);color:var(--ink-dim)}.device-picker-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}.device-pick-btn{background:var(--paper);border:2px solid var(--line);border-radius:var(--radius);padding:18px 10px;display:flex;flex-direction:column;align-items:center;gap:6px;transition:all .15s}.device-pick-btn:hover{border-color:var(--accent);background:#fdf3ec;transform:scale(1.03)}.device-pick-btn .device-name{font-size:var(--text-sm)}.overlay{position:fixed;inset:0;background:#1c27338c;backdrop-filter:blur(3px);display:none;place-items:center;padding:20px;z-index:var(--z-overlay)}.overlay.open{display:grid;animation:fadeIn .2s ease}.modal{width:min(640px,100%);max-height:88vh;overflow:auto;background:var(--surface);border-radius:var(--radius-lg);border-top:5px solid var(--accent);box-shadow:var(--shadow-lg);padding:24px;animation:modalIn .25s cubic-bezier(.2,.9,.3,1.15);z-index:var(--z-modal);display:flex;flex-direction:column}.modal-sm{width:min(440px,100%)}.modal.center{text-align:center}.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;flex-shrink:0}.modal-head h3{font-family:var(--font-display);font-size:var(--text-xl);font-weight:400}.modal-x{background:var(--paper);width:36px;height:36px;border-radius:50%;font-size:1.3rem;color:var(--ink-dim);transition:all .2s;flex-shrink:0}.modal-x:hover{background:var(--red-dim);color:var(--red);transform:rotate(90deg)}.modal form{display:flex;flex-direction:column;flex:1;min-height:0}.modal-actions{display:flex;gap:10px;margin-top:20px;padding-top:16px;border-top:1px solid var(--line);flex-shrink:0;position:sticky;bottom:-24px;background:var(--surface);z-index:1}.modal-actions .btn{flex:1 1 auto}.modal-actions .btn-primary,.modal-actions .btn-danger,.modal-actions .btn-teal{flex:1 1 60%}.modal-actions .btn-ghost{flex:1 1 40%}.confirm-text{font-size:var(--text-base);margin:4px 0 18px;line-height:1.9;white-space:pre-line}.checklist{display:flex;flex-direction:column;gap:8px;max-height:320px;overflow:auto}.check-row{display:flex;align-items:center;gap:10px;padding:12px 14px;background:var(--paper);border-radius:var(--radius);font-size:var(--text-base);cursor:pointer;transition:background .15s,transform .15s}.check-row:hover{background:var(--accent-dim);transform:translate(-3px)}.check-row input{width:18px;height:18px}.sheet-overlay{position:fixed;inset:0;background:#1c27338c;backdrop-filter:blur(3px);z-index:var(--z-overlay);display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transition:all .25s;padding:20px}.sheet-overlay.active{opacity:1;visibility:visible}.sheet{background:var(--surface);width:100%;max-width:580px;max-height:88vh;overflow:auto;border-radius:20px;border-top:5px solid var(--teal);padding:24px 26px;transform:translateY(24px) scale(.98);transition:transform .3s cubic-bezier(.32,.72,0,1);box-shadow:var(--shadow-lg)}.sheet-overlay.active .sheet{transform:translateY(0) scale(1)}.sheet-handle{width:40px;height:4px;background:var(--line);border-radius:99px;margin:0 auto 16px}.sheet h3{font-family:var(--font-display);font-size:var(--text-xl);font-weight:400;margin-bottom:12px}.sheet-actions{display:flex;gap:10px;margin-top:18px}.sheet-actions .btn{flex:1}#toasts{position:fixed;bottom:calc(var(--taskbar-h) + 16px + env(safe-area-inset-bottom));left:50%;transform:translate(-50%);display:flex;flex-direction:column-reverse;gap:8px;width:min(400px,calc(100% - 2rem));z-index:var(--z-toast)}.toast{background:var(--ink);color:#fff;padding:14px 20px;border-radius:var(--radius);font-size:var(--text-base);box-shadow:var(--shadow-lg);border-inline-start:4px solid var(--green);animation:toastIn .3s ease}.toast.error{border-inline-start-color:var(--red);background:var(--red)}.toast.out{animation:toastOut .3s ease forwards}.task-row{border:1px dashed var(--line);border-radius:var(--radius);padding:18px;margin-bottom:14px;background:#fbfcfd;transition:border-color .2s,box-shadow .2s}.task-row:hover{border-color:var(--accent-dim);box-shadow:var(--shadow)}.task-row hr{border:0;border-top:1px dashed var(--line);margin:14px 0 0}.upload-box{display:block;border:2px dashed var(--line);border-radius:var(--radius);padding:14px 16px;background:#fbfcfd;cursor:pointer;transition:border-color .2s,background .2s,transform .15s}.upload-box:hover{border-color:var(--accent);background:#fdf3ec}.upload-box:active{transform:scale(.995)}.upload-box input{display:none}.upload-box .up-label{display:block;font-size:var(--text-sm);font-weight:700;color:var(--ink-dim);transition:color .2s}.upload-box:hover .up-label{color:var(--accent)}.file-chip{display:inline-flex;align-items:center;gap:6px;background:var(--teal-dim);color:var(--teal);border-radius:99px;padding:6px 14px;font-size:var(--text-sm);font-weight:700;margin:3px;transition:transform .15s,box-shadow .15s}.file-chip:hover{transform:translateY(-1px);box-shadow:var(--shadow)}.file-chip a{color:inherit;text-decoration:underline}.file-chip a:hover{color:var(--accent)}.file-chip .rm-file{background:none;color:var(--red);font-weight:900;font-size:1rem;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;transition:all .15s}.file-chip .rm-file:hover{background:var(--red);color:#fff}.tr-files{margin-top:10px}#rf-modal .modal{width:min(860px,100%)}.rf-head{display:grid;grid-template-columns:90px 1fr 110px 1fr 70px 44px 44px 44px 40px;gap:6px;font-size:var(--text-xs);color:var(--ink-dim);font-weight:700;margin-bottom:8px}#rf-list{max-height:400px;overflow:auto;padding:4px 2px;margin-bottom:12px}.rf-row{display:grid;grid-template-columns:90px 1fr 110px 1fr 70px 44px 44px 44px 40px;gap:6px;align-items:center;margin-bottom:8px;padding:6px 8px;border-radius:8px;transition:background .15s;animation:fadeUp .25s ease}.rf-row:hover{background:#fbfcfd}.rf-row input,.rf-row select{min-height:40px;padding:0 10px;border:2px solid var(--line);border-radius:8px;background:var(--paper);font-size:var(--text-sm);width:100%;transition:border-color .2s,background .2s}.rf-row input:focus,.rf-row select:focus{outline:none;border-color:var(--accent);background:#fff}.rf-row .rf-key{font-family:var(--font-mono);direction:ltr}.rf-row .rf-key[readonly]{background:#e3e9ee;color:var(--ink-dim);border-style:dashed}.rf-row input[type=checkbox]{width:18px;height:18px;min-height:auto;justify-self:center}.rf-del{width:34px;height:34px;border-radius:8px;background:var(--red-dim);color:var(--red);font-weight:900;font-size:1.1rem;transition:all .15s}.rf-del:hover{background:var(--red);color:#fff;transform:rotate(90deg)}.report-kv{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px;margin:12px 0}.report-kv .kv{background:var(--paper);border-radius:8px;padding:12px 16px;border-inline-start:3px solid var(--teal);transition:transform .15s,box-shadow .15s}.report-kv .kv:hover{transform:translateY(-2px);box-shadow:var(--shadow)}.report-kv .kv b{display:block;font-size:var(--text-xs);color:var(--ink-dim);font-weight:700;margin-bottom:3px}.report-kv .kv span{font-weight:800;font-size:var(--text-base)}#pd-body .report-kv .kv,#md-body .report-kv .kv,#dd-body .report-kv .kv{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;border-radius:6px}#pd-body .report-kv .kv b,#md-body .report-kv .kv b,#dd-body .report-kv .kv b{display:inline;margin:0}.file-row{display:flex;align-items:center;gap:10px;padding:8px 12px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);margin-bottom:6px}.file-link{flex:1;color:var(--teal);font-weight:600;text-decoration:none;word-break:break-all}.file-link:hover{text-decoration:underline;color:var(--accent)}.kv-table{width:100%}.kv-table td{padding:12px 14px}.kv-table td:first-child{font-weight:800;color:var(--teal);width:35%}.danger-zone{border:2px dashed var(--red);border-radius:var(--radius);padding:18px;background:repeating-linear-gradient(45deg,#fdf6f4 0 14px,#fbeeea 14px 28px)}.danger-zone .panel-title{color:var(--red)}.danger-zone .hint{margin-top:8px}.team-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg)}.event-list{list-style:none}.event-list li{padding:12px 14px;border-bottom:1px dashed var(--line);font-size:var(--text-base);display:flex;align-items:center;gap:8px;transition:background .15s}.event-list li:hover{background:#fdf3ec}.event-list li:last-child{border-bottom:0}.event-list time{margin-inline-start:auto;font-size:var(--text-xs);direction:ltr}.event-actor{font-weight:800;color:var(--teal)}.empty-state{text-align:center;padding:3.5rem 1.5rem;color:var(--ink-dim);grid-column:1 / -1}.empty-ic{font-size:3rem;margin-bottom:12px;animation:float 3s ease-in-out infinite}.fm-breadcrumb{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:14px}.fm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px}.fm-item{display:flex;flex-direction:column;align-items:center;gap:6px;padding:18px 12px;background:var(--paper);border:2px solid var(--line);border-radius:var(--radius-lg);transition:all .15s;text-align:center}.fm-item:hover{border-color:var(--accent);background:#fdf3ec;transform:translateY(-2px)}.fm-ic{font-size:2rem;line-height:1}.fm-name{font-weight:800;font-size:var(--text-sm);word-break:break-all}.fm-sub{font-size:var(--text-xs)}.fm-files{display:flex;flex-direction:column;gap:8px}.fm-file-row{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:10px 14px;flex-wrap:wrap}.fm-file-row .fm-file-info{flex:1;min-width:200px;display:flex;flex-direction:column;gap:2px}.reveal{opacity:0;transform:translateY(16px);transition:opacity .55s ease,transform .55s ease}.reveal.in{opacity:1;transform:none}@keyframes pulse{0%{box-shadow:0 0 #2f7d4f80}70%{box-shadow:0 0 0 7px #2f7d4f00}to{box-shadow:0 0 #2f7d4f00}}@keyframes cardIn{0%{opacity:0;transform:translateY(22px)}}@keyframes fadeUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}@keyframes fadeIn{0%{opacity:0}}@keyframes modalIn{0%{opacity:0;transform:scale(.94) translateY(10px)}}@keyframes shake{20%,60%{transform:translate(-7px)}40%,80%{transform:translate(7px)}}@keyframes toastIn{0%{opacity:0;transform:translateY(12px)}}@keyframes toastOut{to{opacity:0;transform:translateY(8px)}}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-8px)}}@keyframes btnPulse{0%,to{opacity:.65}50%{opacity:.4}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}@media(max-width:900px){.topbar-inner{flex-wrap:wrap;padding:10px 14px;gap:10px;height:auto}.topnav{order:3;flex-basis:100%;margin-inline:-14px;padding-inline:10px}.me-box{display:none}.brand-name{font-size:var(--text-lg)}.brand-stamp{width:30px;height:30px}.display{font-size:var(--text-xl)}.page-head{flex-direction:column;align-items:stretch}.stat b{font-size:var(--text-2xl)}.app-grid{grid-template-columns:repeat(auto-fill,minmax(95px,1fr))}.card-grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr))}.modal{width:min(92vw,640px)}#rf-modal .modal{width:min(94vw,860px)}}@media(max-width:640px){.topbar{z-index:20}.overlay,.sheet-overlay{z-index:500}.notif-panel{z-index:600}#toasts{z-index:700}.table-panel{overflow:visible}.table-wrap{overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;max-height:70vh;border:1px solid var(--line);border-radius:12px;scrollbar-width:thin}.table-wrap table{min-width:620px;width:max-content}.table-wrap::-webkit-scrollbar{height:6px}.table-wrap::-webkit-scrollbar-thumb{background:var(--line);border-radius:4px}.table-panel th:first-child,.table-panel td:first-child{position:sticky;inset-inline-start:0;z-index:3;background:var(--surface);border-inline-end:2px solid var(--line);box-shadow:2px 0 4px #0000000a}.table-panel th:first-child{background:var(--paper);z-index:5}tbody tr:hover td:first-child{background:#fffaf5}.table-wrap th{-webkit-backdrop-filter:none;backdrop-filter:none}.table-wrap th{white-space:nowrap;vertical-align:middle}.table-wrap td{white-space:normal;word-break:break-word;vertical-align:middle;max-width:340px}.table-wrap td:first-child,.table-wrap td:last-child{white-space:nowrap}.table-wrap td .muted{white-space:normal}.container{padding:16px 14px calc(80px + env(safe-area-inset-bottom))}.display{font-size:1.55rem}.panel{padding:14px}.panel-title{font-size:.95rem}td,th{padding:10px 12px;font-size:.82rem}.field input,.field select,.field textarea,.search-input,#order-status-filter,.form-row-inline input,.rf-row input,.rf-row select{font-size:1rem}.btn:not(.btn-sm){min-height:46px}.modal-x{width:40px;height:40px}.login-tab{min-height:44px}.nav-link{padding:8px 10px;font-size:.8rem;flex-shrink:0}.user-chip{gap:10px;margin-inline-start:auto}.notif-panel{position:fixed;top:66px;inset-inline:12px;width:auto;max-height:60dvh}#kpi-strip{display:grid;grid-template-columns:1fr 1fr}.stat{padding:14px 16px}.stat+.stat{border-inline-start:0}.stat:nth-child(2n){border-inline-start:1px dashed var(--line)}.stat:nth-child(n+3){border-top:1px dashed var(--line)}.stat:last-child:nth-child(odd){grid-column:1 / -1;border-inline-start:0}.card-grid,.job-ticket-body{padding:16px 16px 12px}.job-ticket-actions{padding:12px 16px 16px}.job-ticket-actions .btn{min-height:48px}.stamp-done{font-size:.62rem;padding:2px 7px}.head-actions{width:100%}.search-input,#order-status-filter{flex:1;width:auto;min-width:0}.devices-grid{grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:10px}.device-card{width:100%;height:auto;min-height:110px}.device-picker-list{grid-template-columns:repeat(3,1fr)}.stage-title{min-width:120px}.stage-tasks{margin-inline-start:12px;padding-inline-start:12px}.overlay{padding:0}.overlay.open{place-items:end center}.modal{width:100%;max-width:100%;border-radius:20px 20px 0 0;max-height:92dvh;padding:18px 16px calc(18px + env(safe-area-inset-bottom))}.modal-actions{bottom:calc(-18px - env(safe-area-inset-bottom));flex-wrap:wrap}.modal-actions .btn{flex:1 1 45%}.checklist{max-height:220px}.check-row{padding:12px}.sheet-overlay{align-items:flex-end;padding:0}.sheet{max-width:100%;border-radius:20px 20px 0 0;max-height:92dvh;padding:18px 16px calc(18px + env(safe-area-inset-bottom));transform:translateY(100%) scale(1)}.sheet-overlay.active .sheet{transform:translateY(0) scale(1)}.sheet h3{font-size:1.3rem}.rf-head{display:none}#rf-list:before{content:"\c3\a2\cb\153\e2\20ac\2dc  \c3\161\e2\20ac\a0\c3\161\c2\a9\c3\a2\e2\201a\ac\c5\2019\c3\2dc\c2\a8\c3\2dc\c2\a7\c3\161\c2\a9\c3\2dc\c2\b3  \c3\2dc\c2\a7\c3\2122\cb\2020\c3\2122\e2\20ac\17e: \c3\2dc\c2\a7\c3\2122\e2\20ac\17e\c3\2dc\c2\b2\c3\2dc\c2\a7\c3\2122\e2\20ac\a6\c3\203a\c5\2019  \c3\201a\c2\b7  \c3\a2\cb\153\e2\20ac\2dc  \c3\161\e2\20ac\a0\c3\161\c2\a9\c3\a2\e2\201a\ac\c5\2019\c3\2dc\c2\a8\c3\2dc\c2\a7\c3\161\c2\a9\c3\2dc\c2\b3  \c3\2dc\c2\af\c3\2122\cb\2020\c3\2122\e2\20ac\a6: \c3\2122\c2\81\c3\2dc\c2\b9\c3\2dc\c2\a7\c3\2122\e2\20ac\17e  \c3\201a\c2\b7  \c3\a2\cb\153\e2\20ac\2dc  \c3\2dc\c2\b3\c3\2122\cb\2020\c3\2122\e2\20ac\a6: \c3\2dc\c2\a7\c3\2122\e2\20ac\a0\c3\2dc\c2\aa\c3\2122\e2\20ac\161\c3\2dc\c2\a7\c3\2122\e2\20ac\17e  \c3\2dc\c2\a8\c3\2122\e2\20ac\a1  \c3\161\c2\af\c3\2dc\c2\b2\c3\2dc\c2\a7\c3\2dc\c2\b1\c3\2dc\c2\b4";display:block;font-size:.7rem;color:var(--ink-dim);margin-bottom:8px}.rf-row{grid-template-columns:1fr 1fr 44px;grid-template-areas:"key   key   del" "label label del" "type  type  unit" "opts  opts  opts" "req   act   carry";border:1px dashed var(--line);border-radius:10px;padding:10px;background:#fbfaf7}.rf-row>:nth-child(1){grid-area:key}.rf-row>:nth-child(2){grid-area:label}.rf-row>:nth-child(3){grid-area:type}.rf-row>:nth-child(4){grid-area:opts}.rf-row>:nth-child(5){grid-area:unit}.rf-row>:nth-child(6){grid-area:req;justify-self:center}.rf-row>:nth-child(7){grid-area:act;justify-self:center}.rf-row>:nth-child(8):not(:last-child){grid-area:carry;justify-self:center}.rf-row>:nth-child(8):last-child,.rf-row>:nth-child(9){grid-area:del;align-self:start}.rf-row input[type=checkbox]{width:22px;height:22px}.rf-del{width:40px;height:40px}.report-kv{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}.file-chip a{max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-badge{font-size:.68rem}.form-row-inline{flex-direction:column;align-items:stretch}.form-row-inline .btn{width:100%}.event-list li{flex-wrap:wrap}.event-list time{flex-basis:100%;margin-inline-start:0}.fm-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px}.fm-item{padding:14px 8px}.fm-ic{font-size:1.6rem}.fm-file-row .row-actions{width:100%;justify-content:flex-end}.login-wrap{padding:16px}.login-card{padding:1.8rem 1.3rem}.login-head h1{font-size:2.1rem}.code-input{letter-spacing:8px;font-size:1.35rem!important}.taskbar{padding:6px 10px calc(6px + env(safe-area-inset-bottom));gap:4px}.tb-btn{padding:6px 12px;min-width:64px}.tb-home{min-width:60px;padding:5px 16px;margin-top:-14px}.app-grid{grid-template-columns:repeat(auto-fill,minmax(85px,1fr));gap:10px}.app-tile{padding:16px 8px 12px}.app-ic{font-size:1.6rem}.app-label{font-size:.7rem}#toasts{bottom:calc(70px + env(safe-area-inset-bottom));width:calc(100% - 24px)}}@media(max-width:400px){.display{font-size:1.4rem}.stat b{font-size:1.6rem}.nav-link{font-size:.76rem;padding:7px 8px}.brand-name{font-size:1.1rem}.device-picker-list{grid-template-columns:repeat(2,1fr)}.rf-row{grid-template-columns:1fr 1fr 40px}.file-chip a{max-width:120px}.table-wrap table{min-width:540px}.table-wrap{max-height:65vh;border-radius:10px}.table-wrap td,.table-wrap th{padding:9px 10px;font-size:.78rem}.table-panel th:first-child,.table-panel td:first-child{box-shadow:2px 0 4px #0000000d}.fm-grid{grid-template-columns:repeat(2,1fr)}.job-ticket-head{flex-direction:column;gap:4px}.modal-actions .btn{flex:1 1 100%}}.sev-info{background:var(--blue-dim);color:var(--blue)}.sev-warning{background:#fdf1dc;color:#a05a00}.sev-error{background:var(--red-dim);color:var(--red)}.sev-critical{background:#3b0d18;color:#ffd7de}.rf-head{display:grid;grid-template-columns:90px 1fr 110px 1fr 70px 44px 44px 44px 44px 40px;gap:6px;font-size:var(--text-xs);color:var(--ink-dim);font-weight:700;margin-bottom:8px}.rf-row{display:grid;grid-template-columns:90px 1fr 110px 1fr 70px 44px 44px 44px 44px 40px;gap:6px;align-items:center;margin-bottom:8px;padding:6px 8px;border-radius:8px;transition:background .15s;animation:fadeUp .25s ease}input.spec-value{max-width:50%}.customer-search-box{position:relative}.customer-results{position:absolute;top:100%;left:0;right:0;background:var(--surface);border:2px solid var(--accent);border-top:none;border-radius:0 0 var(--radius) var(--radius);max-height:250px;overflow-y:auto;z-index:100;box-shadow:var(--shadow-lg)}.customer-result-item{padding:10px 14px;cursor:pointer;transition:background .15s;display:flex;flex-direction:column;gap:2px}.customer-result-item:hover,.customer-result-item.selected{background:var(--accent-dim)}.customer-result-item strong{color:var(--ink)}.customer-result-item .muted{font-size:var(--text-xs)}.luna-chat-panel{display:flex;flex-direction:column}.luna-chat-messages{max-height:500px;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.luna-message{padding:12px 16px;border-radius:12px;font-size:var(--text-sm);line-height:1.8;max-width:85%;white-space:pre-wrap}.luna-message.luna-system{background:var(--teal-dim);color:var(--teal);align-self:flex-start}.luna-message.luna-user{background:var(--ink);color:#fff;align-self:flex-end}.luna-message.luna-assistant{background:var(--paper);border:1px solid var(--line);align-self:flex-start}.luna-message.luna-loading{background:var(--paper);color:var(--ink-dim);align-self:flex-start;animation:pulse 1.5s infinite}.luna-message.luna-error{background:var(--red-dim);color:var(--red);align-self:flex-start}.luna-chat-input{display:flex;gap:10px;padding:16px;border-top:1px solid var(--line)}.luna-chat-input textarea{flex:1;min-height:48px;padding:12px 14px;border:2px solid var(--line);border-radius:var(--radius);resize:none;font-size:var(--text-base)}.luna-chat-input textarea:focus{outline:none;border-color:var(--accent)}.luna-chat-input .btn{align-self:flex-end}.luna-model-row{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;border:1px solid var(--line);border-radius:var(--radius);margin-bottom:6px}.luna-model-row.active{border-color:var(--accent);background:var(--accent-dim)}.luna-model-name{font-weight:700;font-family:var(--font-mono)}.luna-model-provider{font-size:var(--text-xs);color:var(--ink-dim)}.topbar-inner{font-size:.95em}.task-manage-btns{display:flex;gap:4px}.stage-task-item{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;margin:4px 0;background:var(--paper);border-radius:var(--radius);border:1px solid var(--line)}.stage-tasks-list{min-height:20px;margin-top:8px}.spec-group{border:1px solid var(--line);border-radius:10px;padding:12px;margin-bottom:10px;background:#fafbfc}.spec-group-title{font-weight:800;font-size:.85rem;color:var(--teal);margin-bottom:8px;padding-bottom:6px;border-bottom:1px dashed var(--line)}.spec-group-title small{color:var(--ink-dim);font-weight:400}.stage-manage-btns{display:flex;gap:4px;margin-inline-start:auto}.task-manage-btns{display:flex;gap:4px;flex-shrink:0}.stage-task-item{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;margin:4px 0;background:var(--surface);border-radius:var(--radius);border:1px solid var(--line)}.stage-task-info{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.stage-tasks-list{min-height:24px;margin-top:8px}.stage-ghost{opacity:.4;background:var(--accent-dim)}.task-ghost{opacity:.4;background:var(--teal-dim)}.stage-chip{cursor:grab}.sev-info{background:var(--blue-soft);color:var(--primary)}.sev-warning{background:var(--gold-soft);color:var(--gold)}.sev-error{background:var(--danger-soft);color:var(--red)}.sev-critical{background:var(--red);color:#fff;font-weight:700}.luna-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}.luna-chip{display:inline-flex;align-items:center;gap:5px;padding:5px 12px;border-radius:20px;border:1px solid var(--line);background:var(--surface);font-size:.78rem;cursor:pointer;transition:border-color .15s,background .15s}.luna-chip:hover{border-color:var(--teal);background:color-mix(in srgb,var(--teal) 8%,var(--surface))}.luna-chip-warn{border-color:var(--red);background:color-mix(in srgb,var(--red) 8%,var(--surface))}.luna-h{display:block;margin:10px 0 4px;color:var(--teal);font-size:.9rem;font-weight:800}.luna-li{display:block;padding-right:14px;line-height:1.8}.luna-message-text strong{color:var(--teal)}.report-fields-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px 14px}.report-fields-grid .field{margin-bottom:0}.report-fields-grid .field.full{grid-column:1 / -1}.job-ticket .task-specs{font-size:.78rem}.order-history{display:flex;flex-direction:column}.order-history .history-row{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;padding:7px 4px;border-bottom:1px dashed var(--line);font-size:.82rem}.order-history .history-row:last-child{border-bottom:none}@media(max-width:560px){.report-fields-grid{grid-template-columns:1fr}}.order-general-row{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-start}.order-general-row .field.grow{flex:1;min-width:230px;margin-bottom:0}.field.field-sm select{min-width:120px;max-width:150px;min-height:46px;padding:0 10px;font-size:var(--text-sm)}.order-general-row>.btn{margin-top:22px;white-space:nowrap}.stage-auto-title{flex:1;font-size:.82rem;font-weight:700;color:var(--teal)}.task-row-head{display:flex;gap:8px;align-items:center;margin-bottom:10px}.task-row-head .tr-type{flex:1;min-height:46px;font-weight:800;font-size:var(--text-md)}.of-fields-box{border:1px dashed var(--teal);border-radius:10px;padding:10px 12px;margin:8px 0;background:#177a7a0b}.of-fields-title{font-size:.78rem;font-weight:800;color:var(--teal);margin-bottom:8px}.task-row-inline{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:flex-end;margin:8px 0}.task-row-inline input{min-height:42px;font-size:var(--text-sm)}.tr-qty-pair{display:flex;gap:6px;align-items:flex-end}.tr-qty-pair label,.tr-deadline-box label{display:block;font-size:var(--text-sm);font-weight:700;color:var(--ink-dim);margin-bottom:4px}.tr-qty-pair input{width:130px;min-height:44px;padding:0 10px;border:2px solid var(--line);border-radius:var(--radius);background:var(--paper)}.tr-qty-pair input.tr-qty-unit{width:110px}.tr-desc{flex:1;min-width:200px;min-height:44px;padding:0 12px;border:2px solid var(--line);border-radius:var(--radius);font-size:var(--text-base);background:var(--paper)}.tr-deadline-box{display:flex;flex-direction:column;gap:6px}.tr-jalali{display:flex;gap:6px}.tr-jalali select{min-height:42px;padding:0 8px;font-size:.8rem;border:2px solid var(--line);border-radius:var(--radius);background:var(--paper)}.tr-jalali select.tr-jd{width:70px}.tr-jalali select.tr-jm{width:110px}.tr-jalali select.tr-jy{width:80px}.upload-box-sm{padding:8px 14px}.upload-box-sm .up-label{font-size:.8rem}@media(max-width:620px){.order-general-row{flex-direction:column;align-items:stretch}.order-general-row .field.field-sm select{max-width:100%}.task-row-inline{flex-direction:column;align-items:stretch}}#stages-list .stage-tasks{display:grid;grid-template-columns:repeat(auto-fill,minmax(245px,1fr));gap:10px}#stages-list .task-row{display:flex;flex-direction:column;gap:4px;padding:10px 12px;margin-bottom:0;border:2px solid var(--line);border-radius:12px;background:var(--paper)}.task-row:hover{border-color:var(--teal)}.task-row-top{display:flex;gap:6px;align-items:stretch;margin-bottom:8px}.task-row-top .tr-type{flex:1;min-height:48px;font-weight:800;font-size:1em;border:2px solid var(--teal);border-radius:10px;background:#177a7a0d;padding:0 10px}a.btn.btn-primary.btn-block{max-width:30%}.task-row-top .tr-type:focus{outline:none;border-color:var(--teal);box-shadow:0 0 0 3px #177a7a26}.task-row-top .btn{min-height:46px;padding:0 12px}.mini-lbl{display:block;font-size:.72rem;font-weight:800;color:var(--ink-dim);margin:8px 0 3px}.qty-row{display:flex;gap:6px}.qty-row input{flex:1;min-height:40px;padding:0 10px;border:2px solid var(--line);border-radius:8px;font-size:var(--text-sm);background:var(--paper);min-width:0}.task-row input.tr-desc{width:100%;min-height:40px;margin-bottom:8px;padding:0 10px;border:2px solid var(--line);border-radius:8px;font-size:var(--text-sm);background:var(--paper)}.tr-deadline-box{margin-bottom:8px}.tr-deadline-box .check-field{font-size:.8rem;font-weight:700}.tr-jalali{display:flex;gap:5px;margin-top:5px}.tr-jalali select{flex:1;min-width:0;min-height:38px;padding:0 6px;font-size:.78rem;border:2px solid var(--line);border-radius:8px;background:var(--paper)}.remove-task-row{min-width:38px}.of-fields-box .field{margin-bottom:0}.of-fields-box .field label{font-size:.75rem;margin-bottom:3px}.of-fields-box .field input,.of-fields-box .field select{min-height:38px;padding:0 8px;font-size:.8rem}.job-ticket-actions{flex-direction:column;flex-wrap:wrap}.job-ticket-actions .btn{width:100%}#dash-devices.devices-grid{grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px;justify-items:stretch}#dash-devices .device-card{width:100%;min-height:86px;height:auto;padding:8px 6px;gap:2px}#dash-devices .device-icon{font-size:1.25rem}#dash-devices .device-name{font-size:.72rem;font-weight:700;line-height:1.3}#dash-devices .device-status{font-size:.66rem}#stage-track .stage-manage-btns,#stage-track .task-manage-btns,#add-stage-to-order{display:none!important}#stage-track.edit-on .stage-manage-btns,#stage-track.edit-on .task-manage-btns{display:flex!important}#stage-track.edit-on~#add-stage-to-order{display:inline-flex!important}.modal-lg{width:min(880px,100%)}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.spec-row{display:grid;grid-template-columns:1.2fr 1fr .6fr 34px;gap:8px;margin-bottom:8px}.spec-del{border:none;background:var(--red-dim);color:var(--red);border-radius:8px;font-size:1rem;cursor:pointer}.spec-del:hover{background:var(--red);color:#fff}.pd-tabs{display:flex;gap:6px;border-bottom:2px solid var(--line);margin-bottom:16px;flex-shrink:0}.pd-tab{border:none;background:transparent;padding:10px 14px;font-family:var(--font-body);font-size:var(--text-sm);color:var(--ink-dim);cursor:pointer;border-bottom:3px solid transparent;margin-bottom:-2px;transition:color .15s,border-color .15s}.pd-tab:hover{color:var(--ink)}.pd-tab.active{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}.pd-summary{display:flex;gap:16px;align-items:flex-start;margin-bottom:16px}.pd-thumb{width:132px;height:132px;border-radius:var(--radius);border:1px solid var(--line);object-fit:cover;flex-shrink:0;background:var(--paper)}.pd-thumb-empty{display:flex;align-items:center;justify-content:center;font-size:3rem}.pd-summary-info{flex:1;min-width:0}.kv-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:8px}.report-kv .kv,.kv-grid .kv{display:flex;justify-content:space-between;gap:10px;padding:8px 10px;background:var(--paper);border-radius:8px;font-size:var(--text-sm)}.report-kv .kv b,.kv-grid .kv b{color:var(--ink-dim);font-weight:500;flex-shrink:0}.pd-desc{margin-top:10px;font-size:var(--text-sm);color:var(--ink-dim);background:var(--paper);border-radius:8px;padding:10px 12px}.pd-stats{margin-bottom:18px}.pd-sec-title{font-size:var(--text-base);margin:6px 0 10px}.pd-toolbar{display:flex;justify-content:flex-end;margin-bottom:10px}.doc-list{display:flex;flex-direction:column;gap:10px}.doc-card{border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;background:var(--surface);transition:box-shadow .15s}.doc-card:hover{box-shadow:var(--shadow)}.doc-head{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.doc-ic{font-size:1.6rem;flex-shrink:0}.doc-info{flex:1;min-width:200px;display:flex;flex-direction:column;gap:2px;font-size:var(--text-sm)}.doc-file{font-size:var(--text-xs)}.doc-actions{display:flex;gap:6px;flex-wrap:wrap}.ver-list{display:flex;flex-direction:column;gap:8px}.ver-row{display:flex;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius)}.ver-row.current{border-color:var(--green);background:var(--green-dim)}.ver-badge{font-family:var(--font-mono);font-weight:700;background:var(--paper);padding:4px 8px;border-radius:6px;flex-shrink:0;font-size:var(--text-xs)}.ver-row.current .ver-badge{background:var(--green);color:#fff}.ver-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;font-size:var(--text-sm)}.ver-file a{color:var(--ink)}.tl-list{display:flex;flex-direction:column}.tl-item{display:flex;gap:12px;position:relative;padding-bottom:14px}.tl-item:not(:last-child):before{content:"";position:absolute;top:18px;inset-inline-start:7px;bottom:0;width:2px;background:var(--line)}.tl-dot{width:16px;height:16px;border-radius:50%;border:3px solid var(--line);background:var(--surface);flex-shrink:0;margin-top:3px;z-index:1}.tl-dot.done{border-color:var(--green);background:var(--green)}.tl-body{flex:1;min-width:0}.tl-head{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:var(--text-sm)}.tl-sub{display:flex;gap:12px;flex-wrap:wrap;font-size:var(--text-xs);margin-top:3px}.empty-state{text-align:center;padding:28px 10px}.pager{display:flex;gap:12px;align-items:center;justify-content:center;padding:12px 0 4px}.pp-stage{border:1px solid var(--line);border-radius:var(--radius);padding:10px 14px;margin-bottom:10px;background:var(--surface)}.pp-stage-head{display:flex;align-items:center;gap:8px;margin-bottom:8px}.pp-task{display:flex;gap:14px;flex-wrap:wrap;padding:6px 10px;border-top:1px dashed var(--line);font-size:var(--text-sm)}.pp-task:first-of-type{border-top:none}.pp-edit-stage{border:1px solid var(--line);border-radius:var(--radius);padding:12px;margin-bottom:12px}.pp-edit-stage-head{display:flex;align-items:center;gap:8px;margin-bottom:10px}.pp-edit-stage-head .pp-stage-title{flex:1}.pp-edit-task{display:grid;grid-template-columns:1.2fr 1.6fr .7fr 34px;gap:8px;margin-bottom:8px;align-items:center}.text-danger{color:var(--red)}input#mytasks-search,input#pool-search{width:100%;min-height:48px;padding:0 14px;border:2px solid var(--line);border-radius:var(--radius);font-size:var(--text-base);background:var(--paper);transition:border-color .2s,box-shadow .2s,background .2s}select#mytasks-sort,select#pool-sort{width:5%;min-height:48px;padding:0 14px;border:2px solid var(--line);border-radius:var(--radius);font-size:var(--text-base);background:var(--paper);transition:border-color .2s,box-shadow .2s,background .2s}.announce-modal{width:min(380px,100%)}.announce-modal .announce-ic{font-size:2.4rem;line-height:1;margin-bottom:10px}.announce-modal .announce-title{font-family:var(--font-display);font-weight:400;font-size:var(--text-lg);margin:0 0 8px}.announce-modal .announce-msg{color:var(--ink);font-size:var(--text-base);line-height:1.9;margin:0 0 16px;white-space:pre-line}.announce-modal.announce-info{border-top-color:var(--blue)}.announce-modal.announce-success{border-top-color:var(--green)}.announce-modal.announce-warning{border-top-color:var(--accent)}.announce-modal.announce-danger{border-top-color:var(--red)}button.task-file-download{width:100%;font-family:inherit;font-size:inherit;cursor:pointer}.task-file-download.task-file-locked{border-style:dashed;opacity:.8;cursor:not-allowed}.task-file-download.task-file-locked:hover{border-color:var(--red);background:var(--red-dim)}.rf-options.rf-formula{font-family:var(--font-mono);direction:ltr;text-align:left;background:#f4f8f6;border-color:var(--teal)}.var-chip{display:inline-block;padding:1px 8px;margin:2px 0;border-radius:999px;background:var(--surface-2, #eef2f5);border:1px solid var(--line);font-size:var(--text-xs);font-family:var(--font-mono)}.formula-display{min-height:40px;display:flex;align-items:center;padding:0 12px;border:2px dashed var(--teal);border-radius:8px;background:#0080800d;font-weight:700;font-family:var(--font-mono);direction:ltr;text-align:left;color:var(--ink);overflow-wrap:anywhere}.deviation-panel{border:1px solid var(--red);background:var(--red-dim)}.deviation-panel .panel-title{color:var(--red)}.deviation-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}.deviation-list li{padding:8px 12px;background:var(--paper);border:1px dashed var(--red);border-radius:8px;font-size:var(--text-sm)}.deviation-badge{display:inline-block;padding:2px 8px;border-radius:999px;background:var(--red-dim);color:var(--red);font-weight:700;font-size:var(--text-xs);white-space:nowrap}#invoice-modal .modal{max-width:720px;width:96%;max-height:90vh;overflow-y:auto}.invoice-sec-title{display:flex;align-items:center;gap:8px;margin:18px 0 10px;padding-bottom:7px;border-bottom:2px solid var(--line);color:var(--teal);font-size:.95rem;font-weight:800}.invoice-specs{display:flex;flex-direction:column;gap:12px}.invoice-specs>p.muted{margin:0}.spec-group{border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden;transition:border-color .2s}.spec-group:hover{border-color:var(--teal)}.spec-group-title{display:flex;align-items:center;gap:8px;padding:10px 14px;background:var(--paper);border-bottom:1px solid var(--line);font-weight:800;font-size:.88rem;line-height:1.6}.spec-group-title small{color:var(--ink-dim);font-weight:600;font-size:.75rem}.spec-edit-row{display:flex;align-items:center;gap:10px;padding:7px 14px;border-bottom:1px dashed var(--line)}.spec-edit-row b,.spec-edit-row .spec-label{min-width:150px;font-size:.8rem;font-weight:700;color:var(--ink-dim)}.spec-edit-row input{flex:1;padding:6px 10px;border:1px solid var(--line);border-radius:6px;background:var(--paper);font-size:.85rem}.spec-edit-row input:focus{outline:none;border-color:var(--teal)}.spec-cost-row{display:flex;align-items:center;gap:10px;padding:10px 14px;background:#4cd78714;border-top:2px solid var(--teal)}.spec-time-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 14px;border-bottom:1px dashed var(--line);font-size:.8rem}.spec-time-row span{color:var(--ink-dim);font-weight:700}.spec-time-row b{color:var(--ink);font-size:.82rem}.spec-cost-row b{flex:1;font-size:.82rem;font-weight:800;color:var(--teal)}.spec-cost{width:190px;padding:8px 12px;border:1.5px solid var(--teal);border-radius:8px;background:var(--surface);font-weight:800;font-size:.95rem;color:var(--teal);text-align:center;font-variant-numeric:tabular-nums;transition:box-shadow .2s}.spec-cost:focus{outline:none;box-shadow:0 0 0 3px #4cd78733}.spec-cost::placeholder{font-weight:600;font-size:.78rem;opacity:.5}.invoice-item-row{display:flex;align-items:center;gap:8px;padding:8px 10px;background:var(--paper);border:1px solid var(--line);border-radius:10px;margin-bottom:8px}.invoice-item-row input{padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font-size:.85rem}.invoice-item-row input:focus{outline:none;border-color:var(--teal)}.invoice-item-row .ii-desc{flex:2;min-width:0}.invoice-item-row .ii-qty{width:80px;text-align:center}.invoice-item-row .ii-price{flex:1;min-width:110px;font-weight:700}#invoice-modal .invoice-total{display:flex;align-items:center;justify-content:space-between;background:var(--paper);border:1px solid var(--teal);border-radius:10px;padding:12px 18px;margin-top:16px;font-size:1.05rem}@media(max-width:560px){.spec-edit-row{flex-wrap:wrap;padding:7px 12px}.spec-edit-row b,.spec-edit-row .spec-label{min-width:100%}.spec-cost-row{flex-wrap:wrap;padding:10px 12px}.spec-cost-row b{min-width:100%}.spec-cost{width:100%;flex:1}.invoice-item-row{flex-wrap:wrap}.invoice-item-row .ii-desc{flex:1 1 100%}.invoice-item-row .ii-qty,.invoice-item-row .ii-price{flex:1}}.ui-ic{width:1.15em;height:1.15em;display:inline-block;vertical-align:-.18em;flex:none}.app-ic .ui-ic,.brand-stamp .ui-ic,.login-stamp .ui-ic{width:1.6em;height:1.6em;vertical-align:middle}.tb-ic .ui-ic,.tb-home-ic .ui-ic{width:22px;height:22px}.notif-btn .ui-ic,.feedback-fab .ui-ic{width:1.35em;height:1.35em;vertical-align:middle}.panel-title .ui-ic,.display .ui-ic{margin-inline-end:6px}.kpi-label[title]{cursor:help;border-bottom:1px dotted var(--line)}.kpi-guide{margin:10px 0 4px;font-size:.8rem;color:var(--ink-dim)}.kpi-guide summary{cursor:pointer;font-weight:700;color:var(--teal)}.kpi-guide ul{margin:8px 0 0;padding-inline-start:20px;line-height:1.9}.kpi-guide li{margin:0}

/* ── ui-refine.css ── */
/* مدیریار — اصلاحات رابط کاربری
   هدر سادهتر، فوتر گرد و شناور، و خلاصه عملیاتی مدیرعامل */

/* پنجرههای.modal باید روی نوار شناور پایین قرار بگیرند؛ کانتیکریتاز استکینگ نکند */
.container { z-index: auto; }

/* ── هدر: نوار گرد و شناور، کوتاهتر از قبل ── */
.topbar {
    top: 10px;
    margin-top: 10px;
    inset-inline: auto;
    width: calc(100% - 48px);
    max-width: 1272px;
    margin-inline: auto;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
}
.topbar-inner { height: auto; min-height: 44px; max-width: none; padding: 10px 25px; gap: 24px; }
.brand-stamp { width: 24px; height: 24px; border-width: 1.5px; transform: none; }
.brand:hover .brand-stamp { transform: scale(1.05); }
.brand-name { font-size: .95rem; font-weight: 500; }
.user-chip { gap: 8px; }
.me-name { font-size: .8rem; font-weight: 500; }
.me-role { font-size: .72rem; color: var(--ink-dim); }
.notif-btn { width: 30px; height: 30px; }
.topbar .btn-ghost { border: 1px solid var(--line); background: transparent; color: var(--ink); padding: 6px 12px; font-size: .8rem; }
/* دکمهٔ خروج روی نوار سفید باید خوانا باشد؛ استایل قبلی مخصوص هدر تیره بود و سفید روی سفید دیده نمی‌شد. */
.topbar #logout-btn { background: transparent; border: 1px solid var(--line); color: var(--ink-dim); padding: 6px 12px; font-size: .8rem; }
.topbar #logout-btn:hover { background: var(--red-dim); border-color: var(--red); color: var(--red); }

/* ── فوتر: نوار گرد شناور، کشیده نشده از شرق تا غرب ── */
.taskbar {
    inset-inline: auto;
    left: 50%;
    right: auto;
    bottom: calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 28px);
    padding: 6px 8px;
    gap: 4px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: none;
}
.tb-btn {
    min-width: 0;
    padding: 8px 16px;
    border-radius: 999px;
    color: var(--ink-dim);
}
.tb-btn:hover { color: var(--accent); background: var(--accent-dim); }
.tb-btn.active { color: var(--accent); background: var(--accent-dim); }
.tb-home {
    margin-top: 0;
    padding: 8px 18px;
    min-width: 0;
    border-radius: 999px;
    box-shadow: none;
}
.tb-home:hover { transform: none; box-shadow: none; filter: brightness(1.06); }
.tb-spacer { min-width: 24px; }

/* ── خلاصه عملیاتی مدیرعامل ── */
.stat-alert b, .stat-alert:hover b { color: var(--red); }
.stat-alert:after { background: var(--red); }
.ceo-insight .ceo-section-head { margin-bottom: 14px; }
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.insight-item {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 15px;
    line-height: 1.7;
}
.insight-item b { display: block; font-size: .88rem; margin-bottom: 4px; }
.insight-item span { display: block; font-size: .8rem; color: var(--ink-dim); }
.insight-item.bad { border-inline-start: 3px solid var(--red); }
.insight-item.bad b { color: var(--red); }
.insight-item.warn { border-inline-start: 3px solid #ba7517; }
.insight-item.warn b { color: #854f0b; }
.insight-item.good { border-inline-start: 3px solid var(--green); }
.insight-item.good b { color: var(--green); }
.insight-item.info { border-inline-start: 3px solid var(--blue); }
.insight-item.info b { color: var(--blue); }

/* ── نوار فیلتر سفارشها: ردیف اصلی + فیلترهای پیشرفته ── */
.orders-filter-panel .form-row-inline { gap: 8px; }
.orders-filter-panel #order-status-filter { min-width: 170px; }
#of-toggle { min-width: 104px; }
.ot-advanced {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.ot-advanced[hidden] { display: none; }
.ot-advanced #of-priority { min-width: 170px; }

/* ── منوهای بازشوندهٔ فیلترها (جایگزین استایل پیشفرض option مرورگر) ── */
.ui-select { position: relative; display: inline-flex; min-width: 170px; }
.ui-select-native {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important;
    opacity: 0 !important; pointer-events: none !important;
}
.ui-select-trigger {
    appearance: none;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; min-height: 48px;
    padding: 0 12px 0 14px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font-size: .9rem; font-weight: 700;
    text-align: right; cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.ui-select-trigger:hover { border-color: var(--accent); background: #fff; }
.ui-select-trigger:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #e8611a1f; }
.ui-select.open .ui-select-trigger { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px #e8611a1f; }
.ui-select-caret {
    flex: none; width: 0; height: 0;
    border-inline-start: 5px solid transparent;
    border-inline-end: 5px solid transparent;
    border-top: 6px solid var(--ink-dim);
    transition: transform .2s;
}
.ui-select.open .ui-select-caret { transform: rotate(180deg); }
.ui-select-menu {
    display: none;
    position: fixed; z-index: 700;
    max-height: min(60vh, 520px); overflow: auto;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: none;
    animation: uiSelectIn .14s ease-out;
}
.ui-select.open .ui-select-menu { display: block; }
@keyframes uiSelectIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ui-select-option {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; min-height: 40px;
    padding: 8px 12px;
    border: 0; border-radius: 8px;
    background: transparent; color: var(--ink);
    font-size: .85rem; text-align: right; cursor: pointer;
    transition: background .15s, color .15s;
}
.ui-select-option:hover, .ui-select-option:focus-visible {
    outline: none; background: var(--accent-dim); color: var(--accent);
}
.ui-select-option.selected { background: var(--accent); color: #fff; font-weight: 800; }
.ui-select-option.selected::after { content: "✓"; margin-inline-start: 10px; font-size: .85rem; }

/* ── فیلتر تاریخ شمسی صفحه سفارشها ── */
.jalali-picker { display: inline-flex; align-items: center; gap: 4px; }
.jalali-picker select,
.ot-advanced #of-priority {
    appearance: none;
    min-height: 48px;
    min-width: 76px;
    padding: 0 26px 0 10px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper) var(--chevron) no-repeat left 10px center;
    background-size: 12px;
    font-size: .9rem;
    color: var(--ink);
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.jalali-picker .jp-month { min-width: 112px; }
.jalali-picker .jp-year { min-width: 94px; }
.jalali-picker select:focus,
.ot-advanced #of-priority:focus {
    outline: none;
    border-color: var(--accent);
    background-color: #fff;
    box-shadow: 0 0 0 3px #e8611a1f;
}
.jalali-picker-sep {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink-dim);
    padding: 0 6px;
}

/* ── صفحهبندی لیست سفارشها ── */
.orders-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.orders-pager .pg-info { font-size: .85rem; color: var(--ink-dim); }
.orders-pager .pg-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.orders-pager .btn-sm { min-height: 36px; padding: 0 12px; }
.orders-pager .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── کارت وضعیت حیاتی دستگاه ── */
#device-detail-modal .modal { width: min(94vw, 880px); max-width: 880px; }
#dd-body .dd-overview {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius);
    background: var(--paper); margin-bottom: 12px; flex-wrap: wrap;
}
#dd-body .dd-badge {
    font-size: .8rem; font-weight: 800; padding: 5px 14px; border-radius: 999px;
    background: var(--green-dim); color: var(--green);
}
#dd-body .dd-badge.busy { background: var(--accent-dim); color: var(--accent); }
#dd-body .dd-badge.maintenance { background: #fff3cd; color: #8a6100; }
#dd-body .dd-badge.inactive { background: #e8edf2; color: var(--ink-dim); }
#dd-body .dd-id { font-size: .82rem; color: var(--ink-dim); }
#dd-body .dd-id span { margin-inline: 4px; }
#dd-body .dd-section { margin-top: 14px; }
#dd-body .dd-section h4 {
    font-size: .88rem; font-weight: 800; margin-bottom: 8px;
    padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
#dd-body .dd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
#dd-body .dd-stat {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 10px 12px;
}
#dd-body .dd-stat.critical { border-color: var(--red); background: var(--red-dim); }
#dd-body .dd-stat.busy { border-color: var(--accent); }
#dd-body .dd-stat > span { font-size: .72rem; color: var(--ink-dim); }
#dd-body .dd-stat b { font-size: 1.02rem; font-weight: 900; }
#dd-body .dd-stat small { font-size: .68rem; color: var(--ink-dim); line-height: 1.5; }
#dd-body .dd-delta.up { color: var(--green); }
#dd-body .dd-delta.down { color: var(--red); }
#dd-body .dd-bar { height: 6px; border-radius: 999px; background: var(--paper); overflow: hidden; margin: 4px 0 2px; }
#dd-body .dd-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
#dd-body .dd-active-list, #dd-body .dd-recent { display: grid; gap: 8px; }
#dd-body .dd-active {
    border: 1px solid var(--line); border-inline-start: 3px solid var(--accent);
    border-radius: var(--radius); padding: 10px 12px; background: var(--surface);
}
#dd-body .dd-active.late { border-inline-start-color: var(--red); background: var(--red-dim); }
#dd-body .dd-active-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .82rem; font-weight: 800; }
#dd-body .dd-active-top a, #dd-body .dd-recent-main a { color: var(--accent); }
#dd-body .dd-active-top span { font-size: .75rem; font-weight: 500; color: var(--ink-dim); }
#dd-body .dd-customer { font-size: .78rem; color: var(--ink-dim); margin-top: 2px; }
#dd-body .dd-chips { font-size: .74rem; color: var(--ink); margin-top: 5px; }
#dd-body .dd-sep { color: var(--ink-dim); margin-inline: 5px; }
#dd-body .dd-active-foot { display: flex; gap: 12px; flex-wrap: wrap; font-size: .7rem; color: var(--ink-dim); margin-top: 6px; }
#dd-body .dd-active-foot .ui-ic { width: 13px; height: 13px; }
#dd-body .dd-recent-row {
    border-bottom: 1px solid var(--line); padding: 8px 2px;
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
}
#dd-body .dd-recent-row:last-child { border-bottom: 0; }
#dd-body .dd-recent-main { display: flex; gap: 8px; align-items: center; font-size: .8rem; font-weight: 700; }
#dd-body .dd-recent-main span { font-size: .74rem; font-weight: 500; color: var(--ink-dim); }
#dd-body .dd-recent-row .dd-chips { grid-column: 1; color: var(--ink-dim); }
#dd-body .dd-recent-meta { grid-column: 2; grid-row: 1 / 3; font-size: .7rem; color: var(--ink-dim); text-align: left; white-space: nowrap; }
#dd-body .dd-recent-meta span { margin-inline: 3px; }

/* ── CRM: نوار فیلترها و نمای کلی ── */
.crm-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px;
}
.crm-filters input,
.crm-filters select {
    width: auto;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: .85rem;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.crm-filters .search-input {
    flex: 1 1 320px;
    min-width: 260px;
    padding: 0 14px;
    background-image: none;
}
.crm-filters select {
    flex: 0 1 156px;
    min-width: 132px;
    padding: 0 34px 0 12px;
    appearance: none;
    background-image: var(--chevron);
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 12px;
    cursor: pointer;
}
.crm-filters .btn {
    white-space: nowrap;
    min-height: 44px;
    padding: 0 14px;
    font-size: .84rem;
}
.crm-filters input:focus,
.crm-filters select:focus {
    outline: none;
    border-color: var(--accent);
    background-color: #fff;
    box-shadow: 0 0 0 3px #e8611a1f;
}
.crm-filters select:focus { background-image: var(--chevron); }
.crm-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.crm-ov {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: none;
}
.crm-ov span { font-size: .76rem; color: var(--ink-dim); }
.crm-ov b { font-size: 1.08rem; font-weight: 900; }
.crm-ov.warn { border-inline-start-color: #ba7517; }
.crm-ov.warn b { color: #854f0b; }
.crm-ov.bad { border-inline-start-color: var(--red); }
.crm-ov.bad b { color: var(--red); }

/* ── CRM: جدول غنی مشتریان ── */
#crm-table-view table { min-width: 1080px; }
#crm-table-view td { vertical-align: middle; }
#crm-table-view .mono-link {
    font-family: var(--font-body);
    font-size: .92rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0;
}
#crm-table-view .mono-link strong { font-weight: 700; }
#crm-table-view .mono-link:hover { color: var(--accent); }
#crm-table-view .num.debt { color: var(--red); font-weight: 800; }
.stage-pill, .tag-pill {
    display: inline-block;
    white-space: nowrap;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.7;
    padding: 1px 9px;
}
.stage-pill { background: #e8edf2; color: var(--ink-dim); }
.stage-lead { background: #e7f0ff; color: #1b5faa; }
.stage-contacted { background: #eee8ff; color: #6941c6; }
.stage-negotiating { background: #fff3cd; color: #8a6100; }
.stage-active { background: var(--green-dim); color: var(--green); }
.stage-dormant { background: #e8edf2; color: var(--ink-dim); }
.stage-lost { background: var(--red-dim); color: var(--red); }
.tag-pill { background: var(--accent-dim); color: var(--accent); margin-inline-start: 3px; }

/* ── CRM: خط فروش ── */
.crm-board {
    display: grid;
    grid-template-columns: repeat(6, minmax(210px, 1fr));
    gap: 10px;
    overflow-x: auto;
    padding-bottom: calc(var(--taskbar-h) + 24px);
}
.crm-col {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-height: 220px;
    padding: 9px;
    transition: background-color .2s, border-color .2s;
}
.crm-col.drag-over { border-color: var(--accent); background: var(--accent-dim); }
.crm-col h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: .86rem;
    padding: 3px 4px 9px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
}
.crm-col h4 span { font-size: .75rem; color: var(--ink-dim); background: var(--surface); border-radius: 999px; padding: 1px 8px; }
.crm-col-body { display: grid; gap: 7px; align-content: start; }
.crm-card {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--accent);
    border-radius: 10px;
    cursor: grab;
    font-size: .8rem;
}
.crm-card:hover { border-color: var(--accent); }
.crm-card:active { cursor: grabbing; }
.crm-card span, .crm-card small { font-size: .72rem; color: var(--ink-dim); }
.crm-card a { color: var(--accent); font-size: .72rem; font-weight: 700; margin-top: 3px; }

/* ── CRM: نمای 360 ── */
#customer-360-modal .crm-modal { width: min(96vw, 980px); max-width: 980px; }

/* ── CRM: فرم مشتری — شبکهای و جمعوجور ── */
#customer-modal .modal {
    width: min(760px, 100%);
    max-width: 760px;
    padding: 22px 24px 0;
}
#customer-modal .modal-head { margin-bottom: 16px; }
#customer-modal #customers-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    padding-bottom: 12px;
}
#customer-modal .field { margin: 0; min-width: 0; }
#customer-modal .field label { font-size: .78rem; margin-bottom: 5px; }
#customer-modal .field input:not([type="checkbox"]):not([type="hidden"]),
#customer-modal .field select,
#customer-modal .field textarea {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: .88rem;
}
#customer-modal .field select {
    appearance: none;
    padding-inline-start: 12px;
    padding-inline-end: 32px;
    background-image: var(--chevron);
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 12px;
    cursor: pointer;
}
#customer-modal .field select:focus { background-image: var(--chevron); }
#customer-modal .field textarea {
    min-height: 68px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.6;
}
#customer-modal .field:has(textarea),
#customer-modal .check-field { grid-column: 1 / -1; }
#customer-modal .modal-actions {
    grid-column: 1 / -1;
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 4px -24px 0;
    padding: 14px 24px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
#customer-modal .modal-actions .btn { min-height: 44px; }
.crm-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
}
.crm-tabs button {
    border: 0;
    background: transparent;
    color: var(--ink-dim);
    padding: 10px 12px;
    white-space: nowrap;
    font-size: .82rem;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.crm-tabs button:hover { color: var(--accent); }
.crm-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
#crm360-body { padding: 16px 18px; min-height: 240px; }
.crm-health, .crm-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}
.crm-health > div, .crm-info-grid > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 11px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.crm-health span, .crm-info-grid span { font-size: .72rem; color: var(--ink-dim); }
.crm-health b, .crm-info-grid b { font-size: .86rem; }
.crm-health .debt { color: var(--red); }
.crm-info-grid { margin-top: 10px; }
.crm-table { min-width: 560px; }
.crm-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0 10px;
}
.crm-subhead:not(:first-child) { margin-top: 20px; }
.crm-subhead h4 { font-size: .9rem; }
.crm-file-list { display: grid; gap: 6px; }
.crm-file-list a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
}
.crm-file-list a:hover { border-color: var(--accent); color: var(--accent); }
.crm-file-list small { color: var(--ink-dim); white-space: nowrap; }
.crm-contact {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    font-size: .8rem;
}
.crm-contact:first-child { color: var(--ink); }
.crm-contact-form {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: var(--paper);
    border: 1px dashed var(--line);
    border-radius: 10px;
}
.crm-contact-form input:not([type=checkbox]) { flex: 1 1 130px; min-width: 110px; }
.crm-contact-form label { font-size: .78rem; color: var(--ink-dim); }
.crm-notes { display: grid; gap: 7px; }
.crm-note {
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-inline-start: 3px solid #ba7517;
    border-radius: 10px;
    background: var(--paper);
    font-size: .8rem;
}
.crm-note b { display: block; font-size: .76rem; }
.crm-note p { margin: 4px 0; line-height: 1.7; }
.crm-note time { font-size: .7rem; color: var(--ink-dim); }
.crm-tasks { display: grid; gap: 7px; }
.crm-task {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    font-size: .8rem;
}
.crm-task.done { opacity: .65; }
.crm-task.done b { text-decoration: line-through; }
.crm-task p { margin: 4px 0 0; color: var(--ink-dim); }
.crm-check {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 2px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--green);
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}
.crm-task.done .crm-check { border-color: var(--green); background: var(--green-dim); }
.crm-timeline { display: grid; gap: 0; }
.crm-event {
    display: grid;
    grid-template-columns: 135px 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 9px 4px;
    border-bottom: 1px solid var(--line);
    font-size: .8rem;
}
.crm-event:last-child { border-bottom: 0; }
.crm-event time { color: var(--ink-dim); font-size: .72rem; }
.crm-event b { display: block; }
.crm-event span { color: var(--ink-dim); }
.crm-event a { color: var(--accent); }

/* ── KPI: مقایسه با همان بازه از ماه شمسی قبل ── */
#kpi-strip .kpi-cmp {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px 5px;
    margin-top: 10px;
    padding: 5px 6px;
    border: 1px solid #f0d8c8;
    border-radius: 10px;
    background: var(--accent-dim);
    font-size: .66rem;
    line-height: 1.4;
    font-weight: 600;
    color: var(--ink-dim);
}
#kpi-strip .kpi-cmp .cmp-base { white-space: nowrap; }
#kpi-strip .kpi-cmp span:not(.cmp-base) {
    font-weight: 800;
    white-space: nowrap;
    padding-inline-start: 5px;
    border-inline-start: 1px solid #e6c6b2;
}
#kpi-strip .kpi-cmp .up { color: var(--green); }
#kpi-strip .kpi-cmp .down { color: var(--red); }
#kpi-strip .kpi-cmp .flat { color: var(--ink-dim); }
.team-delta { font-size: .7rem; font-weight: 700; margin-inline-start: 4px; }
.team-delta.up { color: var(--green); }
.team-delta.down { color: var(--red); }
.team-delta.flat { color: var(--ink-dim); }
#ceo-month-team .ceo-section-head span { font-size: .78rem; color: var(--ink-dim); }

@media (max-width: 980px) {
    .crm-board { grid-template-columns: repeat(6, minmax(200px, 1fr)); }
    .crm-contact { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .topbar { width: calc(100% - 28px); max-width: none; margin-inline: auto; top: 8px; margin-top: 8px; }
    .topbar-inner { height: 42px; padding: 0 14px; gap: 10px; }
    .me-role { display: none; }
    .taskbar { bottom: calc(8px + env(safe-area-inset-bottom)); padding: 5px 6px; }
    .tb-btn { padding: 7px 12px; }
    .tb-home { padding: 7px 14px; }
    .insight-grid { grid-template-columns: 1fr; }
    .crm-filters .search-input { flex: 1 1 100%; min-width: 0; }
    .crm-filters select { flex: 1 1 calc(50% - 10px); min-width: 0; }
    .crm-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #customer-modal .modal { width: 100%; max-width: 100%; padding-inline: 16px; }
    #customer-modal #customers-form { grid-template-columns: 1fr; }
    #customer-modal .modal-actions { margin-inline: -16px; padding-inline: 16px; }
    #customer-360-modal .crm-modal { width: 100%; max-width: 100%; }
    .crm-event { grid-template-columns: 1fr auto; }
    .crm-event time { grid-column: 1 / -1; }
}

/* ── صفحه جزئیات سفارش: سلسلهمراتب واضح، منوهای بازشونده مدرن ── */
#order-detail-root { padding-bottom: 96px; }

.od-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.od-head-main { min-width: 0; }
.od-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    font-size: .78rem;
    color: var(--ink-dim);
    text-decoration: none;
}
.od-back:hover { color: var(--accent); }
.od-back .ui-ic { width: 15px; height: 15px; }
.od-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}
.od-title-row h1 { margin: 0; font-size: 1.55rem; line-height: 1.35; }
.od-subtitle {
    margin: 6px 0 0;
    font-size: .84rem;
    color: var(--ink-dim);
}
.od-subtitle span { margin-inline: 6px; color: var(--line); }
.od-desc {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    max-width: 760px;
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    font-size: .82rem;
    line-height: 1.7;
}
.od-desc .ui-ic { width: 15px; height: 15px; flex: 0 0 auto; color: var(--teal); margin-top: 3px; }
.od-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink-dim);
    font-size: .72rem;
    font-weight: 700;
}
.od-chip .ui-ic { width: 13px; height: 13px; }
.od-chip.danger { border-color: var(--red); background: var(--red-dim); color: var(--red); }
.od-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 22px;
}

/* منوهای بازشونده — همان استایلی که برای تمام گزینههای عملیاتی به کار میرود */
.od-menu-wrap { position: relative; display: inline-flex; }
.od-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-dim);
    cursor: pointer;
    transition: border-color .18s, background .18s, color .18s;
}
.od-icon-btn:hover, .od-icon-btn[aria-expanded="true"] {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}
.od-icon-btn .ui-ic { width: 17px; height: 17px; }
.od-menu {
    display: none;
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 40;
}
.od-menu-wide { min-width: 200px; }
.od-menu-wrap.open .od-menu {
    display: grid;
    gap: 2px;
    animation: odMenuIn .16s ease-out;
}
@keyframes odMenuIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
.od-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 600;
    text-align: right;
    cursor: pointer;
}
.od-menu-item:hover { background: var(--accent-dim); color: var(--accent); }
.od-menu-item.danger { color: var(--red); }
.od-menu-item.danger:hover { background: var(--red-dim); }
.od-menu-item .ui-ic { width: 15px; height: 15px; flex: 0 0 auto; }

/* نمای کلی سفارش */
.od-overview { padding: 18px 20px 14px; }
.od-overview-main { display: flex; align-items: center; gap: 18px; }
.od-progress-ring {
    position: relative;
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: conic-gradient(var(--accent) var(--p), var(--line) 0);
}
.od-progress-ring:before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--surface);
}
.od-progress-ring span {
    position: relative;
    font-family: var(--font-display);
    font-size: 1.38rem;
    color: var(--ink);
}
.od-progress-ring small { font-size: .66rem; margin-inline-start: 1px; }
.od-eyebrow {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    color: var(--teal);
    font-weight: 800;
}
.od-eyebrow .ui-ic { width: 14px; height: 14px; }
.od-overview-copy h3 { margin: 4px 0 4px; font-size: 1rem; }
.od-overview-copy p { margin: 0; font-size: .8rem; line-height: 1.7; color: var(--ink-dim); }
.od-progress-track {
    height: 7px;
    margin-top: 9px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}
.od-progress-track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.od-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.od-mini {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--paper);
}
.od-mini > span { font-size: .71rem; color: var(--ink-dim); }
.od-mini b { font-size: .98rem; line-height: 1.45; }
.od-mini em { font-style: normal; font-size: .78rem; color: var(--ink-dim); }
.od-mini small { font-size: .67rem; color: var(--ink-dim); line-height: 1.55; }
.od-mini.warn { border-color: var(--red); background: var(--red-dim); }
.od-mini.warn b { color: var(--red); }

/* پنلهای جمعشونده (مغایرت، مقادیر فنی، تاریخچه) */
.od-deviation-box, .od-technical, .od-history-panel {
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--paper);
}
.od-deviation-box { margin-top: 12px; border-color: var(--red); background: var(--red-dim); }
.od-deviation-box summary, .od-technical summary, .od-history-panel summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    cursor: pointer;
    list-style: none;
    font-size: .82rem;
}
.od-deviation-box summary::-webkit-details-marker,
.od-technical summary::-webkit-details-marker,
.od-history-panel summary::-webkit-details-marker { display: none; }
.od-deviation-box summary span,
.od-technical summary span,
.od-history-panel summary span {
    margin-inline-start: auto;
    font-size: .71rem;
    color: var(--ink-dim);
}
.od-deviation-box summary .ui-ic { color: var(--red); }
.od-deviation-box ul { margin: 0; padding: 0 14px 12px; list-style: none; }
.od-deviation-box li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 6px 0;
    border-top: 1px dashed var(--line);
    font-size: .78rem;
}
.od-deviation-box li span { color: var(--ink-dim); font-size: .73rem; }
.od-deviation-box p { margin: 0; padding: 0 14px 12px; font-size: .74rem; }
.od-technical[open] summary, .od-history-panel[open] summary { border-bottom: 1px solid var(--line); }
.od-tech-grid { margin: 12px; }
.od-history-panel { padding: 0; }
.od-history-panel .order-history { padding: 10px 14px 14px; }

/* تاریخچه دقیق سفارش: رویدادها به ترتیب زمانی، با شماره و شخص انجامدهنده */
.od-history-list {
    list-style: none;
    margin: 0;
    padding: 10px 14px 16px;
    max-height: 620px;
    overflow: auto;
}
.od-history-item {
    display: grid;
    grid-template-columns: 30px 132px minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
    font-size: .78rem;
}
.od-history-item:last-child { border-bottom: 0; }
.od-history-seq {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: .7rem;
    font-weight: 800;
}
.od-history-time { color: var(--ink-dim); font-size: .72rem; padding-top: 4px; white-space: nowrap; }
.od-history-body { min-width: 0; }
.od-history-body b { display: block; font-size: .8rem; }
.od-history-body p {
    margin: 3px 0 0;
    color: var(--ink-dim);
    font-size: .75rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.od-history-user {
    align-self: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--paper-2, #f4f6fb);
    color: var(--ink);
    font-size: .71rem;
    font-weight: 700;
    white-space: nowrap;
}
.od-history-item[data-kind="order.create"] .od-history-seq { background: #e8f5e9; color: #2e7d32; }
.od-history-item[data-kind="task.accept"] .od-history-seq { background: #e3f2fd; color: #1565c0; }
.od-history-item[data-kind="report.submit"] .od-history-seq { background: #e8f8f0; color: #1a7a4a; }
.od-history-item[data-kind^="invoice."] .od-history-seq { background: #fff4e5; color: #b26a00; }
@media (max-width: 760px) {
    .od-history-item { grid-template-columns: 28px minmax(0, 1fr); }
    .od-history-time, .od-history-user { grid-column: 2; padding-top: 0; }
}

/* مراحل تولید: دکمههای ویرایش فقط در حالت ویرایش نمایش داده شوند */
#stage-track .stage-manage-btns,
#stage-track .task-manage-btns { display: none !important; }
#stage-track.edit-on .stage-manage-btns,
#stage-track.edit-on .task-manage-btns { display: flex !important; }
#stage-track:not(.edit-on) .stage-chip { cursor: default; }

/* جدول کارها */
.od-tasks-panel .panel-head-row { align-items: flex-start; }
.od-panel-note { margin: 4px 0 0; font-size: .74rem; color: var(--ink-dim); }
.od-count {
    flex: 0 0 auto;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: .73rem;
    font-weight: 800;
}
.od-tasks-panel .table-wrap { overflow-x: auto; overflow-y: hidden; max-height: none; }
.od-table { min-width: 720px; table-layout: fixed; }
.od-table th { white-space: nowrap; }
.od-tasks-panel .od-table th:nth-child(1) { width: 38%; }
.od-tasks-panel .od-table th:nth-child(2) { width: 18%; }
.od-tasks-panel .od-table th:nth-child(3) { width: 14%; }
.od-tasks-panel .od-table th:nth-child(4) { width: 16%; }
.od-tasks-panel .od-table th:nth-child(5) { width: 14%; }
.od-task-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.od-task-title strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.od-task-note {
    margin-top: 4px;
    font-size: .72rem;
    line-height: 1.5;
    color: var(--ink-dim);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.od-task-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
    font-size: .68rem;
    color: var(--ink-dim);
}
.od-task-meta span { display: inline-flex; align-items: center; gap: 3px; }
.od-task-meta .ui-ic { width: 12px; height: 12px; }
.od-task-meta .od-field-chip {
    max-width: 170px;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.od-task-meta .od-field-chip b { color: var(--ink-dim); font-weight: 700; }
.od-task-meta .od-field-chip small { font-size: .9em; opacity: .8; }
.od-task-meta .od-field-more {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 800;
}
.od-progress-cell { min-width: 170px; }
.od-qty { margin-bottom: 6px; font-size: .78rem; }
.od-row-progress-wrap { display: flex; align-items: center; gap: 7px; font-size: .73rem; }
.od-row-progress {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}
.od-row-progress i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.od-status-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.od-owner-cell small {
    display: block;
    margin-top: 3px;
    font-size: .7rem;
    color: var(--ink-dim);
}
.od-owner-cell small .ui-ic { width: 12px; height: 12px; }
.od-actions-cell { min-width: 150px; justify-content: flex-start; }

@media (max-width: 760px) {
    .od-page-head { flex-direction: column; }
    .od-head-actions { justify-content: flex-start; padding-top: 0; width: 100%; }
    .od-overview-main { align-items: flex-start; }
    .od-progress-ring { width: 70px; height: 70px; }
    .od-progress-ring:before { inset: 6px; }
    .od-menu { min-width: 190px; }
}

/* بازبینی دوم: ساختار خواناتر کارت مرحله */
#stage-track .stage-item { padding: 14px 16px; }
#stage-track .stage-head { margin-bottom: 10px; }
/* استایل قدیمی .stage-title مخصوص اینپوت بود و روی div عنوان مرحله، کادر توخالی میساخت */
#stage-track .stage-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
#stage-track .stage-title strong { font-size: .92rem; line-height: 1.5; }
#stage-track .stage-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 8px;
    font-size: .72rem;
    color: var(--ink-dim);
}
#stage-track .stage-count { margin-inline-start: 0; }
.stage-avail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--teal);
    font-weight: 700;
}
.stage-avail .ui-ic { width: 13px; height: 13px; }
.stage-percent {
    margin-inline-start: auto;
    font-weight: 800;
    color: var(--ink);
}
#stage-track .stage-bar { height: 5px; }
#stage-track .stage-tasks-list { margin-top: 10px; }
.stage-menu-wrap { margin-inline-start: auto; }
#stage-track:not(.edit-on) .stage-menu-wrap { display: none; }
#stage-track.edit-on .stage-menu-wrap { display: inline-flex; }


/* هماهنگی منوی سفارشی با تمام ورودیها: فیلدهای فرم، ردیفinline و انتخابگر شمسی */
.field .ui-select { width: 100%; }
.form-row-inline .ui-select { flex: 1; min-width: 160px; }
.jalali-picker .ui-select { min-width: 0; }
.jalali-picker .ui-select-trigger { min-width: 76px; padding: 0 24px 0 8px; }
.jalali-picker .jp-month .ui-select-trigger { min-width: 112px; }
.jalali-picker .jp-year .ui-select-trigger { min-width: 94px; }
.ui-select-trigger:disabled { opacity: .55; cursor: not-allowed; }

/* جدول تنظیم فیلدها: سلول نوع 110px است؛ select سفارشی نباید روی گزینهها سرریز شود */
#rf-list .rf-row .ui-select,
#rf-list .rf-row .ui-select-trigger { width: 100%; min-width: 0; }
#rf-list .rf-row .ui-select-trigger {
    min-height: 40px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: var(--text-sm);
    font-weight: 400;
}
#rf-list .rf-row .ui-select-caret {
    border-inline-start-width: 4px;
    border-inline-end-width: 4px;
    border-top-width: 5px;
}
#rf-list .rf-row .ui-select-native { min-height: 0 !important; }


/* جلوگیری از اسکرول افقی کل صفحه در موبایل برای جدولهایی که wrapper ندارند */
@media (max-width: 640px) {
    .table-panel:not(:has(.table-wrap)) { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
    .table-panel:not(:has(.table-wrap)) > table { min-width: 620px; width: max-content; }
}

/* آیکنهای امن در پنجره تأیید */
.confirm-text { display: flex; align-items: flex-start; gap: 8px; }
.confirm-text > .ui-ic { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 3px; color: var(--red); }
.confirm-text > span { flex: 1; }

/* ── CRM سادهشده: کابین فرمانده ── */
.taskbar { transition: transform .24s ease; }
body.taskbar-collapsed .taskbar { transform: translateY(115%); }
body[data-page="customers"] .container { padding-bottom: calc(var(--taskbar-h) + 56px + env(safe-area-inset-bottom)); }
.badge.warn { background: #fff0d8; color: #8a5a08; }
.badge.info { background: var(--blue-dim); color: var(--blue); }
.link-btn { border: 0; background: transparent; color: var(--accent); font-weight: 800; cursor: pointer; font-size: inherit; padding: 0 2px; }
.crm-filters { flex-wrap: wrap; }
.crm-active-filters { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; min-height: 24px; }
.filter-note { font-size: .76rem; color: var(--ink-dim); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.crm-status-guide { flex: 1 1 100%; display: grid; gap: 4px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); border-radius: 10px; font-size: .78rem; color: var(--ink-dim); }
.crm-status-guide[hidden] { display: none; }
.crm-status-guide p { line-height: 1.6; }
.crm-status-guide b { color: var(--ink); }
.crm-status-guide small { font-size: .7rem; opacity: .85; }
#customers-tbody .badge,
.customer-card .badge { font-size: .62rem; padding: 1px 6px; margin-inline-start: 4px; white-space: nowrap; }
@media (max-width: 700px) { .crm-status-guide { font-size: .74rem; padding: 9px 11px; } }
.crm-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.crm-ov { text-align: right; cursor: pointer; border-inline-start: 0; border-top: 3px solid var(--accent); color: inherit; font-family: inherit; }
.crm-ov:hover { transform: translateY(-1px); }
.crm-ov span { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.crm-ov span small { font-size: .68rem; color: var(--ink-dim); font-weight: 500; }
.crm-ov em { font-size: .68rem; font-style: normal; color: var(--ink-dim); }
.crm-ov.warn { border-top-color: #ba7517; border-inline-start-color: var(--line); }
.crm-ov.bad { border-top-color: var(--red); border-inline-start-color: var(--line); }
#crm-table-view table { min-width: 620px; width: 100%; }
#crm-table-view th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.tel-link { color: var(--accent); text-decoration: none; font-weight: 700; }
.customer-cards { display: none; }
.customer-card { display: grid; gap: 5px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); border-radius: 12px; }
.customer-card .cc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .92rem; }
.customer-card .cc-line { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--ink-dim); }
.customer-card .cc-line b { color: var(--ink); }
.customer-card .cc-line b.debt { color: var(--red); }
.customer-card .cc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.customer-card .cc-actions .btn { flex: 1; min-height: 38px; }
#customer-dup-warning { display: block; font-size: .76rem; }
#customer-360-modal .crm-modal { width: min(96vw, 860px); max-width: 860px; max-height: 90dvh; padding: 16px 20px; }
.crm-head-actions { position: relative; display: flex; align-items: center; gap: 4px; }
.crm-menu { position: absolute; top: 100%; inset-inline-end: 0; z-index: 8; min-width: 190px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.crm-menu button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); text-align: right; font-family: inherit; font-size: .8rem; cursor: pointer; }
.crm-menu button:hover { background: var(--accent-dim); }
.crm-menu button.danger { color: var(--red); }
#customer-360-modal .crm-tabs { position: sticky; top: 0; z-index: 4; flex-shrink: 0; background: var(--surface); padding: 0; }
#crm360-body { padding: 14px 4px 4px; min-height: 200px; }
.exec-summary { display: grid; gap: 7px; }
.exec-row { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.exec-row > span { font-size: .74rem; color: var(--ink-dim); }
.exec-row > b { font-size: .94rem; }
.exec-row > small { font-size: .72rem; color: var(--ink-dim); }
.exec-row.danger { border-color: #efc7c7; background: var(--red-dim); }
.exec-row.danger > b { color: var(--red); }
.exec-row.action { border-color: #f0d8c8; background: var(--accent-dim); }
.exec-row.action > b { color: var(--accent); }
.crm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.crm-actions .btn, .crm-merge-actions .btn { min-height: 40px; }
.crm-table { min-width: 0; width: 100%; }
.crm-table th { background: var(--paper); }
.crm-history { display: grid; gap: 5px; margin-top: 8px; }
.crm-history details { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .78rem; }
.crm-history summary { cursor: pointer; font-weight: 700; }

@media (max-width: 720px) {
    .crm-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #crm-table-view .table-wrap { display: none; }
    .customer-cards { display: grid; gap: 9px; padding: 9px; }
    #customer-360-modal .crm-modal { width: 100%; max-width: 100%; max-height: 92dvh; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
    #customer-360-modal .modal-head { margin-bottom: 8px; }
    #customer-360-modal .crm-tabs { overflow-x: auto; }
    #customer-360-modal .crm-tabs button { padding: 10px; font-size: .78rem; }
    #crm360-body { padding: 10px 2px 2px; }
    .exec-row { grid-template-columns: 1fr auto; gap: 2px 8px; }
    .exec-row > small { grid-column: 1 / -1; }
    .crm-actions .btn { flex: 1; min-height: 44px; }
    .crm-menu { inset-inline-end: -6px; }
}

/* ═══ جزئیات وظیفه — خلاصهٔ فشرده و عملیات گزارش ═══ */
.td-head-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* کارت خلاصه تمام عرض موجود را میگیرد (درخواست کاربر: از چپ تا راست). */
.td-brief {
    width: 100%;
    padding: 12px 14px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.td-brief-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.td-brief-cell {
    display: inline-flex; align-items: baseline; gap: 7px;
    min-width: 0; max-width: 100%; padding: 7px 11px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
}
.td-brief-cell > span { font-size: .72rem; color: var(--ink-dim); margin: 0; white-space: nowrap; }
.td-brief-cell > b { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: .84rem; }
.td-brief-cell.wide {
    flex: 1 1 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 2px; padding: 0; border: 0; border-radius: 0; background: transparent;
}
.td-brief-cell.wide > span { flex: none; }
.td-brief-cell.wide > .task-detail-specs { flex: 1; min-width: 0; }
.td-brief-files { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; flex: 1 1 auto; }
/* اگر برچسب و چیپ‌ها کنار هم جا نشوند (موبایل)، چیپ‌ها به خط بعد می‌روند و
   تمام عرض سلول را می‌گیرند؛ در غیر این صورت نام فایل به «…» تبدیل می‌شد. */
.td-brief-files-cell { align-items: center; flex-wrap: wrap; }
.td-brief-files .file-chip { max-width: 100%; }
.td-brief-files a { text-decoration: none; }
.td-brief-files a:hover { text-decoration: underline; }
.td-brief .task-detail-specs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; padding: 0; border: 0; background: transparent; }
.td-brief .task-detail-specs > b { display: inline-flex; align-items: center; gap: 5px; margin: 0; color: var(--ink-dim); font-size: .72rem; font-weight: 500; white-space: nowrap; }
.td-brief .task-specs { margin: 0; }
.td-report-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

@media (max-width: 720px) {
    .td-brief-cell { flex: 1 1 calc(50% - 4px); }
    .td-brief-cell.wide { flex: 1 1 100%; align-items: flex-start; flex-direction: column; gap: 6px; }
    .td-head-side { width: 100%; }
}

/* ═══ تاریخچهٔ وضعیت — ردیف‌های فشرده و خوانا ═══ */
.event-list li.ev-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; }
.event-list .ev-actor { font-weight: 600; color: var(--ink); }
.event-list .ev-kind { display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border:1px solid var(--line); border-radius:999px; background:var(--paper); color:var(--ink); font-size:.76rem; font-weight:600; }
.event-list .ev-kind .ui-ic { width:14px; height:14px; color:var(--teal); }
.event-list li.ev-audit .ev-time { margin-inline-start:auto; }
.event-list .ev-note { color: var(--ink-dim); font-size: .78rem; }
.event-list .ev-time { margin-inline-start: 0; direction: rtl; font-size: .72rem; color: var(--ink-dim); }
.event-list .ev-time::before { content: "·"; margin-inline-end: 6px; color: var(--line); }
.event-list .ev-empty { padding: 14px; }

/* ═══ نمای فاکتور — خلاصهٔ مالی و اقدامات ═══ */
.iv-modal { gap: 14px; }
.iv-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.iv-head-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--accent-dim); color: var(--accent); }
.iv-head-text { flex: 1; min-width: 0; }
.iv-head h3 { font-size: 1.05rem; line-height: 1.4; }
.iv-head h3 .mono { font-size: .88rem; color: var(--ink-dim); }
.iv-head-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; font-size: .75rem; color: var(--ink-dim); }
.iv-dot { color: var(--line); }
.iv-head .modal-x { flex: none; }
.iv-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid #b9dcdc; border-radius: 12px; background: linear-gradient(135deg, var(--teal-dim), var(--surface)); }
.iv-hero > span { font-size: .78rem; color: var(--ink-dim); }
.iv-hero > b { font-size: 1.5rem; line-height: 1.3; }
.iv-hero > b small { font-size: .78rem; font-weight: 500; color: var(--ink-dim); margin-inline-start: 4px; }
.iv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.iv-cell { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.iv-cell > span { display: block; font-size: .72rem; color: var(--ink-dim); margin-bottom: 5px; }
.iv-cell > b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .9rem; }
.iv-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.iv-actions .btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 520px) {
    .iv-grid { grid-template-columns: 1fr; }
    .iv-hero > b { font-size: 1.25rem; }
    .iv-actions .btn { flex: 1 1 auto; }
}


/* ═══ ثبت سفارش جدید — ردیف مشتری / اولویت ═══
   دکمهٔ «مشتری جدید» قبلاً با margin-top دستی کنار ردیف می‌نشست و چون
   btn-sm بود (۳۷px) در مقابل ورودی ۴۸px و سلکت ۴۶px ناتراز دیده می‌شد.
   حالا دکمه هم‌ردیف خود ورودی جستجو و هم‌ارتفاع آن است. */
.order-general-row { align-items: flex-start; }
.order-general-row .field { margin-bottom: 0; }
.order-general-row > .btn { margin-top: 22px; white-space: nowrap; }
.order-general-row .field-sm select { min-height: 48px; }

.customer-pick-row { display: flex; align-items: stretch; gap: 8px; }
.customer-pick-row .customer-search-box { flex: 1 1 auto; min-width: 0; }
.customer-pick-row .customer-search-box .search-input { width: 100%; }
.customer-pick-row .btn {
    flex: 0 0 auto; margin-top: 0; min-height: 48px;
    padding-inline: 16px; white-space: nowrap;
}

/* چیپ مشتری انتخاب‌شده — با دکمهٔ حذف انتخاب */
.picked-customer {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 3px 10px 3px 6px; border-radius: 999px;
    background: var(--teal-dim); color: var(--teal);
    font-size: .8rem; line-height: 1.7;
}
.picked-customer > .ui-ic { width: 15px; height: 15px; }
.picked-customer b { font-weight: 800; }
.picked-customer .pc-phone { font-size: .74rem; opacity: .9; }
.picked-customer .pc-clear {
    display: inline-flex; align-items: center; justify-content: center;
    width: 19px; height: 19px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(23, 122, 122, .16); color: var(--teal);
    font-size: .95rem; line-height: 1; cursor: pointer;
    transition: background .15s, color .15s;
}
.picked-customer .pc-clear:hover { background: var(--red-dim); color: var(--red); }

@media (max-width: 640px) {
    .customer-pick-row { flex-wrap: wrap; }
    .customer-pick-row .btn { width: 100%; }
}

/* جدول «کارکرد افراد در ماه جاری» در صفحهٔ اصلی — ردیفها قابل کلیکند */
.month-team-row { cursor: pointer; }
.month-team-row:hover { background: var(--accent-dim); }
.month-team-row:hover td { color: var(--ink); }
#operator-detail-modal .modal { width: min(94vw, 880px); max-width: 880px; }
/* مودال جزئیات اپراتور از همان کلاسهای کارت جزئیات دستگاه استفاده میکند. */
#od-body .dd-overview {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius);
    background: var(--paper); margin-bottom: 12px; flex-wrap: wrap;
}
#od-body .dd-badge {
    font-size: .8rem; font-weight: 800; padding: 5px 14px; border-radius: 999px;
    background: var(--green-dim); color: var(--green);
}
#od-body .dd-badge.busy { background: var(--accent-dim); color: var(--accent); }
#od-body .dd-badge.maintenance { background: #fff3cd; color: #8a6100; }
#od-body .dd-badge.inactive { background: #e8edf2; color: var(--ink-dim); }
#od-body .dd-id { font-size: .82rem; color: var(--ink-dim); }
#od-body .dd-id span { margin-inline: 4px; }
#od-body .dd-section { margin-top: 14px; }
#od-body .dd-section h4 {
    font-size: .88rem; font-weight: 800; margin-bottom: 8px;
    padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
#od-body .dd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
#od-body .dd-stat {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 10px 12px;
}
#od-body .dd-stat.critical { border-color: var(--red); background: var(--red-dim); }
#od-body .dd-stat.busy { border-color: var(--accent); }
#od-body .dd-stat > span { font-size: .72rem; color: var(--ink-dim); }
#od-body .dd-stat b { font-size: 1.02rem; font-weight: 900; }
#od-body .dd-stat small { font-size: .68rem; color: var(--ink-dim); line-height: 1.5; }
#od-body .dd-delta.up { color: var(--green); }
#od-body .dd-delta.down { color: var(--red); }
#od-body .dd-bar { height: 6px; border-radius: 999px; background: var(--paper); overflow: hidden; margin: 4px 0 2px; }
#od-body .dd-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
#od-body .dd-active-list, #od-body .dd-recent { display: grid; gap: 8px; }
#od-body .dd-active {
    border: 1px solid var(--line); border-inline-start: 3px solid var(--accent);
    border-radius: var(--radius); padding: 10px 12px; background: var(--surface);
}
#od-body .dd-active.late { border-inline-start-color: var(--red); background: var(--red-dim); }
#od-body .dd-active-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .82rem; font-weight: 800; }
#od-body .dd-active-top a, #od-body .dd-recent-main a { color: var(--accent); }
#od-body .dd-active-top span { font-size: .75rem; font-weight: 500; color: var(--ink-dim); }
#od-body .dd-customer { font-size: .78rem; color: var(--ink-dim); margin-top: 2px; }
#od-body .dd-chips { font-size: .74rem; color: var(--ink); margin-top: 5px; }
#od-body .dd-sep { color: var(--ink-dim); margin-inline: 5px; }
#od-body .dd-active-foot { display: flex; gap: 12px; flex-wrap: wrap; font-size: .7rem; color: var(--ink-dim); margin-top: 6px; }
#od-body .dd-active-foot .ui-ic { width: 13px; height: 13px; }
#od-body .dd-recent-row {
    border-bottom: 1px solid var(--line); padding: 8px 2px;
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
}
#od-body .dd-recent-row:last-child { border-bottom: 0; }
#od-body .dd-recent-main { display: flex; gap: 8px; align-items: center; font-size: .8rem; font-weight: 700; }
#od-body .dd-recent-main span { font-size: .74rem; font-weight: 500; color: var(--ink-dim); }
#od-body .dd-recent-row .dd-chips { grid-column: 1; color: var(--ink-dim); }
#od-body .dd-recent-meta { grid-column: 2; grid-row: 1 / 3; font-size: .7rem; color: var(--ink-dim); text-align: left; white-space: nowrap; }
#od-body .dd-recent-meta span { margin-inline: 3px; }


/* ── پروفایل ۳۶۰ درجه اپراتور (همان منبع صفحهٔ تحلیل) ── */
#operator-detail-modal .modal { width: min(94vw, 940px); max-width: 940px; }
#od-body .pf-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; border-bottom:1px solid var(--line); padding-bottom:8px; }
#od-body .pf-tab { font:inherit; font-size:.76rem; font-weight:700; cursor:pointer; padding:6px 14px; border-radius:999px; border:1px solid var(--line); background:var(--surface); color:var(--ink-dim); }
#od-body .pf-tab.active { background:var(--accent); border-color:var(--accent); color:#fff; }
#od-body .pf-pane[hidden] { display:none !important; }
#od-body .pf-identity { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
#od-body .pf-avatar { width:46px; height:46px; border-radius:14px; background:var(--accent-dim); color:var(--accent); display:grid; place-items:center; }
#od-body .pf-avatar .ui-ic { width:24px; height:24px; }
#od-body .pf-identity h4 { font-size:1rem; font-weight:900; }
#od-body .pf-identity p { font-size:.74rem; color:var(--ink-dim); }
#od-body .pf-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
#od-body .pf-stat { background:var(--paper); border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
#od-body .pf-stat span { display:block; font-size:.68rem; color:var(--ink-dim); }
#od-body .pf-stat b { display:block; font-size:1.05rem; font-weight:900; }
#od-body .pf-stat small { font-size:.68rem; }
#od-body .pf-stat small.up, #od-body .delta.up { color:var(--green); }
#od-body .pf-stat small.down, #od-body .delta.down { color:var(--red); }
#od-body .pf-insights { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; margin-top:12px; }
#od-body .pf-insights > div { background:var(--accent-dim); border-radius:10px; padding:9px 12px; }
#od-body .pf-insights span { display:block; font-size:.7rem; color:var(--ink-dim); }
#od-body .pf-insights b { font-size:.92rem; font-weight:900; }
#od-body .pf-note { margin-top:12px; font-size:.7rem; line-height:1.7; color:var(--ink-dim); background:var(--paper); border:1px solid var(--line); border-radius:10px; padding:8px 12px; }
#od-body .pf-sec { margin-top:14px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px; }
#od-body .pf-sec h4 { font-size:.86rem; font-weight:900; margin-bottom:8px; }
#od-body .pf-bars { display:grid; gap:6px; }
#od-body .pf-bar { display:grid; grid-template-columns:140px 1fr 62px; align-items:center; gap:8px; font-size:.76rem; }
#od-body .pf-bar i { display:block; height:8px; background:var(--accent); border-radius:999px; }
#od-body .pf-bar i.alt { background:var(--blue); }
#od-body .pf-bar b { text-align:left; font-variant-numeric:tabular-nums; }
@media (max-width: 860px) {
    #od-body .pf-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    #od-body .pf-bar { grid-template-columns:96px 1fr 56px; }
}

/* ردیف «آخرین کارها» در پروفایل اپراتور قابل کلیک است */
#od-body .pf-task-row { cursor: pointer; }
#od-body .pf-task-row:hover { background: var(--accent-dim); }
#od-body .pf-task-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#od-body .pf-task-row[data-order-id=""] { cursor: default; }
/* ── صفحهٔ تنظیمات: ناوبری بخشی + کارتهای واکنشگرا ── */
.settings-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 12px); display: flex; flex-direction: column; gap: 5px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.settings-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-dim); font: inherit; font-size: .84rem; font-weight: 700; text-align: right; cursor: pointer; }
.settings-nav-item .ui-ic { width: 18px; height: 18px; flex: none; }
.settings-nav-item:hover { background: var(--accent-dim); color: var(--ink); }
.settings-nav-item.active { background: var(--accent); color: #fff; }
.settings-content { min-width: 0; display: flex; flex-direction: column; gap: 16px; padding-bottom: calc(var(--taskbar-h) + 16px); }
.settings-card[hidden] { display: none !important; }
.settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.settings-card-head h3 { font-size: 1rem; font-weight: 900; line-height: 1.5; }
.settings-card-head p { font-size: .75rem; color: var(--ink-dim); margin-top: 3px; }
.settings-card-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-dim); color: var(--accent); }
.settings-card-ic .ui-ic { width: 20px; height: 20px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.settings-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-grid .field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 0; }
.settings-grid .field-wide { grid-column: 1 / -1; }
.settings-grid label, .toggle-row b { font-size: .8rem; font-weight: 800; color: var(--ink); }
.settings-grid input, .settings-grid textarea { width: 100%; }
.setting-hint { font-size: .7rem; color: var(--ink-dim); line-height: 1.6; }
.setting-hint.warning-text { color: var(--red); font-weight: 700; }
.input-actions { display: flex; align-items: center; gap: 8px; }
.input-actions input { flex: 1; min-width: 0; }
.input-with-preview { display: flex; align-items: center; gap: 10px; }
.input-with-preview input { flex: 1; min-width: 0; }
.logo-preview { width: 42px; height: 42px; flex: none; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview a { color: var(--accent); font-size: 1.1rem; text-decoration: none; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; }
.toggle-row > span { display: flex; flex-direction: column; gap: 2px; }
.toggle-row small { font-size: .72rem; color: var(--ink-dim); }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row .switch { position: relative; width: 42px; height: 24px; flex: none; border-radius: 999px; background: var(--line); transition: background .2s; }
.toggle-row .switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle-row input:checked + .switch { background: var(--teal); }
.toggle-row input:checked + .switch::after { right: auto; left: 3px; }
.toggle-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.settings-savebar { position: sticky; bottom: calc(var(--taskbar-h) + 8px); z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.settings-savebar .dirty { color: var(--accent); font-weight: 800; }
.settings-roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.role-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; text-align: right; cursor: pointer; }
.role-card:hover, .role-card.active { border-color: var(--accent); background: var(--accent-dim); }
.role-ic { color: var(--accent); }
.role-ic .ui-ic { width: 18px; height: 18px; }
.role-name { font-size: .86rem; font-weight: 800; }
.role-count { font-size: .72rem; color: var(--ink-dim); }
.settings-perm-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.perm-group { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.perm-group-head h4 { font-size: .82rem; font-weight: 900; color: var(--teal); }
.perm-group-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; max-height: 240px; overflow: auto; }
.perm-group-items .check-row { font-size: .76rem; }
@media (max-width: 1100px) {
    .settings-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-perm-groups { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
    .settings-nav-item { flex: none; white-space: nowrap; width: auto; }
}
@media (max-width: 640px) {
    .settings-grid, .settings-grid-2, .settings-grid-3, .perm-group-items { grid-template-columns: 1fr; }
    .settings-card-head { flex-direction: column; }
    .settings-savebar { flex-direction: column; align-items: stretch; }
    .input-actions { flex-wrap: wrap; }
}

/* ── بنر اتصال: بجای صفحهٔ خاموش offline.html داخل اپ نمایش میشود ── */
.offline-banner{position:fixed;top:calc(var(--topbar-h) + 8px);inset-inline:16px;z-index:calc(var(--z-toast) - 1);display:flex;align-items:center;justify-content:center;gap:12px;padding:9px 14px;border:1px solid var(--red);border-radius:12px;background:var(--red-dim);color:var(--red);font-size:.8rem;font-weight:800}
.offline-banner[hidden]{display:none}
.offline-banner .ui-ic{width:16px;height:16px}
.offline-banner button{border:0;border-radius:8px;background:var(--red);color:#fff;padding:6px 14px;font:inherit;font-weight:800;cursor:pointer}
@media(max-width:640px){.offline-banner{inset-inline:8px;flex-wrap:wrap;font-size:.75rem}}

