/* HumaWatch — اجزای مشترک صفحه‌های تردد، درخواست‌ها و کارتابل.
   مستقل از build فرانت؛ با تم روشن/تیره‌ی پنل هماهنگه. */

:root {
  --hw-brand: #465fff;
  --hw-brand-600: #3641f5;
  --hw-brand-50: #ecf3ff;
  --hw-text: #1d2939;
  --hw-text-2: #475467;
  --hw-muted: #98a2b3;
  --hw-border: #e4e7ec;
  --hw-border-2: #f2f4f7;
  --hw-surface: #ffffff;
  --hw-surface-2: #f9fafb;
  --hw-success: #12b76a;
  --hw-success-bg: #ecfdf3;
  --hw-success-text: #027a48;
  --hw-warning: #f79009;
  --hw-warning-bg: #fffaeb;
  --hw-warning-text: #b54708;
  --hw-error: #f04438;
  --hw-error-bg: #fef3f2;
  --hw-error-text: #b42318;
  --hw-info: #0ba5ec;
  --hw-info-bg: #f0f9ff;
  --hw-info-text: #026aa2;
  --hw-purple: #7a5af8;
  --hw-purple-bg: #f4f3ff;
  --hw-purple-text: #5925dc;
}

.dark {
  --hw-brand-50: rgba(70, 95, 255, 0.14);
  --hw-text: rgba(255, 255, 255, 0.9);
  --hw-text-2: #98a2b3;
  --hw-muted: #667085;
  --hw-border: #1d2939;
  --hw-border-2: #1a2231;
  --hw-surface: #111827;
  --hw-surface-2: rgba(255, 255, 255, 0.03);
  --hw-success-bg: rgba(18, 183, 106, 0.14);
  --hw-success-text: #32d583;
  --hw-warning-bg: rgba(247, 144, 9, 0.14);
  --hw-warning-text: #fdb022;
  --hw-error-bg: rgba(240, 68, 56, 0.14);
  --hw-error-text: #f97066;
  --hw-info-bg: rgba(11, 165, 236, 0.14);
  --hw-info-text: #36bffa;
  --hw-purple-bg: rgba(122, 90, 248, 0.16);
  --hw-purple-text: #9b8afb;
}

/* ── کارت و بخش‌ها ── */
.hw-card { background: var(--hw-surface); border: 1px solid var(--hw-border); border-radius: 16px; padding: 20px; }
.hw-card-flush { background: var(--hw-surface); border: 1px solid var(--hw-border); border-radius: 16px; overflow: hidden; }
.hw-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hw-border-2); }
.hw-card-title { font-size: 15px; font-weight: 600; color: var(--hw-text); margin: 0; }
.hw-card-sub { font-size: 12px; color: var(--hw-text-2); margin-top: 2px; }
.hw-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.hw-page-title { font-size: 22px; font-weight: 700; color: var(--hw-text); margin: 0; }
.hw-page-sub { font-size: 13px; color: var(--hw-text-2); margin-top: 4px; }
.hw-section-gap > * + * { margin-top: 20px; }
.hw-grid { display: grid; gap: 16px; grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px) { .hw-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hw-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hw-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .hw-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hw-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hw-grid-side { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.hw-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hw-spacer { flex: 1; }
.hw-muted { color: var(--hw-text-2); }
.hw-small { font-size: 12px; }
.hw-ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.hw-num { font-variant-numeric: tabular-nums; }

/* ── آمار ── */
.hw-stat { background: var(--hw-surface); border: 1px solid var(--hw-border); border-radius: 16px; padding: 16px 18px; }
.hw-stat-label { font-size: 12px; color: var(--hw-text-2); }
.hw-stat-value { font-size: 24px; font-weight: 700; color: var(--hw-text); margin-top: 6px; font-variant-numeric: tabular-nums; }
.hw-stat-hint { font-size: 11px; color: var(--hw-muted); margin-top: 2px; }
.hw-stat-accent { border-inline-start: 4px solid var(--hw-brand); }
.hw-stat-accent.is-success { border-inline-start-color: var(--hw-success); }
.hw-stat-accent.is-error { border-inline-start-color: var(--hw-error); }
.hw-stat-accent.is-warning { border-inline-start-color: var(--hw-warning); }
.hw-stat-accent.is-purple { border-inline-start-color: var(--hw-purple); }

/* ── برچسب وضعیت ── */
.hw-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 11.5px; font-weight: 500; white-space: nowrap; background: var(--hw-border-2); color: var(--hw-text-2); }
.hw-badge.is-success { background: var(--hw-success-bg); color: var(--hw-success-text); }
.hw-badge.is-warning { background: var(--hw-warning-bg); color: var(--hw-warning-text); }
.hw-badge.is-error { background: var(--hw-error-bg); color: var(--hw-error-text); }
.hw-badge.is-info { background: var(--hw-info-bg); color: var(--hw-info-text); }
.hw-badge.is-brand { background: var(--hw-brand-50); color: var(--hw-brand); }
.hw-badge.is-purple { background: var(--hw-purple-bg); color: var(--hw-purple-text); }
.hw-count { display: inline-flex; min-width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 999px; background: var(--hw-error); color: #fff; font-size: 11px; font-weight: 600; padding: 0 6px; margin-inline-start: auto; }

/* ── دکمه‌ها ── */
.hw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 10px; font-size: 13.5px; font-weight: 500; border: 1px solid var(--hw-border); background: var(--hw-surface); color: var(--hw-text); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.hw-btn:hover { background: var(--hw-surface-2); }
.hw-btn:disabled { opacity: .55; cursor: not-allowed; }
.hw-btn-primary { background: var(--hw-brand); border-color: var(--hw-brand); color: #fff; }
.hw-btn-primary:hover { background: var(--hw-brand-600); }
.hw-btn-success { background: var(--hw-success); border-color: var(--hw-success); color: #fff; }
.hw-btn-success:hover { filter: brightness(.95); background: var(--hw-success); }
.hw-btn-danger { background: var(--hw-surface); border-color: var(--hw-error); color: var(--hw-error-text); }
.hw-btn-danger:hover { background: var(--hw-error-bg); }
.hw-btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.hw-btn-xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; }
.hw-link { color: var(--hw-brand); font-weight: 500; text-decoration: none; font-size: 13px; }
.hw-link:hover { text-decoration: underline; }
.hw-link-danger { color: var(--hw-error-text); font-weight: 500; font-size: 13px; background: none; border: 0; cursor: pointer; padding: 0; }

/* ── فرم ── */
.hw-label { display: block; font-size: 13px; font-weight: 500; color: var(--hw-text-2); margin-bottom: 6px; }
.hw-input, .hw-select, .hw-textarea { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--hw-border); background: transparent; color: var(--hw-text); padding: 0 12px; font-size: 14px; font-family: inherit; }
.hw-textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.hw-input:focus, .hw-select:focus, .hw-textarea:focus { outline: none; border-color: #9cb9ff; box-shadow: 0 0 0 3px rgba(70, 95, 255, .12); }
.dark .hw-select option { background: #111827; }
.hw-help { font-size: 11.5px; color: var(--hw-muted); margin-top: 5px; line-height: 1.7; }
.hw-field + .hw-field { margin-top: 16px; }
.hw-form-grid { display: grid; gap: 16px; grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px) { .hw-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hw-span-2 { grid-column: span 2 / span 2; } }
.hw-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--hw-text); cursor: pointer; }
.hw-check input { width: 16px; height: 16px; accent-color: var(--hw-brand); }
.hw-seg { display: inline-flex; border: 1px solid var(--hw-border); border-radius: 10px; padding: 3px; gap: 3px; background: var(--hw-surface-2); }
.hw-seg label { padding: 6px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--hw-text-2); }
.hw-seg input { display: none; }
.hw-seg input:checked + span, .hw-seg label.is-active { background: var(--hw-surface); color: var(--hw-brand); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.hw-seg label span { display: inline-block; }
.hw-error-text { color: var(--hw-error-text); font-size: 12px; margin-top: 4px; }

/* ── هشدار ── */
.hw-alert { border-radius: 12px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent; }
.hw-alert.is-success { background: var(--hw-success-bg); color: var(--hw-success-text); border-color: rgba(18, 183, 106, .25); }
.hw-alert.is-error { background: var(--hw-error-bg); color: var(--hw-error-text); border-color: rgba(240, 68, 56, .25); }
.hw-alert.is-info { background: var(--hw-info-bg); color: var(--hw-info-text); border-color: rgba(11, 165, 236, .25); }
.hw-alert.is-warning { background: var(--hw-warning-bg); color: var(--hw-warning-text); border-color: rgba(247, 144, 9, .25); }

/* ── تب ── */
.hw-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hw-border); margin-bottom: 16px; overflow-x: auto; }
.hw-tab { padding: 10px 14px; font-size: 13.5px; color: var(--hw-text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font-family: inherit; }
.hw-tab:hover { color: var(--hw-text); }
.hw-tab.is-active { color: var(--hw-brand); border-bottom-color: var(--hw-brand); font-weight: 600; }
.hw-tab .hw-count { margin: 0; background: var(--hw-brand); }

/* ── جدول ── */
.hw-table-wrap { overflow-x: auto; }
.hw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hw-table th { text-align: right; font-weight: 500; font-size: 12px; color: var(--hw-text-2); padding: 10px 12px; background: var(--hw-surface-2); border-bottom: 1px solid var(--hw-border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.hw-table td { padding: 9px 12px; border-bottom: 1px solid var(--hw-border-2); color: var(--hw-text); vertical-align: middle; white-space: nowrap; }
.hw-table tr:last-child td { border-bottom: 0; }
.hw-table tr.is-off td { background: var(--hw-surface-2); color: var(--hw-muted); }
.hw-table tr.is-today td { background: var(--hw-brand-50); }
.hw-table tr.is-problem td:first-child { box-shadow: inset -3px 0 0 var(--hw-error); }
.hw-table tr:hover td { background: var(--hw-surface-2); }
.hw-table .hw-td-center { text-align: center; }
.hw-table tfoot td { font-weight: 600; background: var(--hw-surface-2); border-top: 1px solid var(--hw-border); }
.hw-empty { text-align: center; padding: 40px 16px; color: var(--hw-muted); font-size: 13.5px; }

/* ── سلول قابل ویرایش ساعت (اصلاح تردد) ── */
.hw-time-cell { display: inline-flex; align-items: center; gap: 6px; min-width: 76px; }
.hw-time-cell .hw-time-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px dashed transparent; background: none; font-family: inherit; font-size: 13px; color: var(--hw-text); cursor: default; font-variant-numeric: tabular-nums; }
.hw-time-cell.is-editable .hw-time-btn { cursor: pointer; border-color: var(--hw-border); }
.hw-time-cell.is-editable .hw-time-btn:hover { border-color: var(--hw-brand); color: var(--hw-brand); }
.hw-time-cell.is-missing .hw-time-btn { border-color: var(--hw-error); color: var(--hw-error-text); background: var(--hw-error-bg); border-style: dashed; cursor: pointer; }
.hw-time-cell.is-pending .hw-time-btn { border-color: var(--hw-warning); color: var(--hw-warning-text); background: var(--hw-warning-bg); border-style: solid; cursor: pointer; }
.hw-time-cell input[type=time] { height: 30px; border-radius: 8px; border: 1px solid var(--hw-brand); background: var(--hw-surface); color: var(--hw-text); padding: 0 6px; font-size: 13px; font-family: inherit; width: 100px; direction: ltr; }
.hw-time-cell .hw-time-save { height: 30px; padding: 0 10px; border-radius: 8px; border: 0; background: var(--hw-brand); color: #fff; font-size: 12px; cursor: pointer; font-family: inherit; }
.hw-time-cell .hw-time-cancel { height: 30px; padding: 0 6px; border: 0; background: none; color: var(--hw-muted); cursor: pointer; font-size: 16px; }

/* ── نمودار ── */
.hw-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--hw-text-2); }
.hw-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hw-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hw-chart-box { min-height: 320px; }
.dark .apexcharts-text tspan, .dark .apexcharts-legend-text { fill: #98a2b3; color: #98a2b3 !important; }
.dark .apexcharts-gridline { stroke: #1d2939; }
.dark .apexcharts-tooltip { background: #111827 !important; border-color: #1d2939 !important; color: #e4e7ec; }
.dark .apexcharts-tooltip-title { background: #1d2939 !important; border-color: #1d2939 !important; }

/* ── دکمه‌ی ثبت تردد (شبیه اثر انگشت) ── */
.hw-punch-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; }
.hw-punch { position: relative; width: 190px; height: 190px; border-radius: 50%; border: 0; cursor: pointer; background: radial-gradient(circle at 50% 40%, #6b7fff, var(--hw-brand) 60%, var(--hw-brand-600)); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 16px 40px -12px rgba(70, 95, 255, .55); transition: transform .15s; font-family: inherit; }
.hw-punch:hover { transform: scale(1.02); }
.hw-punch:disabled { cursor: not-allowed; filter: grayscale(.4); opacity: .8; transform: none; }
.hw-punch.is-out { background: radial-gradient(circle at 50% 40%, #ff7a6e, var(--hw-error) 60%, #d92d20); box-shadow: 0 16px 40px -12px rgba(240, 68, 56, .5); }
.hw-punch svg.hw-punch-icon { width: 64px; height: 64px; }
.hw-punch-label { font-size: 16px; font-weight: 700; }
.hw-punch-ring { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); transform: rotate(-90deg); pointer-events: none; }
.hw-punch-ring circle { fill: none; stroke-width: 6; }
.hw-punch-ring .track { stroke: var(--hw-border); }
.hw-punch-ring .bar { stroke: var(--hw-success); stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.hw-punch-count { font-size: 42px; font-weight: 800; line-height: 1; }
.hw-method-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.hw-clock { font-size: 34px; font-weight: 700; color: var(--hw-text); font-variant-numeric: tabular-nums; letter-spacing: 1px; }

/* ── فهرست درخواست‌ها ── */
.hw-req { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--hw-border-2); }
.hw-req:last-child { border-bottom: 0; }
.hw-req-main { min-width: 220px; flex: 1; }
.hw-req-title { font-size: 14px; font-weight: 600; color: var(--hw-text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hw-req-meta { font-size: 12.5px; color: var(--hw-text-2); margin-top: 4px; line-height: 1.9; }
.hw-req-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hw-req-note { width: 220px; height: 32px; border-radius: 8px; border: 1px solid var(--hw-border); background: transparent; color: var(--hw-text); padding: 0 10px; font-size: 12.5px; font-family: inherit; }
.hw-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--hw-brand-50); color: var(--hw-brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.hw-person { display: flex; align-items: center; gap: 10px; }

/* ── تقویم ── */
.hw-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.hw-cal-head { text-align: center; font-size: 12px; color: var(--hw-muted); padding-bottom: 4px; }
.hw-cal-day { min-height: 92px; border: 1px solid var(--hw-border); border-radius: 12px; padding: 8px; background: var(--hw-surface); cursor: pointer; display: flex; flex-direction: column; gap: 6px; user-select: none; transition: border-color .15s, box-shadow .15s; }
.hw-cal-day:hover { border-color: var(--hw-brand); box-shadow: 0 0 0 3px rgba(70, 95, 255, .08); }
.hw-cal-day.is-holiday { background: var(--hw-error-bg); border-color: rgba(240, 68, 56, .35); }
.hw-cal-day.is-half { background: var(--hw-warning-bg); border-color: rgba(247, 144, 9, .35); }
.hw-cal-day.is-weekend .hw-cal-num { color: var(--hw-error-text); }
.hw-cal-day.is-today { box-shadow: 0 0 0 2px var(--hw-brand); }
.hw-cal-num { font-size: 15px; font-weight: 700; color: var(--hw-text); display: flex; align-items: center; justify-content: space-between; }
.hw-cal-tag { font-size: 10.5px; font-weight: 500; }
.hw-cal-shift { font-size: 11px; border-radius: 6px; padding: 3px 6px; background: var(--hw-brand-50); color: var(--hw-brand); display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.hw-cal-shift.is-inherited { background: var(--hw-surface-2); color: var(--hw-text-2); }
.hw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--hw-border); background: var(--hw-surface); font-size: 13px; color: var(--hw-text); cursor: pointer; font-family: inherit; }
.hw-chip.is-active { border-color: var(--hw-brand); background: var(--hw-brand-50); color: var(--hw-brand); font-weight: 600; }
.hw-chip.is-eraser.is-active { border-color: var(--hw-error); background: var(--hw-error-bg); color: var(--hw-error-text); }

/* ── درخت واحدها ── */
.hw-tree-indent { display: inline-block; width: 18px; }

/* ── سایدبار ── */
.hw-menu-title { margin: 18px 0 8px; font-size: 11px; color: #98a2b3; letter-spacing: .5px; }
.menu-item .hw-count { margin-inline-start: auto; }

@media (max-width: 640px) {
  .hw-card { padding: 14px; }
  .hw-punch { width: 160px; height: 160px; }
  .hw-cal-day { min-height: 70px; padding: 5px; }
  .hw-req-note { width: 100%; }
}
[x-cloak] { display: none !important; }

/* ── انتخابگر تاریخ شمسی ── */
.hw-dp { position: relative; }
.hw-dp-field { position: relative; }
.hw-dp-input { padding-left: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.hw-dp-field.is-invalid .hw-dp-input { border-color: var(--hw-error); box-shadow: 0 0 0 3px rgba(240, 68, 56, .12); }
.hw-dp-icon { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; background: transparent; color: var(--hw-muted); border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.hw-dp-icon:hover { background: var(--hw-border-2); color: var(--hw-brand); }
.hw-dp-pop { position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; width: 300px; max-width: calc(100vw - 32px); background: var(--hw-surface); border: 1px solid var(--hw-border); border-radius: 14px; padding: 12px; box-shadow: 0 12px 32px -8px rgba(16, 24, 40, .22); }
.hw-dp-pop.is-left { right: auto; left: 0; }
.hw-dp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.hw-dp-nav { width: 32px; height: 34px; flex-shrink: 0; border: 1px solid var(--hw-border); background: transparent; color: var(--hw-text-2); border-radius: 9px; cursor: pointer; font-size: 18px; line-height: 1; }
.hw-dp-nav:hover { background: var(--hw-brand-50); color: var(--hw-brand); border-color: transparent; }
.hw-dp-select { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--hw-border); background: var(--hw-surface); color: var(--hw-text); border-radius: 9px; padding: 0 8px; font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer; }
.hw-dp-select:focus { outline: none; border-color: #9cb9ff; }
.hw-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.hw-dp-week { margin-bottom: 4px; }
.hw-dp-week span { text-align: center; font-size: 11px; color: var(--hw-muted); padding: 2px 0; }
.hw-dp-week span:last-child { color: var(--hw-error); }
.hw-dp-day { height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--hw-text); font-size: 13px; font-family: inherit; cursor: pointer; font-variant-numeric: tabular-nums; }
.hw-dp-day:hover { background: var(--hw-brand-50); color: var(--hw-brand); }
.hw-dp-day.is-friday { color: var(--hw-error-text); }
.hw-dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--hw-brand); font-weight: 700; }
.hw-dp-day.is-selected, .hw-dp-day.is-selected:hover { background: var(--hw-brand); color: #fff; }
.hw-dp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hw-border-2); }
[x-cloak] { display: none !important; }

/* ── ساختار سازمانی ── */
.hw-org-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hw-org-tree, .hw-org-tree ul { list-style: none; margin: 0; padding: 0; }
.hw-org-tree ul { position: relative; margin-right: 24px; padding-right: 34px; }
.hw-org-tree li { position: relative; padding-top: 10px; }
.hw-org-tree ul > li::before { content: ''; position: absolute; right: -34px; top: 40px; width: 34px; border-top: 2px solid #cfd4dc; }
.dark .hw-org-tree ul > li::before { border-color: #344054; }
.hw-org-tree ul > li::after { content: ''; position: absolute; right: -34px; top: 0; bottom: 0; width: 2px; background: #cfd4dc; }
.dark .hw-org-tree ul > li::after { background: #344054; }
.hw-org-tree ul > li:last-child::after { bottom: auto; height: 42px; }
.hw-org-node { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--hw-surface); border: 1px solid var(--hw-border); border-right: 4px solid var(--node-color, var(--hw-brand)); border-radius: 12px; padding: 12px 14px; }
.hw-org-node:hover { box-shadow: 0 4px 14px -6px rgba(16, 24, 40, .18); }
.hw-org-toggle { width: 26px; height: 26px; flex-shrink: 0; border: 1px solid var(--hw-border); border-radius: 7px; background: transparent; color: var(--hw-text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .15s; }
.hw-org-toggle.is-open { transform: rotate(-90deg); }
.hw-org-toggle[disabled] { visibility: hidden; }
.hw-org-main { flex: 1 1 220px; min-width: 0; }
.hw-org-name { font-size: 14.5px; font-weight: 700; color: var(--hw-text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hw-org-meta { font-size: 12px; color: var(--hw-text-2); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.hw-org-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.hw-org-count { min-width: 64px; text-align: center; border-radius: 10px; padding: 5px 8px; background: var(--hw-surface-2); border: 1px solid var(--hw-border-2); }
.hw-org-count b { display: block; font-size: 15px; color: var(--hw-text); font-variant-numeric: tabular-nums; }
.hw-org-count span { font-size: 10.5px; color: var(--hw-muted); white-space: nowrap; }
.hw-org-count.is-warning { background: var(--hw-warning-bg); border-color: transparent; }
.hw-org-count.is-warning b, .hw-org-count.is-warning span { color: var(--hw-warning-text); }
.hw-org-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.hw-org-members { margin: 8px 0 0; border: 1px dashed var(--hw-border); border-radius: 12px; padding: 6px 12px; background: var(--hw-surface-2); }
.hw-org-member { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--hw-border-2); font-size: 13px; }
.hw-org-member:last-child { border-bottom: 0; }
.hw-org-member .hw-avatar { width: 28px; height: 28px; font-size: 12px; }
.hw-org-type-division { --node-color: #7a5af8; }
.hw-org-type-department { --node-color: #465fff; }
.hw-org-type-unit { --node-color: #0ba5ec; }
.hw-org-type-team { --node-color: #12b76a; }

/* ── منبع قانون دسترسی ── */
.hw-rule-list { list-style: none; margin: 0; padding: 0; }
.hw-rule { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hw-border-2); font-size: 13.5px; }
.hw-rule:last-child { border-bottom: 0; }
.hw-rule-src { font-size: 11.5px; color: var(--hw-muted); margin-top: 2px; }

/* ── برنامه‌ی شیفت ── */
.hw-rota-brush { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; min-width: 64px; padding: 5px 10px; border-radius: 10px; border: 1.5px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); color: var(--hw-text); cursor: pointer; font-family: inherit; }
.hw-rota-brush b { font-size: 13px; color: var(--c); }
.hw-rota-brush span { font-size: 10.5px; color: var(--hw-text-2); direction: ltr; }
.hw-rota-brush.is-active { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); background: color-mix(in srgb, var(--c) 18%, transparent); }
.hw-rota-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.hw-rota-wrap { max-height: 70vh; }
.hw-rota { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; user-select: none; }
.hw-rota th, .hw-rota td { border-bottom: 1px solid var(--hw-border-2); border-left: 1px solid var(--hw-border-2); text-align: center; padding: 0; }
.hw-rota thead th { position: sticky; top: 0; z-index: 2; background: var(--hw-surface); padding: 6px 2px; font-size: 11.5px; min-width: 38px; color: var(--hw-text); }
.hw-rota thead th.is-off { color: var(--hw-error-text); }
.hw-rota thead th.is-today { background: var(--hw-brand-50); }
.hw-rota .hw-rota-name { position: sticky; right: 0; z-index: 1; background: var(--hw-surface); text-align: right; padding: 8px 12px; min-width: 150px; white-space: nowrap; }
.hw-rota thead .hw-rota-name { z-index: 3; }
.hw-rota-sum { padding: 0 10px !important; white-space: nowrap; color: var(--hw-text-2); }
.hw-rota-cell { height: 38px; cursor: crosshair; }
.hw-rota-cell.is-off { background: color-mix(in srgb, var(--hw-error) 4%, transparent); }
.hw-rota-cell.is-past { opacity: .75; }
.hw-rota-val { display: flex; align-items: center; justify-content: center; height: 30px; margin: 3px; border-radius: 7px; font-weight: 600; font-size: 11.5px; }
.hw-rota-val.is-set { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.hw-rota-val.is-inherit { color: var(--hw-muted); font-weight: 400; }
.hw-rota-val.is-dirty { outline: 2px dashed var(--hw-brand); outline-offset: -2px; }
.hw-rota-cell:hover .hw-rota-val { box-shadow: inset 0 0 0 1.5px var(--hw-brand); }
.hw-rota tfoot td { background: var(--hw-surface-2); height: 28px; font-size: 11.5px; color: var(--hw-text-2); }
.hw-rota tfoot .hw-rota-name { background: var(--hw-surface-2); }
.hw-rota-cov.is-empty { background: var(--hw-error-bg) !important; color: var(--hw-error-text); font-weight: 700; }

/* ── تقویم شیفت من ── */
.hw-mycal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.hw-mycal-head { text-align: center; font-size: 11px; color: var(--hw-muted); }
.hw-mycal-day { min-height: 58px; border: 1px solid var(--hw-border-2); border-radius: 10px; padding: 5px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hw-mycal-day.is-free { background: var(--hw-surface-2); }
.hw-mycal-day.is-today { border-color: var(--hw-brand); box-shadow: 0 0 0 2px var(--hw-brand-50); }
.hw-mycal-num { font-size: 12px; font-weight: 600; color: var(--hw-text); }

/* انتخاب روش ثبت تردد */
.hw-method-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; width: 100%; }
.hw-method-opt { display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; padding: 10px 8px; border-radius: 14px; border: 1.5px solid var(--hw-border, #e4e7ec); background: transparent; color: inherit; cursor: pointer; font: inherit; transition: .15s; }
.hw-method-opt b { font-size: 14px; }
.hw-method-opt small { font-size: 11.5px; opacity: .7; }
.hw-method-opt:hover { border-color: var(--hw-brand); }
.hw-method-opt.is-on { border-color: var(--hw-brand); background: var(--hw-brand-50); color: var(--hw-brand-600); box-shadow: 0 0 0 3px var(--hw-brand-50); }
.hw-method-opt:disabled { opacity: .6; cursor: default; }

/* ───── دوره‌ی آزمایشی / دمو / راهنمای شروع ───── */
.hw-plan-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; border: 1px solid var(--hw-border); background: var(--hw-surface); font-size: 13.5px; color: var(--hw-text); }
.hw-plan-bar b { font-weight: 700; }
.hw-plan-bar .hw-plan-ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 17px; }
.hw-plan-bar .hw-plan-text { flex: 1 1 260px; line-height: 1.8; }
.hw-plan-bar.is-trial { background: var(--hw-brand-50); border-color: rgba(70, 95, 255, .25); }
.hw-plan-bar.is-trial .hw-plan-ico { background: var(--hw-brand); color: #fff; }
.hw-plan-bar.is-urgent { background: var(--hw-warning-bg); border-color: rgba(247, 144, 9, .35); }
.hw-plan-bar.is-urgent .hw-plan-ico { background: var(--hw-warning); color: #fff; }
.hw-plan-bar.is-demo { background: #101828; border-color: #101828; color: #fff; }
.hw-plan-bar.is-demo .hw-plan-ico { background: #FDB022; color: #101828; }
.hw-plan-bar.is-demo .hw-btn { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; }
.hw-plan-bar.is-demo .hw-btn-primary { background: #fff; color: #101828; border-color: #fff; }
.hw-plan-bar.is-blocked { background: var(--hw-error-bg); border-color: rgba(240, 68, 56, .3); color: var(--hw-error-text); }

.hw-onb { margin-bottom: 16px; }
.hw-onb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hw-onb-progress { flex: 1; height: 8px; border-radius: 99px; background: var(--hw-border-2); overflow: hidden; max-width: 220px; }
.hw-onb-progress i { display: block; height: 100%; background: var(--hw-success); border-radius: 99px; transition: width .3s; }
.hw-onb-steps { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .hw-onb-steps { grid-template-columns: 1fr; } }
.hw-onb-step { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--hw-border); background: var(--hw-surface-2); text-decoration: none; color: var(--hw-text); transition: border-color .15s, background .15s; }
a.hw-onb-step:hover { border-color: var(--hw-brand); background: var(--hw-brand-50); }
.hw-onb-num { width: 30px; height: 30px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: var(--hw-brand); color: #fff; }
.hw-onb-step.is-done { opacity: .75; }
.hw-onb-step.is-done .hw-onb-num { background: var(--hw-success); }
.hw-onb-step.is-done .hw-onb-title { text-decoration: line-through; }
.hw-onb-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.hw-onb-hint { font-size: 12.5px; color: var(--hw-text-2); line-height: 1.7; }

.hw-plans { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.hw-plan { border: 1px solid var(--hw-border); border-radius: 16px; padding: 18px; background: var(--hw-surface); display: flex; flex-direction: column; gap: 10px; }
.hw-plan.is-featured { border-color: var(--hw-brand); box-shadow: 0 0 0 3px var(--hw-brand-50); }
.hw-plan-name { font-weight: 700; font-size: 16px; color: var(--hw-text); }
.hw-plan-price { font-size: 22px; font-weight: 800; color: var(--hw-text); }
.hw-plan-price small { font-size: 12.5px; font-weight: 500; color: var(--hw-text-2); }
.hw-plan ul { margin: 0; padding: 0 18px 0 0; font-size: 13px; color: var(--hw-text-2); line-height: 1.9; flex: 1; }

/* ───── پروفایل و عکس ───── */
.hw-avatar-xl { width: 112px; height: 112px; border-radius: 50%; margin: 6px auto 0; overflow: hidden; background: var(--hw-brand-50); color: var(--hw-brand); display: flex; align-items: center; justify-content: center; font-size: 42px; font-weight: 800; border: 4px solid var(--hw-surface); box-shadow: 0 0 0 1px var(--hw-border); }
.hw-avatar-xl img, .hw-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hw-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--hw-brand-50); color: var(--hw-brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.hw-kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--hw-border-2); font-size: 13.5px; }
.hw-kv span { color: var(--hw-text-2); }
.hw-kv b { color: var(--hw-text); font-weight: 600; text-align: left; }

/* ───── حقوق و جریمه ───── */
.hw-pen { margin-bottom: 16px; }
.hw-pen-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.hw-pen-items { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.hw-pen-item { border: 1px solid var(--hw-border); border-radius: 12px; padding: 12px; background: var(--hw-surface-2); }
.hw-pen-item .k { font-size: 12px; color: var(--hw-text-2); }
.hw-pen-item .v { font-size: 17px; font-weight: 800; color: var(--hw-text); margin-top: 4px; }
.hw-pen-item .h { font-size: 11.5px; color: var(--hw-muted); margin-top: 2px; }
.hw-pen-item.is-money .v { color: var(--hw-error-text); }
.hw-pen-item.is-work .v { color: var(--hw-warning-text); }
.hw-pen-item.is-ok .v { color: var(--hw-success-text); }
.hw-prule { border: 1px solid var(--hw-border); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.hw-prule-title { font-weight: 700; font-size: 14.5px; margin-bottom: 10px; color: var(--hw-text); }
.hw-prule-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; font-size: 13.5px; color: var(--hw-text-2); margin-top: 8px; }
.hw-prule-row .hw-input, .hw-prule-row .hw-select { width: auto; min-width: 90px; height: 38px; }
.hw-pseg { display: inline-flex; border: 1px solid var(--hw-border); border-radius: 10px; overflow: hidden; }
.hw-pseg label { padding: 7px 14px; white-space: nowrap; font-size: 13px; cursor: pointer; color: var(--hw-text-2); border-left: 1px solid var(--hw-border); }
.hw-pseg label:last-child { border-left: 0; }
.hw-pseg input { display: none; }
.hw-pseg label:has(input:checked) { background: var(--hw-brand); color: #fff; }
.hw-table tfoot td { font-weight: 700; background: var(--hw-surface-2); }
