:root {
  --brand: #465fff;
  --brand-dark: #3641f5;
  --brand-light: #ecf3ff;
  --bg: #f8f9fb;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --danger: #dc2626;
  --success: #16a34a;
  --white: #ffffff;
  --sidebar-width: 272px;
  --sidebar-collapsed-width: 80px;

  /* Sidebar "Modern Pro" — palette riêng cho menu, tách khỏi các token dùng
     chung ở trên (kpi cards, topbar...) vì đây là yêu cầu chỉnh RIÊNG
     sidebar, không đổi tông màu toàn site. */
  --sidebar-font: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidebar-section-title: #94a3b8;
  --sidebar-text: #334155;
  --sidebar-active-bg: #eff6ff;
  --sidebar-active-text: #4f46e5;
  --sidebar-hover-bg: #f1f5f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* ---------- App shell ---------- */
/* (Trang đăng nhập/đăng ký giờ dùng css/auth.css riêng — xem file đó) */

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

.sidebar {
  position: relative; /* neo cho .sidebar-toggle-btn định vị tuyệt đối */
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  font-family: var(--sidebar-font);
  transition: width 0.2s ease;
}

/* ----- Thu gọn sidebar (chỉ còn icon) -----
   Ẩn mọi phần chữ/nhãn/chevron/badge/thẻ AI — giữ lại icon căn giữa. Trạng
   thái được lưu ở localStorage (xem shell.js) nên không bị "nháy" giao diện
   giữa các lần chuyển trang (site tĩnh, mỗi trang là 1 lần tải mới). */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-list a .chevron,
.sidebar.collapsed .sidebar-ai-card,
.sidebar.collapsed .sidebar-footer-info,
.sidebar.collapsed .sidebar-footer .chevron {
  display: none;
}

.sidebar.collapsed .nav-list a {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-footer-btn {
  justify-content: center;
  padding: 0.375rem 0;
}

.sidebar.collapsed .sidebar-toggle-btn .icon {
  transform: rotate(180deg);
}

/* Tooltip khi hover 1 mục lúc sidebar đang thu gọn — thuần CSS qua
   data-tooltip (gán trong shell.js), không cần thư viện. */
.sidebar.collapsed .nav-list a,
.sidebar.collapsed .sidebar-footer-btn {
  position: relative;
}

.sidebar.collapsed .nav-list a:hover::after,
.sidebar.collapsed .sidebar-footer-btn:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  z-index: 50;
  pointer-events: none;
}

.sidebar-toggle-btn {
  position: absolute;
  top: 58px;
  right: -13px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  z-index: 5;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: var(--sidebar-hover-bg);
  color: var(--text);
}

.sidebar-toggle-btn .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: 64px;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition: padding 0.2s ease;
}

/* Logo For Future thật (apps/web/public/images/brand/logo-icon.png) — thay
   cho ô vuông gradient chữ "N" placeholder trước đây. object-fit:contain vì
   ảnh gốc không phải hình vuông tuyệt đối. */
.sidebar-brand .logo-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  object-fit: contain;
}

.sidebar-brand .logo-text {
  line-height: 1.15;
}

.sidebar-brand .logo-text strong {
  display: block;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}

.sidebar-brand .logo-text span {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.75rem 0;
}

/* Khoảng cách giữa 2 nhóm menu: 24px */
.nav-group + .nav-group {
  margin-top: 24px;
}

/* Section title: 11px, 600, uppercase, letter-spacing 0.05em, xám nhạt */
.nav-group-label {
  padding: 0 0.75rem;
  margin-bottom: 0.375rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sidebar-section-title);
}

/* Khoảng cách giữa các item: 6px */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Menu item: 14px/500, padding 10px 14px, bo góc "soft card" 10px */
.nav-list a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-text);
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-list a:hover {
  background: var(--sidebar-hover-bg);
}

/* Active state: nền xanh nhạt + chữ/icon Indigo đậm + thanh chỉ báo trái */
.nav-list a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

.nav-list a.active::before {
  content: "";
  position: absolute;
  left: -0.75rem; /* chạm mép trái sidebar — bù lại padding 0.75rem của .sidebar-scroll */
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 0 4px 4px 0;
  background: var(--sidebar-active-text);
}

/* Icon: 20px — stroke-width 1.75 đã set sẵn trong SVG (xem shell.js) */
.nav-list a .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-list a .nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-list a .chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Badge số đếm (vị trí tuyển mới, đơn chờ duyệt...) — dạng pill nhỏ gọn */
.nav-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-list a.active .nav-badge {
  background: var(--sidebar-active-text);
  color: var(--white);
}

.sidebar-ai-card {
  margin: 1rem;
  padding: 1rem;
  border-radius: 14px;
  color: var(--white);
  background: linear-gradient(160deg, var(--brand) 0%, #7a5cff 100%);
}

.sidebar-ai-card .icon {
  width: 20px;
  height: 20px;
}

.sidebar-ai-card h4 {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.875rem;
}

.sidebar-ai-card p {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
  opacity: 0.9;
}

.sidebar-ai-card button {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-dark);
  background: var(--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.sidebar-footer {
  position: relative;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 0.75rem;
}

.sidebar-footer-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.sidebar-footer-btn:hover {
  background: var(--bg);
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-footer-info {
  flex: 1;
  min-width: 0;
}

.sidebar-footer-info .name {
  font-size: 0.8125rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer-info .role {
  font-size: 0.6875rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer .chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-footer-menu {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(100% + 0.5rem);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
  padding: 0.375rem;
  display: none;
}

.sidebar-footer-menu.open {
  display: block;
}

.sidebar-footer-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.sidebar-footer-menu button:hover {
  background: var(--bg);
}

.sidebar-footer-menu .icon {
  width: 16px;
  height: 16px;
}

.main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- Topbar ---------- */

.topbar {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.breadcrumb .current {
  color: var(--text);
  font-weight: 600;
}

.topbar-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-faint);
}

.topbar-search .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.topbar-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font-size: 0.8125rem;
  color: var(--text);
}

.topbar-search input::placeholder {
  color: var(--text-faint);
}

.kbd-hint {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-faint);
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 5px;
  padding: 0.0625rem 0.375rem;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Ghost/minimalist icon button — không viền, không nền ở trạng thái nghỉ,
   chỉ hiện nền nhạt khi hover để vẫn có phản hồi thao tác. */
.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

/* Đè lên đúng góc trên-phải của icon (không phải góc của toàn bộ nút) —
   icon 18px nằm giữa nút 38px nên căn theo mép icon, không phải mép nút. */
.icon-btn .badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.25rem 0.375rem;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.user-menu-trigger:hover {
  background: var(--bg);
}

/* Ảnh đại diện tròn — thay cho vòng tròn chữ cái trước đây. Chưa có tính
   năng tải ảnh hồ sơ thật nên dùng ảnh SVG placeholder trung tính (xem
   DEFAULT_AVATAR_SRC trong shell.js), object-fit:cover để sẵn sàng khi có
   ảnh thật với tỉ lệ khác. */
.user-menu-trigger .avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--brand-light);
}

/* Khối Tên/Vai trò: 2 dòng xếp dọc (flex column), không nối ngang */
.user-menu-trigger .info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.3;
}

.user-menu-trigger .name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.user-menu-trigger .role {
  font-size: 12px;
  color: #64748b;
}

.user-menu-trigger .chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  align-self: center; /* căn giữa dọc theo chiều cao khối info 2 dòng */
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 170px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
  padding: 0.375rem;
  display: none;
  z-index: 20;
}

.user-menu-dropdown.open {
  display: block;
}

.user-menu-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.user-menu-dropdown button:hover {
  background: var(--bg);
}

.user-menu-dropdown .icon {
  width: 16px;
  height: 16px;
}

/* ---------- Content shell ---------- */

.content {
  flex: 1;
  padding: 1.5rem;
}

.content h1 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.content .page-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 640px;
}

.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem;
  margin-top: 1.5rem;
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: 16px;
}

.coming-soon .icon {
  width: 40px;
  height: 40px;
  color: var(--brand);
  opacity: 0.8;
}

.coming-soon h2 {
  margin: 1rem 0 0.25rem;
  font-size: 1.125rem;
}

.coming-soon p {
  margin: 0;
  max-width: 360px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.badge-soon {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-dark);
  background: var(--brand-light);
  border-radius: 999px;
}

/* ---------- Dashboard: header row ---------- */

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.dash-header h1 {
  margin: 0;
  font-size: 1.375rem;
}

.dash-header .page-desc {
  margin-top: 0.25rem;
}

.dash-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.btn-outline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}

.btn-outline:hover {
  background: var(--bg);
}

.btn-outline .icon {
  width: 15px;
  height: 15px;
}

.btn-solid {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--white);
  background: var(--brand);
  border: none;
  border-radius: 9px;
  cursor: pointer;
}

.btn-solid:hover {
  background: var(--brand-dark);
}

.btn-solid .icon {
  width: 15px;
  height: 15px;
}

/* ---------- Dashboard: KPI cards ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.125rem;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.kpi-icon .icon {
  width: 19px;
  height: 19px;
}

.kpi-icon.tone-blue { background: #eaf0ff; color: var(--brand); }
.kpi-icon.tone-green { background: #e8f9ee; color: var(--success); }
.kpi-icon.tone-orange { background: #fff2e6; color: #ea8c1c; }
.kpi-icon.tone-purple { background: #f2ecff; color: #8151e8; }
.kpi-icon.tone-red { background: #fdeaea; color: var(--danger); }

.kpi-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.kpi-trend .icon {
  width: 13px;
  height: 13px;
}

.kpi-trend span.muted {
  font-weight: 400;
  color: var(--text-muted);
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* ---------- Generic panel ---------- */

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.125rem;
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.panel-header h3 {
  margin: 0;
  font-size: 0.9375rem;
}

.panel-select {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.25rem 0.5rem;
}

.panel-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand);
}

/* ---------- Charts row ---------- */

.charts-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.line-chart svg,
.bars-chart-svg svg {
  width: 100%;
  height: auto;
  display: block;
}

.axis-label {
  font-size: 9px;
  fill: #9ca3af;
}

.grid-line {
  stroke: #eef0f3;
  stroke-width: 1;
}

.donut-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.donut-row svg {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.donut-center-value {
  font-size: 15px;
  font-weight: 800;
  fill: var(--text);
}

.donut-center-label {
  font-size: 8.5px;
  fill: var(--text-muted);
}

.donut-legend {
  flex: 1;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.legend-name {
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-pct {
  font-weight: 700;
  width: 40px;
  text-align: right;
}

.legend-count {
  width: 46px;
  text-align: right;
  color: var(--text-muted);
}

.bars-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 180px;
  padding-top: 0.5rem;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 0.5rem;
}

.bar-col .bar {
  width: 60%;
  max-width: 34px;
  border-radius: 6px 6px 0 0;
  background: var(--brand);
}

.bar-col .bar-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

/* ---------- Bottom row ---------- */

.bottom-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.leave-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.leave-list li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}

.leave-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.leave-info {
  flex: 1;
  min-width: 0;
}

.leave-info .name {
  font-size: 0.8125rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leave-info .role {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leave-date {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-right: 0.5rem;
}

.status-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.approved { background: #e8f9ee; color: var(--success); }
.status-badge.pending { background: #fff7e0; color: #b9860a; }
.status-badge.rejected { background: #fdeaea; color: var(--danger); }
.status-badge.active { background: #e8f9ee; color: var(--success); }

.funnel-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.funnel-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.funnel-bar-wrap {
  display: flex;
  justify-content: center;
}

.funnel-bar {
  height: 30px;
  border-radius: 6px;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.funnel-table {
  flex-shrink: 0;
  width: 140px;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.funnel-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  padding-bottom: 0.5rem;
  font-size: 0.6875rem;
}

.funnel-table th:first-child,
.funnel-table td:first-child {
  text-align: left;
}

.funnel-table td {
  padding: 0.3125rem 0;
  text-align: right;
}

.funnel-name {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-muted);
}

.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge-svg-wrap {
  position: relative;
  width: 100%;
  max-width: 220px;
}

.gauge-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.gauge-value {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14%;
  text-align: center;
}

.gauge-value .pct {
  font-size: 1.375rem;
  font-weight: 800;
}

.gauge-value .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.gauge-trend {
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

.gauge-caption {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Employee table ---------- */

.table-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-faint);
  width: 220px;
}

.table-search .icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.table-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font-size: 0.8125rem;
  color: var(--text);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  padding: 0 0.625rem 0.625rem;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.625rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.employee-cell {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.employee-cell .name {
  font-weight: 600;
}

.table-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.page-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.page-btn:hover {
  background: var(--bg);
}

.page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}

@media (max-width: 1180px) {
  .charts-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .sidebar {
    display: none;
  }
  .topbar-search {
    display: none;
  }
}
