/* ZANA ERP — رابط کاربری وب (RTL) */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&display=swap');

:root {
  --bg: #f3f5f9; --panel: #ffffff; --line: #e3e7ee; --text: #1f2937; --muted: #6b7280;
  --primary: #1d4ed8; --primary-2: #2563eb; --primary-soft: #e8efff; --accent: #0ea5e9;
  --ok: #16a34a; --ok-soft: #dcfce7; --warn: #d97706; --warn-soft: #fef3c7; --danger: #dc2626; --danger-soft: #fee2e2;
  --info-soft: #e0f2fe; --gray-soft: #f1f5f9; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
  --radius: 12px; --sidebar: 268px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.7; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: embed; text-align: left; }
.mono { font-family: Consolas, "Courier New", monospace; }
.hidden { display: none !important; }

/* ---------- ورود ---------- */
#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 80% -10%, #dbeafe 0%, transparent 60%), radial-gradient(800px 500px at -10% 110%, #e0f2fe 0%, transparent 60%), var(--bg); padding: 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--panel); border-radius: 20px; box-shadow: 0 20px 50px rgba(16,24,40,.12); padding: 34px 32px; }
.login-card .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.logo-mark { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; letter-spacing: 1px; }
.login-card h1 { font-size: 22px; }
.login-card .sub { color: var(--muted); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: #374151; font-weight: 500; }
.field .req { color: var(--danger); margin-inline-start: 3px; }
.input, input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; border: 1px solid #d1d5db; border-radius: 10px; padding: 9px 12px; background: #fff; outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus, input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
textarea { min-height: 84px; resize: vertical; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 8px 16px; cursor: pointer; background: var(--gray-soft); color: var(--text); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; transition: .15s; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.warn { background: var(--warn); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.error-box { background: var(--danger-soft); color: #991b1b; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.hint { background: var(--info-soft); color: #075985; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; margin-top: 16px; line-height: 1.9; }
.hint code { background: #fff; padding: 1px 6px; border-radius: 6px; direction: ltr; display: inline-block; }

/* ---------- پوسته ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: #0f172a; color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden; flex-shrink: 0; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; color: #fff; }
.sidebar .brand .logo-mark { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
.sidebar .brand b { font-size: 17px; }
.sidebar .brand small { display: block; font-size: 11px; color: #94a3b8; font-weight: 400; }
.sidebar .search { padding: 4px 14px 10px; }
.sidebar .search input { background: #1e293b; border-color: #334155; color: #e2e8f0; padding: 7px 12px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 10px 20px; }
.sidebar nav::-webkit-scrollbar { width: 6px; } .sidebar nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
.nav-group { margin-bottom: 4px; }
.nav-group > .head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: #e2e8f0; font-weight: 500; user-select: none; }
.nav-group > .head:hover { background: #1e293b; }
.nav-group > .head .ic { width: 26px; height: 26px; border-radius: 7px; background: #1e293b; display: grid; place-items: center; font-size: 13px; }
.nav-group > .head .chev { margin-inline-start: auto; font-size: 11px; opacity: .6; transition: transform .15s; }
.nav-group.open > .head .chev { transform: rotate(90deg); }
.nav-group .items { display: none; padding: 2px 0 4px 0; }
.nav-group.open .items { display: block; }
.nav-item { display: block; padding: 6px 12px 6px 10px; margin-inline-start: 22px; border-radius: 8px; color: #cbd5e1; font-size: 13px; }
.nav-item:hover { background: #1e293b; color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.sidebar .foot { padding: 12px 16px; border-top: 1px solid #1e293b; font-size: 12px; color: #94a3b8; }
.sidebar .foot a { color: #93c5fd; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20; }
.topbar .title { font-size: 17px; font-weight: 600; }
.topbar .crumb { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.topbar .today { color: var(--muted); font-size: 13px; }
.topbar .user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 10px; }
.topbar .user:hover { background: var(--gray-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 600; }
.bell { position: relative; cursor: pointer; padding: 6px; border-radius: 8px; }
.bell:hover { background: var(--gray-soft); }
.bell .cnt { position: absolute; top: 0; left: 0; background: var(--danger); color: #fff; font-size: 10px; border-radius: 999px; padding: 0 5px; line-height: 16px; }
.menu-btn { display: none; }
.content { padding: 22px; flex: 1; }
@media (max-width: 960px) {
  .sidebar { position: fixed; right: 0; transform: translateX(100%); transition: transform .2s; z-index: 40; }
  .sidebar.show { transform: none; }
  .menu-btn { display: inline-flex; }
  .content { padding: 14px; }
}

/* ---------- کارت‌ها و جداول ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card .card-h h3 { font-size: 15px; }
.card .card-b { padding: 14px 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar select, .toolbar input { width: auto; min-width: 140px; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th { text-align: right; background: #f8fafc; color: #475569; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 9px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
table.grid tbody tr { transition: background .1s; }
table.grid tbody tr.clickable { cursor: pointer; }
table.grid tbody tr.clickable:hover { background: #f5f8ff; }
table.grid td.num, table.grid th.num { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
table.grid tfoot td { font-weight: 600; background: #f8fafc; }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager .spacer { flex: 1; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--gray-soft); color: #334155; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: #166534; }
.badge.warn { background: var(--warn-soft); color: #92400e; }
.badge.danger { background: var(--danger-soft); color: #991b1b; }
.badge.info { background: var(--info-soft); color: #075985; }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.chip { display: inline-block; background: var(--gray-soft); border-radius: 6px; padding: 0 8px; margin: 2px; font-size: 12px; direction: ltr; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 22px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-weight: 500; word-break: break-word; }
.section { margin-top: 18px; }
.section h4 { font-size: 14px; color: #334155; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.section h4::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h2 { font-size: 20px; }
.page-head .spacer { flex: 1; }
.page-head .status-line { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }

/* ---------- داشبورد ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; transition: transform .1s; }
.stat:hover { transform: translateY(-1px); }
.stat .l { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat .s { font-size: 12px; color: var(--muted); }
.stat.accent { border-inline-start: 4px solid var(--primary); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.quick a { display: block; padding: 10px 12px; background: var(--gray-soft); border-radius: 10px; text-align: center; color: var(--text); font-size: 13px; }
.quick a:hover { background: var(--primary-soft); color: var(--primary); }

/* ---------- فرم ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 16px; }
.form-grid .field.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; padding-top: 26px; }
.check input { width: 18px; height: 18px; }
.lines-editor { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lines-editor .lh { display: flex; align-items: center; padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid var(--line); font-weight: 500; }
.lines-editor table { width: 100%; border-collapse: collapse; }
.lines-editor th { font-size: 12px; color: var(--muted); text-align: right; padding: 6px 8px; }
.lines-editor td { padding: 4px 6px; }
.lines-editor td input, .lines-editor td select { padding: 6px 8px; border-radius: 8px; min-width: 90px; }
.lines-editor .rm { color: var(--danger); cursor: pointer; padding: 4px 8px; }
.lookup { position: relative; }
.lookup .dd { position: absolute; top: 100%; right: 0; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16,24,40,.15); z-index: 50; max-height: 240px; overflow-y: auto; }
.lookup .dd div { padding: 7px 12px; cursor: pointer; font-size: 13px; }
.lookup .dd div:hover, .lookup .dd div.hl { background: var(--primary-soft); }
.lookup .dd small { color: var(--muted); display: block; font-size: 11.5px; }
.lookup.has-val input { border-color: #86efac; background: #f0fdf4; }
.field-err { color: var(--danger); font-size: 12px; }

/* ---------- مودال و اعلان ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 16px; width: 100%; max-width: 760px; box-shadow: 0 30px 60px rgba(0,0,0,.25); animation: pop .15s ease-out; }
.modal.lg { max-width: 1040px; }
.modal .mh { display: flex; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { font-size: 16px; flex: 1; }
.modal .mb { padding: 18px 20px; }
.modal .mf { display: flex; gap: 8px; justify-content: flex-start; padding: 12px 20px; border-top: 1px solid var(--line); }
.x { cursor: pointer; color: var(--muted); font-size: 20px; padding: 0 6px; }
@keyframes pop { from { transform: translateY(8px); opacity: .5; } to { transform: none; opacity: 1; } }
#toasts { position: fixed; bottom: 18px; left: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 420px; font-size: 13px; animation: pop .15s; }
.toast.ok { background: var(--ok); } .toast.err { background: var(--danger); } .toast.warn { background: var(--warn); }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid #cbd5e1; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; text-align: center; color: var(--muted); }
pre.json { background: #0b1220; color: #d1e9ff; padding: 12px 14px; border-radius: 10px; direction: ltr; text-align: left; font-size: 12.5px; overflow: auto; max-height: 420px; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 8px 14px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tree { list-style: none; padding-inline-start: 18px; margin: 0; }
.tree li { position: relative; padding: 3px 0; }
.tree li::before { content: "└"; position: absolute; right: -14px; color: #cbd5e1; }
.bar { height: 8px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); }
.console textarea { min-height: 160px; direction: ltr; font-family: Consolas, monospace; }

/* ---------- ترمینال کارگر ---------- */
.terminal .thead { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 14px; }
.terminal .thead h2 { font-size: 20px; }
.tstats { display: flex; gap: 10px; margin-inline-start: auto; flex-wrap: wrap; }
.tstat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; min-width: 110px; text-align: center; }
.tstat .v { font-size: 26px; font-weight: 700; line-height: 1.2; }
.tstat .l { font-size: 12px; color: var(--muted); }
.tstat.accent { border-color: var(--primary); background: var(--primary-soft); }
.tstat.ok .v { color: var(--ok); } .tstat.bad .v { color: var(--danger); }
.tgrid { display: grid; grid-template-columns: 300px 1fr 300px; gap: 14px; align-items: start; }
@media (max-width: 1200px) { .tgrid { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; min-width: 80px; line-height: 1.4; font-weight: 600; }
.chip-btn small { font-weight: 400; color: var(--muted); font-size: 11px; }
.chip-btn.on { background: var(--primary); color: #fff; border-color: var(--primary); } .chip-btn.on small { color: #dbeafe; }
.chip-btn.off { opacity: .45; cursor: not-allowed; }
.chip-btn.sm { flex-direction: row; min-width: 0; padding: 4px 10px; font-weight: 500; font-size: 12.5px; }
.wolist { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.woitem { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.woitem.on { border-color: var(--primary); background: var(--primary-soft); }
.woitem .r { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.unitgrid { display: flex; flex-wrap: wrap; gap: 4px; max-height: 300px; overflow-y: auto; }
.unit { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 8px; font-size: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.unit small { color: var(--muted); font-size: 10.5px; }
.unit.mine { border-color: var(--ok); background: var(--ok-soft); }
.unit.failed { border-color: var(--danger); background: var(--danger-soft); }
input.scan { width: 100%; font-size: 22px; padding: 14px 18px; border: 2px solid var(--primary); border-radius: 14px; direction: ltr; text-align: center; font-family: Consolas, monospace; letter-spacing: 1px; }
input.scan::placeholder { direction: rtl; letter-spacing: 0; font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif; font-size: 15px; color: #94a3b8; }
.scaninfo { margin-top: 12px; min-height: 40px; }
.scaninfo .r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step { flex: 1; min-width: 90px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; text-align: center; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; }
.step b { font-size: 14px; color: var(--text); } .step small { font-size: 10.5px; }
.step.done { background: var(--ok-soft); border-color: #86efac; } .step.cur { background: var(--primary-soft); border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.2); } .step.bad { background: var(--danger-soft); border-color: #fca5a5; }
.scanactions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.bigbtn { flex: 1; min-width: 140px; border: none; border-radius: 14px; padding: 18px 12px; font-size: 18px; font-weight: 700; cursor: pointer; color: #fff; background: var(--primary); }
.bigbtn.ok { background: var(--ok); } .bigbtn.warn { background: var(--warn); } .bigbtn.danger { background: var(--danger); } .bigbtn.ghost { background: #e2e8f0; color: var(--text); }
.bigbtn:disabled { opacity: .5; }
.flash { position: fixed; inset: 0; display: grid; place-items: center; font-size: 96px; font-weight: 800; color: #fff; z-index: 500; pointer-events: none; animation: flash .7s ease-out forwards; }
.flash.ok { background: rgba(22,163,74,.85); } .flash.danger { background: rgba(220,38,38,.85); } .flash.warn { background: rgba(217,119,6,.85); }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.recent { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #eef1f5; font-size: 12.5px; }
.stationrow { display: flex; gap: 8px; flex-wrap: wrap; }
.stbox { flex: 1; min-width: 100px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.stbox .v { font-size: 22px; font-weight: 700; color: var(--primary); }

/* ---------- نمودارها ---------- */
.chartbox { width: 100%; }
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }
.legend.v { flex-direction: column; gap: 4px; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(160px, 1.2fr) 2fr minmax(120px, auto); align-items: center; gap: 10px; font-size: 13px; }
.hbar.clickable { cursor: pointer; } .hbar.clickable:hover .lbl { color: var(--primary); }
.hbar .trk { height: 12px; background: var(--gray-soft); border-radius: 6px; overflow: hidden; }
.hbar .trk i { display: block; height: 100%; border-radius: 6px; }
.hbar .val { text-align: left; direction: ltr; color: var(--muted); font-size: 12px; white-space: nowrap; }
.donutbox { display: flex; gap: 16px; align-items: center; }
.donut { width: 160px; height: 160px; flex-shrink: 0; }
.rangebar { align-items: center; }

/* ---------- گزارش‌های مدیریتی ---------- */
.headline { background: linear-gradient(135deg, #1e3a8a 0%, #0ea5e9 100%); color: #fff; border-radius: 14px; padding: 16px 20px; margin-bottom: 14px; }
.headline b { font-size: 17px; }
.headline .muted { color: #dbeafe; }
.execbar { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #0f172a 0%, var(--primary) 100%); color: #fff; border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; }
.execbar b { font-size: 16px; }
.execbar .muted { color: #cbd5e1; font-size: 12.5px; }
.execbar .btn { margin-inline-start: auto; }
.findings { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.find { border: 1px solid var(--line); border-inline-start: 5px solid var(--muted); border-radius: 12px; padding: 10px 14px; background: var(--panel); }
.find.danger { border-inline-start-color: var(--danger); background: #fff7f7; }
.find.warn { border-inline-start-color: var(--warn); background: #fffbf3; }
.find.info { border-inline-start-color: var(--accent); }
.find.ok { border-inline-start-color: var(--ok); }
.find .ft { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.find .ft b { font-size: 14.5px; }
.find .ic { font-size: 13px; }
.find .impact { font-weight: 700; color: var(--danger); direction: ltr; }
.find .fd { color: #334155; font-size: 13px; margin: 6px 0; line-height: 2; }
.find .fa { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); background: var(--gray-soft); border-radius: 8px; padding: 6px 10px; }
.find .fa .btn { margin-inline-start: auto; }
.stat .qm { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--gray-soft); color: var(--muted); font-size: 10px; margin-inline-start: 4px; cursor: help; }
.stat.bad { border-inline-start: 4px solid var(--danger); }
tr.row-bad td { background: #fff5f5; }
.cmpbars { display: flex; flex-direction: column; gap: 8px; }
.cmp { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr minmax(120px, auto); gap: 10px; align-items: center; font-size: 13px; }
.cmp .trk { position: relative; height: 18px; background: var(--gray-soft); border-radius: 6px; overflow: hidden; }
.cmp .trk i { position: absolute; inset-inline-start: 0; height: 100%; border-radius: 6px; }
.cmp .trk i.g { background: #cbd5e1; top: 0; }
.cmp .trk i.t { background: var(--primary); top: 0; height: 100%; opacity: .95; }
.cmp .val { direction: ltr; text-align: left; font-size: 12.5px; }
.waterfall { display: flex; gap: 6px; align-items: flex-end; min-height: 260px; padding-top: 10px; overflow-x: auto; }
.wcol { flex: 1; min-width: 78px; display: flex; flex-direction: column; align-items: center; }
.wbar-wrap { position: relative; width: 100%; height: 190px; }
.wbar { position: absolute; inset-inline: 12%; border-radius: 5px; background: #cbd5e1; }
.wbar.start { background: var(--primary); } .wbar.end { background: var(--ok); } .wbar.down { background: #fca5a5; }
.wlink { position: absolute; inset-inline-end: 0; width: 120%; border-top: 1px dashed #cbd5e1; }
.wval { font-size: 11.5px; font-weight: 600; margin-top: 6px; direction: ltr; }
.wlbl { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.5; }
/* جست‌وجوی سریع */
.palette-list { margin-top: 10px; max-height: 320px; overflow-y: auto; }
.pitem { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 9px; cursor: pointer; }
.pitem:hover, .pitem.hl { background: var(--primary-soft); }
.topbar kbd { background: var(--gray-soft); border-radius: 5px; padding: 0 5px; font-size: 10.5px; margin-inline-start: 6px; color: var(--muted); }
@media print {
  .sidebar, .topbar, .rangebar, .btn { display: none !important; }
  .content { padding: 0; } .card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

/* ---------------------------------------------------------------- مهندسی صنایع */
.stat.ok .v { color: var(--ok); }
.stat.warn .v { color: var(--warn); }
.stat.bad .v { color: var(--danger); }
tr.row-bad td { background: #fff5f5; }
tr.row-good td { background: #f2fdf5; }
/* نمودار بار ایستگاه‌ها نسبت به تکت */
.balchart { display: flex; align-items: flex-end; gap: 18px; padding: 10px 4px 0; overflow-x: auto; }
.balcol { flex: 1 1 0; min-width: 78px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bcbar { position: relative; width: 100%; height: 150px; background: var(--gray-soft); border-radius: 8px; display: flex; align-items: flex-end; }
.bcbar i { display: block; width: 100%; background: var(--primary); border-radius: 8px 8px 0 0; transition: height .25s; }
.bcbar.bn i { background: var(--danger); }
.bcbar u { position: absolute; inset-inline: -4px; border-top: 2px dashed var(--danger); }
.bclbl { text-align: center; line-height: 1.9; }
.bclbl b { display: block; font-size: 12.5px; }
.bclbl small { display: block; font-size: 11px; color: var(--muted); }
.bclbl small.bad { color: var(--danger); font-weight: 700; }
/* نوار سهم شش زیان بزرگ */
.lossbar { display: flex; height: 22px; border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.lossbar i { display: block; height: 100%; }

/* ---------------------------------------------------------------- داشبورد تحلیلی تعاملی */
.bitabs { margin: 6px 0 10px; }
.chip-btn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.bilayout { display: grid; grid-template-columns: 238px 1fr; gap: 14px; align-items: start; }
.bislicers { position: sticky; top: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; max-height: calc(100vh - 120px); overflow: auto; }
.slhead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.slhead b { font-size: 13px; }
.slicer { border-top: 1px solid var(--line); padding: 6px 0; }
.slicer summary { cursor: pointer; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.slvals { display: flex; flex-direction: column; gap: 3px; margin-top: 5px; max-height: 230px; overflow: auto; }
.slval { display: flex; align-items: center; gap: 6px; border: 1px solid transparent; background: var(--gray-soft); border-radius: 7px; padding: 4px 7px; font: inherit; font-size: 11.5px; cursor: pointer; text-align: start; }
.slval span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slval small { color: var(--muted); direction: ltr; }
.slval:hover { background: #e2e8f0; }
.slval.on { background: var(--primary); color: #fff; }
.slval.on small { color: #dbeafe; }
.fchips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; min-height: 28px; }
.fchip { background: var(--primary); color: #fff; border: 0; border-radius: 20px; padding: 4px 11px; font: inherit; font-size: 11.5px; cursor: pointer; }
.fchip small { opacity: .75; }
.bigrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vis { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.vis.full { grid-column: 1 / -1; }
.vis:nth-child(4), .vis:nth-child(5) { grid-column: 1 / -1; }
.vis-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--gray-soft); }
.vis-h b { font-size: 13px; }
.vis-b { padding: 12px; }
.vctl { display: flex; align-items: center; gap: 6px; }
.input.sm { padding: 3px 7px; font-size: 11.5px; height: auto; }
.icobtn { border: 1px solid var(--line); background: var(--panel); border-radius: 7px; cursor: pointer; padding: 2px 7px; font-size: 12px; }
/* نمودار ستونی */
.colchart { display: flex; align-items: flex-end; gap: 6px; height: 210px; overflow-x: auto; padding-top: 18px; }
.colchart .col { flex: 1 1 0; min-width: 34px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; cursor: pointer; }
.colchart .col i { display: block; width: 78%; background: var(--primary); border-radius: 6px 6px 0 0; transition: height .2s, background .2s; }
.colchart .col:hover i { background: #1e40af; }
.colchart .col.on i { background: var(--ok); }
.colchart .col .v { font-size: 10px; color: var(--muted); direction: ltr; margin-bottom: 3px; white-space: nowrap; }
.colchart .col u { font-size: 10.5px; color: #475569; text-decoration: none; margin-top: 5px; white-space: nowrap; }
/* سهم دایره‌ای */
.sharebox { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sharebox .pie { width: 140px; height: 140px; border-radius: 50%; flex: 0 0 auto; }
.legend.v span.on { background: var(--primary-soft); border-radius: 6px; padding: 1px 5px; font-weight: 700; }
.hbar.on .trk i { background: var(--ok) !important; }
/* ماتریس گرمایی */
table.matrix td.heat { font-size: 11.5px; }
table.matrix td.b { font-weight: 700; }
@media (max-width: 1100px) { .bilayout { grid-template-columns: 1fr; } .bigrid { grid-template-columns: 1fr; } .bislicers { position: static; max-height: none; } }
/* ستون اول جدول‌های داشبورد تحلیلی نباید زیر فشار ستون‌های عددی له شود */
.vis .table-wrap table.grid th:first-child, .vis .table-wrap table.grid td:first-child { min-width: 210px; max-width: 340px; }
.vis .table-wrap table.grid td, .vis .table-wrap table.grid th { white-space: nowrap; }
.vis .table-wrap table.grid td:first-child { white-space: normal; }

/* ---------------------------------------------------------------- راه‌اندازی کارخانه */
.pbar { height: 8px; background: var(--gray-soft); border-radius: 6px; overflow: hidden; min-width: 120px; }
.pbar i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s; }
.pbar.ok i { background: var(--ok); }
.setup-hero .card-b { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.sh-main { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 320px; }
.sh-ring { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.sh-ring span { width: 80px; height: 80px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.sh-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sh-info h3 { margin: 0; font-size: 20px; }
.sh-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sh-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 420px; }
.sh-block { font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.setup-template { margin-top: 14px; border-inline-start: 5px solid var(--accent); }
.tpl-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 10px 0; }
.tpl { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.tpl h4 { margin: 0; font-size: 15px; }
.tpl p { margin: 0; font-size: 12.5px; line-height: 1.9; }
.tpl .btn { align-self: flex-start; margin-top: 4px; }
.tpl-inc { font-size: 12.5px; color: var(--muted); line-height: 2; }
.setup-phase { margin-top: 14px; }
.setup-phase.complete { border-inline-start: 5px solid var(--ok); }
.setup-phase .card-h h3 { margin: 0; }
.ph-prog { display: flex; align-items: center; gap: 10px; }
.step-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.step-row:last-child { border-bottom: 0; }
.step-row .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; flex: 0 0 auto; background: var(--gray-soft); color: var(--muted); }
.step-row .dot.ok { background: var(--ok-soft); color: #166534; }
.step-row .dot.warn { background: #fef3c7; color: #92400e; }
.st-body { flex: 1; min-width: 0; }
.st-title { display: flex; align-items: center; gap: 8px; }
.st-detail { font-size: 12.5px; line-height: 1.9; margin-top: 2px; }
.st-hint { font-size: 12px; color: #92400e; margin-top: 4px; }
.st-count { min-width: 96px; text-align: center; }
.st-count b { font-size: 18px; }
.st-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.imp { display: flex; flex-direction: column; gap: 12px; }
.imp-step { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.imp-sum { padding: 10px 14px; border-radius: 10px; }
.imp-sum.ok { background: var(--ok-soft); }
.imp-sum.warn { background: #fffbeb; border: 1px solid #fde68a; }
.form { display: flex; flex-direction: column; gap: 10px; }
.frow { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 4px 12px; }
.frow small { grid-column: 2; }
@media (max-width: 800px) { .step-row { flex-wrap: wrap; } .st-actions { width: 100%; } .frow { grid-template-columns: 1fr; } .frow small { grid-column: 1; } }

/* ---------------------------------------------------------------- فیلدهای سفارشی */
.cf-card { margin-top: 14px; border-inline-start: 4px solid var(--accent); }
.cf-card .card-h h3 { margin: 0; }
.cf-form { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.cf-form h4 { margin: 0 0 10px; font-size: 14px; }
th.cf-th { background: #f0f7ff; }
tr.row-off td { opacity: .55; }
.cf-flags { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0; }
.cf-preview { background: var(--gray-soft); border-radius: 10px; padding: 12px; }
.frow.hidden { display: none; }

/* ---------------------------------------------------------------- نقشهٔ شماتیک محل کار */
.lay-stage { background: #fcfdff; border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.lay-stage.compact svg { width: 100%; height: auto; max-height: 460px; }
.lay-view { display: grid; grid-template-columns: 1fr 290px; gap: 14px; align-items: start; }
.lay-view .lay-stage svg { width: 100%; height: auto; }
.lay-side .card { position: sticky; top: 10px; }
.lay-side-v { font-size: 28px; font-weight: 800; margin: 8px 0 2px; }
.lay-svg { display: block; font-family: inherit; direction: rtl; }
.lay-svg text { font-family: Vazirmatn, Tahoma, sans-serif; pointer-events: none; }
.lay-l { font-size: 12.5px; fill: #0f172a; }
.lay-l.b { font-weight: 700; }
.lay-small { font-size: 10.5px; fill: #475569; }
.lay-zone-l { font-size: 15px; font-weight: 800; fill: #64748b; }
.lay-line-l { font-size: 11.5px; font-weight: 700; fill: #1e40af; }
.lay-text { font-size: 15px; font-weight: 700; fill: #0f172a; }
.lay-ic { font-size: 20px; }
.lay-ic-s { font-size: 14px; }
.lay-val { font-size: 13px; font-weight: 800; }
.lay-el { cursor: pointer; }
.lay-el:not(.t-zone):hover rect, .lay-el:not(.t-zone):hover circle { filter: brightness(0.97); }
.lay-dot.running { animation: layPulse 1.6s infinite; }
.lay-dot.down { animation: layBlink 1s infinite; }
@keyframes layPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes layBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .15; } }
.lay-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); align-items: center; }
.lay-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.lay-kpis { margin-bottom: 10px; }
/* ویرایشگر */
.lay-bar { flex-wrap: wrap; gap: 6px; }
.lay-bar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.lay-palette { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 10px; }
.lay-pal-btn { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.lay-pal-btn span { font-size: 15px; }
.lay-pal-btn:hover { border-color: var(--primary); color: var(--primary); }
.lay-editor { display: grid; grid-template-columns: 1fr 280px; gap: 14px; align-items: start; }
.lay-scroll { overflow: auto; max-height: calc(100vh - 250px); border-radius: 12px; }
.lay-stage.edit { outline: none; display: inline-block; min-width: 100%; }
.lay-stage.edit svg { touch-action: none; }
.lay-selbox { fill: none; stroke: #2563eb; stroke-width: 1.5; stroke-dasharray: 5 4; pointer-events: none; }
.lay-handle { fill: #2563eb; stroke: #fff; stroke-width: 1.5; cursor: nwse-resize; }
.lay-props { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; position: sticky; top: 10px; max-height: calc(100vh - 120px); overflow: auto; }
.lay-props h4 { margin: 0 0 10px; }
.lay-prow { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; }
.lay-xy { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.lay-xy .lay-prow { grid-template-columns: 44px 1fr; }
.lay-col { display: flex; gap: 6px; align-items: center; }
.lay-actions { display: flex; gap: 6px; margin-top: 10px; }
.btn.ghost.danger { color: var(--danger); background: transparent; }
.btn.ghost.danger:hover { background: var(--danger-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 1100px) { .lay-view, .lay-editor { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- نوع کسب‌وکار و ماژول‌ها */
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.kind-card { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: start; border: 1.5px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; line-height: 1.8; }
.kind-card:hover { border-color: var(--primary); }
.kind-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.kind-card .kc-i { font-size: 26px; }
.kind-card small { font-size: 12px; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.mod-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; line-height: 1.8; }
.mod-card.on { border-color: var(--ok); background: #f3fdf6; }
.mod-card input { margin-top: 6px; }
.mod-card .muted { font-size: 12px; }
.mod-req { display: block; color: #92400e; font-size: 11.5px; }
.mod-note { margin-top: 8px; color: #92400e; font-size: 12.5px; min-height: 18px; }
.mod-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: 8px; }
.mod-head h4 { margin: 0; }
.mod-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.mod-chips .chip { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--gray-soft); color: var(--muted); text-decoration: line-through; }
.mod-chips .chip.on { background: #dcfce7; color: #166534; text-decoration: none; }
.wiz-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.wiz-s { padding: 4px 12px; border-radius: 20px; background: var(--gray-soft); color: var(--muted); font-size: 12.5px; }
.wiz-s.on { background: var(--primary); color: #fff; }
.wiz-s.done { background: #dcfce7; color: #166534; }
.wiz-sum { background: var(--gray-soft); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
.tpl.kind-card .badge { align-self: flex-start; }

/* ---------------------------------------------------------------- سازمان‌ها */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.org-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.org-card.off { opacity: .6; }
.org-top { display: flex; gap: 12px; align-items: flex-start; }
.org-ic { font-size: 30px; line-height: 1; width: 46px; height: 46px; display: grid; place-items: center; background: var(--primary-soft); border-radius: 12px; flex: none; }
.org-t { flex: 1; min-width: 0; }
.org-t b { font-size: 15.5px; }
.org-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.org-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.org-actions { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.del-warn { background: var(--danger-soft); color: #7f1d1d; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; line-height: 1.9; }
.del-step { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.del-step .input { max-width: 280px; }
@media (max-width: 560px) { .org-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- انتقال پیکربندی */
.tpl-sep { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.tpl-opt { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; background: var(--gray-soft); border-radius: 10px; padding: 8px 12px; }
.cfg-groups { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.cfg-g { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.cfg-g input { margin-top: 6px; }
.cfg-g.inline { align-items: center; padding: 6px 10px; }
.cfg-g.inline input { margin-top: 0; }
.cfg-src .cfg-groups { flex-direction: row; flex-wrap: wrap; }
.cfg-tbls { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cfg-tbls .chip { font-size: 11.5px; }

/* ---------------------------------------------------------------- صندوق فروش (POS) */
.content.pos-mode { padding: 10px 12px; }
.pos-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; height: calc(100vh - 92px); min-height: 520px; }
.pos-main { display: flex; flex-direction: column; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.pos-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pos-top .spacer { flex: 1; }
.pos-clock { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.pos-scan { position: relative; margin: 10px 0 4px; }
.pos-scan-in { font-size: 19px; padding: 12px 14px; border-width: 2px; border-color: var(--primary); }
.pos-results { position: absolute; top: 100%; inset-inline: 0; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,40,.18); max-height: 330px; overflow: auto; }
.pos-res { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; width: 100%; text-align: start; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; cursor: pointer; font: inherit; }
.pos-res:hover, .pos-res.on { background: var(--primary-soft); }
.pos-res-p { font-weight: 700; }
.pos-res .ok { color: var(--ok); } .pos-res .bad { color: var(--danger); }
.pos-cart { flex: 1; overflow: auto; position: relative; }
.pos-cart table { width: 100%; }
.pos-cart tr.sel td { background: var(--primary-soft); }
.pos-cart td { vertical-align: middle; }
.pos-empty { position: absolute; inset: 60px 0 auto; text-align: center; color: var(--muted); }
.pos-qty { display: flex; gap: 4px; align-items: center; }
.pos-qty .input { width: 64px; text-align: center; padding: 5px; }
.pos-disc { width: 64px; padding: 5px; text-align: center; }
.pos-sn { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pos-sn .chip { font-size: 11px; direction: ltr; }
.pos-sn .chip .x { cursor: pointer; margin-inline-start: 4px; color: var(--danger); }
.pos-warn { color: var(--warn); font-size: 11.5px; }
.pos-side { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow: auto; }
.pos-cust { display: flex; flex-direction: column; gap: 6px; }
.pos-cust-list { display: flex; flex-wrap: wrap; gap: 4px; }
.pos-cust-walk { display: grid; grid-template-columns: 1fr 120px; gap: 6px; }
.pos-cust-sel { display: flex; align-items: center; gap: 6px; background: var(--primary-soft); border-radius: 10px; padding: 8px 10px; }
.pos-cust-sel .btn { margin-inline-start: auto; }
.pos-sum { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.pos-sum > div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.pos-sum-t { flex-direction: column; align-items: stretch; background: #0f172a; color: #fff; border-radius: 12px; padding: 10px 12px; margin-top: 6px; }
.pos-total { font-size: 34px; font-weight: 800; text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
.pos-pays { display: grid; gap: 8px; }
.pos-pay { font-size: 17px; padding: 14px; justify-content: space-between; display: flex; align-items: center; }
.pos-pay kbd { font-size: 11px; opacity: .7; }
.pos-pay.cash { background: var(--ok); color: #fff; border-color: var(--ok); }
.pos-pay.card { background: var(--primary); color: #fff; border-color: var(--primary); }
.pos-pay:disabled { opacity: .45; }
.pos-paydlg { display: flex; flex-direction: column; gap: 10px; min-width: min(460px, 86vw); }
.pos-payrow { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: center; }
.pos-payrow > .pos-quick, .pos-payrow > input:not(.pos-money), .pos-payrow > select + * { grid-column: 2; }
.pos-money { font-size: 18px; text-align: left; font-variant-numeric: tabular-nums; }
.pos-quick { display: flex; flex-wrap: wrap; gap: 4px; grid-column: 2; }
.pos-paystat { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.pos-paystat > div { background: var(--gray-soft); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; font-size: 12.5px; }
.pos-paystat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pos-paystat .rem { background: var(--warn-soft); } .pos-paystat .chg { background: var(--ok-soft); }
.pos-done { display: flex; flex-direction: column; gap: 12px; min-width: min(380px, 86vw); }
.pos-change { background: var(--ok-soft); border-radius: 12px; padding: 14px; text-align: center; display: flex; flex-direction: column; }
.pos-change b { font-size: 30px; }
.pos-rcpt-wrap { display: flex; flex-direction: column; align-items: center; }
.pos-rcpt { width: 320px; height: 60vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pos-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.pos-find { display: flex; gap: 6px; }
.pos-open { max-width: 900px; margin: 0 auto; }
.pos-open h2 { margin-bottom: 6px; }
.pos-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 14px 0; }
.pos-term.busy { opacity: .6; cursor: not-allowed; }
.pos-open-cash { display: grid; grid-template-columns: auto minmax(160px, 280px) auto; gap: 10px; align-items: center; }
.btn.lg { padding: 12px 22px; font-size: 16px; }
.pos-links { margin-top: 16px; }
.pos-rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.pos-bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; }
.pos-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.pos-bar i { display: block; width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.pos-bar.cur i { background: var(--accent); }
.pos-bar small { font-size: 10px; color: var(--muted); }
.pos-meth { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
@media (max-width: 900px) { .pos-wrap { grid-template-columns: 1fr; height: auto; } .pos-cart { min-height: 260px; } .pos-open-cash { grid-template-columns: 1fr; } .pos-payrow { grid-template-columns: 1fr; } .pos-payrow > * { grid-column: 1 !important; } }

/* ---------------------------------------------------------------- شخصی‌سازی: پرکاربردها، داشبورد، ظاهر سازمان */
.fav-btn { font-size: 18px; line-height: 1; padding: 4px 8px; color: var(--muted); }
.fav-btn.on { color: #f59e0b; }
.nav-group.fav .head { color: #fcd34d; }
.brand .brand-sub { display: block; opacity: .75; font-size: 10.5px; }
.dash-head { display: flex; margin: -6px 0 8px; }
.dash-head .spacer { flex: 1; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dash-w.full { grid-column: 1 / -1; }
.dash-w:empty { display: none; }
.dash-w > .stats, .dash-w > .execbar, .dash-w > .card { margin-bottom: 0; }
.dash-w > * + * { margin-top: 14px; }
.dash-cfg { display: flex; flex-direction: column; gap: 6px; min-width: min(460px, 86vw); }
.dash-cfg-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.dash-cfg-row.off { opacity: .55; }
.dash-cfg-row label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.ap-brand .frow { display: grid; grid-template-columns: 200px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.ap-color { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ap-color input[type=color] { width: 48px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.ap-sw { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-swb { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.ap-swb.on { box-shadow: 0 0 0 2px var(--text); }
.ap-group { margin-bottom: 10px; }
.ap-group .card-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ap-group .card-h .input { max-width: 280px; margin-inline-start: auto; }
.ap-custom { border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .ap-brand .frow { grid-template-columns: 1fr; } }

.hq-att { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); }

/* ---------------------------------------------------------------- بازگشت */
.back-btn:disabled { opacity: .35; }
.return-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--primary-soft); border-bottom: 1px solid var(--line); padding: 8px 22px; position: sticky; top: 60px; z-index: 15; font-size: 13px; }
.return-bar .btn.primary { margin-inline-start: auto; }

/* ---------------------------------------------------------------- چارت سازمانی */
.oc-page { display: flex; flex-direction: column; gap: 8px; }
.oc-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.oc-toolbar h2 { font-size: 18px; }
.oc-toolbar .spacer { flex: 1; }
.oc-zoom { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--panel); }
.oc-zoom-l { min-width: 44px; text-align: center; font-size: 12px; }
.oc-hint { background: var(--primary-soft); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; }
.oc-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.oc-main { min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.oc-scroll { overflow: auto; max-height: calc(100vh - 230px); min-height: 360px; position: relative; }
.oc-spacer { position: relative; margin: 0 auto; }
.oc-stage { position: absolute; top: 0; right: 0; transform-origin: top right; }
.oc-lines { position: absolute; inset: 0; pointer-events: none; }
.oc-lines line { stroke: #6b7280; stroke-width: 1.4; }
.oc-node { position: absolute; box-sizing: border-box; border: 1.5px solid; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 4px 8px; font-size: 12.5px; line-height: 1.45; cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,40,.08); transition: box-shadow .12s, outline .12s; user-select: none; }
.oc-node.dashed { border-style: dashed; }
.oc-node.off { opacity: .45; }
.oc-node:hover { box-shadow: 0 4px 12px rgba(16,24,40,.18); }
.oc-node.sel { outline: 3px solid #f59e0b; outline-offset: 2px; }
.oc-node.hit { outline: 3px solid #22c55e; outline-offset: 2px; }
.oc-node.dim { opacity: .3; }
.oc-node .oc-name { font-weight: 600; outline: none; }
.oc-node .oc-name[contenteditable=true] { background: #fff; color: #111; border-radius: 4px; padding: 0 4px; cursor: text; }
.oc-node .oc-head { font-size: 11px; opacity: .9; }
.oc-node .oc-code { font-size: 9.5px; opacity: .7; direction: ltr; }
.oc-count { position: absolute; top: -9px; left: -6px; background: #fff; color: #1f2937; border: 1px solid #cbd5e1; border-radius: 999px; font-size: 10px; padding: 0 6px; line-height: 16px; }
.oc-fold { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); min-width: 18px; height: 18px; border-radius: 9px; border: 1px solid #94a3b8; background: #fff; color: #334155; font-size: 11px; line-height: 14px; padding: 0 4px; cursor: pointer; }
.oc-add { position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 14px; line-height: 22px; padding: 0; cursor: pointer; display: none; z-index: 2; }
.oc-stage.editing .oc-node:hover .oc-add, .oc-stage.editing .oc-node.sel .oc-add { display: block; }
.oc-add.below { bottom: -26px; left: calc(50% + 14px); }
.oc-add.left { left: -26px; top: calc(50% - 11px); }
.oc-add.right { right: -26px; top: calc(50% - 11px); }
.oc-node.drop { outline: 3px dashed var(--primary); outline-offset: 3px; }
.oc-node.drop-side { box-shadow: 8px 0 0 -2px var(--primary); }
.oc-node.dragging { opacity: .4; }
.oc-ghost { position: fixed !important; pointer-events: none; z-index: 1000; opacity: .85; transform: rotate(-2deg); }
.oc-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; }
.oc-leg { border: 1.5px solid; border-radius: 6px; padding: 3px 12px; font-size: 12px; }
.oc-leg.dashed { border-style: dashed; }
.oc-note { padding: 0 14px 10px; font-size: 11.5px; }
.oc-panel { width: 310px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
.oc-p-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.oc-p-head b { flex: 1; }
.oc-p-info { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.oc-form { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.oc-f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.oc-f > span { color: var(--muted); }
.oc-chk { display: flex; gap: 6px; align-items: center; font-size: 12.5px; cursor: pointer; }
.oc-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.oc-del-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.oc-cats { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.oc-cat-row { display: grid; grid-template-columns: 170px 1fr auto auto auto auto auto auto; gap: 6px; align-items: center; }
.oc-col { display: flex; flex-direction: column; align-items: center; font-size: 10px; }
.oc-col input { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 1000px) { .oc-body { grid-template-columns: 1fr; } .oc-panel { width: auto; position: static; } }
@media print {
  body.oc-print .sidebar, body.oc-print .topbar, body.oc-print .return-bar, body.oc-print .oc-toolbar, body.oc-print .oc-hint, body.oc-print .oc-panel, body.oc-print .toast { display: none !important; }
  body.oc-print .main, body.oc-print .content { margin: 0 !important; padding: 0 !important; }
  body.oc-print .oc-scroll { max-height: none; overflow: visible; }
  body.oc-print .oc-main { border: 0; }
}

/* ---------------------------------------------------------------- درخواست‌ها و طراح فرایند */
.rq-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rq-type { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; text-align: start; }
.rq-type:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(16,24,40,.1); }
.rq-ic { font-size: 22px; }
.rq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.rq-card { padding: 12px; cursor: pointer; }
.rq-card:hover { box-shadow: 0 4px 12px rgba(16,24,40,.12); }
.rq-c-top { display: flex; gap: 10px; align-items: flex-start; }
.rq-sum { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-c-meta { font-size: 11.5px; margin-top: 6px; }
.rq-form .req { color: var(--danger); }
.rq-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--gray-soft); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.rq-flow-s { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.rq-flow-s.end { border-color: var(--ok); color: var(--ok); }
.rq-d-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.rq-tl { display: flex; flex-direction: column; gap: 0; border-inline-start: 3px solid var(--line); margin: 8px 8px 0 0; padding-inline-start: 14px; }
.rq-tl-i { position: relative; display: flex; flex-direction: column; padding: 6px 0 10px; }
.rq-tl-i::before { content: ''; position: absolute; inset-inline-start: -21px; top: 10px; width: 11px; height: 11px; border-radius: 50%; background: #cbd5e1; border: 2px solid var(--panel); }
.rq-tl-i.done::before { background: var(--ok); } .rq-tl-i.bad::before { background: var(--danger); } .rq-tl-i.cur::before { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.term-req { display: flex; gap: 6px; margin-inline-start: auto; }
.pd-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.pd-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.pd-sec { font-size: 11.5px; color: var(--muted); padding: 8px 8px 2px; }
.pd-item { display: flex; gap: 8px; align-items: center; text-align: start; background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; font: inherit; }
.pd-item small { display: block; font-size: 11px; }
.pd-item:hover { background: var(--gray-soft); } .pd-item.on { background: var(--primary-soft); }
.pd-editor { min-width: 0; }
.pd-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.pd-chain-wrap { overflow-x: auto; padding: 6px 2px 12px; }
.pd-chain { display: flex; gap: 8px; align-items: stretch; }
.pd-node { flex: none; width: 250px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.pd-node.start, .pd-node.end { width: 150px; justify-content: center; text-align: center; background: var(--gray-soft); }
.pd-node.end { border-color: var(--ok); }
.pd-node.step { border-color: var(--primary); }
.pd-n-head { display: flex; gap: 4px; align-items: center; }
.pd-n-head b { flex: 1; }
.pd-name { font-weight: 600; }
.pd-plus { flex: none; align-self: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px dashed var(--primary); background: var(--panel); color: var(--primary); cursor: pointer; font-size: 16px; }
.pd-plus:hover { background: var(--primary); color: #fff; }
.pd-cond { display: flex; flex-direction: column; gap: 4px; }
.pd-cond-row { display: grid; grid-template-columns: 1fr 88px 80px auto; gap: 4px; }
.pd-cond-row .input, .pd-join { padding: 5px 6px; font-size: 12px; }
.pd-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pd-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pd-fields { display: flex; flex-direction: column; gap: 6px; }
.pd-field { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr auto auto auto; gap: 6px; align-items: center; }
.pd-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-roles .chip { cursor: pointer; }
.pd-roles .chip input { display: none; }
@media (max-width: 1000px) { .pd-wrap { grid-template-columns: 1fr; } .pd-list { position: static; max-height: none; } .pd-field { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- داشبورد بخش‌ها */
.db-kpi.ok { border-top: 3px solid var(--ok); } .db-kpi.warn { border-top: 3px solid var(--warn); } .db-kpi.bad { border-top: 3px solid var(--danger); }
.db-kpi.bad .v { color: var(--danger); }
.db-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; align-items: start; }
.db-alerts .card-b { display: flex; flex-direction: column; gap: 4px; }
.db-alert { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; color: var(--text); font-size: 13px; }
a.db-alert:hover { background: var(--gray-soft); }
.db-alert .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); transform: translateY(-1px); }
.db-alert.bad .dot { background: var(--danger); } .db-alert.warn .dot { background: var(--warn); } .db-alert.info .dot { background: var(--accent); }

/* ---------------------------------------------------------------- نقشهٔ شماتیک: چرخش، جریان، لایه‌ها، آمار زنده */
.lay-pill rect { stroke-width: 1; }
.lay-pill text { font-size: 10.5px; font-weight: 700; }
.lay-pill.wip rect { fill: #fff7ed; stroke: #f97316; } .lay-pill.wip text { fill: #c2410c; }
.lay-pill.flow-work rect { fill: #eff6ff; stroke: #2563eb; } .lay-pill.flow-work text { fill: #1d4ed8; }
.lay-pill.flow-material rect { fill: #fff7ed; stroke: #ea580c; } .lay-pill.flow-material text { fill: #c2410c; }
.lay-names { font-size: 10px; fill: #0f766e; font-weight: 600; }
.lay-made { font-size: 10.5px; fill: #15803d; font-weight: 700; }
.lay-halo { paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.lay-flow.run { animation: layDash 1.6s linear infinite; }
@keyframes layDash { to { stroke-dashoffset: -36; } }
.lay-flow-g { cursor: pointer; }
.lay-flow-g:hover .lay-flow { filter: brightness(1.15); }
.lay-hit > g > rect, .lay-hit > g > circle { stroke: #db2777 !important; stroke-width: 3.5 !important; }
.lay-focus { fill: none; stroke: #2563eb; stroke-width: 2.5; stroke-dasharray: 6 4; pointer-events: none; }
.lay-selbox.locked { stroke: #94a3b8; }
.lay-handle.rot { fill: #fff; stroke: #2563eb; stroke-width: 2; cursor: grab; }
.lay-handle.bend { fill: #fff; stroke: #2563eb; stroke-width: 2; cursor: move; }
.lay-rot-line { stroke: #2563eb; stroke-width: 1.2; pointer-events: none; }
.lay-marquee { fill: rgba(37, 99, 235, .08); stroke: #2563eb; stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.lay-conn-src { fill: none; stroke: #16a34a; stroke-width: 3; stroke-dasharray: 6 4; pointer-events: none; animation: layPulse 1.2s infinite; }
.lay-hint { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; border-radius: 10px; padding: 6px 12px; margin-bottom: 8px; font-size: 13px; }
.lay-conn-btn.work { border-color: #93c5fd; } .lay-conn-btn.material { border-color: #fdba74; }
.lay-conn-btn.on.work { background: #2563eb; color: #fff; } .lay-conn-btn.on.material { background: #ea580c; color: #fff; }
.lay-keys { font-size: 11.5px; }
.lay-layers { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.lay-layer { cursor: pointer; user-select: none; opacity: .6; }
.lay-layer.on { opacity: 1; background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.lay-layer input { display: none; }
.lay-scroll.view { max-height: calc(100vh - 230px); border: 1px solid var(--line); background: #fcfdff; }
.lay-scroll.view .lay-stage { border: 0; overflow: visible; }
.lay-side-h { margin: 14px 0 6px; font-size: 13px; }
.lay-bars { display: flex; flex-direction: column; gap: 5px; }
.lay-bar-r { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto; gap: 6px; align-items: center; font-size: 12px; }
.lay-bar-r.click { cursor: pointer; border-radius: 6px; } .lay-bar-r.click:hover { background: var(--gray-soft); }
.lay-bar-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lay-bar-t { background: var(--gray-soft); border-radius: 4px; height: 8px; overflow: hidden; }
.lay-bar-t i { display: block; height: 100%; background: var(--primary-2); border-radius: 4px; }
.lay-bars.wip .lay-bar-t i { background: #f97316; }
.lay-now { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; margin-inline-end: 4px; animation: layPulse 1.6s infinite; }
.lay-wip-box { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 8px; padding: 6px 10px; margin-top: 10px; font-size: 12.5px; }
.lay-side-v small { font-size: 13px; font-weight: 500; color: var(--muted); }
.lay-align { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.lay-align .btn { padding: 4px 0; font-size: 14px; }
.lay-rot { display: grid; grid-template-columns: 1fr 64px auto; gap: 6px; align-items: center; }
.lay-range { width: 100%; accent-color: var(--primary); }
.lay-actions .btn.on { background: var(--primary-soft); color: var(--primary); }
.lay-actions { flex-wrap: wrap; }
.lay-icons { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin-bottom: 8px; }
.lay-icon-b { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; font-size: 17px; padding: 3px 0; cursor: pointer; }
.lay-icon-b.on, .lay-icon-b:hover { border-color: var(--primary); background: var(--primary-soft); }
.lay-tips { margin-top: 14px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.lay-tips b { color: var(--text, #0f172a); }
.lay-lg-line { display: inline-block; width: 22px; height: 0; border-top: 3px solid #2563eb; margin-left: 4px; vertical-align: middle; }
.lay-lg-line.material { border-top: 3px dashed #ea580c; }
.lay-lg-heat { display: inline-block; width: 60px; height: 8px; border-radius: 4px; margin: 0 4px; vertical-align: middle; background: linear-gradient(to left, hsl(0, 95%, 50%), hsl(52, 95%, 50%)); }

/* ---------------------------------------------------------------- راه‌اندازی آسان و افراد کارخانه */
.btn.lg { padding: 10px 22px; font-size: 15px; }
.btn.xl { padding: 14px 34px; font-size: 17px; border-radius: 12px; }
.input.lg { font-size: 17px; padding: 12px 14px; }
.input.sm { padding: 5px 8px; font-size: 12.5px; }
.muted.s, .s.muted { font-size: 12px; }
.qk-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.qk-step { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 14px 6px 8px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.qk-step .qk-n { width: 24px; height: 24px; border-radius: 50%; background: var(--gray-soft); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.qk-step.on { border-color: var(--primary); color: var(--primary); font-weight: 700; box-shadow: 0 0 0 3px var(--primary-soft); }
.qk-step.on .qk-n { background: var(--primary); color: #fff; }
.qk-step.done { color: var(--text, #0f172a); } .qk-step.done .qk-n { background: var(--ok, #16a34a); color: #fff; }
.qk-card .card-b { padding: 22px 26px; }
.qk-body { min-height: 320px; }
.qk-q { font-size: 18px; margin: 18px 0 6px; } .qk-q:first-child { margin-top: 0; }
.qk-foot { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.qk-field { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.qk-l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.qk-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.qk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.qk-cards.two { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.qk-opt { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: start; font: inherit; background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.qk-opt:hover { border-color: var(--primary); }
.qk-opt.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.qk-opt.big { padding: 18px; } .qk-opt.big b { font-size: 16px; }
.qk-opt.tog { padding-inline-start: 44px; }
.qk-tick { position: absolute; inset-inline-start: 12px; top: 13px; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
.qk-opt.on .qk-tick { background: var(--primary); border-color: var(--primary); }
.qk-big { font-size: 34px; line-height: 1; }
.qk-days { display: flex; gap: 4px; }
.qk-day { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel); font: inherit; font-weight: 700; cursor: pointer; }
.qk-day.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.qk-steps { display: flex; flex-direction: column; gap: 8px; }
.qk-srow { display: grid; grid-template-columns: 34px minmax(160px, 1fr) 230px auto; gap: 10px; align-items: center; }
.qk-num { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.qk-min { display: flex; align-items: center; gap: 6px; } .qk-min .input { width: 80px; }
.qk-ops { display: flex; gap: 2px; }
.qk-add { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.qk-sug { border: 1px dashed var(--line); background: var(--panel); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 12.5px; cursor: pointer; }
.qk-sug:hover { border-color: var(--primary); color: var(--primary); }
.qk-sug.on { border-style: solid; border-color: var(--primary); background: var(--primary); color: #fff; }
.qk-preview { background: var(--gray-soft); border-radius: 10px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qk-flow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.qk-chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.qk-chip.end { border-color: var(--ok, #16a34a); color: var(--ok, #16a34a); font-weight: 700; }
.qk-arrow { color: var(--muted); font-weight: 800; }
.qk-pstats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.qk-people, .qk-products { display: flex; flex-direction: column; gap: 8px; }
.qk-person, .qk-product { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--panel); }
.qk-prow { display: grid; grid-template-columns: 36px minmax(180px, 1.3fr) minmax(170px, 1fr) auto auto; gap: 10px; align-items: center; }
.qk-product .qk-prow { grid-template-columns: 36px minmax(180px, 1fr) 120px auto auto; }
.qk-av { width: 34px; height: 34px; border-radius: 50%; background: var(--gray-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.qk-av.lg { width: 44px; height: 44px; font-size: 22px; }
.qk-person.r-boss, .qk-prow.r-boss { background: #fffbeb; }
.qk-boss { color: #92400e; font-size: 13px; font-weight: 600; }
.qk-login { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.qk-pextra { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 46px 2px 0; }
.qk-pextra.col { flex-direction: column; align-items: stretch; }
.qk-pextra .input.sm { width: 150px; }
.qk-sp { flex: 1; }
.qk-mats { display: flex; flex-direction: column; gap: 4px; }
.qk-mat { display: flex; gap: 6px; align-items: center; } .qk-mat .input.sm:first-child { flex: 1; max-width: 300px; }
.qk-bulk { margin-top: 10px; border: 1px dashed var(--line); border-radius: 12px; padding: 8px 12px; }
.qk-bulk summary { cursor: pointer; font-weight: 600; }
.qk-bulk-b { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.qk-sum { display: flex; flex-direction: column; gap: 6px; background: var(--gray-soft); border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.qk-si { display: inline-block; width: 26px; }
.qk-chart { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.qk-box { display: flex; flex-direction: column; align-items: center; background: #deebf7; color: #1f3864; border-radius: 8px; padding: 6px 16px; min-width: 130px; }
.qk-box.boss { background: #c00000; color: #fff; }
.qk-box small { font-size: 11px; opacity: .85; }
.qk-cols { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.qk-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qk-col > .qk-box { background: #2e75b6; color: #fff; }
.qk-grp { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; min-width: 130px; }
.qk-grp small { display: block; color: var(--muted); font-size: 11px; }
.qk-go { display: flex; gap: 14px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.qk-done { max-width: 1000px; }
.qk-done-h { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.qk-done-h .qk-big { font-size: 54px; }
.qk-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 8px 12px; margin: 10px 0; font-size: 13px; }
.qk-pw { font-size: 14px; font-weight: 700; background: #fef9c3; padding: 1px 6px; border-radius: 4px; }
.qk-next { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.qk-nx { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; color: inherit; text-decoration: none; }
a.qk-nx:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(16,24,40,.08); }
.qk-nx-i { font-size: 26px; }
.qk-banner { display: flex; gap: 16px; align-items: center; background: linear-gradient(135deg, #eef4ff, #f5f0ff); border: 1.5px solid #c7d7fe; border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; color: inherit; text-decoration: none; }
.qk-banner:hover { box-shadow: 0 6px 18px rgba(37,99,235,.15); }
.qk-banner > div { flex: 1; } .qk-banner b { font-size: 16px; display: block; margin-bottom: 3px; }
.qk-links { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; font-size: 13.5px; }
.qk-gh { margin: 16px 0 8px; }
.qk-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.qk-tcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.qk-tcard.me { border-color: var(--primary); }
.qk-tc-h { display: flex; gap: 10px; align-items: center; }
.qk-tc-n { flex: 1; min-width: 0; } .qk-tc-n b { font-size: 14.5px; }
.qk-tc-b { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qk-tc-a { display: flex; gap: 6px; }
@media (max-width: 900px) {
  .qk-srow, .qk-prow, .qk-product .qk-prow { grid-template-columns: 34px 1fr; }
  .qk-pextra { margin-right: 0; }
  .qk-card .card-b { padding: 14px; }
}

/* ---------------------------------------------------------------- ترمینال: ثبت تعدادی */
.tq { display: flex; flex-direction: column; gap: 10px; }
.tq-item { font-size: 16px; }
.tq-l { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; color: var(--muted); }
.tq-row { display: flex; gap: 8px; align-items: center; }
.tq-n { width: 140px; height: 70px; font-size: 38px; font-weight: 800; text-align: center; border: 2px solid var(--primary); border-radius: 14px; font-family: inherit; }
.tq-b { width: 70px; height: 70px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel); font-size: 34px; font-weight: 800; cursor: pointer; }
.tq-b:active { background: var(--primary-soft); }
.tq-quick { display: flex; gap: 6px; }
.tq-scrap summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.tq-prog { padding: 6px 8px; border-radius: 8px; margin-bottom: 4px; }
.tq-prog.mine { background: var(--primary-soft); }
.tq-prog .r { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }

/* ---------------------------------------------------------------- نقشهٔ شماتیک: برچسب‌ها، کارت شناور، نور افکن */
.lay-labels { pointer-events: none; }
.lay-lbl { paint-order: stroke; stroke: #fcfdff; stroke-width: 4px; stroke-linejoin: round; fill: #1e293b; }
.lay-lbl.zone { fill: #64748b; }
.lay-lbl.line { fill: #1e40af; }
.lay-lbl.line-stat { fill: #15803d; }
.lay-ini { font-family: Vazirmatn, Tahoma, sans-serif; pointer-events: none; }
.lay-pill.made rect { fill: #16a34a; stroke: #fff; stroke-width: 1.5; } .lay-pill.made text { fill: #fff; }
.lay-el.t-station > g > rect, .lay-el.t-machine > g > rect, .lay-el.t-storage > g > rect, .lay-el.t-cashier > g > rect { filter: url(#lay-shadow); }
.lay-svg.lay-spot .lay-el:not(.lay-hov):not(.lay-rel):not(.t-zone):not(.t-line):not(.t-image):not(.t-wall) { opacity: .28; transition: opacity .15s; }
.lay-svg.lay-spot .lay-labels { opacity: .55; }
.lay-el.lay-hov > g > rect, .lay-el.lay-hov > g > circle { stroke-width: 3.5; }
.lay-el.lay-rel .lay-flow { opacity: 1 !important; }
.lay-el.lay-bump > g > rect, .lay-el.lay-bump > g > circle { animation: layBump 1.6s ease-out 2; }
@keyframes layBump { 0% { filter: drop-shadow(0 0 0 rgba(22,163,74,0)); } 30% { filter: drop-shadow(0 0 8px rgba(22,163,74,.9)); } 100% { filter: drop-shadow(0 0 0 rgba(22,163,74,0)); } }
.lay-scroll.view { cursor: grab; } .lay-scroll.view.panning { cursor: grabbing; user-select: none; }
.lay-tip { font-size: 11.5px; margin-top: 6px; }
.lay-daybar { display: flex; align-items: center; gap: 4px; }
.lay-day-l { font-size: 13px; min-width: 150px; text-align: center; }
.lay-layers .sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.lay-hover { position: fixed; z-index: 9999; width: 300px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 12px 32px rgba(15,23,42,.18); padding: 12px 14px; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; direction: rtl; font-size: 12.5px; color: #0f172a; }
.lay-hover.on { opacity: 1; transform: none; }
.lh-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.lh-t { flex: 1; min-width: 0; } .lh-t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .lh-t small { color: #64748b; font-size: 11px; }
.lh-icon { font-size: 22px; width: 38px; height: 38px; border-radius: 10px; background: #f1f5f9; display: inline-flex; align-items: center; justify-content: center; }
.lh-av { width: 40px; height: 40px; border-radius: 50%; background: #f1f5f9; border: 2px solid #94a3b8; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #334155; }
.lh-av.on { background: #dcfce7; border-color: #16a34a; color: #14532d; }
.lh-state { color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.lh-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 6px; margin-bottom: 8px; }
.lh-tile { background: #f8fafc; border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; }
.lh-tile b { font-size: 15px; } .lh-tile small { color: #64748b; font-size: 10.5px; }
.lh-tile.big b { font-size: 20px; } .lh-tile.ok b { color: #15803d; } .lh-tile.warn b { color: #c2410c; } .lh-tile.bad b { color: #dc2626; }
.lh-sub { font-size: 11.5px; color: #64748b; font-weight: 700; margin: 8px 0 4px; }
.lh-bars { display: flex; flex-direction: column; gap: 4px; }
.lh-bar { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr auto; gap: 6px; align-items: center; font-size: 12px; }
.lh-bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-bt { background: #f1f5f9; height: 7px; border-radius: 4px; overflow: hidden; } .lh-bt i { display: block; height: 100%; background: #2563eb; border-radius: 4px; }
.lh-kv { display: flex; flex-wrap: wrap; gap: 4px 12px; color: #475569; font-size: 11.5px; margin-top: 6px; }
.lh-alert { background: #fef2f2; color: #b91c1c; border-radius: 8px; padding: 5px 8px; margin: 4px 0; font-weight: 600; }
.lh-empty { color: #64748b; background: #f8fafc; border-radius: 8px; padding: 8px; }
.lh-flow { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-weight: 600; } .lh-flow i { color: #64748b; font-style: normal; }
.lh-spark { margin-top: 6px; } .lay-spark { width: 100%; height: 64px; display: block; }
.lh-foot { color: #94a3b8; font-size: 10.5px; margin-top: 8px; text-align: center; }
.lay-side-card .lh-tiles { grid-template-columns: repeat(2, 1fr); }
.lay-more { margin-top: 10px; } .lay-more summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.stats.lay-kpis { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; }
.stats.lay-kpis .stat { padding: 9px 12px; min-height: 0; }
.stats.lay-kpis .stat .v { font-size: 21px; }

/* ---------------------------------------------------------------- نمودار حرفه‌ای و کارت روند */
.pchart { width: 100%; }
.pc-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.pc-lg { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 12px; color: #334155; cursor: pointer; }
.pc-lg.off { opacity: .45; text-decoration: line-through; }
.pc-lg.static { cursor: default; border-style: dashed; color: var(--muted); }
.pc-lg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.pc-lg i.ln { height: 3px; border-radius: 2px; }
.pc-lg i.avg { width: 16px; height: 0; border-top: 2px dashed #475569; border-radius: 0; background: none !important; }
.pc-area { position: relative; width: 100%; }
.pc-svg { display: block; font-family: Vazirmatn, Tahoma, sans-serif; direction: ltr; }
.pc-svg text { font-family: Vazirmatn, Tahoma, sans-serif; }
.pc-bar { transition: opacity .15s; }
.pc-empty { color: var(--muted); text-align: center; padding: 60px 0; }
.pc-tip { position: absolute; z-index: 5; min-width: 170px; background: #0f172a; color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 12px; pointer-events: none; opacity: 0; transition: opacity .1s; box-shadow: 0 8px 24px rgba(15,23,42,.25); direction: rtl; }
.pc-tip.on { opacity: 1; }
.pc-t { display: block; margin-bottom: 5px; font-size: 12.5px; }
.pc-r { display: grid; grid-template-columns: 10px 1fr auto; gap: 6px; align-items: center; padding: 1px 0; }
.pc-r i { width: 9px; height: 9px; border-radius: 3px; }
.pc-rx { display: grid; grid-template-columns: 1fr auto; gap: 6px; color: #cbd5e1; padding: 1px 0; font-size: 12px; }
.pc-z { color: #cbd5e1; margin-top: 3px; }
.pc-card .card-h h3 { white-space: nowrap; }
.pc-seg { display: inline-flex; background: var(--gray-soft); border-radius: 10px; padding: 3px; margin-inline-start: 12px; }
.pc-segb { border: 0; background: none; font: inherit; font-size: 12.5px; padding: 4px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.pc-segb.on { background: var(--panel); color: var(--primary); font-weight: 700; box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.pc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pc-tile { background: var(--gray-soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pc-tile small { color: var(--muted); font-size: 11.5px; }
.pc-tile b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-tile.main { background: var(--primary-soft); } .pc-tile.main b { color: var(--primary); font-size: 19px; }
.pc-sub { font-size: 11.5px; color: var(--muted); }
.pc-trend { font-weight: 700; font-size: 12px; } .pc-trend small { font-weight: 400; color: var(--muted); }
.pc-trend.up { color: #15803d; } .pc-trend.down { color: #dc2626; }
.pc-card:fullscreen { background: var(--bg, #f4f6fa); padding: 24px; overflow: auto; border-radius: 0; }

/* ---------------------------------------------------------------- نقشه: بخش‌ها، کی کجاست، تمام‌صفحه */
.lay-secbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.lay-secb { border: 1.5px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.lay-secb:hover { border-color: var(--primary); color: var(--primary); }
.lay-secb.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.btn.on { background: var(--primary-soft); color: var(--primary); }
.lay-links { pointer-events: none; }
.lay-link { fill: none; stroke: #94a3b8; stroke-width: 1.4; stroke-dasharray: 3 3; opacity: .75; }
.lay-link.now { stroke: #16a34a; stroke-width: 1.8; stroke-dasharray: 5 3; animation: layDash 1.4s linear infinite; opacity: .9; }
.lay-link-dot { fill: #94a3b8; } .lay-link-dot.now { fill: #16a34a; }
.lay-svg.lay-spot .lay-links { opacity: .25; }
.lay-svg.lay-sec { background: #fff; }
.lh-where { background: #f8fafc; border-radius: 8px; padding: 6px 8px; margin: 2px 0 6px; font-size: 12px; }
.lh-where.now { background: #f0fdf4; color: #14532d; }
.lh-mach { color: #64748b; font-size: 11.5px; margin-top: 2px; }
.lh-people { display: flex; flex-wrap: wrap; gap: 4px; }
.lh-chip { border: 1px solid #e2e8f0; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; background: #fff; display: inline-flex; align-items: center; gap: 5px; }
.lh-chip.now { border-color: #86efac; background: #f0fdf4; }
.lh-chip.click { cursor: pointer; } .lh-chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.lay-fs-head { display: none; }
.lay-full.fs { background: var(--bg, #f4f6fa); padding: 14px 18px; overflow: auto; }
.lay-full.fs .lay-fs-head { display: flex; align-items: center; gap: 8px; font-size: 18px; margin-bottom: 8px; }
.lay-full.fs .lay-fs-clock { font-size: 16px; font-weight: 700; }
.lay-full.fs .lay-scroll.view { max-height: none; }
.lay-full.fs .lay-view { grid-template-columns: 1fr 320px; }
.lay-full.fs .lay-tip { display: none; }
#content:fullscreen, .content:fullscreen { background: var(--bg, #f4f6fa); overflow: auto; padding: 18px 22px; }

/* ---------------------------------------------------------------- همگام‌سازی سکان / امید */
.as-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.as-step { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.as-step > b { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 14px; }
.as-step strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.as-step small { color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.as-sources { display: grid; gap: 14px; }
.as-empty { text-align: center; padding: 30px 20px; }
.as-empty-i { font-size: 44px; }
.as-empty p { max-width: 560px; margin: 8px auto 16px; line-height: 1.9; }
.as-src { padding: 16px 18px; border-top: 4px solid var(--primary); }
.as-src.sk { border-top-color: #2563eb; } .as-src.om { border-top-color: #059669; }
.as-src-h { display: flex; align-items: center; gap: 12px; }
.as-src-h h3 { margin: 0 0 2px; font-size: 16px; }
.as-logo { flex: 0 0 auto; min-width: 54px; height: 54px; padding: 0 8px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, #64748b, #334155); box-shadow: 0 4px 12px rgba(15,23,42,.18); }
.as-logo.sk { background: linear-gradient(135deg, #3b82f6, #1e40af); }
.as-logo.om { background: linear-gradient(135deg, #10b981, #047857); }
.as-src-meta { display: flex; gap: 26px; flex-wrap: wrap; margin: 14px 0 6px; }
.as-src-meta > div { display: flex; flex-direction: column; gap: 2px; }
.as-src-meta b { font-size: 13.5px; }
.as-summary { background: var(--gray-soft); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: #334155; line-height: 1.9; margin-top: 8px; }
.as-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.as-prog { margin-top: 12px; }
.as-prog-bar { height: 10px; background: var(--gray-soft); border-radius: 999px; overflow: hidden; }
.as-prog-bar i { display: block; height: 100%; width: 4%; border-radius: 999px; background: linear-gradient(90deg, #3b82f6, #06b6d4); background-size: 200% 100%; animation: as-flow 1.4s linear infinite; transition: width .5s ease; }
@keyframes as-flow { from { background-position: 0 0; } to { background-position: -200% 0; } }
.as-prog-t { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.as-report { margin-top: 14px; }
.as-rep-h { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.as-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.as-tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel); }
.as-tile.ch { border-color: #bfdbfe; background: linear-gradient(180deg, #f8fbff, #fff); }
.as-tile small { color: var(--muted); font-size: 11.5px; display: block; }
.as-tile > b { font-size: 20px; display: block; margin: 2px 0 4px; }
.as-tile-d { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11.5px; }
.as-tile-d .n { color: #15803d; } .as-tile-d .u { color: #b45309; } .as-tile-d .d { color: #b91c1c; }
.as-checks { margin-top: 12px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.as-checks-h { padding: 9px 12px; font-weight: 600; font-size: 13.5px; }
.as-checks.ok .as-checks-h { background: var(--ok-soft); color: #166534; }
.as-checks.bad .as-checks-h { background: var(--warn-soft); color: #92400e; }
.as-checks table { margin: 0; }
.as-ok { color: var(--ok); font-weight: 700; } .as-bad { color: var(--danger); font-weight: 700; }
.as-warns { margin-top: 10px; font-size: 12.5px; }
.as-warns summary { cursor: pointer; color: #92400e; }
.as-warns ul { margin: 6px 0 0; padding-inline-start: 20px; line-height: 1.9; color: #475569; }
.as-cands { display: grid; gap: 10px; }
.as-cand { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; transition: box-shadow .15s, border-color .15s; }
.as-cand:hover { border-color: #bfdbfe; box-shadow: 0 4px 14px rgba(37,99,235,.08); }
.as-cand-b { flex: 1; min-width: 0; }
.as-cand-b > b { font-size: 14.5px; }
.as-cand-n { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #475569; margin-top: 4px; }
.as-adv { margin-top: 14px; font-size: 13px; }
.as-adv summary { cursor: pointer; color: var(--muted); }
.as-adv-f { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 8px; align-items: end; margin-top: 8px; }
.as-scopes { display: flex; flex-wrap: wrap; gap: 6px; }
.as-scope { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; color: #475569; }
.as-scope.on { background: var(--primary-soft); border-color: #93c5fd; color: var(--primary); font-weight: 600; }
@media (max-width: 900px) { .as-flow { grid-template-columns: 1fr 1fr; } .as-adv-f { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .as-flow { grid-template-columns: 1fr; } .as-src-meta { gap: 14px; } }
.as-links { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.as-link { font-size: 12.5px; padding: 4px 11px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.as-link:hover { background: #dbe6ff; }

/* نقشه: عمق و جزئیات شکل‌ها */
.lay-el.t-office > g > rect, .lay-el.t-line > g > rect:first-child, .lay-el.t-forklift > g > rect, .lay-el.t-pallet > g > rect { filter: url(#lay-shadow); }
.lay-el.t-tank .lay-3d { filter: url(#lay-shadow); }
.lay-rail.run { animation: layDash 1.2s linear infinite; }
.lay-accent { pointer-events: none; }
.lay-el.s-down .lay-accent { animation: layBlink 1s infinite; }
.lay-flow-case { pointer-events: none; }
.lay-lbl.zone { fill: #334155; letter-spacing: -.2px; }
.lay-el.t-person > g > circle { filter: url(#lay-shadow); }

/* اکانت مادر: روشن/خاموش کردن ماژول‌ها روی کارت هر سازمان */
.mod-tg { direction: rtl; border: 1px dashed #cbd5e1; background: #fff; color: #94a3b8; cursor: pointer; font: inherit; font-size: 12px; padding: 2px 9px; border-radius: 999px; transition: all .12s; }
.mod-tg.on { border-style: solid; border-color: #93c5fd; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.mod-tg:hover { border-color: var(--primary); color: var(--primary); }

/* ---------------------------------------------------------------- سطح دسترسی افراد */
.ac-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.ac-pcard { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ac-pcard.off { opacity: .6; } .ac-pcard.me { border-color: #bfdbfe; }
.ac-ph { display: flex; align-items: center; gap: 10px; }
.ac-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff; background: linear-gradient(135deg, #60a5fa, #1d4ed8); flex: 0 0 auto; }
.ac-pn b { font-size: 14.5px; }
.ac-ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--p) * 1%), #e5e7eb 0); flex: 0 0 auto; }
.ac-ring span { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #334155; }
.ac-roles, .ac-sum { display: flex; flex-wrap: wrap; gap: 5px; }
.ac-role { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; }
.ac-role.admin { background: #fef3c7; color: #92400e; font-weight: 700; }
.ac-role.custom { background: #f0fdf4; color: #166534; }
.ac-chip { font-size: 11.5px; padding: 1px 8px; border-radius: 6px; background: var(--gray-soft); color: #475569; }
.ac-chip.full { background: #dcfce7; color: #166534; } .ac-chip.view { background: #e0f2fe; color: #075985; } .ac-chip.some { background: #fef3c7; color: #92400e; }
.ac-pa { display: flex; align-items: center; gap: 6px; border-top: 1px dashed var(--line); padding-top: 9px; margin-top: auto; }
.ac-rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ac-rcard { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ac-rcard.admin { border-top: 3px solid #f59e0b; }
.ac-rh { display: flex; align-items: center; gap: 6px; }
.ac-editor h4 { margin: 16px 0 4px; }
.ac-ed-top { display: flex; align-items: center; gap: 10px; background: var(--gray-soft); border-radius: 10px; padding: 8px 12px; }
.ac-login { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.ac-rolepick { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-rp { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; cursor: pointer; font-size: 13px; background: #fff; }
.ac-rp.on { border-color: #93c5fd; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.ac-rp.admin.on { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.ac-rp small { font-weight: 400; }
.ac-total { font-weight: 600; font-size: 13px; color: #334155; margin: 6px 0 8px; }
.ac-note { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; line-height: 1.9; margin-bottom: 8px; }
.ac-matrix { display: flex; flex-direction: column; gap: 6px; }
.ac-area { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.ac-area.lv-full { border-color: #bbf7d0; } .ac-area.lv-view { border-color: #bae6fd; } .ac-area.lv-some { border-color: #fde68a; }
.ac-area.off { opacity: .6; }
.ac-area-h { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.ac-area-h:hover { background: #f8fafc; }
.ac-ic { font-size: 18px; width: 26px; text-align: center; }
.ac-t { display: flex; flex-direction: column; } .ac-t b { font-size: 13.5px; } .ac-t small { font-size: 11px; }
.ac-caret { color: var(--muted); width: 14px; }
.ac-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.ac-seg button { border: 0; background: #fff; font: inherit; font-size: 12px; padding: 4px 11px; cursor: pointer; color: #475569; }
.ac-seg button + button { border-right: 1px solid var(--line); }
.ac-seg button.on { background: var(--primary); color: #fff; font-weight: 600; }
.ac-area.lv-none .ac-seg button.on { background: #64748b; }
.ac-area.lv-view .ac-seg button.on { background: #0284c7; }
.ac-area.lv-full .ac-seg button.on { background: #16a34a; }
.ac-seg button:disabled { opacity: .35; cursor: not-allowed; }
.ac-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 12px; padding: 6px 14px 12px 14px; border-top: 1px dashed var(--line); background: #fbfcfe; }
.ac-perm { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 0; cursor: pointer; flex-wrap: wrap; }
.ac-perm.on span { font-weight: 600; }
.ac-v { color: #0284c7; font-weight: 400; }
.ac-src { flex-basis: 100%; padding-right: 22px; font-size: 11px; }
.ac-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .ac-2col { grid-template-columns: 1fr; } .ac-area-h { flex-wrap: wrap; } }

/* فرایندهای منعطف */
.pd-node.step.multi { width: 290px; }
.pd-aps { display: flex; flex-direction: column; gap: 6px; }
.pd-ap { border: 1px dashed #c7d2fe; border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; background: #fafbff; }
.pd-ap-h { display: flex; align-items: center; }
.pd-fb span { font-size: 11px; }
.pd-mode { font-weight: 600; }
.pd-self { font-size: 12px; line-height: 1.7; }
.pd-actions { flex-wrap: wrap; gap: 6px; }
.pd-verbox { display: inline-flex; gap: 4px; align-items: center; }
.pd-ver { padding: 4px 6px; font-size: 12px; width: auto; }
.pd-sim { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pd-sim-sum { font-weight: 700; color: #166534; background: var(--ok-soft); border-radius: 10px; padding: 8px 12px; }
.pd-sim-sum.none { color: #92400e; background: var(--warn-soft); }
.pd-sim-s { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; }
.pd-sim-s.on { border-color: #bbf7d0; } .pd-sim-s.off { opacity: .6; }
.pd-dlg-list { display: flex; flex-direction: column; gap: 6px; }
.pd-dlg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.pd-dlg.now { border-color: #bbf7d0; background: #f7fef9; }
.mod-chips .mod-tg { text-decoration: none; opacity: 1; }

/* ---------------------------------------------------------------- ساختار سازمانی (روش SAP) */
.qk-cards.three { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.en-health { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; margin-bottom: 12px; }
.en-stat { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.en-stat b { font-size: 18px; } .en-stat small { color: var(--muted); }
.en-health-st { margin-right: auto; border: 0; border-radius: 12px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.en-health-st.ok { background: var(--ok-soft); color: #166534; } .en-health-st.warn { background: var(--warn-soft); color: #92400e; } .en-health-st.bad { background: var(--danger-soft); color: #991b1b; }
.en-tc { font-family: Consolas, monospace; font-size: 11px; background: #eef2ff; color: #4338ca; border-radius: 6px; padding: 1px 6px; direction: ltr; display: inline-block; font-weight: 600; }
.en-empty { color: var(--muted); padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.en-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.en-chip { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--gray-soft); color: #334155; white-space: nowrap; }
.en-chip.ca { background: #f5f3ff; color: #6d28d9; } .en-chip.sl { background: #fff7ed; color: #9a3412; } .en-chip.sp { background: #ecfeff; color: #0e7490; }
.en-chip.ch { background: #eff6ff; color: #1d4ed8; } .en-chip.pl { background: #f0fdf4; color: #166534; } .en-chip.bad { background: var(--danger-soft); color: #991b1b; } .en-chip.off { opacity: .5; }
.en-badge { min-width: 44px; height: 30px; padding: 0 8px; border-radius: 8px; display: grid; place-items: center; font-family: Consolas, monospace; font-weight: 800; color: #fff; background: #475569; direction: ltr; flex: 0 0 auto; }
.en-badge.co { background: linear-gradient(135deg, #1e40af, #3b82f6); height: 36px; min-width: 56px; font-size: 15px; }
.en-badge.pl { background: linear-gradient(135deg, #15803d, #22c55e); } .en-badge.so { background: linear-gradient(135deg, #1d4ed8, #60a5fa); } .en-badge.po { background: linear-gradient(135deg, #b45309, #f59e0b); }
.en-star { font-size: 16px; }
.en-tree { display: flex; flex-direction: column; gap: 16px; }
.en-co { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid #2563eb; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.en-co.central { border-top-color: #f59e0b; } .en-co.bad { border-top-color: var(--danger); } .en-co.off { opacity: .6; }
.en-co-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.en-co-t { display: flex; flex-direction: column; } .en-co-t b { font-size: 16px; }
.en-lvl { margin-top: 12px; padding-right: 18px; border-right: 2px solid #dbeafe; }
.en-lvl-t { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.en-plants, .en-orgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.en-pl, .en-org, .en-ipc { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: linear-gradient(180deg, #fff, #fbfdff); display: flex; flex-direction: column; gap: 8px; }
.en-pl.primary, .en-ipc.primary { border-color: #fcd34d; box-shadow: 0 0 0 3px #fef3c7; } .en-pl.off { opacity: .55; }
.en-pl-h { display: flex; align-items: center; gap: 8px; } .en-pl-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.en-pl-m { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #475569; } .en-pl-m .bad { color: var(--danger); }
.en-sub { display: flex; flex-direction: column; gap: 3px; }
.en-org-h { display: flex; align-items: center; gap: 8px; } .en-org-r { display: flex; flex-direction: column; gap: 3px; padding: 4px 0; border-top: 1px dashed var(--line); }
.en-img { display: grid; grid-template-columns: 290px 1fr; gap: 14px; align-items: start; }
.en-nav { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; position: sticky; top: 70px; }
.en-nav-g { font-size: 12px; font-weight: 800; color: var(--muted); padding: 8px 8px 4px; }
.en-nav-i { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; font: inherit; font-size: 13px; text-align: right; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: #1f2937; }
.en-nav-i:hover { background: var(--gray-soft); } .en-nav-i.on { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.en-nav-i > span:first-child { flex: 1; }
.en-nav-n { font-size: 11px; color: var(--muted); min-width: 18px; text-align: center; }
.en-nav-e { background: var(--danger); color: #fff; border-radius: 999px; width: 16px; height: 16px; font-size: 11px; display: grid; place-items: center; }
.en-pane { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.en-pane-h { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; } .en-pane-h h3 { margin: 0 0 4px; } .en-pane-h p { margin: 0; }
.en-mx th.c, .en-mx td.c { text-align: center; } .en-mx td.en-mx-bad { background: var(--danger-soft); }
.en-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.en-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; } .en-f > span { font-weight: 600; color: #334155; } .en-f small { font-size: 11px; line-height: 1.6; }
.en-f.dim { opacity: .45; }
.en-ck { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; background: #fff; }
.en-ck.error { border-color: #fecaca; background: #fff7f7; } .en-ck.warn { border-color: #fde68a; background: #fffdf5; } .en-ck.ok { border-color: #bbf7d0; background: #f7fef9; }
.en-ck.big { font-weight: 700; font-size: 14px; padding: 12px 16px; }
.en-ck-i { font-weight: 800; } .en-ck.error .en-ck-i { color: var(--danger); } .en-ck.warn .en-ck-i { color: var(--warn); }
.en-ck-t { font-size: 13px; line-height: 1.8; }
.en-ip-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.en-ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.en-ipc:not(.on) { border-style: dashed; background: #fafbfc; }
.en-ipc-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; } .en-ipc-kv > div { display: flex; flex-direction: column; } .en-ipc-kv small { font-size: 11px; }
.en-ipc-a { display: flex; align-items: center; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.en-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.en-step { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 14px 6px 8px; font: inherit; cursor: pointer; color: #475569; }
.en-step b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-soft); font-size: 12px; }
.en-step.on { border-color: var(--primary); color: var(--primary); font-weight: 700; } .en-step.on b { background: var(--primary); color: #fff; }
.en-step.done b { background: var(--ok); color: #fff; }
.en-wz { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.en-wz-h { margin: 16px 0 8px; } .en-wz-h:first-child { margin-top: 0; } .en-wz-h h3 { margin: 0 0 4px; } .en-wz-h p { margin: 0; }
.en-wz-plant { border: 1px solid var(--line); border-right: 4px solid #22c55e; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #fcfffd; }
.en-wz-plant h4 { margin: 12px 0 6px; }
.en-wz-plant-h { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.en-cal { display: grid; grid-template-columns: 110px 110px 130px 1fr; gap: 10px; margin-top: 10px; } .en-cal.hidden { display: none; }
.en-days { display: flex; gap: 4px; } .en-day { border: 1px solid var(--line); border-radius: 8px; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; font-size: 13px; }
.en-day input { display: none; } .en-day.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.en-slocs { display: flex; flex-direction: column; gap: 6px; }
.en-sl-row { display: grid; grid-template-columns: 110px 1fr 180px auto; gap: 6px; } .en-sl-row.two { grid-template-columns: 130px 1fr auto; }
.en-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .en-presets .chip-btn { flex-direction: row; min-width: 0; padding: 4px 10px; font-weight: 500; font-size: 12.5px; }
.en-wz-nav { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.en-review { background: #f8fafc; border-radius: 12px; padding: 12px; }
.en-rv { padding: 6px 10px; } .en-rv.co { font-weight: 700; color: #6d28d9; } .en-rv.co2 { color: #1e40af; border-right: 2px solid #c7d2fe; margin-right: 8px; }
.en-rv.pl { color: #166534; font-weight: 500; border-right: 2px solid #bbf7d0; margin: 4px 10px 4px 0; } .en-rv.so { color: #1d4ed8; font-weight: 500; } .en-rv.po { color: #b45309; font-weight: 500; }
.en-result { margin-top: 14px; }
@media (max-width: 900px) { .en-img { grid-template-columns: 1fr; } .en-nav { position: static; } .en-cal { grid-template-columns: 1fr 1fr; } .en-sl-row { grid-template-columns: 1fr 1fr; } }
.en-nav-e.warn { background: var(--warn); }

/* ---------------------------------------------------------------- داشبورد به سبک SAP Fiori (پوستهٔ Horizon) */
.fl-page { --fl-bg: #f5f6f7; --fl-text: #1d2d3e; --fl-sub: #556b82; --fl-brand: #0070f2; --fl-good: #256f3a; --fl-crit: #e76500; --fl-err: #aa0808;
  --fl-shadow: 0 0 .125rem 0 rgba(34,53,72,.15), 0 .125rem .5rem 0 rgba(34,53,72,.15); --fl-shadow-h: 0 0 .125rem 0 rgba(34,53,72,.15), 0 .5rem 1rem 0 rgba(34,53,72,.2);
  margin: -22px -22px 0; padding: 0 22px 32px; background: var(--fl-bg); min-height: calc(100vh - 60px); color: var(--fl-text); }
.fl-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 26px 0 18px; }
.fl-hero h1 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.3px; background: linear-gradient(90deg, #0a3b7a, #0070f2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fl-ctx { display: flex; gap: 14px; flex-wrap: wrap; color: var(--fl-sub); font-size: 13px; }
.fl-hero-a { display: flex; gap: 8px; flex-wrap: wrap; }
.fl-btn { border: 1px solid #bcc3ca; background: #fff; color: var(--fl-brand); border-radius: 8px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.fl-btn:hover { background: #eaf4ff; border-color: var(--fl-brand); } .fl-btn.ghost { border-color: transparent; background: none; color: var(--fl-sub); font-weight: 500; }
.fl-spaces { display: flex; gap: 2px; border-bottom: 1px solid #d9dde2; margin-bottom: 18px; overflow-x: auto; }
.fl-space { border: 0; background: none; font: inherit; font-size: 14px; color: var(--fl-sub); padding: 10px 16px 12px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; }
.fl-space:hover { color: var(--fl-text); } .fl-space.on { color: var(--fl-brand); border-bottom-color: var(--fl-brand); }
.fl-sec { margin-bottom: 26px; }
.fl-sec-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.fl-sec-h h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--fl-text); }
.fl-sec.closed .fl-sec-b { display: none; } .fl-sec.closed .fl-ghost { transform: rotate(180deg); }
.fl-ghost { border: 0; background: none; color: var(--fl-sub); font-size: 16px; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; transition: transform .15s; }
.fl-ghost:hover { background: #e5e9ee; }
.fl-count { background: #e5e9ee; color: var(--fl-text); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 9px; }
.fl-count.sm { margin-right: 6px; font-size: 11px; padding: 0 7px; }
.fl-tabs { display: inline-flex; gap: 4px; background: #e5e9ee; border-radius: 10px; padding: 3px; }
.fl-tab { border: 0; background: none; font: inherit; font-size: 13px; color: var(--fl-sub); padding: 5px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.fl-tab.on { background: #fff; color: var(--fl-brand); box-shadow: 0 1px 2px rgba(34,53,72,.15); }
.fl-search { width: 100%; max-width: 420px; border: 1px solid #bcc3ca; border-radius: 10px; padding: 9px 14px; font: inherit; margin-bottom: 12px; background: #fff; }
.fl-search:focus { outline: 2px solid var(--fl-brand); outline-offset: 1px; } .fl-search.hidden { display: none; }
.fl-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.fl-tile { width: 176px; height: 176px; box-sizing: border-box; background: #fff; border-radius: 16px; box-shadow: var(--fl-shadow); padding: 14px 16px; display: flex; flex-direction: column;
  text-decoration: none; color: var(--fl-text); position: relative; transition: box-shadow .15s, transform .15s; overflow: hidden; }
.fl-tile:hover { box-shadow: var(--fl-shadow-h); transform: translateY(-2px); }
.fl-tile.wide { width: 364px; }
.fl-t-head { display: flex; flex-direction: column; gap: 3px; }
.fl-t-head b { font-size: 14px; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fl-t-head small { font-size: 12.5px; color: var(--fl-sub); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.fl-t-ic { margin-top: auto; font-size: 30px; line-height: 1; }
.fl-tile.app .fl-t-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #eaf4ff; font-size: 24px; }
.fl-t-kpi { margin-top: auto; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.fl-num { font-size: 34px; font-weight: 300; letter-spacing: -1px; line-height: 1; color: var(--fl-text); }
.fl-tile.good .fl-num { color: var(--fl-good); } .fl-tile.critical .fl-num { color: var(--fl-crit); } .fl-tile.error .fl-num { color: var(--fl-err); }
.fl-tile.good::after, .fl-tile.critical::after, .fl-tile.error::after { content: ''; position: absolute; top: 0; right: 0; left: 0; height: 4px; }
.fl-tile.good::after { background: var(--fl-good); } .fl-tile.critical::after { background: var(--fl-crit); } .fl-tile.error::after { background: var(--fl-err); }
.fl-unit { font-size: 12.5px; color: var(--fl-sub); font-weight: 600; }
.fl-trend { font-size: 13px; } .fl-trend.up { color: var(--fl-good); } .fl-trend.down { color: var(--fl-err); }
.fl-t-foot { font-size: 12px; color: var(--fl-sub); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-spark { width: 100%; height: 34px; margin-top: 6px; }
.fl-spark .a { fill: rgba(0,112,242,.10); } .fl-spark .l { fill: none; stroke: var(--fl-brand); stroke-width: 1.8; stroke-linejoin: round; } .fl-spark .d { fill: var(--fl-brand); }
.fl-spark.good .l { stroke: var(--fl-good); } .fl-spark.good .a { fill: rgba(37,111,58,.1); }
.fl-tile.wide .fl-t-kpi { margin-top: 10px; }
.fl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.fl-card { background: #fff; border-radius: 16px; box-shadow: var(--fl-shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--fl-text); min-width: 0; }
a.fl-card:hover { box-shadow: var(--fl-shadow-h); }
.fl-card-h { display: flex; align-items: center; gap: 8px; } .fl-card-h b { font-size: 14.5px; } .fl-card-h small { color: var(--fl-sub); }
.fl-card-t { font-size: 13.5px; line-height: 1.8; }
.fl-card-f { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid #eef0f3; color: var(--fl-brand); font-size: 13px; font-weight: 600; }
.fl-card.task { border-right: 4px solid var(--fl-brand); } .fl-card.task.late { border-right-color: var(--fl-err); }
.fl-card.sit { border-right: 4px solid #8396a8; } .fl-card.sit.error { border-right-color: var(--fl-err); } .fl-card.sit.critical { border-right-color: var(--fl-crit); }
.fl-sit-ic { font-size: 16px; }
.fl-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--fl-sub); } .fl-facts b { color: var(--fl-text); }
.fl-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 6px; } .fl-tag.error { background: #ffeaf4; color: var(--fl-err); }
.fl-act { border: 1px solid; background: #fff; border-radius: 8px; padding: 4px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.fl-act.ok { color: var(--fl-good); border-color: #9fd1ae; } .fl-act.ok:hover { background: #f1fbf4; }
.fl-act.no { color: var(--fl-err); border-color: #f1b3b3; } .fl-act.no:hover { background: #fff5f5; }
.fl-link { color: var(--fl-brand); text-decoration: none; background: none; border: 0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fl-cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.fl-card.wide { grid-column: 1 / -1; } .fl-card.exec { background: linear-gradient(135deg, #0a3b7a, #0070f2); color: #fff; } .fl-card.exec .fl-card-f { color: #fff; border-top-color: rgba(255,255,255,.25); }
.fl-list { display: flex; flex-direction: column; }
.fl-li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid #eef0f3; text-decoration: none; color: var(--fl-text); }
.fl-li:last-child { border-bottom: 0; } .fl-li:hover { background: #f7f9fb; }
.fl-li > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; } .fl-li b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .fl-li small { font-size: 11.5px; }
.fl-li-v { font-size: 12.5px; white-space: nowrap; }
.fl-prog { display: inline-flex; align-items: center; gap: 6px; } .fl-prog i { display: inline-block; height: 6px; width: 70px; border-radius: 3px; background: #e5e9ee; overflow: hidden; } .fl-prog em { display: block; height: 100%; background: var(--fl-brand); border-radius: 3px; }
.fl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fl-brand); display: inline-block; }
.fl-empty { color: var(--fl-sub); padding: 18px; background: #fff; border-radius: 16px; box-shadow: var(--fl-shadow); text-align: center; flex: 1; }
.fl-empty.ok { color: var(--fl-good); font-weight: 600; }
.fl-more { display: inline-block; margin-top: 10px; color: var(--fl-brand); font-weight: 600; text-decoration: none; }
.fl-space-h { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; } .fl-space-h h2 { margin: 0; font-size: 22px; }
.fl-space-ic { width: 52px; height: 52px; border-radius: 14px; background: #fff; box-shadow: var(--fl-shadow); display: grid; place-items: center; font-size: 26px; }
@media (max-width: 640px) { .fl-page { margin: -12px -12px 0; padding: 0 12px 24px; } .fl-tile { width: calc(50% - 6px); height: 160px; } .fl-tile.wide { width: 100%; } .fl-num { font-size: 28px; } }

/* ================================================================ پوستهٔ SAP Fiori (Horizon) — html.fiori
   الگوها: Shell Bar، Side Navigation، Dynamic Page / List Report (نوار فیلتر + نوار ابزار جدول)، Object Page
   (سرِ صفحه با واقعیت‌های کلیدی و نوار لنگر)، فرم با نوار پایین شناور، Dialog، Message Toast، ObjectStatus.
   رنگ برند سازمان (var(--primary)) همچنان اعمال می‌شود. */
html.fiori {
  --bg: #f5f6f7; --panel: #ffffff; --line: #e5e5e5; --text: #1d2d3e; --muted: #556b82;
  --primary: #0070f2; --primary-2: #0064d9; --primary-soft: #ebf8ff;
  --ok: #256f3a; --ok-soft: #f5fae5; --warn: #e76500; --warn-soft: #fff8d6; --danger: #aa0808; --danger-soft: #ffeaf4; --info-soft: #e1f4ff; --gray-soft: #eff1f2;
  --f-shadow: 0 0 .125rem 0 rgba(34,53,72,.15), 0 .125rem .5rem 0 rgba(34,53,72,.15);
  --f-shadow-s: 0 0 .125rem 0 rgba(34,53,72,.15), 0 .0625rem .1875rem 0 rgba(34,53,72,.15);
  --f-field: #556b81; --f-btn-border: #bcc3ca; --f-link: #0064d9; --f-hover: #eaecee; --f-sel: #ebf8ff; --f-focus: #0032a5;
  --radius: 12px; --sidebar: 256px;
}
html.fiori body { background: var(--bg); color: var(--text); font-size: 14px; }
html.fiori a { color: var(--f-link); }

/* --- Shell Bar */
html.fiori .topbar { position: fixed; top: 0; left: 0; right: 0; height: 52px; padding: 0 12px; gap: 8px; background: #fff; border-bottom: 0; box-shadow: var(--f-shadow-s); z-index: 40; }
html.fiori .menu-btn { display: inline-flex; width: 36px; height: 36px; justify-content: center; padding: 0; font-size: 18px; color: var(--muted); }
html.fiori .back-btn { width: 36px; height: 36px; padding: 0; justify-content: center; font-size: 16px; color: var(--f-link); border: 0; }
html.fiori .back-btn .lbl, html.fiori .shell-search .lbl + kbd { display: none; }
html.fiori .back-btn:disabled { opacity: .35; }
html.fiori .shell-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); padding: 0 6px; }
html.fiori .shell-logo .logo-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
html.fiori .shell-logo b { font-size: 16px; font-weight: 800; letter-spacing: .3px; color: var(--text); }
html.fiori .shell-sep { width: 1px; height: 20px; background: #d9d9d9; }
html.fiori .shell-tenant { font-size: 14px; color: var(--muted); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.fiori .shell-title { display: flex; align-items: baseline; gap: 8px; padding-inline-start: 8px; min-width: 0; }
html.fiori .topbar .title { font-size: 14px; font-weight: 700; white-space: nowrap; }
html.fiori .topbar .crumb { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
html.fiori .shell-search { width: min(460px, 36vw); height: 36px; justify-content: flex-start; gap: 8px; background: #eff1f2 !important; border: 1px solid transparent !important; border-radius: 18px !important; color: var(--muted) !important; font-weight: 400 !important; padding: 0 14px !important; }
html.fiori .shell-search:hover { border-color: var(--f-field) !important; background: #fff !important; }
html.fiori .shell-search kbd { margin-inline-start: auto; }
html.fiori .topbar .today { display: none; }
html.fiori .bell { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; font-size: 17px; }
html.fiori .bell:hover { background: var(--f-hover); }
html.fiori .bell .cnt { top: 2px; left: 2px; background: #aa0808; }
html.fiori .topbar .user { padding: 2px; border-radius: 50%; }
html.fiori .topbar .user .user-t, html.fiori .logout-btn { display: none; }
html.fiori .avatar { width: 32px; height: 32px; background: #0070f2; color: #fff; font-size: 14px; font-weight: 700; }
html.fiori .avatar.lg { width: 56px; height: 56px; font-size: 22px; }
html:not(.fiori) .shell-logo, html:not(.fiori) .shell-search .lbl + kbd:not(:last-child) { display: none; }
.user-pop { position: fixed; top: 56px; left: 10px; z-index: 200; background: #fff; border-radius: 12px; box-shadow: 0 .625rem 1.875rem rgba(34,53,72,.25); min-width: 260px; padding: 8px; display: flex; flex-direction: column; }
.user-pop .up-h { display: flex; gap: 12px; align-items: center; padding: 10px 10px 14px; border-bottom: 1px solid #e5e5e5; margin-bottom: 6px; }
.user-pop .up-h > div:last-child { display: flex; flex-direction: column; }
.user-pop a, .user-pop button { display: block; text-align: right; padding: 10px 12px; border-radius: 8px; color: #1d2d3e; text-decoration: none; border: 0; background: none; font: inherit; cursor: pointer; }
.user-pop a:hover, .user-pop button:hover { background: #eaecee; }
.user-pop .danger { color: #aa0808; }

/* --- Side Navigation */
html.fiori .sidebar { background: #fff; color: var(--text); box-shadow: var(--f-shadow-s); border-inline-start: 0; position: sticky; top: 52px; height: calc(100vh - 52px); z-index: 30; }
html.fiori #app { padding-top: 52px; }
html.fiori .sidebar .brand { display: none; }
html.fiori .sidebar .search { padding: 10px 12px 6px; }
html.fiori .sidebar .search input { background: #fff; border: 1px solid var(--f-field); color: var(--text); height: 34px; border-radius: 4px; }
html.fiori .sidebar nav { padding: 4px 8px 16px; }
html.fiori .sidebar nav::-webkit-scrollbar-thumb { background: #d9d9d9; }
html.fiori .nav-group { margin-bottom: 2px; }
html.fiori .nav-group > .head { height: 40px; padding: 0 12px; border-radius: 8px; color: var(--text); font-weight: 400; }
html.fiori .nav-group > .head:hover { background: var(--f-hover); }
html.fiori .nav-group > .head .ic { background: none; width: 22px; font-size: 16px; }
html.fiori .nav-group > .head .chev { opacity: .7; color: var(--muted); }
html.fiori .nav-group.open > .head { font-weight: 700; }
html.fiori .nav-item { height: 36px; display: flex; align-items: center; padding: 0 12px; margin: 1px 0; margin-inline-start: 30px; border-radius: 8px; color: var(--text); font-size: 13.5px; }
html.fiori .nav-item:hover { background: var(--f-hover); color: var(--text); }
html.fiori .nav-item.active { background: var(--f-sel); color: var(--f-link); font-weight: 700; box-shadow: inset -3px 0 0 var(--primary); }
html.fiori .sidebar .foot { border-top: 1px solid #e5e5e5; color: var(--muted); }
html.fiori .sidebar .foot a { color: var(--f-link); }
/* منوی جمع‌شده: فقط نماد گروه‌ها */
html.fiori #app.nav-collapsed .sidebar { width: 64px; }
html.fiori #app.nav-collapsed .sidebar .search, html.fiori #app.nav-collapsed .sidebar .foot, html.fiori #app.nav-collapsed .nav-group .items,
html.fiori #app.nav-collapsed .nav-group > .head .chev { display: none; }
html.fiori #app.nav-collapsed .nav-group > .head { font-size: 0; justify-content: center; padding: 0; }
html.fiori #app.nav-collapsed .nav-group > .head .ic { font-size: 18px; }
html.fiori .main { min-width: 0; }
html.fiori .content { padding: 0 24px 32px; }
html.fiori .content > :first-child:not(.page-head):not(.list-report):not(.obj-head):not(.fl-page):not(.dash-head) { margin-top: 20px; }
html.fiori .fl-page { margin: 0 -24px; padding: 0 24px 32px; }
html.fiori .dash-head { margin-top: 16px; }
html.fiori .return-bar { background: #e1f4ff; }

/* --- Buttons (Default / Emphasized / Transparent / Accept / Reject / Attention) */
html.fiori .btn { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--f-btn-border); background: #fff; color: var(--f-link); font-weight: 600; font-size: 14px; box-shadow: none; filter: none; gap: 6px; text-decoration: none; }
html.fiori .btn:hover { background: var(--f-hover); filter: none; }
html.fiori .btn:active { background: #dee2e5; }
html.fiori .btn:focus-visible { outline: 2px solid var(--f-focus); outline-offset: 1px; }
html.fiori .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
html.fiori .btn.primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
html.fiori .btn.ghost { background: transparent; border-color: transparent; color: var(--f-link); }
html.fiori .btn.ghost:hover { background: var(--f-hover); }
html.fiori .btn.ok { background: #f5fae5; border-color: #30914c; color: #256f3a; }
html.fiori .btn.ok:hover { background: #e7f3d7; }
html.fiori .btn.danger { background: #ffeaf4; border-color: #f53232; color: #aa0808; }
html.fiori .btn.danger:hover { background: #ffd6e9; }
html.fiori .btn.ghost.danger { background: transparent; border-color: transparent; color: #aa0808; }
html.fiori .btn.warn { background: #fff3b8; border-color: #dd6100; color: #b44f00; }
html.fiori .btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
html.fiori .btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
html.fiori .btn.block { height: 44px; }

/* --- Inputs */
html.fiori .input, html.fiori input[type=text], html.fiori input[type=password], html.fiori input[type=number], html.fiori input[type=email], html.fiori select, html.fiori textarea {
  border: 1px solid var(--f-field); border-radius: 4px; background: #fff; color: var(--text); box-shadow: none; min-height: 36px; font-size: 14px; }
html.fiori textarea { min-height: 72px; }
html.fiori .input:hover, html.fiori input:hover, html.fiori select:hover, html.fiori textarea:hover { border-color: var(--f-link); }
html.fiori .input:focus, html.fiori input:focus, html.fiori select:focus, html.fiori textarea:focus { border-color: var(--f-field); box-shadow: none; outline: 2px solid var(--f-focus); outline-offset: 1px; }
html.fiori .field label, html.fiori .fb-f > span, html.fiori .en-f > span, html.fiori .oc-f > span, html.fiori .frow > span { font-size: 13px; color: var(--muted); font-weight: 400; }
html.fiori .field .req, html.fiori .req { color: #aa0808; }

/* --- Dynamic Page (سرِ صفحهٔ فهرست) و نوار فیلتر */
html.fiori .page-head { margin: 0 -24px 16px; padding: 18px 32px 14px; background: #fff; box-shadow: var(--f-shadow-s); }
html.fiori .page-head h2 { font-size: 20px; font-weight: 800; color: var(--text); }
html.fiori .list-report:not(.embedded) > .dyn-head { margin-bottom: 0; box-shadow: none; padding-bottom: 6px; }
html.fiori .dyn-t { display: flex; align-items: baseline; gap: 10px; }
html.fiori .variant { color: var(--f-link); font-size: 14px; font-weight: 600; cursor: default; }
html.fiori .variant small { font-size: 11px; }
html.fiori .list-report:not(.embedded) > .filterbar { margin: 0 -24px 16px; padding: 8px 32px 16px; background: #fff; box-shadow: 0 .125rem .25rem rgba(34,53,72,.12); }
html.fiori .filterbar { align-items: flex-end; gap: 12px 16px; }
html.fiori .filterbar .grow { flex: 0 1 280px; }
html.fiori .fb-f { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
html.fiori .fb-actions { display: flex; gap: 8px; margin-inline-start: auto; }
html.fiori .list-report.embedded .filterbar { margin-bottom: 10px; }
.fb-f { display: flex; flex-direction: column; gap: 4px; }
.fb-f > span { font-size: 12px; color: var(--muted); }
.fb-actions { display: flex; gap: 8px; }
.tbl-toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl-toolbar h3 { font-size: 15px; font-weight: 700; margin: 0; } .tbl-toolbar .cnt { color: var(--muted); font-weight: 400; }
.tbl-toolbar .spacer { flex: 1; }
table.grid th.nav-ind, table.grid td.nav-ind { width: 28px; padding: 0 6px; text-align: center; color: var(--muted); font-size: 18px; }

/* --- Cards / Tables (Responsive Table) */
html.fiori .card { border: 0; border-radius: 12px; box-shadow: var(--f-shadow); overflow: hidden; }
html.fiori .card .card-h { border-bottom: 1px solid var(--line); padding: 12px 16px; min-height: 48px; }
html.fiori .card .card-h h3 { font-size: 16px; font-weight: 700; color: var(--text); }
html.fiori table.grid { font-size: 14px; }
html.fiori table.grid th { background: #fff; color: var(--text); font-weight: 700; font-size: 13.5px; padding: 10px 12px; border-bottom: 1px solid #a8b2bd; height: 44px; }
html.fiori table.grid td { padding: 8px 12px; border-bottom: 1px solid var(--line); height: 44px; }
html.fiori table.grid tbody tr.clickable:hover, html.fiori table.grid tbody tr:hover { background: var(--f-hover); }
html.fiori table.grid tbody tr.clickable:active { background: var(--f-sel); }
html.fiori table.grid tfoot td { background: #f7f8f9; font-weight: 700; }
html.fiori .pager { justify-content: center; border-top: 1px solid var(--line); color: var(--muted); }
html.fiori .empty { color: var(--muted); }

/* --- ObjectStatus / Tag */
html.fiori .badge { border-radius: 4px; padding: 1px 8px; font-size: 12px; font-weight: 700; background: #eff1f2; color: #1d2d3e; border: 1px solid transparent; line-height: 1.6; }
html.fiori .badge.ok { background: #f5fae5; color: #256f3a; border-color: #bde986; }
html.fiori .badge.warn { background: #fff8d6; color: #b44f00; border-color: #ffdf72; }
html.fiori .badge.danger { background: #ffeaf4; color: #aa0808; border-color: #ffc3c3; }
html.fiori .badge.info { background: #e1f4ff; color: #0040b0; border-color: #b3d9ff; }
html.fiori .badge.primary { background: #ebf8ff; color: #0064d9; border-color: #b3d9ff; }

/* --- Object Page */
.obj-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.crumbs a { text-decoration: none; } .crumbs .sep { opacity: .6; }
.obj-title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.obj-avatar { width: 56px; height: 56px; border-radius: 12px; background: #ebf8ff; display: grid; place-items: center; font-size: 26px; flex: 0 0 auto; }
.obj-titles h1 { margin: 0; font-size: 22px; font-weight: 800; }
.obj-sub { color: var(--muted); font-size: 14px; }
.obj-title-row .spacer { flex: 1; }
.obj-title-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.obj-facts { display: flex; gap: 12px 40px; flex-wrap: wrap; }
.obj-facts .fact { display: flex; flex-direction: column; gap: 2px; }
.obj-facts .fact small { color: var(--muted); font-size: 13px; }
.obj-facts .fact-v { font-size: 16px; font-weight: 600; }
html.fiori .obj-head { margin: 0 -24px 0; padding: 16px 32px 18px; background: #fff; }
html.fiori .obj-facts .fact-v { font-size: 18px; }
.anchor-bar { display: flex; gap: 2px; overflow-x: auto; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
html.fiori .anchor-bar { margin: 0 -24px 16px; padding: 0 24px; background: #fff; box-shadow: 0 .125rem .25rem rgba(34,53,72,.12); position: sticky; top: 52px; z-index: 15; border-bottom: 0; border-top: 1px solid #e5e5e5; }
.anchor { border: 0; background: none; font: inherit; font-size: 14px; color: var(--text); padding: 12px 14px 10px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.anchor:hover { color: var(--f-link, #0064d9); } .anchor.on { color: var(--f-link, #0064d9); border-bottom-color: var(--primary); font-weight: 700; }
.obj-sec { scroll-margin-top: 110px; margin-bottom: 16px; }
.obj-sec .section { scroll-margin-top: 110px; }
html.fiori .kv { gap: 16px 32px; }
html.fiori .kv .k { font-size: 13px; color: var(--muted); }
html.fiori .kv .v { font-size: 14px; font-weight: 400; color: var(--text); }
html.fiori .section h4 { font-size: 15px; color: var(--text); font-weight: 700; }
html.fiori .section h4::after { background: var(--line); }

/* --- فرم: نوار پایین شناور (Floating Footer) */
html.fiori .float-footer { position: sticky; bottom: 0; background: #fff; box-shadow: 0 -.125rem .5rem rgba(34,53,72,.15); border-top: 0; padding: 10px 16px; z-index: 10; }
html.fiori .form-head { margin-bottom: 16px; box-shadow: var(--f-shadow-s); }
html.fiori .form-grid { gap: 12px 24px; }

/* --- IconTabBar */
html.fiori .tabs { gap: 0; border-bottom: 1px solid var(--line); }
html.fiori .tab { padding: 12px 16px 10px; border-bottom: 3px solid transparent; color: var(--text); font-weight: 400; }
html.fiori .tab:hover { color: var(--f-link); }
html.fiori .tab.active { color: var(--f-link); border-bottom-color: var(--primary); font-weight: 700; }

/* --- KPI (کاشی) */
html.fiori .stat { border: 0; border-radius: 16px; box-shadow: var(--f-shadow); padding: 14px 16px; }
html.fiori .stat:hover { box-shadow: 0 0 .125rem rgba(34,53,72,.15), 0 .5rem 1rem rgba(34,53,72,.2); }
html.fiori .stat .l { font-size: 14px; font-weight: 700; color: var(--text); }
html.fiori .stat .v { font-size: 30px; font-weight: 300; letter-spacing: -.5px; }
html.fiori .stat .s { color: var(--muted); }
html.fiori .stat.accent { border-inline-start: 0; box-shadow: var(--f-shadow), inset 0 4px 0 var(--primary); }

/* --- Dialog / Message Toast / پیام‌ها */
html.fiori .modal-bg { background: rgba(0,0,0,.35); }
html.fiori .modal { border-radius: 12px; box-shadow: 0 .625rem 1.875rem rgba(34,53,72,.25); overflow: hidden; }
html.fiori .modal .mh { padding: 12px 16px; border-bottom: 0; box-shadow: 0 .125rem .25rem rgba(34,53,72,.12); }
html.fiori .modal .mh h3 { font-size: 16px; font-weight: 700; }
html.fiori .modal .mb { padding: 16px; }
html.fiori .modal .mf { justify-content: flex-end; flex-direction: row-reverse; background: #fff; border-top: 0; box-shadow: 0 -.125rem .25rem rgba(34,53,72,.08); padding: 10px 16px; }
html.fiori #toasts { left: 50%; transform: translateX(-50%); bottom: 32px; align-items: center; }
html.fiori .toast { background: rgba(29,45,62,.92); color: #fff; border-radius: 8px; padding: 12px 18px; font-size: 14px; box-shadow: 0 .625rem 1.875rem rgba(34,53,72,.25); }
html.fiori .toast.ok, html.fiori .toast.warn { background: rgba(29,45,62,.92); }
html.fiori .toast.err { background: #aa0808; }
html.fiori .hint { background: #e1f4ff; color: #0040b0; border-radius: 8px; border-inline-start: 4px solid #0070f2; }
html.fiori .error-box { background: #ffeaf4; color: #aa0808; border-radius: 8px; border-inline-start: 4px solid #aa0808; }
@media (max-width: 900px) {
  html.fiori .shell-tenant, html.fiori .shell-sep, html.fiori .shell-title { display: none; }
  html.fiori .shell-search { width: 40px; padding: 0 !important; justify-content: center; }
  html.fiori .shell-search .lbl, html.fiori .shell-search kbd { display: none; }
  html.fiori .sidebar { position: fixed; right: 0; top: 52px; transform: translateX(100%); transition: transform .2s; }
  html.fiori .sidebar.show { transform: none; }
  html.fiori .content { padding: 0 12px 24px; }
  html.fiori .page-head, html.fiori .list-report:not(.embedded) > .filterbar, html.fiori .obj-head, html.fiori .anchor-bar { margin-left: -12px; margin-right: -12px; padding-left: 16px; padding-right: 16px; }
}

/* پوستهٔ Fiori: رنگ پیوند روی کاشی‌ها و کارت‌ها اعمال نشود؛ عددهای بزرگ در کاشی جا شوند */
html.fiori .fl-tile, html.fiori .fl-card, html.fiori .fl-li, html.fiori a.stat, html.fiori .execbar { color: var(--text); }
html.fiori .fl-card.exec { color: #fff; }
html.fiori .stat .v { font-size: 24px; font-weight: 400; overflow-wrap: anywhere; line-height: 1.25; }
.fl-num { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- راه‌اندازی از روی چارت سازمانی */
.cf-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.cf-tree { background: var(--panel); border-radius: 12px; box-shadow: var(--f-shadow, var(--shadow)); padding: 8px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.cf-node { display: flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-size: 13.5px; text-align: right; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.cf-node:hover { background: var(--f-hover, #f1f5f9); }
.cf-node.on { background: var(--f-sel, #eff6ff); color: var(--primary); font-weight: 700; box-shadow: inset -3px 0 0 var(--primary); }
.cf-node.done .cf-st { background: #256f3a; color: #fff; }
.cf-node.fin { margin-top: 6px; border-top: 1px dashed var(--line); border-radius: 0 0 8px 8px; }
.cf-st { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--gray-soft); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.cf-ic { width: 18px; text-align: center; } .cf-nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-cnt { color: var(--muted); font-size: 11px; }
.cf-panel { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.cf-ph { display: flex; gap: 14px; align-items: center; }
.cf-ph h3 { margin: 2px 0 4px; font-size: 20px; }
.cf-big { width: 56px; height: 56px; border-radius: 14px; background: var(--primary-soft); display: grid; place-items: center; font-size: 28px; flex: 0 0 auto; }
.cf-sec { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cf-sec h4 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.cf-head { display: flex; align-items: center; gap: 10px; }
.cf-av { width: 34px; height: 34px; border-radius: 50%; background: #0070f2; color: #fff; display: grid; place-items: center; font-weight: 700; }
.cf-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .cf-row .input { flex: 1; min-width: 180px; }
.cf-col { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 240px; }
.cf-add { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: var(--bg); border-radius: 10px; padding: 10px; }
.cf-add > textarea { flex: 1; min-width: 240px; }
.cf-add-o { display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.cf-people { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-person { display: inline-flex; gap: 6px; align-items: center; background: var(--gray-soft); border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.cf-person.head { background: #fff8d6; } .cf-person code { font-size: 11px; color: var(--muted); }
.cf-line { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.cf-line-h { display: flex; gap: 8px; align-items: center; } .cf-line-h code { font-size: 11px; color: var(--muted); }
.cf-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cf-stn { display: inline-flex; flex-direction: column; align-items: center; border: 1px solid #93b4f5; background: #eef4ff; border-radius: 8px; padding: 4px 10px; font-size: 13px; }
.cf-stn small { font-size: 10px; color: var(--muted); } .cf-arr { color: var(--muted); }
.cf-foot { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.cf-prog { display: flex; flex-direction: column; gap: 3px; min-width: 150px; } .cf-prog small { color: var(--muted); font-size: 12px; }
.cf-prog-bar { height: 8px; border-radius: 4px; background: var(--gray-soft); overflow: hidden; } .cf-prog-bar i { display: block; height: 100%; background: #256f3a; }
.cf-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cf-tpl { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: right; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 14px; cursor: pointer; font: inherit; color: var(--text); text-decoration: none; }
.cf-tpl:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(0,112,242,.12); }
.cf-tpl-i { font-size: 28px; }
.cf-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cf-sum > div { background: var(--bg); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.cf-sum b { font-size: 22px; } .cf-sum small { color: var(--muted); }
@media (max-width: 900px) { .cf-wrap { grid-template-columns: 1fr; } .cf-tree { position: static; max-height: 260px; } }

/* ---------------------------------------------------------------- فرم‌های کاغذی و تصمیم مراحل */
.rq-lines { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; width: 100%; }
.rq-lines h4 { margin: 10px 0 2px; }
.rq-ln-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.rq-ln { width: 100%; border-collapse: collapse; font-size: 13px; }
.rq-ln th { background: var(--gray-soft); font-weight: 600; padding: 6px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.rq-ln td { padding: 3px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; min-width: 90px; }
.rq-ln.view td { padding: 6px 8px; }
.rq-ln td.rq-ln-n, .rq-ln th:first-child { width: 42px; min-width: 42px; text-align: center; color: var(--muted); }
.rq-ln td.rq-ln-item, .rq-ln td.rq-ln-work_center, .rq-ln td.rq-ln-customer, .rq-ln td.rq-ln-supplier { min-width: 200px; }
.rq-ln td.rq-ln-number, .rq-ln td.rq-ln-money { min-width: 80px; max-width: 120px; }
.rq-ln .input { padding: 5px 8px; min-height: 32px; }
.rq-ln tr:last-child td { border-bottom: 0; }
.rq-dec { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.rq-dec-b { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: right; font: inherit; border: 1.5px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; cursor: pointer; color: var(--text); }
.rq-dec-b small { color: var(--muted); font-size: 11.5px; }
.rq-dec-b:hover { border-color: var(--primary); }
.rq-dec-b.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.rq-dec-b.reject.on { border-color: var(--danger); background: #fff1f1; box-shadow: inset 0 0 0 1px var(--danger); }
.rq-dec-b.finish.on { border-color: var(--ok); background: #effaf1; box-shadow: inset 0 0 0 1px var(--ok); }
.rq-tl-dec { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.rq-tl-dec > span { background: var(--primary-soft); border-radius: 6px; padding: 1px 8px; }
.rq-tl-i.skip { opacity: .6; }
.rq-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.rq-warn { display: block; background: #fff8e1; border: 1px solid #f5d77a; color: #7a5a00; border-radius: 8px; padding: 6px 10px; font-size: 12.5px; }
.pd-extra { border: 1px dashed var(--line); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; gap: 6px; }
.pd-extra[open] { background: #fcfcff; }
.pd-extra summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.pd-extra > small { display: block; margin: 4px 0 2px; font-size: 11px; line-height: 1.6; }
.pd-decs { display: flex; flex-direction: column; gap: 4px; }
.pd-dec { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border-bottom: 1px dotted var(--line); padding-bottom: 4px; }
.pd-dec .input { flex: 1 1 100px; min-width: 0; padding: 4px 6px; font-size: 12.5px; }
.pd-dec .pd-code { flex: 0 1 80px; }
.pd-cols { margin: 0 24px 8px 0; border-inline-start: 3px solid var(--primary-soft); padding-inline-start: 10px; display: flex; flex-direction: column; gap: 4px; }
.pd-col { background: var(--bg); border-radius: 8px; padding: 4px; }

/* ---------------------------------------------------------------- منوی قفل‌دار و داشبوردهای نقش‌محور */
.nav-item.locked { opacity: .5; }
.nav-item.locked:hover { opacity: .75; }
.nav-item .lock, .nav-group .head .lock { font-size: 10px; margin-inline-end: 4px; filter: grayscale(1); }
.nav-group.locked > .head { opacity: .55; }
.locked-page { max-width: 560px; margin: 60px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--panel); border-radius: 16px; padding: 32px 24px; box-shadow: var(--f-shadow, var(--shadow)); }
.locked-page .lp-ic { font-size: 48px; width: 88px; height: 88px; border-radius: 50%; background: var(--gray-soft); display: grid; place-items: center; }
.locked-page h2 { margin: 4px 0 0; }
.locked-page p { line-height: 1.9; margin: 0; }
.lp-a { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.cd-kpis { margin-bottom: 14px; }
.stat.db-kpi.off { opacity: .55; cursor: default; }
.cd-grid { margin-bottom: 14px; }
.cd-w.wide { grid-column: 1 / -1; }
.cd-w .card-h small { font-size: 11px; }
.cd-note { white-space: pre-wrap; line-height: 2; font-size: 15px; background: #fffbe8; border-radius: 0 0 12px 12px; }
.cd-links { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-link { display: inline-flex; align-items: center; gap: 6px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font-weight: 600; text-decoration: none; min-width: 140px; justify-content: center; }
.cd-link:hover { border-color: var(--primary); color: var(--primary); }
.cd-link.locked { opacity: .5; }
.db-alerts-b { display: flex; flex-direction: column; gap: 4px; }
.dd-editor { min-width: 0; }
.dd-ws { display: flex; flex-direction: column; gap: 4px; }
.dd-empty { padding: 10px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.dd-w { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--panel); }
.dd-w.off { opacity: .55; }
.dd-k { font-size: 18px; width: 26px; text-align: center; }
.dd-wt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dd-wt small { font-size: 11.5px; }
.dd-cfg { margin: -2px 34px 6px 0; display: flex; flex-direction: column; gap: 6px; border-inline-start: 3px solid var(--primary-soft); padding-inline-start: 10px; }
.dd-cat { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.dd-g summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.dd-g summary .btn { margin-inline-start: auto; }
.dd-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 8px; }
.dd-chip { font: inherit; font-size: 12.5px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px; cursor: pointer; color: var(--text); }
.dd-chip:hover { border-color: var(--primary); color: var(--primary); }
.dd-chip.used { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); cursor: default; }
.dd-chip.off { opacity: .45; }
.chip-x { border: 0; background: none; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 2px; color: inherit; }
.dd-preview { min-height: 200px; }
.fl-custom { padding-top: 4px; }
.pd-roles .chip { direction: rtl; padding: 3px 10px; border: 1px solid transparent; }
.pd-roles .chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.dd-blind { color: #b45309; font-size: 11.5px; }

/* ---------------------------------------------------------------- لایهٔ SAP: فیلد فرمان، Easy Access، جریان سند، MD04، SU3، نوار وضعیت */
.cmd-field { display: flex; align-items: center; gap: 4px; background: var(--gray-soft); border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; height: 32px; margin-inline-start: 10px; }
.cmd-field:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px var(--primary-soft); }
.cmd-ic { color: var(--primary); font-size: 10px; }
.cmd-input { border: 0; background: transparent; outline: none; width: 110px; font: 600 13px/1 ui-monospace, Consolas, monospace; text-transform: uppercase; color: var(--text); }
.cmd-input::placeholder { text-transform: none; font-family: Vazirmatn, Tahoma, sans-serif; font-weight: 400; letter-spacing: 0; }
@media (max-width: 900px) { .cmd-field { display: none; } }
.nav-tc { margin-inline-start: 6px; font: 10.5px ui-monospace, Consolas, monospace; opacity: .6; direction: ltr; }
.ea-wrap { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .ea-wrap { grid-template-columns: 1fr; } }
.ea-tree { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.ea-folder > .ea-kids { display: none; padding-inline-start: 18px; border-inline-start: 1px dotted var(--line); margin-inline-start: 7px; }
.ea-folder.open > .ea-kids { display: flex; flex-direction: column; gap: 1px; }
.ea-fh { cursor: pointer; padding: 5px 6px; border-radius: 6px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ea-fh:hover { background: var(--gray-soft); }
.ea-chev { display: inline-block; transition: transform .15s; font-size: 11px; color: var(--muted); }
.ea-folder.open > .ea-fh .ea-chev { transform: rotate(-90deg); }
.ea-leaf { display: flex; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13px; }
.ea-leaf:hover { background: var(--primary-soft); color: var(--primary); }
.ea-leaf code, .ea-codes code { font: 600 11.5px ui-monospace, Consolas, monospace; background: #eef4ff; color: #0a4fb3; border-radius: 4px; padding: 1px 6px; direction: ltr; min-width: 52px; text-align: center; display: inline-block; }
.ea-leaf.locked, .ea-codes tr.locked { opacity: .5; }
.ea-ic { font-size: 9px; color: var(--primary); }
.ea-empty { padding: 4px 8px; font-size: 12px; }
.ea-scroll { max-height: 70vh; overflow-y: auto; }
.df-tbl td { white-space: nowrap; }
.df-tbl tr.df-cur td { background: #fff8d6; font-weight: 700; }
.df-tbl tr.df-locked td { opacity: .6; }
.df-cell { display: flex; align-items: center; gap: 6px; } .df-ind { color: var(--muted); }
.md-bad .v { color: var(--danger); }
.md-chart { width: 100%; height: 150px; }
.md-tbl tr.md-neg td { background: #fff4f4; }
.md-rec { color: #256f3a; font-weight: 600; }
.md-req { color: #b42318; }
.md-code { font: 600 11px ui-monospace, Consolas, monospace; background: var(--gray-soft); border-radius: 4px; padding: 1px 5px; direction: ltr; display: inline-block; min-width: 50px; text-align: center; }
.md-exc { color: #b45309; font-size: 12px; }
.su3-row { display: grid; grid-template-columns: 52px 150px 1fr; gap: 8px; align-items: center; padding: 4px 0; }
.su3-pid { font: 600 11.5px ui-monospace, Consolas, monospace; background: #eef4ff; color: #0a4fb3; border-radius: 4px; padding: 2px 6px; text-align: center; direction: ltr; }
.su3-l { font-size: 13px; }
.sap-status { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 0; height: 28px; background: var(--panel); border-top: 1px solid var(--line); font-size: 12px; margin-top: 16px; box-shadow: 0 -2px 6px rgba(0,0,0,.04); }
.sap-status button { font: inherit; border: 0; background: none; cursor: pointer; color: var(--text); height: 100%; padding: 0 10px; }
.sap-status .ss-msg { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.sap-status .ss-msg.err { color: var(--danger); font-weight: 600; } .sap-status .ss-msg.warn { color: #b45309; } .sap-status .ss-msg.ok { color: #256f3a; }
.sap-status .ss-log:hover, .sap-status .ss-msg:hover { background: var(--gray-soft); }
.ss-err { color: var(--danger); }
.ss-cell { border-inline-start: 1px solid var(--line); padding: 0 10px; color: var(--muted); height: 100%; display: flex; align-items: center; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.ss-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; min-width: 420px; }
.ss-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; background: var(--bg); font-size: 13px; }
.ss-item.err { background: #fff1f1; } .ss-item.warn { background: #fff8e1; } .ss-item.ok { background: #effaf1; }

/* ---------------------------------------------------------------- ماژول‌های اختصاصی */
.cm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cm-chips .chip { direction: rtl; cursor: pointer; border: 1px solid var(--line); background: var(--panel); padding: 3px 12px; border-radius: 999px; font: inherit; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.cm-chips .chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cm-chips .chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.card-b > .input { margin-bottom: 10px; }
.badge.cm-st { border: 1px solid; }
.cm-st-btn { background: var(--panel); }
.cm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.cm-form .wide, .cm-form .error-box { grid-column: 1 / -1; }
@media (max-width: 800px) { .cm-form { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 8px; margin-top: 14px; }
.cm-hist { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.cm-hist > div { border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
.cmd-editor { min-width: 0; }
.pd-item.cmd-ent { padding-inline-start: 28px; font-size: 13px; }
.cmd-sts { display: flex; flex-direction: column; gap: 4px; }
.cmd-st { display: grid; grid-template-columns: 40px 1fr 140px auto auto auto; gap: 6px; align-items: center; }
.cmd-st input[type=color] { width: 36px; height: 30px; border: 0; background: none; padding: 0; }

/* ورود چارت از فایل */
.oc-drop { border: 2px dashed var(--border, #cbd5e1); border-radius: 12px; padding: 22px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; cursor: pointer; margin-bottom: 10px; }
.oc-drop:hover, .oc-drop.on { border-color: var(--primary, #2563eb); background: rgba(37, 99, 235, .06); }
.oc-import details { margin-bottom: 10px; }
.oc-import details textarea { width: 100%; margin-top: 6px; font-family: inherit; }
.oc-import .check { padding-top: 8px; }
.ok-box { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.oc-imp-tree { max-height: 46vh; overflow: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 6px; }
.oc-imp-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.oc-imp-row .input.sm { max-width: 260px; padding: 3px 8px; }
.oc-imp-row.pos .input.sm { background: #fffbeb; }
.oc-imp-row .chip { direction: rtl; margin: 0; border: 1px solid #cbd5e1; border-radius: 999px; padding: 2px 8px; font-size: 12px; background: #eff6ff; cursor: pointer; white-space: nowrap; }
.oc-imp-row .chip.pos { background: #fef3c7; border-color: #f59e0b; }
.row-actions { display: flex; gap: 8px; margin-top: 10px; }
.grid tr.row-warn td { background: #fef3c7; }

/* گزارش‌های روزانهٔ واحدها */
.dl-head { flex-wrap: wrap; gap: 8px; }
.dl-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.dl-key { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; width: 100%; }
.dl-key .dl-f select, .dl-key .dl-f input { width: auto; min-width: 110px; }
.dl-f { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; min-width: 110px; }
.dl-f > span { color: var(--muted); font-weight: 600; }
.dl-f .input { padding: 5px 8px; }
.dl-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.dl-row .dl-f { flex: 0 1 160px; }
.dl-lists .dl-f { flex: 1 1 220px; }
.dl-lists textarea { font-family: inherit; }
.dl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .dl-layout { grid-template-columns: minmax(0, 1fr); } }
.dl-sticky { position: sticky; top: 8px; background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 10px 12px; max-height: calc(100vh - 120px); overflow: auto; }
.dl-sticky h4 { margin: 0 0 8px; }
.dl-sec { margin-bottom: 12px; }
.dl-sec .card-b { display: flex; flex-direction: column; gap: 8px; }
.dl-sec-t { font-weight: 700; margin: 14px 2px 8px; color: var(--muted); }
.dl-grid td, .dl-grid th { padding: 3px 5px; vertical-align: middle; }
.dl-grid .input { padding: 4px 6px; width: 100%; min-width: 60px; }
.dl-rows > .btn { margin-top: 6px; }
.dl-x { width: 34px; }
.dl-empty { text-align: center; padding: 8px !important; }
.input.dl-n { width: 80px; text-align: center; direction: ltr; }
.input.dl-time { width: 80px; text-align: center; }
.dl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px !important; }
.dl-stats .stat { padding: 6px 8px; }
.dl-stats .stat .v { font-size: 16px; }
.stat.hl .v { color: #1d4ed8; }
.stat.bad .v { color: #b91c1c; }
.dl-sub { margin-top: 8px; font-size: 12.5px; }
.dl-kv { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line, #e5e7eb); padding: 2px 0; }
.dl-warns { margin-top: 8px; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; padding: 6px 8px; font-size: 12.5px; color: #92400e; }
.dl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: sticky; bottom: 0; background: var(--card, #fff); border-top: 1px solid var(--line, #e5e7eb); padding: 10px 4px; margin-top: 10px; z-index: 5; }
.dl-bar .spacer { flex: 1; }
.dl-ro input, .dl-ro select, .dl-ro textarea { background: #f8fafc; }
.dl-model { margin-bottom: 12px; border-inline-start: 4px solid #2563eb; }
.dl-model .card-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dl-model .card-h .spacer { flex: 1; }
.dl-model h4 { margin: 12px 0 4px; }
.dl-chk { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.dl-modes { display: flex; gap: 4px; margin: 6px 0; flex-wrap: wrap; }
.dl-cut { width: auto; }
.dl-cut th, .dl-cut td { text-align: center; padding: 4px; min-width: 96px; }
.dl-cut tbody th { text-align: start; white-space: nowrap; }
.dl-cut td.dl-off { background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 6px, #fff 6px, #fff 12px); }
.dl-cell { display: flex; gap: 3px; justify-content: center; }
.dl-cell .input { width: 62px; padding: 3px 4px; }
.dl-cell select.input { width: 70px; }
.dl-auto { display: block; font-size: 11px; color: var(--muted); min-height: 14px; }
.dl-auto.bad { color: #b91c1c; font-weight: 700; }
.dl-auto.warn { color: #b45309; font-weight: 700; }
.dl-carry { display: block; font-size: 11px; color: #047857; }
.dl-bal td.bad { color: #b91c1c; font-weight: 700; }
.dl-bal td.warn { color: #b45309; font-weight: 700; }
.dl-boxline { margin-top: 6px; }
.dl-addmodel { display: flex; gap: 8px; margin: 8px 0 14px; max-width: 460px; }
.dl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 10px 0 14px; }
.dl-card { border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--card, #fff); }
.dl-card.empty { border-style: dashed; }
.dl-card-h { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.dl-ic { font-size: 22px; }
.dl-card-list { display: flex; flex-direction: column; gap: 6px; }
.dl-rep { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px; background: #f8fafc; color: inherit; text-decoration: none; }
.dl-rep:hover { background: #eff6ff; }
.dl-warn-t { color: #b45309; }
.dl-none { padding: 6px 0; }
.dl-card .btn { align-self: flex-start; margin-top: auto; }
.dl-alerts { display: flex; flex-direction: column; gap: 6px; }
.dl-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dl-pack-hint { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.dl-balance { margin-top: 8px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 6px 10px; }
.dl-route td, .dl-route th { text-align: center; }
.row-crit td { background: #fef2f2; }
/* کرنومتر */
.sw-wrap { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .sw-wrap { grid-template-columns: 1fr; } }
.sw-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sw-disp { font-size: 52px; font-weight: 800; text-align: center; direction: ltr; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.sw-lap { text-align: center; }
.sw-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sw-big { font-size: 16px; padding: 10px 18px; }
.sw-laps { display: flex; flex-wrap: wrap; gap: 4px; max-height: 160px; overflow: auto; }
.sw-chip { background: #f1f5f9; border-radius: 999px; padding: 1px 4px 1px 10px; font-size: 12px; display: inline-flex; align-items: center; }
/* گانت */
.gantt { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 8px; margin: 10px 0; }
.g-row { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px dashed #eef1f5; }
.g-l { font-size: 12.5px; }
.g-track { position: relative; height: 24px; background: #f8fafc; border-radius: 6px; }
.g-bar { position: absolute; top: 2px; bottom: 2px; background: #60a5fa; border-radius: 5px; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; }
.g-bar.crit { background: #ef4444; }
@media print { .dl-bar, .dl-tabs, .sidebar, .topbar { display: none !important; } .dl-layout { grid-template-columns: 1fr; } }

/* مسیرهای تأیید هر فرم و فرایند هر نفر */
.pd-paths { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }
.pd-paths-t { font-weight: 700; color: var(--muted); }
.pd-path { border: 1px solid var(--line, #e5e7eb); background: var(--card, #fff); border-radius: 10px; padding: 5px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }
.pd-path small { color: var(--muted); font-size: 11px; }
.pd-path.on { border-color: #2563eb; background: #eff6ff; }
.pd-aud { border: 1px dashed #93c5fd; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #f8fbff; }
.pd-aud-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pd-aud-h .check { padding-top: 0; }
.pd-aud-rows { display: flex; flex-direction: column; gap: 6px; }
.pd-aud-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pd-aud-l { min-width: 170px; font-weight: 600; }
.pd-aud-row select.input { width: auto; min-width: 180px; padding: 3px 6px; }
.chip.pd-chip { direction: rtl; display: inline-flex; align-items: center; gap: 2px; background: #e0e7ff; padding: 1px 2px 1px 8px; margin: 0; }
.pp-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .pp-wrap { grid-template-columns: 1fr; } }
.pp-side { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 8px; }
.pp-list { display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow: auto; }
.pp-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.pp-head .spacer { flex: 1; }
.pp-head select.input { width: auto; }
.pp-table td { vertical-align: middle; }
.pp-table select.input { width: auto; min-width: 170px; padding: 3px 6px; }
.pp-off td { opacity: .55; }
.pp-steps { max-width: 420px; }
/* درخت محصول */
.bt-bar { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.bt-bar .spacer, .bt-row .spacer { flex: 1; }
.bt-tree { border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 6px; background: var(--card, #fff); }
.bt-row { display: flex; align-items: center; gap: 8px; padding: 4px; border-bottom: 1px dashed #eef1f5; flex-wrap: wrap; }
.bt-row.root { background: #eff6ff; border-radius: 8px; font-size: 15px; }
.bt-row:hover { background: #f8fafc; }
.bt-tog { border: 0; background: none; width: 20px; cursor: pointer; color: var(--muted); }
.bt-item { display: inline-flex; align-items: center; gap: 4px; min-width: 240px; }
.bt-new .input { padding: 3px 6px; }
.bt-code { width: 110px; }
.bt-name { width: 200px; }
.bt-qty { display: inline-flex; gap: 3px; align-items: center; }
.bt-uom { width: 60px; padding: 3px 4px; text-align: center; }
.bt-prevbox { max-height: 45vh; overflow: auto; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 6px; }
.bt-prev { padding: 2px 0; }
.cm-stats { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow: auto; }
.cm-st { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.cm-st > .badge { align-self: flex-start; }
.cm-bar { display: grid; grid-template-columns: 160px minmax(0, 1fr) 40px; gap: 6px; align-items: center; font-size: 12.5px; }
.cm-bar-t { background: #eef2f7; border-radius: 4px; height: 10px; overflow: hidden; }
.cm-bar-f { display: block; height: 100%; background: #0a6ed1; }

.dq-trend { display: flex; align-items: flex-end; gap: 2px; height: 90px; }
.dq-col { flex: 1; height: 100%; display: flex; align-items: flex-end; background: #f5f7fa; border-radius: 3px; }
.dq-col span { display: block; width: 100%; background: #b91c1c; border-radius: 3px; min-height: 1px; }
.dq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .dq-grid { grid-template-columns: 1fr; } }

/* سمت‌های شغلی روی چارت */
.oc-node.oc-pos { background: #f8fafc; color: #334155; border-color: #94a3b8; border-radius: 16px; font-size: 12px; padding: 2px 8px; }
.oc-node.oc-pos .oc-name { font-weight: 500; }
.oc-pos-l { display: flex; align-items: center; gap: 4px; }
.oc-pos-i { font-size: 11px; opacity: .75; }
.oc-count.short { border-color: #f59e0b; color: #92400e; }
.oc-add.pos { bottom: -26px; left: calc(50% - 40px); background: #64748b; font-size: 11px; }
.oc-p-head.oc-pos-head { background: #f1f5f9; color: #334155; }

/* مدیران و مسئولان چارت روی داشبورد رئیس */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 4px 2px; }
.team-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border, #e5e7eb); border-inline-start: 4px solid var(--primary); border-radius: 10px; background: var(--card, #fff); color: inherit; text-decoration: none; }
.team-card:hover { box-shadow: 0 4px 14px rgba(16,24,40,.12); }
.team-card.empty { border-inline-start-color: #cbd5e1; }
.team-card.empty .team-person { color: #94a3b8; }
.team-role { font-weight: 700; font-size: 15px; }
.team-person { font-size: 13px; }
.team-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted, #6b7280); }
.team-wait { color: #b45309; font-weight: 600; }
.team-new { position: absolute; top: 8px; left: 8px; background: #16a34a; color: #fff; border-radius: 999px; font-size: 10px; padding: 0 7px; line-height: 17px; }
.team-card.fresh { animation: team-in .5s ease both; }
@keyframes team-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* فرم‌های کاغذی */
.modal.xl { max-width: 1260px; }
.rq-paper { overflow-x: auto; padding: 4px 0; }
.ap-logo { max-height: 56px; max-width: 160px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; padding: 2px; background: #fff; }
.ap-logo-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* نسخهٔ کاویار */
.login-card .ed-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; }
/* خانهٔ کاویار و نقشهٔ فرایند */
.kv-page { max-width: 1280px; margin: 0 auto; padding: 4px 4px 30px; }
.kv-hero { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, var(--primary, #0a6ed1), #0b3d6e); color: #fff; border-radius: 16px; padding: 18px 22px; margin-bottom: 18px; flex-wrap: wrap; }
.kv-hero img { width: 64px; height: 64px; border-radius: 12px; background: #fff; object-fit: contain; padding: 4px; }
.kv-hero h1 { margin: 0; font-size: 24px; }
.kv-sub { opacity: .9; font-size: 14px; }
.kv-map-btn { background: #fff; color: #0b3d6e !important; font-weight: 800; padding: 10px 18px; border-radius: 12px; text-decoration: none; }
.kv-h { margin: 18px 4px 10px; font-size: 17px; }
.kv-h small { color: var(--muted, #6b7280); font-weight: 400; font-size: 13px; }
.kv-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kv-count { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center; padding: 16px 18px; border-radius: 14px; background: var(--card, #fff); border: 1px solid var(--border, #e5e7eb); text-decoration: none; color: inherit; }
.kv-count .kv-ic { grid-row: span 3; font-size: 34px; }
.kv-count b { font-size: 30px; line-height: 1; }
.kv-count small { color: var(--muted, #6b7280); }
.kv-count.warn { border-color: #f59e0b; background: #fff8eb; }
.kv-count.warn b { color: #b45309; }
.kv-count.info b { color: var(--primary, #0a6ed1); }
.kv-count.zero { opacity: .75; }
.kv-count:hover, .kv-form:hover, .kv-step:hover { box-shadow: 0 6px 18px rgba(16,24,40,.12); transform: translateY(-1px); }
.kv-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kv-forms.small { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kv-form { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 118px; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--border, #e5e7eb); background: var(--card, #fff); cursor: pointer; text-align: center; text-decoration: none; color: inherit; font: inherit; transition: .12s; }
.kv-form .kv-ic { font-size: 34px; }
.kv-form b { font-size: 15px; }
.kv-form small { color: var(--muted, #6b7280); font-size: 12px; }
.kv-form.alt { background: #f6f9fc; }
.kv-list { display: flex; flex-direction: column; gap: 6px; }
.kv-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border, #e5e7eb); background: var(--card, #fff); cursor: pointer; font: inherit; text-align: right; }
.kv-badge { border-radius: 999px; padding: 2px 10px; font-size: 12.5px; background: #eef2f7; }
.kv-badge.warn { background: #fff4e0; color: #b45309; } .kv-badge.info { background: #e8f1fd; color: #0a5bb5; } .kv-badge.ok { background: #e8f7ee; color: #15803d; } .kv-badge.bad { background: #fdecec; color: #b42318; }
.kv-dash { margin-top: 6px; }
.kv-foot { text-align: center; margin-top: 24px; }
.kv-map { max-width: 1400px; margin: 0 auto; }
.kv-lane { background: var(--card, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; }
.kv-lane-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.kv-lane-h b { font-size: 16px; } .kv-lane-h small { color: var(--muted, #6b7280); }
.kv-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kv-arrow { font-size: 22px; color: #94a3b8; }
.kv-step { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 150px; min-height: 96px; justify-content: center; border-radius: 12px; border: 2px solid var(--primary, #0a6ed1); background: #f3f8fe; cursor: pointer; font: inherit; transition: .12s; }
.kv-step .kv-ic { font-size: 26px; } .kv-step b { font-size: 14px; } .kv-step small { color: var(--muted, #6b7280); font-size: 12px; }
.kv-step.off { border-color: #cbd5e1; background: #f8fafc; opacity: .6; }
@media (max-width: 700px) { .kv-hero h1 { font-size: 19px; } .kv-step { width: 46%; } .kv-arrow { display: none; } }

.kv-cat { margin: 14px 4px 8px; font-weight: 800; color: #334155; font-size: 14.5px; }
.kv-more { margin-top: 16px; background: var(--card, #fff); border: 1px dashed var(--border, #cbd5e1); border-radius: 14px; padding: 10px 14px; }
.kv-more summary { cursor: pointer; font-weight: 700; color: var(--primary, #0a6ed1); }
.kv-count.zero b { color: #16a34a; font-size: 24px; }

/* ---------- S/4: لایهٔ SAP (s4.js) ---------- */
.warn-box { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.s4-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.s4-f { display: flex; flex-direction: column; gap: 4px; min-width: 150px; font-size: 13px; }
.s4-f > span { color: var(--muted); font-weight: 600; }
.s4-f .lookup { min-width: 240px; }
.s4-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.s4-kv > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.s4-amt { direction: ltr; display: inline-block; font-variant-numeric: tabular-nums; }
.s4-amt.cr { color: #b91c1c; }
.s4-light { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.s4-light.red { background: #ef4444; box-shadow: 0 0 0 2px #fee2e2; }
.s4-light.green { background: #22c55e; box-shadow: 0 0 0 2px #dcfce7; }
.s4-bw { display: inline-block; direction: ltr; font: 600 12px/1.6 ui-monospace, Consolas, monospace; padding: 0 7px; border-radius: 6px; background: #eef2ff; color: #3730a3; }
.s4-bw.in { background: #dcfce7; color: #166534; }
.s4-bw.out { background: #fee2e2; color: #991b1b; }
.s4-bw.mv { background: #e0f2fe; color: #075985; }
.s4-nw { white-space: nowrap; }
.s4-pt { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.s4-fbl td { white-space: nowrap; }
table.s4-fbl td.s4-txt { max-width: 260px; }
.s4-sys { display: inline-flex; flex-wrap: wrap; gap: 3px; direction: ltr; }
.s4-sys code { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 5px; padding: 0 5px; font-size: 11.5px; }
.s4-sys.big code { font-size: 12.5px; padding: 2px 8px; direction: rtl; }
.s4-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.s4-split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.s4-split .s4-side { max-height: 70vh; overflow: auto; }
@media (max-width: 900px) { .s4-split, .s4-split2 { grid-template-columns: 1fr; } }
.s4-txt { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s4-over { color: #b91c1c; font-weight: 600; }
.s4-hint { padding: 18px; }
.s4-cf td { background: #f8fafc; font-style: italic; }
.s4-bar { height: 5px; border-radius: 3px; margin: 2px 0; }
.s4-bar.dr { background: #60a5fa; }
.s4-bar.cr { background: #f87171; }
.s4-done { border-color: #86efac; }
.s4-pct { display: flex; align-items: baseline; gap: 4px; font-size: 22px; }
.s4-cov { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.s4-meter { height: 5px; background: #f1f5f9; }
.s4-meter i { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); }
.s4-cv { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 13px; border-bottom: 1px dashed #eef1f5; }
.s4-cv .ic { width: 16px; text-align: center; font-weight: 700; }
.s4-cv.yes .ic { color: #16a34a; } .s4-cv.part .ic { color: #d97706; } .s4-cv.no .ic { color: #dc2626; } .s4-cv.no > span:nth-child(2) { color: var(--muted); }
.s4-cv .tc { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; }
.s4-cv .tc code { font-size: 11px; background: #eef2ff; color: #3730a3; border-radius: 4px; padding: 0 5px; cursor: pointer; }

/* ---------- طراحی منو و شیوه‌های نمایش (menu.js) ---------- */
.mn-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.mn-style { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; }
.mn-style:hover { border-color: var(--primary); }
.mn-style.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft, #dbeafe); background: var(--primary-soft, #eff6ff); }
.mn-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.mn-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .mn-split { grid-template-columns: 1fr; } }
.mn-tip { margin: 4px 2px 10px; font-size: 12.5px; }
.mn-group { margin-bottom: 12px; border: 1px solid var(--line); }
.mn-group.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft, #dbeafe); }
.mn-group.off { opacity: .55; }
.mn-ghead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f8fafc; border-radius: 12px 12px 0 0; }
.mn-gicon { width: 52px !important; min-width: 0 !important; text-align: center; font-size: 18px; }
.mn-gtitle { width: 220px !important; font-weight: 600; }
.mn-gbody { padding: 6px 8px 8px; min-height: 36px; border-radius: 0 0 12px 12px; }
.mn-gbody.drop { background: #eff6ff; outline: 2px dashed var(--primary); }
.mn-irow { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; font-size: 13px; }
.mn-irow:hover { background: #f1f5f9; }
.mn-irow .spacer, .mn-libi .spacer { flex: 1; }
.mn-grip { cursor: grab; color: #94a3b8; letter-spacing: -2px; }
.mn-move { width: 110px !important; min-width: 0 !important; padding: 2px 6px !important; font-size: 12px; }
.mn-empty { padding: 8px; font-size: 12.5px; }
.mn-libcard { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.mn-libhint { margin: 8px 0; }
.mn-libg { font-weight: 700; margin: 12px 0 4px; font-size: 13px; }
.mn-libi { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 7px; font-size: 12.5px; cursor: grab; }
.mn-libi:hover { background: #f1f5f9; }
.badge.warn { background: #fef3c7; color: #92400e; }
/* شیوهٔ «منوی بالا» */
#app.nav-top .sidebar, #app.nav-tiles .sidebar { display: none; }
.mn-topnav { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 14px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 52px; z-index: 25; }
.mn-top-g { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; color: var(--text); }
.mn-top-g:hover, .mn-top-g.on { background: var(--primary-soft, #eff6ff); color: var(--primary); }
.mn-top-g.locked { opacity: .5; }
.mn-dd { position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15, 23, 42, .15); padding: 8px; min-width: 240px; max-height: 70vh; overflow: auto; column-width: 230px; }
.mn-item { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13px; break-inside: avoid; }
.mn-item:hover { background: #f1f5f9; }
.mn-item.locked { opacity: .5; }
.mn-item .nav-tc { margin-inline-start: auto; }
/* شیوهٔ «کاشی‌ها» */
.mn-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .35); display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; }
.mn-sheet { background: #f8fafc; border-radius: 16px; width: min(1200px, 100%); max-height: calc(100vh - 80px); overflow: auto; box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.mn-sheet-h { display: flex; gap: 12px; align-items: center; padding: 14px 18px; position: sticky; top: 0; background: #f8fafc; border-bottom: 1px solid var(--line); z-index: 1; }
.mn-sheet-h .input { flex: 1; max-width: 420px; }
.mn-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; padding: 16px 18px 22px; }
.mn-tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.mn-tile.locked { opacity: .55; }
.mn-tile-h { display: flex; gap: 8px; align-items: center; padding: 4px 6px 8px; border-bottom: 1px solid #eef1f5; margin-bottom: 6px; }
.mn-tile-h .ic { font-size: 20px; }
/* «فقط آیکون» در پوستهٔ کلاسیک */
html:not(.fiori) #app.nav-rail .sidebar { width: 64px; }
html:not(.fiori) #app.nav-rail .sidebar .search, html:not(.fiori) #app.nav-rail .sidebar .foot, html:not(.fiori) #app.nav-rail .sidebar .brand > div:not(.logo-mark), html:not(.fiori) #app.nav-rail .nav-group .items, html:not(.fiori) #app.nav-rail .nav-group > .head .chev { display: none; }
html:not(.fiori) #app.nav-rail .nav-group > .head { font-size: 0; justify-content: center; padding: 6px 0; }
html:not(.fiori) #app.nav-rail .nav-group > .head .ic { font-size: 16px; }

/* ---------------------------------------------------------------- بازرگانی خارجی: پروندهٔ واردات و کانتینر (imp.js) */
.imp-steps { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.imp-step { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--gray-soft); color: #64748b; white-space: nowrap; }
.imp-step.done { background: var(--ok-soft); color: #166534; }
.imp-step.cur { background: var(--primary); color: #fff; font-weight: 700; }
.imp-steps.sm .imp-step { padding: 1px 6px; font-size: 13px; }
.imp-flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.imp-fs { border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; color: #64748b; background: #fafafa; }
.imp-fs .ic { font-size: 22px; }
.imp-fs.has { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.imp-prog { display: flex; gap: 6px; flex-wrap: wrap; }
.imp-cnt { font-size: 12px; background: var(--gray-soft); border-radius: 6px; padding: 0 6px; }
.chip-btn.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
@media (max-width: 900px) { .imp-flow { grid-template-columns: repeat(2, 1fr); } }
