/* DESK JALALI v3 — ریپرو | design language: dark "fitonist" dashboard, with a day variant (default)
   Author: SPSDEVNIC.NET */

@font-face {
  font-family: "Vazirmatn";
  src: url("../vendor/fonts/Vazirmatn-wght.woff2") format("woff2-variations"), url("../vendor/fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- tokens: day (default) ---------- */
:root {
  --canvas: linear-gradient(160deg, #dfe7ff 0%, #ece4ff 55%, #f3e9ff 100%);
  --shell: #f6f5fb;
  --card: #ffffff;
  --card-2: #f4f2fa;
  --card-3: #ebe8f4;
  --line: #e6e2f0;
  --line-2: #d9d4e7;
  --text: #17151f;
  --text-2: #4b4759;
  --muted: #8a8598;
  --pill-bg: #ecebf3;
  --pill-on-bg: #17151f;
  --pill-on-tx: #ffffff;
  --lilac: #b9a2f2;
  --lilac-2: #d8ccfa;
  --lilac-tx: #5b3fc4;
  --yellow: #f2d06b;
  --yellow-2: #fbecbe;
  --yellow-tx: #8a6400;
  --green: #8fe0a5;
  --green-2: #d4f6dd;
  --green-tx: #1f7a3c;
  --red: #f0868a;
  --red-2: #fde0e1;
  --red-tx: #b4232c;
  --blue-2: #dbe7ff;
  --blue-tx: #2c55c4;
  --shadow: 0 1px 2px rgba(23, 21, 31, .04), 0 8px 28px rgba(60, 45, 120, .07);
  --shadow-2: 0 20px 60px rgba(40, 30, 90, .18);
  --focus: 0 0 0 3px rgba(150, 120, 240, .35);
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --hatch: repeating-linear-gradient(135deg, rgba(23, 21, 31, .07) 0 2px, transparent 2px 9px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --canvas: #000000;
  --shell: #050505;
  --card: #161618;
  --card-2: #1e1e21;
  --card-3: #27272b;
  --line: #26262a;
  --line-2: #34343a;
  --text: #f3f2f7;
  --text-2: #c3c1cc;
  --muted: #8b8995;
  --pill-bg: #141416;
  --pill-on-bg: #ffffff;
  --pill-on-tx: #0b0b0c;
  --lilac: #c2adf5;
  --lilac-2: #3a3152;
  --lilac-tx: #d2c3fb;
  --yellow: #f1d27a;
  --yellow-2: #3b331c;
  --yellow-tx: #f4dc93;
  --green: #8fe6a6;
  --green-2: #1d3a25;
  --green-tx: #9ff0b4;
  --red: #f08a8e;
  --red-2: #44201f;
  --red-tx: #ffb2b4;
  --blue-2: #1d2a45;
  --blue-tx: #a9c3ff;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
  --shadow-2: 0 24px 70px rgba(0, 0, 0, .7);
  --focus: 0 0 0 3px rgba(194, 173, 245, .35);
  --hatch: repeating-linear-gradient(135deg, rgba(255, 255, 255, .09) 0 2px, transparent 2px 9px);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  background: var(--canvas);
  background-attachment: fixed;
  min-height: 100vh;
  font-feature-settings: "ss01";
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.4; font-weight: 700; }
p { margin: 0 0 .5em; }
.ic { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; vertical-align: -0.2em; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--card); padding: 8px 14px; border-radius: 10px; z-index: 99; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }
[hidden] { display: none !important; }
.num, .ltr { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- shell ---------- */
.shell {
  max-width: 1500px;
  margin: 18px auto;
  background: var(--shell);
  border-radius: 34px;
  box-shadow: var(--shadow-2);
  min-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}
:root[data-theme="dark"] .shell { border-color: #121214; }
.main { flex: 1; padding: 6px 28px 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
body.bare { display: grid; place-items: center; padding: 20px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 28px 14px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--shell);
  border-radius: 34px 34px 0 0;
}
.tb-brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; background: var(--pill-on-bg); color: var(--pill-on-tx); display: grid; place-items: center; }
.brand-mark .ic { width: 24px; height: 24px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt b { font-size: 20px; letter-spacing: -.3px; }
.brand-txt small { font-size: 11px; color: var(--muted); }
.icon-btn.nav-toggle { display: none; }

.pillnav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 4px;
  background: var(--pill-bg);
  border-radius: 999px;
  padding: 5px;
  border: 1px solid var(--line);
  min-width: 0;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; cursor: pointer;
  padding: 9px 15px; border-radius: 999px;
  color: var(--text-2); font-weight: 500; white-space: nowrap;
  transition: background .18s, color .18s;
}
.pill .ic { width: 17px; height: 17px; opacity: .8; }
.pill .caret { width: 12px; height: 12px; opacity: .55; }
.pill:hover { color: var(--text); background: var(--card-3); }
.pill.on { background: var(--pill-on-bg); color: var(--pill-on-tx); }
.pill.on .ic { opacity: 1; }
.pill-grp { position: relative; }
.pill-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-start: 50%; transform: translateX(50%);
  min-width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-2); padding: 8px; display: none; flex-direction: column; z-index: 50;
}
.pill-grp.open .pill-menu { display: flex; }
.pill-menu a { padding: 9px 14px; border-radius: 12px; color: var(--text-2); }
.pill-menu a:hover, .pill-menu a.on { background: var(--card-2); color: var(--text); }
.pill-menu a.on { font-weight: 700; }

.tb-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.qsearch { position: relative; display: flex; align-items: center; }
.qsearch .ic { position: absolute; inset-inline-start: 13px; color: var(--muted); pointer-events: none; }
.qsearch input {
  width: 46px; height: 46px; padding: 0 40px 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--pill-bg); transition: width .25s, background .2s; cursor: pointer;
}
.qsearch input:focus, .qsearch input:not(:placeholder-shown) { width: 250px; cursor: text; background: var(--card); }
.qsearch input::placeholder { color: transparent; }
.qsearch input:focus::placeholder { color: var(--muted); }
.icon-btn {
  position: relative; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--pill-bg); display: grid; place-items: center; cursor: pointer; color: var(--text);
}
.icon-btn:hover { background: var(--card-3); }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: -2px; inset-inline-end: -2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--lilac); color: #1a1530; font-size: 11px; font-style: normal; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.th-sun { display: none; }
:root[data-theme="dark"] .th-sun { display: block; }
:root[data-theme="dark"] .th-moon { display: none; }

.user-chip { position: relative; }
.uc-btn {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--pill-bg);
  border-radius: 999px; padding: 4px 4px 4px 14px; cursor: pointer;
}
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--lilac); color: #1a1530; display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.uc-txt { display: flex; flex-direction: column; line-height: 1.25; text-align: start; }
.uc-txt b { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-txt small { font-size: 11px; color: var(--muted); }
.uc-btn .caret { width: 12px; height: 12px; color: var(--muted); }
.dd-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; min-width: 210px; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-2); padding: 8px; display: none; z-index: 60;
}
[data-dd].open .dd-menu { display: block; }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; color: var(--text-2); text-align: start; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--card-2); color: var(--text); }
.dd-menu form { margin: 0; }
.badge { margin-inline-start: auto; font-style: normal; background: var(--lilac); color: #1a1530; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; }

/* ---------- page head ---------- */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 2px 0; }
.phead h1 { font-size: 24px; letter-spacing: -.3px; }
.phead .sub { color: var(--muted); margin: 2px 0 0; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.crumbs .ic { width: 11px; height: 11px; }
.crumbs a:hover { color: var(--text); }
.phead-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; flex-wrap: wrap; }
.card-h h2 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-h h2 .ic { color: var(--muted); }
.card-b { padding: 16px 22px 22px; }
.card.flush .card-b { padding: 12px 0 0; }
.card.sub { background: var(--card-2); box-shadow: none; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 380px; }
.span2 { grid-column: span 2; }
.g-dash1 { grid-template-columns: minmax(0, 1.45fr) minmax(0, .95fr) minmax(0, 1fr); }
.g-dash2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); }
@media (max-width: 1280px) { .g-dash1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .g-dash1 > :first-child { grid-column: 1 / -1; } .g-dash2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .g-dash2 > :last-child { grid-column: 1 / -1; } }
@media (max-width: 900px) { .g-dash1, .g-dash2 { grid-template-columns: 1fr; } }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s;
}
a.stat:hover { transform: translateY(-2px); }
.st-ic { width: 40px; height: 40px; border-radius: 13px; background: var(--card-2); display: grid; place-items: center; margin-bottom: 8px; }
.st-ic .ic { width: 20px; height: 20px; }
.st-v { font-size: 30px; font-weight: 300; letter-spacing: -.5px; line-height: 1.2; }
.st-l { color: var(--muted); font-size: 13px; }
.st-f { margin-top: 6px; }
.stat-lilac .st-ic { background: var(--lilac); color: #1a1530; }
.stat-yellow .st-ic { background: var(--yellow); color: #2a2104; }
.stat-green .st-ic { background: var(--green); color: #0e2a16; }
.stat-red .st-ic { background: var(--red); color: #2c0a0c; }
.stat-dark { background: var(--pill-on-bg); color: var(--pill-on-tx); border-color: transparent; }
.stat-dark .st-l { color: inherit; opacity: .65; }
.stat-dark .st-ic { background: rgba(127, 127, 127, .18); }

/* chips (the green "↗ 2.4%" pills) */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card-3); color: var(--text-2); white-space: nowrap; line-height: 1.9; }
.chip .ic { width: 12px; height: 12px; }
.chip-green { background: var(--green); color: #0f3a1c; }
.chip-yellow { background: var(--yellow); color: #3a2d00; }
.chip-lilac { background: var(--lilac); color: #231a44; }
.chip-red { background: var(--red); color: #3b0b0e; }
.chip-blue { background: var(--blue-2); color: var(--blue-tx); }
.chip-soft-green { background: var(--green-2); color: var(--green-tx); }
.chip-soft-yellow { background: var(--yellow-2); color: var(--yellow-tx); }
.chip-soft-red { background: var(--red-2); color: var(--red-tx); }
.chip-soft-lilac { background: var(--lilac-2); color: var(--lilac-tx); }
.chip-soft { background: var(--card-3); color: var(--muted); font-weight: 500; }
.dot-new { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px var(--red-2); }
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.letter-body { margin-top: 16px; padding: 18px 20px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); line-height: 2.1; white-space: normal; }
.file .thumb { position: relative; }
.file .thumb .ext { position: absolute; bottom: 6px; font-weight: 700; letter-spacing: .5px; }

/* segmented filter like "Taday | Week | Month" */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--pill-bg); border: 1px solid var(--line); border-radius: 999px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 5px 14px; border-radius: 999px; color: var(--text-2); white-space: nowrap; }
.seg input:checked + span { background: var(--pill-on-bg); color: var(--pill-on-tx); }
.seg input:focus-visible + span { box-shadow: var(--focus); }
.seg a { padding: 5px 14px; border-radius: 999px; color: var(--text-2); }
.seg a.on { background: var(--pill-on-bg); color: var(--pill-on-tx); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); cursor: pointer;
  font-weight: 500; white-space: nowrap; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 17px; height: 17px; }
.btn-pri { background: var(--pill-on-bg); color: var(--pill-on-tx); border-color: transparent; }
.btn-pri:hover { background: var(--pill-on-bg); opacity: .88; }
.btn-lilac { background: var(--lilac); color: #1d1636; border-color: transparent; }
.btn-lilac:hover { background: var(--lilac); filter: brightness(1.05); }
.btn-yellow { background: var(--yellow); color: #2d2300; border-color: transparent; }
.btn-green { background: var(--green); color: #0f3019; border-color: transparent; }
.btn-danger { background: var(--red-2); color: var(--red-tx); border-color: transparent; }
.btn-danger:hover { background: var(--red); color: #2b0709; }
.btn-soft { background: var(--card-2); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
form.inline { display: inline; margin: 0; }
.ibtn { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--card); color: var(--text-2); cursor: pointer; vertical-align: middle; }
.ibtn:hover { background: var(--card-2); color: var(--text); }
.ibtn .ic { width: 16px; height: 16px; }
.ibtn-danger:hover { background: var(--red-2); color: var(--red-tx); border-color: transparent; }
.ibtn-green:hover { background: var(--green-2); color: var(--green-tx); }
.acts { display: inline-flex; gap: 4px; align-items: center; flex-wrap: nowrap; }

/* ---------- alerts ---------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.alert .x { margin-inline-start: auto; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.alert-ok { background: var(--green-2); color: var(--green-tx); border-color: transparent; }
.alert-err { background: var(--red-2); color: var(--red-tx); border-color: transparent; }
.alert-info { background: var(--lilac-2); color: var(--lilac-tx); border-color: transparent; }
.alert-warn { background: var(--yellow-2); color: var(--yellow-tx); border-color: transparent; }
.note { padding: 10px 14px; border-radius: var(--r-sm); background: var(--card-2); color: var(--text-2); font-size: 13px; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 18px; }
.form-grid .wide, .form-grid .fld.wide, .form-grid > .form-actions { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > .seg { align-self: flex-start; }
.fld > label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.req { color: var(--red-tx); font-style: normal; }
.help { color: var(--muted); font-size: 12px; }
.inp {
  width: 100%; min-height: 44px; padding: 9px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--card); transition: border-color .15s, box-shadow .15s;
}
textarea.inp { resize: vertical; min-height: 88px; line-height: 1.8; }
.inp:focus { outline: none; border-color: var(--lilac); box-shadow: var(--focus); }
.inp[readonly], .inp:disabled { background: var(--card-2); color: var(--text-2); }
select.inp { appearance: none; -webkit-appearance: none; padding-inline-end: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 18px 50%, 13px 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select.inp[multiple] { background-image: none; min-height: 120px; }
.inp.num { direction: ltr; text-align: left; }
.inp.date { direction: ltr; text-align: left; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 0; }
.chk input { width: 18px; height: 18px; accent-color: var(--pill-on-bg); }
.grid > .grid { align-content: start; }
.qf-grid td:first-child { white-space: nowrap; color: var(--text-2); font-weight: 500; }
.qf-grid td .inp { min-width: 120px; }
.qf-grid .qf-calc td { background: var(--card-2); }
.qf-grid .qf-main td { background: var(--lilac-2); color: var(--lilac-tx); font-weight: 600; }
.rp-tbl .n { text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-tbl tfoot td { font-weight: 700; background: var(--card-3); }
.rp-filter { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.q-legend { margin: 14px 0 0; padding-inline-start: 22px; color: var(--muted); font-size: 12px; columns: 2; column-gap: 28px; }
.q-legend li { margin-bottom: 4px; }
@media (max-width: 700px) { .q-legend { columns: 1; } }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.fn-row { display: grid; grid-template-columns: 150px 1fr 60px; align-items: center; gap: 12px; }
.fn-l { color: var(--text-2); font-size: 13px; }
.fn-bar { height: 14px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.fn-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--lilac), var(--yellow)); }
.fn-row b { text-align: left; font-weight: 600; }
.qf-out { display: block; font-variant-numeric: tabular-nums; font-size: 15px; }
.g-side > .card, .g-side > form > .card { align-self: start; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.perm-grid .chk { padding: 10px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); }
.perm-grid .chk:has(input:checked) { background: var(--green-2); border-color: transparent; color: var(--green-tx); }
.sub-h { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 420px; }
.avatar-sm { width: 38px; height: 38px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--card-3); color: var(--muted); }
.avatar-sm img, .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 140px; height: 140px; margin: 0 auto 16px; border-radius: 32px; overflow: hidden; display: grid; place-items: center; background: var(--card-3); color: var(--muted); }
.avatar-lg .ic { width: 56px; height: 56px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.filebox { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); cursor: pointer; color: var(--text-2); background: var(--card-2); }
.filebox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.filebox:hover { border-color: var(--lilac); }
fieldset.group { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 18px 18px; margin: 0; min-width: 0; }
fieldset.group > legend { padding: 0 8px; font-weight: 600; color: var(--text-2); }

/* plate */
.plate { display: inline-flex; align-items: stretch; border: 2px solid var(--text); border-radius: 10px; overflow: hidden; background: #fff; color: #111; max-width: 340px; }
.plate .inp { border: 0; border-radius: 0; min-height: 44px; text-align: center; background: transparent; color: #111; padding: 6px 4px; font-weight: 700; font-size: 16px; box-shadow: none; }
.plate .pl-2 { width: 56px; }
.plate .pl-3 { width: 70px; }
.plate select.inp { width: 82px; background-image: none; padding: 6px 2px; text-align-last: center; }
.plate .pl-ir { display: flex; flex-direction: column; border-inline-start: 2px solid #111; width: 64px; }
.plate .pl-ir small { font-size: 10px; text-align: center; line-height: 1.5; }
.plate .pl-ir .inp { min-height: 28px; padding: 0 4px 4px; }
.plate-v { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--text-2); border-radius: 7px; padding: 0 8px; font-size: 13px; white-space: nowrap; }
.plate-v b { font-weight: 700; }
.plate-v i { font-style: normal; border-inline-start: 1.5px solid var(--text-2); padding-inline-start: 6px; }

/* combo (searchable select) */
.combo { position: relative; }
.combo-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 7px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card); cursor: pointer; text-align: start; }
.combo-btn .cv { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-btn .cv.ph { color: var(--muted); }
.combo-btn .ic { color: var(--muted); }
.combo.open .combo-btn, .combo-btn:focus { border-color: var(--lilac); box-shadow: var(--focus); outline: none; }
.combo.invalid .combo-btn { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-2); }
.combo-tags { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.combo-tags span { background: var(--lilac-2); color: var(--lilac-tx); border-radius: 999px; padding: 0 9px; font-size: 12px; }
.combo-pop { position: absolute; z-index: 70; top: calc(100% + 6px); inset-inline: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-2); padding: 8px; display: none; }
.combo.open .combo-pop { display: block; }
.combo-pop input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2); padding: 0 12px; margin-bottom: 6px; }
.combo-list { max-height: 260px; overflow: auto; }
.combo-list div { padding: 8px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.combo-list div:hover, .combo-list div.act { background: var(--card-2); }
.combo-list div.sel { font-weight: 700; background: var(--lilac-2); color: var(--lilac-tx); }
.combo-list .none { color: var(--muted); cursor: default; }

/* date picker */
.jdp { position: absolute; z-index: 90; width: 290px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-2); padding: 12px; direction: rtl; }
.jdp-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jdp-h b { font-weight: 600; }
.jdp-h button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card-2); cursor: pointer; display: grid; place-items: center; }
.jdp-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.jdp-g span { text-align: center; font-size: 11px; color: var(--muted); }
.jdp-g button { height: 34px; border: 0; border-radius: 10px; background: var(--card-2); cursor: pointer; }
.jdp-g button:hover { background: var(--card-3); }
.jdp-g button.today { box-shadow: inset 0 0 0 1.5px var(--lilac); }
.jdp-g button.sel { background: var(--lilac); color: #1a1530; font-weight: 700; }
.jdp-g button.fri { color: var(--red-tx); }
.jdp-f { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.jdp-f input { width: 64px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2); text-align: center; direction: ltr; }
.jdp-f .btn { height: 34px; }

/* ---------- tables ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tsearch { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; height: 42px; }
.tsearch input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; }
.tsearch .ic { color: var(--muted); }
.toolbar .inp { min-height: 42px; width: auto; border-radius: 999px; }
.tbl-wrap { overflow-x: auto; border-radius: var(--r-md); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.tbl th { font-size: 12px; font-weight: 500; color: var(--muted); text-align: start; padding: 4px 14px; white-space: nowrap; }
.tbl td { padding: 11px 14px; background: var(--card-2); vertical-align: middle; }
.tbl tr td:first-child { border-start-start-radius: 14px; border-end-start-radius: 14px; }
.tbl tr td:last-child { border-start-end-radius: 14px; border-end-end-radius: 14px; }
.tbl tbody tr:hover td { background: var(--card-3); }
.tbl .r-warn td { background: var(--red-2); }
.tbl .r-gray td { background: var(--card-3); }
.tbl .r-new td:first-child { box-shadow: inset -4px 0 0 var(--lilac); }
.tbl tfoot td { background: transparent; font-weight: 700; padding-top: 10px; }
.tbl .c { text-align: center; }
.tbl .e { text-align: end; }
.tbl .strong { font-weight: 600; }
.tbl.compact td { padding: 7px 12px; }
.tbl.plain { border-spacing: 0; }
.tbl.plain td { background: transparent; border-bottom: 1px solid var(--line); border-radius: 0 !important; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pg-info { color: var(--muted); font-size: 13px; }
.pager nav { display: flex; gap: 4px; align-items: center; }
.pager nav a, .pager nav b, .pager nav span { min-width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; padding: 0 8px; }
.pager nav a { background: var(--card-2); }
.pager nav a:hover { background: var(--card-3); }
.pager nav b { background: var(--pill-on-bg); color: var(--pill-on-tx); }
.pager nav .off { opacity: .35; }
.pager .ic { width: 14px; height: 14px; }

/* key/value lists */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.kv > div { background: var(--card-2); border-radius: var(--r-sm); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv span { font-size: 12px; color: var(--muted); }
.kv b { font-weight: 600; overflow-wrap: anywhere; }
.totals { display: flex; flex-direction: column; gap: 6px; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-radius: 12px; background: var(--card-2); }
.totals > div.big { background: var(--pill-on-bg); color: var(--pill-on-tx); font-size: 16px; }
.totals > div.big b { font-weight: 800; }

/* empty state */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 10px; color: var(--muted); text-align: center; }
.empty .ic { width: 42px; height: 42px; opacity: .5; }
.empty.big { padding: 70px 20px; }
.empty.big h2 { color: var(--text); }

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tl li { position: relative; padding: 12px 16px; background: var(--card-2); border-radius: 16px; }
.tl li .tl-h { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 4px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(10, 8, 20, .45); backdrop-filter: blur(3px); padding: 16px; }
.modal-card { width: min(460px, 100%); background: var(--card); border-radius: 26px; padding: 24px; box-shadow: var(--shadow-2); border: 1px solid var(--line); }
.modal-card.wide { width: min(720px, 100%); max-height: 90vh; overflow: auto; }
.modal-card h3 { margin-bottom: 8px; font-size: 18px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ---------- dashboard widgets ---------- */
.hero-num { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-num b { font-size: 46px; font-weight: 300; letter-spacing: -1.5px; line-height: 1.1; }
.hero-num + small { color: var(--muted); }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal .wd { text-align: center; font-size: 11px; color: var(--muted); }
.cal .d { position: relative; height: 46px; border-radius: 14px; background: var(--card-2); display: grid; place-items: center; font-size: 13px; border: 1px solid var(--line); }
.cal .d.off { background: transparent; border-color: transparent; color: var(--muted); opacity: .45; }
.cal .d.has { background: var(--card-3); }
.cal .d.hi { background: var(--lilac); color: #1a1530; border-color: transparent; font-weight: 700; }
.cal .d.today { background: var(--pill-on-bg); color: var(--pill-on-tx); border-color: transparent; font-weight: 700; }
.cal .d i { position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); }
.cal-foot { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); }
.cal-foot b { font-size: 26px; font-weight: 300; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 300px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; height: 100%; }
.bar .b1, .bar .b2 { border-radius: 14px; position: relative; min-height: 18px; display: grid; place-items: start center; padding-top: 4px; font-size: 11px; font-weight: 700; }
.bar .b1 { background: var(--card-3); }
.bar .b2 { background: var(--hatch), var(--card-2); border: 1px solid var(--line); }
.bar.top .b1 { background: var(--lilac); color: #1a1530; }
.bar.top .b2 { background: var(--yellow); color: #2d2300; border: 0; }
.bar small { text-align: center; color: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-inline-end: 5px; vertical-align: middle; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); }
.list-it .li-ic { width: 42px; height: 42px; border-radius: 13px; background: var(--card-3); display: grid; place-items: center; flex: none; }
.list-it .li-t { flex: 1; min-width: 0; }
.list-it .li-t b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-it .li-t small { color: var(--muted); }
.list-it .li-n { min-width: 54px; height: 46px; border-radius: 14px; background: var(--card-3); display: grid; place-items: center; font-size: 18px; font-weight: 300; padding: 0 10px; }
.list-it.warn { border-color: var(--red); }
.list-it.warn .li-n { background: var(--red-2); color: var(--red-tx); }
a.list-it:hover { background: var(--card-3); }
.list-it .li-v { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tl li.warn { box-shadow: inset -3px 0 0 var(--red); }
.tl li.done { opacity: .8; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .inp { flex: 1; min-width: 0; }
.num.neg { color: var(--red-tx); }
.num.pos { color: var(--green-tx, var(--text)); }
.bubbles { position: relative; height: 230px; }
.bubbles .bb { position: absolute; border-radius: 50%; display: grid; place-items: center; text-align: center; line-height: 1.2; color: #1a1530; }
.bubbles .bb b { font-size: 26px; font-weight: 300; display: block; }
.bubbles .bb small { font-size: 11px; }
.rank { display: flex; flex-direction: column; gap: 6px; }
.rank div { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); }
.rank div span { flex: 1; }
.rank div b { font-weight: 600; }

/* steps (reception workflow) */
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.steps a, .steps span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; }
.steps .on { background: var(--pill-on-bg); color: var(--pill-on-tx); border-color: transparent; }
.steps .done { background: var(--green-2); color: var(--green-tx); border-color: transparent; }
.steps .ic { width: 15px; height: 15px; }

/* survey table */
.qgrid td.opt { text-align: center; }
.qgrid input[type=radio] { width: 18px; height: 18px; accent-color: var(--pill-on-bg); }

/* attachment tiles */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.file { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.file .thumb { height: 100px; border-radius: 12px; background: var(--card-3); display: grid; place-items: center; overflow: hidden; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .thumb .ic { width: 38px; height: 38px; color: var(--muted); }
.file small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.file .acts { position: absolute; top: 14px; inset-inline-start: 14px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(980px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: var(--shell); border-radius: 34px; overflow: hidden; box-shadow: var(--shadow-2); border: 1px solid var(--line); }
.login-art { background: #0b0b0d; color: #f3f2f7; padding: 34px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; position: relative; overflow: hidden; }
.login-art .lg-num { font-size: 56px; font-weight: 200; letter-spacing: -2px; line-height: 1; }
.login-art .lg-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.login-art .lg-bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.login-art .lg-bars i { flex: 1; border-radius: 10px; background: #26262a; }
.login-art .lg-bars i.l { background: #c2adf5; }
.login-art .lg-bars i.y { background: #f1d27a; }
.login-art p { color: #9a98a3; margin: 0; }
.login-form { padding: 40px 38px; display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.login-form h1 { font-size: 26px; }
.login-form .brand { margin-bottom: 8px; }

/* footer */
.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 16px 28px 22px; color: var(--muted); font-size: 12px; }
.foot a:hover { color: var(--text); }

/* print */
@media print {
  body { background: #fff !important; color: #000; }
  .topbar, .foot, .no-print, .phead-act, .alert, .crumbs { display: none !important; }
  .shell { box-shadow: none; border: 0; margin: 0; border-radius: 0; background: #fff; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .tbl td { background: #fff !important; border-bottom: 1px solid #ddd; }
}

/* ---------- responsive ---------- */
@media (min-width: 1281px) {
  .pill > .ic:not(.caret) { display: none; }
  .pill.on > .ic:not(.caret) { display: block; }
  .pill { padding: 9px 13px; }
}
@media (max-width: 1640px) {
  .uc-txt { display: none; }
  .uc-btn { padding: 4px; }
  .uc-btn .caret { display: none; }
}
@media (max-width: 1280px) {
  .pill span { display: none; }
  .pill { padding: 10px 12px; }
  .pill.on span { display: inline; }
  .g-side { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .uc-txt { display: none; }
  .uc-btn { padding: 4px; }
}
@media (max-width: 900px) {
  .shell { margin: 0; border-radius: 0; min-height: 100vh; border: 0; }
  .topbar { border-radius: 0; padding: 12px 16px; flex-wrap: wrap; }
  .icon-btn.nav-toggle { display: grid; }
  .pillnav { display: none; order: 9; flex-basis: 100%; flex-direction: column; border-radius: 22px; padding: 8px; max-height: 70vh; overflow: auto; }
  .pillnav.open { display: flex; }
  .pill { justify-content: flex-start; width: 100%; padding: 11px 14px; }
  .pill span, .pill.on span { display: inline; }
  .pill .caret { margin-inline-start: auto; }
  .pill-menu { position: static; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 18px 6px; min-width: 0; }
  .tb-tools { margin-inline-start: auto; }
  .qsearch input:focus, .qsearch input:not(:placeholder-shown) { width: 170px; }
  .main { padding: 6px 16px 22px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .g4 > .stat { padding: 14px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stats .stat { padding: 14px; }
  .span2 { grid-column: auto; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 760px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { background: var(--card-2); border-radius: 16px; margin-bottom: 8px; padding: 6px 4px; }
  .tbl.stack td { background: transparent !important; display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; border-radius: 0 !important; text-align: end; }
  .tbl.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: start; flex: none; }
  .tbl.stack td.acts-cell { justify-content: flex-start; }
  .tbl.stack td.acts-cell::before { display: none; }
  .phead h1 { font-size: 20px; }
  .card-b { padding: 14px 16px 18px; }
  .card-h { padding: 16px 16px 0; }
  .hero-num b { font-size: 36px; }
  .bars { gap: 5px; }
}
@media (max-width: 520px) {
  .brand-txt small { display: none; }
  .qsearch { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .icon-btn { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
