@font-face { font-family: Vazirmatn; font-weight: 400; font-display: swap; src: url(/fonts/Vazirmatn-Regular.woff2) format("woff2"), url("vendor/fonts/Vazirmatn-Regular.cdc140628f11.woff2") format('woff2'); }
@font-face { font-family: Vazirmatn; font-weight: 500; font-display: swap; src: url(/fonts/Vazirmatn-Medium.woff2) format("woff2"), url("vendor/fonts/Vazirmatn-Medium.dd2193b32cbe.woff2") format('woff2'); }
@font-face { font-family: Vazirmatn; font-weight: 700; font-display: swap; src: url(/fonts/Vazirmatn-Bold.woff2) format("woff2"), url("vendor/fonts/Vazirmatn-Bold.7958481fe611.woff2") format('woff2'); }

:root {
  --brand: #1d5c56;
  --brand-2: #2a8a7f;
  --brand-soft: #e6f2f0;
  --bg: #f4f6f8;
  --card-border: #e2e8ec;
  --muted: #687684;
  --bs-body-font-family: Vazirmatn, Tahoma, sans-serif;
  --bs-primary: #1d5c56;
  --bs-primary-rgb: 29, 92, 86;
  --bs-link-color: #1d5c56;
  --bs-link-color-rgb: 29, 92, 86;
  --bs-link-hover-color: #2a8a7f;
}

body { background: var(--bg); font-family: var(--bs-body-font-family); font-size: .92rem; }
input, select, textarea, button, .btn, .form-control { font-family: inherit !important; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-2); --bs-btn-hover-border-color: var(--brand-2); --bs-btn-active-bg: #154540; --bs-btn-disabled-bg: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

.navbar-hr { background: var(--brand); }
.navbar-hr .navbar-brand { font-weight: 700; letter-spacing: -.2px; }
.navbar-hr .nav-link { color: rgba(255,255,255,.82); border-radius: .4rem; padding: .4rem .75rem !important; }
.navbar-hr .nav-link:hover, .navbar-hr .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.25rem 0 1rem; }
.page-head h1 { font-size: 1.3rem; font-weight: 700; margin: 0; }
.page-head .sub { color: var(--muted); font-size: .85rem; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: .2rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }

.card { border-color: var(--card-border); border-radius: .7rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom-color: var(--card-border); font-weight: 700; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.card-header .small { font-weight: 400; }

.stat { padding: 1rem 1.1rem; display: block; color: inherit; text-decoration: none; height: 100%; }
a.stat:hover { background: #fafcfc; }
.stat .label { color: var(--muted); font-size: .8rem; }
.stat .value { font-size: 1.45rem; font-weight: 700; margin-top: .15rem; }
.stat.warn .value { color: #b54708; }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .6rem .75rem; vertical-align: middle; }
.table thead th { color: var(--muted); font-weight: 500; font-size: .8rem; background: #f8fafb; white-space: nowrap; }
tr.row-link { cursor: pointer; }

.badge { font-weight: 500; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.kv dt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.kv dd { margin-bottom: .65rem; }
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .3rem; }
.form-text { font-size: .78rem; }
.errorlist { list-style: none; padding: 0; margin: .25rem 0 0; color: #b42318; font-size: .8rem; }
.section-title { font-weight: 700; font-size: .95rem; color: var(--brand); margin: .25rem 0 .75rem; }
.nav-tabs .nav-link { color: var(--muted); }
.nav-tabs .nav-link.active { color: var(--brand); font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 1.5rem 1rem; }

/* people */
.avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex: none; }
.avatar.lg { width: 3.6rem; height: 3.6rem; font-size: 1.15rem; }
.person { display: inline-flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; }
a.person:hover { color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--card-border); background: #fff; border-radius: 99px; padding: .15rem .65rem; font-size: .8rem; color: inherit; text-decoration: none; }
a.chip:hover { border-color: var(--brand-2); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }

/* department tree */
.tree-row td:nth-child(2) { padding-inline-start: calc(.75rem + var(--depth, 0) * 1.4rem); }
.dept-code { font-family: Vazirmatn, monospace; background: var(--brand-soft); color: var(--brand); border-radius: .3rem; padding: .05rem .45rem; font-weight: 700; font-size: .8rem; }
.tree-row .branch { color: #b8c4cc; margin-inline-end: .3rem; }

/* org chart: nested lists drawn as a top-down tree */
.chart-wrap { overflow: auto; padding: 1rem 0 2rem; background: #fff; border: 1px solid var(--card-border); border-radius: .7rem; }
.orgchart, .orgchart ul { display: flex; justify-content: center; padding: 0; margin: 0; list-style: none; position: relative; }
.orgchart ul { padding-top: 1.2rem; }
.orgchart li { position: relative; padding: 1.2rem .4rem 0; display: flex; flex-direction: column; align-items: center; }
.orgchart > li { padding-top: 0; }
/* ::before is the left half of the connector, ::after the right half; in RTL the first child is the rightmost */
.orgchart li::before, .orgchart li::after { content: ''; position: absolute; top: 0; height: 1.2rem; width: 50%; border-top: 2px solid #cfd8dd; }
.orgchart li::before { right: 50%; }
.orgchart li::after { left: 50%; border-left: 2px solid #cfd8dd; }
.orgchart li:first-child::after { border: 0; }
.orgchart li:first-child::before { border-right: 2px solid #cfd8dd; border-radius: 0 .45rem 0 0; }
.orgchart li:last-child::before { border-top: 0; }
.orgchart li:last-child::after { border-radius: .45rem 0 0 0; }
.orgchart li:only-child::before { border: 0; }
.orgchart li:only-child::after { border-top: 0; border-left: 2px solid #cfd8dd; border-radius: 0; }
.orgchart > li::before, .orgchart > li::after { display: none; }
.orgchart ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 1.2rem; border-left: 2px solid #cfd8dd; }
.org-node { min-width: 11rem; max-width: 14rem; background: #fff; border: 1px solid var(--card-border); border-top: 3px solid var(--brand-2); border-radius: .55rem; padding: .5rem .65rem; text-align: center; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.org-node .title { font-weight: 700; font-size: .85rem; color: var(--brand); text-decoration: none; display: block; }
.org-node .dept { font-size: .7rem; color: var(--muted); }
.org-node .who { font-size: .8rem; margin-top: .3rem; display: flex; flex-direction: column; gap: .1rem; }
.org-node .who a { color: inherit; text-decoration: none; }
.org-node .who a:hover { color: var(--brand); }
.org-node .vacant { color: #b54708; font-size: .75rem; }
.org-node.lvl-executive { border-top-color: #7c3aed; }
.org-node.lvl-manager { border-top-color: var(--brand); }
.org-node.no-jd { background: #fffdf5; }

/* job description document */
.jd-doc { background: #fff; border: 1px solid var(--card-border); border-radius: .7rem; padding: 1.75rem 2rem; }
.jd-doc h2 { font-size: 1rem; font-weight: 700; color: var(--brand); border-bottom: 1px solid var(--card-border); padding-bottom: .35rem; margin: 1.5rem 0 .75rem; }
.jd-doc h2:first-of-type { margin-top: .5rem; }
.jd-doc .prose { white-space: pre-wrap; }
.jd-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem 1rem; background: #f8fafb; border-radius: .5rem; padding: .8rem 1rem; }
.jd-head .k { color: var(--muted); font-size: .75rem; }
.jd-head .v { font-weight: 500; }
.duty-list { counter-reset: duty; list-style: none; padding: 0; margin: 0; }
.duty-list li { counter-increment: duty; position: relative; padding: .45rem 2rem .45rem 0; border-bottom: 1px dashed var(--card-border); }
.duty-list li::before { content: counter(duty, persian); position: absolute; right: 0; top: .45rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.level-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.level-dots i { width: .55rem; height: .55rem; border-radius: 50%; background: #dbe3e7; }
.level-dots i.on { background: var(--brand-2); }
.sign-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2.5rem; text-align: center; font-size: .85rem; }
.sign-row div { border-top: 1px solid #aab; padding-top: .4rem; min-height: 4rem; }
.diff-add { color: #067647; }
.diff-del { color: #b42318; text-decoration: line-through; }

/* job description editor */
.line-table td { vertical-align: top; }
.line-table textarea { min-height: 2.4rem; }
.line-table .del-cell { width: 3rem; text-align: center; }
.line-table tr.removed { display: none; }
.move-btns { display: flex; flex-direction: column; gap: 2px; }
.move-btns button { border: 0; background: none; line-height: 1; padding: 0 .2rem; color: var(--muted); font-size: .75rem; }
.move-btns button:hover { color: var(--brand); }
.sticky-actions { position: sticky; bottom: 0; background: rgba(244,246,248,.95); backdrop-filter: blur(4px); border-top: 1px solid var(--card-border); padding: .75rem 0; margin-top: 1rem; z-index: 5; }

/* access matrix */
.matrix-wrap { overflow: auto; max-height: 75vh; }
.matrix th, .matrix td { white-space: nowrap; }
.matrix thead th { position: sticky; top: 0; z-index: 2; }
.matrix thead tr:nth-child(2) th { top: 2.3rem; }
.matrix .pos-col { position: sticky; inset-inline-start: 0; background: #fff; z-index: 1; min-width: 14rem; }
.matrix thead .pos-col { z-index: 3; background: #f8fafb; }
.matrix .role-head { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 11rem; font-size: .78rem; text-align: start; padding: .5rem .3rem; }
.matrix .sys-head { text-align: center; background: var(--brand-soft) !important; color: var(--brand); font-weight: 700; border-inline: 2px solid #fff; }
.matrix td.cell { text-align: center; width: 2.4rem; padding: .35rem !important; }
.cell-on { --bs-table-bg: var(--brand-soft); background: var(--brand-soft); color: var(--brand) !important; font-weight: 700; }
.cell-adding { --bs-table-bg: #ecfdf3; background: #ecfdf3; color: #067647 !important; font-weight: 700; }
.cell-removing { --bs-table-bg: #fef3f2; background: #fef3f2; color: #b42318 !important; text-decoration: line-through; }
.matrix .pos-col { max-width: 18rem; white-space: normal; }
.sensitive-dot { color: #b54708; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--muted); }
.legend span b { display: inline-block; min-width: 1.6rem; text-align: center; border-radius: .25rem; margin-inline-end: .25rem; }

.access-sys { border: 1px solid var(--card-border); border-radius: .55rem; padding: .6rem .8rem; margin-bottom: .6rem; }
.access-sys .sys-name { font-weight: 700; color: var(--brand); margin-bottom: .35rem; }
.access-role { display: flex; justify-content: space-between; gap: .5rem; padding: .25rem 0; border-top: 1px dashed var(--card-border); font-size: .85rem; }
.access-role:first-of-type { border-top: 0; }
.access-role .src { color: var(--muted); font-size: .75rem; }

.bell-badge { position: absolute; top: 0; inset-inline-start: 0; font-size: .6rem; }
.request-tile { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.request-tile:hover { border-color: var(--brand-2); box-shadow: 0 2px 10px rgba(16,24,40,.07); color: inherit; }
.occasions { display: flex; flex-wrap: wrap; gap: .4rem; }
.occasions .chip { background: #fff7ed; border-color: #fed7aa; }

.sig-pad-wrap { position: relative; max-width: 32rem; }
.sig-pad { width: 100%; height: 11rem; border: 2px dashed #b8c4cc; border-radius: .5rem; background: #fff; touch-action: none; cursor: crosshair; }
.sig-pad-wrap .btn { position: absolute; top: .25rem; inset-inline-start: .25rem; }
.sig-img { max-height: 3.6rem; max-width: 100%; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem; }
.settings-icon { flex: none; width: 2.5rem; height: 2.5rem; border-radius: .6rem; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.05rem; }

/* numbered process steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .5rem 1rem; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-inline-start: 2.1rem; font-size: .82rem; }
.steps li::before { content: counter(step, persian); position: absolute; inset-inline-start: 0; top: .1rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps li b { display: block; color: var(--brand); }
.steps li span { color: var(--muted); }

/* role checkbox grids (job description, department, person) */
.role-grid { display: flex; flex-direction: column; gap: .75rem; }
.role-sys { border: 1px solid var(--card-border); border-radius: .55rem; padding: .5rem .75rem .7rem; margin: 0; }
.role-sys legend { float: none; width: auto; font-size: .85rem; font-weight: 700; color: var(--brand); padding: 0 .35rem; margin: 0; }
.role-options { display: flex; flex-wrap: wrap; gap: .4rem; }
.role-opt { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--card-border); border-radius: 99px; padding: .3rem .8rem; cursor: pointer; background: #fff; font-size: .85rem; margin: 0; }
.role-opt input { accent-color: var(--brand); }
.role-opt.on { background: var(--brand-soft); border-color: #a9d3cc; color: var(--brand); font-weight: 500; }
.role-opt .role-src { color: var(--muted); font-size: .7rem; }
.role-sys[disabled] .role-opt { cursor: default; opacity: .85; }

/* reports: single-hue magnitude bars (data ends rounded, recessive track) */
.hbars { display: flex; flex-direction: column; gap: .45rem; }
.hbar { display: grid; grid-template-columns: minmax(6rem, 30%) 1fr auto; gap: .6rem; align-items: center; font-size: .85rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: .7rem; background: #eef2f4; border-radius: 4px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--brand-2); border-radius: 4px; }
.hbar:hover .hbar-fill { background: var(--brand); }
.hbar-value { min-width: 3rem; text-align: end; color: var(--bs-body-color); }
.mini-bar { display: inline-block; vertical-align: middle; width: 7rem; height: .55rem; background: #eef2f4; border-radius: 4px; overflow: hidden; }
.mini-bar > span { display: block; height: 100%; background: var(--brand-2); border-radius: 4px; }
.mini-bar.out > span { background: #94a3b8; }

/* appraisal questionnaire */
.q-scale-head { grid-template-columns: 1fr repeat(6, 4.2rem); gap: .25rem; padding: .6rem 1rem; background: #f8fafb; border-bottom: 1px solid var(--card-border); font-size: .72rem; color: var(--muted); text-align: center; position: sticky; top: 0; z-index: 2; }
.q-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--card-border); }
.q-row:last-child { border-bottom: 0; }
.q-row.unanswered .q-num { background: #fff4e5; color: #b54708; }
.q-text { display: flex; gap: .6rem; align-items: baseline; line-height: 1.8; }
.q-num { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; }
.q-options { display: grid; grid-template-columns: repeat(6, 4.2rem); gap: .25rem; }
.q-opt { display: flex; flex-direction: column; align-items: center; cursor: pointer; margin: 0; }
.q-opt input { position: absolute; opacity: 0; pointer-events: none; }
.q-opt span { width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 2px solid #cfd8dd; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); transition: all .12s; }
.q-opt:hover span { border-color: var(--brand-2); }
.q-opt input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.q-opt.na input:checked + span { background: #94a3b8; border-color: #94a3b8; }
.q-opt input:focus-visible + span { outline: 3px solid rgba(42,138,127,.35); }
@media (max-width: 767.98px) {
  .q-row { grid-template-columns: 1fr; }
  .q-options { grid-template-columns: repeat(6, 1fr); }
  .q-opt small { font-size: .62rem; color: var(--muted); margin-top: .15rem; text-align: center; }
}
.comp-row { padding: .55rem 0; border-bottom: 1px dashed var(--card-border); }
.comp-row:last-child { border-bottom: 0; }

/* recruitment pipeline */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(11rem, 1fr)); gap: .6rem; overflow-x: auto; padding-bottom: .5rem; }
.pipe-col { background: #eef2f4; border-radius: .6rem; padding: .5rem; min-height: 8rem; }
.pipe-head { font-weight: 700; font-size: .82rem; color: var(--brand); display: flex; justify-content: space-between; margin-bottom: .45rem; }
.pipe-card { display: block; background: #fff; border: 1px solid var(--card-border); border-radius: .45rem; padding: .45rem .6rem; margin-bottom: .4rem; text-decoration: none; color: inherit; }
.pipe-card:hover { border-color: var(--brand-2); color: inherit; }

/* clock and timesheet */
.clock-card { border-inline-start: 4px solid var(--brand-2); min-height: calc(100% - 1rem); }
.clock-now { font-size: 2rem; font-weight: 700; color: var(--brand); line-height: 1.1; }
.sheet tr.off td { background: #f8fafb; color: var(--muted); }
.sheet tr.future td { opacity: .55; }
.sheet .tm { display: inline-block; background: var(--brand-soft); border-radius: .3rem; padding: 0 .35rem; margin: 1px 0; }
.sheet .tm.open { background: #fff4e5; }

/* leave calendar */
.leave-cal th, .leave-cal td { padding: .25rem !important; text-align: center; font-size: .75rem; min-width: 1.7rem; }
.leave-cal th div { color: var(--muted); font-weight: 400; }
.leave-cal .off { background: #f1f5f7 !important; }
.leave-cal .pos-col { text-align: start; font-size: .82rem; }
.lv { display: block; height: 1.1rem; border-radius: .25rem; }
.lv.pending { opacity: .45; background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,.6) 4px 8px) !important; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }

@media (max-width: 575.98px) {
  .jd-doc { padding: 1rem; }
  .sign-row { grid-template-columns: 1fr; }
}

@media print {
  .navbar, .no-print, .messages { display: none !important; }
  body { background: #fff; font-size: 10.5pt; }
  .jd-doc { border: 0; padding: 0; }
  .card { border: none; box-shadow: none; }
  main { padding: 0 !important; }
  @page { size: A4; margin: 14mm; }
}
