/* ===== افق پودات — پوستهٔ وب (همان چیدمان دسکتاپ: منوی بالا + سایدبار آکاردئونی راست + ابزار چپ + نوار وضعیت) ===== */
@font-face { font-family: 'Vazirmatn'; font-weight: 400; font-display: swap; src: url('/lib/vazirmatn/fonts/Vazirmatn-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 500; font-display: swap; src: url('/lib/vazirmatn/fonts/Vazirmatn-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 700; font-display: swap; src: url('/lib/vazirmatn/fonts/Vazirmatn-Bold.woff2') format('woff2'); }

:root {
  --topbar-h: 54px; --statusbar-h: 30px; --sidebar-w: 268px; --tools-w: 48px;
  --tb-space: var(--topbar-h); --sb-space: var(--sidebar-w); /* فضای اشغالی منوها؛ در حالت Unpin فقط نوار باریک */
  --navy: #0f2a4e; --navy-2: #163a67; --accent: #2563eb; --teal: #12b7a9;
  --bg: #eef2f7; --card: #ffffff; --line: #dde4ee; --ink: #1f2a3a; --muted: #6b7a90;
  --bs-body-font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
}
html, body, h1, h2, h3, h4, h5, h6, .btn, .form-control, .form-select, .nav-link, .dropdown-item, input, button, select, textarea, label, table {
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
}
html { font-size: 13.5px; }
body.ofogh-app { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Topbar ---------- */
.ofogh-topbar { height: var(--topbar-h); background: linear-gradient(90deg, var(--navy), var(--navy-2)); color: #fff; display: flex; align-items: center; gap: 10px; padding: 0 12px; position: sticky; top: 0; z-index: 1040; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.ofogh-brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; white-space: nowrap; margin-inline-end: 8px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--teal), var(--accent)); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; color: #fff; }
.brand-logo.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 28px; }
.ofogh-topmenu { display: flex; align-items: stretch; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.ofogh-topmenu::-webkit-scrollbar { display: none; }
.topmenu-item { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; height: var(--topbar-h); color: #cfe0f5; text-decoration: none; font-size: .9rem; white-space: nowrap; border-bottom: 3px solid transparent; transition: .15s; }
.topmenu-item i { font-size: 1rem; }
.topmenu-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.topmenu-item.active { color: #fff; border-bottom-color: var(--mod, var(--teal)); background: rgba(255,255,255,.1); }
.ofogh-topbar-end { display: flex; align-items: center; gap: 8px; }
.topbar-btn, .topbar-user { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 10px; padding: 5px 10px; font-size: .85rem; text-decoration: none; }
.topbar-user .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--teal); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.topbar-user.dropdown-toggle::after { margin-inline-start: 4px; }

/* ---------- Body grid ---------- */
.ofogh-body { display: flex; flex: 1; min-height: calc(100vh - var(--tb-space) - var(--statusbar-h)); }
.ofogh-sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--card); border-inline-start: 1px solid var(--line); overflow-y: auto; position: sticky; top: var(--tb-space); height: calc(100vh - var(--tb-space) - var(--statusbar-h)); }
.ofogh-main { flex: 1; min-width: 0; padding: 16px 18px 24px; }
.ofogh-tools { width: var(--tools-w); flex: 0 0 var(--tools-w); background: var(--card); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 10px; position: sticky; top: var(--tb-space); height: calc(100vh - var(--tb-space) - var(--statusbar-h)); }
.tool-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; font-size: 1.05rem; transition: .15s; }
.tool-btn:hover { background: #eaf1fb; color: var(--accent); }
@media (max-width: 992px) { .ofogh-tools { display: none; } .ofogh-sidebar { position: fixed; inset-inline-start: 0; z-index: 1035; transform: translateX(100%); transition: .2s; } .ofogh-sidebar.open { transform: none; } }

/* ---------- Accordion sidebar ---------- */
.ofogh-accordion .accordion-item { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.ofogh-accordion .accordion-button { padding: 11px 14px; font-weight: 700; font-size: .92rem; color: var(--ink); background: #f7f9fc; gap: 9px; box-shadow: none; }
.ofogh-accordion .accordion-button:not(.collapsed) { color: #fff; background: linear-gradient(90deg, var(--mod, var(--accent)), color-mix(in srgb, var(--mod, var(--accent)) 70%, #000 10%)); }
.ofogh-accordion .accordion-button:not(.collapsed)::after { filter: brightness(10); }
.ofogh-accordion .accordion-button::after { margin-inline-start: auto; margin-inline-end: 0; }
.ofogh-accordion .mod-icon { font-size: 1.05rem; width: 22px; text-align: center; }
.ofogh-accordion .accordion-body { padding: 6px 6px 8px; }
.nav-items { list-style: none; margin: 0; padding: 0; }
.nav-items .nav-link { display: flex; align-items: center; gap: 9px; padding: 8px 12px; color: var(--ink); border-radius: 9px; font-size: .88rem; }
.nav-items .nav-link i { width: 18px; text-align: center; color: var(--muted); font-size: .95rem; }
.nav-items .nav-link:hover { background: #eef3fa; }
.nav-items .nav-link.active { background: color-mix(in srgb, var(--mod, var(--accent)) 14%, #fff); color: var(--mod, var(--accent)); font-weight: 600; }
.nav-items .nav-link.active i { color: var(--mod, var(--accent)); }
.nav-items .nav-link.parent .caret { margin-inline-start: auto; font-size: .75rem; transition: .15s; }
.nav-items .has-children.open > .parent .caret, .nav-items .parent[aria-expanded="true"] .caret { transform: rotate(180deg); }
.sub-items { list-style: none; margin: 2px 0 4px; padding-inline-start: 14px; border-inline-start: 2px solid var(--line); margin-inline-start: 20px; }
.sub-items .nav-link { padding: 6px 10px; font-size: .84rem; }

/* ---------- Statusbar ---------- */
.ofogh-statusbar { height: var(--statusbar-h); background: #e3e9f2; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 18px; padding: 0 14px; font-size: .78rem; color: #3b4a5f; position: sticky; bottom: 0; z-index: 1030; }
.ofogh-statusbar i { color: var(--accent); margin-inline-end: 4px; }

/* ---------- Page scaffolding ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.2rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-panel, .table-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.table-card .table { margin: 0; }
.table-card .table thead th { background: #f3f6fb; font-weight: 600; font-size: .82rem; color: #42506a; white-space: nowrap; }
.table-card .table td { font-size: .86rem; vertical-align: middle; }
.form-label { font-size: .84rem; margin-bottom: 3px; color: #42506a; }
.form-control, .form-select { font-size: .88rem; border-radius: 8px; }
.form-control-sm, .form-select-sm { font-size: .82rem; }
.btn { border-radius: 9px; font-size: .88rem; }
.btn-sm { font-size: .8rem; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.module-subnav { display: flex; gap: 4px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.subnav-link { padding: 6px 12px; border-radius: 8px; font-size: .85rem; color: var(--ink); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.subnav-link:hover { background: #eef3fa; }
.subnav-link.active { background: var(--accent); color: #fff; }
.num { direction: ltr; unicode-bidi: embed; font-variant-numeric: tabular-nums; }

/* ---------- Toolbar ریبون فرم‌ها (خروج/ایجاد/ذخیره/حذف/بازخوانی/لغو) ---------- */
.form-ribbon { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 12px; }
.form-ribbon .btn { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- درخت کدینگ ---------- */
.tree { list-style: none; padding-inline-start: 0; margin: 0; font-size: .88rem; }
.tree ul { list-style: none; padding-inline-start: 18px; margin: 0; border-inline-start: 1px dashed #cfd8e6; margin-inline-start: 9px; }
.tree li { position: relative; padding: 1px 0; }
.tree .node { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 7px; cursor: pointer; }
.tree .node:hover { background: #eef3fa; }
.tree .node.selected { background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); font-weight: 600; }
.tree .node .code { color: var(--muted); font-size: .8rem; direction: ltr; }
.tree .node .toggle { width: 16px; display: inline-flex; justify-content: center; color: var(--muted); font-size: .75rem; }
.tree .node .toggle.empty { visibility: hidden; }
.tree li.collapsed > ul { display: none; }
.tree li.collapsed > .node .toggle i { transform: rotate(-90deg); }

/* ---------- Auth ---------- */
.auth-body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(900px 500px at 80% 0%, #1b3f70 0, transparent 55%), linear-gradient(135deg, var(--navy), #0b1e3a); }
.auth-card { width: min(420px, 92vw); background: #fff; border-radius: 18px; padding: 28px 26px; box-shadow: 0 30px 60px -25px rgba(0,0,0,.6); }
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand h1 { font-size: 1.4rem; margin: 10px 0 2px; }
.auth-brand p { color: var(--muted); margin: 0; font-size: .85rem; }
.auth-footer { color: #9fb3cf; font-size: .8rem; margin-top: 16px; }

/* ===== پوستهٔ چندپنجره‌ای (shell.js) — پنجره‌ها مثل ویندوز / MDI ===== */
:root { --winbar-h: 36px; }
html.in-frame .ofogh-topbar, html.in-frame .ofogh-sidebar, html.in-frame .pin-rail, html.in-frame .ofogh-tools, html.in-frame .ofogh-statusbar, html.in-frame #winBar { display: none !important; }
body.ofogh-embedded { display: block; min-height: 100vh; background: var(--bg); }
body.ofogh-embedded .ofogh-main { padding: 12px 14px 20px; }
.win-bar { position: fixed; top: var(--tb-space); right: var(--sb-space); left: var(--tools-w); height: var(--winbar-h); z-index: 1020; display: flex; align-items: flex-end; gap: 3px; padding: 0 8px; background: #d5deea; border-bottom: 1px solid #b7c4d6; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.win-bar[hidden] { display: none; }
body.no-tools .win-bar, body.no-tools .win-layer { left: 0; }
body.has-windows #deskPage { padding-top: calc(var(--winbar-h) + 4px); }
body.desk-covered { overflow: hidden; }
.win-layer { position: fixed; top: calc(var(--tb-space) + var(--winbar-h)); bottom: var(--statusbar-h); right: var(--sb-space); left: var(--tools-w); z-index: 1010; pointer-events: none; }
.win-layer > .ow { pointer-events: auto; }
.wb-tab { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; max-width: 230px; height: 30px; padding: 0 10px; border-radius: 7px 7px 0 0; background: #bfcbdc; color: #1f2a3a; font-size: .8rem; cursor: pointer; white-space: nowrap; border: 1px solid #aebdd2; border-bottom: 0; user-select: none; }
.wb-tab:hover { background: #cfd9e7; }
.wb-tab.active { background: #fff; font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); }
.wb-tab.min { opacity: .7; }
.wb-tab.min .wb-t { font-style: italic; }
.wb-tab.drop { outline: 2px dashed var(--accent); }
.wb-tab > i { color: var(--accent); }
.wb-t { overflow: hidden; text-overflow: ellipsis; }
.wb-x { border: 0; background: transparent; padding: 0 2px; line-height: 1; color: #64748b; font-size: 1rem; }
.wb-x:hover { color: #dc2626; }
.wb-tools { margin-inline-start: auto; display: flex; gap: 2px; align-self: center; position: sticky; left: 0; background: #d5deea; padding-inline-start: 6px; }
.wb-tools button { border: 0; background: transparent; width: 28px; height: 26px; border-radius: 5px; color: #334155; }
.wb-tools button:hover { background: #fff; }
.ow { position: absolute; background: #fff; border: 1px solid #9fb0c7; border-radius: 8px; box-shadow: 0 12px 34px rgba(15,42,78,.28); display: flex; flex-direction: column; overflow: hidden; min-width: 320px; min-height: 200px; }
.ow.is-max { inset: 0; border-radius: 0; border: 0; box-shadow: none; }
.ow.is-min { display: none; }
.ow-head { height: 32px; flex: 0 0 32px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: linear-gradient(90deg, var(--navy), var(--navy-2)); color: #fff; font-size: .82rem; cursor: move; user-select: none; touch-action: none; }
.ow.is-max .ow-head { cursor: default; height: 28px; flex-basis: 28px; }
.ow:not(.is-active) .ow-head { background: #7d8da5; }
.ow-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ow-btns { display: flex; gap: 1px; }
.ow-btns button { background: transparent; border: 0; color: #fff; width: 28px; height: 24px; border-radius: 4px; line-height: 1; }
.ow-btns button:hover { background: rgba(255,255,255,.2); }
.ow-btns .ow-close:hover { background: #dc2626; }
.ow-body { flex: 1; position: relative; }
.ow-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); }
.ow-loading { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); }
.ow-loading[hidden] { display: none; }
.ow-grip { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 55%, #94a3b8 55%, #94a3b8 62%, transparent 62%, transparent 72%, #94a3b8 72%, #94a3b8 79%, transparent 79%); touch-action: none; }
.ow.is-max .ow-grip { display: none; }
.win-layer.dragging .ow-frame { pointer-events: none; }
.wb-menu { position: fixed; z-index: 2000; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 4px 0; min-width: 210px; font-size: .82rem; }
.wb-menu button { display: block; width: 100%; text-align: right; border: 0; background: transparent; padding: 6px 12px; }
.wb-menu button:hover { background: #eef2f7; }
.wb-menu hr { margin: 4px 0; }
.shell-toasts { position: fixed; top: calc(var(--tb-space) + var(--winbar-h) + 10px); left: calc(var(--tools-w) + 14px); z-index: 2100; width: 360px; max-width: 80vw; }
.shell-toasts .alert { transition: opacity .4s; }
@media (max-width: 991.98px) { .win-bar, .win-layer { right: 0; left: 0; } } /* پنجره‌ها پس از کوچک‌شدن مرورگر هم دیده شوند */

/* ===== گرید یکدست (ofogh-grid.js / Tabulator) ===== */
.og-host { background: var(--card); }
.og-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); background: #f7f9fc; }
.og-toolbar .btn { font-size: .78rem; }
.og-sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.og-search { position: relative; min-width: 220px; flex: 0 1 280px; }
.og-search i { position: absolute; top: 50%; transform: translateY(-50%); right: 9px; color: var(--muted); font-size: .8rem; }
.og-search input { padding-right: 28px; }
.og-toolbar.og-light { border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; }
.og-colmenu { max-height: 360px; overflow-y: auto; min-width: 220px; }
.og-host .tabulator { border: 0; font-size: .82rem; background: var(--card); }
.og-host .tabulator .tabulator-header { background: #eef2f7; border-bottom: 1px solid var(--line); }
.og-host .tabulator .tabulator-header .tabulator-col { background: #eef2f7; }
.og-host .tabulator .tabulator-col-title { font-weight: 700; color: #334155; white-space: normal; }
/* عنوان ستون کامل دیده شود: شکستن در دو سطر، فاصلهٔ کمتر، فلش و منو جای کمتری بگیرند */
.og-host .tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 6px 6px; display: flex; flex-direction: column; flex: 1; }
.og-host .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-filter { margin-top: auto; padding-top: 4px; }
.og-host .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title { white-space: normal; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.35; }
.og-host .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button { padding: 0 3px; }
.og-host .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder { display: flex; align-items: center; }
.og-host .tabulator .tabulator-header-filter input { font-size: .74rem; padding: 2px 6px; border: 1px solid #cfd8e3; border-radius: 5px; height: 26px; }
.og-host .tabulator-row { min-height: 34px; }
.og-host .tabulator-row .tabulator-cell { padding: 6px 8px; border-left: 0; }
.og-host .tabulator-row.tabulator-row-even { background: #fafbfd; }
.og-host .tabulator-row.tabulator-selected { background: #dbe8ff !important; }
.og-host .tabulator-row.tabulator-selectable:hover { background: #eef4ff; cursor: pointer; }
.og-host .tabulator-cell.og-num { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
.og-host .tabulator-cell.og-actions { overflow: visible; white-space: nowrap; }
.og-host .tabulator-cell .btn { padding: 1px 6px; font-size: .75rem; }
.og-host .tabulator-cell form { display: inline; }
.og-host .tabulator .tabulator-footer { background: #f7f9fc; border-top: 1px solid var(--line); font-size: .78rem; }
.og-host .tabulator .tabulator-calcs-bottom .tabulator-cell { font-weight: 700; background: #e3e9f2; text-align: left; direction: ltr; }
.og-host .tabulator-row.text-muted .tabulator-cell { color: #94a3b8; }
.og-host .tabulator-row.table-warning { background: #fff7d6; }
.og-host .tabulator-row.table-primary { background: #e7efff; }
.og-toasts { position: fixed; top: 12px; left: 14px; z-index: 2100; width: 340px; max-width: 80vw; }
.og-toasts .alert { transition: opacity .4s; }
/* دیالوگ افزودن/ویرایش */
.og-dialog .modal-dialog { max-width: min(1100px, 94vw); }
.og-dialog .modal-dialog.og-dlg-big { max-width: 97vw; }
.og-dialog .modal-content { border-radius: 10px; overflow: hidden; }
.og-dialog .modal-header { background: linear-gradient(90deg, var(--navy), var(--navy-2)); color: #fff; }
.og-dialog .modal-header .btn-close { filter: invert(1); }
.og-dialog-frame { width: 100%; height: 74vh; border: 0; display: block; background: var(--bg); }
.og-dlg-big .og-dialog-frame { height: 86vh; }
.og-dlg-loading { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); }
.og-dlg-loading[hidden] { display: none; }
html.in-dialog .page-head .btn, html.in-dialog .form-ribbon > a.btn-outline-secondary, html.in-dialog .form-ribbon > a.btn-success { display: none; }
html.in-dialog .ofogh-main { padding: 10px 12px; }
@media print { .og-toolbar, .tabulator-header-filter { display: none !important; } }
/* گرید حرفه‌ای: فشرده، تمام‌صفحه، گروه‌بندی، شماره ردیف */
.og-hidden-filter { display: none !important; }
.og-host.og-dense .tabulator-row .tabulator-cell { padding: 3px 6px; }
.og-host.og-dense .tabulator-row { min-height: 26px; }
.og-host.og-nofilter .tabulator-header-filter { display: none; }
.og-host.og-full { position: fixed; inset: 0; z-index: 1080; display: flex; flex-direction: column; background: #fff; }
.og-host.og-full > div:last-child { flex: 1; min-height: 0; }
.og-host.og-full .tabulator { height: 100% !important; max-height: none !important; }
.og-host .tabulator-cell.og-rownum, .og-host .tabulator-col.og-rownum { color: #94a3b8; font-size: .72rem; background: #f8fafc; }
.og-host .tabulator-row.tabulator-group { background: #e8eef7; border-bottom: 1px solid #c9d4e3; font-weight: 600; padding: 5px 10px; }
.og-host .tabulator-row.tabulator-group .og-gtitle { color: var(--navy); }
.og-host .og-gsum { margin-inline-start: 14px; font-weight: 500; color: #475569; font-size: .76rem; }
.og-group { cursor: default; }
.og-group .bi-x-lg { cursor: pointer; font-size: .65rem; }
.og-host .tabulator .tabulator-col .tabulator-header-popup-button { opacity: .45; padding: 0 4px; }
.og-host .tabulator .tabulator-col:hover .tabulator-header-popup-button { opacity: 1; }
.tabulator-menu { direction: rtl; font-family: 'Vazirmatn', Tahoma, sans-serif; font-size: .8rem; border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.tabulator-menu .tabulator-menu-item { padding: 6px 14px; }
.tabulator-popup-container { direction: rtl; }

/* ===== Pin / Unpin منوی بالا و منوی راست (مثل پنل‌های Auto-Hide ویژوال‌استودیو/راهکاران) ===== */
.sb-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #f1f5fa; border-bottom: 1px solid var(--line); font-size: .78rem; font-weight: 700; color: var(--muted); }
.pin-btn { border: 0; background: transparent; color: inherit; width: 28px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.sb-head .pin-btn { margin-inline-start: auto; color: var(--muted); }
.sb-head .pin-btn:hover { background: #e2e8f0; color: var(--accent); }
.fs-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.fs-btn[hidden] { display: none; }
.ofogh-topbar .pin-btn, .ofogh-topbar .fs-btn { color: #cfe0f5; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); height: 32px; width: 32px; border-radius: 9px; }
.ofogh-topbar .pin-btn:hover, .ofogh-topbar .fs-btn:hover { color: #fff; background: rgba(255,255,255,.18); }
.pin-rail { display: none; }
@media (max-width: 991.98px) { .pin-btn { display: none !important; } }
@media (min-width: 992px) {
  body.tb-unpin { --tb-space: 10px; padding-top: 10px; }
  body.sb-unpin { --sb-space: 18px; }
  .pin-rail { position: fixed; z-index: 1045; align-items: center; justify-content: center; cursor: pointer; color: #fff; user-select: none; }
  body.tb-unpin .pin-rail.top { display: flex; top: 0; left: 0; right: 0; height: 10px; background: linear-gradient(90deg, var(--navy), var(--navy-2)); font-size: 10px; }
  body.tb-unpin .pin-rail.top span { background: var(--navy-2); padding: 0 14px 2px; border-radius: 0 0 8px 8px; line-height: 12px; height: 14px; margin-top: 4px; }
  body.sb-unpin .pin-rail.side { display: flex; flex-direction: column; gap: 8px; top: var(--tb-space); bottom: var(--statusbar-h); right: 0; width: 18px; background: #dbe4f0; border-inline-end: 1px solid #b7c4d6; color: #334155; font-size: .72rem; font-weight: 700; }
  body.sb-unpin .pin-rail.side span { writing-mode: vertical-rl; letter-spacing: .5px; }
  body.sb-unpin .pin-rail.side:hover, body.tb-unpin .pin-rail.top:hover { filter: brightness(1.08); }
  body.tb-unpin .ofogh-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1060; transform: translateY(-100%); transition: transform .18s ease; }
  body.tb-unpin.tb-peek .ofogh-topbar { transform: none; box-shadow: 0 6px 22px rgba(0,0,0,.28); }
  body.sb-unpin .ofogh-sidebar { position: fixed; right: 0; top: var(--tb-space); bottom: var(--statusbar-h); height: auto; z-index: 1055; transform: translateX(100%); transition: transform .18s ease; }
  body.sb-unpin.sb-peek .ofogh-sidebar { transform: none; box-shadow: -8px 0 24px rgba(0,0,0,.2); }
  body.sb-unpin .ofogh-main { padding-inline-start: 36px; }
}

/* ===== پیوست‌های سند ===== */
.va-drop { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; margin: 0 0 10px; border: 1.5px dashed #b7c4d6; border-radius: 10px; background: #f8fafc; color: #475569; font-size: .84rem; cursor: pointer; text-align: center; transition: .15s; }
.va-drop .bi { font-size: 1.4rem; color: var(--accent); }
.va-drop:hover, .va-drop.over { border-color: var(--accent); background: #eef4ff; }
.va-up { display: flex; align-items: center; gap: 8px; font-size: .78rem; margin-bottom: 6px; }
.va-up-name { flex: 0 1 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-up .progress { flex: 1; height: 8px; }
.va-up-err { color: #b91c1c; }
.va-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.va-item { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; min-width: 0; }
.va-thumb { display: flex; align-items: center; justify-content: center; width: 100%; height: 92px; padding: 0; border: 0; border-radius: 7px; background: #f1f5f9; overflow: hidden; cursor: pointer; }
.va-thumb img { width: 100%; height: 100%; object-fit: cover; }
.va-thumb .bi { font-size: 2.2rem; }
.va-name { font-size: .8rem; font-weight: 700; margin-top: 5px; }
.va-file { font-size: .72rem; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-meta { font-size: .68rem; color: var(--muted); }
.va-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.va-actions .btn { padding: 1px 6px; font-size: .72rem; }
.va-view { width: min(1100px, 94vw); height: 90vh; padding: 0; border: 0; border-radius: 12px; overflow: hidden; }
.va-view[open] { display: flex; flex-direction: column; }
.va-view::backdrop { background: rgba(15,23,42,.6); }
.va-view-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #f1f5fa; border-bottom: 1px solid var(--line); }
.va-view-name { flex: 1; min-width: 0; font-size: .84rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-view-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #334155; }
.va-view-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.va-view-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* ===== نشانگر ارتباط با سرور (busy.js) ===== */
.busy-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .15s; }
.busy-bar.on { opacity: 1; }
.busy-bar::before { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--accent); border-radius: 3px; animation: busy-slide 1.1s ease-in-out infinite; }
@keyframes busy-slide { from { right: -40%; } to { right: 100%; } }
.busy-pill { position: fixed; top: 12px; left: 50%; transform: translate(-50%, -8px); z-index: 3000; display: flex; align-items: center; gap: 8px; max-width: 92vw; padding: 7px 16px; border-radius: 22px; background: var(--navy); color: #fff; font-size: .84rem; box-shadow: 0 6px 20px rgba(15,23,42,.3); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.busy-pill.on { opacity: 1; transform: translate(-50%, 0); }
button.is-busy, input.is-busy { cursor: progress; }
button.is-busy > .bi { display: none; }
.busy-spin { margin-inline-end: 5px; vertical-align: -2px; }
@media (prefers-reduced-motion: reduce) { .busy-bar::before { animation: none; width: 100%; } }

/* جعبهٔ خطای فرم وقتی خطایی نیست نشان داده نشود */
.validation-summary-valid { display: none !important; }

/* ===== میانبرها (shortcuts.js) ===== */
.status-keys { border: 0; background: transparent; color: #3b4a5f; font-size: .78rem; padding: 0 6px; border-radius: 5px; }
.status-keys:hover { background: rgba(37,99,235,.12); color: var(--accent); }
.keys-help { width: min(620px, 92vw); max-height: 86vh; padding: 14px 18px; border: 0; border-radius: 12px; overflow-y: auto; box-shadow: 0 18px 50px rgba(15,23,42,.35); }
.keys-help::backdrop { background: rgba(15,23,42,.45); }
.keys-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.keys-help h6 { margin: 12px 0 6px; font-size: .82rem; color: var(--muted); }
.keys-grid { display: grid; grid-template-columns: max-content 1fr; gap: 5px 12px; align-items: center; font-size: .84rem; }
.keys-grid kbd, #voucherForm kbd { background: #eef2f7; color: #334155; border: 1px solid #cbd5e1; border-radius: 5px; font-size: .74rem; padding: 1px 6px; direction: ltr; white-space: nowrap; }

/* ===== تاریخچهٔ سند ===== */
.vh-item { border-inline-start: 3px solid #94a3b8; padding: 4px 10px; margin-bottom: 8px; font-size: .8rem; }
.vh-created { border-inline-start-color: #16a34a; }
.vh-edited { border-inline-start-color: var(--accent); }
.vh-statuschanged { border-inline-start-color: #7c3aed; }
.vh-deleted { border-inline-start-color: #dc2626; }
.vh-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vh-changes { margin-top: 3px; color: #475569; white-space: pre-line; overflow-wrap: anywhere; }

/* ===== تقویم شمسی (pdate.js) ===== */
.pdate-wrap { position: relative; display: block; }
.pdate-wrap > input { padding-inline-end: 30px; }
.pdate-btn { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 4px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #64748b; font-size: .82rem; }
.pdate-btn:hover { background: #eef4ff; color: var(--accent); }
.pdp { position: fixed; z-index: 3100; width: 248px; padding: 8px; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.2); font-size: .8rem; direction: rtl; user-select: none; }
.pdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pdp-head button, .pdp-foot button { border: 0; background: #f1f5f9; border-radius: 6px; padding: 2px 10px; font-size: .9rem; }
.pdp-head button:hover, .pdp-foot button:hover { background: #e2e8f0; }
.pdp-week, .pdp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.pdp-week span { color: #94a3b8; font-size: .72rem; padding: 2px 0; }
.pdp-days button { border: 0; background: transparent; border-radius: 6px; padding: 5px 0; font-size: .8rem; }
.pdp-days button:hover { background: #eef4ff; }
.pdp-days button.fri { color: #dc2626; }
.pdp-days button.today { box-shadow: inset 0 0 0 1px var(--accent); }
.pdp-days button.sel { background: var(--accent); color: #fff; }
.pdp-foot { display: flex; justify-content: center; margin-top: 6px; }
