/* MES Platform demo — design tokens from Figma (M0zSFtoeM5FIb66Eplj0Il) */
:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-900: #1e3a8a;

  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-900: #0f172a;
  --white: #ffffff;

  --success-50: #f6ffed;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #389e0d;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-700: #92400e;

  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-500: #ef4444;

  --violet-100: #e8e2fe;
  --violet-600: #6715e8;

  --rose-100: #fedde0;
  --rose-700: #ae002e;

  --radius-s: 4px;
  --radius-l: 8px;
  --radius-xl: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--neutral-900);
  background: var(--neutral-100);
  font-size: 14px;
  line-height: 1.4;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--neutral-300);
  display: flex;
  flex-direction: column;
}
.sidebar__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
}
.sidebar__logo img { height: 96px; }
.sidebar__collapse {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--neutral-400);
  font-size: 18px;
}
.sidebar__menu {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.menu-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-l);
  color: var(--neutral-900);
  font-weight: 500;
  font-size: 15px;
}
.menu-item i { font-size: 20px; line-height: 1; }
.menu-item.active {
  background: var(--primary-500);
  color: var(--white);
}
.menu-item-row { display: flex; align-items: center; gap: 2px; width: 100%; }
.menu-item-row .menu-item { flex: 1; }
.menu-chevron-btn {
  background: transparent;
  border: none;
  color: var(--neutral-400);
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.menu-chevron-btn:hover { background: var(--neutral-100); }
.menu-chevron-btn i { font-size: 18px; transition: transform 0.15s ease; }
.menu-item-wrap.expanded .menu-chevron-btn i { transform: rotate(180deg); }
.menu-item-wrap .submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 40px;
  margin-top: 2px;
}
.menu-item-wrap.expanded .submenu { display: flex; }
.submenu a {
  padding: 6px 8px;
  border-radius: var(--radius-l);
  font-size: 14px;
  color: var(--neutral-600);
}
.submenu a:hover { background: var(--neutral-100); }
.submenu a.active { color: var(--primary-600); font-weight: 600; background: var(--primary-50); }

/* ---------- Tooltip / popup on hover ---------- */
.has-tooltip { position: relative; }
.has-tooltip .tooltip-box {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--neutral-900);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: var(--radius-l);
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 30;
  text-align: left;
}
.has-tooltip .tooltip-box::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--neutral-900);
}
.has-tooltip:hover .tooltip-box { opacity: 1; visibility: visible; }
.tooltip-box.wide { white-space: normal; width: 220px; }
.tooltip-box .tooltip-title { font-weight: 600; margin-bottom: 4px; display: block; }
.tooltip-box ul { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; padding-left: 14px; list-style: disc; }

.menu-section {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--neutral-300);
  font-size: 13px;
  text-transform: uppercase;
}
.menu-section::before,
.menu-section::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--neutral-200);
}

/* ---------- Main / Topbar ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--neutral-100);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar__title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar__title i { font-size: 24px; }
.topbar__title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}
.topbar__back {
  font-size: 20px;
  color: var(--neutral-900);
  margin-right: 4px;
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar__datetime { font-size: 14px; color: var(--neutral-900); }
.topbar__divider { width: 1px; height: 16px; background: var(--neutral-300); }
.icon-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 40px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--neutral-700);
}
.icon-btn .badge-count {
  position: absolute;
  top: -2px;
  right: -6px;
  background: var(--rose-100);
  color: var(--rose-700);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 0 4px;
  border-radius: var(--radius-s);
  line-height: 16px;
}
.avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 40px;
  background: var(--primary-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  font-size: 18px;
}
.content {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Notice banner ---------- */
.banner {
  background: var(--warning-50);
  border: 1px solid var(--warning-100);
  border-radius: var(--radius-xl);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.banner i.banner__icon { color: var(--warning-500); font-size: 20px; }
.banner__body { flex: 1; }
.banner__body strong { font-weight: 700; }
.banner__body b { font-weight: 600; }
.banner__body ul { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.banner__close {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--neutral-500);
  font-size: 18px;
  display: flex;
  align-items: center;
}

/* ---------- KPI cards ---------- */
.kpi-row {
  display: flex;
  gap: 16px;
}
.kpi-card {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.kpi-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.kpi-card__icon.blue { background: var(--primary-100); color: var(--primary-600); }
.kpi-card__icon.green { background: var(--success-100); color: var(--success-600); }
.kpi-card__icon.mint { background: var(--success-50); color: var(--success-600); }
.kpi-card__icon.amber { background: var(--warning-100); color: var(--warning-500); }
.kpi-card__icon.violet { background: var(--violet-100); color: var(--violet-600); }
.kpi-card__body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
.kpi-card__text { flex: 1; min-width: 0; }
.kpi-card__label { font-size: 14px; font-weight: 500; color: var(--neutral-500); }
.kpi-card__value { font-size: 28px; font-weight: 700; color: var(--neutral-900); line-height: 32px; }
.kpi-card__filter { color: var(--neutral-400); font-size: 18px; }

/* ---------- Panels ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: 16px;
}
.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.panel__title { font-size: 16px; font-weight: 600; }
.panel__subtitle { font-size: 13px; color: var(--neutral-500); margin-top: 2px; }
.panel__link { font-size: 13px; font-weight: 600; color: var(--primary-600); display: flex; align-items: center; gap: 4px; }
.panel__select {
  font-size: 13px;
  color: var(--neutral-700);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-l);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--neutral-200);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-500);
}
.tabs a { padding-bottom: 12px; display: inline-flex; }
.tabs a.active {
  color: var(--primary-600);
  font-weight: 600;
  border-bottom: 2px solid var(--primary-600);
}

/* ---------- Filters row ---------- */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.search-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-l);
  padding: 8px 12px;
  color: var(--neutral-400);
  font-size: 14px;
}
.search-input i { font-size: 18px; }
.select-input {
  min-width: 180px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-l);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--neutral-700);
}
.select-input i { color: var(--neutral-400); }

/* ---------- Table ---------- */
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-500);
  padding: 8px;
  border-bottom: 1px solid var(--neutral-200);
}
.data-table td {
  padding: 12px 8px;
  font-size: 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--neutral-100);
}
.data-table tr:nth-child(even) td { background: var(--neutral-50); }
.data-table tr:last-child td { border-bottom: none; }
.cell-name { color: var(--primary-600); font-weight: 500; }
.cell-sub { color: var(--neutral-900); font-weight: 500; margin-top: 2px; }
.name-row { display: flex; align-items: center; gap: 6px; }

.tag-count {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-s);
  background: var(--neutral-100);
  color: var(--neutral-600);
}
.tag-count.alert { background: var(--danger-50); color: var(--danger-500); }

.progress {
  position: relative;
  width: 140px;
  height: 24px;
  border-radius: 40px;
  background: var(--primary-100);
  overflow: hidden;
}
.progress.wide { width: 100%; height: 32px; }
.progress__fill {
  position: absolute;
  inset: 0;
  background: var(--primary-500);
  border-radius: 40px;
}
.progress__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-900);
}
.progress.wide .progress__label { font-size: 14px; }

.diff-badge {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 40px;
  font-size: 13px;
  font-weight: 600;
}
.diff-badge.up { background: var(--success-100); color: var(--success-600); }
.diff-badge.down { background: var(--danger-100); color: var(--danger-500); }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.status-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-dot.ok { color: var(--success-600); }
.status-dot.warn { color: var(--warning-500); }
.status-dot.danger { color: var(--danger-500); }

.task-icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--primary-200);
  color: var(--primary-600);
  border-radius: var(--radius-s);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--neutral-600);
}
.pagination .select-input { min-width: 70px; }
.pagination .icon-btn { border: 1px solid var(--neutral-300); border-radius: var(--radius-s); }

/* ---------- Factory widget ---------- */
.factory-card {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: 16px;
}
.factory-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.factory-card__name { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.chip-status {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 40px;
  font-size: 13px;
  font-weight: 500;
  width: fit-content;
  margin: 8px 0 16px;
}
.chip-status.ok { background: var(--success-100); color: var(--success-600); }
.chip-status.warn { background: var(--warning-100); color: var(--warning-700); }
.factory-card__stats { margin: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.factory-card__stat { display: flex; justify-content: space-between; font-size: 14px; color: var(--neutral-700); }
.factory-card__stat b { font-weight: 600; color: var(--neutral-900); }
.btn-outline {
  width: 100%;
  border: 1px solid var(--primary-200);
  color: var(--primary-600);
  background: var(--white);
  border-radius: var(--radius-l);
  padding: 10px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-primary {
  background: var(--primary-500);
  color: var(--white);
  border: none;
  border-radius: var(--radius-l);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Request list ---------- */
.request-item { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--neutral-100); }
.request-item:last-child { border-bottom: none; }
.request-item__icon {
  width: 36px; height: 36px; border-radius: var(--radius-l);
  background: var(--primary-100); color: var(--primary-600);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px;
}
.request-item__body { flex: 1; min-width: 0; }
.request-item__meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--neutral-500); margin-bottom: 4px; }
.request-item__title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.request-item__desc { font-size: 13px; color: var(--neutral-600); margin-bottom: 8px; }
.request-item__tags { display: flex; gap: 6px; }
.tag-pill {
  font-size: 12px; font-weight: 500; color: var(--neutral-600);
  background: var(--neutral-100); padding: 2px 8px; border-radius: 40px;
}
.status-pill {
  font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 40px; white-space: nowrap;
}
.status-pill.processing { background: var(--primary-50); color: var(--primary-600); }
.status-pill.pending { background: var(--neutral-100); color: var(--neutral-600); }
.status-pill.done { background: var(--success-100); color: var(--success-600); }

/* ---------- Detail page ---------- */
.detail-layout { display: flex; flex-direction: column; gap: 16px; }
.detail-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.detail-card__title { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.detail-card__title i { color: var(--primary-600); font-size: 20px; }
.detail-card__body { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.detail-card__info { display: flex; flex-direction: column; gap: 8px; }
.detail-card__info .detail-row { justify-content: flex-start; gap: 6px; margin-bottom: 0; }
.detail-card__body .progress.wide { flex: 1; max-width: 580px; }
.detail-card__link-btn {
  width: 32px; height: 32px; border: 1px solid var(--primary-200); color: var(--primary-600);
  border-radius: var(--radius-s); display: flex; align-items: center; justify-content: center;
}
.detail-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; color: var(--neutral-700); }
.detail-row b { color: var(--neutral-900); font-weight: 600; }

.sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.sub-tabs a {
  padding: 8px 16px;
  border-radius: var(--radius-l);
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-600);
}
.sub-tabs a.active { background: var(--primary-500); color: var(--white); }
.sub-tabs .count {
  margin-left: 4px;
  background: rgba(0,0,0,0.08);
  border-radius: 40px;
  padding: 0 6px;
}
.sub-tabs a.active .count { background: rgba(255,255,255,0.25); }

/* ---------- Form (Tạo yêu cầu & chỉ đạo) ---------- */
.form-grid { display: flex; flex-direction: column; gap: 20px; max-width: 720px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 14px; font-weight: 600; color: var(--neutral-900); }
.form-field label .required { color: var(--danger-500); margin-left: 2px; }
.form-field .hint { font-size: 12px; color: var(--neutral-500); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-input, .form-textarea, .form-select {
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-l);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--neutral-900);
  width: 100%;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--neutral-400); }
.form-textarea { resize: vertical; min-height: 96px; }
.form-select { display: flex; align-items: center; justify-content: space-between; color: var(--neutral-500); }
.chip-select-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-select {
  border: 1px solid var(--neutral-300);
  border-radius: 40px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-700);
}
.chip-select.selected { background: var(--primary-50); border-color: var(--primary-500); color: var(--primary-600); }
.upload-dropzone {
  border: 1px dashed var(--neutral-300);
  border-radius: var(--radius-l);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--neutral-500);
  font-size: 13px;
  text-align: center;
}
.upload-dropzone i { font-size: 28px; color: var(--neutral-400); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 8px; border-top: 1px solid var(--neutral-100); margin-top: 4px; }
.btn-ghost {
  background: var(--white);
  color: var(--neutral-700);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-l);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
}
.form-stepper { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.form-stepper .step { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--neutral-400); }
.form-stepper .step .dot {
  width: 24px; height: 24px; border-radius: 50%; background: var(--neutral-100); color: var(--neutral-400);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.form-stepper .step.active { color: var(--primary-600); }
.form-stepper .step.active .dot { background: var(--primary-500); color: var(--white); }
.form-stepper .step.done .dot { background: var(--success-500); color: var(--white); }
.form-stepper .line { flex: 1; max-width: 48px; height: 1px; background: var(--neutral-200); }

/* ---------- Detail (Chi tiết yêu cầu & chỉ đạo) ---------- */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 20px; position: relative; }
.timeline-item::before {
  content: ''; position: absolute; left: 11px; top: 28px; bottom: 0; width: 1px; background: var(--neutral-200);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 24px; height: 24px; border-radius: 50%; background: var(--primary-100); color: var(--primary-600);
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; z-index: 1;
}
.timeline-body { flex: 1; }
.timeline-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.timeline-meta { font-size: 12px; color: var(--neutral-500); }

/* ---------- Topbar user (named avatar) ---------- */
.topbar__user { display: flex; align-items: center; gap: 10px; }
.topbar__user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary-100);
  color: var(--primary-600); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.topbar__user-text { display: flex; flex-direction: column; line-height: 1.3; }
.topbar__user-name { font-size: 13px; font-weight: 600; color: var(--neutral-900); }
.topbar__user-role { font-size: 12px; color: var(--neutral-500); }

/* ---------- Tổng quan: factory overview cards ---------- */
.factory-overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.factory-overview-card { background: var(--white); border: 1px solid var(--neutral-200); border-radius: var(--radius-xl); padding: 20px; }
.factory-overview-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.factory-overview-card__header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.factory-overview-card__link {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary-50); color: var(--primary-600);
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.factory-overview-stats { display: flex; gap: 12px; margin-bottom: 20px; }
.stat-box { flex: 1; border: 1px solid var(--neutral-200); border-radius: var(--radius-l); padding: 12px; display: flex; align-items: center; gap: 10px; }
.stat-box__icon {
  width: 36px; height: 36px; border-radius: var(--radius-l); background: var(--primary-100); color: var(--primary-600);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.stat-box__value { font-size: 20px; font-weight: 700; line-height: 1.2; }
.stat-box__label { font-size: 12px; color: var(--neutral-500); }
.stat-box__sub { font-size: 11px; color: var(--neutral-400); }

.donut-row { display: flex; align-items: center; gap: 24px; margin-bottom: 20px; }
.donut-chart { position: relative; width: 128px; height: 128px; border-radius: 50%; flex-shrink: 0; }
.donut-chart__hole {
  position: absolute; inset: 18px; background: var(--white); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-chart__hole .label { font-size: 12px; color: var(--neutral-500); }
.donut-chart__hole .value { font-size: 22px; font-weight: 700; color: var(--neutral-900); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.donut-legend__row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--neutral-700); }
.donut-legend__row-left { display: flex; align-items: center; gap: 8px; }
.donut-legend__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.section-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
table.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--neutral-500); padding: 6px 8px; border-bottom: 1px solid var(--neutral-200); }
.mini-table td { padding: 10px 8px; font-size: 13px; border-bottom: 1px solid var(--neutral-100); }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table .cell-name { color: var(--primary-600); font-weight: 500; }
.mini-table .cell-sub { color: var(--neutral-900); margin-top: 2px; }

/* ---------- Tooltip with structured rows (info icon) ---------- */
.tooltip-box .tooltip-rows { display: flex; flex-direction: column; gap: 4px; }
.tooltip-box .tooltip-row { display: flex; justify-content: space-between; gap: 16px; }
.tooltip-box .tooltip-row span:first-child { color: var(--neutral-400); }

/* ---------- Modal (Chi tiết dự án) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius-xl); width: 100%; max-width: 860px; padding: 24px; box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3); }
.modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal__header h2 { font-size: 20px; font-weight: 700; margin: 0; }
.modal__close { width: 32px; height: 32px; border: none; background: transparent; color: var(--neutral-500); font-size: 20px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.modal__close:hover { background: var(--neutral-100); }
.modal__tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--neutral-200); margin-bottom: 20px; font-size: 14px; font-weight: 500; color: var(--neutral-500); }
.modal__tabs button { background: none; border: none; padding: 0 0 12px; font: inherit; color: inherit; cursor: pointer; }
.modal__tabs button.active { color: var(--primary-600); font-weight: 600; border-bottom: 2px solid var(--primary-600); }
.modal__pane { display: none; }
.modal__pane.active { display: block; }
.detail-pane { display: none; }
.detail-pane.active { display: block; }
.modal h3 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px; margin-bottom: 24px; }
.info-grid .info-field { display: flex; flex-direction: column; gap: 4px; }
.info-grid .info-field span { font-size: 13px; color: var(--neutral-500); }
.info-grid .info-field b { font-size: 14px; font-weight: 600; color: var(--neutral-900); }
.info-grid .info-field .status-dot { font-size: 14px; font-weight: 600; }
.field-view-btn { width: 24px; height: 24px; border: none; background: transparent; color: var(--neutral-400); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.info-field__row { display: flex; align-items: center; gap: 6px; }
.obstacle-list { display: flex; flex-direction: column; gap: 12px; }
.obstacle-item { border-left: 3px solid var(--danger-500); background: var(--neutral-50); border-radius: 0 var(--radius-l) var(--radius-l) 0; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.obstacle-item__title { font-weight: 600; font-size: 14px; padding-right: 110px; }
.obstacle-item__meta { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--neutral-600); flex-wrap: wrap; }
.obstacle-item__badges { position: absolute; top: 12px; right: 16px; display: flex; gap: 8px; align-items: center; }

/* ---------- Tạo yêu cầu & chỉ đạo (new layout) ---------- */
.page-actionbar { display: flex; align-items: center; justify-content: space-between; }
.page-actionbar__back { display: flex; align-items: center; gap: 6px; color: var(--neutral-700); font-weight: 500; font-size: 14px; }
.page-actionbar__actions { display: flex; gap: 12px; }
.btn-outline--auto { width: auto; padding: 10px 20px; }
.btn-ghost--auto { width: auto; }
.content-box { border: 1px solid var(--neutral-200); border-radius: var(--radius-l); padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--neutral-50); }
.content-box h4 { font-size: 14px; font-weight: 700; margin: 0; }
.content-box p { font-size: 13px; color: var(--neutral-700); line-height: 1.6; margin: 0; }
.file-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--neutral-200); border-radius: var(--radius-l); padding: 10px 14px; margin-top: 12px; }
.file-row__icon { width: 36px; height: 36px; border-radius: var(--radius-s); background: var(--danger-50); color: var(--danger-500); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.file-row__body { flex: 1; min-width: 0; }
.file-row__name { font-size: 13px; font-weight: 600; }
.file-row__meta { font-size: 12px; color: var(--neutral-500); display: flex; align-items: center; gap: 6px; }
.file-row__meta i { color: var(--success-500); }
.file-row__remove { background: none; border: none; color: var(--neutral-400); font-size: 18px; display: flex; }

/* ---------- Báo cáo (3-column layout) ---------- */
.content.report-layout { flex-direction: row; align-items: flex-start; }
.report-nav { width: 280px; flex-shrink: 0; background: var(--white); border: 1px solid var(--neutral-200); border-radius: var(--radius-xl); padding: 16px; }
.report-nav__title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.report-nav__factory { margin-bottom: 2px; }
.report-nav__factory-row {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 8px;
  border-radius: var(--radius-l); font-size: 14px; font-weight: 600; color: var(--neutral-900);
  background: transparent; border: none; width: 100%; text-align: left; font-family: inherit; cursor: pointer;
}
.report-nav__factory-row:hover { background: var(--neutral-50); }
.report-nav__factory-row i { color: var(--neutral-400); transition: transform 0.15s ease; }
.report-nav__factory.expanded .report-nav__factory-row i { transform: rotate(180deg); }
.report-nav__sub { display: none; flex-direction: column; gap: 2px; padding: 4px 0 8px 16px; }
.report-nav__factory.expanded .report-nav__sub { display: flex; }
.report-nav__sub a { padding: 8px 12px; border-radius: var(--radius-l); font-size: 13px; color: var(--neutral-600); }
.report-nav__sub a.active { color: var(--primary-600); font-weight: 600; background: var(--primary-50); }
.report-nav__sub a:hover { background: var(--neutral-50); }
.report-content { flex: 1; min-width: 0; }
.report-content__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.report-content__header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.table-scroll { overflow-x: auto; }
table.report-table { width: 100%; border-collapse: collapse; }
.report-table th, .report-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--neutral-100); text-align: center; white-space: nowrap; }
.report-table th { white-space: normal; max-width: 160px; }
.report-table td:nth-child(2) { text-align: left; }
.report-table thead th { color: var(--neutral-500); font-weight: 500; font-size: 13px; border-bottom: 1px solid var(--neutral-200); }
.report-table thead tr:first-child th { color: var(--neutral-700); font-weight: 600; font-size: 14px; }
.report-table tr.total td { font-weight: 700; background: var(--neutral-50); }
.btn-export { display: flex; align-items: center; gap: 6px; border: 1px solid var(--primary-200); color: var(--primary-600); background: var(--white); border-radius: var(--radius-l); padding: 8px 14px; font-weight: 600; font-size: 14px; }
