/* ---- self-hosted fonts ---- */
@font-face{font-family:'Plex Arabic';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Plex Arabic';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Plex Arabic';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Plex Arabic';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Plex Arabic';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Plex Arabic';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Vazirmatn';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/vazirmatn-arabic-400-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Vazirmatn';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/vazirmatn-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Vazirmatn';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/vazirmatn-arabic-500-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Vazirmatn';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/vazirmatn-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Vazirmatn';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/vazirmatn-arabic-700-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Vazirmatn';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/vazirmatn-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/* ================================================================
   Finance Portal — main stylesheet (RTL, Arabic / Persian)
   ================================================================ */
:root {
  --navy: #1B3A5C; --navy-d: #102741; --navy-l: #E7EDF4;
  --teal: #1A6B6B; --teal-l: #E2F1F0;
  --red: #C0392B;  --red-l: #FBEAE8;
  --amber: #E8930A; --amber-l: #FDF1DE;
  --green: #22875A; --green-l: #E3F4EB;
  --purple: #6A4BB0; --purple-l: #EEE9F8;
  --cream: #FFF8DC;
  --bg: #F2F4F8; --card: #FFFFFF; --line: #E4E8EF; --line-2: #EEF1F5;
  --text: #17222F; --text-2: #3C4A5A; --muted: #6E7A89;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,39,65,.05), 0 6px 20px -8px rgba(16,39,65,.10);
  --shadow-lg: 0 18px 40px -16px rgba(16,39,65,.28);
  --side-w: 272px;
  --font: 'Plex Arabic', system-ui, 'Segoe UI', Tahoma, sans-serif;
}
html[data-lang="fa"] { --font: 'Vazirmatn', system-ui, 'Segoe UI', Tahoma, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .86em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--amber) 70%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- color helpers ---------- */
.c-navy   { --c: var(--navy);   --cl: var(--navy-l); }
.c-teal   { --c: var(--teal);   --cl: var(--teal-l); }
.c-red    { --c: var(--red);    --cl: var(--red-l); }
.c-amber  { --c: var(--amber);  --cl: var(--amber-l); }
.c-green  { --c: var(--green);  --cl: var(--green-l); }
.c-purple { --c: var(--purple); --cl: var(--purple-l); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side-w); z-index: 40;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1D3F63 0%, var(--navy) 35%, var(--navy-d) 100%);
  color: #DCE5EF; padding: 18px 14px;
}
.sidebar::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 220px at 90% -40px, rgba(232,147,10,.18), transparent 70%); }
.main { flex: 1; min-width: 0; margin-inline-start: var(--side-w); display: flex; flex-direction: column; }

.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; position: relative; z-index: 1; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--amber), #F5B342); color: #fff; box-shadow: 0 6px 16px -6px rgba(232,147,10,.7); }
.brand-mark .ic { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { color: #fff; font-size: 17px; }
.brand-text small { color: #9FB2C7; font-size: 12px; }

.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; margin-inline: -4px; padding-inline: 4px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-label { font-size: 11.5px; font-weight: 600; color: #7E95AE; margin: 16px 10px 6px; letter-spacing: .02em; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 11px; font-size: 14px; color: #CFDAE6; transition: background .15s, color .15s; position: relative; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.11); color: #fff; font-weight: 600; }
.nav-link.active::before { content: ""; position: absolute; inset-inline-start: -4px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--amber); }
.nav-link > .ic { opacity: .85; }
.nav-dot { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 30%, transparent); color: #fff; }
.nav-dot .ic { width: 16px; height: 16px; }
.nav-link .nav-dot { margin-inline: -4px 0; }

.sidebar-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; margin-top: 10px; position: relative; z-index: 1; }
.me { flex: 1; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; min-width: 0; }
.me:hover, .me.active { background: rgba(255,255,255,.07); }
.me-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.me-text strong { color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: #9FB2C7; font-size: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700;
  background: linear-gradient(135deg, #2F5E8C, var(--teal)); color: #fff; }
.avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 10px; display: grid; place-items: center; background: transparent; color: inherit; cursor: pointer; }
.sidebar .icon-btn { color: #AFC0D2; }
.sidebar .icon-btn:hover { background: rgba(192,57,43,.25); color: #fff; }
.scrim { display: none; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar-title { flex: 1; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.topbar-title h1 { font-size: 21px; }
.today { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.today .ic { width: 16px; height: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; background: var(--card); box-shadow: var(--shadow); }

.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.lang-switch button { border: 0; background: transparent; padding: 5px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--muted); }
.lang-switch button.on { background: var(--navy); color: #fff; font-weight: 600; }
.lang-switch button:not(.on):hover { color: var(--text); }

.content { flex: 1; padding: 8px 28px 28px; display: flex; flex-direction: column; gap: 22px; max-width: 1560px; width: 100%; }
.foot { display: flex; justify-content: space-between; padding: 14px 28px 22px; font-size: 12.5px; color: var(--muted); }

/* ---------- common UI ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line-2); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; display: inline-flex; align-items: center; gap: 8px; flex: 1; }
.card-head.sub-head { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.section-title { font-size: 17px; margin-bottom: 12px; }
.pad { padding: 12px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  padding: 10px 20px; border-radius: 11px; background: var(--navy); color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: 0 6px 14px -8px rgba(27,58,92,.8); transition: transform .1s, background .15s; }
.btn:hover { background: #24507D; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn-ghost { background: var(--card); color: var(--navy); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--navy-l); }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 20px; font-size: 15.5px; }
.link { color: var(--navy); font-weight: 600; font-size: 13.5px; }
.link:hover { text-decoration: underline; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: var(--cl, var(--line-2)); color: var(--c, var(--text-2)); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip-warn { border-color: #F3C98A; color: #9A5B00; background: var(--amber-l); }
.chip-warn.on { background: var(--amber); border-color: var(--amber); color: #fff; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--line-2); color: var(--text-2); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ready { background: var(--green-l); color: var(--green); }
.status.building { background: var(--amber-l); color: #A96400; }
.status.off { background: var(--red-l); color: var(--red); }
.status.info { background: var(--navy-l); color: var(--navy); }
.badge-demo { font-size: 11px; padding: 1px 8px; border-radius: 6px; background: var(--cream); color: #8A6D1C; border: 1px solid #F0E3B2; }
.count-pill { min-width: 26px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

.flash { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; font-size: 14px; border: 1px solid; }
.flash-success { background: var(--green-l); color: #16603F; border-color: #BFE3CF; }
.flash-error   { background: var(--red-l); color: #962D22; border-color: #F1C4BE; }
.flash-warning { background: var(--cream); color: #7A5A00; border-color: #EEDC9E; }

/* forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea, .search input {
  width: 100%; border: 1px solid var(--line); background: #FBFCFD; border-radius: 11px; padding: 10px 12px; outline: none; transition: border .15s, box-shadow .15s, background .15s; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { border-color: #7FA0C4; background: #fff; box-shadow: 0 0 0 4px rgba(27,58,92,.08); }
.field input[readonly] { background: var(--line-2); color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); }
.checks { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
.radio-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; cursor: pointer; font-size: 14px; }
.radio-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--navy); flex: 0 0 auto; }
.ni-totals { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1rem; }
.ni-tcard { flex: 1 1 160px; background: #fff; border: 1px solid var(--line, #e2e6ec); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.ni-tcard strong { font-size: 18px; } .ni-tcard-sum { background: #fff8dc; }
tr.ni-ok > td { background: #e7f6ec; } tr.ni-no > td { background: #fdecec; }
.ni-sub > td { background: #f7f9fc; }
.ni-files-box { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.ni-filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ni-filelist li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ni-rej { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.link.has { font-weight: 700; }
.form-actions { display: flex; gap: 10px; grid-column: 1 / -1; margin-top: 6px; }
.input-ic { position: relative; }
.input-ic > .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: #93A0AE; width: 18px; height: 18px; pointer-events: none; }
.input-ic input { padding-inline-start: 40px; height: 48px; text-align: start; }
.input-ic input[dir="ltr"] { text-align: right; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #93A0AE; cursor: pointer; padding: 8px; border-radius: 8px; display: grid; }
.pw-toggle:hover { color: var(--navy); }

/* tables — RTL: first column on the right */
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-size: 12.5px; font-weight: 600; color: var(--muted); background: #F7F9FB; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover td { background: #FAFBFD; }
.table tbody tr:last-child td { border-bottom: 0; }
.row-off td { opacity: .55; }
.row-focus td { background: #FFFBEA !important; }
.row-actions { white-space: nowrap; }
.row-actions a + a { margin-inline-start: 14px; }
.cell-user { display: inline-flex; align-items: center; gap: 10px; }
.cell-user small { display: block; font-size: 11.5px; }
.details { max-width: 420px; font-size: 13px; color: var(--text-2); word-break: break-word; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pager a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); font-size: 13px; }
.pager a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.narrow { max-width: 760px; display: flex; flex-direction: column; gap: 20px; }

.empty-state { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 56px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state h2 { font-size: 20px; }
.empty-state p { max-width: 520px; color: var(--text-2); }
.empty-icon { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: var(--cl, var(--navy-l)); color: var(--c, var(--navy)); margin-bottom: 6px; }
.empty-icon .ic { width: 36px; height: 36px; }
.empty-icon.red { --c: var(--red); --cl: var(--red-l); }

/* ---------- dashboard ---------- */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 26px 30px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(115deg, var(--navy-d) 0%, var(--navy) 45%, #1F5A70 80%, var(--teal) 100%); box-shadow: var(--shadow-lg); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background: radial-gradient(360px 180px at 12% 120%, rgba(232,147,10,.45), transparent 70%),
              radial-gradient(260px 160px at 95% -20%, rgba(95,211,198,.35), transparent 70%); }
.hero::after { content: ""; position: absolute; inset: 0; opacity: .08;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(90deg, #000, transparent 60%); -webkit-mask-image: linear-gradient(90deg, #000, transparent 60%); }
.hero > * { position: relative; z-index: 1; }
.hero-text h2 { font-size: 24px; }
.hero-text p { color: #C8D7E6; margin-top: 4px; }
.hero-stats { display: flex; gap: 10px; }
.hs { min-width: 92px; padding: 10px 16px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); display: flex; flex-direction: column; align-items: center; backdrop-filter: blur(4px); }
.hs-num { font-size: 24px; font-weight: 700; line-height: 1.2; }
.hs-lbl { font-size: 12px; color: #C8D7E6; }
.hs-crit { background: rgba(192,57,43,.35); border-color: rgba(255,160,150,.35); }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.kpi { position: relative; overflow: hidden; background: var(--card); border-radius: var(--radius); padding: 18px 20px 16px; box-shadow: var(--shadow); border: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 8px; transition: transform .15s, box-shadow .15s; }
.kpi::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--c); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-head { display: flex; align-items: center; gap: 10px; }
.kpi-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--c); color: #fff; box-shadow: 0 8px 16px -8px var(--c); }
.kpi-label { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-2); }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: #E3C65A; box-shadow: 0 0 0 3px var(--cream); }
.kpi-value { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 8px; color: var(--text); }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.kpi-sub { color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.delta .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.delta.up { color: var(--green); background: var(--green-l); }
.delta.down { color: var(--red); background: var(--red-l); }
.spark { width: 100%; height: 38px; margin-top: 2px; }
.spark-line { fill: none; stroke: var(--c); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-area { fill: var(--c); opacity: .1; }
.kpi-meter { margin-top: 12px; }
.kpi-dots { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.dd { font-size: 12px; padding: 3px 10px; border-radius: 8px; background: var(--amber-l); color: #9A5B00; font-weight: 600; }
.dd.hot { background: var(--red-l); color: var(--red); }

.meter { width: 100%; height: 7px; display: block; }
.m-track { fill: var(--line-2); }
.m-fill { fill: var(--c, var(--teal)); }
.meter.m-ok .m-fill { fill: var(--teal); }
.meter.m-warn .m-fill { fill: var(--amber); }
.meter.m-over .m-fill { fill: var(--red); }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.grid-main > .alerts-card:only-child { grid-column: 1 / -1; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }

.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.lg-in { background: var(--teal); } .lg-out { background: #9DB3CB; }
.lg-net { background: var(--amber); border-radius: 50%; }
.lg-budget { background: var(--navy-l); border: 1px solid #C9D6E4; } .lg-actual { background: var(--navy); }
.legend-sm { margin: -6px 0 12px; }
.chart-wrap { width: 100%; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11.5px; font-family: var(--font); }
.chart .bar-in { fill: var(--teal); }
.chart .bar-out { fill: #9DB3CB; }
.chart .net-line { fill: none; stroke: var(--amber); stroke-width: 2.5; stroke-linejoin: round; stroke-dasharray: 5 4; }
.chart .net-dot { fill: #fff; stroke: var(--amber); stroke-width: 2.5; }
.chart rect:hover { opacity: .85; }
.chart-note { font-size: 12px; margin-top: 6px; text-align: end; }

.bell { position: relative; display: inline-grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: var(--red-l); color: var(--red); }
.bell .ic { width: 18px; height: 18px; }
.ping { position: absolute; top: 5px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; }
.ping::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--red); animation: ping 1.6s ease-out infinite; }
@keyframes ping { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.alert { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: #FAFBFC; border: 1px solid var(--line-2); border-inline-start: 4px solid var(--sev); }
.alert.sev-critical { --sev: var(--red); background: #FFF7F6; }
.alert.sev-warning { --sev: var(--amber); background: #FFFBF3; }
.alert.sev-info { --sev: #5B84B1; }
.alert-ic { color: var(--sev); padding-top: 2px; }
.alert-body { flex: 1; min-width: 0; }
.alert-body p { font-size: 14px; color: var(--text); }
.alert-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.due .ic { width: 14px; height: 14px; }
.due.hot { color: var(--red); font-weight: 600; }

.budget-list, .funds, .deadlines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bl-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; margin-bottom: 6px; }
.bl-pct { font-weight: 700; color: var(--teal); }
.bl-pct.over { color: var(--red); }
.bl-nums { font-size: 12px; margin-top: 3px; }
.hbar { width: 100%; height: 12px; display: block; }
.hb-track { fill: var(--line-2); }
.hb-budget { fill: var(--navy-l); }
.hb-actual { fill: var(--navy); }
.hb-actual.over { fill: var(--red); }
.funds li.over .bl-top span:last-child { color: var(--red); font-weight: 700; }

.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.ring-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px; border-radius: 14px; transition: background .15s; }
.ring-item:hover { background: #F7F9FB; }
.ring-item strong { font-size: 14px; }
.ring-item span { font-size: 12px; }
.ring { width: 96px; height: 96px; }
.ring-bg { fill: none; stroke: var(--cl); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--c); stroke-width: 9; stroke-linecap: round; }
.ring-txt { font-size: 17px; font-weight: 700; fill: var(--text); font-family: var(--font); }

.deadlines li { display: flex; align-items: center; gap: 14px; }
.deadlines p { font-size: 14px; font-weight: 600; }
.deadlines .muted { font-size: 12px; }
.dl-date { width: 52px; height: 52px; border-radius: 14px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--cl); color: var(--c); line-height: 1.1; }
.dl-date strong { font-size: 19px; }
.dl-date small { font-size: 10.5px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tile { position: relative; background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; inset-inline-end: -50px; top: -60px; background: var(--cl); opacity: .8; transition: transform .3s; }
.tile > * { position: relative; z-index: 1; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 30%, transparent); }
.tile:hover::after { transform: scale(1.15); }
.tile-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--c); color: #fff; margin-bottom: 4px; box-shadow: 0 10px 18px -10px var(--c); }
.tile-icon .ic { width: 24px; height: 24px; }
.tile strong { font-size: 16px; }
.tile p { font-size: 13px; color: var(--muted); flex: 1; }
.tile-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tile .perm { font-size: 12px; color: var(--muted); flex: 1; }
.tile .go { width: 18px; height: 18px; color: var(--c); transition: transform .2s; }
.tile:hover .go { transform: translateX(-4px); }

/* ---------- permissions ---------- */
.legend-perm { gap: 8px; }
.lvl { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.lvl .ic { width: 15px; height: 15px; }
.lvl-0 { --lv: #8A95A3; --lvl: #EEF1F4; }
.lvl-1 { --lv: #2C6DB0; --lvl: #E4EEF9; }
.lvl-2 { --lv: var(--green); --lvl: var(--green-l); }
.lvl { color: var(--lv); background: var(--lvl); }
.admins-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; padding: 10px 14px; background: var(--navy-l); border-radius: 12px; color: var(--navy); }
.perm-table th, .perm-table td { text-align: center; }
.perm-table th:first-child, .perm-table td:first-child { text-align: start; }
.th-mod { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; white-space: normal; min-width: 96px; line-height: 1.35; }
.th-mod .nav-dot { background: var(--c); }
.sticky-col { position: sticky; inset-inline-start: 0; background: var(--card); z-index: 1; min-width: 200px; }
thead .sticky-col { background: #F7F9FB; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #F1F3F6; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { width: 32px; height: 28px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; color: #A6B0BC; transition: background .12s, color .12s; }
.seg label .ic { width: 16px; height: 16px; }
.seg label:hover { color: var(--lv); }
.seg input:checked + label { background: var(--card); color: var(--lv); box-shadow: 0 1px 3px rgba(16,39,65,.18); }
.seg input:checked + label.lvl-1 { background: #2C6DB0; color: #fff; }
.seg input:checked + label.lvl-2 { background: var(--green); color: #fff; }
.seg input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--amber) 70%, transparent); }
.sticky-save { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px 16px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.dirty-note { display: inline-flex; align-items: center; gap: 6px; color: #9A5B00; font-size: 13px; font-weight: 600; }

/* user editor: permissions inside the user form */
.user-editor { display: flex; flex-direction: column; gap: 18px; }
.user-editor > .sticky-save { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line-2); margin-top: -4px; }
.quick-perms { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: #F7F9FB; font-size: 13px; }
.quick-perms .chip .ic { width: 15px; height: 15px; }
.perm-sec { font-size: 13.5px; color: var(--muted); font-weight: 600; margin: 18px 2px 8px; }
.perm-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.perm-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.perm-row:last-child { border-bottom: 0; }
.perm-row:hover { background: #FAFBFD; }
.perm-row > .nav-dot { width: 38px; height: 38px; border-radius: 11px; background: var(--c); }
.perm-row > .nav-dot .ic { width: 20px; height: 20px; }
.perm-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.perm-name strong { font-size: 14.5px; }
.perm-name small { font-size: 12.5px; }
.seg-text label { width: auto; height: 34px; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; white-space: nowrap; }
.seg-text label .ic { width: 15px; height: 15px; }
.seg input:checked + label.lvl-0 { background: #6E7A89; color: #fff; }
.perm-pills { display: flex; flex-wrap: wrap; gap: 5px; max-width: 520px; }
.perm-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 7px; color: var(--lv); background: var(--lvl); white-space: nowrap; }
.perm-pill .ic { width: 13px; height: 13px; }
a.cell-user:hover { color: var(--navy); text-decoration: underline; }
@media (max-width: 760px) {
  .perm-row { flex-wrap: wrap; }
  .perm-row .seg-text { width: 100%; display: flex; }
  .perm-row .seg-text label { flex: 1; justify-content: center; padding: 0 6px; font-size: 12px; }
}

/* ---------- translations ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: #93A0AE; width: 18px; height: 18px; }
.search input { padding-inline-start: 40px; background: var(--card); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.tr-table td { vertical-align: top; }
.tr-key { width: 22%; min-width: 180px; }
.tr-key code { display: block; color: var(--navy); word-break: break-all; }
.tr-key small { font-size: 11px; }
.tr-table textarea { width: 100%; min-width: 220px; resize: vertical; border: 1px solid transparent; background: transparent; border-radius: 9px; padding: 7px 10px; line-height: 1.6; field-sizing: content; min-height: 38px; }
.tr-table textarea:hover { border-color: var(--line); background: #FBFCFD; }
.tr-table textarea:focus { outline: none; border-color: #7FA0C4; background: #fff; box-shadow: 0 0 0 4px rgba(27,58,92,.08); }
.tr-table textarea.changed { background: var(--cream); border-color: #EBD68E; }
.tr-table textarea:placeholder-shown, .tr-table tr[data-missing] textarea:empty { background: #FFF6F5; }
textarea[lang="ar"] { font-family: 'Plex Arabic', var(--font); }
textarea[lang="fa"] { font-family: 'Vazirmatn', var(--font); }

/* ---------- profile / install ---------- */
.first-login { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(115deg, var(--navy-d), var(--navy) 55%, var(--teal)); box-shadow: var(--shadow-lg); }
.first-login h2 { font-size: 19px; }
.first-login p { color: #D3E0EC; margin-top: 4px; }
.first-login-ic { width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--amber); }
.first-login-ic .ic { width: 28px; height: 28px; }
td .status + .status { margin-inline-start: 6px; }
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-head > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.profile-lang { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; font-size: 12.5px; }
.form-card { display: flex; flex-direction: column; gap: 12px; }
.install-card { max-width: 480px; margin: 60px auto; display: flex; flex-direction: column; gap: 16px; }
.install-card h1 { font-size: 20px; }

/* ---------- login ---------- */
.bare { min-height: 100vh; }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); }
.login-hero { position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; padding: 48px;
  background: linear-gradient(150deg, #0D223A 0%, var(--navy) 45%, #1D5870 80%, var(--teal) 100%); }
.login-hero::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(500px 300px at 85% 10%, rgba(232,147,10,.28), transparent 70%),
              radial-gradient(420px 320px at 10% 95%, rgba(95,211,198,.22), transparent 70%); }
.hero-grid { position: absolute; inset: 0; opacity: .09;
  background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 75%); }
.hero-inner { position: relative; z-index: 1; max-width: 520px; margin-inline: auto; display: flex; flex-direction: column; gap: 30px; }
.brand-lg { padding: 0; }
.brand-lg .brand-mark { width: 56px; height: 56px; border-radius: 16px; }
.brand-lg .brand-mark .ic { width: 30px; height: 30px; }
.brand-lg strong { font-size: 26px; }
.brand-lg small { font-size: 14px; color: #B7C8DA; }
.hero-chart { width: 100%; height: auto; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 16px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.hero-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hero-points li { display: flex; align-items: center; gap: 12px; font-size: 16px; color: #E3ECF5; }
.hero-points .ic { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: rgba(95,211,198,.2); color: #7EE0D4; stroke-width: 2.6; }
.hero-mods { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-mods .chip { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: #DCE6F0; cursor: default; padding: 4px 12px 4px 6px; }
.hero-mods .nav-dot { width: 24px; height: 24px; border-radius: 7px; background: var(--c); }
.hero-mods .nav-dot .ic { width: 14px; height: 14px; }
.login-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: var(--card); }
.login-top { position: absolute; top: 24px; inset-inline-end: 28px; }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login-form h1 { font-size: 28px; }
.login-lock { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--navy-l); color: var(--navy); }
.login-lock .ic { width: 26px; height: 26px; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.secure-note .ic { width: 16px; height: 16px; color: var(--green); }

/* ---------- stock count ---------- */
.btn-amber { background: var(--amber); box-shadow: 0 6px 14px -8px rgba(232,147,10,.9); }
.btn-amber:hover { background: #D07F00; }
.btn.is-busy { opacity: .7; cursor: progress; }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th.num { text-align: end; }
.neg { color: var(--red); }
.link-danger { color: var(--red); }
button.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 13.5px; }
.inline-form { display: inline; }
.row-actions .link, .row-actions .inline-form { margin-inline-start: 12px; }
.row-actions > :first-child { margin-inline-start: 0; }
.row-actions .link .ic { width: 14px; height: 14px; vertical-align: -2px; margin-inline-end: 2px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13.5px; font-weight: 600; margin-bottom: -8px; }
.back-link:hover { color: var(--navy); }
.ic.flip { transform: scaleX(-1); width: 16px; height: 16px; }
.row-link { cursor: pointer; }
.row-link a { color: inherit; }
.row-link:hover a { color: var(--navy); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: " ⇅"; color: #B9C3CE; font-size: 11px; }
th[aria-sort="ascending"]::after { content: " ▲"; color: var(--navy); }
th[aria-sort="descending"]::after { content: " ▼"; color: var(--navy); }

.stk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; }
.stk-tile { border: 1px solid var(--line-2); background: var(--card); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  cursor: pointer; box-shadow: var(--shadow); text-align: start; font-size: 13px; color: var(--text-2); position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.stk-tile::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--tc, var(--navy)); }
.stk-tile:hover { transform: translateY(-2px); }
.stk-tile.on { outline: 2px solid var(--tc, var(--navy)); outline-offset: -2px; }
.stk-tile-num { font-size: 28px; font-weight: 700; color: var(--tc, var(--navy)); line-height: 1.2; }
.t-green { --tc: #1E8E4E; } .t-yellow { --tc: #C98A00; } .t-red { --tc: var(--red); } .t-none { --tc: #8A95A3; }

/* stock count plan: weekly tabs + share */
/* dashboard: stock count calendar (Gregorian) */
.stk-cal .card-head { margin-bottom: 8px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-title { min-width: 110px; text-align: center; font-size: 15px; }
.cal-lg-plan { background: #DCE8F6; border: 1px solid #3B6EA8; } .cal-lg-late { background: #fff; border: 1px dashed var(--red); }
.cal-lg-green { background: #1E8E4E; } .cal-lg-yellow { background: #E8A317; } .cal-lg-red { background: var(--red); }
.cal-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.cal-sum-it { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.cal-sum-it strong { font-size: 17px; }
.cal-sum-it.neg strong { color: #A32A1E; } .cal-sum-it.pos strong { color: #16703D; }
.cal-sum-it.pc-red { background: #FBDAD6; } .cal-sum-it.pc-yellow { background: #FFF1C2; } .cal-sum-it.pc-green { background: #DDF3E5; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day { min-height: 84px; border: 1px solid var(--line-2, var(--line)); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--card); }
.cal-day.other { opacity: .45; }
.cal-day.today { border: 2px solid var(--navy); }
.cal-day.has { background: rgba(232,163,23,.06); }
.cal-num { font-size: 13px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.cal-cnt { font-size: 10.5px; background: var(--navy); color: #fff; border-radius: 999px; padding: 0 6px; line-height: 16px; }
.cal-it { display: block; font-size: 11px; line-height: 1.35; padding: 2px 5px; border-radius: 5px; text-decoration: none; color: #1F4470; background: #DCE8F6; border-inline-start: 3px solid #3B6EA8; min-width: 0; }
.cal-it { position: relative; display: flex; align-items: center; gap: 4px; }
.cal-it .cal-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-pct { flex: none; font-size: 10.5px; font-weight: 700; }
/* details on hover / focus */
.cal-tip { display: none; position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline-start: 0; width: 230px; max-width: 70vw;
  background: var(--card); color: var(--text, #1d2433); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15,30,60,.18);
  padding: 10px 12px; font-size: 12px; line-height: 1.5; white-space: normal; flex-direction: column; gap: 3px; cursor: default; }
.cal-it:hover .cal-tip, .cal-it:focus .cal-tip, .cal-it:focus-within .cal-tip { display: flex; }
.cal-grid > .cal-day:nth-child(7n) .cal-tip, .cal-grid > .cal-day:nth-child(7n+6) .cal-tip { inset-inline-start: auto; inset-inline-end: 0; }
.ct-head { font-weight: 700; font-size: 12.5px; padding-bottom: 5px; margin-bottom: 3px; border-bottom: 1px solid var(--line); }
.ct-row { display: flex; justify-content: space-between; gap: 10px; }
.ct-row > span:first-child { color: var(--muted); }
.ct-row bdi { font-weight: 600; }
.ct-row .neg { color: #A32A1E; } .ct-row .pos { color: #16703D; }
.ct-row .pc-red { color: #A32A1E; } .ct-row .pc-yellow { color: #8A6100; } .ct-row .pc-green { color: #16703D; }
.stk-cal, .stk-cal .cal-grid, .stk-cal .cal-day { overflow: visible; }
.cal-it.is-late { background: #fff; color: #A32A1E; border: 1px dashed var(--red); border-inline-start-width: 3px; }
.cal-it.is-done { background: #EEF1F4; color: var(--text-2); border-color: #8A95A3; }
.cal-it.is-done.pc-green { background: #DDF3E5; color: #16703D; border-color: #1E8E4E; }
.cal-it.is-done.pc-yellow { background: #FFF1C2; color: #7A5600; border-color: #E8A317; }
.cal-it.is-done.pc-red { background: #FBDAD6; color: #A32A1E; border-color: var(--red); }
.cal-it:hover { box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); z-index: 40; }
.cal-day { position: relative; }
.cal-day:hover, .cal-day:focus-within { z-index: 20; opacity: 1; }
@media (max-width: 760px) {
  .cal-day { min-height: 58px; padding: 3px; }
  .cal-it { flex-direction: column; align-items: stretch; gap: 0; }
  .cal-it .cal-name { font-size: 9.5px; }
  .cal-it { font-size: 10px; padding: 1px 3px; }
  .cal-wd { font-size: 10.5px; }
}
.stk-plan-line { margin: 10px 2px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stk-plan-line a { color: inherit; }
.stk-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin-bottom: 14px; }
.stk-tab { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); font-size: 14px; text-decoration: none; }
.stk-tab:hover { border-color: var(--navy); color: var(--navy); }
.stk-tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.stk-tab-n { min-width: 22px; padding: 0 7px; border-radius: 999px; background: rgba(127,127,127,.15); font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.stk-tab.on .stk-tab-n { background: rgba(255,255,255,.22); }
.stk-tab.is-late:not(.on) .stk-tab-n { background: #FBDAD6; color: #A32A1E; }
.stk-week-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.stk-week-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 17px; }
.stk-share { padding: 16px 18px; margin-bottom: 16px; }
.stk-share textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg, #f7f8fa); color: inherit; resize: vertical; margin: 8px 0 12px; }
.stk-share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-wa { background: #25D366; border-color: #25D366; color: #fff; }
.btn-tg { background: #229ED9; border-color: #229ED9; color: #fff; }
.btn-wa:hover, .btn-tg:hover { filter: brightness(.95); color: #fff; }

.days { font-weight: 700; text-align: center !important; min-width: 110px; }
.days-green  { background: #DDF3E5 !important; color: #16703D; }
.days-yellow { background: #FFF1C2 !important; color: #8A6100; }
.days-red    { background: #FBDAD6 !important; color: #A32A1E; }
.days-none   { background: #EEF1F4 !important; color: #6E7A89; }
.days-badge { display: inline-flex; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }

.stk-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 22px 26px; border-radius: 20px; color: #fff;
  background: linear-gradient(115deg, var(--navy-d), var(--navy) 50%, #2A5E73 85%, var(--teal)); box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.stk-hero::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; inset-inline-end: -80px; top: -120px; background: radial-gradient(circle, rgba(232,147,10,.35), transparent 70%); }
.stk-hero > * { position: relative; z-index: 1; }
.stk-hero h2 { font-size: 24px; margin: 6px 0 8px; }
.stk-code { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; letter-spacing: .04em; padding: 2px 10px; border-radius: 7px; background: rgba(255,255,255,.14); }
.stk-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #CFDCE8; font-size: 13.5px; }
.stk-meta span { display: inline-flex; align-items: center; gap: 6px; }
.stk-meta .ic { width: 16px; height: 16px; opacity: .8; }
.stk-hero-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.upload-card { border: 2px dashed #F0C77A; background: #FFFCF3; }
.upload-form { align-items: end; }
.form-wide { grid-column: 1 / -1; }
.file-field input[type=file] { padding: 8px; background: #fff; }
.flash-list { align-items: flex-start; }
.flash-list ul { margin: 6px 0 0; padding-inline-start: 18px; }

.report-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.report-title h3 { font-size: 19px; }
.stk-kpis { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.stk-kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line-2); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.stk-kpi::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--c); }
.stk-kpi.is-main { background: linear-gradient(160deg, #FFFFFF 40%, var(--cl)); }
.stk-kpi-label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.stk-kpi-val { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stk-kpi.is-main .stk-kpi-val { font-size: 32px; }
.stk-kpi-pct { font-size: 13px; color: var(--text-2); }
.stk-kpi-pct bdi:first-child { font-weight: 700; color: var(--c); }
.stk-kpi-prev { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }

.pad-head { padding: 16px 20px 0; }
.stk-break tfoot td, .table tfoot td { font-weight: 700; background: #F4F6FA; border-top: 2px solid var(--line); padding: 12px 16px; }
.pct-cell { font-weight: 700; }
.heat-0 { } .heat-1 { background: #FDF0EE; } .heat-2 { background: #FADDD8; } .heat-3 { background: #F6C4BC; } .heat-4 { background: #F0A79C; color: #7D1D12; }
.chart .bar-cur { fill: var(--red); }
.chart .bar-prev { fill: #C9D3DE; }
.chart .bar-val { fill: var(--text-2); font-size: 11px; font-weight: 700; font-family: var(--font); }
.lg-cur { background: var(--red); } .lg-prev { background: #C9D3DE; }
.count-pill.c-navy-pill { background: var(--navy); }

/* stores admin */
.store-add { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.store-add .field { min-width: 160px; }
.store-add .field.grow { flex: 1; min-width: 240px; }
.cell-input { border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; width: 100%; min-width: 110px; }
.cell-input.wide { min-width: 260px; }
.cell-input:hover { border-color: var(--line); background: #FBFCFD; }
.cell-input:focus { outline: none; border-color: #7FA0C4; background: #fff; }

/* sticky table headers on long lists: the list scrolls inside its card, header stays visible */
.table-scroll.sticky-head { max-height: calc(100vh - 150px); overflow: auto; overscroll-behavior: contain; }
.table-scroll.sticky-head thead th { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--line); }
.table-scroll.sticky-head thead th.sticky-col { z-index: 4; }

/* ---------- supplier reconciliation ---------- */
.days-off { background: #F1F3F5 !important; color: #9AA4AF; }
.status.off-grey { background: #EEF1F4; color: #7A8591; }
.cycle-note { display: block; font-size: 11.5px; }
.diff-material { color: var(--red); font-weight: 700; background: #FFF4F2; }
.diff-minor { color: #8A6100; }
.warn-dot { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; margin-inline-start: 6px; vertical-align: 1px; }
.export-actions { margin-inline-start: auto; }
.export-card { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.export-card .field { min-width: 200px; flex: 1; }
.export-go { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.vr-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vr-kpis .stk-kpi-val { font-size: 23px; }
.vr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.vr-side { display: flex; flex-direction: column; gap: 12px; }
.side-title { font-size: 14.5px; }
.vr-thumb { width: 100%; max-height: 300px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #F7F9FB; }
.vr-pdf { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 12px; background: var(--red-l); color: var(--red); font-weight: 600; font-size: 13px; word-break: break-all; }
.vr-pdf .ic { width: 28px; height: 28px; flex: none; }
.vr-file-actions, .vr-actions { display: flex; flex-direction: column; gap: 8px; }
.vr-actions { border-top: 1px dashed var(--line); padding-top: 12px; }
.vr-actions .btn, .vr-file-actions .btn { width: 100%; }
.return-form { display: flex; flex-direction: column; gap: 6px; }
.return-form textarea { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: vertical; }
.btn-green { background: var(--green); box-shadow: 0 6px 14px -8px rgba(34,135,90,.9); }
.btn-green:hover { background: #1B7049; }
.btn-danger, .btn-danger:hover { background: var(--red); }
.btn-danger-ghost { color: var(--red); border-color: #F1C4BE; }
.btn-danger-ghost:hover { background: var(--red-l); }
.vr-notes { border-top: 1px solid var(--line-2); font-size: 13.5px; }
.ok-text { color: var(--green); font-weight: 700; }
.vr-form-card { gap: 14px; }
.vr-lines td { vertical-align: middle; padding: 8px 6px; }
.vr-lines select, .vr-lines input { width: 100%; min-width: 120px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; background: #fff; }
.vr-lines td:nth-child(5) input { min-width: 220px; }
.vr-lines td:last-child { width: 44px; }
.money-input { font-variant-numeric: tabular-nums; }
.remove-line { color: #B5BEC8; }
.remove-line:hover { color: var(--red); background: var(--red-l); }
.add-line { align-self: flex-start; }
.vr-totals { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; padding: 14px 18px; border-radius: 14px; background: #fff; border: 2px solid var(--line); }
.vr-totals > div { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); }
.vr-totals strong { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.vr-totals .vr-check { flex: 1; min-width: 220px; font-weight: 700; margin: 0; }
.vr-totals.is-ok { border-color: #BFE3CF; background: #F4FBF7; }
.vr-totals.is-ok .vr-check { color: var(--green); }
.vr-totals.is-bad { border-color: #F1C4BE; background: #FFF8F7; }
.vr-totals.is-bad .vr-check { color: var(--red); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 18px; align-items: start; }
.list-add { display: flex; gap: 8px; padding: 0 20px 14px; flex-wrap: wrap; }
.list-add input { flex: 1; min-width: 140px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #FBFCFD; }
.store-add .grow { flex: 1; }
.danger-card { border: 1px solid #F1C4BE; }
.restore-inline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.restore-inline input { border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; min-width: 150px; }
pre.cmd { background: #0F2238; color: #CFE3F5; padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; margin: 8px 0 0; }
@media (max-width: 1100px) { .vr-grid { grid-template-columns: 1fr; } .vr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.inline-field { flex-direction: row; align-items: center; gap: 10px; }
.inline-field select { min-width: 220px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--card); }
.pager a { min-width: auto; padding: 0 14px; }

/* vendor excel import */
.import-card { border: 1px solid #CFE0EE; background: linear-gradient(180deg, #F7FBFF, #fff 60%); }
.import-steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.import-steps .link .ic { width: 14px; height: 14px; vertical-align: -2px; }
.vi-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vi-table { max-height: 420px; border: 1px solid var(--line-2); border-radius: 12px; }
.vi-from { color: var(--muted); text-decoration: line-through; }
.vi-to { color: var(--green); font-weight: 700; }
.vi-cont td { border-top: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .grid-main { grid-template-columns: 1fr; }
  .stk-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) { .stk-kpis { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .sidebar { transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10,25,42,.45); z-index: 35; }
  .main { margin-inline-start: 0; }
  .menu-btn { display: grid; }
  .topbar, .content, .foot { padding-inline: 16px; }
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: 36px 20px; }
  .hero-chart, .hero-mods { display: none; }
  .hero-inner { gap: 18px; }
}
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .today { display: none; }
  .topbar-title h1 { font-size: 18px; }
  .hero { padding: 20px; }
  .hero-stats { width: 100%; }
  .hs { flex: 1; min-width: 0; }
  .kpi-value { font-size: 26px; }
  .card { padding: 16px; }
  .login-top { position: static; margin-bottom: 18px; }
  .login-panel { flex-direction: column; }
  .profile-lang { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .sidebar, .topbar, .foot, .scrim { display: none !important; } .main { margin: 0; } }

/* editable list tables (save-all) */
tr.row-changed td { background: var(--cream); }
tr.row-changed .cell-input { border-color: #EBD68E; background: #FFFDF4; }
form[data-rows-form] .sticky-save { z-index: 5; }
form[data-rows-form].is-dirty .sticky-save { background: color-mix(in srgb, var(--cream) 94%, transparent); }
.settings-lists { display: flex; flex-direction: column; gap: 14px; }
.sticky-save.card-save { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line-2); }

/* ================= cashflow ================= */
.dc-0 { --dc: #2a78d6; } .dc-1 { --dc: #eb6834; } .dc-2 { --dc: #1baf7a; } .dc-3 { --dc: #eda100; }
.dc-4 { --dc: #e87ba4; } .dc-5 { --dc: #008300; } .dc-6 { --dc: #4a3aa7; } .dc-7 { --dc: #e34948; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--dc, #C9D3DE); margin-inline-end: 8px; vertical-align: 0; flex: none; }
.cf-tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--card); padding: 6px; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line-2); }
.cf-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.cf-tab .ic { width: 17px; height: 17px; }
.cf-tab:hover { background: var(--line-2); color: var(--navy); }
.cf-tab.on { background: var(--navy); color: #fff; }
.cf-tab-set { margin-inline-start: auto; color: var(--muted); }
.cf-period { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cf-month { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 6px 4px 12px; }
.cf-month select { border: 0; background: transparent; font-weight: 700; padding: 6px 4px; cursor: pointer; }
.cf-month .ic { color: var(--navy); width: 18px; height: 18px; }
.cf-range { color: var(--muted); font-size: 13px; margin-inline-start: auto; }
.cf-custom { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.cf-custom .field { min-width: 170px; }
.cf-note { display: flex; align-items: center; gap: 10px; }
.cf-note span { flex: 1; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.cf-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cf-kpis .stk-kpi-val { font-size: 22px; }
.cf-kpis .stk-kpi.is-main .stk-kpi-val { font-size: 25px; }
.cf-delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.cf-delta .ic { width: 13px; height: 13px; }
.cf-delta.bad { color: var(--red); } .cf-delta.good { color: var(--green); }
.cf-low { display: inline-flex; align-items: center; gap: 4px; color: var(--red); font-weight: 700; }
.cf-low .ic { width: 15px; height: 15px; }
.cf-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.cf-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.cf-pie { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.cf-pie-fig { position: sticky; top: 90px; }
.cf-donut { width: 100%; max-width: 250px; display: block; margin: 0 auto; }
.donut-seg { fill: var(--dc); stroke: #fff; stroke-width: 1; cursor: pointer; transition: opacity .15s, transform .15s; transform-origin: 110px 110px; }
.donut-seg.hl { transform: scale(1.035); }
.donut-seg.dim { opacity: .28; }
.donut-empty { fill: none; stroke: var(--line); stroke-width: 34; }
.donut-lbl { font-family: var(--font); font-size: 12px; fill: var(--muted); }
.donut-val { font-family: var(--font); font-size: 17px; font-weight: 700; fill: var(--text); }
.cf-legend td, .cf-legend th { padding: 9px 10px; }
.cf-grp { cursor: pointer; }
.cf-grp td:first-child { font-weight: 600; white-space: nowrap; }
.cf-grp:hover td, .cf-grp.hl td { background: #F6F8FB; }
.cf-grp[aria-expanded="true"] td { background: var(--navy-l); }
.cf-chev { width: 14px; height: 14px; color: var(--muted); vertical-align: -2px; transform: rotate(-90deg); transition: transform .15s; }
.cf-grp[aria-expanded="true"] .cf-chev { transform: rotate(90deg); }
.cf-legend-wrap { min-width: 0; overflow-x: auto; }
.cf-legend { font-size: 14px; }
.cf-sub td { font-size: 13.5px; background: #FBFCFD; }
.cf-sub td:first-child { padding-inline-start: 30px; }
.cf-sub a:hover { color: var(--navy); text-decoration: underline; }
.cf-acc { list-style: none; margin: 0; padding: 0; }
.cf-acc li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.cf-acc li bdi { font-weight: 600; }
.cf-acc bdi.neg { color: var(--red); }
.cf-acc-total { border-bottom: 0 !important; font-weight: 700; color: var(--navy); }
.cf-mini td { padding: 8px 6px; }
.cf-top td { padding: 9px 10px; }
.cf-top .rank { width: 28px; color: var(--muted); font-weight: 700; }
.cf-bar-cell { width: 28%; min-width: 120px; }
.cf-bar-cell .meter { width: 100%; height: 8px; display: block; }
.cf-empty { padding: 18px 20px; }
.cf-toolbar { justify-content: space-between; }
.cf-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
.cf-filters select, .cf-vcode { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--card); max-width: 210px; }
.cf-vcode { width: 130px; font-family: ui-monospace, Consolas, monospace; }
.cf-filters .search { min-width: 180px; max-width: 260px; }
.cf-list-head { gap: 16px; }
.cf-list-head h3 { flex: 0 1 auto; }
.cf-sum { font-size: 13.5px; font-weight: 600; }
.cf-sum.in bdi { color: var(--green); } .cf-sum.out bdi { color: var(--red); }
.cf-lock-note { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.cf-lock-note .ic, .row-actions .muted .ic { width: 15px; height: 15px; }
.d-block { display: block; }
.cf-entries td { vertical-align: top; }
.cf-desc { max-width: 340px; }
.cf-amt { font-weight: 700; }
.cf-amt.in { color: var(--green); } .cf-amt.out { color: var(--text); } .cf-amt.tr { color: var(--navy); }
.tag-refund { background: var(--green-l); color: #16603F; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px; }
.cf-form { border: 2px solid var(--navy-l); }
.cf-form-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cf-refund .check { display: inline-flex; gap: 8px; align-items: center; padding: 10px 0 0; font-weight: 600; }
.cf-dup-ok { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-weight: 600; }
.cf-help p { margin-bottom: 8px; }
.cf-help summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.cf-title-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.cf-title-list strong { margin-inline-start: 8px; font-size: 12.5px; }
.cf-pv-sums { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 600; margin: 6px 0 12px; }
.cf-apply { display: inline-flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cf-batches { padding: 12px 18px; }
.cf-batches summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.cf-batches table { margin-top: 10px; }
.cf-daily th, .cf-daily td { padding: 8px 10px; font-size: 13.5px; }
.cf-daily th .sw { margin-inline-end: 4px; }
.cf-daily .row-off td { opacity: .5; }
.cf-in { color: var(--green); } .cf-out { color: var(--text); font-weight: 600; }
.pos { color: var(--green); }
.cf-daily .status .ic { width: 13px; height: 13px; }
.cf-report .card-head { flex-wrap: wrap; }
.cf-rep td { padding: 9px 14px; }
.cf-rep-sec td { background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 14px; }
.cf-rep-grp td { font-weight: 700; background: #F7F9FB; }
.cf-rep-tot td { font-weight: 700; border-top: 2px solid var(--line); background: #F4F6FA; }
.cf-rep-bal td { font-weight: 700; color: var(--navy); background: var(--cream); font-size: 15px; }
.cf-ind { padding-inline-start: 30px !important; }
.cf-close-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cf-close-day { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.cf-close-day .field { min-width: 190px; }
.cf-close-day .hint { flex: 1; min-width: 220px; }
.cf-actual { width: 100%; min-width: 130px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #FBFCFD; }
.cf-actual:focus { outline: none; border-color: #7FA0C4; background: #fff; }
.cf-diff { font-weight: 700; }
.cf-close-actions { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-top: 12px; }
.cf-close-actions .grow { flex: 1; min-width: 220px; }
.cf-ok { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 700; padding: 10px 0; }
.cf-order { max-width: 70px; min-width: 60px; }
.cf-aliases { min-width: 180px; font-size: 12.5px; }
.cf-cats-table td { padding: 6px 8px; }
.cf-set-intro { margin-bottom: -6px; }
.cf-set-intro .link { color: var(--navy); font-weight: 600; }
@media (max-width: 1200px) { .cf-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cf-grid, .cf-close-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .cf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cf-kpis .stk-kpi-val, .cf-kpis .stk-kpi.is-main .stk-kpi-val { font-size: 18px; }
  .cf-kpis .stk-kpi { padding: 14px; }
  .cf-pie { grid-template-columns: 1fr; }
  .cf-pie-fig { position: static; }
  .cf-tab span { display: none; }
  .cf-tab.on span { display: inline; }
  .cf-range { margin-inline-start: 0; }
}
.cf-close-lead { margin: 4px 0 10px; color: var(--text-2); }
.cf-close-table tfoot td { padding: 10px 14px; }
.cf-diff-row td { font-size: 15px; }
.cf-rate-row td { background: #FBFCFD; font-size: 13.5px; }
.cf-acc li.neg bdi, .cf-acc li.neg span { color: var(--red); }
.cf-acc li.ok-text bdi { color: var(--green); }
.cf-mode { display: flex; gap: 8px; align-items: center; font-weight: 600; margin: 4px 0; }

/* fire insurance */
.fi-cov { cursor: default; --tc: var(--teal); }
.fi-cov:hover { transform: none; }
.fi-table .fi-cov-in { min-width: 150px; max-width: 200px; text-align: left; }
.fi-table .fi-date { min-width: 150px; max-width: 170px; }
.fi-table td.days { font-weight: 700; }
.dl-over { background: var(--red-l) !important; color: var(--red) !important; }
.fi-files { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); padding: 3px 10px; border-radius: 999px; border: 1px dashed var(--line); white-space: nowrap; }
.fi-files .ic { width: 15px; height: 15px; }
.fi-files.has { color: var(--navy); border: 1px solid var(--navy-l); background: var(--navy-l); font-weight: 600; }
.fi-files:hover { border-color: var(--navy); color: var(--navy); }

/* دکمه «ذخیره همه تغییرات» همیشه پایین صفحه دیده شود (overflow:hidden کارت، sticky را از کار می‌انداخت) */
form[data-rows-form].table-card { overflow: clip; }
form[data-rows-form] > .sticky-save { z-index: 6; border-radius: 0 0 var(--radius) var(--radius); }
form[data-rows-form].is-dirty > .sticky-save { box-shadow: 0 -8px 20px -12px rgba(16,39,65,.35); }
form[data-rows-form].is-dirty > .sticky-save .btn { background: var(--green); }

/* backup: storage usage */
.bk-usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 10px; }
.bk-usage > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; }
.bk-usage strong { font-size: 1.1rem; }

/* ---------- cash budget ---------- */
.cb-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cb-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cb-title { display: flex; flex-direction: column; }
.cb-title strong { font-size: 17px; }
.cb-kpis { margin-bottom: 16px; }
.cb-pay-chip { display: inline-block; margin-inline-end: 8px; white-space: nowrap; }
.cb-grid { font-size: 13px; }
.cb-grid th, .cb-grid td { padding: 5px 4px; }
.cb-grid .cb-lbl { position: sticky; inset-inline-start: 0; background: var(--card); z-index: 1; min-width: 150px; max-width: 190px; font-weight: 600; white-space: normal; line-height: 1.35; }
.cb-grid thead th { vertical-align: bottom; }
.cb-grid .cb-day { min-width: 88px; }
.cb-wd { display: block; font-weight: 700; }
.cb-date { color: var(--muted); font-weight: 400; font-size: 12px; }
.cb-grid .cell-input { min-width: 84px; text-align: left; padding: 4px 5px; font-size: 13px; border-color: var(--line-2); background: #FBFCFD; }
.cb-grid .cell-input:focus { border-color: var(--navy); background: #fff; outline: none; }
.cb-grid th.cb-payday, .cb-grid td.cb-payday { background: #FFF6CC; }
.cb-grid .cb-edge { color: var(--muted); }
.cb-grid td.cb-prev { background: #F4F6F9; color: var(--muted); }
.cb-grid td.cb-na { background: repeating-linear-gradient(45deg, #F7F8FA, #F7F8FA 6px, #EFF2F5 6px, #EFF2F5 12px); }
.cb-sec td { background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; padding: 6px 12px; }
.cb-sec td:first-child { position: sticky; inset-inline-start: 0; }
.cb-tot td { font-weight: 700; background: #F4F6FA; border-top: 2px solid var(--line); }
.cb-tot .cb-lbl { background: #F4F6FA; }
.cb-pay td { font-weight: 700; }
.cb-pay .cb-lbl { color: var(--navy); }
.cb-rule { display: block; font-size: 11px; font-weight: 600; color: #8A6D00; }
.cb-rem td { font-weight: 700; background: var(--cream); }
.cb-rem .cb-lbl { background: var(--cream); }
.cb-idx td { padding: 3px 8px; }
.cb-idx td span { display: inline-block; min-width: 28px; text-align: center; background: #8FD14F; color: #173300; font-weight: 700; border-radius: 6px; padding: 0 6px; }
.cb-idx-badge { display: inline-block; min-width: 24px; text-align: center; background: #8FD14F; color: #173300; font-weight: 700; border-radius: 6px; }
.cb-sum { background: #FAFBFC; font-weight: 700; }
.cb-notes { padding: 10px 18px 4px; display: grid; gap: 4px; }
.cb-due { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 18px 12px; padding: 12px 14px; background: var(--cream); border-radius: var(--radius-sm); }
.cb-due ul { margin: 6px 0 0; padding-inline-start: 18px; font-size: 13.5px; }
.cb-exp-form { padding: 14px 18px 18px; border-top: 1px solid var(--line-2); }
.cb-flow .form-actions { flex-wrap: wrap; align-items: center; }
.cb-return { display: flex; gap: 8px; flex-wrap: wrap; }
.cb-return input { min-width: 220px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.cb-dom { width: 70px; min-width: 70px; }
.cb-rec-table select { max-width: 220px; }
.status.cb-st-draft { background: var(--amber-l); color: #A96400; }
.status.cb-st-submitted { background: var(--navy-l); color: var(--navy); }
.status.cb-st-returned { background: var(--red-l); color: var(--red); }
.status.cb-st-approved { background: var(--green-l); color: var(--green); }
.status.cb-st-none { background: #EEF1F4; color: #7A8591; }
.cb-dash li .bl-top strong { font-size: 15px; }
.cb-map select { min-width: 180px; }

.cb-hint { display: block; font-size: 10px; color: var(--muted); line-height: 1.3; margin-top: 2px; white-space: nowrap; }
.cb-hint.warn { color: var(--red); font-weight: 700; white-space: normal; }
.cb-grid input.cb-in:has(+ .cb-hint.warn) { border-color: var(--red); }
.cb-mapcard { padding: 14px 18px; margin-bottom: 16px; }
.cb-mapcard summary { cursor: pointer; display: flex; align-items: center; gap: 8px; list-style: none; }
.cb-mapcard summary::-webkit-details-marker { display: none; }
.cb-mapcard[open] summary { margin-bottom: 10px; }
.cb-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 10px 0; }
.cb-rec-auto { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 18px 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: #F4F6F9; }
.cb-rec-auto.on { background: var(--green-l); }
/* budget grid: keep row colours on hover */
.table.cb-grid tbody tr:hover td { background: transparent; }
.table.cb-grid tbody tr.cb-sec td { background: var(--navy); }
.table.cb-grid tbody tr.cb-tot td { background: #F4F6FA; }
.table.cb-grid tbody tr.cb-rem td { background: var(--cream); }
.table.cb-grid tbody tr td.cb-lbl { background: var(--card); }
.table.cb-grid tbody tr.cb-tot td.cb-lbl { background: #F4F6FA; }
.table.cb-grid tbody tr.cb-rem td.cb-lbl { background: var(--cream); }
.table.cb-grid tbody tr td.cb-payday { background: #FFF6CC; }
.table.cb-grid tbody tr td.cb-prev { background: #F4F6F9; }
.table.cb-grid tbody tr td.cb-na { background: repeating-linear-gradient(45deg, #F7F8FA, #F7F8FA 6px, #EFF2F5 6px, #EFF2F5 12px); }
.table.cb-grid tbody tr td.cb-sum { background: #FAFBFC; }
.table.cb-grid tbody tr:hover td.cb-lbl { background: #F2F5F9; }

/* ---------- supplier payments ---------- */
.sp-control { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.sp-day { background: var(--card); border: 1px solid var(--line-2); border-top: 4px solid var(--green); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.sp-day.over { border-top-color: var(--red); background: #FFF8F8; }
.sp-day.sp-total { border-top-color: var(--navy); }
.sp-day-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.sp-day-head small { flex-basis: 100%; }
.sp-day dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 14px; }
.sp-day dt { color: var(--muted); }
.sp-day dd { margin: 0; text-align: left; font-weight: 700; }
.sp-left { font-weight: 700; font-size: 14px; }
.sp-prev { margin: 8px 0; padding-inline-start: 18px; }

.sp-fin { font-size: 13px; }
.sp-fin .cell-input.sp-num { min-width: 110px; text-align: left; }
.cell-input.sp-time { min-width: 96px; }
.sp-fin td.sp-changed { background: #FFF6CC; }
.sp-fin tr.sp-stop td { background: #FDECEC; }
.sp-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: st; }
.sp-steps li { counter-increment: st; padding: 6px 12px; border-radius: 999px; background: #EEF1F4; color: #7A8591; font-size: 13px; font-weight: 600; }
.sp-steps li::before { content: counter(st) ". "; }
.sp-steps li.done { background: var(--green-l); color: var(--green); }
.sp-steps li.now { background: var(--navy); color: #fff; }
.sp-hist { margin-top: 12px; font-size: 13px; }

/* ---------- supplier payment print form ---------- */
.sp-print-body { background: #fff; }
.sp-print { max-width: 1400px; margin: 0 auto; padding: 18px; color: #000; position: relative; }
.sp-print-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.sp-print-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 12px; }
.sp-print-head h1 { font-size: 20px; color: var(--navy); }
.sp-print-meta { text-align: left; font-size: 12px; }
.sp-print-status { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.sp-print-status.ok { background: var(--green-l); color: var(--green); }
.sp-print-status.draft { background: var(--red-l); color: var(--red); }
.sp-print-watermark { text-align: center; font-weight: 700; color: var(--red); border: 2px dashed var(--red); padding: 4px; margin-bottom: 10px; }
.sp-print-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 14px; }
.sp-print-table th, .sp-print-table td { border: 1px solid #9AA6B2; padding: 3px 5px; vertical-align: top; }
.sp-print-table th { background: var(--navy); color: #fff; font-weight: 700; }
.sp-print-table td.num { text-align: left; white-space: nowrap; }
.sp-print-table td.strong { font-weight: 700; }
.sp-print-table tfoot td { font-weight: 700; background: #F1F4F8; }
.sp-print-table tr.changed td { background: #FFF6CC; }
.sp-print-table tr.stop td { background: #FDECEC; }
.sp-print-chain tr.pending td { color: #8A95A1; }
.sp-print-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
@media (max-width: 800px) { .sp-print-grid { grid-template-columns: 1fr; } .sp-print { overflow-x: auto; } }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  .no-print { display: none !important; }
  .sp-print { padding: 0; max-width: none; }
  .sp-print-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sp-print-table tr.changed td, .sp-print-table tr.stop td, .sp-print-status { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- budget actual & weekly close ---------- */
.table.cb-grid tbody tr.cb-adj td { background: #EEF6FF; font-weight: 700; }
.ca-cmp tr.ca-sub td { font-size: 13px; color: var(--text-2); background: #FAFBFC; }
.ca-score { display: inline-block; min-width: 58px; text-align: center; padding: 1px 8px; border-radius: 999px; font-weight: 700; background: #EEF1F4; }
.ca-score.sc-good, .stk-kpi-val.sc-good { color: var(--green); }
.ca-score.sc-good { background: var(--green-l); }
.ca-score.sc-mid, .stk-kpi-val.sc-mid { color: #A96400; }
.ca-score.sc-mid { background: var(--amber-l); }
.ca-score.sc-bad, .stk-kpi-val.sc-bad { color: var(--red); }
.ca-score.sc-bad { background: var(--red-l); }
.ca-close-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0 0 14px; max-width: 560px; }
.ca-close-dl dt { color: var(--muted); }
.ca-close-dl dd { margin: 0; text-align: left; }
.ca-trend td, .ca-trend th { text-align: center; }

/* ---------- license lock ---------- */
.lic-lock { max-width: 520px; margin: 8vh auto; text-align: center; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 36px 28px; }
.lic-lock-icon { font-size: 44px; line-height: 1; margin-bottom: 12px; }
.lic-lock h1 { font-size: 22px; color: var(--navy); margin-bottom: 4px; }
.lic-lock p { margin: 8px 0; color: var(--text-2); }
.lic-lock .lic-ar { color: var(--muted); }
.lic-lock-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.ni-cmpform { gap: 12px; }
.ni-cmp-opts { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 10px; }
.ni-monthpick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ni-months { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.ni-months .check { background: #f3f5f8; border-radius: 8px; padding: 4px 10px; }
