/* ==========================================================================
   سیستم مدیریت وظایف — استایل اصلی (بدون وابستگی به CDN)
   دو تم: روشن (پیش‌فرض) و تیره — با data-theme روی <html>
   ========================================================================== */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #F5F5F6;
  --surface: #FFFFFF;
  --surface-2: #F4F4F5;
  --surface-3: #E9E9EC;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;
  --text: #09090B;
  --text-2: #3F3F46;
  --muted: #5F5F69;
  --faint: #85858F;
  --primary: #0A0A0B;
  --on-primary: #FFFFFF;
  --primary-hover: #27272A;
  --sidebar: #FFFFFF;
  --nav-active: #F1F1F3;
  --overlay: rgba(9, 9, 11, .45);
  --ring: rgba(10, 10, 11, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .05);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .25);

  --done: #166534;   --done-bg: #DCFCE7;   --done-solid: #16A34A;
  --undone: #991B1B; --undone-bg: #FEE2E2; --undone-solid: #DC2626;
  --prog: #92400E;   --prog-bg: #FEF3C7;   --prog-solid: #D97706;
  --leave: #1E40AF;  --leave-bg: #DBEAFE;  --leave-solid: #2563EB;
  --none: #52525B;   --none-bg: #F1F1F3;

  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0A0A0B;
  --surface: #131315;
  --surface-2: #18181B;
  --surface-3: #232327;
  --border: #232327;
  --border-strong: #2E2E33;
  --text: #F4F4F5;
  --text-2: #D4D4D8;
  --muted: #A1A1AA;
  --faint: #8A8A93;
  --primary: #FAFAFA;
  --on-primary: #0A0A0B;
  --primary-hover: #E4E4E7;
  --sidebar: #0E0E10;
  --nav-active: #1F1F23;
  --overlay: rgba(0, 0, 0, .6);
  --ring: rgba(250, 250, 250, .16);
  --shadow: none;
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .7);

  --done: #6EE7B7;   --done-bg: rgba(52, 211, 153, .12);  --done-solid: #34D399;
  --undone: #FCA5A5; --undone-bg: rgba(248, 113, 113, .13); --undone-solid: #F87171;
  --prog: #FCD34D;   --prog-bg: rgba(251, 191, 36, .12);  --prog-solid: #FBBF24;
  --leave: #93C5FD;  --leave-bg: rgba(96, 165, 250, .13); --leave-solid: #60A5FA;
  --none: #B4B4BC;   --none-bg: #1E1E22;
  color-scheme: dark;
}

*, *::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.7;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.4; }
p { margin: 0; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--surface-3); }
svg.i { width: 18px; height: 18px; flex-shrink: 0; }
.ltr { direction: ltr; unicode-bidi: plaintext; }

/* ---------- چیدمان اصلی ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex-shrink: 0; background: var(--sidebar); border-left: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 16px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; color: var(--text);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
[data-theme="dark"] .brand-logo img.logo-auto { filter: invert(1) hue-rotate(180deg); mix-blend-mode: screen; }
.brand-name { font-weight: 800; font-size: 15px; line-height: 1.3; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-group { font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 12px 12px 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500; transition: background-color .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--nav-active); color: var(--text); font-weight: 650; box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav-link .grow { flex: 1; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: var(--on-primary);
}
.badge.soft { background: var(--surface-3); color: var(--text-2); }
.sidebar-foot { margin-top: auto; padding-top: 12px; }
.user-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1280px; padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.page-title { font-size: 24px; font-weight: 800; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.topbar { display: none; }
.drawer-overlay { display: none; }

/* ---------- اجزای پایه ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 700; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.mr-auto { margin-right: auto; }
.w-full { width: 100%; }
.center { text-align: center; }
.hidden { display: none !important; }

.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.grid-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.split { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.split.stretch { align-items: stretch; }
.split-main { flex: 999 1 560px; min-width: 0; }
.split-side { flex: 1 1 320px; min-width: 0; }

/* دکمه‌ها */
.btn {
  height: 42px; padding: 0 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; background: none; transition: background-color .15s, border-color .15s, opacity .15s;
  text-decoration: none; user-select: none;
}
.btn:focus-visible, .input:focus, .seg a:focus-visible, .nav-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--undone-solid); color: #fff; border-color: var(--undone-solid); }
.btn-danger-soft { background: var(--surface-2); color: var(--undone); border-color: var(--border-strong); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-lg { height: 50px; font-size: 15px; border-radius: 12px; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.dot { position: absolute; top: 9px; left: 10px; width: 8px; height: 8px; border-radius: 999px; background: var(--undone-solid); }

/* فرم‌ها */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.label .opt { font-weight: 400; color: var(--muted); }
.input {
  height: 42px; width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 12px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
[data-theme="dark"] .input { background-color: #0F0F11; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--text-2); }
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.8; }
select.input {
  appearance: none; -webkit-appearance: none; padding-left: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8A93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center;
}
input[type="file"].input { padding: 7px 10px; height: auto; font-size: 13px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > svg { position: absolute; right: 12px; color: var(--faint); pointer-events: none; }
.input-icon > .input { padding-right: 40px; }
.hint { font-size: 12.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* سوییچ */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background-color .15s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 999px;
  background: var(--surface); transition: right .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { right: 21px; background: var(--on-primary); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }

/* کنترل بخش‌بندی‌شده (تب‌های کوچک) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.seg a, .seg button, .seg label {
  height: 34px; padding: 0 14px; border-radius: 9px; border: none; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.seg a:hover, .seg button:hover, .seg label:hover { color: var(--text); }
.seg .on, .seg input:checked + label { background: var(--primary); color: var(--on-primary); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg .cnt { font-size: 11px; padding: 0 6px; height: 18px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); display: inline-flex; align-items: center; }
.seg .on .cnt { background: var(--on-primary); color: var(--primary); }

/* چیپ وضعیت و تگ نوع */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.c-done { background: var(--done-bg); color: var(--done); }
.c-undone { background: var(--undone-bg); color: var(--undone); }
.c-prog { background: var(--prog-bg); color: var(--prog); }
.c-leave { background: var(--leave-bg); color: var(--leave); }
.c-none { background: var(--none-bg); color: var(--none); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-2); white-space: nowrap; }

/* نوار پیشرفت */
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.bar.thin { height: 6px; }
.bar > span.ok { background: var(--done-solid); }
.bar > span.warn { background: var(--prog-solid); }
.bar > span.bad { background: var(--undone-solid); }
.bar > span.soft { background: var(--muted); }

/* آواتار */
.avatar {
  width: 36px; height: 36px; border-radius: 999px; background: var(--surface-3); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 52px; height: 52px; font-size: 16px; }
.avatar.xl { width: 60px; height: 60px; font-size: 18px; }
.avatar.inv { background: var(--primary); color: var(--on-primary); }

/* جدول */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tr.day-row td { background: var(--surface-2); padding: 9px 16px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.tbl tr.row-alert td { background: var(--undone-bg); }
.tbl tr.row-muted td { opacity: .6; }
.tbl .end { text-align: left; }

/* کارت آماری */
.stat { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1; }
.stat.mini { padding: 16px; gap: 6px; }
.stat.mini .stat-value { font-size: 24px; }
.stat.mini .stat-label { font-weight: 500; font-size: 12.5px; order: 2; }

/* حلقهٔ امتیاز */
.ring {
  --p: 0; --size: 168px; --thick: 14px;
  width: var(--size); height: var(--size); border-radius: 999px; flex-shrink: 0;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-3) 0);
  display: flex; align-items: center; justify-content: center;
}
.ring > div {
  width: calc(var(--size) - var(--thick) * 2); height: calc(var(--size) - var(--thick) * 2); border-radius: 999px; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.2;
}
.ring .ring-val { font-size: 38px; font-weight: 800; }
.ring.sm { --size: 76px; --thick: 7px; }
.ring.sm .ring-val { font-size: 17px; }

/* هشدار و پیام‌ها */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.8; border: 1px solid transparent; }
.alert svg { margin-top: 2px; }
.alert-success { background: var(--done-bg); color: var(--done); }
.alert-error { background: var(--undone-bg); color: var(--undone); }
.alert-warning { background: var(--prog-bg); color: var(--prog); }
.alert-info { background: var(--leave-bg); color: var(--leave); }
.flash-stack { display: flex; flex-direction: column; gap: 8px; }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* آیتم‌های فهرست */
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
a.list-item:hover { border-color: var(--border-strong); }
.icon-box { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface-3); color: var(--text-2); }
.icon-box.leave { background: var(--leave-bg); color: var(--leave); }
.icon-box.bad { background: var(--undone-bg); color: var(--undone); }
.icon-box.ok { background: var(--done-bg); color: var(--done); }
.quote { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 15px; line-height: 1.9; }

/* پیوست */
.thumb {
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.lg { width: 56px; height: 56px; border-radius: 12px; }

/* مودال */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; background: var(--overlay); overflow-y: auto; }
.modal.open { display: flex; }
.modal-box { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 22px; margin: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-box.wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 17px; font-weight: 700; }

/* نمودار ستونی روند */
.trend { display: flex; align-items: flex-end; gap: 10px; height: 200px; border-bottom: 1px solid var(--border); }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.trend-bar { width: 100%; max-width: 34px; border-radius: 8px 8px 0 0; background: var(--text-2); }
.trend-bar.today { background: var(--faint); }
.trend-bar.off { background: transparent; border: 1px dashed var(--border-strong); border-bottom: none; height: 40px; }
.trend-val { font-size: 11px; color: var(--muted); white-space: nowrap; }
.trend-labels { display: flex; gap: 10px; }
.trend-labels span { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); }

/* میله‌های افقی (گزارش تیم) */
.hbar-row { display: flex; align-items: center; gap: 14px; }
.hbar-name { width: 130px; font-size: 14px; font-weight: 600; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar { flex: 1; height: 26px; border-radius: 8px; background: var(--surface-2); position: relative; overflow: hidden; }
.hbar > span { position: absolute; top: 0; bottom: 0; right: 0; border-radius: 8px; background: var(--primary); }
.hbar > span.bad { background: var(--undone-solid); }
.hbar > i { position: absolute; top: 4px; bottom: 4px; width: 2px; background: var(--muted); }
.hbar-val { width: 50px; font-weight: 800; font-size: 15px; text-align: left; }

/* تقویم عملکرد */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-h { text-align: center; font-size: 12px; color: var(--muted); }
.cal-d {
  height: 58px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 1px solid var(--border); color: var(--faint); line-height: 1.3;
}
.cal-d b { font-size: 13px; }
.cal-d small { font-size: 10.5px; }
.cal-d.blank { border: none; }
.cal-d.p100 { background: var(--done-solid); border-color: var(--done-solid); color: #fff; }
.cal-d.p80 { background: var(--done-bg); border-color: transparent; color: var(--done); }
.cal-d.p50 { background: var(--prog-bg); border-color: transparent; color: var(--prog); }
.cal-d.p0 { background: var(--undone-bg); border-color: transparent; color: var(--undone); }
.cal-d.leave { background: var(--leave-bg); border-color: var(--leave-solid); color: var(--leave); }
.cal-d.off { border-style: dashed; border-color: var(--border-strong); color: var(--muted); }
.cal-d.today { border: 2px solid var(--primary); color: var(--text); }
.cal-d.empty-day { color: var(--muted); }
[data-theme="dark"] .cal-d.p100 { color: #052E1C; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* انتخاب‌گر چندتایی (کارمندان / روزهای هفته) */
.pick-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick span {
  height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text-2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.pick input:checked + span { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.pick input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.pick.wd span { width: 34px; height: 40px; padding: 0; justify-content: center; border-radius: 10px; font-weight: 700; }

/* انتخاب وضعیت با دکمه‌های بزرگ (کارتابل کارمند) */
.status-pick { display: flex; gap: 8px; }
.status-pick label { flex: 1; position: relative; }
.status-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.status-pick span {
  height: 46px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 0 6px;
}
.status-pick input:checked + span.s-done { background: var(--done-bg); border-color: var(--done-solid); color: var(--done); }
.status-pick input:checked + span.s-prog { background: var(--prog-bg); border-color: var(--prog-solid); color: var(--prog); }
.status-pick input:checked + span.s-undone { background: var(--undone-bg); border-color: var(--undone-solid); color: var(--undone); }
.status-pick input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }

/* کارت وظیفهٔ کارمند */
.task-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.task-card summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.task-card summary::-webkit-details-marker { display: none; }
.task-card[open] summary .chev { transform: rotate(180deg); }
.check-circle { width: 32px; height: 32px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border-strong); color: transparent; }
.check-circle.done { background: var(--done-solid); border-color: var(--done-solid); color: #fff; }
.check-circle.prog { border-color: var(--prog-solid); color: var(--prog-solid); }
.check-circle.undone { border-color: var(--undone-solid); color: var(--undone-solid); }
.upload-drop {
  flex: 1; min-height: 48px; border-radius: 12px; border: 1.5px dashed var(--border-strong); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; position: relative; padding: 6px 10px; text-align: center;
}
.upload-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.daily-msg { padding: 16px 18px; border-radius: 18px; background: var(--primary); color: var(--on-primary); display: flex; gap: 12px; }
.daily-msg .lbl { font-size: 12px; font-weight: 700; opacity: .7; }
.daily-msg .txt { font-size: 15px; font-weight: 600; line-height: 1.9; margin-top: 2px; }

/* گفتگوی تیکت */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; line-height: 1.9; }
.msg.mine { margin-left: auto; background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.msg.theirs { margin-right: auto; }
.msg .meta { font-size: 11.5px; opacity: .7; margin-bottom: 2px; }
.msg.mine a { color: var(--on-primary); text-decoration: underline; }
.ticket-item { display: block; padding: 12px; border-radius: 12px; border: 1px solid transparent; }
.ticket-item:hover { background: var(--surface-2); }
.ticket-item.active { background: var(--surface-2); border-color: var(--border-strong); }

/* منوی پایین موبایل (کارمند) */
.bottom-nav { display: none; }

/* دکمهٔ تم */
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* انتخاب‌گر تاریخ شمسی */
.jdp {
  position: absolute; z-index: 80; width: 280px; padding: 12px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 13px;
}
.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; }
.jdp-head button { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--surface-2); color: var(--text); cursor: pointer; }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.jdp-grid span { font-size: 11px; color: var(--muted); padding: 4px 0; }
.jdp-grid button { height: 34px; border-radius: 8px; border: none; background: transparent; color: var(--text); cursor: pointer; font-size: 13px; }
.jdp-grid button:hover { background: var(--surface-2); }
.jdp-grid button.sel { background: var(--primary); color: var(--on-primary); }
.jdp-grid button.tod { box-shadow: inset 0 0 0 1px var(--border-strong); }
.jdp-foot { display: flex; justify-content: space-between; margin-top: 8px; }

/* صفحهٔ ورود */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 26px; }
.auth-logo { width: 84px; height: 84px; border-radius: 22px; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 900px) {
  .content { padding: 20px 16px 48px; }
}
@media (max-width: 767.98px) {
  .sidebar {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: 290px; height: auto;
    transform: translateX(105%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .drawer-overlay { display: block; position: fixed; inset: 0; z-index: 45; background: var(--overlay); }
  body.sidebar-open { overflow: hidden; }
  .topbar {
    display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 16px; position: sticky; top: 0; z-index: 30;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .topbar .t { flex: 1; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-head .theme-toggle { display: none; }
  .page-title { font-size: 21px; }
  .hide-mobile { display: none !important; }
  .stat-value { font-size: 28px; }
  .hbar-name { width: 90px; font-size: 13px; }
  .msg { max-width: 92%; }
  .ring { --size: 150px; }

  /* کارمند: منوی پایین به‌جای همبرگری */
  body.role-employee .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 68px; padding: 0 6px env(safe-area-inset-bottom);
    background: var(--sidebar); border-top: 1px solid var(--border);
  }
  body.role-employee .content { padding-bottom: 100px; }
  body.role-employee .menu-btn { display: none; }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11.5px; font-weight: 600; color: var(--faint); position: relative;
  }
  .bottom-nav a.active { color: var(--text); }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav .bdot { position: absolute; top: 9px; right: 50%; margin-right: -18px; width: 8px; height: 8px; border-radius: 999px; background: var(--undone-solid); }
}
@media (min-width: 768px) {
  .only-mobile { display: none !important; }
}

/* ---------- چاپ ---------- */
@media print {
  :root, [data-theme="dark"] {
    --bg: #fff; --surface: #fff; --surface-2: #F4F4F5; --surface-3: #E4E4E7; --border: #D4D4D8; --border-strong: #A1A1AA;
    --text: #000; --text-2: #222; --muted: #444; --faint: #666; --primary: #000; --on-primary: #fff;
    --done: #166534; --done-bg: #DCFCE7; --undone: #991B1B; --undone-bg: #FEE2E2; --prog: #92400E; --prog-bg: #FEF3C7;
    --leave: #1E40AF; --leave-bg: #DBEAFE; --none: #444; --none-bg: #F1F1F3; color-scheme: light;
  }
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .bottom-nav, .no-print, .page-actions, .drawer-overlay, .modal { display: none !important; }
  .content { padding: 0; max-width: none; gap: 14px; }
  .card { box-shadow: none; break-inside: avoid; }
  .tbl-wrap { overflow: visible; }
  .tbl { min-width: 0 !important; font-size: 11.5px; }
  .tbl td, .tbl th { padding: 6px 8px; }
  .print-only { display: block !important; }
  #more-days { display: table-row-group !important; }
  .reveal-wrap { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.print-only { display: none; }

/* فرم تعریف وظیفه */
.step-no { width: 28px; height: 28px; border-radius: 999px; background: var(--primary); color: var(--on-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.pick span .avatar { width: 26px; height: 26px; font-size: 10px; margin-right: -6px; }
.pick span small { font-size: 11.5px; }
.pick input:checked + span .avatar { background: var(--on-primary); color: var(--primary); }
.pick input:checked + span small { color: inherit; opacity: .75; }

/* وضعیت آنلاین */
.avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.online-dot { position: absolute; bottom: 1px; left: 1px; width: 12px; height: 12px; border-radius: 999px; background: var(--done-solid); border: 2px solid var(--surface); }
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.presence.on { color: var(--done); font-weight: 600; }
.presence.on::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--done-solid); }
