.indicators-table-wrap {
  width: 100%;
}
.indicators-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.indicators-table th,
.indicators-table td {
  padding: 0.45rem 0.5rem;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.indicators-table td {
  white-space: normal;
}
.indicators-table td select,
.indicators-table td input {
  width: 100%;
  min-width: 0;
  font-size: 0.85rem;
}
/**
 * داشبورد هوشمند - نوین گستر
 * الگو: Human Resources KPI Dashboard — پس‌زمینه سفید، آبی و مرجانی
 */
:root {
  --primary: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-dark: #1e40af;
  --accent: #e11d48;
  --accent-light: #f43f5e;
  --chart-blue: #2563eb;
  --chart-coral: #ec4899;
  --chart-blue-light: #93c5fd;
  --glass-bg: #ffffff;
  --glass-border: #e5e7eb;
  --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --glass-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
  --sidebar-width: 140px;
  --sidebar-drawer-width: 280px;
  --sidebar-bg: #1e3a8a;
  --sidebar-text: #e0e7ff;
  --sidebar-hover: #1e40af;
  --card-bg: #ffffff;
  --body-bg: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Vazirmatn', 'Tahoma', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  direction: rtl;
  font-size: 14px;
}

body {
  font-family: var(--font);
  margin: 0;
  background: linear-gradient(160deg, #f0fdfa 0%, #e0f2fe 25%, #f8fafc 60%, #f1f5f9 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* لایه اصلی */
.app-wrap {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  /* فضای بیشتر بالای محتوا تا با دکمه منو تداخل نداشته باشد */
  padding: 2.75rem 1.75rem 2rem;
  margin-right: 0;
  transition: margin 0.2s;
}

/* هدر صفحه — عنوان بولد، تمیز (الگوی HR KPI) */
.page-header {
  margin-bottom: 0.5rem;
  padding: 0 0 0.5rem 0;
  border-bottom: 2px solid var(--border);
}

.page-header--row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.page-header--row .page-header__title {
  margin: 0;
  text-align: center;
  justify-self: center;
}

.page-header--row .period-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  justify-self: end;
}
.subtitle--group {
  margin: -0.5rem 0 1rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.page-header__spacer {
  min-width: 0;
}

.period-filters__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.period-filters__select {
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.period-filters__select:hover {
  border-color: var(--primary);
}

.page-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.35rem 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
}

.page-header .subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
  text-align: center;
}

/* دکمه منو (همبرگر) — گوشه بالا */
.menu-toggle {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 301;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, transform 0.2s;
}
.menu-toggle:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.menu-toggle span {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.app-wrap.menu-open .menu-toggle {
  right: calc(var(--sidebar-drawer-width) + 0.5rem);
}

/* overlay برای بستن منو با کلیک بیرون */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.app-wrap.menu-open .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* سایدبار — به‌صورت کشو، با کلیک روی همبرگر باز می‌شود */
.sidebar {
  position: fixed;
  width: var(--sidebar-drawer-width);
  top: 0;
  right: 0;
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
}
.app-wrap.menu-open .sidebar {
  transform: translateX(0);
}

body.menu-open { overflow: hidden; }

.sidebar-nav a {
  white-space: nowrap;
}

.sidebar-brand {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
}

.sidebar-brand .sidebar-logo {
  max-width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  display: block;
}

.sidebar-brand .sidebar-logo--text {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sidebar-text);
  text-align: center;
  padding: 0.5rem 0;
}

.sidebar-brand .logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-brand .tagline {
  font-size: 0.8rem;
  color: #1e40af;
  margin-top: 0.35rem;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-nav .nav-section {
  margin-bottom: 0.5rem;
}

.sidebar-nav .nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 0.5rem 1.5rem;
  margin: 0;
  font-weight: 600;
}

.sidebar-nav a {
  display: block;
  padding: 0.7rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav a.active {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-right: 3px solid #93c5fd;
}

.sidebar-nav .nav-sub {
  padding-right: 1rem;
  margin-bottom: 0.25rem;
}

.sidebar-nav .nav-sub a {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: #c7d2fe;
}

.sidebar-nav .nav-sub a:hover {
  color: #fff;
}

.sidebar-nav-group {
  margin: 0;
}

.sidebar-nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.5rem;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  list-style: none;
  transition: background 0.2s, color 0.2s;
}

.sidebar-nav-group summary::-webkit-details-marker {
  display: none;
}

.sidebar-nav-group summary::after {
  content: '‹';
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s;
}

.sidebar-nav-group[open] summary::after {
  transform: rotate(-90deg);
}

.sidebar-nav-group summary:hover,
.sidebar-nav-group summary.active {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
}

.sidebar-specialized-dashboards {
  padding-top: 0.2rem;
}

.sidebar-nav .nav-item-disabled {
  display: block;
  padding: 0.5rem 1rem;
  color: #94a3b8;
  cursor: default;
  font-size: 0.9rem;
  opacity: 0.75;
}

.sidebar-analytics {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.sidebar-analytics .title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-light);
}

.sidebar-analytics .desc {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.55;
}

.sidebar-analytics .link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #93c5fd;
  text-decoration: none;
}

.sidebar-analytics .link:hover {
  text-decoration: underline;
}

/* کادر KPI — طراحی شیشه‌ای مینیمال */
.kpi-hero {
  margin-bottom: 2rem;
  margin-top: 0;
  padding: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(248,250,252,0.9) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 8px 32px rgba(30, 64, 175, 0.08), 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}

.kpi-hero:has(.kpi-hero__tab) {
  overflow: visible;
  margin-bottom: 0.15rem;
  margin-top: -0.25rem;
}

.kpi-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
  opacity: 0.6;
}

.kpi-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 0.5rem;
}

.kpi-section--1 {
  grid-column: 1 / -1;
  grid-row: 1;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04) 0%, transparent 100%);
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.12);
  padding-top: 0.5rem;
}

.kpi-section--2 {
  grid-column: 1;
  grid-row: 2;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.04) 0%, transparent 100%);
  border-radius: 16px;
  border: 1px solid rgba(34, 197, 94, 0.12);
  padding-top: 0.5rem;
}

.kpi-section--3 {
  grid-column: 2;
  grid-row: 2;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.04) 0%, transparent 100%);
  border-radius: 16px;
  border: 1px solid rgba(124, 58, 237, 0.12);
  padding-top: 0.5rem;
}

.kpi-section--kpi {
  grid-column: 1 / -1;
  grid-row: 3;
}

.kpi-section {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.kpi-section__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 1rem 0;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  display: block;
  width: fit-content;
  text-align: center;
  align-self: center;
  border: 1px solid rgba(59, 130, 246, 0.15);
  letter-spacing: 0.02em;
}

/* سربرگ — عملکرد حضور و تحلیل پویایی (داخل کادر، چسبیده به خط بالا) */
.kpi-section__tab {
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.75rem;
  margin: 0 0 0.5rem 0;
  width: fit-content;
  align-self: center;
  border-radius: 6px;
}

.kpi-section__tab--1 {
  color: #1d4ed8;
  background: rgba(239, 246, 255, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.kpi-section__tab--2 {
  color: #059669;
  background: rgba(240, 253, 244, 0.9);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.kpi-section__tab--3 {
  color: #7c3aed;
  background: rgba(245, 243, 255, 0.9);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.kpi-section__tab--kpi {
  color: #1d4ed8;
  background: rgba(239, 246, 255, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ترتیب بخش‌ها — امکان جابجایی با ستاره */
.dashboard-sections {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dashboard-sections .kpi-hero[data-section="overview"] { order: 1; }
.dashboard-sections .kpi-hero[data-section="kpi"] { order: 2; }
.dashboard-sections.order-kpi-first .kpi-hero[data-section="overview"] { order: 2; }
.dashboard-sections.order-kpi-first .kpi-hero[data-section="kpi"] { order: 1; }

.section-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #cbd5e1;
  transition: color 0.2s, fill 0.2s, stroke 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.section-pin:hover { color: #eab308; }
.section-pin .section-pin__icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.section-pin:hover .section-pin__icon {
  fill: none;
  stroke: #eab308;
}
.section-pin.is-active .section-pin__icon {
  fill: #eab308;
  stroke: none;
}

/* سربرگ — نمای کلی سرمایه انسانی (چسبیده به بالای کادر) */
.kpi-hero__tab--top {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -8px auto 0;
  margin-bottom: 0;
  padding: 0.4rem 1.2rem;
  width: fit-content;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.95) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.08);
  text-align: center;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 2;
}
.kpi-hero__tab--kpi {
  margin: -8px auto 0;
  margin-bottom: 0;
  border-radius: 0 0 10px 10px;
  border-top: none;
}

/* سربرگ — شاخص های کلیدی عملکرد سرمایه انسانی (چسبیده به کادر بالا) */
.kpi-hero__tab {
  display: block;
  margin: 0 auto;
  margin-top: 0.5rem;
  margin-bottom: -14px;
  padding: 0.6rem 1.5rem;
  width: fit-content;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.98) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -2px 12px rgba(59, 130, 246, 0.08);
  text-align: center;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 2;
}

/* شاخص های کلیدی عملکرد سرمایه انسانی — نمودارهای ده گانه */
.kpi-hero--kpi {
  margin-top: 0;
  padding-top: 0.5rem;
}
.kpi-section--kpi {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04) 0%, transparent 100%);
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.12);
  padding: 0.5rem 1rem 1rem;
}
.kpi-section--kpi .kpi-section__title {
  margin: 0 auto 0.5rem auto;
}
.kpi-section--kpi .card-chart-view {
  width: 100%;
  height: 100%;
  min-height: 115px;
}
.kpi-section--kpi .card-chart-view--gauge,
.group-page-cards .card-chart-view--gauge {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* سطر نمودارهای لایه سوم (indicator) */
.indicator-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
  .indicator-charts-row {
    grid-template-columns: 1fr;
  }
}
.indicator-charts-row .card--half {
  min-width: 0;
}
.indicator-charts-row .card-chart--gauge-fixed {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}
.indicator-charts-row .card-gauge-value-section {
  flex-shrink: 0;
  margin-top: 0.5rem;
  padding: 0 0.5rem 0.5rem;
}
.indicator-charts-row .card-gauge-value-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(100, 116, 139, 0.4) 15%, rgba(100, 116, 139, 0.4) 85%, transparent);
  margin-bottom: 0.5rem;
}
.indicator-charts-row .card-indicator-value--gauge {
  display: block !important;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.25rem 0;
  color: #334155;
}

.kpi-section--kpi .card-gauge-wrap,
.group-page-cards .card-gauge-wrap,
.indicator-charts-row .card-gauge-wrap {
  position: relative;
  width: 200px;
  height: 110px;
  margin: 0 auto;
  overflow: hidden;
  background: transparent;
  box-sizing: border-box;
}
.kpi-section--kpi .card-gauge-bg,
.group-page-cards .card-gauge-bg,
.indicator-charts-row .card-gauge-bg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px !important;
  height: 200px !important;
  max-height: none;
  pointer-events: none;
  z-index: 0;
}
.kpi-section--kpi .gauge-bg-arc,
.group-page-cards .gauge-bg-arc,
.indicator-charts-row .gauge-bg-arc {
  stroke: none;
}
.kpi-section--kpi .gauge-bg-arc--red,
.group-page-cards .gauge-bg-arc--red,
.indicator-charts-row .gauge-bg-arc--red { fill: #ef4444; }
.kpi-section--kpi .gauge-bg-arc--yellow,
.group-page-cards .gauge-bg-arc--yellow,
.indicator-charts-row .gauge-bg-arc--yellow { fill: #fcd34d; }
.kpi-section--kpi .gauge-bg-arc--green,
.group-page-cards .gauge-bg-arc--green,
.indicator-charts-row .gauge-bg-arc--green { fill: #22c55e; }
/* مدل B گیج: جای قرمز و سبز عوض می‌شود (چپ سبز، راست قرمز) */
.gauge-model-b .gauge-bg-arc--red { fill: #22c55e; }
.gauge-model-b .gauge-bg-arc--green { fill: #ef4444; }
.kpi-section--kpi .card-gauge-scale,
.group-page-cards .card-gauge-scale,
.indicator-charts-row .card-gauge-scale {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px !important;
  height: 200px !important;
  max-height: none;
  pointer-events: none;
  z-index: 1;
}
.kpi-section--kpi .gauge-label,
.group-page-cards .gauge-label,
.indicator-charts-row .gauge-label {
  font-size: 10px;
  font-weight: 600;
  fill: #475569;
}
.kpi-section--kpi .card-gauge-hub,
.group-page-cards .card-gauge-hub,
.indicator-charts-row .card-gauge-hub {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: linear-gradient(145deg, #94a3b8 0%, #64748b 50%, #475569 100%);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  z-index: 3;
  pointer-events: none;
}
@keyframes needle-sway {
  0%, 100% { transform: rotate(var(--needle-angle, -90deg)); }
  25% { transform: rotate(calc(var(--needle-angle, -90deg) + 1.5deg)); }
  75% { transform: rotate(calc(var(--needle-angle, -90deg) - 1.5deg)); }
}
.kpi-section--kpi .card-gauge-needle,
.group-page-cards .card-gauge-needle,
.indicator-charts-row .card-gauge-needle {
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 8px;
  height: 70px;
  margin-left: -4px;
  background: linear-gradient(to top, #374151 0%, #4b5563 50%, #6b7280 100%);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  transform-origin: bottom center;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: needle-sway 3s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}
/* گیج بزرگتر در صفحه indicator */
.indicator-charts-row .card-gauge-wrap {
  width: 280px;
  height: 154px;
}
.indicator-charts-row .card-gauge-bg,
.indicator-charts-row .card-gauge-scale {
  width: 280px !important;
  height: 280px !important;
}
.indicator-charts-row .card-gauge-needle {
  width: 11px;
  height: 98px;
  margin-left: -5.5px;
  bottom: 14px;
}
.indicator-charts-row .card-gauge-hub {
  width: 14px;
  height: 14px;
  margin-left: -7px;
  bottom: 5px;
}
.indicator-charts-row .card-chart--gauge-fixed {
  min-height: 220px;
}
.kpi-section--kpi .dashboard-grid {
  margin: 0;
  gap: 0.65rem;
}
.kpi-section--kpi .card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
.kpi-section--kpi .card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%);
  border-radius: 0 16px 16px 0;
  opacity: 0.6;
}
[dir="rtl"] .kpi-section--kpi .card::before {
  right: auto;
  left: 0;
  border-radius: 16px 0 0 16px;
}
.kpi-section--kpi .card:hover {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12), 0 12px 32px rgba(0, 0, 0, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  transform: translateY(-2px);
}
.kpi-section--kpi .card-title {
  text-align: center;
  color: #1e40af;
  border-bottom-color: rgba(37, 99, 235, 0.15);
  padding: 0.5rem 0.75rem 0.4rem;
  font-size: 0.75rem;
}
.kpi-section--kpi .card-title a:hover {
  color: #3b82f6;
}
.kpi-section--kpi .card-chart {
  height: 115px;
  padding: 0.35rem 0.6rem 0.35rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.5) 0%, transparent 100%);
}
.kpi-section--kpi .card-indicator-title {
  border-top-color: rgba(37, 99, 235, 0.1);
}
.kpi-section--kpi .card-indicator-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem 0.25rem;
  margin-top: auto;
  border-top: 1px solid rgba(37, 99, 235, 0.1);
}
.kpi-section--kpi .card-indicator-footer .card-chart-switch {
  justify-self: start;
}
.kpi-section--kpi .card-indicator-value {
  justify-self: center;
  color: #1e40af;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.kpi-section--kpi .card-indicator-value:hover {
  opacity: 0.8;
}
.kpi-section--kpi .card-color-picker-wrap {
  position: relative;
  justify-self: end;
}
.kpi-section--kpi .card-color-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.kpi-section--kpi .card-color-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.kpi-section--kpi .card-color-btn__icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #6366f1, #ec4899, #ef4444);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-section--kpi .card-color-btn:hover .card-color-btn__icon {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.kpi-section--kpi .card-chart--kpi {
  position: relative;
}
.kpi-section--kpi .card-chart-switch {
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kpi-section--kpi .card-chart-switch__track {
  display: block;
  width: 26px;
  height: 14px;
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  border-radius: 7px;
  position: relative;
  transition: all 0.3s ease;
}
.kpi-section--kpi .card-chart-switch__knob {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
[dir="rtl"] .kpi-section--kpi .card-chart-switch__knob {
  right: auto;
  left: 1px;
}
.kpi-section--kpi .card-chart-switch[aria-checked="true"] .card-chart-switch__track {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}
.kpi-section--kpi .card-chart-switch[aria-checked="true"] .card-chart-switch__knob {
  transform: translateX(-12px);
}
[dir="rtl"] .kpi-section--kpi .card-chart-switch[aria-checked="true"] .card-chart-switch__knob {
  transform: translateX(12px);
}
.kpi-section--kpi .card-title a {
  text-align: center;
}

.kpi-section__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  flex: 1;
}

.kpi-charts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  flex: 1;
}

.kpi-section--1 .kpi-charts-grid {
  grid-template-columns: repeat(4, 1fr);
}

/* نمودارهای بخش نمای کلی سرمایه انسانی — نمودارها بزرگتر، کلید وضعیت کوچکتر */
.kpi-section--1 .kpi-chart-card--combined {
  min-height: 150px;
}
.kpi-section--1 .kpi-chart-card:not(.kpi-chart-card--combined) {
  min-height: 160px;
}
.kpi-section--1 .kpi-chart-card canvas {
  max-height: 165px;
  min-height: 140px;
}
.kpi-section--1 .kpi-chart-card--tenure {
  min-height: 160px;
}
.kpi-section--1 .kpi-chart-card--tenure canvas {
  max-height: 165px;
  min-height: 140px;
}

/* کلید وضعیت نمای کلی — تا حد امکان کوچک */
.kpi-section--1 .kpi-chart-switch__track {
  width: 24px;
  height: 12px;
  border-radius: 6px;
}
.kpi-section--1 .kpi-chart-switch__knob {
  width: 8px;
  height: 8px;
  top: 2px;
  right: 2px;
}
[dir="rtl"] .kpi-section--1 .kpi-chart-switch__knob {
  right: auto;
  left: 2px;
}
.kpi-section--1 .kpi-chart-switch[aria-checked="true"] .kpi-chart-switch__knob {
  transform: translateX(-12px);
}
[dir="rtl"] .kpi-section--1 .kpi-chart-switch[aria-checked="true"] .kpi-chart-switch__knob {
  transform: translateX(12px);
}

/* کادر نسبت پرسنل هر واحد — نوشته‌ها پایین، نمودار بزرگتر */
.kpi-section--1 .kpi-chart-card--personnel-unit {
  min-height: 175px;
}
.kpi-section--1 .kpi-chart-card--personnel-unit .kpi-chart-card__label {
  order: -1;
  margin-bottom: 0.5rem;
  margin-top: 0;
}
.kpi-section--1 .kpi-chart-card--personnel-unit canvas {
  max-height: 175px;
  min-height: 145px;
  flex: 1;
}
.kpi-section--1 .kpi-chart-card {
  padding: 0.45rem 0.5rem;
}

.kpi-section--2 .kpi-charts-grid,
.kpi-section--3 .kpi-charts-grid {
  grid-template-columns: repeat(3, 1fr);
}

.kpi-chart-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 0.6rem;
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 140px;
  transition: all 0.25s ease;
}

.kpi-chart-card:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.kpi-section--2 .kpi-chart-card:hover {
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.1);
}


.kpi-section--3 .kpi-chart-card:hover {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
}

.kpi-chart-card canvas {
  max-height: 140px;
  width: 100% !important;
  height: auto !important;
}

.kpi-chart-card__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.35rem;
  text-align: center;
  line-height: 1.3;
  order: -1;
}

.kpi-chart-switch {
  order: 999;
  margin-top: auto;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  align-self: center;
  -webkit-tap-highlight-color: transparent;
}
.kpi-section--1 .kpi-chart-switch {
  margin-top: 0.2rem;
}
.kpi-chart-switch__track {
  display: block;
  width: 40px;
  height: 22px;
  background: #cbd5e1;
  border-radius: 11px;
  position: relative;
  transition: background 0.25s ease;
}
.kpi-chart-switch__knob {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.25s ease;
}
[dir="rtl"] .kpi-chart-switch__knob {
  right: auto;
  left: 2px;
}
.kpi-chart-switch[aria-checked="true"] .kpi-chart-switch__track {
  background: #34d399;
}
.kpi-chart-switch[aria-checked="true"] .kpi-chart-switch__knob {
  transform: translateX(-20px);
}
[dir="rtl"] .kpi-chart-switch[aria-checked="true"] .kpi-chart-switch__knob {
  transform: translateX(20px);
}

.chart-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  background: rgba(30, 41, 59, 0.95);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}
.chart-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.kpi-chart-card__number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.kpi-chart-card__number--small {
  font-size: 1.75rem;
}

.kpi-chart-card--hero {
  grid-column: span 1;
  justify-content: center;
  min-height: 160px;
}

.kpi-chart-card--combined {
  grid-column: span 1;
  min-height: 150px;
  padding: 0.75rem;
  align-items: stretch;
}

.kpi-combined__top {
  text-align: center;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.kpi-combined__top-label {
  font-weight: 700;
}

.kpi-combined__number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.kpi-combined__unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.kpi-combined__bottom {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.6rem;
  flex: 1;
  padding-top: 0.6rem;
}

.kpi-combined__gender {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  justify-content: center;
  padding-top: 1.75rem;
}

.kpi-combined__gender-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.kpi-combined__icon {
  width: 36px;
  height: 36px;
  color: var(--text-muted);
}

.kpi-combined__gender-item:first-child .kpi-combined__icon {
  color: #3b82f6;
}

.kpi-combined__gender-item:last-child .kpi-combined__icon {
  color: #ec4899;
}

.kpi-combined__pct {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.kpi-combined__label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kpi-combined__gender-box,
.kpi-combined__marital {
  flex: 1 1 0;
  min-width: 0;
}

.kpi-combined__gender-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: rgba(59, 130, 246, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.kpi-combined__gender-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-align: center;
  width: 100%;
}

.kpi-combined__marital {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.5rem 0.75rem;
  background: rgba(124, 58, 237, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(124, 58, 237, 0.15);
}

.kpi-combined__marital-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-align: center;
  width: 100%;
}

.kpi-combined__marital-items {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-top: 1.5rem;
}

.kpi-combined__marital-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.kpi-combined__marital-icon {
  width: 28px;
  height: 36px;
  color: var(--text-muted);
}

.kpi-combined__marital-icon--couple {
  width: 36px;
  height: 36px;
  color: #a855f7;
}

.kpi-combined__marital-item:last-child .kpi-combined__marital-icon {
  color: #ec4899;
}

.kpi-combined__marital-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.kpi-combined__marital-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-chart-card--compact {
  min-height: 120px;
  justify-content: center;
}

.kpi-chart-card--wide {
  grid-column: 1 / -1;
  min-height: 200px;
}

.kpi-chart-card--wide canvas {
  max-height: 160px;
}

.kpi-chart-card--tenure {
  min-height: 200px;
  grid-column: span 2;
}

.kpi-chart-card--tenure canvas {
  max-height: 140px;
}

.kpi-chart-card--tenure .kpi-chart-card__tenure-header {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.kpi-chart-card__tenure-header {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.kpi-chart-card__tenure-header strong {
  color: var(--primary);
  font-weight: 700;
}

.kpi-chart-card--bars {
  grid-column: 1 / -1;
  min-height: 140px;
}

.kpi-chart-card--gauge {
  min-height: 150px;
  position: relative;
}

.kpi-chart-card__gauge-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
}

.kpi-chart-card__gauge-wrap canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-height: none;
}

.kpi-chart-card__gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  pointer-events: none;
}

.kpi-hero__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

.kpi-glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 1rem 1rem;
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: all 0.25s ease;
  min-height: 85px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.kpi-glass:hover {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.kpi-section--2 .kpi-glass:hover {
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.2);
}

.kpi-section--3 .kpi-glass:hover {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.2);
}

.kpi-glass__icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--chart-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.kpi-glass__icon {
  width: 24px;
  height: 24px;
  color: #fff;
}

.kpi-glass__value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin: 0 0 0.2rem 0;
  letter-spacing: -0.02em;
}

.kpi-glass__value .kpi-glass__num {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kpi-glass__unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-glass__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.kpi-glass--wide {
  grid-column: 1 / -1;
}

.kpi-glass__value--small {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
}

/* کارت ساختار کارکنان — دقیقاً مثل تصویر (Employee Structure) */
.employee-structure-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 2px dashed #d1d5db;
  padding: 1rem 1.25rem;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.employee-structure-card:hover {
  border-color: #9ca3af;
  box-shadow: var(--glass-shadow-hover);
}

.employee-structure__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #374151;
  margin: 0 0 1rem 0;
  letter-spacing: 0.02em;
  text-align: center;
}

.employee-structure__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex: 1;
}

.employee-structure__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.employee-structure__icon {
  display: block;
  width: 44px;
  height: 44px;
  color: #4b5563;
  flex-shrink: 0;
}

.employee-structure__item--female .employee-structure__icon {
  color: #38bdf8;
}

.employee-structure__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.employee-structure__pct {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
}

.employee-structure__label {
  font-size: 0.7rem;
  font-weight: 500;
  color: #6b7280;
}

/* گرید کارت‌های نمودار — تمیز، سفید (الگوی HR KPI) */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}

.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
  box-shadow: var(--glass-shadow-hover);
  border-color: var(--chart-blue-light);
}

.card-indicator {
  position: relative;
}
.card-favorite {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.card-favorite__icon {
  position: absolute;
  width: 22px;
  height: 22px;
  transition: opacity 0.2s;
}
.card-favorite__icon--outline {
  color: #94a3b8;
}
.card-favorite__icon--filled {
  color: #eab308;
  opacity: 0;
}
.card-favorite.is-favorite .card-favorite__icon--outline {
  opacity: 0;
}
.card-favorite.is-favorite .card-favorite__icon--filled {
  opacity: 1;
}
.card-favorite:hover .card-favorite__icon--outline {
  color: #cbd5e1;
}
.card-favorite:hover .card-favorite__icon--filled {
  color: #facc15;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.85rem 1rem 0.65rem;
  margin: 0;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
}

.card-title a {
  color: inherit;
  text-decoration: none;
  display: block;
  transition: color 0.2s;
}

.card-title a:hover {
  color: var(--primary);
}

.card-chart {
  padding: 0.75rem 1rem 0.75rem;
  height: 140px;
  position: relative;
}

.card-indicator-title {
  display: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 0.75rem 1rem 0.5rem;
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

.card-indicator-value {
  display: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 0 1rem 1rem;
  line-height: 1.3;
}

.card-chart--lg {
  height: 260px;
  padding: 1rem 1.25rem 1.25rem;
}

.card--standalone {
  margin-bottom: 1.5rem;
}

/* دکمه‌ها — استایل پریمیوم */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--chart-blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.35);
}

/* صفحه پرسنل — فیلتر و جستجو */
.personnel-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
}

.personnel-filters__search {
  flex: 1;
  min-width: 200px;
}

.personnel-filters__filter {
  min-width: 140px;
}

.personnel-filters__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.personnel-filters__input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: var(--font);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s;
}

.personnel-filters__input:focus {
  outline: none;
  border-color: var(--chart-blue);
}

.personnel-filters__input::placeholder {
  color: var(--text-muted);
}

.personnel-filters__select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: var(--font);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s;
}

.personnel-filters__select:focus {
  outline: none;
  border-color: var(--chart-blue);
}

.personnel-filters__count {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.6rem 0.85rem;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.personnel-filters__count-num {
  color: var(--chart-blue);
}

.personnel-filters__count-label {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ستون و دکمه تحلیل پرسنل */
.personnel-col-analyze {
  width: 1%;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.personnel-analyze-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--chart-blue);
  text-decoration: none;
  border: 1px solid var(--chart-blue-light);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.06);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.personnel-analyze-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--chart-blue);
}

.personnel-analyze-btn svg {
  width: 16px;
  height: 16px;
}

/* صفحه گزارش تحلیل پرسنل (ISO HR) */
.analysis-report {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.guide-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-block {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  padding: 1.25rem 1.5rem;
}

.report-block__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}

/* خلاصه پرسنل — دو ستون: اطلاعات پرسنل + مدال توکن شیشه‌ای */
.report-profile-wrap {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.report-profile-wrap .report-profile {
  flex: 1;
  min-width: 220px;
}

/* مدال توکن — طرح شیشه‌ای زیبا */
.personnel-token-medal {
  flex-shrink: 0;
  align-self: flex-start;
}
.personnel-token-medal__glass {
  padding: 1.35rem;
  background: linear-gradient(145deg, rgba(248, 250, 252, 0.85) 0%, rgba(226, 232, 240, 0.75) 50%, rgba(203, 213, 225, 0.7) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 4px 24px rgba(148, 163, 184, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(148, 163, 184, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  min-width: 120px;
}
.personnel-token-medal__circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.5);
}
.personnel-token-medal__circle--bronze {
  background: linear-gradient(145deg, #e8c97a 0%, #b8860b 50%, #8b6914 100%);
}
.personnel-token-medal__circle--silver {
  background: linear-gradient(145deg, #f5f5f5 0%, #c0c0c0 50%, #808080 100%);
}
.personnel-token-medal__circle--gold {
  background: linear-gradient(145deg, #ffd700 0%, #daa520 50%, #b8860b 100%);
}
.personnel-token-medal__circle--platinum {
  background: linear-gradient(145deg, #e5e4e2 0%, #a8a8a8 50%, #696969 100%);
}
.personnel-token-medal__score {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  line-height: 1;
}
.personnel-token-medal__circle--silver .personnel-token-medal__score {
  color: #2d2d2d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.personnel-token-medal__circle--platinum .personnel-token-medal__score {
  color: #1a1a1a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.personnel-token-medal__info {
  text-align: center;
}
.personnel-token-medal__label {
  display: block;
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.personnel-token-medal__tier {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.report-formula-note {
  font-size: 0.8rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: var(--radius);
  border-right: 3px solid var(--primary-light);
}

.report-formula-note summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.report-formula-note summary::-webkit-details-marker {
  display: none;
}

.report-formula-note summary::before {
  content: '▸ ';
  margin-left: 0.25rem;
}

.report-formula-note[open] summary::before {
  content: '▾ ';
}

.report-profile {
  display: grid;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.report-profile__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.report-profile__row:last-child {
  border-bottom: none;
}

.report-profile__label {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 140px;
}

.report-profile__value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.report-list {
  margin: 0;
  padding-right: 1.25rem;
  list-style: disc;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.8;
}

.report-list li {
  margin-bottom: 0.35rem;
}

.report-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.report-table th,
.report-table td {
  padding: 0.5rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.report-table th {
  background: var(--glass-bg);
  font-weight: 600;
  color: var(--text);
}

.report-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.report-text {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}

.report-text--muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.report-highlight {
  margin: 0.75rem 0;
}

.report-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
}

.report-badge--ok {
  background: #d1fae5;
  color: #065f46;
}

.report-badge--warn {
  background: #fef3c7;
  color: #92400e;
}

.report-badge--danger {
  background: #fee2e2;
  color: #991b1b;
}

/* جدول سنجه‌ها: با table-layout: fixed هر ستون عرض ثابت خودش را می‌گیرد و
   ستون filler بین «مقدار» و «روند» تمام فضای اضافی وسط را جذب می‌کند.
   نتیجه: شاخص/وضعیت/مقدار سمت راست و روند سمت چپ. */
.report-table--metrics {
  width: 100%;
  table-layout: fixed;
}
.report-table--metrics .col-num {
  width: 3rem;
  text-align: center;
  color: var(--text-muted);
}
.report-table--metrics .col-metric {
  width: 30rem;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.report-table--metrics .col-status {
  width: 8rem;
  text-align: center;
  white-space: nowrap;
}
.report-table--metrics .col-score {
  width: 4.5rem;
  text-align: center;
  font-weight: 700;
}
.report-table--metrics .col-filler {
  width: auto;
  padding: 0;
  border: none;
  background: transparent;
}
.report-table--metrics .col-trend {
  width: 13rem;
}
/* در صفحات باریک، ستون شاخص کوتاه‌تر می‌شود تا جدول overflow نکند */
@media (max-width: 1100px) {
  .report-table--metrics .col-metric { width: 22rem; }
}
@media (max-width: 900px) {
  .report-table--metrics .col-metric { width: 16rem; }
  .report-table--metrics .col-trend { width: 11rem; }
}
.report-table--metrics .col-trend {
  width: 13rem;
  text-align: center;
  vertical-align: middle;
  padding: 0.25rem 0.4rem;
}
.trend-wrap {
  display: block;
  width: 100%;
  direction: ltr;
}
.trend-spark {
  display: block;
  width: 100%;
  height: 32px;
  max-height: 32px;
}
.trend-spark--placeholder {
  opacity: 0.8;
}
.trend-months {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 3px;
  margin-top: 1px;
  font-size: 0.6rem;
  color: #94a3b8;
  line-height: 1;
  direction: ltr;
}
.trend-months span {
  flex: 1 1 0;
  text-align: center;
  font-family: inherit;
}

.report-footer {
  margin: 1rem 0 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* صفحه پرسنل — جدول تمیز (الگوی HR) */
.table-wrap {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  overflow: auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table-wrap th,
.table-wrap td {
  padding: 0.85rem 1.15rem;
  text-align: right;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.table-wrap th {
  background: rgba(15, 118, 110, 0.06);
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.table-wrap tbody tr {
  transition: background 0.15s;
}

.table-wrap tbody tr:hover td {
  background: rgba(15, 118, 110, 0.04);
}

/* یادداشت پایین صفحه (مثلاً پرسنل) */
.page-note {
  margin-top: 1rem;
  padding: 0.65rem 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* صفحه تحلیل (سطح ۳) — بلوک‌های تمیز (الگوی HR) */
.analysis-sections {
  display: grid;
  gap: 1rem;
}

.analysis-block {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.2s;
}

.analysis-block:hover {
  box-shadow: var(--glass-shadow-hover);
}

.analysis-block h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.85rem 0;
  color: var(--text);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.analysis-block ul {
  margin: 0;
  padding-right: 1.25rem;
  color: var(--text);
  line-height: 1.7;
}

.analysis-block li {
  margin-bottom: 0.5rem;
}

/* breadcrumb — نوار مسیر تمیز */
.breadcrumb {
  margin-bottom: 1rem;
  padding: 0.6rem 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--chart-blue);
}

.breadcrumb span {
  margin: 0 0.4rem;
  opacity: 0.7;
}

/* لیست گروه‌ها در صفحه دوم */
.group-indicators-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.group-indicators-list .card-title,
.group-indicators-list .card-title a {
  text-align: center;
}
.group-indicators-list .card-title a {
  font-size: 0.95rem;
}

/* صفحه گروه — سه حالت پایین نمودار مثل صفحه اول */
.group-page-cards .card--kpi {
  display: flex;
  flex-direction: column;
}
.group-page-cards .card-chart--kpi {
  position: relative;
  height: 180px;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
}
.group-page-cards .card-chart-view {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.group-page-cards .card-chart-view canvas {
  max-height: 160px !important;
}
.group-page-cards .card-indicator-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  flex-shrink: 0;
  min-height: 44px;
  margin-top: 0;
  border-top: 1px solid rgba(37, 99, 235, 0.15);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.95) 100%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.group-page-cards .card-indicator-footer .card-chart-switch {
  justify-self: start;
}
.group-page-cards .card-indicator-value {
  justify-self: center;
  display: block !important;
  font-size: 1rem;
  font-weight: 700;
  color: #1e40af;
  cursor: pointer;
  padding: 0 0.25rem;
  min-width: 2.5em;
  text-align: center;
}
.group-page-cards .card-indicator-value:hover {
  opacity: 0.8;
}
.group-page-cards .card-color-picker-wrap {
  position: relative;
  justify-self: end;
}
.group-page-cards .card-color-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.group-page-cards .card-color-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}
.group-page-cards .card-color-btn__icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #6366f1, #ec4899, #ef4444);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.card-indicator-footer--single {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(37, 99, 235, 0.15);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(241, 245, 249, 0.96) 100%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  gap: 0.75rem;
}
.card-indicator-footer--single .card-color-picker-wrap {
  margin-inline-start: auto;
}
.card-indicator-footer--single .card-chart-switch {
  flex-shrink: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.card-indicator-footer--single .card-chart-switch__track {
  display: block;
  width: 26px;
  height: 14px;
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  border-radius: 7px;
  position: relative;
}
.card-indicator-footer--single .card-chart-switch__knob {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}
[dir="rtl"] .card-indicator-footer--single .card-chart-switch__knob {
  right: auto;
  left: 1px;
}
.card-indicator-footer--single .card-chart-switch[aria-checked="true"] .card-chart-switch__track {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}
.card-indicator-footer--single .card-chart-switch[aria-checked="true"] .card-chart-switch__knob {
  transform: translateX(-14px);
}
[dir="rtl"] .card-indicator-footer--single .card-chart-switch[aria-checked="true"] .card-chart-switch__knob {
  transform: translateX(14px);
}
.card-indicator-footer--single .card-color-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}
.card-indicator-footer--single .card-color-btn__icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #6366f1, #ec4899, #ef4444);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.group-page-cards .card-chart-switch {
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.group-page-cards .card-chart-switch__track {
  display: block;
  width: 26px;
  height: 14px;
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  border-radius: 7px;
  position: relative;
}
.group-page-cards .card-chart-switch__knob {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}
[dir="rtl"] .group-page-cards .card-chart-switch__knob {
  right: auto;
  left: 1px;
}
.group-page-cards .card-chart-switch[aria-checked="true"] .card-chart-switch__track {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}
.group-page-cards .card-chart-switch[aria-checked="true"] .card-chart-switch__knob {
  transform: translateX(-12px);
}
[dir="rtl"] .group-page-cards .card-chart-switch[aria-checked="true"] .card-chart-switch__knob {
  transform: translateX(12px);
}
.group-page-cards .card--kpi {
  display: flex;
  flex-direction: column;
}

/* ریسپانسیو */
@media (max-width: 1024px) {
  .sidebar {
    width: 260px;
  }
  .main-content {
    margin-right: 260px;
  }
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi-sections {
    grid-template-columns: 1fr;
  }
  .kpi-section--2,
  .kpi-section--3 {
    grid-column: 1;
  }
  .kpi-charts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi-section--2 .kpi-charts-grid,
  .kpi-section--3 .kpi-charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-hero__grid,
  .kpi-section__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .personnel-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .personnel-filters__search {
    min-width: 0;
  }
  .personnel-filters__filter {
    min-width: 0;
  }
  .sidebar {
    transform: translateX(100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-right: 0;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .kpi-hero {
    padding: 1.25rem;
  }
  .kpi-sections {
    grid-template-columns: 1fr;
  }
  .kpi-charts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .kpi-section--2 .kpi-charts-grid,
  .kpi-section--3 .kpi-charts-grid {
    grid-template-columns: 1fr;
  }
  .kpi-section__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .kpi-hero__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .kpi-glass {
    min-height: 100px;
    padding: 1.1rem 1rem;
  }
  .kpi-glass__icon-wrap {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
  }
  .kpi-glass__icon {
    width: 20px;
    height: 20px;
  }
  .kpi-glass__value {
    font-size: 1.2rem;
  }
}

/* صفحه تنظیمات */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.settings-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.settings-tab:hover {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
}
.settings-tab.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.settings-content {
  max-width: 100%;
  width: 100%;
}
.settings-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--text);
}
.settings-section__desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem 0;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}
.settings-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.settings-block--wide {
  width: 100%;
}
.settings-block--wide .indicators-table-wrap {
  width: 100%;
}
.settings-block--wide .indicators-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.settings-block h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text);
}
.form-row {
  margin-bottom: 1rem;
}
.form-row:last-child {
  margin-bottom: 0;
}
.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.form-row--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.token-ranges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem 1.25rem;
}
.token-range-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.token-range-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.token-range-row .settings-input {
  max-width: 6em;
}

.form-row--inline label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  cursor: pointer;
}
.settings-input,
.settings-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
}
.settings-color {
  width: 60px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.settings-btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--glass-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.groups-indicators-list { display: flex; flex-direction: column; gap: 0.5rem; }
.groups-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.groups-row .groups-letter { font-weight: 700; min-width: 1.5em; }
.groups-row .groups-title { flex: 1; min-width: 120px; }
.groups-row .groups-file { min-width: 140px; }
.indicators-table-wrap {
  margin-top: 0.5rem;
  overflow-x: visible;
}
.indicators-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.indicators-table th,
.indicators-table td {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  text-align: center;
  white-space: normal;
  vertical-align: middle;
}
.indicators-table th {
  background: rgba(37, 99, 235, 0.08);
  font-weight: 600;
}
.indicators-table .ind-group-select,
.indicators-table .ind-model-select,
.indicators-table .ind-target-unit,
.indicators-table .ind-target-period {
  min-width: 120px;
}
.indicators-table .ind-target-value {
  min-width: 140px;
}
.indicators-table td select,
.indicators-table td input {
  width: 100%;
  box-sizing: border-box;
}

.settings-btn:hover {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
}
.settings-btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.settings-btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.settings-btn--danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.settings-btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}
.settings-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
}

/* صفحه اطلاعات واحدها — طرح جدید v2 */
.units-page .main-content {
  padding-bottom: 2rem;
}

/* هدر و خلاصه */
.units-v2__header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e2e8f0;
}
.units-v2__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.units-v2__title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
}
.units-v2__stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #64748b;
}
.units-v2__stat strong {
  color: #0f172a;
}
.units-v2__stat-sep {
  color: #cbd5e1;
  font-weight: 300;
}
.units-v2__desc {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
}

/* گرید واحدها */
.units-v2__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}
.unit-v2 {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.unit-v2:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}
.unit-v2__head {
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}
.unit-v2__name {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}
.unit-v2__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #64748b;
}
.unit-v2__kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}
.unit-v2__kpi {
  text-align: center;
  padding: 0.5rem 0.4rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}
.unit-v2__kpi--perf {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
}
.unit-v2__kpi--perf .unit-v2__kpi-val {
  color: #1d4ed8;
}
.unit-v2__kpi-lbl {
  display: block;
  font-size: 0.65rem;
  color: #64748b;
  margin-bottom: 0.2rem;
  font-weight: 500;
}
.unit-v2__kpi-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
}
.unit-v2__kpi-val small {
  font-size: 0.65rem;
  font-weight: 500;
  color: #94a3b8;
}

/* SWOT */
.unit-v2__swot {
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.unit-v2__swot-item {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-right: 4px solid transparent;
}
.unit-v2__swot-item h4 {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.unit-v2__swot-item ul {
  margin: 0;
  padding: 0 0 0 1rem;
  font-size: 0.78rem;
  line-height: 1.65;
  color: #475569;
}
.unit-v2__swot-item--s {
  background: #f0fdf4;
  border-right-color: #22c55e;
}
.unit-v2__swot-item--s h4 { color: #15803d; }
.unit-v2__swot-item--w {
  background: #fef2f2;
  border-right-color: #ef4444;
}
.unit-v2__swot-item--w h4 { color: #dc2626; }
.unit-v2__swot-item--o {
  background: #eff6ff;
  border-right-color: #3b82f6;
}
.unit-v2__swot-item--o h4 { color: #2563eb; }
.unit-v2__swot-item--t {
  background: #fffbeb;
  border-right-color: #f59e0b;
}
.unit-v2__swot-item--t h4 { color: #d97706; }
.unit-v2__swot-item--n {
  grid-column: 1 / -1;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.85rem;
}
.unit-v2__swot-item--n p { margin: 0; }

@media (max-width: 500px) {
  .unit-v2__kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .unit-v2__swot {
    grid-template-columns: 1fr;
  }
}

/* داشبورد KPI نیروی کار — بازسازی دقیق ترکیب و حالت تصویر مرجع */
.wf-dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 1.25rem;
  margin-top: 1rem;
}
.wf-card {
  background: #ffffff;
  border: 1px solid rgba(139, 69, 19, 0.08);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 200px;
  transition: border-color 0.2s ease;
}
.wf-card:hover {
  border-color: rgba(139, 69, 19, 0.15);
}
.wf-card--empty {
  background: transparent;
  border: 1px dashed rgba(139, 69, 19, 0.1);
  min-height: 180px;
}
.wf-card--add {
  display: flex;
  align-items: stretch;
  padding: 0;
}
.wf-card--add .add-indicator-card {
  flex: 1;
  width: 100%;
  min-height: 180px;
}
.wf-card__value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}
.wf-card__title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #5D4037;
  text-align: center;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.wf-card__chart {
  flex: 1;
  width: 100%;
  min-height: 100px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wf-card__chart canvas {
  max-height: 120px;
  width: 100% !important;
}
.wf-card__structure {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0.5rem 0;
}
.wf-structure__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.wf-structure__icon {
  width: 44px;
  height: 44px;
}
.wf-structure__item--male .wf-structure__icon {
  color: #D4A574;
}
.wf-structure__item--female .wf-structure__icon {
  color: #A52A2A;
}
.wf-structure__pct {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a1a1a;
}
.wf-structure__label {
  font-size: 0.7rem;
  color: #795548;
  font-weight: 600;
}
.wf-gauge-scale {
  display: flex;
  justify-content: space-between;
  width: 85%;
  margin-top: -8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #5D4037;
}
@media (max-width: 1200px) {
  .wf-dashboard { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .wf-dashboard { grid-template-columns: repeat(2, 1fr); }
}

/* داشبورد KPI منابع انسانی — بازسازی دقیق تصویر Human Resources KPI Dashboard */
.hr-page-header .subtitle {
  font-size: 0.9rem;
  color: #555;
}
.hr-section {
  margin-top: 2rem;
}
.hr-section--top {
  background: #fff;
  padding: 1.5rem;
  border-radius: 4px;
}
.hr-dept-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: center;
}
.hr-dept-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 130px;
}
.hr-dept-item__title {
  font-size: 0.68rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}
.hr-dept-item__chart {
  width: 130px;
  height: 130px;
  position: relative;
}
.hr-dept-item__chart canvas {
  width: 100% !important;
  height: 100% !important;
}
.hr-legend-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  border-right: 1px solid rgba(0,0,0,0.06);
}
.hr-legend-panel__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.hr-legend-panel__icon {
  width: 40px;
  height: 40px;
  color: #1a1a1a;
}
.hr-legend-panel__bar {
  width: 28px;
  height: 10px;
  border-radius: 2px;
}
.hr-legend-panel__bar--male {
  background: #C55A11;
}
.hr-legend-panel__bar--female {
  background: #4472C4;
}
.hr-legend-panel__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #333;
}
.hr-section__subtitle {
  font-size: 0.9rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 0;
}
.hr-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
.hr-chart-panel {
  background: #fff;
  padding: 1.25rem;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
}
.hr-chart-panel__title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}
.hr-chart-panel__body {
  flex: 1;
  min-height: 240px;
  position: relative;
}
.hr-chart-panel__body canvas {
  width: 100% !important;
  max-height: 240px;
}
@media (max-width: 1024px) {
  .hr-bottom-row { grid-template-columns: 1fr; }
  .hr-legend-panel { border-right: none; margin-right: 0; }
}
@media (max-width: 768px) {
  .hr-dept-row { flex-direction: column; align-items: center; }
  .hr-legend-panel { flex-direction: row; gap: 2rem; }
}

/* کارت ایجاد شاخص جدید */
.add-indicator-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 1.5rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px dashed rgba(37, 99, 235, 0.35);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
}
.add-indicator-card:hover {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: rgba(37, 99, 235, 0.6);
  transform: translateY(-2px);
}
.add-indicator-card__icon {
  width: 64px;
  height: 64px;
  color: rgba(37, 99, 235, 0.7);
  margin-bottom: 0.75rem;
}
.add-indicator-card__icon svg {
  width: 100%;
  height: 100%;
}
.add-indicator-card__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
}

.add-indicator-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.add-indicator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  max-width: 320px;
}

/* مودال شیشه‌ای ارتقا اکانت */
.upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.upgrade-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.upgrade-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
}
.upgrade-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}
.upgrade-modal__glass {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 2rem;
}
.upgrade-modal__text {
  margin: 0 0 1.5rem 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.7;
}
.upgrade-modal__close {
  display: block;
  width: 100%;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.upgrade-modal__close:hover {
  background: var(--primary-dark);
}
html.theme-dark .upgrade-modal__glass {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(148, 163, 184, 0.2);
}

/* تم روشن (پیش‌فرض) */
html.theme-light {
  --glass-bg: #ffffff;
  --card-bg: #ffffff;
  --body-bg: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
}

/* دارک مود */
html.theme-dark {
  --glass-bg: #1e293b;
  --card-bg: #1e293b;
  --body-bg: #0f172a;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
}
html.theme-dark body {
  background: #0f172a;
}

/* منوی سراسری: نسخه مشترک نمایش داده شود و نمونه‌های قدیمی هر صفحه پنهان بمانند. */
.sidebar:not(.global-sidebar) { display: none !important; }
.global-sidebar { display: flex; }

/* گیج یکسان پروژه در ستون خالی کنار نمودار روند صفحات وضعیت واحدها */
.report-table--metrics td.col-filler:has(.status-mini-gauge),
.report-table--metrics td.col-filler:has(.status-mini-gauge-empty) {
  min-width: 104px;
  padding: 0.25rem 0.4rem;
  text-align: center;
  vertical-align: middle;
}
.kpi-mini-gauge.status-mini-gauge {
  position: relative;
  width: 94px;
  height: 59px;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(145deg, #0b1f33, #173b57);
  border-radius: 9px;
  box-shadow: 0 4px 10px rgba(11,31,51,.14);
  direction: ltr;
}
.kpi-mini-gauge.status-mini-gauge .card-gauge-wrap {
  position: absolute;
  top: 4px;
  left: 50%;
  margin: 0;
  transform: translateX(-50%) scale(.42);
  transform-origin: top center;
}
.kpi-mini-gauge.status-mini-gauge .card-gauge-needle {
  animation: none !important;
  transform: rotate(var(--needle-angle, -90deg)) !important;
}
.status-mini-gauge .kpi-mini-gauge__value {
  position: absolute;
  top: 47px;
  right: 50%;
  bottom: auto;
  display: block;
  min-width: 30px;
  height: 10px;
  margin: 0;
  color: #fff;
  font-size: .58rem;
  line-height: 10px;
  text-align: center;
  transform: translateX(50%);
}
.status-mini-gauge-empty { color: #94a3b8; font-weight: 700; }
@media (max-width: 760px) {
  .kpi-mini-gauge.status-mini-gauge { transform: scale(.92); transform-origin: center; }
}
@media print {
  .kpi-mini-gauge.status-mini-gauge { break-inside: avoid; box-shadow: none; }
}

/* مقدار ناموجود، گیج را حفظ می‌کند اما عقربه ندارد تا صفر واقعی برداشت نشود. */
.status-mini-gauge--empty .card-gauge-needle { display: none; }
.status-mini-gauge--empty .card-gauge-bg,
.status-mini-gauge--empty .card-gauge-scale { opacity: .62; }

/* عنوان ستون گیج دقیقاً بالای خود نمودار قرار بگیرد. */
.report-table--metrics th.col-filler {
  text-align: center;
  vertical-align: middle;
}
