/* IDC portal — palette taken from the brushed-steel logo */
@font-face {
  font-family: "Vazirmatn";
  src: url("../vendor/vazirmatn/Vazirmatn-wght.f6d31671339d.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --charcoal: #15181B;      /* logo backdrop, edges */
  --charcoal-2: #24272C;
  --charcoal-hi: #3C4045;   /* logo backdrop, lit centre */
  --graphite: #2B2F36;
  --steel: #5A616B;
  --silver: #A9AFB7;
  --silver-light: #DADDE2;
  --silver-faint: #EEF0F3;
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --text: #1F2329;
  --muted: #6B7280;
  --ok: #2E7D4F;   --ok-bg: #E6F2EB;
  --prog: #3E5C76; --prog-bg: #E5ECF2;
  --warn: #B7791F; --warn-bg: #FBF1DF;
  --danger: #B42318; --danger-bg: #FBE9E7;
  --wait: #6B7280; --wait-bg: #F0F1F3;
  --steel-gradient: linear-gradient(90deg, #7D838B 0%, #F2F3F5 50%, #7D838B 100%);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(21, 24, 27, .06), 0 4px 14px rgba(21, 24, 27, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
a { color: var(--prog); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------------------------------------------------------------- header */
.ic { width: 18px; height: 18px; flex-shrink: 0; display: block; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: radial-gradient(ellipse 50% 190% at 50% 0%, #30343A 0%, #1C1F23 52%, #121417 100%);
  color: #fff;
  border-bottom: 1px solid #000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}
.site-header .bar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px 0 14px; height: 68px; max-width: 1800px; margin: 0 auto;
}
.hsep { width: 1px; height: 30px; background: rgba(255, 255, 255, .12); flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; flex-shrink: 0; }
/* transparent PNG: the header colour shows around the letters */
.brand img { height: 48px; width: auto; display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45)); }
.nav { display: flex; gap: 4px; align-items: center; flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.nav a {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 10px; flex-shrink: 0;
  color: #B9BEC6; font-weight: 500; white-space: nowrap; text-decoration: none;
}
.nav a.icon-only { width: 42px; padding: 0; justify-content: center; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .05); text-decoration: none; }
.nav a.active {
  color: #fff; background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10), inset 0 -2px 0 #C9CED5;
}
.nav .nsep { width: 1px; height: 24px; background: rgba(255, 255, 255, .12); margin: 0 8px; flex-shrink: 0; }
.userbox { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.userbox form { margin: 0; }
.hbtn {
  width: 42px; height: 42px; border-radius: 10px; background: transparent; border: 1px solid rgba(255, 255, 255, .12);
  color: #C9CDD3; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.hbtn:hover { color: #fff; border-color: var(--silver); background: rgba(255, 255, 255, .05); }
.userbox .who { text-align: right; line-height: 1.3; }
.userbox .who b { display: block; font-size: 13.5px; font-weight: 700; }
a.who {
  display: flex; align-items: center; gap: 10px; height: 42px; box-sizing: border-box; padding: 0 10px 0 8px;
  color: #fff; text-decoration: none; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
  transition: background .15s, border-color .15s;
}
a.who > .ic { width: 18px; height: 18px; color: var(--silver-light); }
a.who > .ic:last-child { width: 15px; height: 15px; color: var(--silver); transform: rotate(90deg); }
a.who:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .34); text-decoration: none; }
a.who:hover > .ic:last-child { color: #fff; }
.who-text { display: flex; flex-direction: column; }
.userbox .who .position { display: block; font-size: 11px; color: var(--silver); }
.role-badge {
  display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px;
  border: 1px solid #5A616B; color: var(--silver-light);
}
.btn-ghost {
  background: transparent; color: #DADDE2; border: 1px solid #4A5058; border-radius: 8px;
  padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--silver); color: #fff; }
a.btn-ghost { display: inline-block; text-decoration: none; white-space: nowrap; }
.form-grid.one-col { grid-template-columns: minmax(0, 1fr); }

/* ---------------------------------------------------------------- layout */
.page { max-width: 1800px; margin: 0 auto; padding: 20px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 22px; font-weight: 800; }
.ph-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; color: #fff;
  background: linear-gradient(150deg, #3C4045 0%, #15181B 100%); box-shadow: 0 4px 12px rgba(21, 24, 27, .18);
  display: flex; align-items: center; justify-content: center;
}
.ph-icon .ic { width: 22px; height: 22px; }
.ph-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.btn .ic { width: 17px; height: 17px; }
.ch-ic {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; background: var(--bg); color: var(--steel);
  display: flex; align-items: center; justify-content: center;
}
.ch-ic .ic { width: 16px; height: 16px; }
.tone-ok .ch-ic { background: var(--ok-bg); color: var(--ok); }
.tone-warn .ch-ic { background: var(--warn-bg); color: var(--warn); }
.tone-danger .ch-ic { background: var(--danger-bg); color: var(--danger); }
.tone-steel .ch-ic { background: var(--prog-bg); color: var(--prog); }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .spacer { flex: 1; }
.card {
  background: var(--surface); border: 1px solid #E3E6EA;
  border-radius: 14px; box-shadow: 0 1px 2px rgba(21, 24, 27, .04);
}
.card > .card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--silver-faint); font-weight: 700;
}
.card > .card-head .count { margin-inline-start: auto; color: var(--muted); font-weight: 500; font-size: 13px; }
.card > .card-body { padding: 14px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  border-radius: 10px; padding: 9px 16px; border: 1px solid var(--graphite);
  background: var(--graphite); color: #fff; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { background: #1F2329; }
.btn.secondary { background: var(--surface); color: var(--graphite); border-color: var(--silver-light); }
.btn.secondary:hover { border-color: var(--steel); background: var(--silver-faint); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.row-actions form { margin: 0; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--graphite); }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  font: inherit; font-size: 14px; color: var(--text);
  border: 1px solid var(--silver-light); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(62, 92, 118, .25); border-color: var(--prog); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.errorlist { color: var(--danger); margin: 2px 0 0; padding: 0; list-style: none; font-size: 12.5px; font-weight: 500; }

.messages { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 10px 14px; border-radius: 8px; border: 1px solid; font-weight: 500; }
.messages .success { background: var(--ok-bg); border-color: #B9DCC7; color: #1E5C38; }
.messages .error { background: var(--danger-bg); border-color: #F1C2BC; color: #8A1A12; }

/* ---------------------------------------------------------------- status chips */
.chip { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.st-done { background: var(--ok-bg); color: var(--ok); }
.st-prog { background: var(--prog-bg); color: var(--prog); }
.st-block { background: var(--warn-bg); color: var(--warn); }
.st-stop { background: var(--danger-bg); color: var(--danger); }
.st-wait { background: var(--wait-bg); color: var(--wait); }
.pr-crit { background: var(--danger); color: #fff; }
.pr-high { background: var(--danger-bg); color: var(--danger); }
.pr-mid { background: var(--silver-faint); color: var(--steel); }
.pr-low { background: transparent; color: var(--muted); border: 1px solid var(--silver-light); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; }
.dot.red { background: var(--danger); } .dot.amber { background: #E0A43A; } .dot.green { background: var(--ok); }
.up { color: var(--ok); font-weight: 700; } .down { color: var(--danger); font-weight: 700; } .flat { color: var(--muted); }
.late { color: var(--danger); font-weight: 700; }
.pctbar { display: flex; align-items: center; gap: 6px; }
.pctbar .track { flex: 1; height: 7px; background: var(--silver-faint); border-radius: 99px; overflow: hidden; min-width: 34px; }
.pctbar .fill { height: 100%; background: linear-gradient(90deg, var(--steel), var(--prog)); border-radius: 99px; }
.pctbar .v { font-size: 12px; min-width: 34px; direction: ltr; text-align: left; }
/* progress in four bands: red, orange, yellow, green */
.fill.p1 { background: #B42318 !important; } .fill.p2 { background: #D9730D !important; }
.fill.p3 { background: #D4A72C !important; } .fill.p4 { background: #2E7D4F !important; }
.nocell { display: flex; flex-direction: column; justify-content: center; gap: 5px; height: 100%; line-height: 1.2; }
.mini-pct { display: flex; align-items: center; gap: 5px; }
.mini-pct .track { flex: 1; height: 6px; min-width: 36px; background: var(--silver-faint); border-radius: 99px; overflow: hidden; }
.mini-pct .fill { height: 100%; border-radius: 99px; }
.mini-pct span { font-size: 11px; color: var(--steel); direction: ltr; min-width: 28px; text-align: left; }
.clock {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); color: var(--silver);
}
.clock .cl { display: flex; flex-direction: column; line-height: 1.25; }
.clock .t { display: block; font-size: 14px; font-weight: 600; color: #fff; direction: ltr; text-align: right; letter-spacing: .5px; font-feature-settings: "tnum"; }
.clock .d { display: block; font-size: 11px; color: var(--silver); white-space: nowrap; direction: rtl; unicode-bidi: isolate; }
.obs b { color: var(--graphite); }
.obs .chip { margin-inline-start: 6px; font-size: 11.5px; line-height: 18px; }
.obs div { margin-top: 2px; }
.obs-editor {
  width: 360px; background: var(--surface); padding: 14px; border-radius: 10px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25); border: 1px solid var(--silver-light); direction: rtl; font-family: inherit;
}
.obs-editor label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--graphite); }
.obs-editor textarea { resize: vertical; }
.obs-hint { font-size: 12px; color: var(--muted); line-height: 1.7; }
.obs-actions { display: flex; gap: 6px; }

/* ---------------------------------------------------------------- dashboard */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
@media (max-width: 1300px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi {
  --tone: var(--prog); --tint: #E8EEF4; --edge: #C9D6E2;
  position: relative; overflow: hidden; border-radius: 14px; padding: 16px 18px; color: var(--text);
  background: linear-gradient(150deg, var(--tint) 0%, #fff 115%); border: 1px solid var(--edge);
  box-shadow: 0 1px 2px rgba(21, 24, 27, .05);
}
.kpi::after {   /* a soft band of the card's colour along the top */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tone);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .label { font-size: 13.5px; color: var(--tone); font-weight: 700; }
.kpi-ic {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--tone); color: #fff; box-shadow: 0 4px 10px rgba(21, 24, 27, .15);
}
.kpi-ic .ic { width: 20px; height: 20px; }
.kpi .value { font-size: 34px; font-weight: 800; line-height: 1.15; margin-top: 6px; color: var(--text); }
.kpi.k-total { --tone: #3E5C76; --tint: #E3EBF3; --edge: #C6D4E1; }
.kpi.k-open  { --tone: #2C6E78; --tint: #DFF0F1; --edge: #BADCDF; }
.kpi.k-done  { --tone: #2E7D4F; --tint: #E1F1E7; --edge: #BBDCC8; }
.kpi.k-prod  { --tone: #A3661A; --tint: #FBEFD9; --edge: #EDD3A6; }
.kpi.k-insp  { --tone: #5D4C94; --tint: #ECE8F6; --edge: #D3CBEA; }
.kpi.k-issue { --tone: #B42318; --tint: #FBE5E2; --edge: #F1C2BC; }
.kpi.k-issue .value { color: var(--danger); }
.minis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1300px) { .minis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mini { background: var(--surface); border: 1px solid var(--silver-light); border-radius: var(--radius); padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.mini .v { font-size: 22px; font-weight: 800; color: var(--graphite); min-width: 34px; text-align: center; }
.mini .l { font-size: 12.5px; color: var(--steel); line-height: 1.4; }
.mini.alert .v { color: var(--danger); }
.chart-box { position: relative; height: 270px; }
.list-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.list-table th { text-align: right; font-weight: 600; color: var(--steel); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--silver-light); white-space: nowrap; }
.list-table td { padding: 7px 8px; border-bottom: 1px solid var(--silver-faint); vertical-align: top; }
.list-table tr:last-child td { border-bottom: 0; }
.list-table .desc { color: var(--text); max-width: 360px; }
.list-table .muted, .muted { color: var(--muted); }
.empty { color: var(--muted); padding: 14px 4px; text-align: center; font-size: 13px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 8px 0; border-bottom: 1px solid var(--silver-faint); font-size: 13px; line-height: 1.7; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--muted); font-size: 12px; }
.feed .old { color: var(--muted); text-decoration: line-through; }

/* ---------------------------------------------------------------- grid page */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px;
  padding: 10px; background: var(--surface); border: 1px solid #E3E6EA; border-radius: 14px;
}
.search-box { position: relative; display: flex; align-items: center; flex: 0 1 300px; min-width: 220px; }
.search-box .ic { position: absolute; right: 12px; width: 17px; height: 17px; color: #8C939C; pointer-events: none; }
.toolbar .search { width: 100%; height: 40px; padding: 0 38px 0 12px; border-radius: 10px; border-color: #D5D9DF; background: #F7F8FA; font-size: 13.5px; }
.toolbar label .ic { width: 16px; height: 16px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  display: inline-flex; align-items: center; gap: 6px; height: 36px;
  font: inherit; font-size: 13px; border: 1px solid #D5D9DF; background: var(--surface);
  color: var(--charcoal-hi); border-radius: 99px; padding: 0 12px; cursor: pointer;
}
.filters button:hover { border-color: var(--steel); }
.filters .fi { display: flex; color: var(--steel); }
.filters .fi .ic { width: 15px; height: 15px; }
.filters .fi.warn { color: var(--warn); } .filters .fi.danger { color: var(--danger); }
.filters .fi.orange { color: #D9730D; } .filters .fi.steel { color: var(--prog); }
.filters button.on { background: var(--graphite); border-color: var(--graphite); color: #fff; font-weight: 600; }
.filters button.on .fi { color: #fff; }
.grid-wrap { height: calc(100vh - 235px); min-height: 420px; }

/* sort arrows: faint when the column is not sorted, amber when it is */
.ag-theme-quartz.idc .ag-header-cell .ag-sort-indicator-icon .ag-icon { color: #F5B942; font-size: 17px; }
.ag-theme-quartz.idc .ag-header-cell .ag-sort-none-icon .ag-icon { color: #8C939C; font-size: 15px; }
.ag-theme-quartz.idc .ag-header-cell:hover .ag-sort-none-icon .ag-icon { color: #DADDE2; }

.ag-theme-quartz.idc {
  --ag-font-family: "Vazirmatn", Tahoma, sans-serif;
  --ag-font-size: 13px;
  --ag-foreground-color: var(--text);
  --ag-header-background-color: var(--graphite);
  --ag-header-foreground-color: #F2F3F5;
  --ag-header-column-resize-handle-color: #5A616B;
  --ag-border-color: var(--silver-light);
  --ag-row-border-color: var(--silver-faint);
  --ag-odd-row-background-color: #FAFBFC;
  --ag-row-hover-color: #EEF2F6;
  --ag-selected-row-background-color: #E3EAF1;
  --ag-range-selection-border-color: var(--prog);
  --ag-input-focus-border-color: var(--prog);
  --ag-active-color: var(--prog);
  --ag-wrapper-border-radius: var(--radius);
  --ag-cell-horizontal-padding: 10px;
}
.ag-theme-quartz.idc .ag-header-group-cell { background: #1F2329; font-weight: 700; }
.ag-theme-quartz.idc .ag-header-group-cell.grp-alt { background: #343940; }
.ag-theme-quartz.idc .ag-header-cell-label { justify-content: center; text-align: center; }
.ag-theme-quartz.idc .ag-header-cell-text { white-space: normal; line-height: 1.3; }
.ag-theme-quartz.idc .calc-cell { background: #F4F5F7; color: #3A3F46; }
.ag-theme-quartz.idc .ag-header-cell.calc-head { background: #3F454D; }
.ag-theme-quartz.idc .cell-wrap { white-space: normal; line-height: 1.55; padding-top: 6px; padding-bottom: 6px; }
.ag-theme-quartz.idc .stale-date { color: var(--muted); font-style: italic; }
.ag-theme-quartz.idc .ag-cell.flash-ok { animation: flashok 1.2s ease-out; }
@keyframes flashok { from { background: #CFE8D9; } to { background: transparent; } }
.act { display: flex; gap: 4px; justify-content: center; align-items: center; height: 100%; }
.act button {
  width: 28px; height: 28px; padding: 0; border: 1px solid #E3E6EA; background: #fff; border-radius: 8px;
  cursor: pointer; color: var(--steel); display: inline-flex; align-items: center; justify-content: center;
}
.act button svg { width: 15px; height: 15px; }
.act button:hover { border-color: var(--steel); color: var(--text); }
.act button.del { color: var(--danger); border-color: #F1C9C4; background: #FFF6F5; }
.act button.del:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

/* show / hide password (static/js/pwtoggle.js); the field is LTR, so the eye sits at its right end */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 38px !important; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; padding: 0;
}
.pw-toggle:hover { color: var(--text); background: var(--silver-faint); }

/* ---------------------------------------------------------------- modal, drawer, toast */
.overlay { position: fixed; inset: 0; background: rgba(21, 24, 27, .45); z-index: 200; display: none; }
.overlay.open { display: block; }
.modal {
  position: fixed; z-index: 210; top: 8vh; left: 50%; transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px)); max-height: 84vh; overflow: auto;
  background: var(--surface); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); display: none;
}
.modal.open, .drawer.open { display: block; }
.modal .m-head, .drawer .m-head {
  display: flex; align-items: center; padding: 14px 18px; color: #fff;
  background: radial-gradient(ellipse 70% 200% at 50% 0%, var(--charcoal-hi), var(--charcoal));
}
.modal .m-head h3, .drawer .m-head h3 { font-size: 16px; }
.modal .m-head button, .drawer .m-head button { margin-inline-start: auto; }
.modal .m-body { padding: 18px; }
.modal .m-foot { padding: 12px 18px; border-top: 1px solid var(--silver-faint); display: flex; gap: 8px; justify-content: flex-start; }
.drawer {
  position: fixed; z-index: 210; top: 0; bottom: 0; left: 0; width: min(560px, 100vw);
  background: var(--surface); box-shadow: 10px 0 40px rgba(0, 0, 0, .25); display: none; overflow: auto;
}
.drawer .d-body { padding: 16px 18px; }
.drawer h4 { margin: 18px 0 8px; font-size: 14px; color: var(--graphite); }
.toast-box { position: fixed; bottom: 20px; left: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--graphite); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 420px; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------------------------------------------------------------- daily changes */
.summary-box { background: var(--surface); border: 1px solid var(--silver-light); border-inline-start: 4px solid var(--graphite); border-radius: var(--radius); padding: 14px 18px; line-height: 2; margin-bottom: 16px; }
.report-sec .card-head::before { display: none; }
.section-card .card-head::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--steel); }
.section-card.tone-ok .card-head::before { background: var(--ok); }
.section-card.tone-warn .card-head::before { background: var(--warn); }
.section-card.tone-danger .card-head::before { background: var(--danger); }
.section-card.tone-steel .card-head::before { background: var(--prog); }
.date-form { display: flex; gap: 8px; align-items: center; }
.range-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; margin-bottom: 14px; }
.range-bar label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--graphite); font-size: 13.5px; }
.range-bar .date-in { position: relative; display: flex; align-items: center; }
.range-bar .date-in .ic { position: absolute; left: 11px; width: 16px; height: 16px; color: #8C939C; pointer-events: none; }
.range-bar input { width: 140px; height: 40px; text-align: center; direction: ltr; padding: 0 12px 0 34px; border-radius: 10px; border-color: #D5D9DF; background: #F7F8FA; }
.range-bar .presets { display: flex; gap: 4px; flex-wrap: wrap; padding: 3px; border-radius: 10px; background: #F0F1F3; }
.range-bar .preset { font-size: 13px; border-radius: 8px; padding: 6px 14px; color: var(--charcoal-hi); text-decoration: none; }
.range-bar .preset:hover { background: rgba(255, 255, 255, .6); text-decoration: none; }
.range-bar .preset.on { background: #fff; color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(21, 24, 27, .10); }
.range-bar .range-info { margin-inline-start: auto; color: var(--muted); font-size: 12.5px; }
.date-form input { width: 140px; text-align: center; direction: ltr; }

/* ---------------------------------------------------------------- settings lists */
.lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lists .item { display: flex; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--silver-faint); }
.lists .item form { display: flex; gap: 6px; align-items: center; flex: 1; margin: 0; }
.lists .item input { padding: 5px 8px; font-size: 13px; }
.lists .used { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.lists.steps { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); margin-bottom: 26px; }
.lists .item input[type=text] { flex: 1; min-width: 0; }
.lists .btn.icon { padding: 4px 7px; font-size: 10px; line-height: 1.6; }
.lists .step-no { width: 20px; text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.lists .done-tag { color: var(--ok); background: var(--ok-bg); border-radius: 4px; padding: 1px 6px; font-weight: 600; }
.settings-h { font-size: 15px; margin: 6px 0 4px; color: var(--graphite); }
.settings-note { color: var(--muted); font-size: 12.5px; line-height: 1.9; margin: 0 0 12px; }

/* ---------------------------------------------------------------- login */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: flex-end;   /* RTL: flex-end = left */
  padding: 24px clamp(20px, 6vw, 96px); position: relative; isolation: isolate; overflow: hidden;
  background-color: var(--charcoal);
}
/* the platform photo full screen, toned toward the graphite/steel palette.
   .login-photo = the photo, ::after = charcoal veil, ::before = curtain that lifts when the page opens */
.login-body::before, .login-body::after, .login-photo { content: ""; position: fixed; inset: 0; pointer-events: none; }
.login-photo {
  z-index: -2; background: url("../img/login-bg.605d95511ee7.jpg") 62% center / cover no-repeat;
  filter: saturate(.45) brightness(.8) contrast(1.05);
}
.login-body::after {
  z-index: -1;
  background:
    radial-gradient(ellipse 38% 60% at 18% 50%, rgba(21, 24, 27, .55) 0%, rgba(21, 24, 27, 0) 100%),
    linear-gradient(180deg, rgba(28, 30, 34, .55) 0%, rgba(21, 24, 27, .78) 100%);
}
.login-body::before { z-index: 5; background: var(--charcoal); opacity: 0; }

/* logo + form: a light, see-through column on the left of the photo */
.login-side { width: min(340px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px; position: relative; z-index: 1; }
.login-logo { position: relative; width: 300px; max-width: 88%; }
.login-logo img { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .65)); }
/* a light glint that runs across the steel letters (masked by the logo itself) */
.login-logo .shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 43%, rgba(255, 255, 255, .55) 47%, #fff 50%, rgba(255, 255, 255, .55) 53%, transparent 57%) no-repeat;
  background-size: 260% 100%; background-position: 160% 0;
  -webkit-mask: url("../img/logo.f7d5134dbe38.svg") center / contain no-repeat;
          mask: url("../img/logo.f7d5134dbe38.svg") center / contain no-repeat;
}
.login-card {
  position: relative; width: 100%; padding: 20px 20px 18px; border-radius: 12px; overflow: hidden;
  background: rgba(21, 24, 27, .42); border: 1px solid rgba(218, 221, 226, .18);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35);
}
.login-card::before {   /* brushed-steel line drawn along the top edge */
  content: ""; position: absolute; top: 0; left: 0; height: 2px; width: 100%; background: var(--steel-gradient);
  transform-origin: left center;
}
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card .ltr-field { text-align: left; color: #C9CDD3; font-weight: 400; font-size: 12.5px; letter-spacing: .3px; transition: color .2s; }
.login-card .ltr-field:focus-within { color: #fff; }
.login-card .ltr-field input {
  background: rgba(255, 255, 255, .92); border: 1px solid transparent; border-radius: 8px; padding: 9px 11px; font-size: 14px;
  transition: box-shadow .25s, border-color .25s, background .25s;
}
.login-card .ltr-field input:focus { outline: none; background: #fff; border-color: var(--silver); box-shadow: 0 0 0 3px rgba(169, 175, 183, .35), 0 0 18px rgba(218, 221, 226, .25); }
.login-card .btn {
  position: relative; overflow: hidden; width: 100%; margin-top: 4px; padding: 10px; font-size: 14px; font-weight: 500; letter-spacing: .5px;
  background: #E3E6EA; color: var(--charcoal); border-color: transparent; transition: background .2s, transform .15s;
}
.login-card .btn::after {   /* steel sheen that crosses the button on hover */
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .85) 50%, transparent 70%);
}
.login-card .btn:hover { background: #fff; }
.login-card .btn:hover::after { transform: translateX(120%); transition: transform .7s ease; }
.login-card .btn:active { transform: scale(.98); }
.login-card .err { background: rgba(251, 233, 231, .95); color: #8A1A12; border: 1px solid #F1C2BC; border-radius: 8px; padding: 8px 11px; font-size: 12.5px; text-align: right; }
.login-card.notfound { text-align: center; color: #E3E6EA; }
.login-card.notfound h1 { font-size: 18px; margin: 0 0 6px; }
.login-card.notfound p { margin: 0 0 16px; font-size: 13px; color: #C9CDD3; }
.login-card.notfound .btn { display: block; }
.login-card .forgot { display: block; margin-top: 12px; text-align: center; font-size: 12.5px; color: #C9CDD3; direction: ltr; }
.login-card .forgot:hover { color: #fff; }
.login-card.auth-card { color: #E3E6EA; }
.login-card.auth-card h1 { font-size: 17px; margin: 0 0 8px; }
.login-card.auth-card p { font-size: 13px; line-height: 1.9; margin: 0 0 14px; color: #C9CDD3; }
.login-card.auth-card .auth-note { margin: 12px 0 0; font-size: 12px; color: #A9AFB7; }
.login-card.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card.auth-card > .btn { display: block; text-align: center; }
.login-foot a { color: inherit; }
/* «حساب من»: options on one side, the chosen option's panel beside them */
.acct { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; max-width: 1040px; }
.acct-menu { flex: 1 1 280px; max-width: 100%; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.acct-opt {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px;
  color: var(--text); text-decoration: none !important; border: 1px solid transparent;
}
.acct-opt:hover { background: var(--bg); }
.acct-opt.on { background: var(--silver-faint); border-color: #D5D9DF; }
.acct-opt .ao-ic {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--prog-bg); color: var(--prog);
}
.acct-opt.on .ao-ic { background: var(--graphite); color: #fff; }
.acct-opt .ao-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.acct-opt .ao-t b { font-size: 14px; }
.acct-opt .ao-t small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.acct-opt > .ic:last-child { width: 16px; height: 16px; color: #8C939C; transform: rotate(90deg); }
.acct-panel { flex: 999 1 420px; min-width: 0; }
.acct-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 180px;
  border: 1px dashed #D5D9DF; border-radius: 14px; color: var(--muted); background: #F7F8FA;
}
.acct-empty .ic { width: 28px; height: 28px; color: #A9AFB7; }
.acct-empty p { margin: 0; font-size: 13.5px; }
.login-foot { color: var(--silver); font-size: 11.5px; margin: 0; opacity: .8; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

/* opening sequence:
   curtain lifts (the photo itself never moves) -> the logo comes into focus -> a slow glint runs over it
   -> the panel unfolds from the top and its steel line is drawn -> the fields follow */
@keyframes login-curtain { from { opacity: 1; } to { opacity: 0; } }
@keyframes login-focus { from { opacity: 0; transform: translateY(-14px) scale(.92); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes login-glint { 0% { background-position: 160% 0; } 26%, 100% { background-position: -60% 0; } }
@keyframes login-glow {
  0%, 30%, 100% { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .65)); }
  13% { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .65)) drop-shadow(0 0 16px rgba(226, 232, 240, .55)) brightness(1.12); }
}
@keyframes login-unfold {
  from { opacity: 0; clip-path: inset(0 0 100% 0 round 12px); transform: translateX(-18px); }
  to { opacity: 1; clip-path: inset(0 0 0 0 round 12px); transform: none; }
}
@keyframes login-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes login-field { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes login-fade { from { opacity: 0; } to { opacity: .8; } }
.login-body::before { animation: login-curtain 1.1s ease-out both; }
.login-logo { animation: login-focus 1s cubic-bezier(.2, .8, .2, 1) .5s both; }
.login-logo .shine { animation: login-glint 11s ease-in-out 1.5s infinite; }
.login-logo img { animation: login-glow 11s ease-in-out 1.5s infinite; }
.login-card { animation: login-unfold .8s cubic-bezier(.2, .8, .2, 1) .9s both; }
.login-card::before { animation: login-line .7s cubic-bezier(.6, 0, .2, 1) 1.5s both; }
.login-card form > * { animation: login-field .5s cubic-bezier(.2, .8, .2, 1) both; }
.login-card form > :nth-child(2) { animation-delay: 1.15s; }
.login-card form > :nth-child(3) { animation-delay: 1.25s; }
.login-card form > :nth-child(4) { animation-delay: 1.35s; }
.login-card form > :nth-child(5) { animation-delay: 1.45s; }
.login-foot { animation: login-fade .8s ease-out 1.7s both; }
@media (prefers-reduced-motion: reduce) {
  .login-body::before, .login-logo, .login-logo .shine, .login-logo img, .login-card, .login-card::before,
  .login-card form > *, .login-foot { animation: none; }
  .login-body::before { opacity: 0; }
}
@media (max-width: 700px) {
  .login-body { justify-content: center; }
  .login-photo { background-position: 70% center; }
  .login-logo { width: 250px; }
}

/* datepicker above modals */
jdp-container { z-index: 400 !important; font-family: "Vazirmatn", Tahoma, sans-serif !important; }

/* ---------------------------------------------------------------- phones & small tablets */
.card > .card-body { overflow-x: auto; }
@media (max-width: 900px) {
  .site-header .bar { flex-wrap: wrap; height: auto; padding: 8px 12px 0; gap: 6px 10px; }
  .site-header .bar { padding-bottom: 8px; }
  .brand img { height: 40px; }
  .site-header .bar > .hsep, .userbox .hsep { display: none; }
  .userbox .who { display: none; }
  .clock .d { display: none; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -12px; padding: 0 6px; }
  .nav a { padding: 0 10px; font-size: 13.5px; height: 38px; }
  .page { padding: 12px; }
  .page-head h1 { font-size: 18px; }
  .kpis, .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .value { font-size: 28px; }
  .toolbar .search { width: 100%; }
  .grid-wrap { height: calc(100vh - 290px); }
  .form-grid { grid-template-columns: 1fr; }
  .date-form { width: 100%; }
}

/* ---------------------------------------------------------------- dashboard charts */
.dash-row { margin-bottom: 16px; }
.gauge-box { height: 220px; }
.gauge-foot { text-align: center; color: var(--steel); font-size: 13px; margin-top: 4px; }
.gauge-foot b { color: var(--graphite); }

/* ---------------------------------------------------------------- period report layout */
.sec-tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
@media (max-width: 1100px) { .sec-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .sec-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sec-tile {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--surface); min-width: 0;
  border: 1px solid #E3E6EA; border-radius: 12px; color: var(--graphite); text-decoration: none !important;
}
a.sec-tile:hover { border-color: var(--steel); box-shadow: var(--shadow); }
.sec-tile .st-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec-tile .st-ic { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--silver-faint); color: var(--charcoal-hi); }
.sec-tile .st-ic .ic { width: 17px; height: 17px; }
.sec-tile b { font-size: 22px; font-weight: 800; }
.sec-tile > span:last-child { font-size: 12.5px; line-height: 1.4; color: var(--charcoal-hi); }
.sec-tile.tone-ok .st-ic { background: var(--ok-bg); color: var(--ok); }
.sec-tile.tone-warn .st-ic { background: var(--warn-bg); color: var(--warn); }
.sec-tile.tone-danger { border-color: #F1C9C4; }
.sec-tile.tone-danger .st-ic { background: var(--danger-bg); color: var(--danger); }
.sec-tile.tone-danger b { color: var(--danger); }
.sec-tile.tone-steel .st-ic { background: var(--prog-bg); color: var(--prog); }
.sec-tile.empty-tile { background: #F7F8FA; border-style: dashed; border-color: #D5D9DF; }
.sec-tile.empty-tile .st-ic { background: var(--silver-faint); color: #8C939C; }
.sec-tile.empty-tile b, .sec-tile.empty-tile > span:last-child { color: var(--muted); }
.report-sec { margin-bottom: 14px; scroll-margin-top: 110px; }
.report-table { table-layout: fixed; }
.report-table td { line-height: 1.7; }
/* a thin line between columns */
.report-table th + th, .report-table td + td { border-inline-start: 1px solid var(--silver-light); }
/* minimizable modules */
.report-sec .card-head { cursor: pointer; user-select: none; }
.sec-toggle {
  margin-inline-start: 10px; width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; cursor: pointer; padding: 0;
  border: 1px solid var(--silver-light); background: var(--surface); color: var(--graphite);
  font: 600 16px/1 "Vazirmatn", Tahoma, sans-serif; display: inline-flex; align-items: center; justify-content: center;
}
.sec-toggle:hover { border-color: var(--steel); background: var(--silver-faint); }
.sec-toggle .ic { width: 16px; height: 16px; transform: rotate(180deg); transition: transform .2s; }
.report-sec.collapsed .sec-toggle .ic { transform: none; }
.report-sec.collapsed .card-body { display: none; }
.report-sec.collapsed .card-head { border-bottom: 0; }
.report-table .desc { max-width: none; }

/* ---------------------------------------------------------------- print */
.print-wrap { position: relative; }
.print-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 190px;
  background: var(--surface); border: 1px solid var(--silver-light); border-radius: 8px; box-shadow: var(--shadow); padding: 4px;
}
.print-menu[hidden] { display: none; }
.print-menu button {
  display: block; width: 100%; text-align: right; background: none; border: 0; border-radius: 6px;
  padding: 8px 10px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
.print-menu button:hover { background: var(--silver-faint); }
.print-banner {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--graphite); color: #fff; border-radius: 10px; padding: 10px 16px; box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: center; font-size: 13.5px;
}
.print-banner[hidden] { display: none; }
body.print-picking main .card, body.print-picking main .kpis, body.print-picking main .sec-tiles, body.print-picking main .grid-wrap { cursor: pointer; }
.print-hover { outline: 3px solid #F5B942 !important; outline-offset: 3px; border-radius: var(--radius); }
.print-meta { display: none; }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  html, body { background: #fff !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 12px; }
  .site-header, .toast-box, .print-banner, .overlay, .modal, .drawer, .messages,
  .page-head .btn, .page-head .spacer, .ph-icon, .ch-ic, .st-ic, .toolbar, .presets, .range-bar .btn, .act, .lists form.item:last-child { display: none !important; }
  .page { padding: 0 !important; max-width: none !important; }
  .print-meta {
    display: flex; align-items: center; gap: 12px; border-bottom: 1.5px solid #2B2F36;
    padding-bottom: 6px; margin-bottom: 10px; font-size: 13px;
  }
  .print-meta img { height: 34px; }
  .print-meta span { margin-inline-start: auto; color: #555; font-size: 11.5px; }
  .card, .kpi { box-shadow: none !important; break-inside: avoid; }
  .report-sec { break-inside: auto; }
  .grid-wrap { height: auto !important; min-height: 0 !important; }
  a { color: inherit; text-decoration: none; }
  .page-head h1 { display: none; }     /* the title is in the print header */
  /* A4 landscape is narrower than the 1100px breakpoint: keep the screen layout */
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 8px; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sec-tiles { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; }
  .dash-row { break-inside: avoid; }
  /* charts keep their screen-size bitmap; let it shrink into the narrower print columns */
  .chart-box { height: auto !important; }
  .chart-box canvas { max-width: 100% !important; height: auto !important; }
  /* print one picked part: hide everything that is not on the path down to it */
  body.print-part main > :not(.print-path):not(.print-target):not(.print-meta),
  body.print-part .print-path > :not(.print-path):not(.print-target):not(.print-meta) { display: none !important; }
  body.print-part .print-path { display: block !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; }
  body.print-part .print-target { width: 100% !important; }
}
