/* Meritio - Main Stylesheet */

/* Login/Signup Tab Styling */
.tab-button {
  border: none;
  background: none;
  padding: 12px;
  color: var(--gray-600, #6b7280);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-button:hover {
  color: var(--primary-color, #3b82f6);
  background-color: var(--gray-50, #f9fafb);
}

.tab-button.active {
  color: var(--primary-color, #3b82f6);
  border-bottom-color: var(--primary-color, #3b82f6);
  font-weight: 600;
}

#signup-form-container {
  animation: fadeIn 0.3s ease-in;
}

#login-form-container {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --app-surface: #f4f4f1;
  --app-surface-elevated: #ffffff;
  --app-border: #e8e8e4;
  --app-navy: #0f172a;
  --app-navy-soft: #e2e8f0;
  --enterprise-radius: 14px;
  --enterprise-radius-sm: 10px;
  --enterprise-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --enterprise-shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.1);
  --enterprise-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --secondary-color: #6366f1;
  --purple-color: #7c3aed;
  --success-color: #16a34a;
  --warning-color: #ea580c;
  --danger-color: #dc2626;
  --info-color: #3b82f6;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --slate-50: #f8fafc;
}

/* ============================================================
   APP SHELL — Left Sidebar Navigation
   ============================================================ */

:root {
  --sidebar-width: 240px;
  --sidebar-bg: #0f172a;
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-link-idle: rgba(255,255,255,0.55);
  --sidebar-link-hover-bg: rgba(255,255,255,0.06);
  --sidebar-link-hover-fg: rgba(255,255,255,0.9);
  --sidebar-link-active-bg: rgba(37,99,235,0.25);
  --sidebar-link-active-fg: #fff;
  --sidebar-link-active-border: #3b82f6;
  --sidebar-footer-bg: rgba(0,0,0,0.25);
}

/* ── App shell layout ─────────────────────────────── */
#app-shell {
  display: flex;
  min-height: 100vh;
}

#app-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app-content #app {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Sidebar container ────────────────────────────── */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  box-shadow: 2px 0 16px rgba(0,0,0,0.18);
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

#app-content {
  transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Collapsed state (icons only, 64px) ──────────── */
.app-sidebar.sidebar-collapsed {
  width: 64px;
}

.app-sidebar.sidebar-collapsed ~ #app-content,
body.sidebar-collapsed #app-content {
  margin-left: 64px;
}

/* Hide text labels when collapsed */
.app-sidebar.sidebar-collapsed .sidebar-brand-name,
.app-sidebar.sidebar-collapsed .sidebar-nav-label,
.app-sidebar.sidebar-collapsed .sidebar-nav-dot,
.app-sidebar.sidebar-collapsed .sidebar-user-info,
.app-sidebar.sidebar-collapsed .sidebar-footer-btn span,
.app-sidebar.sidebar-collapsed .sidebar-user-name,
.app-sidebar.sidebar-collapsed .sidebar-user-role {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Center everything in collapsed state */
/* (brand collapsed state handled below the button CSS) */

.app-sidebar.sidebar-collapsed .sidebar-nav {
  padding: 0.75rem 0.5rem;
}

.app-sidebar.sidebar-collapsed .sidebar-nav-link {
  justify-content: center;
  padding: 0.6rem;
  gap: 0;
  border-left: 3px solid transparent;
}

.app-sidebar.sidebar-collapsed .sidebar-nav-link:hover {
  border-left-color: rgba(255,255,255,0.15);
}

.app-sidebar.sidebar-collapsed .sidebar-nav-link.active {
  border-left-color: var(--sidebar-link-active-border);
}

.app-sidebar.sidebar-collapsed .sidebar-nav-icon {
  width: 22px;
  font-size: 1.1rem;
}

.app-sidebar.sidebar-collapsed .sidebar-footer {
  padding: 0.9rem 0.5rem;
}

.app-sidebar.sidebar-collapsed .sidebar-user-card {
  justify-content: center;
  padding: 0.5rem;
  gap: 0;
}

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

.app-sidebar.sidebar-collapsed .sidebar-footer-btn i {
  font-size: 1rem;
}

/* Tooltip on hover when collapsed (show label as title) */
.app-sidebar.sidebar-collapsed .sidebar-nav-link {
  position: relative;
}

/* ── Collapse toggle button (lives inside brand row) ── */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.75rem;
  transition: background 0.15s ease, color 0.15s ease;
}

/* The icon inside rotates via CSS — no JS needed */
.sidebar-collapse-btn i {
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.sidebar-collapse-btn:hover {
  background: rgba(37,99,235,0.35);
  border-color: rgba(59,130,246,0.4);
  color: #fff;
}

/* Rotate the chevron when sidebar is collapsed */
.app-sidebar.sidebar-collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

/* Collapsed: fade out + zero-width the brand link, center just the button */
.app-sidebar.sidebar-collapsed .sidebar-brand-wrap {
  padding: 0.85rem 0;
  justify-content: center;
  gap: 0;
}

.app-sidebar.sidebar-collapsed .sidebar-brand {
  opacity: 0;
  flex: 0 0 0;
  min-width: 0;
  overflow: hidden;
  gap: 0;
  pointer-events: none;
}

/* ── Brand / Logo ─────────────────────────────────── */
.sidebar-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem 0.85rem 1.1rem;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  /* Fade out when sidebar collapses */
  opacity: 1;
  transition: opacity 0.18s ease;
}

.sidebar-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  padding: 3px;
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* ── Nav links ────────────────────────────────────── */
.sidebar-nav {
  padding: 0.75rem 0.6rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--sidebar-link-idle);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  position: relative;
  border-left: 3px solid transparent;
  margin-bottom: 2px;
  white-space: nowrap;
}

.sidebar-nav-link:hover {
  background: var(--sidebar-link-hover-bg);
  color: var(--sidebar-link-hover-fg);
  border-left-color: rgba(255,255,255,0.15);
}

.sidebar-nav-link.active {
  background: var(--sidebar-link-active-bg);
  color: var(--sidebar-link-active-fg);
  border-left-color: var(--sidebar-link-active-border);
  font-weight: 600;
}

.sidebar-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.sidebar-nav-label {
  flex: 1;
  min-width: 0;
}

/* Small active indicator dot (top-right of link) */
.sidebar-nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #60a5fa;
  flex-shrink: 0;
}

/* ── Spacer ───────────────────────────────────────── */
.sidebar-spacer {
  flex: 1;
}

/* ── Footer: Powered by ICAN ──────────────────────── */
.sidebar-powered-by {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
}
.sidebar-powered-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.3);
  font-weight: 400;
  letter-spacing: 0.02em;
}
.sidebar-powered-brand {
  font-size: 0.78rem;
  font-weight: 800;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Hide powered-by text when sidebar collapsed, just show dot */
.app-sidebar.sidebar-collapsed .sidebar-powered-by {
  padding: 0.85rem 0.5rem;
  justify-content: center;
}
.app-sidebar.sidebar-collapsed .sidebar-powered-label { display: none; }
.app-sidebar.sidebar-collapsed .sidebar-powered-brand {
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.35);
}

/* ── Top Ribbon ───────────────────────────────────── */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 58px;
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 60%, #1e3a5f 100%);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: 0 2px 16px rgba(15,23,42,0.22);
  flex-shrink: 0;
}

.app-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  flex: 1;
}

/* Greeting block */
.topbar-greeting {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.topbar-greeting-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
}

.topbar-greeting-sep {
  color: rgba(255,255,255,0.2);
  font-size: 1rem;
}

.topbar-greeting-date {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  font-weight: 400;
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Topbar divider between items */
.topbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.12);
}

/* Profile button */
.topbar-profile-wrap {
  position: relative;
}

.topbar-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 0.3rem 0.65rem 0.3rem 0.4rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.topbar-profile-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
}

.topbar-profile-btn.active {
  background: rgba(99,102,241,0.2);
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}

.topbar-user-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}

.topbar-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  line-height: 1.2;
}

.topbar-user-role {
  font-size: 0.67rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.topbar-chevron {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.topbar-profile-btn.active .topbar-chevron { transform: rotate(180deg); }

/* Dropdown */
.topbar-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 240px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15,23,42,0.14), 0 2px 8px rgba(15,23,42,0.06);
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 9999;
  overflow: hidden;
}

.topbar-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.topbar-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.topbar-dd-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}

.topbar-dd-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.2;
}

.topbar-dd-role {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 2px;
}

.topbar-dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 0;
}

.topbar-dd-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 1.1rem;
  font-size: 0.835rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.topbar-dd-item i {
  font-size: 0.9rem;
  color: #6366f1;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.topbar-dd-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.topbar-dd-item--danger { color: #ef4444; }
.topbar-dd-item--danger i { color: #ef4444; }
.topbar-dd-item--danger:hover { background: #fff1f2; color: #dc2626; }

/* Make app-content account for topbar height */
#app-content {
  display: flex;
  flex-direction: column;
}

/* Keep sidebar collapsed states working without the old footer */
.app-sidebar.sidebar-collapsed .sidebar-footer-btn span,
.app-sidebar.sidebar-collapsed .sidebar-user-name,
.app-sidebar.sidebar-collapsed .sidebar-user-role { display: none; }

/* ── App content pages: no top gap, full height ───── */
.meritio-app-page {
  min-height: 100vh;
}

/* Remove the old fixed height offset (was for top navbar) */
.meritio-sim-list,
.meritio-workspace {
  min-height: 100vh !important;
}

/* ── Responsive: collapse sidebar on mobile ───────── */
@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  }

  .app-sidebar.sidebar-open {
    transform: translateX(0);
  }

  #app-content {
    margin-left: 0;
  }

  .sidebar-mobile-toggle {
    display: flex !important;
  }
}

/* Mobile toggle button (shown inside page header on small screens) */
.sidebar-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* Mobile toggle inside topbar matches dark background */
.app-topbar .sidebar-mobile-toggle {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.12);
}
.app-topbar .sidebar-mobile-toggle:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

/* On desktop, hide the topbar mobile toggle */
@media (min-width: 992px) {
  #sidebar-toggle-btn-top { display: none !important; }
}

/* On mobile, hide topbar user info text to save space */
@media (max-width: 640px) {
  .topbar-user-info { display: none; }
  .app-topbar { padding: 0 1rem; }
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}

.sidebar-overlay.active { display: block; }

/* ── Navbar (legacy) — hide since sidebar replaces it ─── */
.navbar-main { display: none !important; }

/* Custom color utilities */
.text-purple {
  color: var(--purple-color) !important;
}

.bg-purple {
  background-color: var(--purple-color) !important;
}

/* Delete button styling on exercise cards */
.exercise-card .delete-exercise-btn {
  opacity: 0.6;
  transition: all 0.2s ease;
}

.exercise-card:hover .delete-exercise-btn {
  opacity: 1;
}

.exercise-card .delete-exercise-btn:hover {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: white;
}

.exercise-card .edit-notes-btn {
  opacity: 0.6;
  transition: all 0.2s ease;
}

.exercise-card:hover .edit-notes-btn {
  opacity: 1;
}

.exercise-card .edit-notes-btn:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Notes preview styling */
.notes-preview {
  font-style: italic;
  border-left: 3px solid var(--primary-color);
  max-height: 60px;
  overflow: hidden;
}

/* Multi-Select Filter Dropdown Styles */
.filter-dropdown-container {
  position: relative;
  display: inline-block;
  width: 100%;
  min-height: 36px; /* Ensure consistent container height */
}

/* Ensure all filter buttons in table headers have consistent sizing */
#increases-table th .filter-dropdown-container {
  min-height: 36px;
  display: flex;
  align-items: center;
}

.filter-btn {
  width: 100%;
  min-width: 120px; /* Minimum width to accommodate most text */
  min-height: 32px; /* Consistent height for all buttons */
  height: auto; /* Allow height to grow if text wraps */
  margin-top: 4px;
  font-size: 0.75rem;
  padding: 6px 8px; /* Increased padding for better appearance */
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
  hyphens: auto; /* Enable hyphenation for long words */
}

.filter-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 250px;
  max-width: 350px;
  max-height: 400px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  padding: 8px;
  display: none;
  overflow: hidden;
  flex-direction: column;
}

.filter-dropdown-menu.show {
  display: flex;
}

.filter-search-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.875rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  margin-bottom: 8px;
}

.filter-actions {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dee2e6;
}

.filter-actions button {
  flex: 1;
  padding: 4px 8px;
  font-size: 0.75rem;
  border: 1px solid #ced4da;
  background: white;
  border-radius: 0.25rem;
  cursor: pointer;
}

.filter-actions button:hover {
  background: #f8f9fa;
}

.filter-options-list {
  overflow-y: auto;
  max-height: 250px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.filter-option-item {
  padding: 4px 8px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.filter-option-item:hover {
  background: #f8f9fa;
}

.filter-option-item input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

.filter-option-item label {
  margin: 0;
  cursor: pointer;
  font-size: 0.875rem;
  flex: 1;
  user-select: none;
}

/* ⚠️ CRITICAL: See EDIT_INDIVIDUAL_MERIT_INCREASES_TABLE_UX_RULES.md */
/* Sticky columns for Employee ID and Name */
#increases-table-container {
  position: relative;
}

#increases-table th.sticky-column-left-0,
#increases-table td.sticky-column-left-0 {
  position: sticky;
  left: 0;
  z-index: 10;
  background-color: #f8f9fa;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

#increases-table th.sticky-column-left-1,
#increases-table td.sticky-column-left-1 {
  position: sticky;
  left: var(--sticky-column-0-width, 120px); /* Will be calculated dynamically */
  z-index: 10;
  background-color: #f8f9fa;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

#increases-table thead th.sticky-column-left-0,
#increases-table thead th.sticky-column-left-1 {
  z-index: 11; /* Header should be above body cells */
  background-color: #f8f9fa;
}

#increases-table tbody tr:hover td.sticky-column-left-0,
#increases-table tbody tr:hover td.sticky-column-left-1 {
  background-color: #e9ecef; /* Slightly darker on hover */
}

/* Column visibility - hidden columns */
#increases-table th.column-hidden,
#increases-table td.column-hidden {
  display: none !important;
}

/* ⚠️ CRITICAL: See EDIT_INDIVIDUAL_MERIT_INCREASES_TABLE_UX_RULES.md */
/* Zebra striping for better readability */
#increases-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

#increases-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

#increases-table tbody tr:hover {
  background-color: #e9ecef !important;
}

/* Ensure sticky columns maintain background on hover */
#increases-table tbody tr:hover td.sticky-column-left-0,
#increases-table tbody tr:hover td.sticky-column-left-1 {
  background-color: #e9ecef;
}

/* Better focus indication for keyboard navigation */
#increases-table-container:focus {
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
}

/* Edit Individual Increases: wider last 10 columns for better readability */
#increases-table th:nth-last-child(-n+10),
#increases-table td:nth-last-child(-n+10) {
  min-width: 110px;
  white-space: nowrap;
}

/* Global Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Navigation Bar */
.navbar-main {
  background-color: white;
  border-bottom: 1px solid var(--gray-200);
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-main .navbar-brand {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--app-navy);
  letter-spacing: -0.02em;
}

.navbar-main .navbar-brand .header-logo {
  height: 30px !important;
  width: auto !important;
  margin-right: 0.5rem !important;
  object-fit: contain;
}

.navbar-main #main-nav {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.navbar-main #main-nav .nav-link {
  color: #475569;
  font-weight: 500;
  padding: 0.38rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.navbar-main #main-nav .nav-link.active {
  background-color: #e0e7ff;
  color: #312e81;
  box-shadow: inset 0 0 0 1px rgba(49, 46, 129, 0.2);
}

.navbar-main #main-nav .nav-link:hover:not(.active) {
  background-color: var(--gray-100);
  color: var(--gray-900);
}

.navbar-main .navbar-nav:not(#main-nav) .nav-link {
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
}

.navbar-main .navbar-nav:not(#main-nav) .nav-link:hover {
  background-color: var(--gray-100);
}

/* Login Page */
/* ============================================================
   LOGIN PAGE — Full redesign
   ============================================================ */
.lp-shell {
  display: flex;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ── Left hero panel ──────────────────────────────────────── */
.lp-hero {
  flex: 0 0 55%;
  background: linear-gradient(135deg, #0c0e2b 0%, #1a1060 35%, #2d1b69 65%, #1e3a8a 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

/* Animated gradient orbs */
.lp-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}
.lp-orb--1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -120px; left: -100px;
  animation: lp-drift1 12s ease-in-out infinite alternate;
}
.lp-orb--2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  bottom: -80px; right: -60px;
  animation: lp-drift2 15s ease-in-out infinite alternate;
}
.lp-orb--3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #2563eb, transparent 70%);
  top: 50%; left: 60%;
  transform: translate(-50%, -50%);
  animation: lp-drift3 10s ease-in-out infinite alternate;
}
@keyframes lp-drift1 { 0%{transform:translate(0,0);} 100%{transform:translate(60px,40px);} }
@keyframes lp-drift2 { 0%{transform:translate(0,0);} 100%{transform:translate(-50px,-30px);} }
@keyframes lp-drift3 { 0%{transform:translate(-50%,-50%) scale(1);} 100%{transform:translate(-50%,-50%) scale(1.3);} }

/* Subtle dot-grid overlay */
.lp-grid-overlay {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.lp-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Brand */
.lp-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.lp-brand-mark {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.lp-brand-img {
  height: 26px; width: auto; object-fit: contain;
  filter: brightness(0) invert(1);
}
.lp-brand-name {
  font-size: 1.15rem; font-weight: 800; color: #fff; letter-spacing: -0.02em;
}

/* Headline */
.lp-headline-title {
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin: 0 0 0.75rem;
}
.lp-headline-accent {
  background: linear-gradient(90deg, #a5b4fc, #818cf8, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lp-headline-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.65;
  margin: 0;
  max-width: 380px;
}

/* Feature cards */
.lp-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.lp-feature {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.2s ease;
  animation: lp-slide-in 0.5s ease both;
}
.lp-feature:hover {
  background: rgba(255,255,255,0.1);
  transform: translateX(4px);
}
.lp-feature--1 { animation-delay: 0.1s; }
.lp-feature--2 { animation-delay: 0.2s; }
.lp-feature--3 { animation-delay: 0.3s; }
@keyframes lp-slide-in {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.lp-feature-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: rgba(99,102,241,0.25);
  border: 1px solid rgba(99,102,241,0.35);
  color: #a5b4fc;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.lp-feature-icon--green { background: rgba(22,163,74,0.2); border-color: rgba(22,163,74,0.3); color: #86efac; }
.lp-feature-icon--violet { background: rgba(124,58,237,0.2); border-color: rgba(124,58,237,0.3); color: #c4b5fd; }
.lp-feature-title { font-size: 0.88rem; font-weight: 700; color: #f1f5f9; }
.lp-feature-desc  { font-size: 0.75rem; color: rgba(255,255,255,0.45); margin-top: 0.1rem; }

/* Social proof */
.lp-proof {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.lp-proof-avatars { display: flex; }
.lp-proof-av {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; color: #fff;
  margin-left: -8px;
}
.lp-proof-avatars .lp-proof-av:first-child { margin-left: 0; }
.lp-proof-text {
  font-size: 0.78rem; color: rgba(255,255,255,0.45); font-weight: 500; flex: 1;
}

/* ── Right form panel ─────────────────────────────────────── */
.lp-form-panel {
  flex: 1;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}
/* Subtle top-right decoration */
.lp-form-panel::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.07), transparent 70%);
  pointer-events: none;
}
.lp-form-panel::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -80px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.05), transparent 70%);
  pointer-events: none;
}

.lp-back {
  position: absolute;
  top: 1.5rem; left: 1.75rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; font-weight: 600; color: #64748b;
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
  z-index: 1;
}
.lp-back:hover { background: #f8fafc; border-color: #cbd5e1; color: #334155; text-decoration: none; }

.lp-form-wrap {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

/* Form header */
.lp-form-header {
  text-align: center;
  margin-bottom: 2.25rem;
}
.lp-form-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border: 1px solid #e0e7ff;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 14px rgba(99,102,241,0.12);
}
.lp-form-title {
  font-size: 1.7rem; font-weight: 800; color: #0f172a;
  letter-spacing: -0.04em; margin: 0 0 0.35rem;
}
.lp-form-subtitle {
  font-size: 0.88rem; color: #64748b; margin: 0;
}

/* Fields */
.lp-form { display: flex; flex-direction: column; gap: 1.1rem; }
.lp-field { display: flex; flex-direction: column; gap: 0.4rem; }
.lp-label {
  font-size: 0.78rem; font-weight: 700; color: #374151;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.lp-input-wrap {
  position: relative; display: flex; align-items: center;
}
.lp-input-icon {
  position: absolute; left: 0.85rem;
  color: #94a3b8; font-size: 0.9rem; pointer-events: none;
  transition: color 0.15s ease;
}
.lp-input {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  padding: 0.7rem 0.85rem 0.7rem 2.4rem;
  font-size: 0.9rem; color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: all 0.18s ease;
  font-family: inherit;
}
.lp-input--pad-right { padding-right: 2.75rem; }
.lp-input::placeholder { color: #cbd5e1; }
.lp-input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.lp-input:focus + .lp-input-icon,
.lp-input-wrap:focus-within .lp-input-icon { color: #6366f1; }

/* Password toggle */
.lp-pw-toggle {
  position: absolute; right: 0.75rem;
  background: none; border: none; cursor: pointer;
  color: #94a3b8; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  padding: 0.25rem;
  transition: color 0.15s ease;
}
.lp-pw-toggle:hover { color: #6366f1; }

/* Submit button */
.lp-submit {
  margin-top: 0.5rem;
  width: 100%;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
  background-size: 200% 100%;
  border: none; border-radius: 11px;
  color: #fff; font-size: 0.95rem; font-weight: 700;
  padding: 0.8rem 1.5rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
  font-family: inherit;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}
.lp-submit::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  pointer-events: none;
}
.lp-submit:hover {
  background-position: right center;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(99,102,241,0.45);
}
.lp-submit:active { transform: translateY(0); }
.lp-submit-arrow { transition: transform 0.2s ease; }
.lp-submit:hover .lp-submit-arrow { transform: translateX(3px); }

/* Disabled state while logging in */
.lp-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.lp-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 2rem;
  line-height: 1.6;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .lp-shell { flex-direction: column; }
  .lp-hero { flex: 0 0 auto; padding: 2.5rem 1.5rem; min-height: 45vh; }
  .lp-form-panel { padding: 2.5rem 1.5rem; }
  .lp-back { position: static; margin-bottom: 1.5rem; align-self: flex-start; }
  .lp-form-wrap { max-width: 100%; }
  .lp-headline-title { font-size: 2rem; }
}
@media (max-width: 600px) {
  .lp-hero { min-height: 40vh; padding: 2rem 1.25rem; }
  .lp-features { gap: 0.5rem; }
  .lp-form-panel { padding: 2rem 1.25rem; }
}

/* ── Legacy aliases (keep layout from breaking if referenced) */
.login-page { display: none; }
.login-card { display: none; }
#back-to-landing { /* handled by .lp-back */ }

/* Change password (authenticated) */
.change-password-page {
  min-height: calc(100vh - 64px);
  background: linear-gradient(165deg, var(--slate-50, #f8fafc) 0%, #eef2ff 45%, #faf5ff 100%);
  padding: 2rem 1.25rem 3rem;
}

.change-password-inner {
  max-width: 480px;
  margin: 0 auto;
}

.change-password-back {
  display: inline-flex;
  align-items: center;
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 1.25rem;
  transition: background-color 0.2s, color 0.2s;
}

.change-password-back:hover {
  background-color: rgba(255, 255, 255, 0.7);
  color: var(--gray-900);
}

.change-password-card {
  position: relative;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(15, 23, 42, 0.06), 0 20px 50px rgba(79, 70, 229, 0.08);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.change-password-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary-color, #4f46e5) 0%, #7c3aed 100%);
}

.change-password-card-body {
  padding: 2rem 2rem 2rem 2.25rem;
}

.change-password-icon-wrap {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(124, 58, 237, 0.12) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color, #4f46e5);
  font-size: 1.5rem;
}

.change-password-requirements {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
}

.change-password-requirements ul li {
  margin-bottom: 0.2rem;
}

/* Cards */
.card {
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.card-header {
  background-color: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 1.25rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* Buttons */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* Tables */
.table {
  font-size: 0.875rem;
}

.table thead {
  background-color: var(--gray-50);
}

.table th {
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-200);
}

.table-hover tbody tr:hover {
  background-color: var(--gray-50);
}

/* Progress Tracker */
.progress-tracker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0;
  padding: 2rem;
  background: white;
  border-radius: 0.5rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  transition: transform 0.2s;
}

.step:hover {
  transform: translateY(-2px);
}

.step[style*="cursor: pointer"] {
  cursor: pointer;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 60%;
  width: 80%;
  height: 2px;
  background-color: var(--gray-200);
  z-index: 0;
}

.step.completed::after {
  background-color: var(--primary-color);
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  position: relative;
  z-index: 1;
  background-color: white;
  border: 2px solid var(--gray-200);
  color: var(--gray-600);
}

.step.completed .step-circle {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.step.active .step-circle {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.step-label {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  text-align: center;
}

.step.completed .step-label,
.step.active .step-label {
  color: var(--primary-color);
  font-weight: 600;
}

/* File Upload Area */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.upload-area:hover {
  border-color: var(--primary-color);
  background-color: #eff6ff;
}

.upload-area.dragover {
  border-color: var(--primary-color);
  background-color: #eff6ff;
}

/* Employees Table */
#employees-section .table-responsive {
  max-height: 500px;
  overflow-y: auto;
}

#employees-section table {
  font-size: 0.875rem;
}

#employees-section th {
  position: sticky;
  top: 0;
  background-color: #f8f9fa;
  z-index: 10;
  font-weight: 600;
  white-space: nowrap;
}

#employees-section td {
  vertical-align: middle;
  white-space: nowrap;
}

#employees-section .badge {
  font-size: 0.75rem;
}

/* Merit Matrix Table */
.merit-matrix-table {
  width: 100%;
  border-collapse: collapse;
}

.merit-matrix-table th,
.merit-matrix-table td {
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  text-align: center;
}

.merit-matrix-table th {
  background-color: #1e293b;
  color: #94a3b8;
  font-weight: 600;
}

.merit-matrix-table td input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: 0.25rem;
  padding: 0.5rem;
  text-align: center;
}

/* Ensure checkboxes and radio buttons in Select/Meets Expectations columns are visible */
.merit-matrix-table td input[type="checkbox"],
.merit-matrix-table td input[type="radio"] {
  width: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.merit-matrix-table td input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Editable Input Styling */
/* Ensure all editable inputs are clickable and focusable */
.editable-input,
.increase-input,
.comment-input {
  pointer-events: auto !important;
  user-select: text !important;
  cursor: text !important;
}

.editable-input {
  background-color: #fefce8;
  border: 1px solid #eab308;
}

.editable-input:focus {
  background-color: #eff6ff;
  border-color: var(--primary-color);
}

/* Badge Styling */
/* Exercise List View Styles */
.exercise-list-item {
  transition: background-color 0.2s;
}

/* CRITICAL: Ensure Performance Rating Source dropdown is always clickable */
#performance-rating-source {
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 10 !important;
  position: relative !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  -webkit-user-select: auto !important;
  -moz-user-select: auto !important;
  user-select: auto !important;
}

#performance-rating-source:disabled,
#performance-rating-source[disabled] {
  pointer-events: none !important;
  opacity: 0.65 !important;
}

/* Ensure parent container doesn't block clicks */
#performance-rating-source + small {
  pointer-events: auto !important;
}

/* Ensure the parent div container doesn't block clicks */
.mb-3 {
  pointer-events: auto !important;
  position: relative !important;
}

/* Leverage Matrix Configuration: keep info icon flush right next to title text */
#matrix-section .card-header h5 span.d-inline-flex {
  gap: 0;
  white-space: nowrap;
}
#matrix-section .card-header h5 span.d-inline-flex i.bi-info-circle {
  margin-left: 0;
  margin-right: 0;
}

.exercise-list-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.exercise-list-item td {
  vertical-align: middle;
  padding: 1rem;
}

.exercise-list-item .fw-semibold {
  font-weight: 600;
  color: #1f2937;
}

.badge-status {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-draft {
  background-color: var(--gray-100);
  color: var(--gray-700);
}

.badge-in-progress {
  background-color: #fef3c7;
  color: #92400e;
}

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

/* Responsive */
@media (max-width: 768px) {
  .login-card {
    max-width: 100%;
    padding: 1.5rem;
  }
  
  .progress-tracker {
    flex-direction: column;
    gap: 1rem;
  }
  
  .step:not(:last-child)::after {
    display: none;
  }
  
  .table-responsive {
    overflow-x: auto;
  }
}

/* Utility Classes */
.text-muted {
  color: var(--gray-600);
}

.bg-light {
  background-color: var(--gray-50);
}

.shadow-sm {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Resulting Merit Matrix - Consistent Cell Sizing */
.resulting-matrix-cell,
.final-matrix-cell {
  min-height: 70px;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  box-sizing: border-box;
}

/* Final Merit Matrix Table - Fixed Layout */
#final-merit-matrices-table {
  table-layout: fixed;
  width: 100%;
}

#final-merit-matrices-table th,
#final-merit-matrices-table td {
  vertical-align: middle;
}

.resulting-matrix-cell .small {
  font-size: 0.75rem;
  line-height: 1.2;
  margin-top: 2px;
}

.resulting-matrix-cell .resulting-matrix-input {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}

.resulting-matrix-cell input[disabled] {
  background-color: #f8f9fa;
  opacity: 0.6;
  cursor: not-allowed;
}

/* Resulting Merit Matrix Table - Balanced Column Widths */
#resulting-merit-matrix-table {
  table-layout: fixed;
  width: 100%;
}

#resulting-merit-matrix-table th:first-child,
#resulting-merit-matrix-table td:first-child {
  width: 180px;
  max-width: 180px;
  min-width: 180px;
  padding: 0.5rem;
  font-size: 0.875rem;
  word-wrap: break-word;
}

#resulting-merit-matrix-table th:not(:first-child),
#resulting-merit-matrix-table td:not(:first-child) {
  width: auto;
  min-width: 140px;
  padding: 0.5rem;
}

#resulting-merit-matrix-table td {
  vertical-align: middle;
}

/* For rating-only matrix (2 columns) */
#resulting-merit-matrix-table th:last-child:not(:first-child),
#resulting-merit-matrix-table td:last-child:not(:first-child) {
  width: auto;
  min-width: 200px;
}

/* For 5-column matrix */
#resulting-merit-matrix-table th:nth-child(2),
#resulting-merit-matrix-table th:nth-child(3),
#resulting-merit-matrix-table th:nth-child(4),
#resulting-merit-matrix-table th:nth-child(5),
#resulting-merit-matrix-table td:nth-child(2),
#resulting-merit-matrix-table td:nth-child(3),
#resulting-merit-matrix-table td:nth-child(4),
#resulting-merit-matrix-table td:nth-child(5) {
  width: calc((100% - 180px) / 4);
  min-width: 140px;
}

/* Summary Cards Styles - Modern, Dynamic Design */
.summary-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  border: 1px solid #e5e7eb;
}

.summary-card-small {
  padding: 14px 16px;
  gap: 12px;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.summary-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.summary-card-small .summary-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 20px;
}

.summary-card-primary .summary-card-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.summary-card-success .summary-card-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.summary-card-info .summary-card-icon {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

.summary-card-warning .summary-card-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.summary-card-danger .summary-card-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.summary-card-content {
  flex: 1;
  min-width: 0;
}

.summary-card-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.summary-card-small .summary-card-value {
  font-size: 1.5rem;
}

.summary-card-small .summary-card-label {
  font-size: 0.8rem;
}

/* Breakdown Cards Styles - Smaller, Compact Design */
#increases-breakdown-cards {
  margin-bottom: 1.5rem;
}

#increases-breakdown-cards .col-md-2 {
  min-width: 0;
  padding-left: 4px;
  padding-right: 4px;
  flex: 0 0 auto;
  width: calc(100% / 6);
  max-width: calc(100% / 6);
}

.breakdown-card {
  background: white;
  border-radius: 10px;
  padding: 12px 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  height: 100%;
  border: 1px solid #e5e7eb;
  min-height: 115px;
  max-height: 115px;
  box-sizing: border-box;
  overflow: hidden;
  width: 100%;
}

.breakdown-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.breakdown-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #6b7280;
  flex-shrink: 0;
}

.breakdown-card-content {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
}

.breakdown-card-label {
  font-size: 0.65rem;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
}

.breakdown-card-budget {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
}

.breakdown-budget-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.breakdown-budget-label {
  font-size: 0.6rem;
  color: #9ca3af;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15px;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 45px;
}

.breakdown-budget-value {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-all;
}

.breakdown-budget-available {
  color: #2563eb;
}

.breakdown-budget-used {
  color: #059669;
}

/* Budget Summary Cards - Prominent Design */
.budget-summary-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.budget-summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.budget-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.budget-summary-available {
  border-color: #3b82f6;
}

.budget-summary-available::before {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.budget-summary-used {
  border-color: #10b981;
}

.budget-summary-used::before {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.budget-summary-used.budget-warning {
  border-color: #f59e0b;
}

.budget-summary-used.budget-warning::before {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.budget-summary-used.budget-danger {
  border-color: #ef4444;
}

.budget-summary-used.budget-danger::before {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.budget-summary-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.budget-summary-available .budget-summary-icon {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}

.budget-summary-used .budget-summary-icon {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}

.budget-summary-used.budget-warning .budget-summary-icon {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
}

.budget-summary-used.budget-danger .budget-summary-icon {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
}

.budget-summary-content {
  flex: 1;
  min-width: 0;
}

.budget-summary-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.budget-summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .summary-card {
    padding: 16px;
    gap: 12px;
  }
  
  .summary-card-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  .summary-card-value {
    font-size: 1.5rem;
  }
  
  #increases-breakdown-cards .col-md-2 {
    width: 50%;
    max-width: 50%;
    flex: 0 0 50%;
  }
  
  .breakdown-card {
    padding: 10px 8px;
    gap: 6px;
    min-height: 100px;
    max-height: 100px;
  }
  
  .breakdown-card-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .breakdown-card-label {
    font-size: 0.6rem;
    margin-bottom: 6px;
  }
  
  .breakdown-budget-item {
    gap: 3px;
  }
  
  .breakdown-budget-label {
    font-size: 0.55rem;
    min-width: 40px;
  }
  
  .breakdown-budget-value {
    font-size: 0.7rem;
  }
  
  .budget-summary-card {
    padding: 20px;
    gap: 16px;
  }
  
  .budget-summary-icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }
  
  .budget-summary-value {
    font-size: 1.75rem;
  }
}


/* Comment input styling */
#increases-table .comment-input {
  min-width: 200px;
  max-width: 400px;
  resize: vertical;
  font-size: 0.875rem;
  padding: 4px 8px;
}

#increases-table .comment-input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Summary Table - Analytics Dashboard */
.summary-table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: white;
  margin-bottom: 1rem;
}

#analytics-summary-table {
  width: 100%;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  background-color: white;
}

/* Table Header Styling */
#analytics-summary-table .summary-table-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 2px solid #dee2e6;
}

#analytics-summary-table .summary-table-header th {
  padding: 12px 10px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #495057;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
  vertical-align: middle;
  border-right: 1px solid #dee2e6;
  border-bottom: 2px solid #dee2e6;
}

#analytics-summary-table .summary-table-header th:last-child {
  border-right: none;
}

/* Column Width Classes */
#analytics-summary-table .summary-col-country {
  min-width: 110px;
  width: 110px;
  position: sticky;
  left: 0;
  z-index: 10;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

#analytics-summary-table .summary-col-number {
  min-width: 90px;
  width: 90px;
}

#analytics-summary-table .summary-col-currency {
  min-width: 120px;
  width: 120px;
}

#analytics-summary-table .summary-col-percentage {
  min-width: 110px;
  width: 110px;
}

/* Table Body Styling */
#analytics-summary-table .summary-table-row {
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

#analytics-summary-table .summary-table-row:hover {
  background-color: #f8f9fa;
}

#analytics-summary-table .summary-table-row:last-child {
  border-bottom: none;
}

#analytics-summary-table .summary-table-global {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  font-weight: 600;
  border-top: 2px solid #2196f3;
  border-bottom: 2px solid #2196f3;
}

#analytics-summary-table .summary-table-global:hover {
  background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
}

#analytics-summary-table .summary-table-global td {
  border-top: 1px solid #90caf9;
  border-bottom: 1px solid #90caf9;
}

/* Cell Styling */
#analytics-summary-table td {
  padding: 10px;
  vertical-align: middle;
  border-right: 1px solid #e9ecef;
  white-space: nowrap;
}

#analytics-summary-table td:last-child {
  border-right: none;
}

#analytics-summary-table .summary-cell-country {
  position: sticky;
  left: 0;
  z-index: 5;
  background-color: white;
  font-weight: 600;
  color: #212529;
  min-width: 110px;
  width: 110px;
}

#analytics-summary-table .summary-table-row:hover .summary-cell-country {
  background-color: #f8f9fa;
}

#analytics-summary-table .summary-table-global .summary-cell-country {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

#analytics-summary-table .summary-table-global:hover .summary-cell-country {
  background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
}

#analytics-summary-table .summary-cell-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #495057;
  min-width: 90px;
}

#analytics-summary-table .summary-cell-currency {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #212529;
  font-weight: 500;
  min-width: 120px;
}

#analytics-summary-table .summary-cell-percentage {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #495057;
  font-weight: 500;
  min-width: 110px;
}

/* Zebra striping for better readability */
#analytics-summary-table .summary-table-row:nth-child(even):not(.summary-table-global) {
  background-color: #fafafa;
}

#analytics-summary-table .summary-table-row:nth-child(odd):not(.summary-table-global) {
  background-color: white;
}

#analytics-summary-table .summary-table-row:nth-child(even):not(.summary-table-global):hover {
  background-color: #f8f9fa;
}

/* Analytics Dashboard Charts Styling - Enterprise HR-Grade Design */
.analytics-dashboard-charts {
  max-width: 1400px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.analytics-dashboard-charts .card {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: white;
  box-shadow: none; /* No shadows for clean, flat design */
  margin-bottom: 0;
}

.analytics-dashboard-charts .card-header {
  padding: 20px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.analytics-dashboard-charts .card-header h6 {
  font-weight: 600;
  font-size: 1rem;
  color: #212529;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.01em;
}

.analytics-dashboard-charts .card-header select {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 6px 12px;
  margin-left: 16px;
}

.analytics-dashboard-charts .card-body {
  padding: 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Chart 1 / 4: responsive height + room for in-bar labels */
.analytics-chart-wrap {
  position: relative;
  overflow: visible;
  width: 100%;
}
.analytics-chart-wrap--budget {
  height: clamp(240px, 34vw, 320px);
  min-height: 220px;
}
.analytics-chart-wrap--positioning {
  height: clamp(260px, 36vw, 380px);
  min-height: 240px;
}
@media (max-width: 576px) {
  .analytics-chart-wrap--budget {
    height: clamp(220px, 52vw, 280px);
    min-height: 200px;
  }
  .analytics-chart-wrap--positioning {
    height: clamp(240px, 58vw, 320px);
    min-height: 220px;
  }
}

.analytics-dashboard-charts .card {
  margin-bottom: 24px;
}

/* Responsive layout for charts */
@media (max-width: 1200px) {
  .analytics-dashboard-charts .col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .analytics-dashboard-charts .card-body {
    padding: 16px;
  }
  
  .analytics-dashboard-charts .card-header {
    padding: 12px;
  }
  
  .analytics-dashboard-charts .card-header h6 {
    font-size: 0.875rem;
  }
  
  .analytics-dashboard-charts .card-header select {
    max-width: 150px;
    font-size: 0.75rem;
  }
}

/* Responsive adjustments for summary table */
@media (max-width: 1200px) {
  #analytics-summary-table {
    font-size: 0.8rem;
  }
  
  #analytics-summary-table .summary-table-header th {
    padding: 10px 8px;
    font-size: 0.75rem;
  }
  
  #analytics-summary-table td {
    padding: 8px;
  }
}

/* Manager Discretion Overrides Table - Enterprise Styling */
#manager-overrides-table {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
}

#manager-overrides-table thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: #212529;
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  padding: 12px 16px;
}

#manager-overrides-table tbody td {
  padding: 10px 16px;
  color: #495057;
  border-bottom: 1px solid #e9ecef;
}

#manager-overrides-table tbody tr:hover {
  background-color: #f8f9fa;
}

#manager-overrides-table tbody tr.table-primary {
  background-color: #e7f3ff;
  font-weight: 600;
}

/* Analytics Summary Table - Enterprise Styling */
#analytics-summary-table {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
}

#analytics-summary-table thead th {
  font-weight: 600;
  font-size: 0.8125rem;
  color: #212529;
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  padding: 12px 16px;
  white-space: nowrap;
}

#analytics-summary-table tbody td {
  color: #495057;
  font-size: 0.875rem;
  padding: 10px 16px;
  white-space: nowrap;
}

#analytics-summary-table tbody tr.summary-table-global {
  background-color: #e7f3ff;
  font-weight: 600;
}

/* Global Filters Styling */
#analytics-currency-filter,
#analytics-geography-filter {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 6px 12px;
}

#analytics-currency-filter:focus,
#analytics-geography-filter:focus {
  border-color: #2c5a7a;
  box-shadow: 0 0 0 0.2rem rgba(44, 90, 122, 0.1);
  outline: none;
}

/* ========== Meritio in-app enterprise polish (excludes landing.css pages) ========== */
@keyframes meritio-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.meritio-app-page {
  background-color: var(--app-surface) !important;
}

@media (prefers-reduced-motion: no-preference) {
  .meritio-app-page.meritio-workspace > .container-fluid:first-of-type {
    animation: meritio-fade-up 0.5s var(--enterprise-ease) both;
  }
}

.meritio-workspace-topbar {
  background: #fff !important;
  border-bottom: 1px solid var(--app-border) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.meritio-workspace-topbar .btn-primary {
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
  transition: transform 0.18s var(--enterprise-ease), box-shadow 0.22s var(--enterprise-ease), background-color 0.2s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  .meritio-workspace-topbar .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  }
}

.navbar-main {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.25s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  .navbar-main #main-nav .nav-link {
    transition: background-color 0.2s var(--enterprise-ease), color 0.2s var(--enterprise-ease), box-shadow 0.2s var(--enterprise-ease), transform 0.15s var(--enterprise-ease);
  }

  .navbar-main #main-nav .nav-link:hover:not(.active) {
    transform: translateY(-1px);
  }
}

.meritio-workspace .card {
  border: 1px solid var(--app-border);
  border-radius: var(--enterprise-radius);
  box-shadow: var(--enterprise-shadow);
  overflow: hidden;
  transition: box-shadow 0.28s var(--enterprise-ease), transform 0.28s var(--enterprise-ease), border-color 0.2s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  .meritio-workspace .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--enterprise-shadow-hover);
    border-color: #dce3f0;
  }
}

/* Analytics dashboard: keep Bootstrap-adjacent chrome so charts/layout stay stable */
.meritio-workspace .meritio-analytics-freeze .card,
.meritio-workspace #analytics-dashboard-section .card {
  border-radius: 0.5rem !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  margin-bottom: 1.5rem;
  overflow: visible !important;
  transition: none !important;
  animation: none !important;
}

.meritio-workspace .meritio-analytics-freeze .card:hover,
.meritio-workspace #analytics-dashboard-section .card:hover {
  transform: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  border-color: var(--gray-200) !important;
}

.meritio-workspace .meritio-analytics-freeze .card-header,
.meritio-workspace #analytics-dashboard-section .card-header {
  background: #fff !important;
  background-image: none !important;
  color: inherit !important;
  font-weight: 600;
  border-bottom: 1px solid var(--gray-200) !important;
}

.meritio-workspace .meritio-analytics-freeze .btn,
.meritio-workspace #analytics-dashboard-section .btn {
  transition: none !important;
  box-shadow: none !important;
}

.meritio-workspace .meritio-analytics-freeze .btn:hover,
.meritio-workspace #analytics-dashboard-section .btn:hover {
  transform: none !important;
  box-shadow: none !important;
}

.meritio-workspace .card-header {
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f8 100%);
  border-bottom: 1px solid var(--app-border);
  font-weight: 600;
  color: var(--app-navy);
  letter-spacing: -0.01em;
}

.meritio-workspace .progress-tracker .step.active .step-circle {
  background: linear-gradient(145deg, #1e40af, #2563eb);
  border-color: #1e3a8a;
}

.meritio-workspace .progress-tracker .step.active .step-label {
  color: #1e3a8a;
  font-weight: 600;
}

.meritio-workspace .progress-tracker {
  border: 1px solid var(--app-border);
  border-radius: var(--enterprise-radius);
  box-shadow: var(--enterprise-shadow);
  background: #fff;
  transition: box-shadow 0.3s var(--enterprise-ease), border-color 0.25s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  .meritio-workspace .progress-tracker:hover {
    box-shadow: var(--enterprise-shadow-hover);
    border-color: #dce3f0;
  }

  .meritio-workspace .progress-tracker .step-circle {
    transition: transform 0.22s var(--enterprise-ease), border-color 0.22s var(--enterprise-ease), box-shadow 0.22s var(--enterprise-ease);
  }

  .meritio-workspace .progress-tracker .step:hover .step-circle {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
  }
}

.meritio-workspace .upload-area {
  border-radius: var(--enterprise-radius-sm);
  border-width: 1.5px;
  transition: border-color 0.25s var(--enterprise-ease), background-color 0.25s var(--enterprise-ease), box-shadow 0.25s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  .meritio-workspace .upload-area:hover {
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.12);
  }
}

/* Summary + breakdown budget row */
#increases-summary-cards .summary-card {
  border: 1px solid var(--app-border);
  border-radius: var(--enterprise-radius-sm);
  box-shadow: var(--enterprise-shadow);
  background: #fff;
  transition: box-shadow 0.28s var(--enterprise-ease), transform 0.28s var(--enterprise-ease), border-color 0.2s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  #increases-summary-cards .summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--enterprise-shadow-hover);
    border-color: #d6e4ff;
  }
}

#increases-breakdown-cards .breakdown-card {
  border: 1px solid var(--app-border);
  border-radius: var(--enterprise-radius-sm);
  box-shadow: var(--enterprise-shadow);
  background: var(--app-surface-elevated);
  transition: box-shadow 0.25s var(--enterprise-ease), transform 0.25s var(--enterprise-ease), border-color 0.2s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  #increases-breakdown-cards .breakdown-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--enterprise-shadow-hover);
    border-color: #dce3f0;
  }
}

#increases-breakdown-cards .breakdown-card-label {
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  text-transform: uppercase;
  color: #64748b;
}

/* Merit increases table — calmer grid, clearer hierarchy */
.meritio-workspace #increases-table {
  font-size: 0.8125rem;
  border-collapse: separate;
  border-spacing: 0;
}

.meritio-workspace #increases-table thead th {
  background: #f8fafc !important;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--app-border) !important;
  border-top: none !important;
  vertical-align: middle;
  padding: 0.55rem 0.45rem;
}

.meritio-workspace #increases-table tbody td {
  border-color: #eef2f7 !important;
  vertical-align: middle;
  padding: 0.45rem 0.4rem;
}

.meritio-workspace #increases-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

.meritio-workspace #increases-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

.meritio-workspace #increases-table tbody tr:hover td {
  background-color: #f8fafc !important;
}

.meritio-workspace #increases-table th.sticky-column-left-0,
.meritio-workspace #increases-table td.sticky-column-left-0,
.meritio-workspace #increases-table th.sticky-column-left-1,
.meritio-workspace #increases-table td.sticky-column-left-1 {
  background-color: #f8fafc !important;
}

.meritio-workspace #increases-table tbody tr:hover td.sticky-column-left-0,
.meritio-workspace #increases-table tbody tr:hover td.sticky-column-left-1 {
  background-color: #f1f5f9 !important;
}

.meritio-workspace #increases-table .form-control-sm {
  font-size: 0.8125rem;
}

/* Performance acronym pill */
.merit-perf-td {
  white-space: nowrap;
  text-align: center;
}

.merit-perf-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.35rem;
  transition: background-color 0.2s var(--enterprise-ease), border-color 0.2s var(--enterprise-ease), transform 0.15s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  .merit-perf-td:hover .merit-perf-pill {
    transform: scale(1.06);
    border-color: #93c5fd;
    background: #dbeafe;
  }
}

/* Positioning range bar */
.merit-pos-td {
  min-width: 88px;
  max-width: 120px;
}

.merit-pos-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.merit-pos-caption {
  font-size: 0.66rem;
  color: #64748b;
  line-height: 1.1;
  text-align: center;
}

.merit-pos-fallback {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.2;
  display: block;
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merit-pos-bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: visible;
}

.merit-pos-bar__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #93c5fd, #3b82f6);
  max-width: 100%;
}

.merit-pos-bar__mid {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  margin-left: -1px;
  background: #64748b;
  border-radius: 1px;
  opacity: 0.85;
}

.merit-pos-bar__marker {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  margin-top: -4px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
}

/* ── Dual-marker positioning bar (before = open, after = filled) ── */
.merit-pos-bar--dual {
  height: 4px;
}

/* Small tick marks at start and end */
.merit-pos-bar__tick {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 12px;
  background: #94a3b8;
  border-radius: 1px;
}
.merit-pos-bar__tick--start { left: 0; }
.merit-pos-bar__tick--end   { right: 0; left: auto; }

/* Before: open circle (stroke only) */
.merit-pos-bar__before {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #64748b;
  box-shadow: 0 0 0 1px rgba(100,116,139,0.2);
  z-index: 1;
}

/* After: filled circle */
.merit-pos-bar__after {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  background: #4f46e5;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(79,70,229,0.35);
  z-index: 2;
}

.positioning-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  font-size: 0.74rem;
  color: #475569;
}

.positioning-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.positioning-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot-below { background: #ef4444; }
.legend-dot-range { background: #2563eb; }
.legend-dot-above { background: #f59e0b; }

.positioning-legend-note {
  color: #64748b;
}

/* Eligibility dot */
.merit-elig-td {
  vertical-align: middle !important;
}

.merit-elig {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.merit-elig-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.merit-elig--yes .merit-elig-dot {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.merit-elig--no .merit-elig-dot {
  background: #cbd5e1;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.35);
}

/* ============================================
   SIMULATION LIST PAGE — FULL REDESIGN
   ============================================ */

/* Page CSS variables */
.meritio-sim-list {
  --sim-primary: #2563eb;
  --sim-primary-hover: #1d4ed8;
  --sim-primary-light: #eff6ff;
  --sim-success: #10b981;
  --sim-warning: #f59e0b;
  --sim-danger: #ef4444;
  --sim-gray: #94a3b8;
  --sim-dark: #0f172a;
  --sim-card-radius: 12px;
  --sim-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 2px 6px rgba(0,0,0,0.04);
  --sim-shadow-hover: 0 0 0 2px #bfdbfe, 0 12px 28px rgba(37,99,235,0.13);
  --sim-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── PAGE LAYOUT ───────────────────────────────────── */
.meritio-sim-list {
  background: #f0f4f8;
  display: flex;
  flex-direction: column;
}

/* ── FULL-BLEED HEADER ─────────────────────────────── */
.sim-page-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.sim-header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.sim-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.sim-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sim-title-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-radius: 10px;
  color: var(--sim-primary);
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(37,99,235,0.15);
}

.sim-page-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.sim-page-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0.1rem 0 0;
}

/* ── VIEW TOGGLE ───────────────────────────────────── */
.sim-view-toggle .btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.875rem;
}

/* ── CREATE BUTTON ─────────────────────────────────── */
.sim-create-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.45rem 1.1rem;
  box-shadow: 0 1px 3px rgba(37,99,235,0.25), 0 2px 8px rgba(37,99,235,0.15);
  transition: all 0.2s var(--sim-ease);
}

.sim-create-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}

.sim-create-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(37,99,235,0.2);
}

/* ── METRIC CARDS ROW ──────────────────────────────── */
.sim-metrics-row {
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
  padding-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.sim-metric-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  position: relative;
  overflow: hidden;
  min-width: 140px;
  transition: all 0.2s var(--sim-ease);
}

.sim-metric-card:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.sim-metric-icon {
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.sim-metric-body {
  min-width: 0;
}

.sim-metric-num {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.sim-metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-top: 0.2rem;
}

/* Metric card variants */
.sim-metric-total { border-left: 3px solid #94a3b8; }
.sim-metric-total .sim-metric-icon { background: #f1f5f9; color: #64748b; }
.sim-metric-total .sim-metric-num { color: #1e293b; }

.sim-metric-active { border-left: 3px solid #3b82f6; }
.sim-metric-active .sim-metric-icon { background: #dbeafe; color: #2563eb; }
.sim-metric-active .sim-metric-num { color: #1d4ed8; }

.sim-metric-completed { border-left: 3px solid #10b981; }
.sim-metric-completed .sim-metric-icon { background: #d1fae5; color: #059669; }
.sim-metric-completed .sim-metric-num { color: #047857; }

.sim-metric-draft { border-left: 3px solid #cbd5e1; }
.sim-metric-draft .sim-metric-icon { background: #f8fafc; color: #94a3b8; }
.sim-metric-draft .sim-metric-num { color: #475569; }

/* Live dot for in-progress */
.sim-metric-live-dot {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  animation: sim-live-pulse 2s ease-in-out infinite;
}

@keyframes sim-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
  50% { opacity: 0.8; transform: scale(1.15); box-shadow: 0 0 0 4px rgba(59,130,246,0); }
}

/* ── CONTENT AREA ──────────────────────────────────── */
.sim-content-area {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 2rem 2.5rem;
  width: 100%;
}

/* ── SEARCH & FILTER TOOLBAR ───────────────────────── */
.sim-toolbar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: var(--sim-shadow);
  margin-bottom: 1.25rem;
  /* overflow must NOT be hidden — it clips Bootstrap dropdown menus */
  overflow: visible;
}

/* Keep the inner row's children clipped to the rounded card edges without blocking dropdowns */
.sim-toolbar-inner > *:first-child { border-top-left-radius: inherit; border-bottom-left-radius: inherit; }
.sim-toolbar-inner > *:last-child  { border-top-right-radius: inherit; border-bottom-right-radius: inherit; }

.sim-toolbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
}

.sim-search-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 260px;
}

.sim-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.875rem;
  pointer-events: none;
}

.sim-search-input {
  width: 100%;
  height: 40px;
  padding: 0 0.85rem 0 2.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  background: #f8fafc;
  color: #0f172a;
  transition: all 0.2s var(--sim-ease);
  outline: none;
}

.sim-search-input::placeholder { color: #94a3b8; }

.sim-search-input:focus {
  background: #fff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* Filter chips row */
.sim-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.filter-chip {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s var(--sim-ease);
  line-height: 1.4;
}

.filter-chip:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #334155;
}

.filter-chip.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 1px 4px rgba(37,99,235,0.3);
}

/* Results meta */
.sim-results-meta {
  margin-bottom: 0.85rem;
  padding: 0 0.25rem;
}

/* ── STATUS PILLS ──────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.status-pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pill--draft { background: #f1f5f9; color: #64748b; }
.status-pill--draft::before { background: #94a3b8; }

.status-pill--active { background: #dbeafe; color: #1d4ed8; }
.status-pill--active::before { background: #3b82f6; animation: sim-live-pulse 2s infinite; }

.status-pill--completed { background: #d1fae5; color: #047857; }
.status-pill--completed::before { background: #10b981; }

.status-pill--final { background: #ede9fe; color: #6d28d9; }
.status-pill--final::before { background: #8b5cf6; }

.status-pill--approved { background: #dcfce7; color: #15803d; }
.status-pill--approved::before { background: #22c55e; }

/* Pill used as a button (in card view dropdown trigger) */
.sim-status-pill-btn {
  cursor: pointer;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}
.sim-status-pill-btn:hover {
  opacity: 0.85;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Status change dropdown menu */
.sim-status-menu {
  min-width: 160px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 0.25rem;
}

.sim-status-option {
  border-radius: 7px;
  padding: 0.4rem 0.5rem;
}

.sim-status-option:hover { background: #f8fafc; }
.sim-status-option.active { background: #eff6ff; }

/* ── CSS GRID CARD CONTAINER ───────────────────────── */
#exercises-container.sim-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
@media (max-width: 1200px) {
  #exercises-container.sim-cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  #exercises-container.sim-cards-grid { grid-template-columns: 1fr; }
}

/* ── EXERCISE CARDS ────────────────────────────────── */
@keyframes sim-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sim-exercise-card {
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--status-color, #cbd5e1);
  border-radius: var(--sim-card-radius);
  box-shadow: var(--sim-shadow);
  background: #fff;
  overflow: visible;
  transition: border-color 0.25s var(--sim-ease), box-shadow 0.25s var(--sim-ease), transform 0.25s var(--sim-ease);
}

.sim-exercise-card .card-body {
  padding: 1.15rem 1.25rem;
}

@media (prefers-reduced-motion: no-preference) {
  .sim-exercise-card {
    animation: sim-card-in 0.38s var(--sim-ease) both;
  }

  .sim-exercise-card:hover {
    box-shadow: var(--sim-shadow-hover);
    transform: translateY(-3px);
  }

  .sim-exercise-card:hover .sim-btn-arrow {
    transform: translateX(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sim-exercise-card:hover {
    box-shadow: 0 0 0 2px #bfdbfe;
  }
}

/* Card icon */
.sim-card-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Card title */
.sim-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}

/* Notes preview */
.sim-notes-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.79rem;
  line-height: 1.45;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 7px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.75rem;
}

.sim-notes-spacer {
  height: 0.75rem;
}

/* Meta row */
.sim-meta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.sim-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #64748b;
}

.sim-meta-item i { font-size: 0.7rem; color: #94a3b8; }

/* Modifier avatar initial */
.sim-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 2px;
}

/* Card footer */
.sim-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Open button — gradient blue, full width, arrow animates on card hover */
.sim-btn-open {
  flex: 1;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 3px rgba(37,99,235,0.2);
  transition: background 0.2s var(--sim-ease), box-shadow 0.2s var(--sim-ease);
}

.sim-btn-open:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.sim-btn-arrow {
  display: inline-block;
  transition: transform 0.25s var(--sim-ease);
}

/* Secondary action buttons */
.sim-action-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 7px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.8rem;
  transition: all 0.15s var(--sim-ease);
}

.sim-action-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.sim-action-btn--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ── LIST VIEW TABLE ───────────────────────────────── */
.sim-list-card {
  border-radius: var(--sim-card-radius);
  box-shadow: var(--sim-shadow);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.sim-exercise-table {
  font-size: 0.84rem;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

/* Dark polished header */
.sim-exercise-table thead tr {
  background: #0f172a;
}
.sim-exercise-table thead th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  background: #0f172a;
  border: none;
  padding: 0.8rem 1rem;
  white-space: nowrap;
  vertical-align: middle;
}
.sim-exercise-table thead th:first-child { border-radius: 0; }

/* Row cells */
.sim-exercise-table tbody td {
  padding: 0;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s ease;
}
.sim-exercise-table tbody tr:last-child td { border-bottom: none; }

/* Left accent via CSS var */
.sim-list-row { position: relative; }
.sim-list-row td:first-child {
  border-left: 3px solid transparent;
  transition: border-color 0.15s ease;
}
.sim-list-row:hover td { background: #f8fafc; }
.sim-list-row:hover td:first-child { border-left-color: var(--row-accent, #3b82f6); }

/* Cell sizing helpers */
.sim-list-cell-name   { width: 38%; }
.sim-list-cell-status { width: 14%; }
.sim-list-cell-date   { width: 12%; font-size: 0.78rem; color: #64748b; padding: 0.9rem 1rem !important; }
.sim-list-cell-actions{ width: 10%; }

/* Name column inner layout */
.sim-list-name-wrap {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem;
}
.sim-list-icon-wrap {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; flex-shrink: 0;
}
.sim-list-text { min-width: 0; }
.sim-list-title {
  font-weight: 600; color: #0f172a; font-size: 0.88rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 300px;
}
.sim-list-note {
  font-size: 0.73rem; color: #94a3b8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 300px; margin-top: 0.1rem;
}

/* Status column */
.sim-list-cell-status { padding: 0.9rem 1rem !important; }

/* Date creator */
.sim-list-creator {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; color: #94a3b8; margin-top: 0.2rem;
}
.sim-list-av {
  width: 16px; height: 16px; border-radius: 50%;
  background: #e0e7ff; color: #4338ca;
  font-size: 0.58rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sim-list-never { color: #cbd5e1; }

/* Actions column */
.sim-list-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.3rem; padding: 0.9rem 1rem;
}
.sim-tbl-btn {
  height: 30px; border-radius: 7px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem; cursor: pointer; transition: all 0.15s ease;
  background: transparent; padding: 0 0.5rem;
  font-family: inherit; white-space: nowrap;
}
.sim-tbl-btn--gray { color: #64748b; border-color: #e2e8f0; width: 30px; padding: 0; }
.sim-tbl-btn--gray:hover { background: #f1f5f9; color: #334155; }
.sim-tbl-btn--red  { color: #dc2626; border-color: #fca5a5; width: 30px; padding: 0; }
.sim-tbl-btn--red:hover  { background: #fff1f2; border-color: #ef4444; }
.sim-tbl-btn--open {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff; border: none; padding: 0 0.75rem;
  font-weight: 600; font-size: 0.78rem;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.sim-tbl-btn--open:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
  transform: translateY(-1px);
}

/* Legacy aliases */
.sim-list-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: #eff6ff; border-radius: 7px; color: #2563eb; font-size: 0.875rem; flex-shrink: 0; }
.sim-table-meta { font-size: 0.78rem; color: #64748b; }
.sim-list-btn { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 0.78rem; border-radius: 6px; background: #f1f5f9; border: 1px solid #e2e8f0; color: #64748b; transition: all 0.15s ease; }
.sim-list-btn:hover { background: #e2e8f0; color: #334155; }

/* ── EMPTY STATE ───────────────────────────────────── */
.sim-empty-state {
  padding: 4rem 1rem;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--sim-card-radius);
}

.sim-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 20px;
  font-size: 2rem;
  color: var(--sim-primary);
}

@media (prefers-reduced-motion: no-preference) {
  .sim-empty-icon {
    animation: sim-float 3s ease-in-out infinite;
  }
}

@keyframes sim-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── SKELETON LOADING ──────────────────────────────── */
.sim-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.1rem;
  width: 100%;
}

.sim-skeleton-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--sim-card-radius);
  padding: 1.25rem;
  overflow: hidden;
}

.skel-stripe {
  height: 4px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  border-radius: 999px;
  margin-bottom: 1rem;
  animation: skel-shimmer 1.6s ease-in-out infinite;
}

.skel-header {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.skel-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

.skel-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
}

.skel-line {
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.6s ease-in-out infinite;
}

.skel-line--title { height: 14px; width: 70%; }
.skel-line--pill  { height: 18px; width: 38%; border-radius: 999px; }
.skel-line--meta  { height: 10px; width: 55%; }

.skel-notes {
  height: 46px;
  border-radius: 7px;
  background: linear-gradient(90deg, #f8fafc 25%, #f1f5f9 50%, #f8fafc 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.6s ease-in-out infinite;
  margin-bottom: 0.85rem;
}

.skel-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.skel-btn {
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.6s ease-in-out infinite;
}

@keyframes skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── MODAL IMPROVEMENTS ────────────────────────────── */
.sim-modal-content {
  border-radius: 14px;
  overflow: hidden;
  border: none;
}

.sim-modal-topbar {
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.sim-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 10px;
  color: var(--sim-primary);
  font-size: 1.25rem;
}

.sim-modal-input {
  height: 44px;
  font-size: 0.9375rem;
  border-radius: 8px;
  border-color: #e2e8f0;
}

.sim-modal-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.sim-char-counter {
  font-size: 0.72rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.sim-char-counter--warn { color: #d97706; }
.sim-char-counter--danger { color: #dc2626; font-weight: 600; }

/* Responsive tweaks */
@media (max-width: 767.98px) {
  .sim-header-inner { padding: 1rem 1.25rem; }
  .sim-content-area { padding: 1rem 1.25rem 2rem; }
  .sim-metrics-row { gap: 0.6rem; }
  .sim-metric-card { min-width: unset; flex: 1 1 calc(50% - 0.6rem); }
  #exercises-container.sim-cards-grid {
    grid-template-columns: 1fr;
  }
  .sim-toolbar-inner { gap: 0.5rem; }
  .sim-search-wrap { width: 100%; }
}

/* ── KEEP OLD CLASS COMPAT ─────────────────────────── */
.meritio-app-page:not(.meritio-workspace) .exercise-card {
  border-radius: var(--enterprise-radius);
}

.meritio-app-page:not(.meritio-workspace) .card .card-header {
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f8 100%);
  border-bottom: 1px solid var(--app-border);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Primary actions — enterprise blue, lift on hover */
.meritio-app-page .btn-primary {
  border-radius: 0.5rem;
  font-weight: 600;
  padding: 0.45rem 1.15rem;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
  transition: transform 0.18s var(--enterprise-ease), box-shadow 0.22s var(--enterprise-ease), background-color 0.2s var(--enterprise-ease), border-color 0.2s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  .meritio-app-page .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  }

  .meritio-app-page .btn-primary:active {
    transform: translateY(0);
  }
}

.meritio-app-page .btn-outline-primary,
.meritio-app-page .btn-outline-secondary {
  border-radius: 0.5rem;
  font-weight: 500;
  transition: background-color 0.2s var(--enterprise-ease), border-color 0.2s var(--enterprise-ease), color 0.2s var(--enterprise-ease), transform 0.15s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  .meritio-app-page .btn-outline-primary:hover,
  .meritio-app-page .btn-outline-secondary:hover {
    transform: translateY(-1px);
  }
}

/* List / config pages — section cards (not modals: they sit outside .meritio-app-page) */
.meritio-app-page:not(.meritio-workspace) .container-fluid .card:not(.exercise-card) {
  border-radius: var(--enterprise-radius);
  border: 1px solid var(--app-border);
  box-shadow: var(--enterprise-shadow);
  transition: box-shadow 0.28s var(--enterprise-ease), transform 0.28s var(--enterprise-ease);
}

@media (prefers-reduced-motion: no-preference) {
  .meritio-app-page:not(.meritio-workspace) .container-fluid .card:not(.exercise-card):hover {
    transform: translateY(-2px);
    box-shadow: var(--enterprise-shadow-hover);
  }
}

@media (prefers-reduced-motion: reduce) {
  .meritio-workspace .card:hover,
  .meritio-app-page .btn-primary:hover,
  .meritio-app-page .btn-outline-primary:hover,
  .meritio-app-page .btn-outline-secondary:hover,
  .meritio-app-page:not(.meritio-workspace) .container-fluid .card:not(.exercise-card):hover,
  .meritio-workspace-topbar .btn-primary:hover,
  .meritio-app-page:not(.meritio-workspace) .exercise-card:hover {
    transform: none !important;
  }

  .meritio-app-page.meritio-workspace > .container-fluid:first-of-type {
    animation: none !important;
  }

  .navbar-main #main-nav .nav-link:hover:not(.active) {
    transform: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
   WORKSPACE DESIGN OVERHAUL v2
   CSS-only — zero functional impact
   ══════════════════════════════════════════════════════════ */

/* ── 1. Topbar ─────────────────────────────────────────── */
.meritio-workspace-topbar {
  height: 60px !important;
  padding: 0 !important;
  box-shadow: 0 1px 0 rgba(15,23,42,0.07), 0 4px 20px rgba(15,23,42,0.04) !important;
  display: flex;
  align-items: center;
}
.meritio-workspace-topbar > .container-fluid {
  height: 60px;
  padding: 0 1.5rem !important;
}
.meritio-workspace-topbar #exercise-title {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.025em !important;
  margin-bottom: 1px !important;
}
.meritio-workspace-topbar #exercise-status {
  font-size: 0.73rem !important;
  color: #64748b !important;
  font-weight: 500 !important;
}
.meritio-workspace-topbar #button-back {
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #475569 !important;
  background: #fff !important;
  font-weight: 500 !important;
  font-size: 0.78rem !important;
  padding: 0.36rem 0.85rem !important;
  transition: all 0.15s ease !important;
}
.meritio-workspace-topbar #button-back:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}
.meritio-workspace-topbar #button-save-exercise {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  padding: 0.4rem 1.1rem !important;
  box-shadow: 0 1px 3px rgba(37,99,235,0.4), 0 4px 14px rgba(37,99,235,0.2) !important;
  transition: all 0.18s ease !important;
}
.meritio-workspace-topbar #button-save-exercise:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 18px rgba(37,99,235,0.38) !important;
}
.meritio-workspace-topbar #button-manage-hrbp {
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  padding: 0.36rem 0.85rem !important;
}

/* ── 2. Progress Tracker ───────────────────────────────── */
.step:not(:last-child)::after {
  top: 17px;
  height: 1.5px;
  background-color: #e2e8f0;
  left: 62%;
  width: 76%;
}
.step.completed::after {
  background: linear-gradient(90deg, #2563eb, #60a5fa) !important;
}
.step-circle {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 2px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.step.completed .step-circle {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.step.active .step-circle {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 3px 12px rgba(37,99,235,0.4) !important;
}
.step-label {
  font-size: 0.74rem;
  font-weight: 500;
  color: #94a3b8;
}
.step.completed .step-label { color: #2563eb !important; font-weight: 600 !important; }
.step.active .step-label { color: #1d4ed8 !important; font-weight: 700 !important; }

/* ── 3. Card headers — inset blue accent + clean white bg ── */
.meritio-workspace .card-header {
  background: #ffffff !important;
  background-image: none !important;
  border-bottom: 1px solid #eaecf0 !important;
  box-shadow: inset 4px 0 0 #2563eb !important;
  padding: 0.9rem 1.25rem 0.9rem 1.35rem !important;
  position: relative;
}
.meritio-workspace .card-header h5,
.meritio-workspace .card-header h6 {
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}
/* Analytics/charts section: remove blue accent bar */
.meritio-workspace #analytics-dashboard-section .card-header,
.meritio-workspace .analytics-dashboard-charts .card-header {
  box-shadow: none !important;
  padding-left: 1.25rem !important;
}

/* ── 4. Employee stat cards ─────────────────────────────── */
#employees-statistics .card {
  border: 1px solid #e8ecf0 !important;
  background: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}
#employees-statistics .card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.09) !important;
  transform: translateY(-2px) !important;
}
#employees-statistics .card-body {
  padding: 1.1rem 1rem !important;
}
/* Colored top border per stat type */
#employees-statistics .col-md-3:nth-child(1) .card { border-top: 3px solid #2563eb !important; }
#employees-statistics .col-md-3:nth-child(2) .card { border-top: 3px solid #0ea5e9 !important; }
#employees-statistics .col-md-3:nth-child(3) .card { border-top: 3px solid #22c55e !important; }
#employees-statistics .col-md-3:nth-child(4) .card { border-top: 3px solid #94a3b8 !important; }
#employees-statistics .col-md-4 .card           { border-top: 3px solid #f59e0b !important; }
/* Stat numbers */
#stat-total-employees  { color: #2563eb !important; font-size: 1.7rem !important; }
#stat-countries        { color: #0ea5e9 !important; font-size: 1.7rem !important; }
#stat-eligible         { color: #22c55e !important; font-size: 1.7rem !important; }
#stat-not-eligible     { color: #64748b !important; font-size: 1.7rem !important; }
#stat-missing-performance,
#stat-missing-positioning,
#stat-missing-salary   { color: #f59e0b !important; font-size: 1.7rem !important; }
/* Stat labels */
#employees-statistics .text-muted.small { font-size: 0.74rem !important; font-weight: 500; color: #64748b !important; }

/* ── 5. Upload area ─────────────────────────────────────── */
.meritio-workspace .upload-area {
  background: #f8fafc !important;
  border: 2px dashed #cbd5e1 !important;
  border-radius: 14px !important;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
}
.meritio-workspace .upload-area:hover,
.meritio-workspace .upload-area.dragover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  box-shadow: 0 4px 20px rgba(37,99,235,0.1) !important;
}
.meritio-workspace .upload-area .bi {
  transition: color 0.2s ease;
}
.meritio-workspace .upload-area:hover .bi {
  color: #2563eb !important;
}

/* ── 6. Budget table ────────────────────────────────────── */
/* ── Resulting Merit Matrix — inline header filters ── */
.rmm-card-header {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
  padding: 0.7rem 1.25rem 0.7rem 1.35rem !important;
}

/* Title group */
.rmm-title-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}
.rmm-title-icon {
  font-size: 0.95rem;
  color: #2563eb;
}
.rmm-title-text {
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.rmm-info-icon {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Filter chips */
.rmm-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 10px;
  flex-shrink: 0;
}
.rmm-filter-chip {
  display: flex;
  align-items: center;
  gap: 5px;
}
.rmm-filter-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}
.rmm-filter-label i {
  font-size: 0.7rem;
  color: #94a3b8;
}
.rmm-filter-divider {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
  margin: 0 4px;
  flex-shrink: 0;
}
.rmm-filter-select {
  height: 26px;
  padding: 0 22px 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5' viewBox='0 0 9 5'%3E%3Cpath d='M1 1l3.5 3L8 1' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  min-width: 150px;
  transition: border-color 0.15s;
}
.rmm-filter-select--sm { min-width: 72px; }
.rmm-filter-select:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

/* Actions pushed to the right */
.rmm-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* ── Budget table — clean redesign matching site aesthetic ── */
.meritio-workspace #budget-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
}

/* Consistent dark slate header — same as all other workspace tables */
.meritio-workspace #budget-table thead th {
  background: #1e293b !important;
  color: #94a3b8 !important;
  font-size: 0.68rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  font-weight: 600 !important;
  border: none !important;
  border-right: 1px solid rgba(255,255,255,0.06) !important;
  padding: 0.85rem 1rem !important;
  white-space: nowrap;
  vertical-align: middle;
}
.meritio-workspace #budget-table thead th:first-child { padding-left: 1.35rem !important; }
.meritio-workspace #budget-table thead th:last-child  { border-right: none !important; }

/* Group dividers in header */
.meritio-workspace #budget-table thead th.bth-sep {
  border-left: 1px solid rgba(255,255,255,0.1) !important;
}

/* Body rows */
.meritio-workspace #budget-table tbody td {
  background: #fff;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.84rem !important;
  vertical-align: middle;
  transition: background 0.12s ease;
}
.meritio-workspace #budget-table tbody td.bth-sep {
  border-left: 1px solid #f1f5f9 !important;
}
.meritio-workspace #budget-table tbody tr:hover td {
  background: #f8fafc !important;
}
.meritio-workspace #budget-table tbody tr:last-child td { border-bottom: none !important; }

/* Country cell */
.budget-country-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 160px;
}
.budget-country-info { display: flex; flex-direction: column; gap: 2px; }
.budget-country-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.budget-country-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.budget-emp-badge {
  font-size: 0.67rem;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}
.budget-currency-badge {
  font-size: 0.67rem;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 4px;
  padding: 1px 6px;
  border: 1px solid #dbeafe;
}

/* All inputs inside budget table */
.meritio-workspace #budget-table input[type="number"] {
  border: 1px solid #e2e8f0 !important;
  border-radius: 7px !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  padding: 0.3rem 0.4rem !important;
  text-align: center !important;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s !important;
  height: 32px !important;
}
.meritio-workspace #budget-table input[type="number"]:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important;
  background: #fff !important;
  outline: none !important;
}
.meritio-workspace #budget-table input[type="number"]:disabled {
  background: #f1f5f9 !important;
  color: #cbd5e1 !important;
  border-color: #e2e8f0 !important;
  cursor: not-allowed !important;
}

/* Subgroup budget builder */
.subgroup-builder {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
  padding: 0.9rem;
}
.subgroup-builder-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.7rem;
}
.subgroup-builder-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: #0f172a;
  font-size: 0.9rem;
}
.subgroup-builder-subtitle {
  color: #64748b;
  font-size: 0.76rem;
  margin-top: 0.15rem;
}
.subgroup-builder-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}
.subgroup-builder-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
}
.subgroup-builder-controls .form-select {
  max-width: 260px;
}
.subgroup-builder-hint {
  color: #64748b;
  font-size: 0.74rem;
}
.subgroup-groups-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.subgroup-group-card {
  border: 1px solid #dbeafe;
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem;
}
.subgroup-group-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: end;
}
.subgroup-group-criteria {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.subgroup-criterion-row {
  display: grid;
  grid-template-columns: 1fr 0.7fr 1fr auto;
  gap: 0.45rem;
  align-items: end;
}
.subgroup-field-stack {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.subgroup-field-label {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #64748b;
  text-transform: uppercase;
}
.subgroup-summary {
  margin-top: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #334155;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}
.subgroup-summary.bad {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.subgroup-validation-banner {
  margin-bottom: 0.6rem;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.76rem;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #9f1239;
}
.subgroup-inline-actions {
  display: flex;
  gap: 0.35rem;
}

/* Pill classes (kept for JS compatibility but now minimal) */
.bth-pill { display: inline; }
.bth-pill--merit, .bth-pill--promo, .bth-pill--adj, .bth-pill--other { background: none; color: inherit; padding: 0; border-radius: 0; }

/* ── Merged budget+% cell — side-by-side layout ── */
.budget-combined-cell {
  padding: 0.55rem 0.75rem !important;
  min-width: 200px;
}
.budget-inline-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Budget input — wider, takes most of the space */
.budget-combined-cell .budget-text-input {
  border: 1px solid #e2e8f0 !important;
  border-radius: 7px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  padding: 0.3rem 0.5rem !important;
  height: 32px !important;
  flex: 1 1 auto !important;
  min-width: 80px !important;
  text-align: right !important;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s !important;
  box-sizing: border-box;
}
.budget-combined-cell .budget-text-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important;
  background: #fff !important;
  outline: none !important;
}
.budget-combined-cell .budget-text-input:disabled {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border-color: #e2e8f0 !important;
  cursor: not-allowed !important;
}
/* % input — compact, fixed width */
.budget-pct-input {
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  padding: 0.3rem 0.25rem !important;
  height: 32px !important;
  width: 58px !important;
  flex-shrink: 0 !important;
  text-align: center !important;
}
.budget-pct-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.12) !important;
  background: #fff !important;
  color: #0f172a !important;
  outline: none !important;
}
.budget-pct-input:disabled {
  background: #f8fafc !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
}
.budget-pct-unit {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   MMX — Merit Matrix Studio (unified panel)
   All rules use !important where needed to override the
   .meritio-workspace .card-header { background:#fff !important }
   and the inset blue box-shadow applied to every card header.
   ══════════════════════════════════════════════════════════ */

/* ── Shell card ─────────────────────────────────────────── */
.mmx-shell {
  border: 1px solid #cbd5e1 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 24px rgba(15,23,42,0.09) !important;
  transform: none !important; /* stop workspace hover lift on this card */
}
/* Prevent workspace hover transform on this card */
.meritio-workspace .mmx-shell:hover {
  transform: none !important;
  box-shadow: 0 4px 24px rgba(15,23,42,0.09) !important;
}

/* ── Header: override workspace's white bg + blue inset bar ─ */
.meritio-workspace .mmx-shell .card-header,
.mmx-shell .card-header.mmx-header,
.mmx-shell .mmx-header {
  background: #ffffff !important;
  background-image: none !important;
  border-bottom: 1px solid #eaecf0 !important;
  box-shadow: inset 4px 0 0 #2563eb !important;
  padding: 0.9rem 1.25rem 0.9rem 1.35rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
}
/* Match workspace h5/h6 colour inside MMX header */
.mmx-shell .card-header h5,
.mmx-shell .card-header h6 {
  color: #0f172a !important;
}

.mmx-header-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  flex: 1;
}
.mmx-header-icon-wrap {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
  display: flex; align-items: center; justify-content: center;
  color: #fff !important;
  font-size: 1rem;
  flex-shrink: 0;
}
.mmx-header-title {
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.mmx-info-icon {
  font-size: 0.78rem;
  color: #94a3b8 !important;
  cursor: help;
  flex-shrink: 0;
}
.mmx-header-sub {
  font-size: 0.71rem !important;
  color: #64748b !important;
  margin-top: 0.15rem;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  line-height: 1.35;
}
.mmx-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.mmx-reset-btn,
.meritio-workspace .mmx-shell .card-header .mmx-reset-btn {
  color: #475569 !important;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  font-size: 0.78rem !important;
  box-shadow: none !important;
}
.mmx-reset-btn:hover { color: #1e293b !important; border-color: #cbd5e1 !important; background: #f1f5f9 !important; }
.mmx-save-btn,
.meritio-workspace .mmx-shell .card-header .mmx-save-btn {
  background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
  color: #fff !important;
  border: none !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35) !important;
}
.mmx-save-btn:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(99,102,241,0.45) !important;
}

/* ── Controls bar: single tight row, no wrapping ────────── */
/* ─────────────────────────────────────────────────────────
   Controls strip
   Sits between the dark card header (#0f172a) and the dark
   table header (#1e293b). Uses the same dark family so the
   three zones read as one cohesive configuration area above
   the white data rows. All interactive elements: 28 px tall,
   same font size (0.76rem), same vertical midline.
   ───────────────────────────────────────────────────────── */
.mmx-controls-wrap {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  height: 44px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.mmx-controls-wrap::-webkit-scrollbar { display: none; }

/* ── Left: Matrix Type label + pills ─────────────────────── */
.mmx-type-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.mmx-type-label {
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  white-space: nowrap;
  line-height: 1;
}
/* Pill track — light surface */
.mmx-type-pills {
  display: flex;
  align-items: center;
  background: #e2e8f0;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 3px;
  gap: 2px;
  height: 28px;
  box-sizing: border-box;
}
/* Each pill */
.mmx-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  height: 20px;
  padding: 0 0.65rem;
  border-radius: 5px;
  font-size: 0.76rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
  box-sizing: border-box;
}
.mmx-pill input[type="radio"] { display: none; }
.mmx-pill:has(input:checked) {
  background: #fff;
  color: #4338ca;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.mmx-pill:hover:not(:has(input:checked)) {
  background: rgba(0,0,0,0.05);
  color: #374151;
}

/* ── Divider ─────────────────────────────────────────────── */
.mmx-ctrl-divider {
  width: 1px;
  height: 18px;
  background: #d1d5db;
  margin: 0 1rem;
  flex-shrink: 0;
  align-self: center;
  border-radius: 1px;
}

/* ── Right: Rating Source + Country ─────────────────────── */
.mmx-right-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  height: 100%;
  margin-left: auto;
  flex-shrink: 0;     /* never compress — always fully visible */
}
.mmx-ctrl-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 28px;
  white-space: nowrap;
}
.mmx-ctrl-label {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.69rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  line-height: 1;
  height: 28px;
}

/* ── All selects: uniform 28 px, light-themed ─────────────── */
.mmx-select {
  height: 28px;
  line-height: 28px;
  font-size: 0.76rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: #1e293b;
  padding: 0 28px 0 0.6rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-width: 0;
  box-sizing: border-box;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mmx-select--wide    { min-width: 168px; max-width: 210px; }
.mmx-select--country { min-width: 120px; max-width: 170px; }
.mmx-select:focus {
  border-color: #6366f1;
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background-color: #fff;
}
.mmx-select option { background: #fff; color: #1e293b; }

.mmx-merit-input-wrap { display: flex; align-items: center; gap: 0.25rem; height: 28px; }
.mmx-merit-input {
  width: 62px; height: 28px; line-height: 1;
  font-size: 0.76rem;
  border: 1px solid rgba(255,255,255,0.13); border-radius: 6px;
  padding: 0 0.5rem; color: #e2e8f0;
  background: rgba(255,255,255,0.08); box-sizing: border-box;
}
.mmx-merit-input:focus {
  border-color: #6366f1; outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}
.mmx-merit-unit { font-size: 0.76rem; color: #64748b; line-height: 1; }

/* ── Project rating controls strip ──────────────────────── */
.mmx-project-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.4rem;
  height: 40px;
  background: #1a2535;
  border-bottom: 1px solid #2d3f55;
}
.mmx-add-btn { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac !important; font-size: 0.78rem; }
.mmx-add-btn:hover { background: #dcfce7; border-color: #4ade80 !important; }
.mmx-rem-btn { background: #fff1f2; color: #dc2626; border: 1px solid #fca5a5 !important; font-size: 0.78rem; }
.mmx-rem-btn:hover { background: #fee2e2; border-color: #f87171 !important; }

/* ── Unified matrix table ───────────────────────────────── */
.mmx-table-area { padding: 0; }
.mmx-table {
  font-size: 0.84rem;
  margin-bottom: 0;
  border-collapse: separate !important;
  border-spacing: 0;
}
/* Dark table header with full-opacity text */
.mmx-table thead th,
.meritio-workspace .mmx-table thead th,
.meritio-workspace .mmx-shell .mmx-table thead th,
.mmx-shell .mmx-table thead th,
#leverage-matrix-table thead th,
#leverage-matrix-table th {
  background: #1e293b !important;
  background-color: #1e293b !important;
  background-image: none !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  font-size: 0.67rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.09em !important;
  padding: 0.8rem 1rem !important;
  border: none !important;
  border-right: 1px solid #2d3f55 !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}
.mmx-table thead th:first-child,
.meritio-workspace .mmx-table thead th:first-child { padding-left: 1.4rem !important; }
.mmx-table thead th:last-child,
.meritio-workspace .mmx-table thead th:last-child { border-right: none !important; }

/* Body rows */
.mmx-table tbody td {
  padding: 0.65rem 1rem !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #f1f5f9 !important;
  border-right: 1px solid #f1f5f9 !important;
  background: #fff;
}
.mmx-table tbody td:first-child {
  padding-left: 1.4rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  font-size: 0.84rem !important;
  border-left: 3px solid transparent !important;
  transition: border-color 0.15s;
}
.mmx-table tbody td:last-child { border-right: none !important; }
.mmx-table tbody tr:last-child td { border-bottom: none !important; }
.mmx-table tbody tr:hover td { background: #f8fafc !important; }
.mmx-table tbody tr:hover td:first-child { border-left-color: #4f46e5 !important; }

/* ── Merged cell: calc preview + leverage input ──────────── */
.mmx-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
/* Small grey calculated % above the input */
.mmx-calc-preview {
  font-size: 0.66rem !important;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
  line-height: 1;
  min-height: 0.85rem;
  transition: color 0.2s ease;
}
.mmx-cell:focus-within .mmx-calc-preview { color: #4f46e5; }

/* Leverage input: the primary big number */
.mmx-table .leverage-input,
.meritio-workspace .mmx-table .leverage-input {
  border: 1.5px solid #dde3ec !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  width: 86px !important;
  text-align: center !important;
  padding: 0.32rem 0.4rem !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
  min-width: 0 !important;
}
.mmx-table .leverage-input:focus,
.meritio-workspace .mmx-table .leverage-input:focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.13) !important;
  background: #fff !important;
  outline: none !important;
  color: #1e293b !important;
}

/* ══════════════════════════════════════════════════════════
   WORKSPACE TABLE DESIGN SYSTEM
   One set of tokens — applied to every table in the workspace
   so they all share the same header, body, and hover style.
   ══════════════════════════════════════════════════════════ */

/* ── Shared header token (ALL workspace tables) ─────────── */
.meritio-workspace .merit-matrix-table thead th,
.meritio-workspace .mmx-table thead th,
.meritio-workspace #resulting-merit-matrix-table thead th,
.meritio-workspace #final-merit-matrices-table thead th,
.meritio-workspace #final-increases-table thead th,
.meritio-workspace #budget-summary-table thead th,
.meritio-workspace #manager-overrides-table thead th {
  background: #1e293b !important;
  background-image: none !important;
  color: #94a3b8 !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  padding: 0.8rem 1rem !important;
  border: none !important;
  border-right: 1px solid #2d3f55 !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}
.meritio-workspace .merit-matrix-table thead th:last-child,
.meritio-workspace .mmx-table thead th:last-child,
.meritio-workspace #resulting-merit-matrix-table thead th:last-child,
.meritio-workspace #final-merit-matrices-table thead th:last-child,
.meritio-workspace #final-increases-table thead th:last-child,
.meritio-workspace #budget-summary-table thead th:last-child,
.meritio-workspace #manager-overrides-table thead th:last-child {
  border-right: none !important;
}

/* ── Shared body token ───────────────────────────────────── */
.meritio-workspace .merit-matrix-table tbody td,
.meritio-workspace .mmx-table tbody td {
  padding: 0.65rem 1rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
  border-right: 1px solid #f1f5f9 !important;
  font-size: 0.83rem !important;
  background: #fff;
  vertical-align: middle !important;
}
.meritio-workspace .merit-matrix-table tbody td:last-child,
.meritio-workspace .mmx-table tbody td:last-child { border-right: none !important; }
.meritio-workspace .merit-matrix-table tbody tr:last-child td,
.meritio-workspace .mmx-table tbody tr:last-child td { border-bottom: none !important; }

/* ── Shared hover ────────────────────────────────────────── */
.meritio-workspace .merit-matrix-table tbody tr:hover td,
.meritio-workspace .mmx-table tbody tr:hover td { background: #f8fafc !important; }

/* ── Inputs inside merit-matrix-table (legacy/fallback) ──── */
.merit-matrix-table td input:not([type="checkbox"]):not([type="radio"]) {
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 6px !important;
  background: #f8fafc !important;
  font-size: 0.8rem !important;
  padding: 0.27rem 0.4rem !important;
}
.merit-matrix-table td input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12) !important;
  background: #fff !important;
  outline: none !important;
}

/* ══════════════════════════════════════════════════════════
   WORKSPACE UNIFIED BUTTON TOKENS  (ws-btn)
   Single source of truth for ALL buttons in every workspace section.
   ══════════════════════════════════════════════════════════ */
.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 32px;
  padding: 0 0.9rem;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, box-shadow 0.15s ease;
  vertical-align: middle;
}
.ws-btn:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}
/* Ghost — subtle slate outline, used for secondary/utility actions */
.ws-btn--ghost {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
.ws-btn--ghost:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
  text-decoration: none;
}
/* Save — solid indigo gradient, used for primary write actions */
.ws-btn--save {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 4px rgba(99,102,241,0.35);
}
.ws-btn--save:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  box-shadow: 0 2px 8px rgba(99,102,241,0.45);
  color: #fff;
  text-decoration: none;
}
/* Run Analysis — teal/emerald accent to stand out from indigo Save */
.ws-btn--run {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 4px rgba(14,165,233,0.35);
  padding: 0 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.ws-btn--run:hover {
  background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%);
  box-shadow: 0 2px 10px rgba(14,165,233,0.45);
  color: #fff;
  text-decoration: none;
}
.ws-btn--run i { font-size: 0.8rem; }

/* dropdown caret */
.ws-btn.dropdown-toggle::after { margin-left: 0.25rem; }

/* Dropdown menu — matches workspace aesthetic */
.ws-dropdown {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15,23,42,0.12);
  padding: 0.4rem 0;
  min-width: 185px;
  overflow: hidden;
}
.ws-dropdown .dropdown-item {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ws-dropdown .dropdown-item i { color: #94a3b8; font-size: 0.85rem; }
.ws-dropdown .dropdown-item:hover,
.ws-dropdown .dropdown-item:focus {
  background: #f1f5f9;
  color: #1e293b;
}
.ws-dropdown .dropdown-item:hover i,
.ws-dropdown .dropdown-item:focus i { color: #6366f1; }
.ws-dropdown .dropdown-divider { margin: 0.3rem 0; border-color: #f1f5f9; }

/* Action button bar inside card-headers — consistent gap */
.ws-action-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

/* ══════════════════════════════════════════════════════════
   EMPLOYEE DATA UPLOAD — modern two-panel layout (edu-*)
   ══════════════════════════════════════════════════════════ */
.edu-panels {
  display: flex;
  align-items: stretch;
  gap: 0;
}

/* Each panel */
.edu-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 2rem;
  gap: 1.25rem;
  position: relative;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  min-height: 280px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.edu-panel--download:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 20px rgba(99,102,241,0.1);
}

/* Step number badge */
.edu-step-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  letter-spacing: 0;
}

/* Icon circle */
.edu-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.edu-icon-wrap--indigo {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #4f46e5;
}
.edu-icon-wrap--teal {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #059669;
}

/* Text block */
.edu-text { display: flex; flex-direction: column; gap: 0.35rem; }
.edu-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}
.edu-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
  max-width: 260px;
}
.edu-badge-format {
  display: inline-flex;
  align-items: center;
  font-size: 0.73rem;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  margin-top: 0.25rem;
}

/* Action button */
.edu-action-btn { height: 38px; padding: 0 1.4rem; font-size: 0.82rem; }

/* Vertical divider with arrow */
.edu-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
  flex-shrink: 0;
}
.edu-divider-line {
  width: 1px;
  flex: 1;
  background: #e2e8f0;
}
.edu-divider-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Upload zone overrides (Step 2 uses upload-area class for JS drag events) */
.edu-upload-zone {
  width: 100%;
  flex: 1;
  border: 2px dashed #cbd5e1 !important;
  border-radius: 12px !important;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease !important;
  min-height: 0 !important;
}
.edu-upload-zone:hover,
.edu-upload-zone.dragover {
  border-color: #059669 !important;
  background: #f0fdf4 !important;
  box-shadow: 0 4px 20px rgba(5,150,105,0.08) !important;
}

/* File selected info row */
.edu-file-info {
  width: 100%;
  background: #f0fdf4;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 0.8rem 1rem;
}
.edu-file-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.edu-file-icon { font-size: 1.4rem; color: #059669; flex-shrink: 0; }
.edu-file-meta { flex: 1; text-align: left; min-width: 0; }
.edu-file-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edu-file-size { font-size: 0.73rem; color: #64748b; }
.edu-file-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

/* Panel 2 layout adjustments */
.edu-panel--upload {
  gap: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .edu-panels {
    flex-direction: column;
  }
  .edu-divider {
    flex-direction: row;
    padding: 1rem 0;
  }
  .edu-divider-line {
    flex: 1;
    width: auto;
    height: 1px;
  }
  .edu-divider-arrow {
    transform: rotate(90deg);
  }
}

/* ── 8. Increases Table — major overhaul ────────────────── */
#increases-table-container {
  border-radius: 12px !important;
  border: 1px solid #e4e8ed !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}

/* Dark, professional header */
.meritio-workspace #increases-table thead.table-light {
  background: none !important;
}
.meritio-workspace #increases-table thead th {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border: none !important;
  border-bottom: 1px solid #2d3f55 !important;
  border-right: 1px solid #2d3f55 !important;
  padding: 0 !important;
  vertical-align: middle;
  white-space: nowrap;
}
.meritio-workspace #increases-table thead th:last-child { border-right: none !important; }

/* Sticky header columns — slightly darker shade */
.meritio-workspace #increases-table thead .sticky-column-left-0,
.meritio-workspace #increases-table thead .sticky-column-left-1 {
  background: #192230 !important;
  z-index: 21 !important;
  box-shadow: 2px 0 6px rgba(0,0,0,0.2) !important;
}

/* Filter buttons → styled text labels, not outline buttons */
.meritio-workspace #increases-table .filter-btn,
.meritio-workspace #hrbp-employee-table .filter-btn {
  background: transparent !important;
  border: none !important;
  color: #cbd5e1 !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  padding: 0.78rem 0.65rem !important;
  min-height: unset !important;
  margin-top: 0 !important;
  white-space: nowrap !important;
  text-align: left !important;
  line-height: 1.2 !important;
  border-radius: 0 !important;
  justify-content: flex-start !important;
}
.meritio-workspace #increases-table .filter-btn:hover,
.meritio-workspace #hrbp-employee-table .filter-btn:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.07) !important;
}

/* Sort buttons in dark header */
.meritio-workspace #increases-table .sort-btn,
.meritio-workspace #hrbp-employee-table .sort-btn {
  color: #4b6080 !important;
  opacity: 1 !important;
  padding: 0.78rem 0.4rem !important;
  transition: color 0.15s ease !important;
}
.meritio-workspace #increases-table .sort-btn:hover,
.meritio-workspace #hrbp-employee-table .sort-btn:hover {
  color: #94a3b8 !important;
}
/* Sort icon when active */
.meritio-workspace #increases-table .sort-btn.asc .bi,
.meritio-workspace #increases-table .sort-btn.desc .bi {
  color: #60a5fa !important;
}

/* Table body rows */
.meritio-workspace #increases-table tbody td {
  border-color: #f1f5f9 !important;
  padding: 0.52rem 0.72rem !important;
  font-size: 0.82rem !important;
  color: #1e293b !important;
  vertical-align: middle;
}
.meritio-workspace #increases-table tbody tr:nth-child(even) td {
  background: #fafbfd !important;
}
.meritio-workspace #increases-table tbody tr:nth-child(odd) td {
  background: #fff !important;
}
.meritio-workspace #increases-table tbody tr:hover td {
  background: #f0f5ff !important;
}

/* Sticky body columns */
.meritio-workspace #increases-table tbody .sticky-column-left-0,
.meritio-workspace #increases-table tbody .sticky-column-left-1 {
  background: #fff !important;
  box-shadow: 2px 0 6px rgba(0,0,0,0.07) !important;
  z-index: 9 !important;
}
.meritio-workspace #increases-table tbody tr:nth-child(even) .sticky-column-left-0,
.meritio-workspace #increases-table tbody tr:nth-child(even) .sticky-column-left-1 {
  background: #fafbfd !important;
}
.meritio-workspace #increases-table tbody tr:hover .sticky-column-left-0,
.meritio-workspace #increases-table tbody tr:hover .sticky-column-left-1 {
  background: #f0f5ff !important;
}

/* Editable inputs inside table */
.meritio-workspace #increases-table .editable-input {
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 6px !important;
  background: #f8fafc !important;
  font-size: 0.79rem !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
}
.meritio-workspace #increases-table .editable-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
  background: #fff !important;
  outline: none !important;
}

/* Comment textarea */
.meritio-workspace #increases-table .comment-input {
  border: 1.5px solid #e8ecf0 !important;
  border-radius: 6px !important;
  font-size: 0.77rem !important;
  background: #f8fafc !important;
  resize: none !important;
}
.meritio-workspace #increases-table .comment-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.11) !important;
  background: #fff !important;
  outline: none !important;
}

/* Table footer totals */
.meritio-workspace #increases-table tfoot td {
  background: #f1f5f9 !important;
  font-weight: 700 !important;
  border-top: 2px solid #dde3ec !important;
  font-size: 0.82rem !important;
  color: #0f172a !important;
  padding: 0.62rem 0.72rem !important;
}

/* Filter dropdown (popup) — refine */
.filter-dropdown-menu {
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
  padding: 10px !important;
}
.filter-search-input {
  border-radius: 7px !important;
  border-color: #e2e8f0 !important;
  font-size: 0.82rem !important;
}
.filter-option-item { border-radius: 6px; }
.filter-option-item:hover { background: #f0f5ff !important; }
.filter-option-item label { font-size: 0.82rem !important; }
.filter-actions button {
  border-radius: 6px !important;
  font-size: 0.73rem !important;
  border-color: #e2e8f0 !important;
}
.filter-actions button:hover { background: #eff6ff !important; color: #2563eb !important; }

/* ── 9. Other tables (resulting matrix, final, budget summary) ── */
/* Resulting / final matrix body — keep specific padding override */
.meritio-workspace #resulting-merit-matrix-table tbody td,
.meritio-workspace #final-merit-matrices-table tbody td,
.meritio-workspace #final-increases-table tbody td,
.meritio-workspace #budget-summary-table tbody td,
.meritio-workspace #manager-overrides-table tbody td {
  font-size: 0.83rem !important;
  padding: 0.58rem 0.85rem !important;
  border-color: #f1f5f9 !important;
}
.meritio-workspace #resulting-merit-matrix-table tbody tr:hover td,
.meritio-workspace #final-merit-matrices-table tbody tr:hover td,
.meritio-workspace #final-increases-table tbody tr:hover td,
.meritio-workspace #budget-summary-table tbody tr:hover td { background: #f8fafc !important; }

/* Editable cells in resulting matrix */
.meritio-workspace .resulting-matrix-cell input {
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 6px !important;
  background: #f8fafc !important;
  font-size: 0.8rem !important;
}
.meritio-workspace .resulting-matrix-cell input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
  background: #fff !important;
  outline: none !important;
}

/* ── 10. Analytics summary table ───────────────────────── */
#analytics-summary-table .summary-table-header {
  background: none !important;
}
#analytics-summary-table .summary-table-header th {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-right: 1px solid #2d3f55 !important;
  border-bottom: none !important;
  font-size: 0.67rem !important;
  letter-spacing: 0.07em !important;
  padding: 0.85rem 0.75rem !important;
}
#analytics-summary-table .summary-table-header th:last-child { border-right: none !important; }
#analytics-summary-table .summary-col-country,
#analytics-summary-table .summary-table-header .summary-col-country {
  background: #192230 !important;
  box-shadow: 2px 0 6px rgba(0,0,0,0.18) !important;
}
#analytics-summary-table .summary-table-row:hover {
  background: #f8faff !important;
}
#analytics-summary-table .summary-table-global {
  background: linear-gradient(90deg, #eff6ff, #dbeafe) !important;
  border-top: 2px solid #2563eb !important;
  border-bottom: 2px solid #2563eb !important;
}
#analytics-summary-table .summary-table-global:hover {
  background: linear-gradient(90deg, #dbeafe, #bfdbfe) !important;
}
#analytics-summary-table .summary-table-global .summary-cell-country {
  background: #eff6ff !important;
}
#analytics-summary-table .summary-table-global:hover .summary-cell-country {
  background: #dbeafe !important;
}

/* ── 11. Budget method toggle ───────────────────────────── */
/* ── Budget method toggle — matches site card aesthetic ── */
/* ── Budget entry method — pill toggle in card header ── */
.bmt-radio { display: none !important; }

#budget-method-toggle-container {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
}
.bmt-inner {
  display: flex;
  align-items: center;
  height: 32px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 3px;
  gap: 2px;
}
.bmt-pill {
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 14px;
  font-size: 0.775rem;
  font-weight: 600;
  color: #475569;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  white-space: nowrap;
  line-height: 1;
}
.bmt-pill:hover { color: #1e293b; background: rgba(255,255,255,0.7); }

/* Active states via hidden radio siblings */
#budget-method-amount:checked ~ .bmt-inner .bmt-pill[for="budget-method-amount"],
#budget-method-percentage:checked ~ .bmt-inner .bmt-pill[for="budget-method-percentage"] {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}

/* Thin separator between toggle and buttons */
.bmt-action-sep {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  flex-shrink: 0;
}

/* ── 12. Card action buttons ────────────────────────────── */
.meritio-workspace .card-header .btn-sm {
  border-radius: 7px !important;
  font-size: 0.77rem !important;
  font-weight: 500 !important;
  padding: 0.33rem 0.8rem !important;
}
.meritio-workspace .card-header .btn-primary,
.meritio-workspace .card-header .btn-outline-primary.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 1px 4px rgba(37,99,235,0.3) !important;
}
.meritio-workspace .card-header .btn-primary:hover {
  box-shadow: 0 4px 14px rgba(37,99,235,0.35) !important;
}

/* ── 13. Run Analysis button ────────────────────────────── */
.meritio-workspace #analysis-section .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border: none !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  padding: 0.65rem 2.2rem !important;
  box-shadow: 0 2px 10px rgba(37,99,235,0.3) !important;
  transition: all 0.2s ease !important;
}
.meritio-workspace #analysis-section .btn-primary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 22px rgba(37,99,235,0.38) !important;
}

/* ── 14. Form inputs throughout workspace ───────────────── */
.meritio-workspace .form-control:not(.editable-input):not(.comment-input):not(.increase-input),
.meritio-workspace .form-select {
  border-color: #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.meritio-workspace .form-control:not(.editable-input):not(.comment-input):not(.increase-input):focus,
.meritio-workspace .form-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important;
  outline: none !important;
}

/* ── 15. Merit performance pill — richer colours ──────────── */
.merit-perf-pill {
  min-width: 2.5rem !important;
  padding: 0.15rem 0.5rem !important;
  font-size: 0.69rem !important;
  border-radius: 5px !important;
  font-weight: 700 !important;
}

/* ── 16. Eligibility badge refinements ──────────────────── */
.merit-elig-yes { color: #16a34a !important; font-weight: 600 !important; }
.merit-elig-no  { color: #dc2626 !important; font-weight: 600 !important; }

/* ── 17. HRBP employee picker table ────────────────────── */
.meritio-workspace #hrbp-employee-table thead th {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border: none !important;
  border-bottom: 1px solid #2d3f55 !important;
  border-right: 1px solid #2d3f55 !important;
  padding: 0 !important;
  white-space: nowrap;
}

/* ── 18. Modals — refined styling ─────────────────────────── */
.meritio-workspace ~ .modal .modal-content,
#hrbpAssignmentModal .modal-content,
#deleteHRBPAssignmentModal .modal-content,
#columnVisibilityModal .modal-content {
  border-radius: 14px !important;
  border: none !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18) !important;
  overflow: hidden !important;
}
#hrbpAssignmentModal .modal-header,
#deleteHRBPAssignmentModal .modal-header,
#columnVisibilityModal .modal-header {
  background: #fff !important;
  border-bottom: 1px solid #eaecf0 !important;
  padding: 1.1rem 1.5rem !important;
  box-shadow: inset 4px 0 0 #2563eb !important;
}
#hrbpAssignmentModal .modal-footer,
#deleteHRBPAssignmentModal .modal-footer,
#columnVisibilityModal .modal-footer {
  background: #f8fafc !important;
  border-top: 1px solid #eaecf0 !important;
}

/* ── 19. Budget impact section card stats ────────────────── */
#budget-impact-analysis-section .card {
  border-radius: 12px !important;
  overflow: hidden !important;
}

/* ── 20. Workspace background ────────────────────────────── */
#workspace-content {
  background: #f4f6fa !important;
}

/* ── 21. Matrix Section — equal height + design polish ───── */

/* Keep Bootstrap grid intact — only add stretch + flex column to cols */
#matrix-section > .row {
  align-items: stretch;
  /* No extra gap — Bootstrap gutter handles spacing */
}
#matrix-section .col-md-6 {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem; /* gap on mobile when they stack */
}
@media (min-width: 768px) {
  #matrix-section .col-md-6 {
    margin-bottom: 0;
  }
}
#matrix-section .col-md-6 > .card {
  flex: 1;
  display: flex;
  flex-direction: column;
}
#matrix-section .col-md-6 > .card > .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem !important;
}
#matrix-section .col-md-6 > .card > .card-body > .table-responsive {
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e4e8ed;
}

/* ── Performance rating source dropdown ── */
#performance-rating-source {
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  font-size: 0.76rem !important;
  background: #ffffff !important;
  padding: 0 28px 0 0.6rem !important;
  color: #1e293b !important;
  font-weight: 500 !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
}
#performance-rating-source:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important;
  outline: none !important;
}

/* ── Country select in right card header ── */
#matrix-country-select,
#matrix-example-merit-pct {
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  font-size: 0.76rem !important;
  background: #ffffff !important;
  color: #1e293b !important;
}
#matrix-country-select:focus,
#matrix-example-merit-pct:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important;
  outline: none !important;
}

/* ── Leverage matrix table — editable inputs ── */
#leverage-matrix-table {
  width: 100%;
  height: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
#leverage-matrix-table thead th {
  background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
  color: #fff !important;
  font-size: 0.71rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  font-weight: 700 !important;
  padding: 0.9rem 1rem !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  text-align: center;
}
#leverage-matrix-table thead th:first-child { text-align: left; }

#leverage-matrix-table tbody td {
  padding: 0.7rem 0.9rem !important;
  border: none !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle;
  background: #fff;
}
#leverage-matrix-table tbody tr:last-child td { border-bottom: none !important; }
#leverage-matrix-table tbody tr:hover td { background: #f8faff !important; }
#leverage-matrix-table tbody td:first-child {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  text-align: left !important;
}

/* Percentage inputs — refined */
#leverage-matrix-table td input:not([type="checkbox"]):not([type="radio"]) {
  width: 82px !important;
  text-align: center !important;
  border: 1.5px solid #dde3ec !important;
  border-radius: 8px !important;
  padding: 0.32rem 0.5rem !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  background: #f0f4ff !important;
  color: #1e3a8a !important;
  transition: all 0.15s ease !important;
  display: block;
  margin: 0 auto;
}
#leverage-matrix-table td input:not([type="checkbox"]):not([type="radio"]):hover {
  border-color: #93c5fd !important;
  background: #e8f0ff !important;
}
#leverage-matrix-table td input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.14) !important;
  background: #fff !important;
  color: #1e293b !important;
  outline: none !important;
}

/* ── Calculated matrix table — read-only display ── */
#calculated-matrix-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100%;
  height: 100%;
}
#calculated-matrix-table thead th {
  background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
  color: #fff !important;
  font-size: 0.71rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  font-weight: 700 !important;
  padding: 0.9rem 1rem !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  text-align: center;
}
#calculated-matrix-table thead th:first-child { text-align: left; }

#calculated-matrix-table tbody td {
  padding: 0.7rem 1rem !important;
  border: none !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle;
  text-align: center;
  background: #fff;
}
#calculated-matrix-table tbody tr:last-child td { border-bottom: none !important; }
#calculated-matrix-table tbody tr:hover td { background: #f8faff !important; }

/* Performance rating name column */
#calculated-matrix-table tbody td:first-child {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  text-align: left !important;
}

/* Percentage value cells — bold blue chip look */
#calculated-matrix-table tbody td:not(:first-child) {
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  color: #1e3a8a !important;
  letter-spacing: -0.01em;
}
/* Subtle pill background on value cells */
#calculated-matrix-table tbody td:not(:first-child) {
  position: relative;
}

/* Alternating row tint */
#calculated-matrix-table tbody tr:nth-child(odd) td { background: #fff !important; }
#calculated-matrix-table tbody tr:nth-child(even) td { background: #fafbff !important; }
#calculated-matrix-table tbody tr:hover td { background: #eff6ff !important; }

/* ══════════════════════════════════════════════════════════
   User Management Page
   ══════════════════════════════════════════════════════════ */

/* ── Page shell ─────────────────────────────────────────── */
.um-page {
  min-height: 100vh;
  background: #f4f6fa;
}

/* ── Hero header ────────────────────────────────────────── */
.um-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  padding: 2.5rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}
.um-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 280px; height: 280px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  pointer-events: none;
}
.um-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: 30%;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}
.um-hero-inner {
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.um-hero-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.um-hero-icon-wrap {
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  color: #fff;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}
.um-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  margin: 0 0 0.2rem;
}
.um-hero-subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  margin: 0 0 0.2rem;
  max-width: 480px;
}
.um-hero-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  margin: 0;
}
.um-create-btn {
  background: rgba(255,255,255,0.18) !important;
  border: 1.5px solid rgba(255,255,255,0.4) !important;
  color: #fff !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  padding: 0.6rem 1.25rem !important;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  transition: background 0.15s ease, border-color 0.15s ease !important;
}
.um-create-btn:hover {
  background: rgba(255,255,255,0.28) !important;
  border-color: rgba(255,255,255,0.65) !important;
}

/* ── Stats strip ────────────────────────────────────────── */
.um-stats-strip {
  background: #ffffff;
  border-bottom: 1px solid #e8ecf0;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  max-width: 1200px;
  margin: 0;
}
.um-stat {
  padding: 1.1rem 1.75rem 1.1rem 0;
  min-width: 110px;
}
.um-stat:first-child { padding-left: 0; }
.um-stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.um-stat-value--green  { color: #16a34a; }
.um-stat-value--blue   { color: #2563eb; }
.um-stat-value--purple { color: #7c3aed; }
.um-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.um-stat-divider {
  width: 1px;
  height: 40px;
  background: #e8ecf0;
  margin: 0 1.5rem;
  flex-shrink: 0;
}

/* ── Page body ──────────────────────────────────────────── */
.um-body {
  padding: 2rem;
  max-width: 1200px;
}

/* ── Table card ─────────────────────────────────────────── */
.um-table-card {
  background: #fff;
  border: 1px solid #e4e8ed;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.um-table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid #eaecf0;
  background: #fafbfc;
  box-shadow: inset 4px 0 0 #2563eb;
}
.um-table-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.um-table-card-title i { color: #2563eb; }
.um-table-card-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

/* ── Table ──────────────────────────────────────────────── */
.um-table {
  margin: 0;
  font-size: 0.875rem;
}
.um-table thead tr th {
  background: #0f172a !important;
  color: #94a3b8 !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  padding: 0.7rem 1rem !important;
  border: none !important;
  white-space: nowrap;
}
.um-row { transition: background 0.12s ease; }
.um-row:hover td { background: #f8fafc !important; }
.um-row td {
  padding: 0.85rem 1rem !important;
  border-color: #f1f3f5 !important;
  vertical-align: middle;
}

/* ── User cell (avatar + name) ──────────────────────────── */
.um-user-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.um-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
}
.um-user-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.875rem;
  line-height: 1.2;
}
.um-user-email {
  font-size: 0.775rem;
  color: #64748b;
  margin-top: 0.1rem;
}

/* ── Role badges ────────────────────────────────────────── */
.um-role-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.3rem 0.65rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.um-role-badge--comp  { background: #eff6ff; color: #1d4ed8; }
.um-role-badge--hrbp  { background: #f5f3ff; color: #6d28d9; }
.um-role-badge--admin { background: #fff1f2; color: #be123c; }
.um-role-badge--other { background: #f1f5f9; color: #475569; }

/* ── Status ─────────────────────────────────────────────── */
.um-status-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.um-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.um-status-dot--active   { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
.um-status-dot--inactive { background: #cbd5e1; }
.um-status-text { font-size: 0.8rem; font-weight: 600; }
.um-status-text--active   { color: #16a34a; }
.um-status-text--inactive { color: #94a3b8; }

/* ── Last login dates ───────────────────────────────────── */
.um-date-recent { font-size: 0.8rem; font-weight: 600; color: #2563eb; }
.um-date        { font-size: 0.8rem; color: #64748b; }
.um-never       { font-size: 0.8rem; color: #cbd5e1; font-style: italic; }

/* ── Action buttons ─────────────────────────────────────── */
.um-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.um-action-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.um-action-btn--edit   { color: #2563eb; border-color: #dbeafe; }
.um-action-btn--edit:hover { background: #eff6ff; border-color: #93c5fd; }
.um-action-btn--key    { color: #d97706; border-color: #fde68a; }
.um-action-btn--key:hover { background: #fffbeb; border-color: #fbbf24; }
.um-action-btn--danger { color: #dc2626; border-color: #fecaca; }
.um-action-btn--danger:hover { background: #fff1f2; border-color: #f87171; }

/* ── Modal header styles ────────────────────────────────── */
.um-modal-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
  border-bottom: none !important;
  padding: 1rem 1.25rem !important;
}
.um-modal-header--amber {
  background: linear-gradient(135deg, #92400e 0%, #d97706 100%) !important;
}
.um-modal-header--danger {
  background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 100%) !important;
}
.um-modal-header .modal-title,
.um-modal-header--amber .modal-title,
.um-modal-header--danger .modal-title { color: #fff !important; font-size: 0.95rem !important; }
.um-modal-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}
.um-modal-icon--amber { background: rgba(255,255,255,0.2); }
.um-modal-icon--danger { background: rgba(255,255,255,0.2); }

/* ── Modal form fields ──────────────────────────────────── */
.um-form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
  display: block;
}
.um-input-icon {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
  font-size: 0.9rem !important;
}
.um-btn-save {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}

/* ── Status toggle in modal ─────────────────────────────── */
.um-status-toggle {
  display: flex;
  gap: 0.5rem;
}
.um-status-pill {
  cursor: pointer;
}
.um-status-pill span {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  background: #fff;
  transition: all 0.15s ease;
  user-select: none;
}
.um-status-pill input:checked + span {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

/* ══════════════════════════════════════════════════════════
   Configurations Page
   ══════════════════════════════════════════════════════════ */

/* ── Page shell ─────────────────────────────────────────── */
.config-page {
  min-height: 100vh;
  background: #f4f6fa;
}

/* ── Page header ────────────────────────────────────────── */
.config-page-header {
  background: #ffffff;
  border-bottom: 1px solid #e8ecf0;
  padding: 1.75rem 2rem 1.5rem;
}
.config-page-header-inner {
  max-width: 1200px;
}
.config-page-title-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.config-page-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.config-page-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  margin: 0 0 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.config-page-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}
.config-info-icon {
  font-size: 0.8rem !important;
  color: #94a3b8 !important;
  cursor: help;
  vertical-align: middle;
}

/* ── Page body ──────────────────────────────────────────── */
.config-page-body {
  padding: 2rem;
  max-width: 1200px;
}

/* ── Cards ──────────────────────────────────────────────── */
.config-card {
  background: #ffffff;
  border: 1px solid #e4e8ed;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.config-card--danger {
  border-color: #fecaca;
}
.config-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eaecf0;
  background: #fafbfc;
  box-shadow: inset 4px 0 0 #2563eb;
}
.config-card-header--danger {
  background: #fff5f5;
  box-shadow: inset 4px 0 0 #dc3545;
  border-bottom-color: #fecaca;
}
.config-card-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.config-section-badge {
  width: 38px;
  height: 38px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.config-section-badge--green {
  background: #f0fdf4;
  color: #16a34a;
}
.config-section-badge--danger {
  background: #fff1f2;
  color: #dc3545;
}
.config-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}
.config-card-subtitle {
  font-size: 0.775rem;
  color: #64748b;
  font-weight: 400;
}
.config-card-body {
  padding: 1.5rem;
}
.config-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #f1f3f5;
  background: #fafbfc;
}

/* ── Callouts (info banners) ─────────────────────────────── */
.config-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  font-size: 0.83rem;
}
.config-callout--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}
.config-callout--neutral {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}
.config-callout--danger {
  background: #fff5f5;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}
.config-callout-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.config-callout--info .config-callout-icon  { color: #2563eb; }
.config-callout--neutral .config-callout-icon { color: #64748b; }
.config-callout--danger .config-callout-icon  { color: #dc3545; }
.config-callout-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.config-callout-list {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.7;
}

/* ── Tables ─────────────────────────────────────────────── */
.config-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  margin: 0;
}
.config-table thead tr th {
  background: #0f172a !important;
  color: #94a3b8 !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  padding: 0.7rem 0.85rem !important;
  border: none !important;
  border-bottom: none !important;
  white-space: nowrap;
}
.config-table thead tr th:first-child { border-radius: 0; }
.config-table--sm thead tr th { font-size: 0.68rem !important; padding: 0.55rem 0.75rem !important; }
.config-table tbody tr { transition: background 0.12s ease; }
.config-table tbody tr:hover td { background: #f8fafc !important; }
.config-table tbody tr td {
  padding: 0.65rem 0.85rem !important;
  border-color: #f1f3f5 !important;
  vertical-align: middle;
  color: #374151;
  font-size: 0.85rem;
}
.config-table .form-control,
.config-table .form-select {
  font-size: 0.85rem;
  border-radius: 8px;
  border-color: #e2e8f0;
}
.config-table .form-control:focus,
.config-table .form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.config-table .btn-sm { font-size: 0.78rem; }

/* ── Count label ─────────────────────────────────────────── */
.config-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

/* ── Buttons ─────────────────────────────────────────────── */
.config-btn-save {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  padding: 0.42rem 1rem !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25) !important;
}
.config-btn-save:hover {
  box-shadow: 0 4px 14px rgba(37,99,235,0.35) !important;
  transform: translateY(-1px);
}
.config-btn-add {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
}
.config-btn-danger {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  white-space: nowrap;
}

/* ── Currency rate source toggle ──────────────────────────── */
.config-rate-source-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
}
.config-rate-source-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.config-rate-source-toggle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.config-rate-pill {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  cursor: pointer;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  transition: all 0.15s ease;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
}
.config-rate-pill:hover { border-color: #93c5fd; }
input[name="rate-source"]:checked + .config-rate-pill {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.config-rate-pill-sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: #94a3b8;
}
input[name="rate-source"]:checked + .config-rate-pill .config-rate-pill-sub {
  color: #60a5fa;
}

/* ── Tabs ────────────────────────────────────────────────── */
.config-tabs {
  border-bottom: 2px solid #eaecf0 !important;
  gap: 0.25rem;
}
.config-tabs .nav-link {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  border: none !important;
  border-radius: 8px 8px 0 0 !important;
  padding: 0.55rem 1rem !important;
  transition: color 0.15s, background 0.15s !important;
}
.config-tabs .nav-link:hover { color: #2563eb !important; background: #f0f5ff !important; }
.config-tabs .nav-link.active {
  color: #2563eb !important;
  background: transparent !important;
  border-bottom: 2px solid #2563eb !important;
  margin-bottom: -2px;
}

/* ── Upload steps ────────────────────────────────────────── */
.config-upload-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.config-upload-step {
  display: flex;
  gap: 0.85rem;
  flex: 1;
}
.config-upload-step-num {
  width: 28px;
  height: 28px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}
.config-upload-step-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.15rem;
}
.config-upload-step-desc {
  font-size: 0.78rem;
  color: #64748b;
}
.config-upload-step-divider {
  width: 1px;
  background: #e2e8f0;
  margin: 0 1.5rem;
  align-self: stretch;
  flex-shrink: 0;
}

/* ── IMF live badge ───────────────────────────────────────── */
.config-badge-live {
  background: #dcfce7 !important;
  color: #166534 !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  padding: 0.25rem 0.6rem !important;
}

/* ── Danger zone row ─────────────────────────────────────── */
.config-danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 10px;
}
.config-danger-row-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.2rem;
}
.config-danger-row-desc {
  font-size: 0.8rem;
  color: #64748b;
}

/* ── Country Modal sections ──────────────────────────────── */
.config-modal-section {
  padding: 1.25rem 0;
  border-bottom: 1px solid #f1f3f5;
  margin-bottom: 0.25rem;
}
.config-modal-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════════════════════════
   Analytics Dashboard — Design Overhaul
   ══════════════════════════════════════════════════════════ */

/* ── Filters toolbar ────────────────────────────────────── */
/* ── Filters bar: dark pill bar ─────────────────────────── */
.analytics-filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: #0f172a;
  border: none;
  border-radius: 14px;
  padding: 0.85rem 1.4rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 4px 24px rgba(15,23,42,0.18);
}
.analytics-filters-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.5rem;
  white-space: nowrap;
}
.analytics-filters-label i { color: #6366f1; }
.analytics-filter-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.25rem 0.7rem 0.25rem 0.55rem;
}
.analytics-filter-chip label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  margin: 0;
  white-space: nowrap;
}
.analytics-filter-chip select {
  border: none !important;
  border-radius: 6px !important;
  font-size: 0.78rem !important;
  padding: 0.2rem 1.6rem 0.2rem 0.4rem !important;
  background: transparent !important;
  color: #e2e8f0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 4px center !important;
  transition: color 0.15s ease !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
}
.analytics-filter-chip select option { background: #1e293b; color: #e2e8f0; }
.analytics-filter-chip select:focus { color: #fff !important; outline: none !important; }

/* ── KPI Summary Bar ────────────────────────────────────── */
.analytics-kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
@media (max-width: 768px) {
  .analytics-kpi-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .analytics-kpi-bar { grid-template-columns: 1fr; }
}
.analytics-kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 1.35rem 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.analytics-kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0.12;
  pointer-events: none;
}
.analytics-kpi-card:hover { transform: translateY(-3px); }

.analytics-kpi-card--blue {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  box-shadow: 0 8px 32px rgba(37,99,235,0.35);
}
.analytics-kpi-card--blue:hover { box-shadow: 0 14px 40px rgba(37,99,235,0.45); }

.analytics-kpi-card--green {
  background: linear-gradient(135deg, #14532d 0%, #16a34a 100%);
  box-shadow: 0 8px 32px rgba(22,163,74,0.35);
}
.analytics-kpi-card--green:hover { box-shadow: 0 14px 40px rgba(22,163,74,0.45); }

.analytics-kpi-card--amber {
  background: linear-gradient(135deg, #78350f 0%, #d97706 100%);
  box-shadow: 0 8px 32px rgba(217,119,6,0.35);
}
.analytics-kpi-card--amber:hover { box-shadow: 0 14px 40px rgba(217,119,6,0.45); }

.analytics-kpi-card--slate {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  box-shadow: 0 8px 32px rgba(15,23,42,0.35);
}
.analytics-kpi-card--slate:hover { box-shadow: 0 14px 40px rgba(15,23,42,0.45); }

.analytics-kpi-value {
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.04em;
}
.analytics-kpi-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.analytics-kpi-label i { color: rgba(255,255,255,0.5); }
/* Decorative background circle */
.analytics-kpi-card::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}

/* ── Section headings inside analytics ──────────────────── */
.analytics-section-title {
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem !important;
  padding: 0.5rem 0.85rem;
  border-left: 4px solid #6366f1;
  background: linear-gradient(90deg, #f0f4ff 0%, transparent 100%);
  border-radius: 0 8px 8px 0;
  letter-spacing: -0.01em;
}
.analytics-section-title i { color: #6366f1; font-size: 0.9rem; }

/* ── Chart card wrapper ─────────────────────────────────── */
.analytics-chart-card {
  border: 1px solid #e4e8ed !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 24px rgba(15,23,42,0.07) !important;
  overflow: hidden;
  background: #fff;
  height: 100%;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.analytics-chart-card:hover {
  box-shadow: 0 8px 36px rgba(15,23,42,0.1) !important;
  transform: translateY(-2px);
}
.analytics-chart-card .card-header {
  background: #0f172a !important;
  box-shadow: none !important;
  border-bottom: none !important;
  padding: 1rem 1.25rem !important;
}
.analytics-chart-card .card-header h6 {
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: #f1f5f9 !important;
  letter-spacing: -0.01em !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.analytics-chart-card .card-header h6 i { color: #818cf8; font-size: 0.9rem; }
.analytics-chart-card .card-header .form-select {
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  font-size: 0.76rem !important;
  color: #cbd5e1 !important;
  font-weight: 500 !important;
  background: rgba(255,255,255,0.07) !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  padding-right: 28px !important;
}
.analytics-chart-card .card-header .form-select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2) !important;
  outline: none !important;
  background-color: rgba(255,255,255,0.1) !important;
}
.analytics-chart-card .card-header .form-select option { background: #1e293b; color: #e2e8f0; }
.analytics-chart-card .card-body {
  padding: 1.5rem !important;
  background: #fff;
}

/* ── Summary table section wrapper ─────────────────────── */
.analytics-summary-wrap {
  border: 1px solid #e4e8ed;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(15,23,42,0.07);
}
.analytics-summary-wrap .summary-table-responsive {
  border-radius: 0;
  box-shadow: none;
}

/* ── Column group header row ────────────────────────────── */
.summary-group-header th {
  background: #0f172a !important;
  color: #60a5fa !important;
  font-size: 0.65rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  font-weight: 700 !important;
  padding: 0.5rem 0.75rem !important;
  border: none !important;
  border-right: 2px solid #1e293b !important;
  text-align: center !important;
}
.summary-group-header th:first-child {
  border-right: 2px solid #1e293b !important;
}
.summary-group-header th:last-child {
  border-right: none !important;
}

/* ══════════════════════════════════════════════════════════
   Meritio Toast Notifications
   ══════════════════════════════════════════════════════════ */
#toast-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.meritio-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: #ffffff;
  border-radius: 14px;
  box-shadow:
    0 4px 6px -1px rgba(0,0,0,0.07),
    0 10px 32px -4px rgba(0,0,0,0.13);
  padding: 0.95rem 1rem 0.95rem 1rem;
  min-width: 300px;
  max-width: 400px;
  position: relative;
  overflow: hidden;
  pointer-events: all;
  border-left: 4px solid transparent;
  /* Slide-in from right */
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.45, 0.64, 1),
    opacity   0.25s ease;
}

.meritio-toast.mt-visible {
  transform: translateX(0);
  opacity: 1;
}

.meritio-toast.mt-hiding {
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition:
    transform 0.28s ease-in,
    opacity   0.22s ease-in;
}

/* ── Type accent colors ─── */
.meritio-toast--success { border-left-color: #22c55e; }
.meritio-toast--error   { border-left-color: #ef4444; }
.meritio-toast--warning { border-left-color: #f59e0b; }
.meritio-toast--info    { border-left-color: #3b82f6; }

/* ── Icon bubble ─── */
.mt-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.meritio-toast--success .mt-icon { background: #dcfce7; color: #16a34a; }
.meritio-toast--error   .mt-icon { background: #fee2e2; color: #dc2626; }
.meritio-toast--warning .mt-icon { background: #fef3c7; color: #d97706; }
.meritio-toast--info    .mt-icon { background: #dbeafe; color: #2563eb; }

/* ── Message ─── */
.mt-content {
  flex: 1;
  min-width: 0;
  padding-top: 0.35rem;
}

.mt-msg {
  margin: 0;
  font-size: 0.855rem;
  line-height: 1.5;
  color: #1e293b;
  font-weight: 500;
}

/* ── Close button ─── */
.mt-close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
  margin-top: 0.25rem;
}

.mt-close:hover {
  color: #475569;
  background: #f1f5f9;
}

/* ── Auto-dismiss progress bar ─── */
.mt-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left center;
  animation: mt-shrink 5s linear forwards;
  border-radius: 0 0 0 14px;
}

.meritio-toast--success .mt-progress { background: #22c55e; }
.meritio-toast--error   .mt-progress { background: #ef4444; }
.meritio-toast--warning .mt-progress { background: #f59e0b; }
.meritio-toast--info    .mt-progress { background: #3b82f6; }

.meritio-toast:hover .mt-progress {
  animation-play-state: paused;
}

@keyframes mt-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .meritio-toast {
    transform: none !important;
    transition: opacity 0.2s ease !important;
  }
  .meritio-toast.mt-hiding { opacity: 0; }
  .mt-progress { animation: none; }
}

/* Merit guardrails modal and in-table flags */
.merit-guardrails-modal .modal-header {
  background: linear-gradient(135deg, #f8faff 0%, #f1f5ff 100%);
}

.guardrails-mode-toggle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.guardrails-mode-pill {
  border: 1px solid #d8e1f5;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #42556f;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.guardrails-mode-pill input {
  display: none;
}

.guardrails-mode-pill:has(input:checked) {
  border-color: #5f7dbf;
  color: #1f3f7a;
  background: #eef4ff;
}

.guardrails-input {
  min-width: 120px;
}

.guardrails-help-row {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #5b6b82;
}

.increases-guardrail-soft-near {
  border-color: #f3b44a !important;
  background-color: #fff7e5 !important;
}

.increases-guardrail-hard-breach,
.increases-guardrail-soft-breach {
  border-color: #d9534f !important;
  background-color: #fff0f0 !important;
}

.comment-required-highlight {
  border: 1px solid #e6a545;
  background: #fffaf0;
}

#increases-table thead th[data-column-index] {
  white-space: normal;
  vertical-align: middle;
}

#increases-table thead th[data-column-index="17"],
#increases-table thead th[data-column-index="18"] {
  min-width: 150px;
}

/* Keep post-Eligibility headers readable in dense tables */
#increases-table thead th[data-column-id="current_salary"],
#increases-table thead th[data-column-id="merit_percentage"],
#increases-table thead th[data-column-id="matrix_merit_percentage"],
#increases-table thead th[data-column-id="guardrail_limits"],
#increases-table thead th[data-column-id="guardrail_flag"],
#increases-table thead th[data-column-id="merit_amount"],
#increases-table thead th[data-column-id="promotion_percentage"],
#increases-table thead th[data-column-id="adjustment_percentage"],
#increases-table thead th[data-column-id="mandatory_percentage"],
#increases-table thead th[data-column-id="col_percentage"],
#increases-table thead th[data-column-id="one_time_percentage"] {
  min-width: 130px;
  line-height: 1.25;
}

#increases-table td[data-field="guardrail_limits"] {
  font-variant-numeric: tabular-nums;
  min-width: 140px;
}

#increases-table td[data-field="guardrail_flag"] .badge {
  font-size: 0.72rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ANALYTICS DASHBOARD — v3 ENTERPRISE REDESIGN
   Modern, clean, white-based cards that match the workspace aesthetic.
   Keeps all chart functionality intact — only overrides visual chrome.
   ══════════════════════════════════════════════════════════════════════════════ */

/* Section wrapper — tighter spacing, cleaner outer card */
.meritio-workspace #analytics-dashboard-section {
  margin-top: 1.5rem;
}
.meritio-workspace #analytics-dashboard-section > .card,
.meritio-workspace .meritio-analytics-freeze > .card {
  border: 1px solid #e4e8ed !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
  overflow: visible !important;
  background: #fff !important;
}

/* Dashboard top header — white with brand accent strip */
.meritio-workspace #analytics-dashboard-section > .card > .card-header {
  background: #ffffff !important;
  background-image: none !important;
  border-bottom: 1px solid #eef1f5 !important;
  padding: 1.1rem 1.4rem !important;
  position: relative;
  border-radius: 16px 16px 0 0 !important;
}
.meritio-workspace #analytics-dashboard-section > .card > .card-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #6366f1 0%, #2563eb 100%);
  border-radius: 16px 0 0 0;
}
.meritio-workspace #analytics-dashboard-section > .card > .card-header h5 {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.015em !important;
  margin: 0 !important;
}
.meritio-workspace #analytics-dashboard-section > .card > .card-header h5 i.bi-bar-chart {
  color: #6366f1 !important;
}
.meritio-workspace #analytics-dashboard-section > .card > .card-body {
  padding: 1.5rem 1.5rem 1.75rem !important;
  background: #f9fafb !important;
  border-radius: 0 0 16px 16px !important;
}

/* ── Filter bar: clean light "command bar" ─────────────────────────── */
.meritio-workspace .analytics-filters-bar {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  background: #ffffff !important;
  border: 1px solid #e4e8ed !important;
  border-radius: 12px !important;
  padding: 0.6rem 0.85rem !important;
  margin-bottom: 1.5rem !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
}
.meritio-workspace .analytics-filters-label {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.55rem 0 0.3rem;
  margin-right: 0.15rem;
  white-space: nowrap;
}
.meritio-workspace .analytics-filters-label i { color: #6366f1 !important; font-size: 0.85rem; }
.meritio-workspace .analytics-filter-chip {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 0.25rem 0.4rem 0.25rem 0.75rem !important;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.meritio-workspace .analytics-filter-chip:hover {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
}
.meritio-workspace .analytics-filter-chip label {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 !important;
  white-space: nowrap;
}
.meritio-workspace .analytics-filter-chip select,
.meritio-workspace .analytics-filter-chip .form-select-sm {
  border: none !important;
  border-radius: 8px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  padding: 0.3rem 1.75rem 0.3rem 0.55rem !important;
  background: #ffffff !important;
  color: #0f172a !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236366f1' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  outline: none !important;
  cursor: pointer !important;
  min-width: 140px !important;
  transition: box-shadow 0.15s ease !important;
}
.meritio-workspace .analytics-filter-chip select:focus,
.meritio-workspace .analytics-filter-chip .form-select-sm:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
}
.meritio-workspace .analytics-filter-chip select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

/* ── KPI cards: clean white with colored accent ─────────────────── */
.meritio-workspace .analytics-kpi-bar {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 1rem !important;
  margin-bottom: 1.75rem !important;
}
@media (max-width: 900px) {
  .meritio-workspace .analytics-kpi-bar { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
  .meritio-workspace .analytics-kpi-bar { grid-template-columns: 1fr !important; }
}
.meritio-workspace .analytics-kpi-card {
  position: relative !important;
  overflow: hidden !important;
  background: #ffffff !important;
  border: 1px solid #e4e8ed !important;
  border-radius: 14px !important;
  padding: 1rem 1.15rem 1rem 1.25rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.45rem !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease !important;
}
.meritio-workspace .analytics-kpi-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08) !important;
  border-color: #d1d9e3 !important;
}
/* Left accent stripe */
.meritio-workspace .analytics-kpi-card::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important; top: 12% !important; bottom: 12% !important;
  width: 3px !important;
  border-radius: 3px !important;
  background: #6366f1 !important;
  inset: 12% auto 12% 0 !important;
  opacity: 1 !important;
}
/* Reset old decorative circle */
.meritio-workspace .analytics-kpi-card::after {
  content: none !important;
  display: none !important;
}
.meritio-workspace .analytics-kpi-card--blue::before  { background: linear-gradient(180deg, #3b82f6, #2563eb) !important; }
.meritio-workspace .analytics-kpi-card--green::before { background: linear-gradient(180deg, #22c55e, #16a34a) !important; }
.meritio-workspace .analytics-kpi-card--amber::before { background: linear-gradient(180deg, #f59e0b, #d97706) !important; }
.meritio-workspace .analytics-kpi-card--slate::before { background: linear-gradient(180deg, #64748b, #334155) !important; }

/* Force remove old dark gradients */
.meritio-workspace .analytics-kpi-card--blue,
.meritio-workspace .analytics-kpi-card--green,
.meritio-workspace .analytics-kpi-card--amber,
.meritio-workspace .analytics-kpi-card--slate {
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}
.meritio-workspace .analytics-kpi-card--blue:hover,
.meritio-workspace .analytics-kpi-card--green:hover,
.meritio-workspace .analytics-kpi-card--amber:hover,
.meritio-workspace .analytics-kpi-card--slate:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08) !important;
}

.meritio-workspace .analytics-kpi-value {
  font-size: 2rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.05 !important;
  letter-spacing: -0.03em !important;
  font-variant-numeric: tabular-nums;
}
.meritio-workspace .analytics-kpi-label {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  margin-top: 0.1rem !important;
}
.meritio-workspace .analytics-kpi-label i {
  font-size: 0.9rem !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.meritio-workspace .analytics-kpi-card--blue  .analytics-kpi-label i { background: #eff6ff !important; color: #2563eb !important; }
.meritio-workspace .analytics-kpi-card--green .analytics-kpi-label i { background: #ecfdf5 !important; color: #16a34a !important; }
.meritio-workspace .analytics-kpi-card--amber .analytics-kpi-label i { background: #fffbeb !important; color: #d97706 !important; }
.meritio-workspace .analytics-kpi-card--slate .analytics-kpi-label i { background: #f1f5f9 !important; color: #334155 !important; }

/* ── Section titles — clean minimal ─────────────────────────────── */
.meritio-workspace .analytics-section-title {
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.55rem !important;
  margin-bottom: 0.85rem !important;
  margin-top: 0.25rem !important;
  padding: 0 !important;
  border-left: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}
.meritio-workspace .analytics-section-title::before {
  content: '' !important;
  display: inline-block !important;
  width: 3px !important;
  height: 14px !important;
  background: #6366f1 !important;
  border-radius: 2px !important;
  margin-right: 0.1rem;
}
.meritio-workspace .analytics-section-title i { color: #6366f1 !important; font-size: 0.85rem !important; }

/* ── Chart cards — white unified aesthetic ───────────────────────── */
.meritio-workspace .analytics-dashboard-charts .analytics-chart-card,
.meritio-workspace .analytics-dashboard-charts > [class^="col-"] > .card {
  border: 1px solid #e4e8ed !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  overflow: hidden !important;
  margin-bottom: 0 !important;
  height: 100% !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}
.meritio-workspace .analytics-dashboard-charts .analytics-chart-card:hover,
.meritio-workspace .analytics-dashboard-charts > [class^="col-"] > .card:hover {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08) !important;
  transform: translateY(-1px) !important;
}

/* Chart header — white with subtle bottom divider + blue icon bubble */
.meritio-workspace .analytics-chart-card .card-header,
.meritio-workspace .analytics-dashboard-charts .card-header {
  background: #ffffff !important;
  background-image: none !important;
  color: #0f172a !important;
  border-bottom: 1px solid #eef1f5 !important;
  padding: 0.85rem 1.1rem !important;
  box-shadow: none !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 0.75rem !important;
  flex-wrap: wrap !important;
}
.meritio-workspace .analytics-chart-card .card-header h6,
.meritio-workspace .analytics-dashboard-charts .card-header h6 {
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}
.meritio-workspace .analytics-chart-card .card-header h6 i,
.meritio-workspace .analytics-dashboard-charts .card-header h6 i {
  font-size: 0.85rem !important;
  color: #2563eb !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  background: #eff6ff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.meritio-workspace .analytics-chart-card .card-header .bi-info-circle {
  background: transparent !important;
  width: auto !important;
  height: auto !important;
  color: #94a3b8 !important;
  font-size: 0.8rem !important;
}

/* Chart breakdown selector in header */
.meritio-workspace .analytics-chart-card .card-header .form-select,
.meritio-workspace .analytics-dashboard-charts .card-header .form-select,
.meritio-workspace .analytics-dashboard-charts .card-header select {
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  background: #f8fafc !important;
  padding: 0.3rem 1.8rem 0.3rem 0.7rem !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236366f1' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  margin-left: 0 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  cursor: pointer !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.meritio-workspace .analytics-chart-card .card-header .form-select:hover,
.meritio-workspace .analytics-dashboard-charts .card-header .form-select:hover,
.meritio-workspace .analytics-dashboard-charts .card-header select:hover {
  border-color: #cbd5e1 !important;
  background-color: #ffffff !important;
}
.meritio-workspace .analytics-chart-card .card-header .form-select:focus,
.meritio-workspace .analytics-dashboard-charts .card-header .form-select:focus,
.meritio-workspace .analytics-dashboard-charts .card-header select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  outline: none !important;
}
.meritio-workspace .analytics-chart-card .card-header .form-select option,
.meritio-workspace .analytics-dashboard-charts .card-header .form-select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

/* Chart body */
.meritio-workspace .analytics-chart-card .card-body,
.meritio-workspace .analytics-dashboard-charts .card-body {
  padding: 1.25rem 1.1rem 1.1rem !important;
  background: #ffffff !important;
}

/* ── Summary table — unified dark slate header, polished rows ───── */
.meritio-workspace .analytics-summary-wrap {
  border: 1px solid #e4e8ed !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  background: #ffffff !important;
}
.meritio-workspace .analytics-summary-wrap .summary-table-responsive {
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #ffffff !important;
}

.meritio-workspace #analytics-summary-table {
  font-size: 0.82rem !important;
  background: #ffffff !important;
}

/* Group header (Headcount / Merit Budget / etc.) */
.meritio-workspace #analytics-summary-table thead tr.summary-group-header th {
  background: #1e293b !important;
  color: #94a3b8 !important;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  padding: 0.6rem 0.75rem !important;
  border: none !important;
  border-right: 1px solid #334155 !important;
  text-align: center !important;
}
.meritio-workspace #analytics-summary-table thead tr.summary-group-header th:last-child {
  border-right: none !important;
}

/* Column header row (Total Employees / Merit Budget / etc.) */
.meritio-workspace #analytics-summary-table thead tr.summary-table-header {
  background: #0f172a !important;
  border-bottom: none !important;
}
.meritio-workspace #analytics-summary-table thead tr.summary-table-header th {
  background: #0f172a !important;
  background-image: none !important;
  color: #e2e8f0 !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 0.65rem 0.75rem !important;
  border: none !important;
  border-right: 1px solid #1e293b !important;
  border-bottom: none !important;
  box-shadow: none !important;
  white-space: normal !important;
  line-height: 1.25 !important;
  vertical-align: middle !important;
  text-align: right !important;
}
.meritio-workspace #analytics-summary-table thead tr.summary-table-header th:last-child { border-right: none !important; }
.meritio-workspace #analytics-summary-table thead tr.summary-table-header th.summary-col-country,
.meritio-workspace #analytics-summary-table thead tr.summary-group-header th.summary-col-country,
.meritio-workspace #analytics-summary-table thead th[rowspan] {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  text-align: left !important;
  box-shadow: 2px 0 0 rgba(0,0,0,0.15) !important;
}

/* Body rows */
.meritio-workspace #analytics-summary-table tbody tr.summary-table-row {
  background: #ffffff !important;
  transition: background-color 0.15s ease !important;
}
.meritio-workspace #analytics-summary-table tbody tr.summary-table-row:nth-child(even):not(.summary-table-global) {
  background: #fafbfc !important;
}
.meritio-workspace #analytics-summary-table tbody tr.summary-table-row:hover {
  background: #eff6ff !important;
}
.meritio-workspace #analytics-summary-table tbody td {
  padding: 0.65rem 0.75rem !important;
  border: none !important;
  border-bottom: 1px solid #eef1f5 !important;
  border-right: 1px solid #f1f5f9 !important;
  color: #334155 !important;
  font-size: 0.8rem !important;
  vertical-align: middle !important;
}
.meritio-workspace #analytics-summary-table tbody td:last-child { border-right: none !important; }
.meritio-workspace #analytics-summary-table tbody tr:last-child td { border-bottom: none !important; }

.meritio-workspace #analytics-summary-table .summary-cell-country {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  text-align: left !important;
  box-shadow: 2px 0 0 rgba(226, 232, 240, 0.6) !important;
}
.meritio-workspace #analytics-summary-table tbody tr.summary-table-row:nth-child(even):not(.summary-table-global) .summary-cell-country {
  background: #fafbfc !important;
}
.meritio-workspace #analytics-summary-table tbody tr.summary-table-row:hover .summary-cell-country {
  background: #eff6ff !important;
}
.meritio-workspace #analytics-summary-table .summary-cell-number,
.meritio-workspace #analytics-summary-table .summary-cell-currency,
.meritio-workspace #analytics-summary-table .summary-cell-percentage {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
}
.meritio-workspace #analytics-summary-table .summary-cell-currency { font-weight: 600 !important; color: #0f172a !important; }
.meritio-workspace #analytics-summary-table .summary-cell-number   { color: #334155 !important; }

/* Global row — subtle highlight strip, not neon blue */
.meritio-workspace #analytics-summary-table tbody tr.summary-table-global,
.meritio-workspace #analytics-summary-table tbody tr.summary-table-global td {
  background: linear-gradient(90deg, #f0f5ff 0%, #eef2ff 100%) !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  border-top: 2px solid #6366f1 !important;
  border-bottom: 1px solid #c7d2fe !important;
}
.meritio-workspace #analytics-summary-table tbody tr.summary-table-global:hover,
.meritio-workspace #analytics-summary-table tbody tr.summary-table-global:hover td {
  background: linear-gradient(90deg, #e0e7ff 0%, #dbeafe 100%) !important;
}
.meritio-workspace #analytics-summary-table .summary-table-global .summary-cell-country {
  background: linear-gradient(90deg, #f0f5ff 0%, #eef2ff 100%) !important;
  color: #0f172a !important;
}

/* ── Manager Discretion Overrides table — unified look ──────────── */
.meritio-workspace #manager-overrides-table {
  border: 1px solid #e4e8ed !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  margin-bottom: 0 !important;
  background: #ffffff !important;
}
.meritio-workspace #manager-overrides-table thead tr,
.meritio-workspace #manager-overrides-table thead.table-light tr {
  background: transparent !important;
}
.meritio-workspace #manager-overrides-table thead th {
  background: #0f172a !important;
  background-image: none !important;
  color: #e2e8f0 !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  padding: 0.75rem 0.9rem !important;
  border: none !important;
  border-right: 1px solid #1e293b !important;
  box-shadow: none !important;
  white-space: normal !important;
  line-height: 1.3 !important;
  vertical-align: middle !important;
}
.meritio-workspace #manager-overrides-table thead th:last-child { border-right: none !important; }
.meritio-workspace #manager-overrides-table tbody td {
  padding: 0.7rem 0.9rem !important;
  font-size: 0.82rem !important;
  color: #334155 !important;
  border: none !important;
  border-bottom: 1px solid #eef1f5 !important;
  border-right: 1px solid #f1f5f9 !important;
  vertical-align: middle !important;
  font-variant-numeric: tabular-nums !important;
}
.meritio-workspace #manager-overrides-table tbody td:last-child { border-right: none !important; }
.meritio-workspace #manager-overrides-table tbody tr:last-child td { border-bottom: none !important; }
.meritio-workspace #manager-overrides-table tbody tr:nth-child(even) td { background: #fafbfc !important; }
.meritio-workspace #manager-overrides-table tbody tr:hover td { background: #eff6ff !important; }
.meritio-workspace #manager-overrides-table tbody td:first-child { font-weight: 700 !important; color: #0f172a !important; }

/* Wrap manager overrides in a framed container to match aesthetic */
.meritio-workspace #analytics-dashboard-section .table-responsive:has(#manager-overrides-table) {
  border: 1px solid #e4e8ed;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  background: #ffffff;
}

/* Kill the old analytics-dashboard-charts Bootstrap card shadow to avoid double-frame */
.meritio-workspace .analytics-dashboard-charts .card {
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  border: 1px solid #e4e8ed !important;
  margin-bottom: 0 !important;
}

/* Export button in analytics header */
.meritio-workspace #analytics-dashboard-section #button-export-analytics {
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  padding: 0.4rem 0.9rem !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  transition: all 0.15s ease !important;
}
.meritio-workspace #analytics-dashboard-section #button-export-analytics:hover {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
}
.meritio-workspace #analytics-dashboard-section #button-export-analytics i {
  color: #6366f1 !important;
}

/* AI-assisted Excel mapping UI */
.ai-map-low-confidence {
  background: rgba(234, 88, 12, 0.12);
}

#ai-mapping-table td,
#ai-mapping-table th {
  vertical-align: middle;
}

#ai-mapping-alerts .alert {
  margin-bottom: 0.5rem;
}

.ai-confidence-legend {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ai-mapping-summary {
  font-weight: 500;
}
