.idock {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  height: 50px;
  padding: var(--space-1) var(--space-2);
  background: #ffffff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
}

.idock-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary, #0078d4) 14%, #fff);
  pointer-events: none !important;
  opacity: 0;
}

.idock-unit {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
}

.idock-item {
  position: relative;
}

.idock-btn {
  all: unset;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 36px;
  height: var(--control-height);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--slate-500);
  cursor: pointer;
  transition: color var(--duration-base) ease-out, padding var(--duration-base) ease-out, gap var(--duration-base) ease-out;
}

.idock-btn.is-active {
  gap: var(--space-2);
  padding: 0 var(--space-3);
  background: transparent;
  color: var(--primary, #0078d4);
}

.idock-btn:not(.is-active):hover {
  color: var(--primary, #0078d4);
}

.idock-ico {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: currentColor;
  transform: scale(1);
  transition: transform var(--duration-base) ease-out, color var(--duration-base) ease-out;
}

.idock-btn:hover .idock-ico {
  transform: none;
}

.idock-label {
  max-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: var(--text-md);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transition: max-width var(--duration-base) ease-out, opacity var(--duration-base) ease-out, margin var(--duration-base) ease-out;
}

.idock-btn.is-active .idock-label {
  max-width: 140px;
  margin-left: 0;
  opacity: 1;
  font-weight: 600;
}

.idock-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}

.idock-split {
  width: 1px;
  height: 20px;
  margin: 0 var(--space-2);
  background: var(--slate-200);
  flex-shrink: 0;
}

.idock-tip {
  pointer-events: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 20;
  width: max-content;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--slate-700);
  font-size: var(--text-sm);
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--slate-200);
  opacity: 0;
  transform: translateX(-50%) scale(0.96);
  transition: opacity var(--duration-base) ease, transform var(--duration-base) ease;
}

.idock-item:hover .idock-tip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.idock-btn.is-active + .idock-tip,
.idock-item:has(.idock-btn.is-active) .idock-tip {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .idock-btn,
  .idock-ico,
  .idock-label,
  .idock-tip {
    transition: none;
  }
}
/* New HRMS module preview — HR / RM / Company Admin */
.hm-shell {
  --hm-blue: var(--primary);
  --hm-green: var(--primary);
  --hm-amber: var(--primary);
  --hm-teal: var(--primary);
  --hm-pink: var(--primary);
  --hm-purple: var(--primary);
  --hm-orange: var(--primary);
  --hm-slate: var(--slate-500);
  --hm-border: var(--slate-200);
  --hm-line: var(--slate-150);
  --hm-muted: var(--slate-500);
  --hm-text: var(--slate-900);
  --hm-surface: #ffffff;
  --hm-bg: var(--app-bg, #f9fafb);
  /* Shared card radius ("md") for every panel/tile surface. */
  --hm-radius-card: 8px;
  --hm-accent: var(--primary, #059669);
  padding: 0 var(--space-5) var(--space-6);
  color: var(--hm-text);
  background: var(--hm-bg);
  overflow: visible;
  -webkit-font-smoothing: antialiased;
}

.hm-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin: 0;
  padding: var(--space-3) 0 var(--space-4);
  background: transparent;
}

.hm-kicker {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--hm-accent);
}

.hm-top h1 {
  margin: 0;
  font-size: var(--text-page-title);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--slate-900);
}

.hm-top .muted {
  margin: 0;
  max-width: 52ch;
  color: var(--hm-muted);
  font-size: var(--text-base);
  font-weight: 400;
}

/* Orb row — white, thin horizontal lines top + bottom (like Project Details) */
.hm-orbs-bar {
  /* Full-bleed lines within shell; icons keep side inset via shell padding */
  margin: 0 -20px;
  padding: var(--space-3) var(--space-5) var(--space-3);
  overflow: visible;
  background: #ffffff;
  border-top: 1px solid var(--hm-line);
  border-bottom: 1px solid var(--hm-line);
}

.hm-orbs {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-1);
  flex-wrap: wrap;
  overflow: visible;
}

.hm-orb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px var(--space-1);
  border-radius: 0;
  position: relative;
  min-width: 62px;
  font-family: inherit;
}

.hm-orb-ring {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  border: 0;
  box-shadow: inset 0 0 0 1.5px var(--hm-tone, var(--hm-accent));
  background: #fff;
  display: grid;
  place-items: center;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  color: var(--hm-tone, var(--hm-accent));
}

.hm-orb-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--slate-500);
  text-align: center;
  line-height: 1.2;
  max-width: 78px;
  letter-spacing: 0;
}

.hm-orb-ring svg {
  width: 18px;
  height: 18px;
  color: inherit;
}

.hm-orb:hover .hm-orb-ring {
  background: color-mix(in srgb, var(--hm-tone, var(--hm-accent)) 10%, #fff);
}

.hm-orb.is-active .hm-orb-ring {
  background: var(--hm-tone, var(--hm-accent));
  color: #fff;
  box-shadow: inset 0 0 0 1.5px var(--hm-tone, var(--hm-accent));
}

.hm-orb.is-active .hm-orb-label {
  color: var(--hm-tone, var(--hm-accent));
  font-weight: 600;
}

.hm-orb-dot {
  position: absolute;
  top: 2px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid #fff;
}

.hm-orb--green { --hm-tone: var(--success); }
.hm-orb--teal { --hm-tone: var(--primary); }
.hm-orb--blue { --hm-tone: var(--primary); }
.hm-orb--amber { --hm-tone: var(--warning); }
.hm-orb--pink { --hm-tone: var(--primary); }
.hm-orb--purple { --hm-tone: var(--primary); }
.hm-orb--orange { --hm-tone: var(--warning); }
.hm-orb--slate { --hm-tone: var(--slate-500); }
.hm-orb--cyan { --hm-tone: var(--primary); }
.hm-orb--fuchsia { --hm-tone: var(--primary); }
.hm-orb--rose { --hm-tone: var(--danger); }

.hm-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) 0 0;
  background: transparent;
  overflow: visible;
}

@keyframes hm-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hm-tab-stage {
  min-width: 0;
  overflow: visible;
}

.hm-tab-panel {
  animation: hm-panel-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: visible;
}

.hm-shell > .hm-tab-stage,
.pm-analytics-hub-panel.hm-tab-stage {
  overflow: visible;
}

@media (prefers-reduced-motion: reduce) {
  .hm-tab-panel,
  .hm-reports-swap,
  .hm-perf-swap {
    animation: none;
  }

  .hm-perf-ring-fill,
  .hm-perf-dist-bar span {
    transition: none;
  }
}

.hm-overview {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--hm-line);
}

.hm-ov-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: 2px;
  overflow: visible;
  width: 100%;
}

.hm-hrms-dock {
  position: relative;
  z-index: 50;
  padding: var(--space-2) var(--space-5) var(--space-2);
  background: var(--app-bg, #f9fafb);
}

.hm-hrms-dock .idock {
  flex-wrap: wrap;
  height: auto;
  min-height: 50px;
}

.hm-ov-tab {
  border: 1px solid var(--hm-border);
  background: #fff;
  color: var(--slate-600);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  cursor: pointer;
}

.hm-ov-tab:hover {
  border-color: color-mix(in srgb, var(--hm-blue) 35%, var(--hm-border));
  color: var(--slate-900);
}

.hm-ov-tab.is-active {
  background: color-mix(in srgb, var(--hm-accent) 12%, #fff);
  border-color: color-mix(in srgb, var(--hm-accent) 40%, var(--hm-border));
  color: var(--hm-accent);
}

.hm-ov-report-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
}

.hm-ov-report-title h2 {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.hm-ov-report .hm-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hm-ov-report .hm-emp-actions {
  white-space: nowrap;
}

.hm-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0 auto;
  padding: var(--space-1);
  border: 0;
  background: none;
  color: var(--slate-500);
  cursor: pointer;
}

.hm-back-link svg {
  flex-shrink: 0;
  color: currentColor;
  transform: translateX(0);
  transition: transform var(--duration-base) ease-out, color var(--duration-base) ease-out;
}

.hm-back-link:hover {
  color: var(--primary, #0078d4);
}

.hm-back-link:hover svg {
  transform: translateX(-4px);
}

.hm-card--clickable {
  cursor: pointer;
}

.hm-card--clickable:hover {
  border-color: color-mix(in srgb, var(--hm-blue) 35%, var(--hm-border));
}

.hm-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.hm-stat-row--compact {
  margin-bottom: var(--space-4);
}

.hm-stat-row--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.hm-overview-kpis,
.hm-overview > .hm-stat-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-4);
}

.hm-att-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-4);
}

/* Overview KPI cards — solid fill, circular icon, centered text */
.hm-kpi {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--slate-400);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  text-align: center;
  font: inherit;
  color: #ffffff;
  width: 100%;
  transform: scale(1);
  transition: transform var(--duration-base) ease-out, box-shadow var(--duration-base) ease-out, filter var(--duration-base) ease-out;
}

.hm-kpi.is-clickable {
  cursor: pointer;
}

.hm-kpi:hover {
  transform: none;
  filter: brightness(1.04);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.12), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.hm-kpi.is-active {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1),
    inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.hm-kpi-ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #ffffff;
}

.hm-kpi-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}

.hm-kpi--orange {
  background: var(--primary);
}
.hm-kpi--orange .hm-kpi-ico {
  color: var(--primary);
}

.hm-kpi--blue {
  background: var(--primary);
}
.hm-kpi--blue .hm-kpi-ico {
  color: var(--primary);
}

.hm-kpi--green {
  background: var(--primary);
}
.hm-kpi--green .hm-kpi-ico {
  color: var(--primary);
}

.hm-kpi--rose {
  background: var(--primary);
}
.hm-kpi--rose .hm-kpi-ico {
  color: var(--primary);
}

.hm-kpi--red {
  background: var(--primary);
}
.hm-kpi--red .hm-kpi-ico {
  color: var(--primary);
}

.hm-kpi--purple {
  background: var(--primary);
}
.hm-kpi--purple .hm-kpi-ico {
  color: var(--primary);
}

.hm-kpi--violet {
  background: var(--primary);
}
.hm-kpi--violet .hm-kpi-ico {
  color: var(--primary);
}

.hm-kpi--slate {
  background: var(--slate-500);
}
.hm-kpi--slate .hm-kpi-ico {
  color: var(--slate-700);
}

.hm-kpi--amber {
  background: var(--primary);
}
.hm-kpi--amber .hm-kpi-ico {
  color: var(--primary);
}

.hm-kpi--teal {
  background: var(--primary);
}
.hm-kpi--teal .hm-kpi-ico {
  color: var(--primary);
}

.hm-kpi-value {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #ffffff;
}

.hm-kpi-label {
  margin-top: 2px;
  font-size: var(--text-sm);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.88);
}

.hm-stat {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.hm-stat--blue { border-top: 3px solid var(--hm-blue); }
.hm-stat--green { border-top: 3px solid var(--hm-green); }
.hm-stat--amber { border-top: 3px solid var(--hm-amber); }
.hm-stat--teal { border-top: 3px solid var(--hm-teal); }
.hm-stat--pink { border-top: 3px solid var(--hm-pink); }

.hm-stat-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--hm-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hm-stat-value {
  margin-top: var(--space-2);
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hm-stat-hint {
  margin-top: var(--space-1);
  font-size: var(--text-md);
  color: var(--hm-muted);
}

.hm-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.35fr 1.05fr;
  gap: var(--space-4);
}

.hm-card {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  min-height: 240px;
}

.hm-card--wide { min-height: 260px; }
.hm-card--full { min-height: 0; }

.hm-card-head,
.hm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.hm-card-head h2,
.hm-panel-head h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--slate-900);
}

.hm-panel-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hm-view-all {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--primary, #0078d4);
  cursor: pointer;
}

.hm-view-all:hover {
  text-decoration: underline;
}

.hm-att-inbox {
  padding: var(--space-5) var(--space-5) var(--space-5);
  min-height: 0;
  border-radius: var(--hm-radius-card, var(--radius-md));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}

.hm-att-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0 auto;
  padding: var(--space-1);
  border: 0;
  background: none;
  color: var(--slate-500);
  cursor: pointer;
}

.hm-att-back svg {
  flex-shrink: 0;
  color: currentColor;
  transform: translateX(0);
  transition: transform var(--duration-base) ease-out, color var(--duration-base) ease-out;
}

.hm-att-back:hover {
  color: var(--slate-900);
}

.hm-att-back:hover svg {
  transform: translateX(-4px);
}

.hm-att-inbox-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.hm-att-inbox-title h2 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}

.hm-open-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary, #0078d4) 14%, #fff);
  color: var(--primary, #0078d4);
  font-size: var(--text-sm);
  font-weight: 500;
}

.hm-att-table th:nth-child(2),
.hm-att-table th:nth-child(3),
.hm-att-table th:nth-child(4),
.hm-att-table td:nth-child(2),
.hm-att-table td:nth-child(3),
.hm-att-table td:nth-child(4) {
  text-align: right;
}

.hm-att-item {
  font-weight: 500;
  color: var(--slate-900);
}

.hm-att-table tr.is-clear .hm-att-item {
  font-weight: 500;
  color: var(--slate-500);
}

.hm-att-pending {
  font-weight: 500;
  color: var(--slate-900);
}

.hm-att-table tr.is-clear .hm-att-pending {
  font-weight: 500;
  color: var(--slate-500);
}

.hm-att-oldest {
  font-weight: 500;
  color: var(--warning-strong);
}

.hm-att-table tr.is-clear .hm-att-oldest {
  font-weight: 500;
  color: var(--slate-500);
}

.hm-att-review,
.hm-att-clear {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
}

.hm-att-review {
  color: var(--primary, #0078d4);
}

.hm-att-review:hover {
  text-decoration: underline;
}

.hm-att-clear {
  color: var(--slate-500);
  cursor: default;
}

.hm-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-3);
  border-radius: 999px;
  background: color-mix(in srgb, var(--hm-accent) 12%, #fff);
  color: var(--hm-accent);
  font-size: var(--text-sm);
  font-weight: 500;
}

.hm-list-card {
  padding: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--hm-radius-card, var(--radius-md));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}

.hm-list-card .hm-card-head {
  margin: 0;
  padding: var(--space-4) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--slate-100);
}

.hm-list-card .hm-card-head h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--slate-900);
}

.hm-list-card .hm-view-all {
  color: var(--slate-500);
  font-size: var(--text-base);
  font-weight: 500;
}

.hm-list-card .hm-view-all:hover {
  color: var(--slate-500);
  text-decoration: none;
}

.hm-list-body {
  display: flex;
  flex-direction: column;
}

.hm-list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  margin: 0;
  padding: var(--space-3) var(--space-5);
  border: 0;
  border-bottom: 1px solid var(--slate-100);
  border-radius: 0;
  background: #ffffff;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.hm-list-row:last-child {
  border-bottom: 0;
}

.hm-list-row:hover {
  background: var(--slate-50);
}

.hm-list-row.is-active {
  background: var(--slate-50);
}

.hm-list-ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: transparent;
  color: var(--slate-500);
  transform: scale(1);
  transition: transform var(--duration-base) ease-out;
}

.hm-list-row:hover .hm-list-ico {
  transform: none;
}

.hm-list-ico--orange { color: var(--warning-strong); }
.hm-list-ico--amber { color: var(--warning-strong); }
.hm-list-ico--blue { color: var(--primary); }
.hm-list-ico--rose { color: var(--danger-strong); }
.hm-list-ico--purple { color: var(--primary); }
.hm-list-ico--violet { color: var(--primary); }
.hm-list-ico--slate { color: var(--slate-500); }

.hm-list-row.is-empty .hm-list-ico {
  opacity: 0.55;
}

.hm-list-label {
  flex: 1;
  min-width: 0;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-900);
}

.hm-list-row.is-empty .hm-list-label {
  color: var(--slate-500);
  font-weight: 400;
}

.hm-list-count {
  min-width: 1.5rem;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-500);
  text-align: center;
}

.hm-list-count.is-hot {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary, #0078d4) 12%, #fff);
  color: var(--primary, #0078d4);
  font-weight: 600;
}

.hm-row-ico {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hm-row-ico--orange {
  background: var(--accent-soft);
  color: var(--primary);
}
.hm-row-ico--amber {
  background: var(--accent-muted);
  color: var(--primary);
}
.hm-row-ico--blue {
  background: var(--accent-soft);
  color: var(--primary);
}
.hm-row-ico--rose {
  background: var(--accent-soft);
  color: var(--primary);
}
.hm-row-ico--purple {
  background: var(--accent-soft);
  color: var(--primary);
}
.hm-row-ico--violet {
  background: var(--accent-soft);
  color: var(--primary);
}
.hm-row-ico--slate {
  background: var(--slate-100);
  color: var(--slate-500);
}

.hm-donut-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  flex-wrap: wrap;
  padding: var(--space-5) var(--space-5) var(--space-5);
}

.hm-dept-card {
  cursor: pointer;
}

.hm-dept-empty {
  padding: var(--space-5) var(--space-5) var(--space-5);
}

.hm-donut {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hm-donut-hole {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hm-donut-hole strong {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--slate-900);
}

.hm-donut-hole span {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--slate-500);
  margin-top: var(--space-1);
}

.hm-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 180px;
}

.hm-donut-legend li {
  display: grid;
  grid-template-columns: 8px 1fr auto auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--slate-100);
  font-size: var(--text-base);
}

.hm-donut-legend li:first-child {
  padding-top: 0;
}

.hm-donut-legend li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.hm-donut-legend-btn {
  display: contents;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.hm-donut-legend-btn .hm-leg-name {
  color: inherit;
}

.hm-donut-legend li:has(.hm-donut-legend-btn):hover .hm-leg-name {
  color: var(--primary, #0f766e);
}

.hm-row-click {
  cursor: pointer;
}

.hm-row-click:hover td {
  background: var(--slate-50);
}

.hm-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-xs);
}

.hm-leg-name {
  color: var(--slate-900);
  font-weight: 500;
}

.hm-leg-count {
  color: var(--slate-700);
  font-weight: 600;
  min-width: 1.5rem;
  text-align: right;
}

.hm-leg-pct {
  color: var(--slate-500);
  font-weight: 500;
  min-width: 2.25rem;
  text-align: right;
}

.hm-upcoming,
.hm-simple-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hm-upcoming li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.hm-upcoming strong,
.hm-simple-list li {
  display: block;
  font-size: var(--text-base);
}

.hm-upcoming .muted {
  font-size: var(--text-sm);
}

.hm-up-ico {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--hm-blue) 10%, #fff);
  color: var(--hm-blue);
  flex-shrink: 0;
}

.hm-subhead {
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg);
}

.hm-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.hm-table-wrap {
  height: 420px;
  overflow: auto;
  border: 1px solid var(--slate-150);
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: #ffffff;
}

.hm-table-wrap--soft {
  height: auto;
  max-height: 280px;
  border: 0;
  border-radius: 0;
}

.hm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-md);
  line-height: var(--leading-table);
}

.hm-table th,
.hm-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  white-space: nowrap;
}

.hm-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--space-2) var(--space-4);
  background: var(--slate-50);
  color: var(--slate-500);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--slate-150);
}

.hm-table td {
  border-bottom: 1px solid var(--slate-100);
  background: #ffffff;
  color: var(--slate-900);
}

.hm-table tbody tr:last-child td {
  border-bottom: 0;
}

.hm-table tbody tr:hover td {
  background: var(--slate-50);
}

.hm-title-cell {
  font-weight: 400;
  white-space: normal !important;
}

.hm-pill {
  display: inline-flex;
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 500;
}

.hm-pill--green { background: var(--success-soft); color: var(--success-strong); }
.hm-pill--amber { background: var(--warning-muted); color: var(--warning-strong); }
.hm-pill--red { background: var(--danger-soft); color: var(--danger-strong); }
.hm-pill--slate { background: var(--slate-100); color: var(--slate-600); }
.hm-pill--blue { background: var(--accent-soft); color: var(--primary); }
.hm-pill--teal { background: var(--accent-muted); color: var(--primary-darker); }

.hm-name-link {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

button.hm-name-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hm-name-link:hover {
  color: var(--hm-accent, #059669);
  text-decoration: underline;
}

.hm-table tfoot td {
  background: var(--slate-50);
  color: var(--slate-500);
  font-size: var(--text-md);
  font-weight: 500;
  border-top: 1px solid var(--slate-150);
  border-bottom: 0;
}

.hm-table .sortable-th:hover {
  background: var(--slate-100);
  color: var(--slate-500);
}

.hm-table .sortable-th.sorted {
  color: var(--hm-accent, #059669);
}

.hm-reports {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
}

.hm-reports .hm-emp-head {
  margin: 0;
  padding: 0;
}

.hm-reports .hm-emp-title h2 {
  margin: 0;
}

.hm-reports-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-4);
  border-right: 1px solid var(--slate-100);
  background: #ffffff;
}

.hm-reports-kicker {
  margin: 0 var(--space-3) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.hm-reports-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  width: 100%;
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background var(--duration-base) ease-out;
}

.hm-reports-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary, #0078d4);
  opacity: 0;
  transform: scaleY(0.7);
  transform-origin: center;
  transition: opacity var(--duration-base) ease-out, transform var(--duration-base) ease-out;
}

.hm-reports-item strong {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-900);
}

.hm-reports-item span {
  font-size: var(--text-md);
  font-weight: 400;
  line-height: 1.35;
  color: var(--slate-500);
}

.hm-reports-item:hover {
  background: var(--slate-50);
}

.hm-reports-item.is-active {
  background: var(--slate-100);
}

.hm-reports-item.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}

.hm-reports-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
  min-width: 0;
  width: 100%;
}

.hm-reports-swap {
  animation: hm-panel-in 0.32s ease-out;
}

.hm-reports-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.hm-reports-head h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}

.hm-reports-head p {
  margin: 0;
  max-width: 46ch;
  font-size: var(--text-base);
  line-height: 1.45;
  color: var(--slate-500);
}

.hm-reports-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.hm-reports-chip,
.hm-reports-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: 0;
  border: 1px solid var(--slate-200);
  background: #ffffff;
  color: var(--slate-600);
  font: inherit;
  cursor: pointer;
}

.hm-reports-chip {
  height: 36px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  font-size: var(--text-base);
  font-weight: 500;
}

.hm-reports-icon-btn {
  width: 36px;
  height: var(--control-height);
  padding: 0;
  border-radius: var(--radius-md);
}

.hm-reports-chip:hover,
.hm-reports-icon-btn:hover {
  border-color: var(--slate-300);
  background: var(--slate-50);
}

.hm-reports-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.hm-reports-metric {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: var(--slate-100);
}

.hm-reports-metric span {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.hm-reports-metric strong {
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--slate-900);
}

.hm-reports-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 180px;
  border: 1.5px dashed var(--slate-200);
  border-radius: var(--hm-radius-card, var(--radius-md));
  color: var(--slate-500);
}

.hm-reports-grid-mark {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius-xs);
}

.hm-reports-grid p {
  margin: 0;
  font-size: var(--text-base);
}

.hm-reports-body {
  min-width: 0;
  width: 100%;
  flex: 1;
}

.hm-reports .hm-emp-head + .hm-reports-body,
.hm-reports .hm-emp-head + .hm-reports-swap {
  margin-top: 0;
}

.hm-shell .hm-reports-body .panel {
  margin-top: 0;
}

.hm-reports-body .panel + .panel,
.hm-reports-body .ra-filters + .panel {
  margin-top: var(--space-4);
}

.hm-reports-body .table-scroll,
.hm-reports-body .leave-consumed-scroll,
.hm-reports-body .att-reg-scroll,
.hm-reports-body .ewh-scroll {
  max-width: 100%;
}

@media (max-width: 700px) {
  .hm-reports-main {
    padding: 0;
  }

  .hm-reports-head {
    flex-direction: column;
  }
}

/* Employees tab */
.hm-emp {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
}

.hm-emp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hm-emp-title {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.hm-emp-title-ico {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary, #0078d4) 12%, #fff);
  color: var(--primary, #0078d4);
  flex-shrink: 0;
}

.hm-emp-title h2 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--slate-900);
}

.hm-emp-title .muted {
  margin: var(--space-1) 0 0;
  font-size: var(--text-md);
  font-weight: 400;
  line-height: 1.45;
  color: var(--slate-500);
}

.hm-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  background: var(--hm-accent, #059669);
  color: #fff;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: filter var(--duration-fast) ease, box-shadow var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.hm-btn-primary:hover {
  filter: brightness(0.96);
  box-shadow: var(--shadow-btn-hover);
}

.hm-btn-primary:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-btn-active);
}

.hm-btn-primary:disabled {
  box-shadow: none;
}

.hm-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--hm-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  background: #fff;
  color: var(--slate-700);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.hm-btn-ghost:hover {
  border-color: color-mix(in srgb, var(--hm-blue) 30%, var(--hm-border));
  box-shadow: var(--shadow-btn-hover);
}

.hm-btn-ghost:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-btn-active);
}

.hm-btn-ghost:disabled {
  box-shadow: none;
}

.hm-emp-sections {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--hm-line);
}

.hm-emp-section-tab {
  border: 0;
  background: none;
  padding: var(--space-3) var(--space-4);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.hm-emp-section-tab:hover {
  color: var(--slate-900);
}

.hm-emp-section-tab.is-active {
  color: var(--hm-accent, #059669);
  border-bottom-color: var(--hm-accent, #059669);
}

.hm-emp-panel {
  min-height: 0;
}

.hm-emp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-3);
}

.hm-emp-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: min(240px, 100%);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--hm-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--hm-muted);
}

.hm-emp-search input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  color: var(--hm-text);
}

.hm-emp-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--hm-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-7) var(--space-2) var(--space-3);
  background: #fff;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-700);
}

.hm-emp-select span {
  color: var(--hm-muted);
  font-weight: 500;
}

.hm-emp-select select {
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-weight: 500;
  color: inherit;
  appearance: none;
  padding-right: var(--space-1);
  cursor: pointer;
}

.hm-emp-select-caret {
  position: absolute;
  right: 10px;
  color: var(--slate-500);
  pointer-events: none;
}

.hm-emp-filters {
  gap: var(--space-4);
  overflow: visible;
  position: relative;
  z-index: 6;
}

.hm-emp-filters-end {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
  flex-shrink: 0;
}

.hm-emp-filters .erp-search {
  flex: 0 1 320px;
  align-self: stretch;
}

.hm-emp-filters .hm-emp-select {
  border: 0;
  background: none;
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-700);
  gap: var(--space-1);
  cursor: pointer;
}

.hm-emp-filters .hm-emp-select span {
  color: inherit;
  font-weight: 500;
}

.hm-emp-filters .hm-emp-select select {
  font-size: var(--text-base);
  font-weight: 500;
  color: inherit;
  padding-right: 0;
}

.hm-emp-filters .hm-emp-select:hover,
.hm-emp-filters .hm-emp-select:focus-within {
  color: var(--primary, #0078d4);
}

.hm-emp-filters .hm-emp-select-caret {
  position: static;
  color: currentColor;
}

.hm-emp-report-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--slate-900);
}

.hm-emp-actions {
  position: relative;
}

.hm-icon-btn {
  border: 0;
  background: none;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  color: var(--slate-500);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.hm-icon-btn:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.hm-emp-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 5;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--hm-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  padding: var(--space-1);
  display: flex;
  flex-direction: column;
}

.hm-emp-menu button {
  border: 0;
  background: none;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--text-base);
  cursor: pointer;
  color: var(--slate-900);
}

.hm-emp-menu button:hover {
  background: var(--slate-50);
}

/* Attendance tab */
.hm-att {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
}

.hm-emp-title-ico--blue {
  background: color-mix(in srgb, var(--primary, #0078d4) 12%, #fff);
  color: var(--primary, #0078d4);
}

.hm-date-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--hm-border);
  border-radius: 999px;
  padding: var(--space-2) var(--space-4);
  background: #fff;
  color: var(--slate-700);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
}

.hm-date-chip:hover {
  border-color: color-mix(in srgb, var(--hm-blue) 35%, var(--hm-border));
}

label.hm-date-chip {
  cursor: default;
}

.hm-date-chip input {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  min-width: 7.5rem;
  font: inherit;
  font-weight: 500;
  color: var(--slate-900);
  outline: none;
}

.hm-date-chip input[type="number"] {
  min-width: 4.5rem;
  width: 4.5rem;
}

.hm-date-range {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 34px;
  padding: 0 var(--space-3) 0 var(--space-3);
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  background: #fff;
  color: var(--slate-500);
  white-space: nowrap;
}

.hm-date-range-cal {
  flex-shrink: 0;
  color: var(--slate-500);
}

.hm-date-range-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.hm-date-range-field span {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--slate-500);
}

.hm-date-range-field strong {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--slate-900);
  font-variant-numeric: tabular-nums;
}

.hm-date-range-field input[type="date"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

/* Let the whole field act as one click target (no segment / icon hit zones). */
.hm-date-range-field input[type="date"]::-webkit-datetime-edit,
.hm-date-range-field input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.hm-date-range-sep {
  display: inline-flex;
  align-items: center;
  color: var(--slate-500);
}

.hm-table-wrap--report {
  height: auto;
  max-height: min(70vh, 640px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hm-table-wrap--report .hm-table {
  min-width: 640px;
}

.hm-detail-table {
  max-height: none;
}

.hm-detail-table .hm-table {
  min-width: 0;
}

.hm-detail-table .hm-table td:first-child {
  width: 34%;
  color: var(--slate-500);
  font-weight: 500;
}

.hm-detail-table .hm-table td:last-child {
  white-space: normal;
  word-break: break-word;
}

.hm-applicant-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.hm-applicant-detail .hm-emp-report-label {
  margin: var(--space-1) 0 0;
}

@media (max-width: 720px) {
  .hm-detail-table .hm-table thead {
    display: none;
  }

  .hm-detail-table .hm-table tbody tr {
    display: block;
    padding: var(--space-3) var(--space-4) var(--space-2);
    border-bottom: 1px solid var(--slate-100);
  }

  .hm-detail-table .hm-table tbody tr:last-child {
    border-bottom: 0;
  }

  .hm-detail-table .hm-table td {
    display: block;
    width: 100%;
    padding: 2px 0;
    border-bottom: 0;
    white-space: normal;
  }

  .hm-detail-table .hm-table td:first-child {
    width: 100%;
    font-size: var(--text-xs);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--slate-500);
  }

  .hm-detail-table .hm-table td:last-child {
    padding-bottom: var(--space-2);
  }

  .hm-recruit--360 .hm-emp-head {
    flex-direction: column;
    align-items: stretch;
  }

  .hm-recruit--360 .hm-emp-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hm-recruit--360 .hm-emp-toolbar .btn {
    width: 100%;
    justify-content: center;
  }

  .hm-recruit--360 .hm-leave-form {
    grid-template-columns: 1fr;
  }

  .hm-recruit--360 .hm-leave-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hm-recruit--360 .hm-leave-actions .btn {
    width: 100%;
  }

  .hm-recruit--360 .hm-recruit-interview-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hm-recruit--360 .hm-recruit-interview-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hm-e360 .pd-rail-search-wrap {
    width: 100%;
  }

  .hm-recruit--360 .hm-table .btn.small {
    white-space: nowrap;
  }

  .hm-recruit--360 .hm-table th,
  .hm-recruit--360 .hm-table td {
    padding: var(--space-3) var(--space-3);
  }

  .hm-recruit--360 .hm-e360-orbs,
  .hm-recruit--360 .action-orbs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: var(--space-1);
  }
}

.hm-team-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1;
}

.hm-att-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(280px, 1.35fr) minmax(200px, 0.9fr);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--slate-100);
  border-radius: var(--hm-radius-card, var(--radius-md));
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.hm-att-today,
.hm-att-trend,
.hm-att-quick {
  padding: var(--space-6) var(--space-6) var(--space-5);
}

.hm-att-today,
.hm-att-trend {
  border-right: 1px solid var(--slate-100);
}

.hm-att-today h2,
.hm-att-trend h2,
.hm-att-quick h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--slate-900);
}

.hm-att-today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.hm-att-today-head .hm-view-all {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-500);
}

.hm-att-today-head .hm-view-all:hover {
  color: var(--primary, #0078d4);
  text-decoration: none;
}

.hm-att-stack {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--slate-100);
  margin-bottom: var(--space-4);
}

.hm-att-stack-seg {
  min-width: 3px;
  height: 100%;
}

.hm-att-stack-seg.is-present,
.hm-att-today-row i.is-present,
.hm-att-legend .is-present,
.hm-att-chart-bars .is-present { background: var(--primary-darker); }

.hm-att-stack-seg.is-late,
.hm-att-today-row i.is-late,
.hm-att-legend .is-late,
.hm-att-chart-bars .is-late { background: var(--warning); }

.hm-att-stack-seg.is-on-leave,
.hm-att-today-row i.is-on-leave { background: var(--slate-400); }

.hm-att-stack-seg.is-absent,
.hm-att-today-row i.is-absent,
.hm-att-legend .is-absent,
.hm-att-chart-bars .is-absent { background: var(--danger); }

.hm-att-today-list {
  display: flex;
  flex-direction: column;
}

.hm-att-today-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  margin: 0;
  padding: var(--space-3) 0;
  border: 0;
  border-bottom: 1px solid var(--slate-100);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.hm-att-today-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hm-att-today-row i {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-xs);
}

.hm-att-today-row span {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-700);
}

.hm-att-today-row strong {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-900);
}

.hm-att-today-row em {
  font-style: normal;
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--slate-500);
}

.hm-att-trend h2,
.hm-att-quick h2 {
  margin-bottom: var(--space-4);
}

.hm-att-chart {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: var(--space-2);
  min-height: 168px;
}

.hm-att-chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--slate-500);
  text-align: right;
  padding: var(--space-1) 0 var(--space-6);
}

.hm-att-chart-plot {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--space-2);
}

.hm-att-chart-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
}

.hm-att-chart-bars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-height: 140px;
  padding: var(--space-2) 2px 0;
}

.hm-att-chart-bars span {
  width: 7px;
  border-radius: var(--radius-xs) var(--radius-xs) 1px 1px;
}

.hm-att-chart-bars .is-present {
  min-height: 0;
}

.hm-att-chart-bars .is-late,
.hm-att-chart-bars .is-absent {
  height: 5px;
  min-height: 5px;
  border-radius: 1px;
}

.hm-att-chart-bars .is-off {
  opacity: 0.35;
}

.hm-att-chart-lbl {
  margin: var(--space-2) 0 var(--space-2);
  font-size: var(--text-xs);
  color: var(--slate-500);
  white-space: nowrap;
}

.hm-att-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--slate-500);
}

.hm-att-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-xs);
  margin-right: var(--space-2);
  vertical-align: 1px;
}

.hm-att-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hm-att-actions button {
  display: grid;
  grid-template-columns: 40px 1fr 16px;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-1) var(--space-2) 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  font-weight: 500;
  color: var(--slate-900);
  cursor: pointer;
  text-align: left;
}

.hm-att-actions button:hover {
  background: var(--slate-50);
}

.hm-att-act-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--slate-100);
  color: var(--slate-500);
}

.hm-att-act-label {
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.25;
  color: var(--slate-900);
}

.hm-att-act-chev {
  color: var(--slate-500);
  justify-self: end;
}

.hm-row-ico--green {
  background: var(--accent-soft);
  color: var(--primary);
}

.hm-att-action-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hm-att-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hm-leave {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
}

.hm-pay {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
}

.hm-perf {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
}

.hm-perf-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  width: fit-content;
  max-width: 100%;
  height: 36px;
  padding: var(--space-1);
  overflow-x: auto;
  background: var(--slate-100);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  scrollbar-width: none;
}

.hm-perf-tabs::-webkit-scrollbar {
  display: none;
}

.hm-perf-tabs-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(15, 23, 42, 0.04);
  pointer-events: none !important;
  opacity: 0;
}

.hm-perf-tab {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  margin: 0;
  border: 0;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  color: var(--slate-500);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-base) ease-out;
}

.hm-perf-tab:hover {
  color: var(--slate-900);
}

.hm-perf-tab.is-active {
  font-weight: 600;
  color: var(--slate-900);
}

.hm-perf-swap {
  animation: hm-panel-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hm-masters {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hm-masters .hm-emp-head {
  margin: 0;
  padding: 0;
}

.hm-masters .hm-emp-title h2 {
  margin: 0;
}

.hm-masters .panel {
  margin-top: 0;
}

.hm-masters .panel-header {
  margin-bottom: var(--space-2);
}

.hm-masters .panel-header h2 {
  display: none;
}

.hm-masters .hm-perf-swap {
  animation: none;
}

.hm-perf-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) 1.4fr;
  overflow: hidden;
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: #ffffff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.hm-perf-cycle-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: var(--space-6) var(--space-6) var(--space-5);
  background: var(--slate-900);
}

.hm-perf-kicker {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.hm-perf-cycle-card .hm-perf-kicker {
  color: var(--slate-500);
}

.hm-perf-ring {
  position: relative;
  width: 136px;
  height: 136px;
  margin: var(--space-7) auto var(--space-6);
}

.hm-perf-ring svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hm-perf-ring-track,
.hm-perf-ring-fill {
  fill: none;
  stroke-width: 7;
}

.hm-perf-ring-track {
  stroke: var(--slate-700);
}

.hm-perf-ring-fill {
  stroke: #ffffff;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 68px 68px;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hm-perf-ring-fill.is-empty {
  opacity: 0;
}

.hm-perf-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}

.hm-perf-ring-label strong {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #ffffff;
}

.hm-perf-ring-label span {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-500);
}

.hm-perf-cycle-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.hm-perf-cycle-foot strong {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
  color: #ffffff;
}

.hm-perf-cycle-foot span {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-500);
}

.hm-perf-dist-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--space-7) var(--space-5);
  background: #ffffff;
}

.hm-perf-dist {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.hm-perf-dist-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 28px;
  align-items: center;
  gap: var(--space-4);
}

.hm-perf-dist-label {
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.25;
  color: var(--slate-900);
}

.hm-perf-dist-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--slate-100);
  overflow: hidden;
}

.hm-perf-dist-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--slate-300);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.hm-perf-dist-row--green .hm-perf-dist-bar span { background: var(--success); }
.hm-perf-dist-row--blue .hm-perf-dist-bar span { background: var(--primary); }
.hm-perf-dist-row--amber .hm-perf-dist-bar span { background: var(--warning); }
.hm-perf-dist-row--rose .hm-perf-dist-bar span { background: var(--danger); }

.hm-perf-dist-n {
  font-size: var(--text-base);
  font-weight: 500;
  text-align: right;
  color: var(--slate-500);
}

.hm-perf-dist-note {
  margin: var(--space-6) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--slate-100);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--slate-500);
}

.hm-perf-mine {
  margin-top: var(--space-1);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: var(--slate-50);
}

.hm-leave-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-4);
  max-width: 820px;
}

.hm-leave-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-700);
}

.hm-leave-field--full {
  grid-column: 1 / -1;
}

.hm-leave-field span {
  color: var(--hm-muted);
  font-weight: 500;
}

.hm-leave-field input,
.hm-leave-field select,
.hm-leave-field textarea {
  border: 1px solid var(--hm-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-3);
  font: inherit;
  font-weight: 500;
  color: var(--hm-text);
  background: #fff;
}

.hm-leave-field textarea {
  resize: vertical;
  min-height: 88px;
}

.hm-leave-msg {
  grid-column: 1 / -1;
  margin: 0;
  font-size: var(--text-base);
  font-weight: 500;
}

.hm-leave-msg.is-error {
  color: var(--danger-strong);
}

.hm-leave-msg.is-ok {
  color: var(--success-strong);
}

.hm-leave-form .hm-att-action-row,
.hm-leave-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.hm-leave-actions .btn,
.hm-leave-form .btn {
  min-height: var(--control-height);
  height: var(--control-height);
}

.hm-leave-balance {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--slate-500);
}

.hm-leave-balance strong {
  color: var(--slate-900);
  font-weight: 500;
}

/* ── Apply Leave: compact card form ─────────────────────────────── */
.hm-apply-leave {
  max-width: 680px;
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.hm-apply-leave-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--hm-line);
}

.hm-apply-leave-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hm-accent) 12%, transparent);
  color: var(--hm-accent);
}

.hm-apply-leave-titles {
  min-width: 0;
}

.hm-apply-leave-titles h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.25;
  color: var(--hm-text);
}

.hm-apply-leave-titles p {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  color: var(--hm-muted);
}

.hm-apply-leave .hm-back-link {
  width: 30px;
  height: 30px;
  border: 1px solid var(--hm-border);
  border-radius: var(--radius-sm);
  background: var(--hm-surface);
}

.hm-apply-leave .hm-back-link:hover {
  border-color: color-mix(in srgb, var(--hm-accent) 40%, var(--hm-border));
  background: color-mix(in srgb, var(--hm-accent) 6%, transparent);
}

/* Apply Leave form body (.al-*) lives in styles/form-kit.css */

.hm-recruit {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-7) var(--space-7) var(--space-6);
  background: #ffffff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}

.hm-recruit--360 {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: var(--space-4);
}

.hm-recruit--360 .hm-emp-head {
  padding: 0 var(--space-1);
}

.hm-recruit-desc {
  margin: 0;
  font-size: var(--text-md);
  line-height: 1.45;
}

.hm-recruit .hm-e360-identity {
  flex-wrap: wrap;
  row-gap: var(--space-3);
}

.hm-recruit .hm-e360-chips {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .hm-recruit .hm-e360-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hm-e360-hero-actions {
    width: 100%;
    margin-left: 0;
  }
  .hm-e360-hero-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-height: var(--control-height);
    justify-content: center;
  }
}

.hm-recruit-interview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.hm-orb-count {
  font-style: normal;
  font-weight: 600;
  color: inherit;
}

.pd-color-orb.is-on .hm-orb-count,
.pd-color-orb-lbl .hm-orb-count {
  color: inherit;
}

.hm-recruit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.hm-recruit-head h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--slate-900);
}

.hm-recruit-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.hm-recruit-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  min-height: 92px;
  padding: var(--space-4) var(--space-5) var(--space-4);
  border: 0;
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: var(--slate-100);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hm-recruit-kpi:hover {
  background: var(--slate-150);
}

.hm-recruit-kpi span {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.hm-recruit-kpi strong {
  font-size: var(--text-4xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--slate-700);
}

.hm-recruit-kpi.is-zero strong {
  color: var(--slate-500);
}

.hm-recruit-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px var(--space-6) var(--space-8);
  border-radius: var(--radius-lg);
  background: var(--slate-50);
}

.hm-recruit-empty-ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--slate-150);
  color: var(--slate-500);
}

.hm-recruit-empty h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--slate-900);
}

.hm-recruit-empty p {
  max-width: 420px;
  margin: var(--space-2) 0 0;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.5;
  color: var(--slate-500);
}

.hm-recruit-stages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

.hm-recruit-stages li {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--slate-500);
}

.hm-recruit-stages li + li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin: 0 var(--space-3);
  border-radius: var(--radius-xs);
  background: var(--slate-300);
}

.hm-recruit-pipe {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: var(--slate-50);
}

.hm-recruit-pipe-stage {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-4);
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: #ffffff;
}

.hm-recruit-pipe-stage span {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-500);
}

.hm-recruit-pipe-stage strong {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--slate-900);
}

@media (max-width: 900px) {
  .hm-perf-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .hm-leave-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .hm-grid { grid-template-columns: 1fr 1fr; }
  .hm-card--wide { grid-column: 1 / -1; }
  .hm-att-board { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  .hm-stat-row,
  .hm-grid,
  .hm-split,
  .hm-att-board,
  .hm-reports-metrics,
  .hm-recruit-kpis { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .hm-stat-row,
  .hm-grid,
  .hm-split,
  .hm-att-board,
  .hm-reports-metrics,
  .hm-recruit-kpis { grid-template-columns: 1fr; }

  .hm-att-today,
  .hm-att-trend {
    border-right: 0;
    border-bottom: 1px solid var(--slate-100);
  }

  .hm-recruit {
    padding: var(--space-5) var(--space-4) var(--space-4);
  }
}

.hm-shell h1,
.hm-shell h2,
.hm-shell h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hm-shell .muted {
  font-weight: 400;
  font-style: normal;
}

.hm-md-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.hm-md-chart-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--slate-700);
}

.hm-md-triple {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: stretch;
  margin-bottom: var(--space-4);
}

.hm-md-triple .hm-perf-dist {
  margin-top: var(--space-4);
}

.hm-md-dist .hm-perf-dist-row,
.hm-md-triple .hm-perf-dist-row {
  grid-template-columns: minmax(92px, 1fr) minmax(48px, 1.2fr) 28px;
}

.hm-md-type {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.hm-md-mark-wrap {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex-shrink: 0;
  color: var(--slate-500);
}

.hm-md-mark-wrap svg {
  display: block !important;
  width: 13px !important;
  height: 13px !important;
  overflow: visible !important;
}

.hm-md-mark {
  display: block !important;
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.hm-md-mark-wrap--green { color: var(--success-strong); }
.hm-md-mark-wrap--blue { color: var(--primary); }
.hm-md-mark-wrap--amber { color: var(--warning-strong); }
.hm-md-mark-wrap--rose { color: var(--danger-strong); }
.hm-md-mark-wrap--slate { color: var(--slate-500); }

.hm-shell .hm-kpi-ico svg,
.hm-hrms-dock .idock-ico svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
}

.hm-shell .hm-kpi-ico svg {
  width: 20px !important;
  height: 20px !important;
}

.hm-md-balance-pane {
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--slate-200);
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.hm-md-balance-pane .hm-emp-report-label {
  margin-bottom: var(--space-4);
}

.hm-md-balance-pane .hm-table-wrap--soft {
  max-height: none;
  border: 0;
}

.hm-md-usage {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
}

.hm-md-usage-row {
  display: grid;
  grid-template-columns: minmax(120px, 168px) minmax(0, 1fr) 36px;
  align-items: center;
  gap: var(--space-4);
}

.hm-md-stack {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--slate-100);
}

.hm-md-stack .is-taken {
  height: 100%;
  background: var(--primary);
}

.hm-md-stack .is-left {
  height: 100%;
  background: var(--success);
}

.hm-md-lead {
  margin: -4px 0 var(--space-4);
}

.hm-md-boards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.92fr);
  grid-template-rows: 210px 210px;
  gap: var(--space-4);
  height: 434px;
}

.hm-md-boards-up {
  grid-column: 1;
  grid-row: 1;
}

.hm-md-boards-recent {
  grid-column: 1;
  grid-row: 2;
}

.hm-md-boards-notif {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.hm-md-boards > .hm-list-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.hm-md-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.hm-md-scroll--panel {
  height: 420px;
  flex: none;
}

.hm-md-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.hm-md-scroll::-webkit-scrollbar-track,
.hm-md-scroll::-webkit-scrollbar-thumb,
.hm-md-scroll::-webkit-scrollbar-corner {
  background: transparent;
}

.hm-md-preview,
.hm-md-timeline {
  list-style: none;
  margin: 0;
  padding: var(--space-1) 0 var(--space-2);
}

.hm-md-preview li,
.hm-md-timeline li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
}

.hm-md-preview-body,
.hm-md-timeline-body {
  min-width: 0;
  flex: 1;
}

.hm-md-preview strong,
.hm-md-timeline strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.35;
  color: var(--slate-900);
}

.hm-md-preview .muted,
.hm-md-timeline .muted {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--slate-500);
}

@media (max-width: 700px) {
  .hm-md-triple {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hm-md-boards {
    grid-template-columns: 1fr;
    grid-template-rows: 210px 210px 360px;
    height: auto;
  }

  .hm-md-boards-up,
  .hm-md-boards-recent,
  .hm-md-boards-notif {
    grid-column: 1;
    grid-row: auto;
  }
}

.hm-card-empty {
  padding: var(--space-2) var(--space-5) var(--space-5);
}

.hm-profile-val {
  padding: var(--space-3) 0 2px;
  font-weight: 500;
  color: var(--hm-text);
}

.hm-md-profile {
  padding: 0;
  overflow: hidden;
}

.hm-md-profile-banner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--slate-900);
  color: #ffffff;
}

.hm-md-profile-ava {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--slate-800);
  color: var(--slate-200);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.hm-md-profile-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hm-md-profile-who {
  min-width: 0;
}

.hm-md-profile-who strong {
  display: block;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
}

.hm-md-profile-who span {
  display: block;
  margin-top: 2px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-500);
}

.hm-md-profile-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--slate-800);
  color: var(--slate-500);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hm-md-profile-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.hm-md-profile-status.is-active {
  background: var(--success-strong);
  color: var(--success-strong);
}

.hm-md-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6) var(--space-7);
  padding: var(--space-6) var(--space-6) var(--space-6);
}

.hm-md-profile-field span {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.hm-md-profile-field strong {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-900);
  word-break: break-word;
}

@media (max-width: 800px) {
  .hm-md-profile-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .hm-md-profile-grid {
    grid-template-columns: 1fr;
  }
}

.hm-leave-field .ss {
  width: 100%;
}

@media (max-width: 1200px) {
  .hm-stat-row--5,
  .hm-md-charts {
    grid-template-columns: 1fr 1fr;
  }
  .hm-overview-kpis,
  .hm-overview > .hm-stat-row,
  .hm-att-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .hm-stat-row--5,
  .hm-overview-kpis,
  .hm-overview > .hm-stat-row,
  .hm-md-charts,
  .hm-att-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .hm-stat-row--5 {
    grid-template-columns: 1fr;
  }
  .hm-overview-kpis,
  .hm-overview > .hm-stat-row,
  .hm-att-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

/* PM pages share the HRMS chrome; undo .pm-page padding on the dock. */
.pm-page .hm-hrms-dock {
  margin-left: -20px;
  margin-right: -20px;
  padding: var(--space-2) var(--space-5) var(--space-2);
  background: var(--app-bg, #f9fafb);
  font-size: var(--text-lg);
}

.hm-table-wrap .hm-card-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  text-align: center;
  gap: var(--space-2);
}

.hm-table-wrap .hm-card-empty h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}

.hm-table-wrap .hm-card-empty .muted {
  margin: 0 0 var(--space-2);
}

/* PM module pages use the same type scale and tables as HRMS. */
.hm-shell .pm-page,
.hm-shell .pm-analytics-embedded,
.hm-shell .rm-page {
  padding: 0;
  background: transparent;
  font-size: inherit;
  color: inherit;
}

.hm-shell .pm-page h1 {
  margin: 0;
  font-size: var(--text-page-title);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hm-shell .panel {
  border: 1px solid var(--slate-200);
  border-radius: var(--hm-radius-card, var(--radius-md));
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  background: #ffffff;
}

.hm-shell .panel-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--slate-900);
}

.hm-shell table:not(.hm-table) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-base);
}

.hm-shell table:not(.hm-table) th,
.hm-shell table:not(.hm-table) td {
  padding: var(--space-4) var(--space-5);
  text-align: left;
}

.hm-shell table:not(.hm-table) th {
  padding: var(--space-3) var(--space-5);
  background: var(--slate-50);
  color: var(--slate-500);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--slate-150);
}

.hm-shell table:not(.hm-table) td {
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-900);
}

.hm-shell table:not(.hm-table) tbody tr:hover td {
  background: var(--slate-50);
}

.hm-shell .pm-analytics-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}

.hm-shell .pm-analytics-nav a,
.hm-shell .pm-analytics-nav button {
  border: 1px solid var(--slate-200);
  background: #fff;
  color: var(--slate-600);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
}

.hm-shell .pm-analytics-nav a.active,
.hm-shell .pm-analytics-nav button.active {
  background: color-mix(in srgb, var(--primary, #059669) 12%, #fff);
  border-color: color-mix(in srgb, var(--primary, #059669) 40%, var(--slate-200));
  color: var(--primary, #059669);
}

.hm-shell .pm-page .panel,
.hm-shell .panel.wi-panel,
.hm-shell .panel.ra-filters,
.hm-shell .panel.rd-util-panel,
.hm-shell .panel.cp-grid-wrap,
.hm-shell .panel.cp-legend,
.hm-shell .panel.pm-heatmap,
.hm-shell .panel.pm-chart-card,
.hm-shell .panel.pm-tracker-panel {
  border-radius: var(--radius-lg);
}

.hm-shell .pm-page .panel {
  border: 1px solid var(--slate-200);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  background: #ffffff;
}

.hm-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.hm-shell .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  width: 100%;
}

.hm-shell .pm-dash-kpis,
.pm-dash-kpis {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  width: 100%;
}

.hm-shell .card:not(.pm-stat) {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--slate-200);
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.hm-shell .card:not(.pm-stat):hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.hm-shell .card.pm-stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 0;
  border-radius: var(--radius-sm);
  color: #ffffff;
  transform: scale(1);
  transition: transform var(--duration-base) ease-out, box-shadow var(--duration-base) ease-out, filter var(--duration-base) ease-out;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.hm-shell .card.pm-stat:hover {
  z-index: 1;
  transform: none;
  filter: brightness(1.04);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.12), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.hm-shell .card.pm-stat.is-active {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1),
    inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.hm-shell .pm-stat-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
  flex: 1;
}

.hm-shell .card.pm-stat .value {
  order: 0;
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #ffffff;
}

.hm-shell .card.pm-stat .label {
  order: 1;
  margin-top: 2px;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255, 255, 255, 0.88);
}

.hm-shell .card.pm-stat .card-link,
.hm-shell .card.pm-stat .muted,
.hm-shell .card.pm-stat .rm-kpi-hint {
  display: none;
}

.hm-shell .card.pm-stat .pm-stat-icon {
  order: -1;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin: 0;
  background: #ffffff;
  box-shadow: none;
}

.hm-shell .cards > .card.pm-stat:nth-child(8n + 1) {
  background: var(--warning);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 1) .pm-stat-icon {
  color: var(--warning-strong);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 2) {
  background: var(--primary);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 2) .pm-stat-icon {
  color: var(--primary);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 3) {
  background: var(--success);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 3) .pm-stat-icon {
  color: var(--success-strong);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 4) {
  background: var(--danger);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 4) .pm-stat-icon {
  color: var(--danger-strong);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 5) {
  background: var(--primary);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 5) .pm-stat-icon {
  color: var(--primary);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 6) {
  background: var(--primary);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 6) .pm-stat-icon {
  color: var(--primary);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 7) {
  background: var(--slate-400);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 7) .pm-stat-icon {
  color: var(--slate-600);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 8) {
  background: var(--primary);
}
.hm-shell .cards > .card.pm-stat:nth-child(8n + 8) .pm-stat-icon {
  color: var(--primary);
}

.hm-shell .cards > .card.pm-stat.rm-kpi-red {
  background: var(--danger);
}
.hm-shell .cards > .card.pm-stat.rm-kpi-red .pm-stat-icon {
  color: var(--danger-strong);
}
.hm-shell .cards > .card.pm-stat.rm-kpi-green {
  background: var(--success);
}
.hm-shell .cards > .card.pm-stat.rm-kpi-green .pm-stat-icon {
  color: var(--success-strong);
}
.hm-shell .cards > .card.pm-stat.rm-kpi-amber {
  background: var(--warning);
}
.hm-shell .cards > .card.pm-stat.rm-kpi-amber .pm-stat-icon {
  color: var(--warning-strong);
}

.hm-shell .ra-filters {
  padding: 0;
  margin-bottom: var(--space-3);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.hm-shell .ra-filters-row,
.hm-shell .wi-filters,
.hm-shell .wi-toolbar,
.hm-shell .toolbar,
.hm-shell .pm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

.hm-shell .ra-filters-hint {
  margin: var(--space-2) 0 0;
  font-size: var(--text-md);
}

.hm-shell .toolbar {
  margin: 0 0 var(--space-3);
  padding: 0;
  border: 0;
  background: transparent;
}

.hm-shell .table-wrap,
.hm-shell .table-scroll,
.hm-shell .pm-health-table-wrap,
.hm-shell .pm-productivity-table-wrap,
.hm-shell .rd-util-table-wrap,
.hm-shell .cp-grid-scroll {
  overflow: auto;
  border: 1px solid var(--slate-150);
  border-radius: var(--radius-lg);
  background: #ffffff;
}

.hm-shell .cp-grid-wrap {
  padding: 0;
  overflow: hidden;
}

.hm-shell .cp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}

.hm-pm-reports {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-2);
  padding: var(--space-2) 0 var(--space-4);
}

.hm-shell .rm-report-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-2);
}

.hm-shell .rm-report-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  width: 100%;
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  box-shadow: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.hm-shell .rm-report-card:hover {
  background: var(--slate-50);
}

.hm-shell .rm-report-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--slate-900);
}

.hm-shell .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--slate-100);
}

.hm-shell .hm-perf-tabs {
  margin: 0 0 var(--space-4);
}

.hm-shell > .panel {
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.hm-shell > .panel > .panel-header {
  padding: var(--space-3) 0 var(--space-4);
  margin-bottom: 0;
  border-bottom: 0;
}

.hm-shell > .panel > .panel-header h2 {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}

@media (max-width: 900px) {
  .hm-shell .cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .hm-shell .cards {
    grid-template-columns: 1fr;
  }
}

/* ── Employee 360 workspace (project-details style rail + panels) ───────── */
.hm-e360 {
  min-height: 0;
  gap: var(--space-3);
  align-items: stretch;
}

.hm-e360 .pd-rail {
  top: 0;
  min-height: 0;
  height: calc(100vh - 168px);
  max-height: calc(100vh - 168px);
  overflow: hidden;
}

.hm-e360 .pd-rail-head {
  flex: 0 0 auto;
}

.hm-e360 .pd-rail-list {
  flex: 1 1 0;
  min-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hm-e360 .pd-rail-pager {
  flex: 0 0 auto;
}

@media (max-width: 960px) {
  .hm-e360 .pd-rail {
    position: static;
    height: auto;
    max-height: min(52vh, 420px);
  }
}

.hm-e360 .pd-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-left: 0;
}

.hm-e360 .pd-rail-search-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--slate-500);
}

.hm-e360 .pd-rail-search {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  font-size: var(--text-md) !important;
  color: var(--slate-900);
}

.hm-e360 .pd-rail-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
  color: var(--slate-500);
  font-size: var(--text-sm);
}

.hm-e360 .pd-rail-page-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--hm-border, #e6edf3);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--slate-500);
  cursor: pointer;
}

.hm-e360 .pd-rail-page-btn:hover:not(:disabled) {
  color: var(--primary, #0f766e);
  border-color: color-mix(in srgb, var(--primary, #0f766e) 35%, var(--slate-200));
}

.hm-e360 .pd-rail-page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.hm-e360-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.hm-e360-identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.hm-e360-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.hm-e360-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hm-e360-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.hm-e360-name-row h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--slate-900);
}

.hm-e360-identity p {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
}

.hm-e360-code {
  display: inline-flex;
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: var(--slate-100);
  color: var(--slate-600);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0;
}

.hm-e360-edit {
  margin-left: auto;
}

.hm-e360-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-left: auto;
}

.hm-e360-hero-actions .hm-e360-edit {
  margin-left: 0;
}

.hm-recruit-job-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hm-recruit-job-copy h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.hm-recruit-job-copy .hm-recruit-desc {
  white-space: pre-wrap;
}

/* Filled with the accent colour chosen in Theme settings (--primary). */
.hm-e360-edit.btn,
.hm-e360-edit.btn.secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--primary, #059669);
  background: var(--primary, #059669);
  color: #ffffff;
  box-shadow: var(--shadow-btn);
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.hm-e360-edit.btn:hover,
.hm-e360-edit.btn.secondary:hover {
  border-color: var(--primary-dark, #047857);
  background: var(--primary-dark, #047857);
  color: #ffffff;
  box-shadow: var(--shadow-btn-hover);
}

.hm-e360-edit.btn:active,
.hm-e360-edit.btn.secondary:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-btn-active);
}

.hm-e360-edit.btn:focus-visible,
.hm-e360-edit.btn.secondary:focus-visible {
  outline: 2px solid var(--primary, #059669);
  outline-offset: 2px;
}

.hm-e360-edit.btn svg {
  color: currentColor;
}

/* html[data-theme="dark"] .btn.secondary outranks the rule above — restate it. */
html[data-theme="dark"] .hm-e360-edit.btn,
html[data-theme="dark"] .hm-e360-edit.btn.secondary {
  border-color: var(--primary, #059669);
  background: var(--primary, #059669);
  color: #ffffff;
}

html[data-theme="dark"] .hm-e360-edit.btn:hover,
html[data-theme="dark"] .hm-e360-edit.btn.secondary:hover {
  border-color: var(--primary-dark, #047857);
  background: var(--primary-dark, #047857);
  color: #ffffff;
}

.hm-profile-photo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.hm-profile-photo-preview {
  width: 56px;
  height: 56px;
  overflow: hidden;
}

.hm-profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hm-e360-chips {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
}

/* Same muted tiles as project-management hero KPIs (.kpi-chip). */
.hm-e360-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  box-shadow: none;
  min-width: 0;
  text-align: left;
}

.hm-e360-chip-lbl {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--slate-500);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-e360-chip-val {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--slate-900);
  line-height: 1.25;
  word-break: break-word;
}

.hm-e360-chip-val a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hm-e360-chip-val a:hover {
  text-decoration: underline;
}

.hm-e360-chip-hint {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--slate-500);
  line-height: 1.3;
}

html[data-theme="dark"] .hm-e360-chip {
  background: var(--surface-raised, #1e293b);
}

html[data-theme="dark"] .hm-e360-chip-lbl,
html[data-theme="dark"] .hm-e360-chip-hint {
  color: var(--muted, #94a3b8);
}

html[data-theme="dark"] .hm-e360-chip-val {
  color: var(--heading, #f8fafc);
}

.hm-e360-alloc-more {
  margin: 0;
  font-size: var(--text-sm);
}

.hm-e360-orbs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: #fff;
  border: 1px solid var(--hm-border, #e6edf3);
  border-radius: var(--hm-radius-card, var(--radius-md));
}

.hm-e360-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

/* Stat tiles — solid colour fills, matching the .hm-kpi cards on the HRMS
   module home: saturated background, white text, no border. Same palette, so
   the two card families read as one system. */
.hm-e360-stat {
  --hm-stat-fill: var(--slate-400);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-4) var(--space-4);
  border: 0;
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: var(--hm-stat-fill);
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  min-width: 0;
  transform: scale(1);
  transition: transform var(--duration-base) ease-out, box-shadow var(--duration-base) ease-out,
    filter var(--duration-base) ease-out;
}

.hm-e360-stat:hover {
  transform: none;
  filter: brightness(1.04);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.12), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Palette lifted from .hm-kpi--* above so both card types stay in step. */
.hm-e360-stat--green { --hm-stat-fill: var(--success); }
.hm-e360-stat--rose { --hm-stat-fill: var(--danger); }
.hm-e360-stat--amber { --hm-stat-fill: var(--warning); }
.hm-e360-stat--blue { --hm-stat-fill: var(--primary); }

.hm-e360-stat-lbl {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-e360-stat-val {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: #ffffff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "case" 1;
}

.hm-e360-stat-hint {
  font-size: var(--text-xs);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  .hm-e360-stat {
    transition: none;
  }
  .hm-e360-stat:hover {
    transform: none;
  }
}

.hm-e360-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.hm-e360-lt-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
}

.hm-e360-lt {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--hm-border, #e6edf3);
  border-radius: var(--hm-radius-card, var(--radius-md));
  background: #fff;
  min-width: 0;
}

.hm-e360-lt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.hm-e360-lt-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-e360-lt-val {
  font-size: var(--text-sm);
  color: var(--slate-500);
  white-space: nowrap;
}

.hm-e360-lt-val strong {
  font-size: var(--text-lg);
  color: var(--slate-900);
}

.hm-e360-lt-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--slate-100);
  overflow: hidden;
}

.hm-e360-lt-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.hm-e360-lt-bar i.is-full {
  background: var(--danger);
}

.hm-e360-lt-foot {
  font-size: var(--text-xs);
  color: var(--slate-500);
}

.hm-e360-lt-total {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
}

.hm-e360-doc-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.hm-e360-doc-form input[type="text"],
.hm-e360-doc-form select {
  height: var(--control-height);
  padding: 0 var(--space-3);
  border: 1px solid var(--hm-border, #e6edf3);
  border-radius: var(--radius-md);
  background: #fff;
  font: inherit;
  font-size: var(--text-md);
  color: var(--slate-900);
}

.hm-e360-doc-form input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
}

.hm-e360-doc-form input[type="file"] {
  font-size: var(--text-sm);
  color: var(--slate-600);
}

.hm-e360-doc-dl {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--primary, #0f766e);
  text-decoration: none;
}

.hm-e360-doc-dl:hover {
  text-decoration: underline;
}

@media (max-width: 1200px) {
  .hm-e360-chips,
  .hm-e360-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hm-e360-lt-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hm-e360-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hm-e360-chips,
  .hm-e360-stats,
  .hm-e360-lt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* No rail rendered → single column (beats the global 44px collapsed-rail column) */
.pd-shell.hm-e360.hm-e360--self,
.pd-shell.hm-e360:not(:has(> .pd-rail)) {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
}

.hm-sum {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.hm-sum-row3,
.hm-sum-row2 {
  display: grid;
  gap: var(--space-4);
}

.hm-sum-row3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hm-sum-row2 {
  grid-template-columns: 1.05fr 1.2fr;
}

.hm-sum-card {
  background: #fff;
  border: 1px solid var(--slate-150);
  border-radius: var(--hm-radius-card, var(--radius-md));
  padding: var(--space-4) var(--space-5) var(--space-5);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.hm-sum-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.hm-sum-card-head h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--slate-900);
}

.hm-sum-chip {
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
}

.hm-sum-chip.is-ok {
  color: var(--success-strong);
  background: var(--success-muted);
}

.hm-sum-chip.is-muted {
  color: var(--slate-500);
  background: var(--slate-100);
}

.hm-sum-sub {
  margin: -4px 0 var(--space-3);
  font-size: var(--text-md);
}

.hm-sum-today-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.hm-sum-today-grid div,
.hm-sum-hours {
  background: var(--slate-50);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-3);
  box-shadow: var(--shadow-card);
}

.hm-sum-today-grid span,
.hm-sum-hours span,
.hm-sum-leave-row span,
.hm-sum-ts-meta p {
  display: block;
  font-size: var(--text-sm);
  color: var(--slate-500);
}

.hm-sum-today-grid strong,
.hm-sum-hours strong {
  font-size: var(--text-xl);
  color: var(--slate-900);
}

.hm-sum-hours {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-3);
}

.hm-sum-live {
  font-style: normal;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--success-strong);
}

.hm-sum-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.hm-sum-leave {
  margin-bottom: var(--space-3);
}

.hm-sum-leave-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-md);
}

.hm-sum-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--slate-100);
  overflow: hidden;
}

.hm-sum-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.hm-sum-leave--green .hm-sum-bar i { background: var(--primary); }
.hm-sum-leave--blue .hm-sum-bar i { background: var(--primary); }
.hm-sum-leave--orange .hm-sum-bar i { background: var(--primary); }
.hm-sum-leave--teal .hm-sum-bar i { background: var(--primary); }

.hm-sum-ts {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.hm-sum-ring {
  position: relative;
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
}

.hm-sum-ring svg {
  width: 88px;
  height: 88px;
  transform: rotate(-90deg);
}

.hm-sum-ring-bg {
  fill: none;
  stroke: var(--slate-200);
  stroke-width: 8;
}

.hm-sum-ring-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
}

.hm-sum-ring strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: var(--text-lg);
}

.hm-sum-ts-meta b {
  display: block;
  margin-bottom: var(--space-2);
}

.hm-sum-month-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
  font-weight: 500;
}

.hm-sum-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
  text-align: center;
}

.hm-sum-cal-wd {
  font-size: var(--text-xs);
  color: var(--slate-500);
  font-weight: 500;
}

.hm-sum-cal-day {
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-700);
}

.hm-sum-cal-day.is-present { background: var(--accent-soft); color: var(--primary); }
.hm-sum-cal-day.is-absent { background: var(--danger-soft); color: var(--danger-strong); }
.hm-sum-cal-day.is-leave { background: var(--warning-soft); color: var(--warning-strong); }
.hm-sum-cal-day.is-half { background: var(--warning-soft); color: var(--warning-strong); }
.hm-sum-cal-day.is-holiday { background: var(--success-soft); color: var(--success-strong); }
.hm-sum-cal-day.is-weekoff { background: var(--accent-soft); color: var(--primary); }
.hm-sum-cal-day.is-late { background: var(--warning-soft); color: var(--warning-strong); }
.hm-sum-cal-day.is-wfh { background: var(--accent-muted); color: var(--primary-darker); }
.hm-sum-cal-day.is-today {
  box-shadow: 0 0 0 2px var(--primary);
}

.hm-sum-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--slate-500);
}

.hm-sum-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: var(--space-2);
}

.hm-sum-legend .is-present { background: var(--primary); }
.hm-sum-legend .is-absent { background: var(--danger); }
.hm-sum-legend .is-leave { background: var(--warning); }
.hm-sum-legend .is-half { background: var(--warning); }
.hm-sum-legend .is-holiday { background: var(--success); }
.hm-sum-legend .is-weekoff { background: var(--primary); }
.hm-sum-legend .is-late { background: var(--warning); }
.hm-sum-legend .is-wfh { background: var(--primary); }

.hm-sum-up {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hm-sum-up li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
}

.hm-sum-up-ico {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  color: var(--slate-900);
}

.hm-sum-up-ico.is-holiday { background: var(--success-muted); color: var(--success-strong); }
.hm-sum-up-ico.is-leave { background: var(--accent-soft); color: var(--primary); }
.hm-sum-up-ico.is-birthday { background: var(--accent-soft); color: var(--primary); }
.hm-sum-up-ico.is-anniversary { background: var(--accent-soft); color: var(--primary); }

.hm-sum-up strong {
  display: block;
  font-size: var(--text-md);
}

.hm-sum-up p,
.hm-sum-up em {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--slate-500);
  font-style: normal;
}

@media (max-width: 1100px) {
  .hm-sum-row3,
  .hm-sum-row2 {
    grid-template-columns: 1fr;
  }
}

/* Monthly attendance register (one row per employee, dates across) */
.att-reg-page .att-reg-panel {
  padding: var(--space-3);
}

.att-reg-toolbar {
  margin-bottom: var(--space-3);
  max-width: 420px;
}

.att-reg-scroll {
  overflow: auto;
  max-height: min(72vh, 760px);
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #fff;
}

.att-reg {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: var(--text-sm);
  color: var(--slate-800);
}

.att-reg th,
.att-reg td {
  border: 1px solid var(--slate-300);
  padding: var(--space-2) var(--space-2);
  vertical-align: middle;
  white-space: nowrap;
}

.att-reg thead th {
  position: sticky;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-align: center;
  z-index: 4;
}

.att-reg thead tr:first-child th {
  top: 0;
}

.att-reg thead tr:nth-child(2) th {
  top: 36px;
  z-index: 3;
  font-weight: 600;
  font-size: var(--text-xs);
}

.att-reg thead th.att-reg-sticky {
  z-index: 7;
  top: 0;
}

.att-reg tbody td.att-reg-sticky {
  position: sticky;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 var(--slate-200);
}

.att-reg tbody tr:nth-child(even) td {
  background: var(--slate-50);
}

.att-reg tbody tr:nth-child(even) td.att-reg-sticky {
  background: var(--slate-50);
}

.att-reg tbody tr:hover td,
.att-reg tbody tr:hover td.att-reg-sticky {
  background: var(--slate-100);
}

.att-reg-sno {
  left: 0;
  min-width: 44px;
  width: 44px;
  text-align: center;
}

.att-reg-code {
  left: 44px;
  min-width: 108px;
  width: 108px;
}

.att-reg-name {
  left: 152px;
  min-width: 168px;
  width: 168px;
  text-align: left;
  font-weight: 500;
  z-index: 3;
}

.att-reg thead th.att-reg-name {
  z-index: 8;
}

.att-reg-num {
  text-align: center;
  min-width: 72px;
}

.att-reg-date {
  min-width: 196px;
}

.att-reg-sub {
  min-width: 76px;
}

.att-reg-in.is-late {
  color: var(--danger-strong);
  font-weight: 600;
}

.att-reg-status {
  text-align: center;
  font-weight: 600;
  letter-spacing: 0;
}

.att-reg tbody td.att-reg-cell--leave,
.att-reg tbody tr:nth-child(even) td.att-reg-cell--leave,
.att-reg tbody tr:hover td.att-reg-cell--leave {
  background: var(--warning-soft);
  color: var(--warning-strong);
}

.att-reg tbody td.att-reg-cell--holiday,
.att-reg tbody tr:nth-child(even) td.att-reg-cell--holiday,
.att-reg tbody tr:hover td.att-reg-cell--holiday {
  background: var(--success-soft);
  color: var(--success-strong);
}

.att-reg tbody td.att-reg-cell--weekoff,
.att-reg tbody tr:nth-child(even) td.att-reg-cell--weekoff,
.att-reg tbody tr:hover td.att-reg-cell--weekoff {
  background: var(--accent-soft);
  color: var(--primary);
}

.att-reg tbody td.att-reg-cell--wfh,
.att-reg tbody tr:nth-child(even) td.att-reg-cell--wfh,
.att-reg tbody tr:hover td.att-reg-cell--wfh {
  background: var(--accent-soft);
  color: var(--primary-darker);
}

.att-reg tbody td.att-reg-cell--absent,
.att-reg tbody tr:nth-child(even) td.att-reg-cell--absent,
.att-reg tbody tr:hover td.att-reg-cell--absent {
  background: var(--danger-soft);
  color: var(--danger-strong);
}

.att-reg-empty {
  text-align: center;
  padding: var(--space-5) var(--space-2);
}

.att-reg-holidays-count {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.att-reg-holidays-pop {
  position: fixed;
  z-index: 80;
  background: #fff;
  color: var(--slate-900);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgb(15 23 42 / 0.16);
  max-height: 280px;
  overflow: auto;
  font-size: var(--text-sm);
}

.att-reg-holidays-pop-title {
  font-weight: 600;
  padding: var(--space-2) var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--slate-200);
}

.att-reg-holidays-pop ul {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0;
}

.att-reg-holidays-pop li {
  display: grid;
  grid-template-columns: 88px 88px 1fr;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
}

.att-reg-holidays-pop li:nth-child(even) {
  background: var(--slate-50);
}

.att-reg-holidays-pop-date {
  font-weight: 500;
}

.att-reg-holidays-pop-day {
  color: var(--slate-500);
}

.att-reg-holidays-pop-name {
  font-weight: 500;
}

@media (max-width: 800px) {
  .att-reg-scroll {
    max-height: min(64vh, 620px);
  }

  .att-reg-name {
    min-width: 140px;
    width: 140px;
  }
}

/* Table bodies stay regular weight — nothing bold inside rows (titles, links, badges, totals) */
.hm-table tbody td,
.hm-table tbody td *,
.pd-premium .hm-table.hm-table tbody td,
.pd-premium .hm-table.hm-table tbody td *,
.pd-premium .hm-table.hm-table tbody .hm-title-cell,
.pd-table tbody td,
.pd-table tbody td * {
  font-weight: 400 !important;
}

/* Employee 360 — Edit profile + section dropdown side by side */
.hm-e360-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex-shrink: 0;
}
.hm-e360-actions .hm-e360-edit {
  margin: 0;
}
.hm-e360-actions .smenu-trigger {
  height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--slate-200, #e2e8f0);
  box-shadow: none;
  color: var(--heading);
  font-size: var(--text-sm);
  font-weight: 500;
}
.hm-e360-actions .smenu-trigger .smenu-ico {
  color: var(--primary);
}
.hm-e360-actions .smenu-trigger:hover,
.hm-e360-actions .smenu.is-open .smenu-trigger {
  border-color: var(--slate-300, #cbd5e1);
  background: var(--slate-50, #f8fafc);
}

/* Section dropdowns inside detail-page hero action rows (recruitment job, CRM lead) */
.hm-e360-hero-actions .smenu-trigger,
.hero-actions .smenu-trigger {
  height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--slate-200, #e2e8f0);
  box-shadow: none;
  color: var(--heading);
  font-size: var(--text-sm);
  font-weight: 500;
}
.hm-e360-hero-actions .smenu-trigger .smenu-ico,
.hero-actions .smenu-trigger .smenu-ico {
  color: var(--primary);
}
.hm-e360-hero-actions .smenu-trigger:hover,
.hero-actions .smenu-trigger:hover,
.hm-e360-hero-actions .smenu.is-open .smenu-trigger,
.hero-actions .smenu.is-open .smenu-trigger {
  border-color: var(--slate-300, #cbd5e1);
  background: var(--slate-50, #f8fafc);
}
.hero-actions:has(.smenu) {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* ===== Employee self-service "Edit Profile" form — visual polish only ===== */
.hm-edit-profile {
  padding: var(--space-5) var(--space-6) var(--space-6) !important;
  border: 1px solid var(--slate-150, #e2e8f0);
  border-radius: var(--radius-lg);
  background: #ffffff;
}
.hm-edit-profile .hm-card-head {
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
}
.hm-edit-profile .hm-ov-report-title {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
}
.hm-edit-profile .hm-ov-report-title h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--heading);
}
.hm-edit-profile .hm-back-link {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--slate-600, #475569);
}
.hm-edit-profile .hm-back-link:hover {
  background: var(--slate-50, #f8fafc);
  color: var(--heading);
}
/* Intro note as a soft info callout */
.hm-edit-profile > p.muted {
  margin: 0 0 var(--space-5) !important;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary) 6%, #ffffff);
  color: var(--slate-600, #475569) !important;
  font-size: var(--text-sm);
  line-height: 1.5;
}
/* Form grid: 3 columns on wide screens */
.hm-edit-profile .hm-leave-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4) var(--space-5);
  max-width: none;
}
.hm-edit-profile .hm-leave-field {
  gap: 6px;
}
.hm-edit-profile .hm-leave-field > span {
  color: var(--slate-600, #475569);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hm-edit-profile .hm-leave-field input,
.hm-edit-profile .hm-leave-field select,
.hm-edit-profile .hm-leave-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 0 var(--space-3);
  border: 1px solid var(--slate-300, #cbd5e1);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--heading);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 400;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.hm-edit-profile .hm-leave-field textarea {
  padding: var(--space-2) var(--space-3);
  min-height: 72px;
  resize: vertical;
}
.hm-edit-profile .hm-leave-field input:hover,
.hm-edit-profile .hm-leave-field select:hover,
.hm-edit-profile .hm-leave-field textarea:hover {
  border-color: var(--slate-400, #94a3b8);
}
.hm-edit-profile .hm-leave-field input:focus,
.hm-edit-profile .hm-leave-field select:focus,
.hm-edit-profile .hm-leave-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
.hm-edit-profile .hm-leave-field input:disabled,
.hm-edit-profile .hm-leave-field select:disabled,
.hm-edit-profile .hm-leave-field textarea:disabled {
  background-color: var(--slate-50, #f8fafc);
  color: var(--slate-500, #64748b);
}
/* Photo block */
.hm-edit-profile .hm-profile-photo {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--slate-300, #cbd5e1);
  border-radius: var(--radius-md);
  background: var(--slate-50, #f8fafc);
}
.hm-edit-profile .hm-profile-photo-preview {
  width: 56px;
  height: 56px;
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px var(--slate-200, #e2e8f0);
}
/* Actions */
.hm-edit-profile .hm-leave-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--slate-100, #f1f5f9);
}
@media (max-width: 1100px) {
  .hm-edit-profile .hm-leave-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .hm-edit-profile {
    padding: var(--space-4) !important;
  }
  .hm-edit-profile .hm-leave-form {
    grid-template-columns: 1fr;
  }
}
html[data-theme="dark"] .hm-edit-profile,
html[data-theme="dark"] .hm-edit-profile .hm-leave-field input,
html[data-theme="dark"] .hm-edit-profile .hm-leave-field select,
html[data-theme="dark"] .hm-edit-profile .hm-leave-field textarea,
html[data-theme="dark"] .hm-edit-profile .hm-back-link {
  background-color: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .hm-edit-profile .hm-profile-photo,
html[data-theme="dark"] .hm-edit-profile > p.muted {
  background: var(--surface-hover);
}
.hm-edit-profile .hm-leave-msg,
.hm-edit-profile .hm-leave-field--full {
  grid-column: 1 / -1;
}

/* Edit Profile header — title on the left */
.hm-edit-profile .hm-card-head {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.hm-edit-profile .hm-ov-report-title {
  flex-direction: row-reverse;
  justify-content: flex-start;
  margin-right: auto;
  width: auto;
  text-align: left;
}
.hm-edit-profile .hm-ov-report-title h2 {
  text-align: left;
}
.hm-edit-profile .hm-ov-report-title {
  flex-direction: row;
  justify-content: flex-start;
}
.hm-edit-profile .hm-ov-report-title .hm-back-link {
  order: -1;
}
/* Edit Profile header — title left, back button right */
.hm-edit-profile .hm-ov-report-title {
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  margin-right: 0;
}
.hm-edit-profile .hm-ov-report-title .hm-back-link {
  order: 0;
  margin-left: auto;
}
.hm-ov-tabs {
  position: relative;
  z-index: 40;
  overflow: visible;
  align-items: center;
}

.hm-chip-drop {
  position: relative;
  z-index: 45;
}

.hm-chip-drop-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: var(--space-2) var(--space-1);
  border: 0;
  background: none;
  color: var(--slate-700);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0;
  border-radius: var(--radius-sm);
}

.hm-chip-drop-trigger:hover,
.hm-chip-drop.is-open .hm-chip-drop-trigger {
  color: var(--primary, #0078d4);
}

.hm-chip-drop-trigger svg {
  color: currentColor;
}

.hm-chip-drop-caret {
  display: inline-flex;
}

.hm-chip-drop-caret svg {
  transition: transform var(--duration-base) ease;
}

.hm-chip-drop.is-open .hm-chip-drop-caret svg {
  transform: rotate(180deg);
}

.hm-chip-drop-kicker {
  color: inherit;
  font-weight: 500;
}

.hm-chip-drop-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 196px;
  max-height: 280px;
  overflow-y: auto;
  padding: var(--space-2);
  background: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08), 0 8px 24px rgba(60, 64, 67, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--duration-base) ease, transform var(--duration-base) cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility var(--duration-base) ease;
}

.hm-chip-drop-panel.is-left {
  left: 0;
  right: auto;
}

.hm-chip-drop.is-open .hm-chip-drop-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.hm-chip-drop-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: transparent;
  color: var(--slate-700);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--duration-fast) ease, transform var(--duration-base) cubic-bezier(0.2, 0.8, 0.2, 1),
    background var(--duration-fast) ease, color var(--duration-fast) ease;
  transition-delay: calc(var(--chip-i, 0) * 24ms);
}

.hm-chip-drop-item svg {
  flex-shrink: 0;
  color: var(--slate-500);
}

.hm-chip-drop.is-open .hm-chip-drop-item {
  opacity: 1;
  transform: translateY(0);
}

.hm-chip-drop-item:hover {
  background: var(--slate-100);
}

.hm-chip-drop-item:hover svg,
.hm-chip-drop-item.is-active svg {
  color: var(--slate-700);
}

.hm-chip-drop-item.is-active {
  background: color-mix(in srgb, var(--primary, #0078d4) 10%, #fff);
  color: var(--primary-darker, #005a9e);
  font-weight: 500;
}

/* Boxed variant — sits beside a search field as an inline filter */
.hm-chip-drop--boxed .hm-chip-drop-trigger {
  height: 36px;
  padding: 0 var(--space-3);
  gap: var(--space-2);
  border: 1px solid var(--slate-300, #cbd5e1);
  border-radius: 4px;
  background: var(--surface, #fff);
  color: var(--heading);
  font-size: var(--text-md);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.hm-chip-drop--boxed .hm-chip-drop-trigger:hover {
  border-color: var(--slate-400, #94a3b8);
}
.hm-chip-drop--boxed.is-open .hm-chip-drop-trigger,
.hm-chip-drop--boxed .hm-chip-drop-trigger:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
.hm-chip-drop--boxed .hm-chip-drop-kicker {
  padding-right: var(--space-2);
  border-right: 1px solid var(--slate-200, #e2e8f0);
  color: var(--slate-500, #64748b);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hm-chip-drop--boxed .hm-chip-drop-caret {
  color: var(--slate-500, #64748b);
}
html[data-theme="dark"] .hm-chip-drop--boxed .hm-chip-drop-trigger {
  border-color: var(--border-strong, var(--border));
  background: var(--surface);
}
html[data-theme="dark"] .hm-chip-drop--boxed .hm-chip-drop-kicker {
  border-right-color: var(--border);
}
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties {
  @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
    *, :before, :after, ::backdrop {
      --tw-rotate-x: initial;
      --tw-rotate-y: initial;
      --tw-rotate-z: initial;
      --tw-skew-x: initial;
      --tw-skew-y: initial;
      --tw-space-y-reverse: 0;
      --tw-border-style: solid;
      --tw-leading: initial;
      --tw-font-weight: initial;
      --tw-tracking: initial;
      --tw-shadow: 0 0 #0000;
      --tw-shadow-color: initial;
      --tw-shadow-alpha: 100%;
      --tw-inset-shadow: 0 0 #0000;
      --tw-inset-shadow-color: initial;
      --tw-inset-shadow-alpha: 100%;
      --tw-ring-color: initial;
      --tw-ring-shadow: 0 0 #0000;
      --tw-inset-ring-color: initial;
      --tw-inset-ring-shadow: 0 0 #0000;
      --tw-ring-inset: initial;
      --tw-ring-offset-width: 0px;
      --tw-ring-offset-color: #fff;
      --tw-ring-offset-shadow: 0 0 #0000;
      --tw-outline-style: solid;
      --tw-blur: initial;
      --tw-brightness: initial;
      --tw-contrast: initial;
      --tw-grayscale: initial;
      --tw-hue-rotate: initial;
      --tw-invert: initial;
      --tw-opacity: initial;
      --tw-saturate: initial;
      --tw-sepia: initial;
      --tw-drop-shadow: initial;
      --tw-drop-shadow-color: initial;
      --tw-drop-shadow-alpha: 100%;
      --tw-drop-shadow-size: initial;
      --tw-backdrop-blur: initial;
      --tw-backdrop-brightness: initial;
      --tw-backdrop-contrast: initial;
      --tw-backdrop-grayscale: initial;
      --tw-backdrop-hue-rotate: initial;
      --tw-backdrop-invert: initial;
      --tw-backdrop-opacity: initial;
      --tw-backdrop-saturate: initial;
      --tw-backdrop-sepia: initial;
      --tw-ease: initial;
      --tw-content: "";
      --tw-translate-x: 0;
      --tw-translate-y: 0;
      --tw-translate-z: 0;
    }
  }
}

@layer theme {
  :root, :host {
    --color-amber-50: oklch(98.7% .022 95.277);
    --color-amber-600: oklch(66.6% .179 58.318);
    --color-amber-700: oklch(55.5% .163 48.998);
    --color-emerald-50: oklch(97.9% .021 166.113);
    --color-emerald-500: oklch(69.6% .17 162.48);
    --color-emerald-600: oklch(59.6% .145 163.225);
    --color-emerald-700: oklch(50.8% .118 165.612);
    --color-blue-50: oklch(97% .014 254.604);
    --color-blue-600: oklch(54.6% .245 262.881);
    --color-blue-700: oklch(48.8% .243 264.376);
    --color-violet-50: oklch(96.9% .016 293.756);
    --color-violet-600: oklch(54.1% .281 293.009);
    --color-violet-700: oklch(49.1% .27 292.581);
    --color-rose-50: oklch(96.9% .015 12.422);
    --color-rose-500: oklch(64.5% .246 16.439);
    --color-rose-600: oklch(58.6% .253 17.585);
    --color-rose-700: oklch(51.4% .222 16.935);
    --color-slate-50: oklch(98.4% .003 247.858);
    --color-slate-100: oklch(96.8% .007 247.896);
    --color-slate-200: oklch(92.9% .013 255.508);
    --color-slate-400: oklch(70.4% .04 256.788);
    --color-slate-500: oklch(55.4% .046 257.417);
    --color-slate-600: oklch(44.6% .043 257.281);
    --color-slate-700: oklch(37.2% .044 257.287);
    --color-slate-800: oklch(27.9% .041 260.031);
    --color-slate-900: oklch(20.8% .042 265.755);
    --color-white: #fff;
    --spacing: .25rem;
    --container-xs: 20rem;
    --container-md: 28rem;
    --container-lg: 32rem;
    --text-xs: 11px;
    --text-xs--line-height: calc(1 / .75);
    --text-sm: 12px;
    --text-sm--line-height: calc(1.25 / .875);
    --text-base: 14px;
    --text-base--line-height: calc(1.5 / 1);
    --text-lg: 16px;
    --text-lg--line-height: calc(1.75 / 1.125);
    --text-xl: 18px;
    --text-xl--line-height: calc(1.75 / 1.25);
    --text-2xl: 22px;
    --text-2xl--line-height: calc(2 / 1.5);
    --text-3xl: 26px;
    --text-4xl: 30px;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --tracking-wide: .025em;
    --leading-tight: 1.25;
    --radius-xs: .125rem;
    --radius-sm: .25rem;
    --radius-md: .375rem;
    --radius-lg: .5rem;
    --radius-xl: .75rem;
    --radius-2xl: 1rem;
    --ease-in-out: cubic-bezier(.4, 0, .2, 1);
    --animate-spin: spin 1s linear infinite;
    --default-transition-duration: .15s;
    --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    --text-md: 13px;
  }
}

@layer base, components;

@layer utilities {
  .collapse {
    visibility: collapse;
  }

  .visible {
    visibility: visible;
  }

  .sr-only {
    clip-path: inset(50%);
    white-space: nowrap;
    border-width: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    position: absolute;
    overflow: hidden;
  }

  .absolute {
    position: absolute;
  }

  .fixed {
    position: fixed;
  }

  .relative {
    position: relative;
  }

  .static {
    position: static;
  }

  .sticky {
    position: sticky;
  }

  .inset-0 {
    inset: 0;
  }

  .-top-0\.5 {
    top: calc(var(--spacing) * -.5);
  }

  .-right-0\.5 {
    right: calc(var(--spacing) * -.5);
  }

  .right-0 {
    right: 0;
  }

  .z-20 {
    z-index: 20;
  }

  .z-50 {
    z-index: 50;
  }

  .container {
    width: 100%;
  }

  @media (min-width: 40rem) {
    .container {
      max-width: 40rem;
    }
  }

  @media (min-width: 48rem) {
    .container {
      max-width: 48rem;
    }
  }

  @media (min-width: 64rem) {
    .container {
      max-width: 64rem;
    }
  }

  @media (min-width: 80rem) {
    .container {
      max-width: 80rem;
    }
  }

  @media (min-width: 96rem) {
    .container {
      max-width: 96rem;
    }
  }

  .mx-auto {
    margin-inline: auto;
  }

  .mt-1 {
    margin-top: var(--spacing);
  }

  .mt-2 {
    margin-top: calc(var(--spacing) * 2);
  }

  .mt-4 {
    margin-top: calc(var(--spacing) * 4);
  }

  .mt-6 {
    margin-top: calc(var(--spacing) * 6);
  }

  .mt-auto {
    margin-top: auto;
  }

  .mb-1 {
    margin-bottom: var(--spacing);
  }

  .mb-2 {
    margin-bottom: calc(var(--spacing) * 2);
  }

  .mb-3 {
    margin-bottom: calc(var(--spacing) * 3);
  }

  .mb-4 {
    margin-bottom: calc(var(--spacing) * 4);
  }

  .mb-6 {
    margin-bottom: calc(var(--spacing) * 6);
  }

  .ml-auto {
    margin-left: auto;
  }

  .block {
    display: block;
  }

  .flex {
    display: flex;
  }

  .grid {
    display: grid;
  }

  .hidden {
    display: none;
  }

  .inline {
    display: inline;
  }

  .inline-flex {
    display: inline-flex;
  }

  .table {
    display: table;
  }

  .h-2\.5 {
    height: calc(var(--spacing) * 2.5);
  }

  .h-4 {
    height: calc(var(--spacing) * 4);
  }

  .h-5 {
    height: calc(var(--spacing) * 5);
  }

  .h-6 {
    height: calc(var(--spacing) * 6);
  }

  .h-8 {
    height: calc(var(--spacing) * 8);
  }

  .h-9 {
    height: calc(var(--spacing) * 9);
  }

  .h-10 {
    height: calc(var(--spacing) * 10);
  }

  .h-11 {
    height: calc(var(--spacing) * 11);
  }

  .h-12 {
    height: calc(var(--spacing) * 12);
  }

  .h-14 {
    height: calc(var(--spacing) * 14);
  }

  .h-16 {
    height: calc(var(--spacing) * 16);
  }

  .h-screen {
    height: 100vh;
  }

  .max-h-\[70vh\] {
    max-height: 70vh;
  }

  .min-h-screen {
    min-height: 100vh;
  }

  .w-2\.5 {
    width: calc(var(--spacing) * 2.5);
  }

  .w-4 {
    width: calc(var(--spacing) * 4);
  }

  .w-5 {
    width: calc(var(--spacing) * 5);
  }

  .w-6 {
    width: calc(var(--spacing) * 6);
  }

  .w-8 {
    width: calc(var(--spacing) * 8);
  }

  .w-9 {
    width: calc(var(--spacing) * 9);
  }

  .w-10 {
    width: calc(var(--spacing) * 10);
  }

  .w-11 {
    width: calc(var(--spacing) * 11);
  }

  .w-12 {
    width: calc(var(--spacing) * 12);
  }

  .w-14 {
    width: calc(var(--spacing) * 14);
  }

  .w-44 {
    width: calc(var(--spacing) * 44);
  }

  .w-64 {
    width: calc(var(--spacing) * 64);
  }

  .w-full {
    width: 100%;
  }

  .max-w-lg {
    max-width: var(--container-lg);
  }

  .max-w-md {
    max-width: var(--container-md);
  }

  .max-w-xs {
    max-width: var(--container-xs);
  }

  .min-w-0 {
    min-width: 0;
  }

  .min-w-4 {
    min-width: calc(var(--spacing) * 4);
  }

  .flex-1 {
    flex: 1;
  }

  .flex-shrink {
    flex-shrink: 1;
  }

  .flex-shrink-0 {
    flex-shrink: 0;
  }

  .grow {
    flex-grow: 1;
  }

  .border-collapse {
    border-collapse: collapse;
  }

  .transform {
    transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
  }

  .animate-spin {
    animation: var(--animate-spin);
  }

  .cursor-pointer {
    cursor: pointer;
  }

  .resize {
    resize: both;
  }

  .grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flex-col {
    flex-direction: column;
  }

  .flex-wrap {
    flex-wrap: wrap;
  }

  .items-center {
    align-items: center;
  }

  .items-start {
    align-items: flex-start;
  }

  .justify-between {
    justify-content: space-between;
  }

  .justify-center {
    justify-content: center;
  }

  .justify-end {
    justify-content: flex-end;
  }

  .gap-1 {
    gap: var(--spacing);
  }

  .gap-1\.5 {
    gap: calc(var(--spacing) * 1.5);
  }

  .gap-2 {
    gap: calc(var(--spacing) * 2);
  }

  .gap-3 {
    gap: calc(var(--spacing) * 3);
  }

  .gap-4 {
    gap: calc(var(--spacing) * 4);
  }

  :where(.space-y-0\.5 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));
    margin-block-end: calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)));
  }

  :where(.space-y-1 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(var(--spacing) * var(--tw-space-y-reverse));
    margin-block-end: calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)));
  }

  :where(.space-y-2 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));
    margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)));
  }

  :where(.space-y-3 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));
    margin-block-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
  }

  :where(.space-y-6 > :not(:last-child)) {
    --tw-space-y-reverse: 0;
    margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));
    margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)));
  }

  .truncate {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .overflow-hidden {
    overflow: hidden;
  }

  .overflow-y-auto {
    overflow-y: auto;
  }

  .rounded {
    border-radius: .25rem;
  }

  .rounded-2xl {
    border-radius: var(--radius-2xl);
  }

  .rounded-full {
    border-radius: 3.40282e38px;
  }

  .rounded-lg {
    border-radius: var(--radius-lg);
  }

  .rounded-xl {
    border-radius: var(--radius-xl);
  }

  .border {
    border-style: var(--tw-border-style);
    border-width: 1px;
  }

  .border-t {
    border-top-style: var(--tw-border-style);
    border-top-width: 1px;
  }

  .border-r {
    border-right-style: var(--tw-border-style);
    border-right-width: 1px;
  }

  .border-b {
    border-bottom-style: var(--tw-border-style);
    border-bottom-width: 1px;
  }

  .border-dashed {
    --tw-border-style: dashed;
    border-style: dashed;
  }

  .border-slate-50 {
    border-color: var(--color-slate-50);
  }

  .border-slate-100 {
    border-color: var(--color-slate-100);
  }

  .border-slate-200 {
    border-color: var(--color-slate-200);
  }

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

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

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

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

  .bg-rose-500 {
    background-color: var(--color-rose-500);
  }

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

  .bg-slate-50\/60 {
    background-color: #f8fafc99;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-slate-50\/60 {
      background-color: color-mix(in oklab, var(--color-slate-50) 60%, transparent);
    }
  }

  .bg-slate-100 {
    background-color: var(--color-slate-100);
  }

  .bg-slate-200 {
    background-color: var(--color-slate-200);
  }

  .bg-slate-900\/40 {
    background-color: #0f172b66;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-slate-900\/40 {
      background-color: color-mix(in oklab, var(--color-slate-900) 40%, transparent);
    }
  }

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

  .bg-white {
    background-color: var(--color-white);
  }

  .bg-white\/15 {
    background-color: #ffffff26;
  }

  @supports (color: color-mix(in lab, red, red)) {
    .bg-white\/15 {
      background-color: color-mix(in oklab, var(--color-white) 15%, transparent);
    }
  }

  .bg-gradient-to-br {
    --tw-gradient-position: to bottom right in oklab;
    background-image: linear-gradient(var(--tw-gradient-stops));
  }

  .p-1 {
    padding: var(--spacing);
  }

  .p-2 {
    padding: calc(var(--spacing) * 2);
  }

  .p-3 {
    padding: calc(var(--spacing) * 3);
  }

  .p-4 {
    padding: calc(var(--spacing) * 4);
  }

  .p-5 {
    padding: calc(var(--spacing) * 5);
  }

  .p-6 {
    padding: calc(var(--spacing) * 6);
  }

  .p-8 {
    padding: calc(var(--spacing) * 8);
  }

  .px-1 {
    padding-inline: var(--spacing);
  }

  .px-1\.5 {
    padding-inline: calc(var(--spacing) * 1.5);
  }

  .px-2 {
    padding-inline: calc(var(--spacing) * 2);
  }

  .px-3 {
    padding-inline: calc(var(--spacing) * 3);
  }

  .px-4 {
    padding-inline: calc(var(--spacing) * 4);
  }

  .px-5 {
    padding-inline: calc(var(--spacing) * 5);
  }

  .px-6 {
    padding-inline: calc(var(--spacing) * 6);
  }

  .py-0\.5 {
    padding-block: calc(var(--spacing) * .5);
  }

  .py-1 {
    padding-block: var(--spacing);
  }

  .py-1\.5 {
    padding-block: calc(var(--spacing) * 1.5);
  }

  .py-2 {
    padding-block: calc(var(--spacing) * 2);
  }

  .py-3 {
    padding-block: calc(var(--spacing) * 3);
  }

  .py-4 {
    padding-block: calc(var(--spacing) * 4);
  }

  .py-5 {
    padding-block: calc(var(--spacing) * 5);
  }

  .py-12 {
    padding-block: calc(var(--spacing) * 12);
  }

  .py-16 {
    padding-block: calc(var(--spacing) * 16);
  }

  .pb-1 {
    padding-bottom: var(--spacing);
  }

  .text-center {
    text-align: center;
  }

  .text-left {
    text-align: left;
  }

  .text-right {
    text-align: right;
  }

  .text-2xl {
    font-size: var(--text-2xl);
    line-height: var(--tw-leading, var(--text-2xl--line-height));
  }

  .text-base {
    font-size: var(--text-base);
    line-height: var(--tw-leading, var(--text-base--line-height));
  }

  .text-lg {
    font-size: var(--text-lg);
    line-height: var(--tw-leading, var(--text-lg--line-height));
  }

  .text-sm {
    font-size: var(--text-sm);
    line-height: var(--tw-leading, var(--text-sm--line-height));
  }

  .text-xl {
    font-size: var(--text-xl);
    line-height: var(--tw-leading, var(--text-xl--line-height));
  }

  .text-xs {
    font-size: var(--text-xs);
    line-height: var(--tw-leading, var(--text-xs--line-height));
  }

  .text-\[10px\] {
    font-size: 10px;
  }

  .leading-tight {
    --tw-leading: var(--leading-tight);
    line-height: var(--leading-tight);
  }

  .font-bold {
    --tw-font-weight: var(--font-weight-bold);
    font-weight: var(--font-weight-bold);
  }

  .font-medium {
    --tw-font-weight: var(--font-weight-medium);
    font-weight: var(--font-weight-medium);
  }

  .font-semibold {
    --tw-font-weight: var(--font-weight-semibold);
    font-weight: var(--font-weight-semibold);
  }

  .tracking-wide {
    --tw-tracking: var(--tracking-wide);
    letter-spacing: var(--tracking-wide);
  }

  .break-all {
    word-break: break-all;
  }

  .text-amber-600 {
    color: var(--color-amber-600);
  }

  .text-amber-700 {
    color: var(--color-amber-700);
  }

  .text-blue-600 {
    color: var(--color-blue-600);
  }

  .text-blue-700 {
    color: var(--color-blue-700);
  }

  .text-emerald-500 {
    color: var(--color-emerald-500);
  }

  .text-emerald-600 {
    color: var(--color-emerald-600);
  }

  .text-emerald-700 {
    color: var(--color-emerald-700);
  }

  .text-rose-500 {
    color: var(--color-rose-500);
  }

  .text-rose-600 {
    color: var(--color-rose-600);
  }

  .text-rose-700 {
    color: var(--color-rose-700);
  }

  .text-slate-200 {
    color: var(--color-slate-200);
  }

  .text-slate-400 {
    color: var(--color-slate-400);
  }

  .text-slate-500 {
    color: var(--color-slate-500);
  }

  .text-slate-600 {
    color: var(--color-slate-600);
  }

  .text-slate-700 {
    color: var(--color-slate-700);
  }

  .text-slate-800 {
    color: var(--color-slate-800);
  }

  .text-slate-900 {
    color: var(--color-slate-900);
  }

  .text-violet-600 {
    color: var(--color-violet-600);
  }

  .text-violet-700 {
    color: var(--color-violet-700);
  }

  .text-white {
    color: var(--color-white);
  }

  .capitalize {
    text-transform: capitalize;
  }

  .uppercase {
    text-transform: uppercase;
  }

  .italic {
    font-style: italic;
  }

  .underline {
    text-decoration-line: underline;
  }

  .opacity-0 {
    opacity: 0;
  }

  .opacity-70 {
    opacity: .7;
  }

  .shadow-2xl {
    --tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, #00000040);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .shadow-lg {
    --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, #0000001a), 0 4px 6px -4px var(--tw-shadow-color, #0000001a);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .shadow-xl {
    --tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, #0000001a), 0 8px 10px -6px var(--tw-shadow-color, #0000001a);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .ring {
    --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .outline {
    outline-style: var(--tw-outline-style);
    outline-width: 1px;
  }

  .invert {
    --tw-invert: invert(100%);
    filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
  }

  .filter {
    filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
  }

  .backdrop-blur {
    --tw-backdrop-blur: blur(8px);
    -webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
    backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
  }

  .backdrop-filter {
    -webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
    backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
  }

  .transition {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .ease-in-out {
    --tw-ease: var(--ease-in-out);
    transition-timing-function: var(--ease-in-out);
  }

  @media (hover: hover) {
    .group-hover\:opacity-100:is(:where(.group):hover *) {
      opacity: 1;
    }
  }

  .peer-disabled\:opacity-50:is(:where(.peer):disabled ~ *) {
    opacity: .5;
  }

  .after\:absolute:after {
    content: var(--tw-content);
    position: absolute;
  }

  .after\:top-0\.5:after {
    content: var(--tw-content);
    top: calc(var(--spacing) * .5);
  }

  .after\:left-0\.5:after {
    content: var(--tw-content);
    left: calc(var(--spacing) * .5);
  }

  .after\:h-5:after {
    content: var(--tw-content);
    height: calc(var(--spacing) * 5);
  }

  .after\:w-5:after {
    content: var(--tw-content);
    width: calc(var(--spacing) * 5);
  }

  .after\:rounded-full:after {
    content: var(--tw-content);
    border-radius: 3.40282e38px;
  }

  .after\:bg-white:after {
    content: var(--tw-content);
    background-color: var(--color-white);
  }

  .after\:transition-all:after {
    content: var(--tw-content);
    transition-property: all;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .peer-checked\:after\:translate-x-5:is(:where(.peer):checked ~ *):after {
    content: var(--tw-content);
    --tw-translate-x: calc(var(--spacing) * 5);
    translate: var(--tw-translate-x) var(--tw-translate-y);
  }

  .last\:border-0:last-child {
    border-style: var(--tw-border-style);
    border-width: 0;
  }

  @media (hover: hover) {
    .hover\:bg-slate-50:hover {
      background-color: var(--color-slate-50);
    }

    .hover\:bg-slate-50\/50:hover {
      background-color: #f8fafc80;
    }

    @supports (color: color-mix(in lab, red, red)) {
      .hover\:bg-slate-50\/50:hover {
        background-color: color-mix(in oklab, var(--color-slate-50) 50%, transparent);
      }
    }

    .hover\:bg-slate-100:hover {
      background-color: var(--color-slate-100);
    }

    .hover\:text-slate-900:hover {
      color: var(--color-slate-900);
    }
  }

  @media (min-width: 40rem) {
    .sm\:grid-cols-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 48rem) {
    .md\:grid-cols-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 64rem) {
    .lg\:grid-cols-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lg\:grid-cols-4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }
}

@property --tw-rotate-x {
  syntax: "*";
  inherits: false
}

@property --tw-rotate-y {
  syntax: "*";
  inherits: false
}

@property --tw-rotate-z {
  syntax: "*";
  inherits: false
}

@property --tw-skew-x {
  syntax: "*";
  inherits: false
}

@property --tw-skew-y {
  syntax: "*";
  inherits: false
}

@property --tw-space-y-reverse {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}

@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-leading {
  syntax: "*";
  inherits: false
}

@property --tw-font-weight {
  syntax: "*";
  inherits: false
}

@property --tw-tracking {
  syntax: "*";
  inherits: false
}

@property --tw-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-inset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-ring-inset {
  syntax: "*";
  inherits: false
}

@property --tw-ring-offset-width {
  syntax: "<length>";
  inherits: false;
  initial-value: 0;
}

@property --tw-ring-offset-color {
  syntax: "*";
  inherits: false;
  initial-value: #fff;
}

@property --tw-ring-offset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-outline-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-blur {
  syntax: "*";
  inherits: false
}

@property --tw-brightness {
  syntax: "*";
  inherits: false
}

@property --tw-contrast {
  syntax: "*";
  inherits: false
}

@property --tw-grayscale {
  syntax: "*";
  inherits: false
}

@property --tw-hue-rotate {
  syntax: "*";
  inherits: false
}

@property --tw-invert {
  syntax: "*";
  inherits: false
}

@property --tw-opacity {
  syntax: "*";
  inherits: false
}

@property --tw-saturate {
  syntax: "*";
  inherits: false
}

@property --tw-sepia {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-drop-shadow-size {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-blur {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-brightness {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-contrast {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-grayscale {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-hue-rotate {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-invert {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-opacity {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-saturate {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-sepia {
  syntax: "*";
  inherits: false
}

@property --tw-ease {
  syntax: "*";
  inherits: false
}

@property --tw-content {
  syntax: "*";
  inherits: false;
  initial-value: "";
}

@property --tw-translate-x {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}

@property --tw-translate-y {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}

@property --tw-translate-z {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
:root {
  /* ==========================================================================
     Colour system — 70 : 20 : 10
       70% dominant   neutral canvas + white surfaces (--bg, --app-bg, --surface)
       20% secondary  one slate scale for text, borders, headers, sidebar, icons
       10% accent     the theme colour (--primary, set by ThemePicker) — primary
                      actions, active/selected states, links, focus, progress
     Status colours (success / warning / danger) are functional only: badges,
     alerts, validation. Never use them, or any other hue, for decoration.
     ========================================================================== */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-150: #e8edf2;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --accent-soft: color-mix(in srgb, var(--primary) 10%, #fff);
  --accent-muted: color-mix(in srgb, var(--primary) 32%, #fff);

  --success-soft: #dcfce7;
  --success-muted: #bbf7d0;
  --success-strong: #15803d;
  --warning-soft: #fef3c7;
  --warning-muted: #fde68a;
  --warning-strong: #b45309;
  --danger-soft: #fee2e2;
  --danger-muted: #fecaca;
  --danger-strong: #b91c1c;

  /* 70% — dominant */
  --bg: var(--slate-100);
  --surface: #ffffff;
  --surface-raised: var(--slate-50);
  --surface-hover: var(--slate-100);
  /* Main layout (shell + content) background */
  --app-bg: var(--slate-50);
  /* Button elevation — a tight contact shadow plus a soft ambient one.
     Pressed swaps to an inset so the button reads as travelling downward. */
  --shadow-btn:
    0 1px 1px rgba(15, 23, 42, 0.04),
    0 1px 3px -1px rgba(15, 23, 42, 0.1);
  --shadow-btn-hover:
    0 1px 1px rgba(15, 23, 42, 0.04),
    0 4px 10px -4px rgba(15, 23, 42, 0.22);
  --shadow-btn-active: inset 0 1px 2px rgba(15, 23, 42, 0.16);
  /* Card elevation — same contact + ambient pairing as buttons, but softer
     and wider, since cards are large surfaces rather than hit targets. */
  --shadow-card:
    0 1px 1px rgba(15, 23, 42, 0.03),
    0 8px 18px -14px rgba(15, 23, 42, 0.26);
  --shadow-card-hover:
    0 1px 1px rgba(15, 23, 42, 0.03),
    0 14px 26px -16px rgba(15, 23, 42, 0.34);
  /* 20% — secondary */
  --heading: var(--slate-900);
  --text: var(--slate-800);
  --muted: var(--slate-500);
  --border: var(--slate-200);
  --border-strong: var(--slate-400);
  --sidebar: var(--slate-50);
  --sidebar-hover: var(--slate-150);
  --topbar-bg: #ffffff;
  --input-bg: #ffffff;
  --input-border: var(--slate-300);
  --input-placeholder: var(--slate-500);

  /* 10% — accent (ThemeContext overrides these at runtime) */
  --primary: #038387;
  --primary-dark: #006468;
  --primary-darker: #004b4f;
  --primary-soft: #dff0f0;
  --sidebar-active: var(--primary-soft);

  /* Status — functional only */
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: var(--radius-md);
  --font: "Outfit", sans-serif;

  /* Typography scale — the only font sizes the ERP uses (see styles/typography.css).
     These names intentionally replace Tailwind's --text-* theme values too. */
  --text-xs: 11px;   /* badges, metadata */
  --text-sm: 12px;   /* table headers, helper text, filter labels */
  --text-md: 13px;   /* table content, labels, buttons, navigation */
  --text-base: 14px; /* body, inputs */
  --text-lg: 16px;   /* card headings, subheadings */
  --text-xl: 18px;   /* section headings, modal titles */
  --text-2xl: 22px;  /* report titles, compact metrics */
  --text-3xl: 26px;  /* page titles, dashboard metrics */
  --text-4xl: 30px;  /* hero metrics */
  --text-nav-sub: 12.5px; /* sidebar submenu items */
  --text-page-title: clamp(22px, 1.2vw + 12px, 26px); /* fluid page titles */

  /* Spacing — 4 / 8 point grid. Use these instead of ad-hoc px values. */
  --space-0-5: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;

  /* Radius — pills (999px) are reserved for badges, tags, avatars. */
  --radius-xs: 4px;  /* tiny controls, chips */
  --radius-sm: 6px;  /* inputs, buttons */
  --radius-md: 8px;  /* cards, panels */
  --radius-lg: 12px; /* modals, large containers */

  /* Component heights */
  --control-height: 38px;    /* inputs, selects, standard buttons */
  --control-height-sm: 32px; /* compact buttons, icon buttons */
  --row-height: 44px;        /* table body rows (minimum) */
  --topbar-height: 64px;

  /* Elevation — cards stay flat; only overlays float. */
  --shadow-popover: 0 4px 16px -4px rgba(15, 23, 42, 0.16), 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-modal: 0 24px 48px -12px rgba(15, 23, 42, 0.28);

  /* Motion — 150–250ms, never decorative. */
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* Breakpoints (reference — CSS vars can't be used in @media):
     mobile < 640 · tablet 640–1024 · desktop 1024–1440 · large > 1440 */

  --leading-title: 1.2;
  --leading-heading: 1.3;
  --leading-body: 1.5;
  --leading-table: 1.4;
  --tracking-title: -0.02em;
  --tracking-caps: 0.03em;
}

/* Dark mode lives in one block near the end of this file. */

* {
  box-sizing: border-box;
}

html,
body,
button,
input,
select,
textarea,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Outfit", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

/* Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--app-bg);
}

.sidebar {
  width: 272px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--border);
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.02);
}

/* Two-column sidebar (SmartHR-style) */
.sidebar.two-col {
  width: auto;
  flex-direction: row;
  align-items: stretch;
  overflow: visible;
  z-index: 30;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.sidebar.two-col.is-collapsed {
  width: 88px;
}

.sidebar.two-col.is-expanded {
  width: 328px;
}

.sidebar-rail {
  --rail-accent: var(--primary-darker);
  width: 64px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3) 0 var(--space-3);
  margin: var(--space-3) var(--space-3);
  background: #ffffff;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
  z-index: 40;
  overflow: visible;
  position: relative;
  height: calc(100vh - 20px);
  max-height: calc(100vh - 20px);
}

.sidebar-mark {
  position: relative;
  width: 56px;
  height: 40px;
  padding: 0;
  margin: 2px 0 0;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-mark:hover {
  background: var(--slate-50);
  filter: none;
}

.sidebar-mark-letter {
  display: none;
}

.sidebar-mark-img {
  width: 52px;
  height: 28px;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.sidebar-rail-mods {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: visible;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0 var(--space-2);
  scrollbar-width: none;
}

.sidebar-rail-mods::-webkit-scrollbar {
  display: none;
}

.sidebar-rail-mods::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--slate-150);
  flex-shrink: 0;
  margin: 2px 0 var(--space-1);
}

.sidebar-rail-tools {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
  flex-shrink: 0;
  overflow: visible;
  position: relative;
  z-index: 5;
  background: transparent;
}

.sidebar-rail-tools::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--slate-150);
  flex-shrink: 0;
  margin: var(--space-1) 0 2px;
}

.sidebar-rail-btn {
  position: relative;
  width: 36px;
  height: var(--control-height);
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--slate-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
}

.sidebar-rail-btn:hover,
.sidebar-rail-btn.open {
  background: transparent;
  color: var(--slate-500);
}

.sidebar-rail-mods .sidebar-rail-btn.active {
  background: var(--rail-accent, #0f766e);
  color: #fff;
}

.sidebar-rail-mods .sidebar-rail-btn.active::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: var(--rail-accent, #0f766e);
}

.sidebar-rail-ico {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  line-height: 1;
  color: inherit;
}

.sidebar-rail-ico .nav-ico-svg,
.sidebar-rail-ico svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.sidebar-rail-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 var(--space-1);
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.sidebar-rail-tip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--slate-900);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 220px;
  line-height: 1.25;
}

.sidebar-rail-tip::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--slate-900);
}

.sidebar-rail-tip.is-floating {
  position: fixed;
  left: auto;
  transform: translateY(-50%);
  opacity: 1;
  visibility: visible;
  z-index: 5000;
}

.sidebar-rail-tip-sub {
  font-size: var(--text-xs);
  opacity: 0.8;
  font-weight: 400;
}

.sidebar-rail-btn:hover .sidebar-rail-tip,
.sidebar-rail-btn:focus-visible .sidebar-rail-tip,
.sidebar-mark:hover .sidebar-rail-tip,
.sidebar-mark:focus-visible .sidebar-rail-tip {
  opacity: 1;
  visibility: visible;
}

.sidebar-rail-more {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  overflow: visible;
  z-index: 6;
}

.sidebar-rail-tray {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: var(--space-2);
  min-width: 196px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  z-index: 4000;
  pointer-events: auto;
}

.sidebar-rail-btn[aria-expanded="true"] > .sidebar-rail-tip {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sidebar-rail-tray .sidebar-rail-btn,
.sidebar-rail-tray .theme-picker.is-compact,
.sidebar-rail-tray .notif-bell.is-compact {
  width: 100%;
  justify-content: flex-start;
}

.sidebar-rail-tray .sidebar-rail-btn {
  height: var(--control-height);
  padding: 0 var(--space-3);
  gap: var(--space-3);
  border-radius: var(--radius-xs);
  width: 100%;
  color: inherit;
}

.sidebar-rail-tray .sidebar-rail-btn:hover,
.sidebar-rail-tray .sidebar-rail-btn.open,
.sidebar-rail-tray .sidebar-rail-btn.active {
  background: var(--sidebar-hover);
  color: inherit;
  box-shadow: none;
  transform: none;
}

.sidebar-rail-tray .sidebar-rail-tip {
  position: static;
  transform: none;
  opacity: 1;
  visibility: visible;
  background: none;
  color: inherit;
  box-shadow: none;
  padding: 0;
  font-weight: 500;
  font-size: var(--text-md);
  max-width: none;
  white-space: nowrap;
}

.sidebar-rail-tray .sidebar-rail-tip::before,
.sidebar-rail-tray .sidebar-rail-tip-sub {
  display: none;
}

.sidebar-rail-user {
  position: relative;
  margin-top: 2px;
}

.sidebar-rail-avatar-btn,
.sidebar-rail-avatar-btn.active,
.sidebar-rail-avatar-btn:hover {
  width: 36px;
  height: var(--control-height);
  background: transparent !important;
  box-shadow: none !important;
  color: inherit;
  transform: none;
}

.sidebar-rail-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--rail-accent, #0f766e);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sidebar-rail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-rail-user-menu {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  padding: var(--space-2);
  z-index: 50;
}

.sidebar-rail-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-1);
}

.sidebar-rail-user-meta strong {
  font-size: var(--text-md);
  font-weight: 500;
}

.notif-bell.is-compact {
  position: relative;
}

.notif-bell.is-rail {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
}

.notif-bell.is-rail .bell-pop {
  left: calc(100% + 8px);
  right: auto;
  top: auto;
  bottom: 0;
  z-index: 4001;
}

.notif-bell.is-compact .bell-pop {
  left: calc(100% + 8px);
  right: auto;
  top: auto;
  bottom: 0;
}

.sidebar-panel {
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--sidebar);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.sidebar.two-col .sidebar-nav {
  padding: var(--space-2) 0 var(--space-4);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.sidebar.two-col .nav-section {
  margin: var(--space-2) var(--space-3) var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--heading);
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  border-radius: var(--radius-xs);
  border-left: 3px solid var(--primary);
  line-height: 1.3;
}

.sidebar.two-col .nav-link {
  margin: 1px var(--space-2);
  padding: var(--space-2) var(--space-3);
  gap: var(--space-3);
  font-size: var(--text-md);
  font-weight: 500;
  border-radius: var(--radius-xs);
  width: calc(100% - 16px);
  color: var(--slate-800);
  border-left: 3px solid transparent;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, border-color var(--duration-fast) ease;
  box-sizing: border-box;
}

.sidebar.two-col .nav-link:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--sidebar));
  color: var(--primary-darker, #005a9e);
  border-left-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 14%, transparent);
}

.sidebar.two-col .nav-link.active {
  background: var(--sidebar-active);
  color: var(--primary-darker, #005a9e);
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar.two-col .nav-link:hover .nav-ico,
.sidebar.two-col .nav-link.active .nav-ico {
  color: var(--primary);
}

.sidebar.two-col .nav-ico {
  width: 18px;
  height: 18px;
  color: var(--slate-600);
  flex-shrink: 0;
}

.sidebar.two-col .nav-label {
  font-weight: 500;
  letter-spacing: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-rail-btn {
  transition: color var(--duration-base) ease, background var(--duration-base) ease;
}

.sidebar-rail-btn:hover {
  background: transparent;
  color: var(--slate-500);
  box-shadow: none;
  transform: none;
}

.sidebar-rail-mods .sidebar-rail-btn.active {
  background: var(--rail-accent, #0f766e);
  color: #fff;
  box-shadow: none;
}

.sidebar.two-col .nav-link-btn {
  width: calc(100% - 16px);
}

.sidebar.two-col .nav-ico--sm {
  width: 16px;
  height: 16px;
}

.sidebar.two-col .nav-ico-svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.sidebar.two-col .nav-children .nav-link.nav-child {
  padding-left: var(--space-8);
  font-size: var(--text-nav-sub);
  font-weight: 500;
}

.sidebar.two-col .nav-parent-row {
  padding-right: var(--space-2);
}

.topbar.topbar--slim {
  height: 36px;
  min-height: 36px;
  padding: 0 var(--space-4);
}

.topbar.topbar--slim .topbar-left {
  flex: 1;
  gap: var(--space-3);
}

.topbar.topbar--slim .title {
  font-size: var(--text-md);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
}

.topbar.topbar--slim .back-btn {
  min-height: 26px;
  height: 26px;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
}

.theme-picker.is-compact,
.notif-bell.is-compact {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
}

.theme-picker.is-compact .theme-picker-panel {
  left: calc(100% + 8px);
  right: auto;
  top: auto;
  bottom: 0;
  min-width: 260px;
}


.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-3) 0 var(--space-5);
  /* Distinct ultra-thin scrollbar — only visible when menus overflow */
  scrollbar-width: thin;
  scrollbar-color: var(--slate-400) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--slate-400);
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--slate-600);
}

.sidebar-nav::-webkit-scrollbar-corner {
  background: transparent;
}

.sidebar .brand {
  padding: var(--space-5) var(--space-5);
  min-height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
}

.sidebar .brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.company-logo-thumb {
  height: 28px;
  width: auto;
  max-width: 72px;
  object-fit: contain;
  display: block;
}

.company-logo-preview {
  display: block;
  margin-top: var(--space-3);
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.nav-section {
  padding: var(--space-5) var(--space-5) var(--space-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.2;
}

.nav-group + .nav-group {
  border-top: 1px solid var(--slate-150);
  margin-top: var(--space-2);
  padding-top: var(--space-1);
}

.nav-parent-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: var(--space-3);
}

.nav-parent-link {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: inherit;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  cursor: pointer;
}

.nav-caret-btn {
  flex-shrink: 0;
  width: 28px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: transform var(--duration-base) ease, background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.nav-caret-btn:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.nav-caret-btn.open {
  transform: rotate(90deg);
}

.nav-ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}

.nav-ico-svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ui-line-ico {
  display: block;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  letter-spacing: 0;
}

.nav-bullet {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-bullet::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--slate-400);
}

.nav-link.active .nav-ico {
  color: var(--primary);
}

.nav-link.active .nav-bullet::before {
  background: var(--primary);
}

.nav-children {
  padding-left: 0;
  border-left: none;
  margin-left: 0;
  overflow: hidden;
  animation: navSlideDown 0.2s ease;
}

.nav-children .nav-link.nav-child {
  padding-left: 50px;
  font-weight: 500;
  font-size: var(--text-nav-sub);
  color: var(--muted);
}

@keyframes navSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-children .nav-link {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  font-size: var(--text-nav-sub);
  font-weight: 400;
  color: var(--muted);
}

.title-project {
  color: var(--primary, #6366f1);
  font-weight: 600;
}

.scope-tag {
  margin-left: var(--space-3);
  padding: 2px var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-xs);
  background: var(--primary-soft);
  color: var(--primary-darker, #005a9e);
  vertical-align: middle;
}

.link-title {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--primary, #6366f1);
  cursor: pointer;
  text-align: left;
}

.link-title:hover {
  text-decoration: underline;
}

/* Sidebar items rendered as buttons (module launchers / Home) */
.nav-link-btn {
  width: calc(100% - 16px);
  box-sizing: border-box;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  appearance: none;
  cursor: pointer;
}

/* ---------------------- Work Items (Azure-like) ------------------------- */
.wi-panel {
  padding: 0;
  overflow: visible;
}

.wi-new {
  position: relative;
}

.wi-caret {
  font-size: 10px;
  opacity: 0.85;
}

.wi-new-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 120;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: var(--space-2);
}

.wi-new-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  background: none;
  border: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  cursor: pointer;
  color: var(--text);
}

.wi-new-item:hover {
  background: var(--surface-hover);
}

/* Work Item full-page form — Azure DevOps–style add/edit */
.panel.wif {
  padding: 0;
  background: var(--surface);
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.wif {
  padding: 0;
}

.wif-ado {
  border: none;
  border-radius: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: none;
}

.wif-fixed {
  flex-shrink: 0;
  background: var(--surface);
  z-index: 20;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.wif-scroll {
  flex: 1;
  min-height: 0;
  overflow: visible;
  background: var(--surface);
}

.wif-pagebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.wif-pagebar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wif-page-title {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.wif-back-link {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  width: fit-content;
}

.wif-back-link:hover {
  text-decoration: underline;
}

.wif-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
  z-index: 40;
}

.wif-actions .wi-new {
  position: relative;
  z-index: 41;
}

.wif-actions .wi-new-menu {
  left: auto;
  right: 0;
  z-index: 60;
}

.wif-actions .btn {
  min-width: 72px;
  padding: 0 var(--space-4);
}

.wif-banner-error {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--danger-soft);
  border-bottom: 1px solid var(--danger-muted);
  color: var(--danger-strong);
  font-size: var(--text-sm);
}

.wif-banner-success {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--success-soft);
  border-bottom: 1px solid var(--success);
  color: var(--success-strong);
  font-size: var(--text-sm);
}

.wif-banner-type {
  font-weight: 600;
  letter-spacing: 0;
}

.wif-banner-msg {
  font-weight: 500;
}

.wif-readonly-note {
  margin: 0;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.wif-title-block {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-1);
  background: var(--surface);
}

.wif-type-icon {
  width: 22px;
  height: 22px;
  font-size: 10px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  margin-top: 0;
}

.wif-title-input {
  flex: 1;
  min-width: 0;
  height: var(--control-height-sm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  box-shadow: none;
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1.2;
  padding: var(--space-1) var(--space-3);
  outline: none;
  background: var(--surface);
  color: var(--text);
}

.wif-title-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.wif-title-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.wif-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  padding: 2px var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border);
}

.wif-identity-assignee {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 200px;
  max-width: 320px;
}

.wif-identity-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--slate-300);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.wif-identity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wif-identity-assignee-field {
  flex: 1;
  min-width: 0;
}

.wif-identity-assignee-field .ss-control {
  border: none;
  background: transparent;
  padding: var(--space-1) 0;
  min-height: 28px;
  box-shadow: none;
}

.wif-identity-assignee-field .ss-control:hover,
.wif-identity-assignee-field .ss.open .ss-control {
  background: var(--surface-hover);
  border-radius: var(--radius-xs);
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

.wif-identity-meta {
  font-size: var(--text-md);
}

.wif-area-path {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: min(320px, 42vw);
}

.wif-area-path-label {
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
}

.wif-area-path-value {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
  background: var(--surface-hover);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wif-area-path-edit {
  flex: 1;
  min-width: 140px;
  max-width: 260px;
  padding: 0;
  background: transparent;
}

.wif-area-path-edit .search-select,
.wif-area-path-edit .search-select-trigger {
  width: 100%;
  font-size: var(--text-md);
}

.wif-tag-link {
  border: none;
  background: none;
  color: var(--primary);
  font-size: var(--text-md);
  cursor: pointer;
  padding: 0;
}

.wif-tag-link:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Azure gray state / classification bar */
.wif-statebar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-hover);
  border-bottom: none;
  position: relative;
  z-index: 15;
}

.wif-compact-field {
  margin: 0;
  min-width: 0;
}

.wif-compact-field > label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
}

.wif-compact-field .ss-control,
.wif-compact-field select,
.wif-readonly-chip {
  width: 100%;
  min-height: 30px;
  height: 30px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  padding-top: 2px;
  padding-bottom: 2px;
}

.wif-readonly-chip {
  display: flex;
  align-items: center;
  padding: 2px var(--space-2);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wif-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 300px) minmax(240px, 300px);
  gap: 0;
  align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.wif-cols.wif-cols-task-compact {
  grid-template-columns: minmax(240px, 360px);
  justify-content: start;
}

.wif-cols.wif-cols-task-compact .wif-col-details {
  border-right: none;
}

.wif-col {
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.wif-col-main {
  padding: 0 0 var(--space-4);
  border-right: 1px solid var(--border);
  overflow: visible;
}

.wif-proofs {
  margin-top: 0;
  padding: var(--space-3) var(--space-3) var(--space-2);
  border-top: none;
  overflow: visible;
  max-width: 100%;
  box-sizing: border-box;
}

.wif-col-details,
.wif-col-related {
  padding: 0 0 var(--space-4);
  border-right: 1px solid var(--border);
}

.wif-col-related {
  border-right: none;
}

.wif-pane-head {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border-bottom: 2px solid var(--primary);
  box-sizing: border-box;
}

.wif-pane-head-sub {
  margin-top: var(--space-1);
  border-bottom-color: var(--border-strong);
  border-bottom-width: 1px;
  min-height: 30px;
  padding-top: var(--space-3);
}

.wif-pane-empty {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.wif-related-hint {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
  padding: 0;
}

.wif-section {
  margin-bottom: 0;
}

.wif-section-main {
  padding: var(--space-3) var(--space-3) var(--space-2);
  margin-bottom: 0;
}

.wif-section-side {
  padding: var(--space-3) var(--space-3) var(--space-2);
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.wif-section-side:last-child {
  border-bottom: none;
}

.wif-section h4 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  border-bottom: none;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.wif-section-side h4 {
  font-size: var(--text-sm);
  color: var(--muted);
}

.wif-stack-padded {
  padding: var(--space-2) var(--space-3) 0;
}

.wif-hide-label > label {
  display: none;
}

.wif-proofs {
  margin-top: 0;
  padding: var(--space-3) var(--space-3) var(--space-2);
  border-top: none;
}

.wif-proofs-hint {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
}

.wif-discussion {
  margin: 0;
}

.wif-discussion .wif-ado-textarea {
  min-height: 72px;
}

.wif-discussion-note {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
}

.wif-discussion-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-2);
}

.wif-comment-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 280px;
  overflow-y: auto;
}

.wif-comment {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  background: var(--surface-hover);
}

.wif-comment-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
}

.wif-comment-body {
  font-size: var(--text-md);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.wif-mention-wrap {
  position: relative;
}

.wif-mention-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  margin: 0;
  padding: var(--space-1) 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

.wif-mention-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: none;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  text-align: left;
  cursor: pointer;
  font-size: var(--text-md);
  color: var(--text);
}

.wif-mention-item:hover,
.wif-mention-item.active {
  background: var(--surface-hover);
}

.wif-mention-name {
  font-weight: 500;
}

.wif-tinymce {
  width: 100%;
}

.wif-tinymce .tox-tinymce {
  border-radius: var(--radius-xs) !important;
  border-color: var(--border-strong) !important;
  width: 100% !important;
}

.wif-ado-field {
  margin: 0;
  gap: var(--space-1);
}

.wif-ado-field + .wif-ado-field {
  margin-top: var(--space-3);
}

.wif-req-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}

.wif-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.wif-stack .field {
  margin: 0;
}

.wif-stack .field > label,
.wif-ado-field > label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
}

.wif-stack .field input,
.wif-stack .field .ss-control {
  min-height: 30px;
  height: 30px;
  font-size: var(--text-sm);
  padding-top: 2px;
  padding-bottom: 2px;
  border-color: var(--border-strong);
}

.wif-stack .field input:hover,
.wif-stack .field .ss-control:hover {
  border-color: var(--border-strong);
}

.wif-stack .field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.wif-ado-textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.4;
  resize: vertical;
  color: var(--text);
}

.wif-ado-textarea:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.wif-ado-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: var(--surface);
}

.wif-ado-textarea::placeholder {
  color: var(--muted);
}

.wif-ado-textarea:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.wif-desc-rich {
  min-height: 120px;
  max-height: 420px;
  overflow-y: auto;
  white-space: normal;
  word-break: break-word;
  resize: vertical;
}

.wif-desc-rich:empty::before,
.wif-desc-rich[data-empty="1"]::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

.wif-desc-rich:focus {
  outline: none;
}

.wif-desc-rich-readonly {
  cursor: default;
  resize: none;
}

/* Render imported / editor HTML (tables, lists, images) correctly */
.wif-html-body,
.wif-desc-rich.wif-html-body {
  line-height: 1.45;
}

.wif-html-body p {
  margin: 0 0 0.45em;
}

.wif-html-body ul,
.wif-html-body ol {
  margin: 0.4em 0;
  padding-left: 1.4em;
}

.wif-html-body table {
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
  margin: 0.5em 0;
  display: table;
  white-space: normal;
}

.wif-html-body th,
.wif-html-body td {
  border: 1px solid var(--border, #c8c6c4);
  padding: var(--space-2) var(--space-2);
  vertical-align: top;
  text-align: left;
}

.wif-html-body th {
  background: var(--surface-hover, #f3f2f1);
  font-weight: 600;
}

.wif-html-body img {
  max-width: 100%;
  height: auto;
}

.wif-html-body blockquote {
  margin: 0.5em 0;
  padding-left: 0.8em;
  border-left: 3px solid var(--border, #c8c6c4);
}

.wif-html-body a {
  color: var(--link, #005a9e);
}

.wif-desc-inline-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-2) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-hover);
}

.wif-discussion-note {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
}

.wif-proofs {
  margin-top: var(--space-1);
  padding-top: 0;
  border-top: none;
}

.wif-proofs-hint {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
}

.wif-paste-hint {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
}

.wif-paste-hint kbd {
  display: inline-block;
  padding: 0 var(--space-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface-hover);
  font-size: 10px;
  font-family: Consolas, "Courier New", monospace;
}

.wif-paste-zone {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-sm);
  cursor: text;
  outline: none;
}

.wif-paste-zone strong {
  color: var(--text);
  font-size: var(--text-sm);
}

.wif-paste-zone:focus,
.wif-paste-zone.wif-paste-active,
.wif-ado-textarea.wif-paste-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.wif-paste-previews {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.wif-paste-preview {
  margin: 0;
  width: 120px;
}

.wif-paste-preview img,
.wif-proof-thumb {
  display: block;
  width: 100%;
  max-width: 160px;
  max-height: 100px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-hover);
}

.wif-paste-preview figcaption {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wif-proof-thumb-link {
  display: inline-block;
  margin-top: var(--space-2);
}

.wif-proof-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  padding: 0;
  background: transparent;
  border: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.wif-proof-row .field {
  margin: 0;
  min-width: 0;
  gap: var(--space-1);
}

.wif-proof-name {
  flex: 1 1 140px;
  min-width: 0;
}

.wif-proof-file {
  flex: 1 1 160px;
  min-width: 0;
}

.wif-proof-row .field > label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}

.wif-proof-name input {
  width: 100%;
  height: 30px;
  min-height: 30px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  font-size: var(--text-sm);
  color: var(--text);
  box-shadow: none;
  box-sizing: border-box;
}

.wif-proof-name input:hover {
  border-color: var(--border-strong);
}

.wif-proof-name input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.wif-proof-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-height: 30px;
  min-width: 0;
}

.wif-file-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.wif-file-pick:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.wif-file-name {
  flex: 1 1 80px;
  min-width: 0;
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wif-proof-remove {
  flex: 0 0 auto;
  height: 30px;
  white-space: nowrap;
  align-self: end;
  margin: 0;
}

.wif-add-proof {
  height: 30px;
  margin-top: 2px;
}

.wif-stack .field input:disabled,
.wif-stack .field textarea:disabled {
  background: var(--surface-hover);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}

.wif-approval-note {
  margin: var(--space-1) 0 0;
  padding: 0;
  font-size: var(--text-xs);
}

.wif-error {
  margin: var(--space-2) var(--space-4) 0;
}

/* Sprint form — 2-column ADO layout */
.sprint-cols {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
}

.sprint-col-main {
  min-width: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.sprint-col-side {
  min-width: 0;
  padding: 0 0 var(--space-4);
  background: var(--surface);
}

.sprint-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-3);
}

.sprint-form .wif-title-input {
  border-color: var(--border-strong);
}

.sprint-form .wif-stack .field > label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
}

.sprint-form .sms {
  border-color: var(--border-strong);
  border-radius: var(--radius-xs);
}

.sprint-form .sms:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.sprint-form .sms-search {
  font-size: var(--text-sm);
  min-height: 30px;
  padding: var(--space-1) var(--space-2);
}

.sprint-form .sms-chip {
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
  background: var(--surface-hover);
  border: none;
}

.sprint-form .wif-section-side {
  border-bottom: none;
}

.sprint-field-hint {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
}

/* Resource Allocation form */
.alloc-cols {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.alloc-col {
  min-width: 0;
  padding: 0 0 var(--space-4);
}

.alloc-form .wif-section-side {
  border-bottom: none;
}

.alloc-form .wif-stack .field > label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
}

.alloc-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-3);
}

.alloc-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 2px 0 var(--space-1);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.alloc-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.alloc-form .wif-title-input {
  border-color: var(--border-strong);
  cursor: default;
  background: var(--surface-raised);
}

.alloc-form .wif-title-input:focus {
  border-color: var(--border-strong);
  box-shadow: none;
}

.alloc-hours-summary {
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-xs);
  background: var(--surface-raised, #f3f2f1);
  border: 1px solid var(--border, #edebe9);
}

.alloc-schedule-preview {
  color: var(--success-strong);
  font-weight: 500;
}

@media (max-width: 960px) {
  .alloc-cols,
  .alloc-pair {
    grid-template-columns: 1fr;
  }
}

/* Resource allocation — holiday/leave date picker */
.alloc-date-picker {
  position: relative;
}

.alloc-date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong, #d2d0ce);
  border-radius: var(--radius-xs);
  background: var(--surface, #fff);
  color: var(--text, #323130);
  font-size: var(--text-base);
  cursor: pointer;
  text-align: left;
}

.alloc-date-trigger:hover:not(:disabled) {
  border-color: var(--primary);
}

.alloc-date-trigger:disabled,
.alloc-date-trigger.is-muted {
  cursor: not-allowed;
  opacity: 0.65;
  background: var(--surface-raised, #f3f2f1);
}

.alloc-date-placeholder {
  color: var(--muted, #605e5c);
}

.alloc-date-icon {
  font-size: var(--text-base);
  line-height: 1;
  opacity: 0.75;
}

.alloc-date-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  min-width: 280px;
  padding: var(--space-3);
  border: 1px solid var(--border-strong, #d2d0ce);
  border-radius: var(--radius-sm);
  background: var(--surface, #fff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.alloc-date-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.alloc-date-month {
  font-weight: 500;
  font-size: var(--text-md);
}

.alloc-date-loading {
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

.alloc-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.alloc-date-dow {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted, #605e5c);
  padding: var(--space-1) 0;
}

.alloc-date-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text, #323130);
  font-size: var(--text-sm);
  cursor: pointer;
}

.alloc-date-cell.empty {
  pointer-events: none;
}

.alloc-date-cell:not(.is-blocked):not(.is-out-of-range):hover {
  background: var(--surface-hover, #f3f2f1);
  border-color: var(--border, #edebe9);
}

.alloc-date-cell.is-selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.alloc-date-cell.is-selected .alloc-date-marker {
  color: #fff;
  background: rgba(255, 255, 255, 0.25);
}

.alloc-date-cell.is-holiday:not(.is-selected) {
  background: var(--warning-soft);
}

.alloc-date-cell.is-leave:not(.is-selected) {
  background: var(--danger-soft);
}

.alloc-date-cell.is-non-working:not(.is-selected) {
  background: var(--danger-muted);
}

.alloc-date-cell.is-blocked,
.alloc-date-cell.is-out-of-range {
  cursor: not-allowed;
  opacity: 0.72;
}

.alloc-date-cell.is-blocked:not(.is-selected) {
  text-decoration: line-through;
}

.alloc-date-num {
  line-height: 1.2;
  font-weight: 500;
}

.alloc-date-marker {
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  margin-top: 1px;
  padding: 1px var(--space-1);
  border-radius: var(--radius-xs);
}

.alloc-date-cell.is-holiday .alloc-date-marker {
  background: var(--warning);
  color: #fff;
}

.alloc-date-cell.is-leave .alloc-date-marker {
  background: var(--danger);
  color: #fff;
}

.alloc-date-cell.is-non-working .alloc-date-marker {
  background: var(--danger);
  color: #fff;
}

.alloc-date-legend {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border, #edebe9);
  font-size: var(--text-xs);
  color: var(--muted, #605e5c);
}

.alloc-date-marker-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin-right: var(--space-1);
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  font-weight: 600;
  color: #fff;
}

.alloc-date-marker-pill.is-holiday {
  background: var(--warning);
}

.alloc-date-marker-pill.is-leave {
  background: var(--danger);
}

.alloc-date-marker-pill.is-non-working {
  background: var(--danger);
}

html[data-theme="dark"] .alloc-date-popover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .alloc-date-cell.is-holiday:not(.is-selected) {
  background: #5c3d1e;
}

html[data-theme="dark"] .alloc-date-cell.is-leave:not(.is-selected) {
  background: #5c2a28;
}

@media (max-width: 1100px) {
  .wif-cols {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
  }

  .wif-col-related {
    grid-column: 1 / -1;
  }

  .sprint-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .wif-statebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wif-cols {
    grid-template-columns: 1fr;
  }

  .wif-col-related {
    grid-column: auto;
  }

  .wif-proof-row {
    flex-direction: column;
    align-items: stretch;
  }

  .wif-proof-name,
  .wif-proof-file {
    flex: 1 1 auto;
    width: 100%;
  }

  .wif-proof-remove {
    width: fit-content;
    align-self: flex-start;
  }

  .sprint-cols {
    grid-template-columns: 1fr;
  }

  .sprint-dates {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.wi-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}

.wi-filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-left: auto;
}

.wi-filters select,
.wi-search {
  height: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid var(--input-border, #d1d5db);
  border-radius: var(--radius-xs);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  background-color: var(--input-bg, #f3f4f6);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.wi-filters .ss {
  min-width: 160px;
  max-width: 220px;
}

.wi-filters .ss-control {
  height: auto;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  box-sizing: border-box;
}

.wi-date-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wi-date-field span {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

.wi-date-field input[type="date"] {
  height: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid var(--input-border, #d1d5db);
  border-radius: var(--radius-xs);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  background-color: var(--input-bg, #f3f4f6);
  color: inherit;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.wi-cell-long {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-picker {
  position: relative;
}

.col-picker-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: 260px;
  max-height: 360px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.col-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-1);
}

.col-picker-hint {
  margin: 0 var(--space-3) var(--space-2);
  font-size: var(--text-xs);
}

.col-picker-list {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-2);
  overflow: auto;
  max-height: 280px;
}

.col-picker-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  cursor: grab;
}

.col-picker-item:hover {
  background: var(--surface-hover);
}

.col-picker-item.is-on label {
  font-weight: 600;
}

.col-picker-grip {
  color: var(--muted);
  font-size: var(--text-sm);
  letter-spacing: -2px;
  user-select: none;
  width: 14px;
}

.col-picker-item label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  cursor: pointer;
  min-width: 0;
}

.sortable-th.is-draggable {
  cursor: grab;
}

.wi-search {
  min-width: 200px;
}

.wi-table {
  width: 100%;
  border-collapse: collapse;
}

.wi-table th {
  text-align: left;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
  white-space: nowrap;
  line-height: 1.2;
}

.wi-table td {
  padding: var(--space-1) var(--space-3);
  border-bottom: 1px solid var(--slate-150);
  font-size: var(--text-md);
  vertical-align: middle;
  line-height: 1.25;
  white-space: nowrap;
}

.wi-table td.wi-title {
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wi-table tr:hover td {
  background: var(--surface-hover);
}

.wi-table td:last-child {
  white-space: nowrap;
}

.wi-table td:last-child .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  min-height: 32px;
  height: 32px;
  padding: 0 var(--space-3);
  font-size: var(--text-md);
  line-height: 1;
  margin: 0 2px 0 0;
}

.wi-type {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.wi-type-box {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-xs);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wi-title {
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

.wi-title:hover {
  color: var(--primary, #6366f1);
  text-decoration: underline;
}

.wi-state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
  font-size: var(--text-sm);
}

.wi-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ---------------------- Project Summary (Azure-like) -------------------- */
.proj-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.ps-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.ps-title {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.ps-title h1 {
  margin: 0;
  font-size: var(--text-page-title);
}

.ps-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-xl);
}

.ps-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.ps-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: var(--space-5);
}

.ps-members {
  grid-column: 1 / -1;
}

.ps-about h3,
.ps-stats h3,
.ps-members h3 {
  margin-top: 0;
}

.ps-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.ps-meta-label {
  display: block;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.ps-meta-value {
  display: block;
  font-weight: 500;
  margin-top: 2px;
}

.ps-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.ps-stat {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
}

.ps-stat-link {
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.ps-stat-link:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
  transform: none;
}

.ps-type-link {
  border: none;
  cursor: pointer;
  font: inherit;
}

.ps-type-link:hover {
  text-decoration: underline;
}

.ps-stat-num {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--primary, #6366f1);
}

.ps-stat-label {
  font-size: var(--text-sm);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ps-bytype {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ps-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--text-md);
  font-weight: 600;
}

@media (max-width: 880px) {
  .ps-grid {
    grid-template-columns: 1fr;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  margin: 1px var(--space-2);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
}

.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary-darker);
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-link.sub {
  padding-left: var(--space-8);
  font-size: var(--text-nav-sub);
  color: var(--muted);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.back-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1;
  padding: 0 var(--space-3);
  cursor: pointer;
  border-radius: 0;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
  vertical-align: middle;
  white-space: nowrap;
}

.back-btn:hover {
  background: var(--sidebar-hover);
  color: var(--primary-darker);
  border-color: var(--primary);
}

.back-arrow {
  font-size: 15px;
  line-height: 1;
}

.topbar .title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
}

.badge {
  background: var(--primary-soft);
  color: var(--primary-darker);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* ---- User menu dropdown ---- */
.user-menu-wrap { position: relative; }
.user-menu-toggle {
  display: flex; align-items: center; gap: var(--space-2);
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3); cursor: pointer; color: inherit; font-size: var(--text-base);
}
.user-menu-toggle:hover { background: var(--surface-hover); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: var(--text-md);
  overflow: hidden; flex-shrink: 0;
}
.user-avatar-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { transition: transform var(--duration-base); }
.user-caret.open { transform: rotate(180deg); }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 180px; z-index: 500; padding: var(--space-1) 0;
}
.user-dropdown-item {
  display: flex; align-items: center; gap: var(--space-2); width: 100%;
  padding: var(--space-2) var(--space-4); border: none; background: none;
  font-size: var(--text-md); cursor: pointer; color: var(--text);
}
.user-dropdown-item:hover { background: var(--surface-hover); }
.user-dropdown-item.logout { color: var(--danger, #d32f2f); }

/* ---- My Profile ---- */
.profile-page {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-1) var(--space-1) var(--space-9);
}
.profile-head { margin-bottom: var(--space-4); }
.profile-head h1 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-page-title);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.profile-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: var(--space-5) var(--space-5) var(--space-5);
}
.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.profile-section-head h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}
.profile-lock,
.profile-edit-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  color: var(--muted, #666);
  background: var(--surface-hover, #f5f5f5);
}
.profile-edit-badge {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.profile-photo-btn {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--border);
  padding: 0;
  overflow: hidden;
  background: var(--surface-hover);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-photo-btn:hover .profile-photo-hint { opacity: 1; }
.profile-photo-hint {
  position: absolute;
  inset: auto 0 0;
  padding: var(--space-1) 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
}
.profile-photo-img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-fallback {
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--primary);
}
.profile-hero-meta { min-width: 0; flex: 1; }
.profile-hero-meta h2 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xl);
  font-weight: 600;
}
.profile-hero-sub {
  margin: 0 0 var(--space-3);
  color: var(--muted, #666);
  font-size: var(--text-md);
}
.profile-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-5);
  margin: 0;
}
.profile-meta-grid > div {
  padding: var(--space-3) var(--space-3);
  background: var(--surface-hover, #f7f7f7);
  border: 1px solid var(--border);
}
.profile-meta-grid dt {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #666);
}
.profile-meta-grid dd {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 500;
  word-break: break-word;
}
.profile-save-bar {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-1) 0 2px;
}
.profile-actions { margin-top: var(--space-4); display: flex; gap: var(--space-3); }
.profile-docs .profile-doc-upload { margin-bottom: var(--space-2); }
.profile-pending-files {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}
.profile-pending-files li::before {
  content: "• ";
  color: var(--primary);
}
.profile-doc-list {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}
.profile-doc-empty { padding: var(--space-1) 0; }
.profile-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--border);
  background: var(--surface);
}
.profile-note { margin-top: var(--space-2); }
.profile-page .form-grid label.span-2,
.profile-page .profile-actions.span-2 { grid-column: 1 / -1; }
.profile-page .form-grid label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted, #555);
}
.profile-page .form-grid input,
.profile-page .form-grid select,
.profile-page .form-grid textarea {
  font-weight: 500;
  color: var(--text);
}
.profile-page .alert {
  padding: var(--space-3) var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-base);
  border: 1px solid var(--border);
}
.profile-page .alert.error {
  background: color-mix(in srgb, var(--danger, #d32f2f) 10%, transparent);
  color: var(--danger, #d32f2f);
  border-color: color-mix(in srgb, var(--danger, #d32f2f) 35%, var(--border));
}
.profile-page .alert.success {
  background: color-mix(in srgb, var(--success) 10%, transparent);
  color: var(--success-strong);
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}
.profile-page .muted.small { font-size: var(--text-sm); margin: 0; }
@media (max-width: 640px) {
  .profile-hero { flex-direction: column; align-items: flex-start; }
  .profile-meta-grid { grid-template-columns: 1fr; }
}

/* ---- Change password modal ---- */
.cpw-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 9000;
}
.cpw-modal {
  background: var(--surface); border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  width: 400px; max-width: 94vw; padding: var(--space-6);
}
.cpw-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.cpw-header h3 { margin: 0; font-size: var(--text-lg); }
.cpw-close {
  background: none; border: none; font-size: var(--text-2xl); cursor: pointer;
  color: var(--text-secondary); line-height: 1;
}
.cpw-close:hover { color: var(--text); }
.cpw-actions { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-5); }

.content {
  /* padding: 24px; */
  flex: 1;
  background: var(--app-bg);
}

.content.content--flush {
  padding-top: 0;
}

/* Cards / stats */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-5);
  transition: box-shadow var(--duration-base) ease, transform var(--duration-base) ease;
}

.card:hover {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.06);
}

.card-clickable {
  cursor: pointer;
  transition: box-shadow var(--duration-base) ease, transform var(--duration-base) ease;
}

button.card.pm-stat {
  display: flex;
  width: 100%;
  align-items: stretch;
  justify-content: space-between;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  min-height: 92px;
}

.crm-dash-block h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg);
  font-weight: 600;
}

.crm-dash-block + .crm-dash-block {
  margin-top: var(--space-1);
}

.crm-dash-block .cards {
  margin-bottom: var(--space-5);
}

.crm-dash-tabs {
  margin: 0 0 var(--space-4);
  max-width: 100%;
  overflow-x: auto;
}

.crm-dash .card.pm-stat,
.crm-dash button.card.pm-stat {
  color: #ffffff;
}

.crm-dash .card.pm-stat .label,
.crm-dash .card.pm-stat .value,
.crm-dash .card.pm-stat .crm-dash-hint {
  color: #ffffff;
}

.crm-dash-hint {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  line-height: 1.35;
  color: #ffffff;
}

.crm-dash-report {
  margin-top: 0;
}

.crm-dash-report .table-wrap {
  overflow-x: auto;
}

.crm-dash-report th.num,
.crm-dash-report td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.crm-dash-row-click {
  cursor: pointer;
}

.crm-dash-row-click:hover {
  background: rgba(15, 23, 42, 0.04);
}

.crm-dash-overdue-due {
  color: var(--danger-strong);
  font-weight: 600;
  white-space: nowrap;
}

.crm-exec-period {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 var(--space-4);
}

.crm-exec-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.crm-exec-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  min-height: 118px;
  padding: var(--space-4) var(--space-4) var(--space-4);
  border: 0;
  border-radius: var(--radius-lg);
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  box-shadow: none;
}

.crm-exec-kpi.is-clickable {
  cursor: pointer;
}

.crm-exec-kpi.is-clickable:hover {
  transform: none;
}

.crm-exec-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
}

.crm-exec-kpi-label {
  font-size: var(--text-sm);
  font-weight: 500;
  opacity: 0.82;
}

.crm-exec-kpi-value {
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.crm-exec-kpi-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.crm-exec-kpi-hint {
  font-size: var(--text-xs);
  opacity: 0.7;
}

.crm-exec-delta {
  font-size: var(--text-sm);
  font-weight: 500;
}

.crm-exec-delta.is-up {
  color: var(--success-strong);
}

.crm-exec-delta.is-down {
  color: var(--danger-strong);
}

.crm-exec-delta.is-flat {
  color: var(--slate-500);
}

.crm-exec-kpi--blue {
  background: var(--accent-soft);
  color: var(--primary);
}

.crm-exec-kpi--green {
  background: var(--accent-soft);
  color: var(--primary-darker);
}

.crm-exec-kpi--purple {
  background: var(--slate-100);
  color: var(--primary);
}

.crm-exec-kpi--orange {
  background: var(--accent-soft);
  color: var(--primary);
}

.crm-exec-kpi--rose {
  background: var(--slate-100);
  color: var(--primary);
}

.crm-exec-kpi--blue .crm-exec-kpi-icon { color: var(--primary); }
.crm-exec-kpi--green .crm-exec-kpi-icon { color: var(--primary); }
.crm-exec-kpi--purple .crm-exec-kpi-icon { color: var(--primary); }
.crm-exec-kpi--orange .crm-exec-kpi-icon { color: var(--primary); }
.crm-exec-kpi--rose .crm-exec-kpi-icon { color: var(--primary); }

.crm-exec-report {
  margin-top: 0;
}

.crm-exec-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.crm-exec-toolbar h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}

.crm-exec-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.crm-exec-toolbar-actions .erp-search {
  width: min(240px, 100%);
}

.crm-exec-report .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.crm-exec-report th.num,
.crm-exec-report td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.crm-exec-total td {
  font-weight: 600;
  background: var(--slate-50);
}

.crm-exec-ach {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 108px;
}

.crm-exec-ach-bar {
  flex: 1;
  height: 8px;
  min-width: 64px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--slate-200);
}

.crm-exec-ach-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--success);
}

.crm-exec-ach-label {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
}

.crm-exec-overdue {
  color: var(--danger-strong);
  font-weight: 600;
}

.crm-exec-acts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 108px;
  font-size: var(--text-xs);
  line-height: 1.35;
  white-space: nowrap;
  color: var(--slate-600);
}

.crm-exec-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.crm-exec-chart {
  min-width: 0;
}

.crm-exec-chart h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .crm-exec-kpis,
  .crm-exec-charts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .crm-exec-kpis,
  .crm-exec-charts {
    grid-template-columns: 1fr;
  }

  .crm-exec-toolbar,
  .crm-exec-toolbar-actions,
  .crm-exec-period {
    justify-content: stretch;
  }

  .crm-exec-toolbar-actions .erp-search,
  .crm-exec-toolbar-actions .export-btns,
  .crm-exec-toolbar-actions .col-picker {
    width: 100%;
  }

  .crm-exec-kpi-value {
    font-size: var(--text-3xl);
  }
}

html[data-theme="dark"] .crm-exec-kpi--blue {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
  color: var(--primary);
}

html[data-theme="dark"] .crm-exec-kpi--green {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
  color: var(--primary);
}

html[data-theme="dark"] .crm-exec-kpi--purple {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
  color: var(--primary);
}

html[data-theme="dark"] .crm-exec-kpi--orange {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
  color: var(--primary);
}

html[data-theme="dark"] .crm-exec-kpi--rose {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
  color: var(--primary);
}

html[data-theme="dark"] .crm-exec-kpi-icon {
  background: rgba(15, 23, 42, 0.35);
}

html[data-theme="dark"] .crm-exec-total td {
  background: #1e293b;
}

html[data-theme="dark"] .crm-exec-acts {
  color: #cbd5e1;
}

html[data-theme="dark"] .crm-exec-ach-bar {
  background: #334155;
}

@media (max-width: 720px) {
  .crm-dash-hint {
    font-size: var(--text-xs);
  }
}

.card-clickable:hover {
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);
  transform: none;
}

.card-link {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--primary);
}

.ra-filters {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.ra-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  align-items: flex-end;
}

.ra-filters-row .field {
  margin: 0;
  min-width: 160px;
}

.ra-filters-hint {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
}

.ra-avail-table {
  width: 100%;
  border-collapse: collapse;
}

.ra-avail-group {
  border-top: 1px solid var(--border);
}

.ra-avail-summary td {
  padding: var(--space-3) var(--space-3);
  vertical-align: middle;
}

.ra-avail-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.ra-avail-toggle:hover {
  text-decoration: underline;
}

.ra-avail-caret {
  color: var(--muted);
  font-size: var(--text-sm);
  width: 12px;
}

.ra-avail-detail-row > td {
  padding: 0 var(--space-3) var(--space-3) var(--space-8);
  background: var(--surface-raised);
}

.ra-avail-detail {
  width: 100%;
  max-width: 520px;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ra-avail-detail th,
.ra-avail-detail td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-size: var(--text-md);
}

.ra-avail-detail thead th {
  background: var(--surface-hover);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.ra-avail-detail tbody tr + tr td {
  border-top: 1px solid var(--slate-100);
}

.ra-avail-leave td {
  background: var(--slate-100);
  color: var(--danger-strong);
}

.ra-avail-weekend td {
  background: var(--surface-raised);
  color: var(--muted);
}

.proj-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.proj-card-compact {
  padding: var(--space-3) var(--space-4) !important;
}

.proj-strip {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  min-height: 36px;
}

.proj-strip-name {
  font-size: var(--text-lg);
  font-weight: 600;
  flex: 1 1 160px;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proj-strip-meta {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  white-space: nowrap;
}

.proj-strip-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 500;
}

.proj-strip-value {
  font-size: var(--text-md);
  color: var(--text);
}

.proj-strip-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

/* Projects list — clean table layout */
.pm-projects-page {
  max-width: 1180px;
}

.pm-projects-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.pm-projects-header h1 {
  margin: 0;
  font-size: var(--text-page-title);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.pm-projects-sub {
  margin: var(--space-1) 0 0;
  font-size: var(--text-md);
  color: var(--muted);
}

.pm-projects-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.pm-projects-panel {
  padding: 0;
  overflow: hidden;
}

.pm-projects-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}

.pm-projects-search {
  flex: 1;
  min-width: 0;
  height: var(--control-height-sm);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--text-md);
  color: var(--text);
}

.pm-projects-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.pm-projects-status-filter {
  width: 200px;
  flex-shrink: 0;
}

.pm-projects-table-wrap {
  overflow-x: auto;
}

.pm-projects-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.pm-projects-table th,
.pm-projects-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-md);
}

.pm-projects-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}

.pm-projects-table tbody tr:last-child td {
  border-bottom: none;
}

.pm-projects-table tbody tr:hover td {
  background: var(--surface-hover);
}

.pm-projects-table th:nth-child(1),
.pm-projects-table td:nth-child(1) {
  width: 22%;
}

.pm-projects-table th:nth-child(2),
.pm-projects-table td:nth-child(2),
.pm-projects-table th:nth-child(3),
.pm-projects-table td:nth-child(3),
.pm-projects-table th:nth-child(4),
.pm-projects-table td:nth-child(4) {
  width: 14%;
}

.pm-projects-table th:nth-child(5),
.pm-projects-table td:nth-child(5) {
  width: 10%;
}

.pm-projects-actions-col,
.pm-projects-table th:nth-child(6),
.pm-projects-table td:nth-child(6) {
  width: 16%;
  min-width: 148px;
  text-align: right;
}

.pm-projects-name {
  display: block;
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  font-size: var(--text-base);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.pm-projects-name:hover {
  color: var(--primary-darker);
  text-decoration: underline;
}

.pm-projects-code {
  margin-top: 2px;
  font-size: var(--text-sm);
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
}

.pm-projects-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: nowrap;
  white-space: nowrap;
}

.pm-projects-link {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border: none;
  background: none;
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border-radius: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  line-height: 1.3;
}

.pm-projects-link + .pm-projects-link {
  border-left: 1px solid var(--border);
}

.pm-projects-link:hover {
  color: var(--primary-darker);
  background: transparent;
}

.pm-projects-link-primary {
  color: var(--primary-dark);
  font-weight: 500;
}

/* Compact professional action buttons (not badges) */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height-sm);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  border: none;
  background: var(--slate-100);
  color: var(--text, #323130);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-btn);
  transition: background var(--duration-fast) ease, box-shadow var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.ui-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 2;
}

.ui-btn:hover:not(:disabled) {
  background: var(--surface-hover, #f3f2f1);
  box-shadow: var(--shadow-btn-hover);
}

.ui-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: var(--shadow-btn-active);
}

.ui-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.ui-btn--sm {
  min-height: var(--control-height-sm);
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.ui-btn--icon {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  background: transparent !important;
  border: none;
  box-shadow: none;
}

.ui-btn--icon:hover:not(:disabled) {
  background: color-mix(in srgb, currentColor 12%, transparent) !important;
  box-shadow: none;
}

html[data-theme="dark"] .ui-btn--icon {
  background: transparent !important;
}

html[data-theme="dark"] .ui-btn--icon:hover:not(:disabled) {
  background: color-mix(in srgb, currentColor 18%, transparent) !important;
}

.ui-hover-tip {
  position: fixed;
  transform: translate(-50%, -100%);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--slate-900);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.ui-hover-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--slate-900);
}

.ui-btn--edit,
.ui-btn--primary-soft {
  background: var(--accent-soft);
  color: var(--primary);
}

.ui-btn--invite,
.ui-btn--purple {
  background: var(--slate-150);
  color: var(--primary);
}

.ui-btn--docs,
.ui-btn--amber {
  background: var(--accent-soft);
  color: var(--primary-darker);
}

.ui-btn--open,
.ui-btn--green {
  background: var(--slate-100);
  color: var(--success-strong);
}

.ui-btn--danger,
.ui-btn--delete {
  background: var(--danger-soft);
  color: var(--danger-strong);
}

.ui-btn--neutral {
  background: var(--slate-100);
  color: var(--slate-700);
}

.ui-btn--solid {
  background: var(--primary, #0078d4);
  border: none;
  color: #fff;
}

.ui-btn--solid:hover:not(:disabled) {
  background: var(--primary-dark, #106ebe);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 22%, transparent);
}

.report-total-row td {
  font-weight: 600;
  background: var(--slate-50);
  border-top: 2px solid var(--border, #e2e8f0);
  color: var(--text, #1f2937);
}

.report-total-label {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: var(--text-xs);
  color: var(--muted, #64748b);
}

.ui-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--text-md);
  line-height: 1.4;
}

.ui-alert-success {
  background: var(--slate-100);
  border-color: var(--success);
  color: var(--success-strong);
}

.ui-alert-error {
  background: var(--danger-soft);
  border-color: var(--danger-muted);
  color: var(--danger-strong);
}

.ui-alert-info {
  background: var(--accent-soft);
  border-color: var(--accent-muted);
  color: var(--primary);
}

.ui-alert-warn {
  background: var(--warning-soft);
  border-color: var(--warning-muted);
  color: var(--warning-strong);
}

.ui-alert-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  padding: 0 2px;
}

.ui-alert-close:hover {
  opacity: 1;
}

.pm-projects-panel {
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.pm-projects-table tfoot td {
  padding: var(--space-3) var(--space-4);
}

.pm-projects-empty {
  padding: var(--space-9) var(--space-6);
  text-align: center;
}

.pm-projects-empty h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  font-weight: 600;
}

.pm-projects-empty p {
  margin: 0 0 var(--space-4);
}

.pm-projects-empty .btn {
  margin-top: var(--space-1);
}

@media (max-width: 900px) {
  .pm-projects-header {
    flex-direction: column;
  }

  .pm-projects-table th:nth-child(2),
  .pm-projects-table td:nth-child(2),
  .pm-projects-table th:nth-child(3),
  .pm-projects-table td:nth-child(3),
  .pm-projects-table th:nth-child(4),
  .pm-projects-table td:nth-child(4) {
    display: none;
  }

  .pm-projects-table th:nth-child(1),
  .pm-projects-table td:nth-child(1) {
    width: 40%;
  }

  .pm-projects-actions-col,
  .pm-projects-table th:nth-child(6),
  .pm-projects-table td:nth-child(6) {
    width: 45%;
    min-width: 0;
  }
}

.proj-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-3);
}

.proj-grid-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-7);
}

.proj-grid-inline .proj-detail {
  min-width: 0;
}

.members-more {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

.proj-detail {
  display: flex;
  flex-direction: column;
}

.proj-detail-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 500;
}

.proj-detail-value {
  font-size: var(--text-base);
  margin-top: 2px;
}

.proj-people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}

.proj-documents {
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
}

.proj-doc-list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.proj-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.proj-doc-name {
  font-size: var(--text-base);
  font-weight: 500;
  word-break: break-word;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.alloc-head,
.alloc-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.7fr;
  gap: var(--space-2);
  align-items: center;
}

.alloc-head {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 500;
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border);
}

.alloc-row {
  padding: var(--space-2) 0;
}

.alloc-row input {
  padding: var(--space-2) var(--space-2);
}

.alloc-emp {
  font-size: var(--text-md);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .label {
  color: var(--muted);
  font-size: var(--text-md);
}

.card .value {
  font-size: var(--text-3xl);
  font-weight: 600;
  margin-top: var(--space-2);
}

.dash-report {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-height: 65vh;
  overflow-y: auto;
  padding-right: var(--space-1);
}

.dash-report-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}

.dash-report-mini-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.dash-report-mini-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dash-report-mini-value {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text);
}

.dash-report-section h4 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  color: var(--text);
}

.dash-modules {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-1) 0 var(--space-2);
}

.dash-module-btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.dash-module-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.panel-header h2 {
  margin: 0;
  font-size: var(--text-xl);
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-md);
}

th,
td {
  text-align: left;
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr:hover {
  background: var(--surface-raised);
}

.table-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Buttons — one shared height across the app */
.btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  height: var(--control-height);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-4);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-btn);
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease, transform var(--duration-fast) ease;
  vertical-align: middle;
  white-space: nowrap;
}

.btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-btn-hover);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-btn-active);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn.secondary:hover {
  background: var(--surface-hover);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.btn.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
}

/* Same height as .btn — only slightly tighter horizontal padding */
.btn.small {
  min-height: var(--control-height-sm);
  height: var(--control-height-sm);
  padding: 0 var(--space-3);
  font-size: var(--text-md);
  line-height: 1;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.field.full {
  grid-column: 1 / -1;
}

/* CRM Groups — compact single-line form */
.crm-groups-page .crm-groups-page-header {
  margin-bottom: var(--space-2);
}
.crm-groups-page .crm-groups-page-header h1 {
  margin: 0;
  font-size: var(--text-page-title);
}
.crm-groups-form {
  margin-bottom: var(--space-3);
  padding: var(--space-3) var(--space-4);
}
.crm-groups-form-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.crm-groups-form-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}
.crm-groups-form-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.crm-groups-error {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
}
.crm-groups-form-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  align-items: end;
}
.crm-groups-form-row--company {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.crm-groups-form-row--ids {
  margin-top: var(--space-2);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 720px;
}
.crm-groups-field .field-label {
  font-size: var(--text-xs);
  margin-bottom: 2px;
}
.crm-groups-field input,
.crm-groups-form-row .ss .ss-control {
  min-height: 32px;
}
.crm-groups-contacts {
  margin-top: var(--space-3);
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: var(--space-2);
}
.crm-groups-contacts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.crm-groups-contacts-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.crm-groups-contacts-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(220px, 40vh);
}
.crm-groups-contact-labels,
.crm-groups-contact-row {
  display: grid;
  grid-template-columns:
    minmax(88px, 1fr)
    minmax(100px, 1.1fr)
    minmax(80px, 0.85fr)
    minmax(88px, 0.95fr)
    minmax(88px, 0.95fr)
    minmax(110px, 1.2fr)
    32px;
  gap: var(--space-2);
  align-items: center;
  min-width: 860px;
}
.crm-req {
  color: var(--danger-strong);
  font-weight: 600;
}
.crm-groups-contact-labels {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted, #6b7280);
  margin-bottom: var(--space-1);
  padding-right: 2px;
}
.crm-groups-contact-row {
  margin-bottom: var(--space-1);
}
.crm-groups-contact-row input {
  min-height: 30px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-md);
}
.crm-groups-contact-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-xs);
  background: var(--input-bg, #f3f4f6);
  color: var(--muted, #6b7280);
  cursor: pointer;
}
.crm-groups-contact-remove:hover:not(:disabled) {
  color: var(--danger-strong);
  border-color: var(--danger-muted);
  background: var(--slate-100);
}
.crm-groups-contact-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.crm-groups-list {
  padding: var(--space-3) var(--space-4);
}
.crm-groups-list-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}
.crm-groups-list table {
  font-size: var(--text-md);
}
.crm-groups-list .rm-empty {
  padding: var(--space-3) 0;
}
.pm-clients-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pm-clients-ids {
  max-width: 960px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pm-clients-active {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 52px;
}
.pm-clients-active input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: var(--space-2);
}
@media (max-width: 960px) {
  .crm-groups-form-row,
  .crm-groups-form-row--company,
  .crm-groups-form-row--ids,
  .pm-clients-ids {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
}
@media (max-width: 640px) {
  .crm-groups-form-row,
  .crm-groups-form-row--company,
  .crm-groups-form-row--ids,
  .pm-clients-ids {
    grid-template-columns: 1fr;
  }
}

.field label {
  font-size: var(--text-md);
  color: var(--muted);
  font-weight: 500;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="image"]),
select,
textarea {
  height: auto;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--input-border, #d1d5db);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  line-height: 1.25rem;
  font-weight: 400;
  font-family: inherit;
  color: var(--heading, #201f1e);
  background-color: var(--input-bg, #f3f4f6);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

select:not([multiple]) {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-right: var(--space-8);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="image"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary, #0078d4);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary, #0078d4) 25%, transparent),
    0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder, #6b7280);
}

.field label {
  color: var(--text);
}

/* ---- Consistent field sizing across the app ---- */
.field input,
.field select,
.field textarea,
.field .ss,
.field .sms {
  width: 100%;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field .ss-control {
  height: auto;
  min-height: 36px;
}

.field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
}

/* Description / any textarea keeps its own defined size */
.field textarea,
textarea {
  min-height: 84px;
  height: auto;
  resize: vertical;
}

/* CRM create/edit pages use the same bordered panel rhythm as EmployeeForm. */
.crm-resource-form {
  overflow: visible;
}

.crm-resource-form > .error {
  margin-bottom: var(--space-4);
}

.crm-resource-form > h4 {
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-base);
}

.crm-resource-form .form-grid {
  align-items: start;
}

.crm-resource-form .field {
  min-width: 0;
}

.crm-resource-form .crm-field-error {
  margin: var(--space-2) 0 0;
  color: var(--danger-strong);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.crm-resource-form .field.has-error input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="image"]),
.crm-resource-form .field.has-error textarea,
.crm-resource-form .field.has-error select,
.crm-resource-form .field.has-error .ss-control {
  border: 1px solid var(--danger);
}

.crm-resource-form .field.has-error input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="image"]):focus,
.crm-resource-form .field.has-error textarea:focus,
.crm-resource-form .field.has-error select:focus,
.crm-resource-form .field.has-error .ss.open .ss-control,
.crm-resource-form .field.has-error .ss-control:focus-within {
  border-color: var(--danger);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent),
    0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.crm-form-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.crm-masters-drop {
  position: relative;
  z-index: 20;
}

.crm-resource-form .crm-masters-drop .hm-chip-drop-trigger {
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-strong, #d1d5db);
  background: var(--surface, #fff);
  color: inherit;
  font-weight: 500;
}

.crm-resource-form .crm-masters-drop .hm-chip-drop-panel {
  min-width: 180px;
}

.crm-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.crm-field-label-row label {
  margin: 0;
}

.crm-field-add-plus {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border-strong, #d1d5db);
  border-radius: var(--radius-sm);
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  cursor: pointer;
  line-height: 0;
}

.crm-field-add-plus:hover,
.crm-field-add-plus:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.crm-company-select {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.crm-company-select-field {
  flex: 1 1 180px;
  min-width: 0;
}

.crm-company-select-add {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: var(--control-height);
}

.crm-contact-pop .ss-list {
  max-height: 220px;
}

.crm-contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.crm-contact-item input {
  width: 16px;
  height: 16px;
  margin-top: var(--space-1);
  flex: 0 0 auto;
}

.crm-contact-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.crm-contact-item-name {
  font-weight: 500;
  line-height: 1.3;
}

.crm-contact-item-meta {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.35;
  word-break: break-word;
}

.crm-lead-contacts {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.crm-lead-contact-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.crm-lead-contact-name {
  font-weight: 500;
}

.crm-lead-contact-meta {
  color: var(--muted);
  font-size: var(--text-sm);
}

.crm-quick-add-company .crm-groups-form-row {
  margin-bottom: var(--space-1);
}

@media (max-width: 900px) {
  .crm-quick-add-company .crm-groups-form-row {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 560px) {
  .crm-quick-add-company .crm-groups-form-row {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  .crm-resource-form {
    padding: var(--space-4);
  }

  .crm-resource-form .panel-header {
    align-items: flex-start;
    gap: var(--space-3);
  }

  .crm-resource-form .form-grid {
    grid-template-columns: 1fr;
  }

  .crm-resource-form .field.full {
    grid-column: auto;
  }

  .crm-company-select-add {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .crm-field-add-plus {
    width: 28px;
    height: 28px;
  }
}

/* Modal — large by default (same family as Project Health popup) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: grid;
  place-items: center;
  padding: var(--space-4);
  z-index: 5200;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: min(720px, 100%);
  max-width: 720px;
  max-height: min(90vh, 760px);
  overflow: auto;
  padding: var(--space-5) var(--space-6) var(--space-6);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-modal);
}

.modal.modal-lg {
  width: min(720px, 100%);
  max-width: 720px;
}

.modal-wide {
  width: min(960px, 100%);
  max-width: 960px;
}

.modal h3 {
  margin-top: 0;
}

/* Optional modal extras (opt-in via <Modal size="xl" animated showClose>) */
.modal.modal-lg.modal-xl {
  width: min(1140px, calc(100vw - 48px));
  max-width: min(1140px, calc(100vw - 48px));
  max-height: min(92vh, 900px);
}

.modal--closable {
  position: relative;
}

.modal--closable > h3 {
  padding-right: var(--space-8, 40px);
}

.modal-close-x {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--slate-500);
  cursor: pointer;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

.modal-close-x:hover {
  background: var(--slate-100);
  color: var(--heading);
}

.modal-close-x:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.modal-backdrop--anim {
  animation: modal-backdrop-in 220ms ease-out both;
}

.modal--anim {
  animation: modal-pop-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modal-backdrop-in {
  from { background-color: rgba(15, 23, 42, 0); }
  to { background-color: rgba(15, 23, 42, 0.35); }
}

@keyframes modal-pop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop--anim,
  .modal--anim {
    animation: none;
  }
}

.modal .field {
  min-width: 0;
}

.modal .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.modal .field select,
.modal .field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.leave-detail-heading {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text, #323130);
  border-bottom: 1px solid var(--border, #edebe9);
  padding-bottom: var(--space-2);
}

.leave-detail-section .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}

.leave-consumed-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.leave-consumed-table {
  width: max-content;
  min-width: 100%;
}

.leave-consumed-table .leave-data-col {
  min-width: 140px;
  white-space: nowrap;
}

.leave-consumed-table .leave-sticky-name {
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
}

.leave-consumed-table .leave-sticky-name .link-btn {
  text-align: left;
  white-space: normal;
}

.ewh-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ewh-table {
  width: max-content;
  min-width: 100%;
}

.ewh-table .ewh-sticky-name {
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  background-image: radial-gradient(
      circle at 20% 20%,
      color-mix(in srgb, var(--primary) 6%, transparent),
      transparent 40%
    ),
    radial-gradient(circle at 80% 80%, color-mix(in srgb, var(--primary) 5%, transparent), transparent 40%);
}

.login-card {
  background: var(--surface);
  border-radius: 0;
  padding: var(--space-8) var(--space-8);
  width: 380px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  box-shadow: 0 6.4px 14.4px rgba(0, 0, 0, 0.13), 0 1.2px 3.6px rgba(0, 0, 0, 0.11);
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.login-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: 100%;
}

.login-card h1 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-card .sub {
  color: var(--muted);
  margin-bottom: var(--space-6);
  font-size: var(--text-base);
  text-align: center;
}

.login-credit {
  margin: var(--space-5) 0 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
  letter-spacing: 0;
}

.login-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary, #0a84ff);
  font-size: var(--text-md);
  cursor: pointer;
  text-decoration: underline;
}

.login-link-btn:hover {
  opacity: 0.85;
}

.login-card .field {
  margin-bottom: var(--space-4);
}

.error {
  color: var(--danger);
  font-size: var(--text-md);
  margin-top: var(--space-2);
}

.success {
  color: var(--success-strong);
  font-size: var(--text-md);
  margin-top: var(--space-2);
}

.muted {
  color: var(--muted);
}

.pill {
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.pill.green { background: var(--success-soft); color: var(--success-strong); }
.pill.gray { background: var(--surface-hover); color: var(--muted); }
.pill.red { background: var(--danger-soft); color: var(--danger-strong); }
.pill.amber { background: var(--warning-muted); color: var(--warning-strong); }

/* ===== Roles & Permissions ===== */
.roles-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  min-height: 420px;
}
.roles-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border: 1px solid var(--border, #edebe9);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--surface-raised);
  max-height: min(70vh, 640px);
  overflow-y: auto;
}
.roles-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: var(--surface);
  cursor: pointer;
  box-shadow: none;
  font: inherit;
  color: inherit;
}
.roles-list-item:hover {
  border-color: var(--border);
  background: var(--surface-raised);
}
.roles-list-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.roles-list-name {
  font-weight: 500;
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.3;
}
.roles-list-meta {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.3;
}
.roles-editor {
  border: 1px solid var(--border, #edebe9);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  min-height: 320px;
}
.roles-editor-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
  padding: var(--space-6);
}
.roles-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-end;
  margin-bottom: var(--space-2);
}
@media (max-width: 900px) {
  .roles-layout {
    grid-template-columns: 1fr;
  }
  .roles-list {
    max-height: 220px;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .roles-list-item {
    width: auto;
    min-width: 160px;
    flex: 1 1 160px;
  }
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}
.access-module {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.access-module.on {
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 1px var(--accent-muted) inset;
}
.access-module-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-raised);
  cursor: pointer;
}
.access-module.on .access-module-head {
  background: var(--surface-hover);
}
.menu-perm-list {
  padding: var(--space-2) var(--space-2) var(--space-3);
  border-top: 1px solid var(--slate-150);
}
.menu-perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-md);
  border-radius: var(--radius-sm);
}
.menu-perm-row:hover {
  background: var(--surface-raised);
}
.menu-perm-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}
.menu-perm-actions {
  display: flex;
  gap: var(--space-3);
}
.menu-perm-act {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--muted);
  cursor: pointer;
}
.menu-perm-group {
  font-weight: 600;
  color: var(--muted);
}

.rd-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
}
.rd-filters .field { margin: 0; min-width: 160px; }
.rd-filters .rd-emp { min-width: 260px; flex: 1; }
.rd-filters .rd-actions { margin-left: auto; }

.tree-canvas {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--primary) 8%, transparent) 1px, transparent 0)
      0 0 / 22px 22px,
    linear-gradient(135deg, var(--slate-50) 0%, var(--slate-100) 100%);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  overflow-x: auto;
}

/* Hierarchy level palette — accent, tint, connector */
.tree .node.level-0,
.legend-item.level-0 { --level-accent: var(--primary); --level-bg: var(--accent-soft); --level-border: var(--accent-muted); --level-stat: var(--accent-soft); }
.tree .node.level-1,
.legend-item.level-1 { --level-accent: var(--primary-darker); --level-bg: var(--slate-50); --level-border: color-mix(in srgb, var(--primary) 20%, #fff); --level-stat: color-mix(in srgb, var(--primary) 6%, #fff); }
.tree .node.level-2,
.legend-item.level-2 { --level-accent: var(--slate-600); --level-bg: var(--slate-50); --level-border: var(--slate-300); --level-stat: var(--slate-100); }
.tree .node.level-3,
.legend-item.level-3 { --level-accent: var(--slate-600); --level-bg: var(--slate-50); --level-border: var(--slate-300); --level-stat: var(--slate-100); }
.tree .node.level-4,
.legend-item.level-4 { --level-accent: var(--slate-600); --level-bg: var(--slate-50); --level-border: var(--slate-300); --level-stat: var(--slate-100); }
.tree .node.level-5,
.legend-item.level-5 { --level-accent: var(--slate-600); --level-bg: var(--slate-50); --level-border: var(--slate-300); --level-stat: var(--slate-100); }

.hierarchy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xs);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-xs);
  background: var(--level-bg);
  border: 2px solid var(--level-accent);
  flex-shrink: 0;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--level-accent);
  background: var(--level-bg);
  border: 1px solid var(--level-border);
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.tree {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

/* Nested levels — connector color matches child level */
.tree .tree {
  margin-left: var(--space-4);
  padding-left: var(--space-5);
  border-left: 1.5px solid var(--level-accent, #c7cde8);
}

.tree .tree.tree-level-1 { --level-accent: var(--primary); }
.tree .tree.tree-level-2 { --level-accent: var(--slate-600); }
.tree .tree.tree-level-3 { --level-accent: var(--slate-600); }
.tree .tree.tree-level-4 { --level-accent: var(--slate-600); }
.tree .tree.tree-level-5 { --level-accent: var(--slate-600); }
.tree .tree.tree-level-6 { --level-accent: var(--slate-600); }

.tree li {
  position: relative;
  padding: var(--space-1) 0;
}

/* Horizontal connector from the vertical line to each child strip. */
.tree .tree > li::before {
  content: "";
  position: absolute;
  top: 22px;
  left: -20px;
  width: 20px;
  height: 1.5px;
  background: var(--level-accent, var(--border-strong));
}

.tree .node {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  min-width: 280px;
  max-width: 520px;
  padding: var(--space-3) var(--space-3);
  background: var(--level-bg, var(--surface));
  border: 1px solid var(--level-border, var(--border));
  border-left: 4px solid var(--level-accent, var(--primary));
  border-radius: var(--radius-xs);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  transition: box-shadow var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.node-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.tree .node strong {
  font-weight: 500;
  color: var(--text);
}

.node-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
}

.node-stat {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--level-stat, var(--surface-raised));
  border: 1px solid var(--level-border, var(--border));
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.node-stat-label {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: var(--text-xs);
}

.node-stat-value {
  font-weight: 500;
  color: var(--text);
}

.node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--muted);
}

.node-meta-label {
  font-weight: 500;
  color: var(--muted);
}

.tree .node:hover {
  border-color: var(--level-accent, var(--primary));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--level-accent, var(--primary)) 18%, transparent);
}

/* Inactive branches: muted accent + dimmed strip. */
.tree .node.inactive {
  --level-accent: var(--muted);
  --level-bg: var(--slate-50);
  --level-border: var(--border);
  --level-stat: var(--slate-100);
  opacity: 0.65;
}

.tree .node-actions {
  display: inline-flex;
  gap: var(--space-2);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--duration-fast) ease-in-out;
}

.tree .node:hover .node-actions {
  opacity: 1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.multi-select-box {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
}

/* Searchable single-select (combobox) */
.ss {
  position: relative;
}

.ss-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--control-height);
  border: 1px solid var(--input-border, #d1d5db);
  border-radius: var(--radius-xs);
  background-color: var(--input-bg, #f3f4f6);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  font-size: var(--text-base);
  color: var(--heading, #201f1e);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.ss-disabled .ss-control {
  cursor: not-allowed;
  background: var(--surface-hover);
  color: var(--muted);
  border-color: var(--border-strong);
}

.ss-caret {
  color: var(--muted);
  font-size: var(--text-sm);
}

.ss-pop {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  overflow: hidden;
}

.ss-pop.ss-pop-portal {
  right: auto;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.18);
}

.ss-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: var(--space-2) var(--space-3);
  outline: none;
  border-radius: 0;
}

.ss-list {
  max-height: 220px;
  overflow-y: auto;
}

.ss-item {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  cursor: pointer;
  border-bottom: 1px solid var(--slate-100);
}

.ss-item:last-child {
  border-bottom: none;
}

.ss-item:hover {
  background: var(--surface-hover);
}

.ss-item.active {
  background: var(--surface-hover);
  font-weight: 600;
}

.ss-clear {
  color: var(--muted);
  font-style: italic;
}

.ss-empty {
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-md);
}

/* Searchable multi-select */
.sms {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--surface);
}

.sms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.sms-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-hover);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
}

.sms-chip button {
  border: none;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary-dark);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 1;
  cursor: pointer;
  font-size: var(--text-md);
}

.sms-search {
  width: 100%;
  border: none;
  padding: var(--space-2) var(--space-3);
  outline: none;
  border-radius: 0;
  background: transparent;
}

.sms-pop {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  overflow: hidden;
}

.sms-list {
  max-height: 220px;
  overflow-y: auto;
}

.sms-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  cursor: pointer;
  border-bottom: 1px solid var(--slate-100);
}

.sms-item:last-child {
  border-bottom: none;
}

.sms-item:hover {
  background: var(--surface-hover);
}

.sms-item input {
  width: 16px;
  height: 16px;
}

.sms-empty {
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-md);
}

.multi-select-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 2px;
  font-size: var(--text-base);
  cursor: pointer;
  border-bottom: 1px solid var(--slate-100);
}

.multi-select-item:last-child {
  border-bottom: none;
}

.multi-select-item input {
  width: 16px;
  height: 16px;
}

.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-9) var(--space-6);
  min-height: 120px;
  color: var(--muted);
}

.page-fallback {
  padding: var(--space-7) var(--space-1);
  min-height: 64px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.toolbar input {
  flex: 1;
  max-width: 280px;
}

/* HRMS dashboards + leave workflow */
.card .value.green { color: var(--success-strong); }
.card .value.amber { color: var(--warning-strong); }
.card .value.red { color: var(--danger-strong); }

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-1) 0 var(--space-5);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.tabs {
  display: flex;
  gap: var(--space-2);
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notif-list li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.notif-list li.unread {
  background: var(--surface-hover);
  padding-left: var(--space-3);
  border-left: 3px solid var(--primary);
}

/* Notification bell */
.notif-bell {
  position: relative;
}
.bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-xl);
  padding: var(--space-1) var(--space-2);
  line-height: 1;
}
.bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-1);
}
.bell-pop {
  position: absolute;
  right: 0;
  top: 130%;
  width: 320px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  z-index: 50;
}
.bell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  gap: var(--space-2);
}
.bell-head-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.bell-unread-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger-strong);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.bell-section-label {
  padding: var(--space-2) var(--space-4) var(--space-1);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted, #605e5c);
}
.bell-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}
.bell-new-tag {
  flex-shrink: 0;
  padding: 1px var(--space-2);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.5;
}
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: var(--text-sm);
}
.rd-emp-link {
  font-size: inherit;
  font-weight: 500;
  padding: 0;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}
.rd-emp-link:hover {
  text-decoration: underline;
}

.rd-util-panel {
  overflow: hidden;
}
.rd-util-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}
.rd-util-table {
  width: 100%;
  min-width: 1280px;
  table-layout: auto;
  border-collapse: collapse;
}
.rd-util-table th,
.rd-util-table td {
  vertical-align: middle;
  padding: var(--space-3) var(--space-3);
}
.rd-util-table th {
  white-space: normal;
  line-height: 1.3;
  font-size: var(--text-sm);
  vertical-align: bottom;
  overflow: visible;
}
.rd-util-table .sortable-th {
  min-width: 4.5rem;
}
.rd-util-table th:nth-child(1),
.rd-util-table td.rd-num:first-child {
  width: 3rem;
  min-width: 3rem;
  white-space: nowrap;
}
.rd-util-table th:nth-child(2),
.rd-util-table td.rd-emp-cell {
  min-width: 160px;
  max-width: 240px;
}
.rd-emp-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-util-table th:nth-child(3) { min-width: 5.5rem; }
.rd-util-table th:nth-child(4) { min-width: 6.5rem; }
.rd-util-table th:nth-child(5) { min-width: 7.25rem; }
.rd-util-table th:nth-child(6) { min-width: 7.25rem; }
.rd-util-table th:nth-child(7) { min-width: 6.5rem; }
.rd-util-table th:nth-child(8) { min-width: 7.5rem; }
.rd-util-table th:nth-child(9) { min-width: 6.5rem; }
.rd-util-table .rd-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rd-util-table .rd-util,
.rd-util-table .rd-unalloc {
  text-align: right;
  white-space: nowrap;
}
.rd-util-table .rd-util .rm-band,
.rd-util-table .rd-unalloc .pill {
  justify-content: flex-end;
}
.rd-util-table th:nth-child(n + 3) {
  text-align: right;
}
.rd-util-table th.sortable-th {
  white-space: normal;
}
.rd-util-panel .panel-header {
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-start;
}
.rd-util-panel .panel-header-actions {
  margin-left: auto;
  justify-content: flex-end;
}
.rd-util-panel .panel-header-actions .muted {
  font-size: var(--text-sm);
  line-height: 1.4;
  max-width: 100%;
}
.bell-list .bell-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.bell-list .bell-item:hover {
  background: var(--surface-raised);
}
.bell-list .bell-item.unread {
  background: var(--surface-hover);
}
.bell-list .bell-item.is-chat.unread {
  background: var(--surface-hover);
  border-left: 3px solid var(--primary);
}
.bell-title {
  font-weight: 600;
  font-size: var(--text-md);
}
.bell-msg {
  font-size: var(--text-sm);
  margin-top: 2px;
}
.bell-empty {
  padding: var(--space-5) var(--space-4);
  text-align: center;
}

/* Capacity planning report grid */
.cp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.cp-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.panel.cp-grid-wrap {
  padding: 0;
  overflow: hidden;
}

.cp-grid-scroll {
  overflow: auto;
  max-height: calc(100vh - 280px);
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.cp-grid-wrap {
  padding: 0;
  margin: 0;
}

.cp-grid-scroll .cp-grid {
  margin-bottom: 2px;
}

.cp-grid {
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-xs);
  min-width: max-content;
  width: max-content;
}

.cp-grid th,
.cp-grid td {
  border: 1px solid var(--slate-300);
  padding: 0;
  text-align: center;
  vertical-align: middle;
  background: var(--surface);
}

.cp-grid thead th {
  background: var(--surface-raised);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.cp-grid thead th.cp-sticky {
  z-index: 5;
}

.cp-sticky {
  position: sticky;
  z-index: 3;
  background: var(--surface-raised) !important;
  text-align: left !important;
  padding: var(--space-2) var(--space-2) !important;
  white-space: nowrap;
}

.cp-grid tbody td.cp-sticky {
  background: var(--surface) !important;
}

.cp-grid tbody tr:nth-child(even) td.cp-sticky {
  background: var(--surface-raised) !important;
}

.cp-sno {
  left: 0;
  min-width: 42px;
  width: 42px;
  text-align: center !important;
}

.cp-name {
  left: 42px;
  min-width: 160px;
}

.cp-hours {
  left: 202px;
  min-width: 130px;
  text-align: center !important;
  font-weight: 500;
}

.cp-hours2 {
  left: 332px;
  min-width: 140px;
  text-align: center !important;
  font-weight: 500;
  box-shadow: 4px 0 6px -2px rgba(15, 23, 42, 0.12);
}

.cp-grid thead th.cp-hours2 {
  box-shadow: 4px 0 6px -2px rgba(15, 23, 42, 0.12);
}

.cp-day {
  min-width: 34px;
  max-width: 34px;
  padding: var(--space-1) 2px !important;
}

.cp-day.cp-weekend {
  background: var(--danger-muted);
}

.cp-day.cp-holiday-col {
  background: var(--warning-soft);
}

.cp-day-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: inline-block;
  font-size: var(--text-xs);
  line-height: 1.1;
  white-space: nowrap;
}

.cp-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  font-weight: 500;
  font-size: var(--text-xs);
}

.cp-non-working {
  background: var(--danger);
  color: #fff;
}

.cp-holiday {
  background: var(--warning);
  color: #fff;
}

.cp-leave {
  background: var(--danger);
  color: #fff;
}

.cp-idle {
  background: var(--danger-muted);
  color: var(--text);
}

.cp-allocated {
  background: var(--success);
  color: #fff;
}

/* Project Management dashboard — project table helpers */
.pm-dash-project-row {
  cursor: pointer;
}

.pm-dash-project-row:hover td {
  background: var(--surface-hover);
}

.pm-dash-hint {
  margin: var(--space-3) var(--space-4) var(--space-4);
  font-size: var(--text-sm);
}

/* ================================================================== */
/* Project Management module — compact, professional typography        */
/* ================================================================== */
.pm-page {
  font-size: var(--text-md);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.pm-page h1 {
  font-size: var(--text-page-title);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
  color: var(--text);
}

.pm-page h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
  margin: 0;
  color: var(--text);
}

.pm-page h3 {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text);
}

.pm-page .panel-header h2 {
  font-size: var(--text-lg);
}

.pm-page table {
  font-size: var(--text-md);
}

.pm-page th {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.pm-page .card .value {
  font-size: var(--text-3xl);
  font-weight: 600;
}

.pm-page .card .label {
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.pm-page .proj-card h2 {
  font-size: var(--text-lg);
}

/* Compact, professional card theme for PM pages */
.pm-page {
  padding: var(--space-4) var(--space-5);
  background: var(--app-bg);
}

.pm-page .cards {
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.pm-page .card {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.pm-page .card:hover {
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1), 0 3px 8px rgba(15, 23, 42, 0.05);
}

.pm-page .card .value {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--primary);
  line-height: 1.1;
}

.pm-page .card .label {
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: var(--space-2);
}

.pm-page .card-link {
  margin-top: var(--space-2);
}

/* KPI stat card with premium icon tile */
.card.pm-stat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.pm-stat-body {
  min-width: 0;
  flex: 1;
}

.pm-stat-breakdown {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.pm-stat-breakdown li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.35;
  color: var(--muted, #64748b);
}

.pm-stat-breakdown-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.pm-stat-breakdown-val {
  flex-shrink: 0;
  font-weight: 500;
  color: var(--text, #0f172a);
  font-variant-numeric: tabular-nums;
}

.pm-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}

.pm-stat-icon .kpi-ico-svg,
.pm-stat-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.85;
}

.card.pm-stat.is-active .pm-stat-icon {
  background: color-mix(in srgb, var(--primary) 20%, var(--surface));
}

.rm-kpi-red .pm-stat-icon,
.crm-kpi-danger .pm-stat-icon {
  color: var(--danger-strong);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 20%, transparent);
}

.rm-kpi-green .pm-stat-icon,
.crm-kpi-success .pm-stat-icon {
  color: var(--success-strong);
  background: color-mix(in srgb, var(--success-strong) 12%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success-strong) 20%, transparent);
}

.rm-kpi-amber .pm-stat-icon,
.crm-kpi-warn .pm-stat-icon {
  color: var(--warning-strong);
  background: color-mix(in srgb, var(--warning) 14%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 22%, transparent);
}

.pm-page .pm-stat.is-active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary), 0 1.6px 3.6px rgba(0, 0, 0, 0.08);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.pm-page .panel {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: var(--space-4) !important;
}

.pm-page .panel-header {
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--slate-100);
  padding-bottom: var(--space-3);
}

.pm-page th,
.pm-page td {
  padding: var(--space-2) var(--space-3);
}

.pm-page tbody tr:hover td {
  background: var(--surface-hover);
}

.pm-page .pm-dash-hint {
  margin: var(--space-2) var(--space-1) 2px;
}

/* ================================================================== */
/* Employee self-service home                                          */
/* ================================================================== */
.emp-home {
  --eh-radius: 10px;
}

.eh-banner {
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-card);
}

.eh-banner h1 {
  margin: 0;
  font-size: var(--text-page-title);
  font-weight: 600;
}

.eh-banner p {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--text-md);
}

.eh-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-4);
  align-items: start;
}

@media (max-width: 900px) {
  .eh-grid {
    grid-template-columns: 1fr;
  }
}

.eh-left,
.eh-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.eh-card {
  background: var(--surface, #fff);
  color: var(--text, #201f1e);
  border: 1px solid var(--border, #e1dfdd);
  border-radius: var(--eh-radius);
  padding: var(--space-4) var(--space-4);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.eh-punch {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.eh-punch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-base);
}

.eh-punch-in-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eh-late-pill {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  line-height: 1.4;
}

.eh-punch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.eh-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.eh-card-head h3 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Holiday card — VMax primary tone, not red Keka-style */
.eh-holiday {
  background: var(--surface);
  color: var(--text);
  border-top: 3px solid var(--primary);
  border-radius: var(--eh-radius);
}

.eh-holiday-name {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--heading);
}

.eh-holiday-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 2px;
}

.eh-holiday-date {
  margin-top: var(--space-1);
  font-size: var(--text-md);
  color: var(--muted);
}

.eh-holiday-cal {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.eh-holiday-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.eh-holiday-cal-month {
  font-size: var(--text-md);
  font-weight: 500;
}

.eh-holiday-cal-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-lg);
  line-height: 1;
}

.eh-holiday-cal-btn:hover {
  background: var(--surface-hover);
}

.eh-holiday-cal-weekdays,
.eh-holiday-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-1);
  text-align: center;
}

.eh-holiday-cal-weekdays {
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 500;
}

.eh-holiday-cal-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
}

.eh-holiday-cal-cell.is-empty {
  visibility: hidden;
}

.eh-holiday-cal-cell.is-today {
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.eh-holiday-cal-cell.is-holiday {
  background: var(--primary-soft);
  color: var(--primary-darker);
  font-weight: 500;
  cursor: default;
}

.eh-holiday-cal-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.eh-holiday-cal-list li {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
  flex-wrap: wrap;
}

.eh-holiday-cal-list strong {
  font-weight: 500;
  white-space: nowrap;
}

.eh-holiday-cal-list em {
  font-style: normal;
  font-size: var(--text-xs);
  padding: 1px var(--space-2);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-darker);
}

.eh-holiday-cal-empty {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

/* People rows (avatars) */
.eh-people-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.eh-person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.eh-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: var(--text-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eh-person-name {
  font-weight: 500;
  font-size: var(--text-base);
  color: var(--text, #201f1e);
}

.eh-person-sub {
  font-size: var(--text-sm);
  color: var(--muted, #6b7280);
}

/* Time / clock */
.eh-time {
  text-align: center;
}

.eh-clock {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.eh-clock-time {
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.eh-clock-day {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 2px;
}

.eh-clock-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.eh-clock-info {
  font-size: var(--text-sm);
}

/* Leave balances */
.eh-balances {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.eh-balance {
  flex: 1 1 80px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2);
  background: var(--surface-raised);
}

.eh-balance-num {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--primary);
}

.eh-balance-name {
  font-size: var(--text-xs);
  color: var(--muted, #6b7280);
  margin-top: 2px;
}

/* Inbox */
.eh-inbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.eh-inbox-num {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--danger-strong);
}

/* People tabs (right column) */
.eh-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: var(--space-4);
}

.eh-tab {
  border: none;
  background: none;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--muted, #6b7280);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.eh-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.eh-tab-body {
  max-height: 320px;
  overflow-y: auto;
  padding-right: var(--space-1);
}

.eh-tab-body h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-md);
  font-weight: 600;
}

/* HRMS Dashboard — Logs & Requests (attendance) */
.hrms-logs-panel {
  margin-bottom: var(--space-5);
  padding: 0;
  overflow: hidden;
}

.hrms-logs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) 0;
}

.hrms-logs-head h2 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 600;
}

.hrms-logs-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
  color: var(--muted, #6b7280);
  cursor: pointer;
  user-select: none;
}

.hrms-logs-toggle input {
  width: 36px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.hrms-logs-tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-5) 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.hrms-logs-tab {
  border: none;
  background: transparent;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--muted, #6b7280);
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.hrms-logs-tab.active {
  background: var(--accent-soft);
  color: var(--primary);
}

.hrms-logs-periods {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5) 0;
}

.hrms-logs-period {
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text, #374151);
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.hrms-logs-period.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.hrms-logs-subhead {
  padding: var(--space-3) var(--space-5) var(--space-2);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text, #111827);
}

.hrms-logs-loading {
  padding: var(--space-3) var(--space-5) var(--space-5);
}

.hrms-logs-table-wrap {
  overflow-x: auto;
  padding: 0 var(--space-5) var(--space-4);
}

.hrms-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-md);
}

.hrms-logs-table th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
  padding: var(--space-3) var(--space-3) var(--space-3) 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  white-space: nowrap;
}

.hrms-logs-table td {
  padding: var(--space-4) var(--space-3) var(--space-4) 0;
  border-bottom: 1px solid var(--border, #f3f4f6);
  vertical-align: middle;
}

.hrms-logs-no-entry {
  color: var(--primary);
  font-size: var(--text-sm);
}

.hrms-logs-visual {
  min-width: 140px;
}

.hrms-logs-visual-track {
  height: 8px;
  background: var(--slate-100);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.hrms-logs-visual-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary));
  border-radius: 999px;
}

.hrms-logs-more {
  border: none;
  background: none;
  color: var(--muted, #9ca3af);
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
  padding: 2px var(--space-2);
}

.hrms-logs-calendar {
  padding: 0 var(--space-5) var(--space-5);
}

.hrms-logs-calendar-head {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.hrms-logs-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
}

.hrms-logs-cal-dow {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
  text-align: center;
  padding: var(--space-1);
}

.hrms-logs-cal-cell {
  min-height: 52px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--surface, #fff);
}

.hrms-logs-cal-cell.empty {
  border-color: transparent;
  background: transparent;
}

.hrms-logs-cal-cell.present {
  background: var(--success-soft);
  border-color: var(--success);
}

.hrms-logs-cal-cell.absent {
  background: var(--slate-100);
  border-color: var(--danger-muted);
}

.hrms-logs-cal-cell.leave {
  background: var(--warning-soft);
  border-color: var(--warning);
}

.hrms-logs-cal-cell.off {
  background: var(--slate-100);
  border-color: var(--slate-300);
}

.hrms-logs-cal-cell.none {
  background: var(--surface, #fff);
}

.eh-feed-placeholder {
  border-style: dashed;
}

/* ---------- Feed login notice strips ---------- */
.feed-notice-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}

.feed-notice-strip {
  display: flex;
  align-items: stretch;
  min-height: 36px;
  background: var(--primary-soft);
  border: 1px solid var(--accent-muted);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.feed-notice-strip.is-update {
  background: var(--warning-soft);
  border-color: var(--warning-muted);
  border-left-color: var(--warning);
}

.feed-notice-strip.is-chat {
  background: var(--surface-hover);
  border-color: var(--accent-muted);
  border-left-color: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent);
  animation: tc-notice-pulse 1.6s ease-in-out 2;
}

.feed-notice-strip.is-call {
  background: var(--success-soft);
  border-color: var(--success-muted);
  border-left-color: var(--success-strong);
  animation: tc-notice-pulse 1.6s ease-in-out 3;
}

.feed-notice-strip.is-mail {
  background: var(--warning-soft);
  border-color: var(--warning-muted);
  border-left-color: var(--warning);
  animation: tc-notice-pulse 1.6s ease-in-out 2;
}

.feed-notice-strip.is-chat .feed-notice-cta {
  color: var(--primary);
}

.feed-notice-strip.is-call .feed-notice-cta {
  color: var(--success-strong);
}

.feed-notice-strip.is-mail .feed-notice-cta {
  color: var(--warning-strong);
}

.feed-notice-strip.is-chat .feed-notice-text strong {
  color: var(--primary);
}

.feed-notice-strip.is-call .feed-notice-text strong {
  color: var(--success-strong);
}

.feed-notice-strip.is-mail .feed-notice-text strong {
  color: var(--warning-strong);
}

@keyframes tc-notice-pulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 22%, transparent);
  }
}

.feed-notice-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.feed-notice-body:hover {
  background: rgba(255, 255, 255, 0.45);
}

.feed-notice-icon {
  flex-shrink: 0;
  font-size: var(--text-base);
  line-height: 1;
}

.feed-notice-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  font-size: var(--text-md);
  line-height: 1.3;
}

.feed-notice-text strong {
  font-weight: 600;
}

.feed-notice-msg {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.feed-notice-cta {
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary);
}

.feed-notice-strip.is-update .feed-notice-cta {
  color: var(--warning-strong);
}

.feed-notice-close {
  flex-shrink: 0;
  width: 34px;
  border: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
}

.feed-notice-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.feed-notice-more {
  margin: 0;
  font-size: var(--text-sm);
  padding-left: var(--space-1);
}

.feed-post.is-highlighted {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
  background: var(--primary-soft);
}

.feed-post-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
}

.feed-post-modal {
  width: min(560px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  padding: var(--space-4) var(--space-4) var(--space-4);
}

.feed-post-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border, #eef0f3);
}

.feed-post-modal-head h3 {
  margin: 0;
  font-size: var(--text-lg);
}

/* ---------- Announcements & Posts feed ---------- */
.feed-card .eh-card-head {
  margin-bottom: var(--space-3);
}

.feed-composer {
  margin-bottom: var(--space-3);
  padding: 0;
  background: transparent;
  border: none;
}

.feed-composer-box {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border, #e1dfdd);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.feed-tinymce {
  width: 100%;
}

.wif-tinymce {
  width: 100%;
}

.wif-tinymce .tox-tinymce {
  border-radius: var(--radius-xs) !important;
  border-color: var(--border-strong) !important;
  width: 100% !important;
}

.feed-tinymce .tox-tinymce {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xs) !important;
  overflow: hidden;
}

.feed-tinymce .tox .tox-editor-header,
.feed-tinymce .tox .tox-toolbar,
.feed-tinymce .tox .tox-toolbar__primary,
.feed-tinymce .tox .tox-toolbar__overflow {
  background: var(--surface-raised) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: var(--space-1) var(--space-2) !important;
  box-shadow: none !important;
}

.feed-tinymce .tox .tox-tbtn {
  width: 28px !important;
  height: 28px !important;
  background: transparent !important;
  color: var(--text) !important;
}

.feed-tinymce .tox .tox-tbtn:hover,
.feed-tinymce .tox .tox-tbtn:focus,
.feed-tinymce .tox .tox-tbtn--enabled,
.feed-tinymce .tox .tox-tbtn--enabled:hover {
  background: var(--surface-hover) !important;
  color: var(--heading, var(--text)) !important;
}

.feed-tinymce .tox .tox-tbtn svg {
  fill: currentColor !important;
}

.feed-tinymce .tox .tox-edit-area,
.feed-tinymce .tox .tox-edit-area__iframe {
  background: var(--surface) !important;
}

.feed-tinymce .tox .tox-statusbar {
  background: var(--surface-raised) !important;
  border-top: 1px solid var(--border) !important;
}

/* TinyMCE oxide skin still paints white chrome — force dark surfaces */
html[data-theme="dark"] .feed-tinymce .tox-tinymce,
html[data-theme="dark"] .feed-tinymce .tox .tox-editor-container,
html[data-theme="dark"] .feed-tinymce .tox .tox-sidebar-wrap,
html[data-theme="dark"] .feed-tinymce .tox .tox-edit-area,
html[data-theme="dark"] .feed-tinymce .tox .tox-edit-area__iframe {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .feed-tinymce .tox .tox-editor-header,
html[data-theme="dark"] .feed-tinymce .tox .tox-toolbar,
html[data-theme="dark"] .feed-tinymce .tox .tox-toolbar__primary,
html[data-theme="dark"] .feed-tinymce .tox .tox-toolbar__overflow,
html[data-theme="dark"] .feed-tinymce .tox .tox-toolbar-overlord {
  background: var(--surface-raised) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn,
html[data-theme="dark"] .feed-tinymce .tox .tox-split-button,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn--select {
  background: transparent !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn:hover,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn:focus,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn--enabled,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn--enabled:hover,
html[data-theme="dark"] .feed-tinymce .tox .tox-split-button:hover {
  background: var(--surface-hover) !important;
  color: var(--heading) !important;
}

html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn svg,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn__icon-wrap svg {
  fill: #cbd5e1 !important;
}

html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn:hover svg,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn--enabled svg {
  fill: #f8fafc !important;
}

html[data-theme="dark"] .ml-editor .feed-tinymce .tox-tinymce {
  background: var(--surface) !important;
}

.feed-composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: 0 var(--space-3) var(--space-3);
}

.feed-attach-thumb,
.feed-attach-reel,
.feed-attach-voice {
  position: relative;
  display: inline-flex;
  max-width: 100%;
}

.feed-attach-thumb img {
  display: block;
  max-width: 180px;
  max-height: 140px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border, #e5e7eb);
  object-fit: cover;
  background: var(--surface-raised);
}

.feed-attach-reel .feed-reel {
  width: 120px;
  margin: 0;
}

.feed-attach-voice audio {
  width: min(100%, 260px);
  height: 32px;
}

.feed-attach-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--slate-900);
  color: #fff;
  font-size: var(--text-base);
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.feed-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--slate-150);
  background: var(--surface-raised);
}

.feed-composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.feed-composer-end {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.feed-char-count {
  font-size: var(--text-xs);
}

.feed-icon-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.feed-icon-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--primary);
}

.feed-icon-btn.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.feed-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.feed-icon-btn.recording {
  color: var(--danger-strong);
  background: var(--danger-soft);
  animation: feed-pulse 1.1s ease-in-out infinite;
}

.feed-vibe-menu {
  position: relative;
}

.feed-vibe-popover {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  min-width: 180px;
  max-height: 260px;
  overflow: auto;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border, #e1dfdd);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.feed-vibe-popover.open {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-vibe-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-md);
  color: var(--text);
  cursor: pointer;
}

.feed-vibe-option:hover,
.feed-vibe-option.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.feed-file-input {
  display: none;
}

.feed-reel-chooser {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 var(--space-3) var(--space-3);
  padding: var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-xs);
}

.feed-reel-chooser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-md);
}

.feed-reel-chooser-link {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.feed-reel-link-input {
  flex: 1;
  min-width: 160px;
  min-height: 32px;
  height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong, #8a8886);
  font: inherit;
  font-size: var(--text-md);
  border-radius: var(--radius-xs);
}

.feed-reel-upload-link {
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.feed-reel-upload-link:hover {
  text-decoration: underline;
}

.feed-recording-hint {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--danger-strong);
}

@keyframes feed-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 35%, transparent);
  }
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 0%, transparent);
  }
}

.feed-post-body {
  margin: 0 0 var(--space-2);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-size: var(--text-base);
  color: var(--text);
}

.feed-post-html {
  white-space: normal;
}

.feed-post-html p {
  margin: 0 0 0.55em;
}

.feed-post-html p:last-child {
  margin-bottom: 0;
}

.feed-post-html ul,
.feed-post-html ol {
  margin: 0 0 0.55em;
  padding-left: 1.35em;
}

.feed-post-html a {
  color: var(--primary-dark);
  text-decoration: underline;
}

.feed-post-html strong,
.feed-post-html b {
  font-weight: 600;
}

.feed-post-html em,
.feed-post-html i {
  font-style: italic;
}

.feed-post-html u {
  text-decoration: underline;
}

.feed-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.feed-composer-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  min-width: 0;
}

.feed-file-input {
  display: none;
}

.feed-vibe-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.feed-vibe-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
}

.feed-vibe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.feed-vibe-chip {
  border: 1px solid var(--border, #d1d5db);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: var(--space-1) var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  line-height: 1.3;
}

.feed-vibe-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.feed-vibe-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-darker);
  font-weight: 600;
}

.feed-vibe-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary-darker);
  background: var(--primary-soft);
  border: 1px solid var(--accent-muted);
  border-radius: 999px;
  padding: var(--space-1) var(--space-2);
  white-space: nowrap;
}

.feed-delete-btn {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--danger-strong) !important;
  border-color: var(--danger-muted) !important;
}

.feed-vibe-badge + .feed-delete-btn {
  margin-left: var(--space-1);
}

.feed-delete-btn:hover:not(:disabled) {
  background: var(--danger-soft) !important;
}

.feed-voice-btn.recording {
  border-color: var(--danger) !important;
  color: var(--danger-strong) !important;
  background: var(--danger-soft) !important;
  animation: feed-pulse 1.1s ease-in-out infinite;
}

@keyframes feed-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 35%, transparent);
  }
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 0%, transparent);
  }
}

.feed-recording-hint {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--danger-strong);
}

.feed-composer-voice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.feed-composer-reel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.feed-composer-voice audio,
.feed-voice-player audio {
  width: min(100%, 360px);
  height: 36px;
}

.feed-voice-player {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-xs);
}

.feed-voice-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.feed-reel {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 9 / 16;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0b0b0f;
  border: 1px solid var(--slate-800);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.feed-reel--preview {
  margin-bottom: 0;
}

.feed-reel--embed {
  width: min(100%, 320px);
  aspect-ratio: 9 / 16;
}

.feed-reel--pending {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-4);
  background: linear-gradient(160deg, var(--slate-800) 0%, #0b0b0f 100%);
}

.feed-reel-pending-body {
  color: #fff;
  text-align: center;
  padding: var(--space-2);
  max-width: 220px;
}

.feed-reel-pending-body strong {
  display: block;
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
  text-transform: capitalize;
}

.feed-reel-pending-body p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
}

.feed-reel--link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-3);
}

.feed-reel--link a {
  color: #fff;
  font-weight: 500;
  text-decoration: underline;
}

.feed-reel-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: var(--space-1) var(--space-2);
  backdrop-filter: blur(4px);
}

.feed-reel-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.feed-reel-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.feed-reel-open {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  font-size: var(--text-xs);
  font-weight: 500;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  padding: var(--space-1) var(--space-2);
  text-decoration: none;
}

.feed-reel-open:hover {
  background: rgba(0, 0, 0, 0.75);
}

.feed-reel-chooser {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border, #e5e7eb);
}

.feed-reel-chooser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.feed-reel-chooser-hint {
  margin: 0;
  font-size: var(--text-sm);
}

.feed-reel-chooser-link {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.feed-reel-link-input {
  flex: 1;
  min-width: 180px;
  min-height: 32px;
  height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong, #8a8886);
  font: inherit;
  font-size: var(--text-md);
}

.feed-reel-chooser-or {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
}

.feed-post.vibe-party,
.feed-post.vibe-hype,
.feed-post.vibe-chill,
.feed-post.vibe-kudos,
.feed-post.vibe-meme,
.feed-post.vibe-hot_take,
.feed-post.vibe-appreciation,
.feed-post.vibe-focus,
.feed-post.vibe-roast {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  border-radius: var(--radius-md);
}

.feed-post.vibe-party {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-hype {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-chill {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-kudos {
  background: linear-gradient(180deg, var(--accent-muted) 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-meme {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-hot_take {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-appreciation {
  background: linear-gradient(180deg, var(--slate-100) 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-focus {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-roast {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface, #fff) 72px);
}

.feed-composer-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.feed-composer-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border, #e5e7eb);
  object-fit: contain;
  background: var(--surface);
}

.feed-post-image-link {
  display: block;
  margin: 0 0 var(--space-3);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}

.feed-post-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: var(--surface-raised);
}

.feed-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.feed-card .eh-card-head,
.feed-card .feed-composer,
.feed-card > .error,
.feed-card > .muted {
  flex-shrink: 0;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  /* Grow with posts; scrollbar only after content gets large */
  max-height: min(90vh, 1400px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px var(--space-1) var(--space-2) 0;
  scrollbar-width: thin;
  scrollbar-color: var(--slate-300) transparent;
}

.feed-list::-webkit-scrollbar {
  width: 6px;
}

.feed-list::-webkit-scrollbar-track {
  background: transparent;
}

.feed-list::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 999px;
}

.feed-list::-webkit-scrollbar-thumb:hover {
  background: var(--slate-500);
}

.feed-post {
  padding: var(--space-4) var(--space-4) var(--space-4);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md);
  background: var(--surface, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.feed-post-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border, #eef0f3);
}

.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary));
  flex-shrink: 0;
}

.feed-post-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.feed-post-meta strong {
  font-size: var(--text-md);
}

.feed-post-meta .muted {
  font-size: var(--text-xs);
}

.feed-reaction-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.feed-reaction-chip-wrap {
  position: relative;
  display: inline-flex;
}

.feed-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: var(--surface-hover);
  font-size: var(--text-sm);
  color: var(--text);
  cursor: default;
}

.feed-reaction-chip-wrap:hover .feed-reaction-chip,
.feed-reaction-chip-wrap:focus-within .feed-reaction-chip {
  background: var(--primary-soft);
  outline: 1px solid var(--primary);
}

.feed-reaction-who {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 40;
  min-width: 140px;
  max-width: 220px;
  padding: var(--space-2) var(--space-3);
  background: var(--slate-900);
  color: #fff;
  border-radius: var(--radius-xs);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  pointer-events: none;
}

.feed-reaction-chip-wrap:hover .feed-reaction-who,
.feed-reaction-chip-wrap:focus-within .feed-reaction-who {
  display: block;
}

.feed-reaction-who strong {
  display: block;
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
  font-weight: 500;
}

.feed-reaction-who ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-reaction-who li {
  font-size: var(--text-sm);
  line-height: 1.35;
  padding: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-reaction-who li.muted {
  color: var(--muted);
}

.feed-view-count-wrap {
  position: relative;
  margin-left: auto;
  cursor: default;
}

.feed-meta-count {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  line-height: 1.2;
}

.feed-meta-label {
  font-weight: 500;
}

.feed-comment-count {
  cursor: pointer;
  margin-left: auto;
}

.feed-comment-count:hover,
.feed-comment-count.is-open {
  color: var(--text);
}

.feed-view-count-wrap .feed-meta-count,
.feed-view-count-wrap .feed-view-count {
  margin-left: 0;
}

.feed-view-count {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 600;
}

.feed-view-label {
  font-weight: 500;
}

.feed-view-who {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 40;
  min-width: 140px;
  max-width: 220px;
  padding: var(--space-2) var(--space-3);
  background: var(--slate-900);
  color: #fff;
  border-radius: var(--radius-xs);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  text-align: left;
}

.feed-view-count-wrap:hover .feed-view-who,
.feed-view-count-wrap:focus-within .feed-view-who {
  display: block;
}

.feed-view-who strong {
  display: block;
  font-size: var(--text-xs);
  margin-bottom: var(--space-1);
  font-weight: 500;
}

.feed-view-who ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-view-who li {
  font-size: var(--text-sm);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-view-who li.muted {
  color: rgba(255, 255, 255, 0.65);
}

.feed-comments {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.feed-comments-empty {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
}

.feed-comment-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 280px;
  overflow-y: auto;
}

.feed-comment {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}

.feed-comment-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  background: var(--surface-hover);
  color: var(--text);
}

.feed-comment-body {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--surface-hover);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.feed-comment-body p {
  margin: 2px 0 0;
  font-size: var(--text-md);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.feed-comment-meta strong {
  font-size: var(--text-sm);
}

.feed-comment-delete {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-xs);
  cursor: pointer;
  padding: 0;
}

.feed-comment-delete:hover:not(:disabled) {
  color: var(--danger, #b91c1c);
}

.feed-comment-form {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.feed-comment-input {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--control-height-sm);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-md);
}

.feed-comment-input:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.feed-post-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border, #eef0f3);
}

.feed-react-wrap {
  position: relative;
}

.feed-react-count {
  cursor: pointer;
}

.feed-react-count:hover,
.feed-react-count.is-open,
.feed-react-count.is-active {
  color: var(--text);
}

.feed-emoji-picker {
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-1);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 12px 28px rgba(15, 23, 42, 0.16);
  animation: feed-emoji-in 0.14s ease-out;
}

@keyframes feed-emoji-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.feed-emoji-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: var(--space-1) 2px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  line-height: 1;
  transition: background var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.feed-emoji-glyph {
  font-size: var(--text-2xl);
  line-height: 1;
  transition: transform var(--duration-fast) ease;
}

.feed-emoji-name {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-emoji-btn:hover {
  background: var(--primary-soft);
}

.feed-emoji-btn:hover .feed-emoji-glyph {
  transform: scale(1.22);
}

.feed-emoji-btn.selected {
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.feed-emoji-btn.selected .feed-emoji-name {
  color: var(--primary-dark);
}

@media (max-width: 480px) {
  .feed-emoji-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Code / Git (Repositories) ---------- */
.code-panel {
  padding: 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-2);
}

.code-header h2 {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 600;
}

.code-repo-picker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.code-repo-picker select {
  min-width: 180px;
}

.code-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}

.code-tab {
  border: none;
  background: transparent;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--muted, #6b7280);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.code-tab:hover:not(:disabled) {
  color: var(--text, #111827);
  background: rgba(0, 0, 0, 0.03);
}

.code-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--surface);
}

.code-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.code-tab-body {
  padding: var(--space-5) var(--space-5) var(--space-6);
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.code-toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.git-import-type {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--input-border, var(--border, #e5e7eb));
  border-radius: var(--radius-sm);
  background: var(--input-bg, var(--surface));
  color: var(--heading, inherit);
  font-size: var(--text-base);
}

.git-import-type-ico {
  color: var(--warning-strong);
  font-size: var(--text-sm);
  line-height: 1;
}

.git-import-auth {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-1) 0 2px;
  font-size: var(--text-md);
  cursor: pointer;
  user-select: none;
}

.pipelines-guide {
  margin: 0 0 var(--space-5);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md);
  background: var(--surface-raised, var(--surface));
  overflow: hidden;
}

.pipelines-guide-body {
  padding: 0;
  color: var(--text, inherit);
  font-size: var(--text-md);
  line-height: 1.5;
}

.pipelines-guide-modal-body {
  max-height: min(70vh, 640px);
  overflow-y: auto;
  padding-right: var(--space-1);
}

.pipelines-guide-intro {
  margin: 0 0 var(--space-3);
}

.pipelines-guide-steps {
  margin: 0;
  padding-left: var(--space-5);
}

.pipelines-guide-steps > li {
  margin: 0 0 var(--space-4);
}

.pipelines-guide-steps h4 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
}

.pipelines-guide-substeps {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
}

.pipelines-guide-substeps > li {
  margin-bottom: var(--space-3);
}

.pipelines-guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--text-md);
}

.pipelines-guide-table th,
.pipelines-guide-table td {
  border: 1px solid var(--border, #e5e7eb);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
}

.pipelines-guide-table th {
  background: color-mix(in srgb, var(--heading, #111) 4%, transparent);
  font-weight: 600;
}

.pipelines-code {
  margin: var(--space-2) 0 var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border, #e5e7eb);
  background: var(--input-bg, #0f172a0a);
  color: var(--heading, inherit);
  font-size: var(--text-sm);
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.pipelines-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.code-empty {
  text-align: center;
  padding: var(--space-9) var(--space-5);
  border: 1px dashed var(--border, #e5e7eb);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.code-empty-icon {
  font-size: 36px;
  margin-bottom: var(--space-2);
}

.code-empty h3 {
  margin: 0 0 var(--space-2);
}

.code-empty p {
  margin: 0 0 var(--space-4);
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.repo-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 140px;
}

.repo-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.repo-ico {
  font-size: var(--text-xl);
  line-height: 1;
}

.repo-desc {
  margin: 0;
  font-size: var(--text-md);
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.repo-meta .chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--surface-hover);
  border: 1px solid var(--border, #e5e7eb);
  font-size: var(--text-sm);
  color: var(--text);
  white-space: nowrap;
}

.repo-card-actions {
  margin-top: auto;
  padding-top: var(--space-1);
  display: flex;
  gap: var(--space-2);
}

.repo-card-actions .btn {
  user-select: none;
}

/* ---------- Code / Files browser ---------- */
.files-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: 520px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.files-sidebar {
  border-right: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: 70vh;
  overflow: hidden;
}

.files-sidebar .field {
  margin-bottom: var(--space-3);
}

.files-sidebar .field label {
  display: block;
  margin-bottom: var(--space-1);
}

.files-sidebar .field select,
.files-sidebar .field .ss {
  width: 100%;
  max-width: 100%;
}

.files-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  max-height: 70vh;
  overflow: hidden;
}

.repo-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.tree-search {
  padding: var(--space-2);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.tree-search input {
  width: 100%;
  box-sizing: border-box;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2);
  cursor: pointer;
  font-size: var(--text-md);
  line-height: 1.3;
  user-select: none;
}

.tree-row:hover {
  background: var(--surface-hover);
}

.tree-row.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.tree-caret {
  width: 12px;
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform var(--duration-fast) ease;
}

.tree-caret.open {
  transform: rotate(90deg);
}

.tree-caret.placeholder {
  visibility: hidden;
}

.tree-ico {
  flex-shrink: 0;
  font-size: var(--text-base);
  line-height: 1;
}

.tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-loading {
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted, #6b7280);
}

.file-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.file-viewer.empty {
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-5);
}

.file-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
  flex-shrink: 0;
}

.file-path {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.file-viewer-msg {
  padding: var(--space-6) var(--space-4);
}

.code-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
}

.clone-box {
  display: inline-block;
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-hover);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
}

.code-empty-setup {
  text-align: left;
  max-width: 720px;
  margin: 0 auto;
}

.code-empty-setup > .code-empty-icon,
.code-empty-setup > h3,
.code-empty-setup > p {
  text-align: center;
}

.clone-hints {
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.clone-hints-intro {
  margin: 0 0 var(--space-1) !important;
  text-align: center;
}

.clone-path-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  width: 100%;
  box-sizing: border-box;
  word-break: break-all;
}

.clone-path-box code {
  font-size: var(--text-sm);
}

.clone-hint-block {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  text-align: left;
}

.clone-hint-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.clone-hint-label {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text);
}

.clone-hint-pre {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--slate-900);
  color: var(--slate-200);
  font-size: var(--text-sm);
  line-height: 1.55;
  overflow-x: auto;
  text-align: left;
}

.clone-hint-pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}

.repo-clone-hint {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .files-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .files-sidebar {
    max-height: 280px;
    border-right: none;
    border-bottom: 1px solid var(--border, #e5e7eb);
  }

  .files-content {
    max-height: none;
  }
}

/* ---- Commits ---- */
.commits-layout {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  min-height: 420px;
}
.commits-list-pane {
  flex: 1;
  min-width: 0;
}
.commits-toolbar {
  align-items: flex-end;
  flex-wrap: wrap;
}
.commits-search {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  flex: 1;
  min-width: 260px;
  justify-content: flex-end;
}
.commits-search input[type="search"] {
  font-family: Consolas, "Cascadia Mono", monospace;
  min-width: 180px;
}
.chip.add {
  background: var(--success-soft);
  color: var(--success-strong);
}
.chip.del {
  background: var(--danger-soft);
  color: var(--danger-strong);
}
.section-title {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--muted);
}

/* Full-width commit review (large code compare) */
.commit-review {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: calc(100vh - 220px);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.commit-review-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}
.commit-review-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
  font-size: var(--text-md);
}
.commit-review-sha {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--primary, #0078d4);
  background: var(--primary-soft);
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
}
.commit-review-msg {
  font-weight: 500;
  color: var(--text);
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.commit-review-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 280px);
  min-height: 520px;
}
.commit-review-files {
  border-right: 1px solid var(--border, #e5e7eb);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.commit-review-files-head {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}
.commit-file-list {
  list-style: none;
  margin: 0;
  padding: var(--space-2);
  overflow: auto;
  flex: 1;
}
.commit-file-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text);
}
.commit-file-item:hover {
  background: var(--surface-hover);
}
.commit-file-item.active {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary, #0078d4);
}
.commit-file-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: var(--text-sm);
}
.commit-file-stats {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
}
.commit-file-stats .add { color: var(--success-strong); }
.commit-file-stats .del { color: var(--danger-strong); }
.commit-review-diff {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  overflow: hidden;
}
.commit-review-diff-head {
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.commit-review-filepath {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.commit-review-filepath code {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
}
.commit-review-compare-hint {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
}
.commit-review-diff .diff-viewer-wrap {
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.commit-review-diff .diff-viewer-wrap.large .diff-scroll,
.diff-scroll.large {
  max-height: none;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
@media (max-width: 900px) {
  .commit-review-body {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .commit-review-files {
    border-right: none;
    border-bottom: 1px solid var(--border, #e5e7eb);
    max-height: 180px;
  }
  .commit-review-diff .diff-scroll.large {
    max-height: 70vh;
  }
}

/* ---- Shared code tables ---- */
.code-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-md);
  background: var(--surface);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-table th,
.code-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border, #e5e7eb);
  text-align: left;
}
.code-table th {
  background: var(--surface-raised);
  font-weight: 600;
  color: var(--muted);
  font-size: var(--text-sm);
}
.code-table.clickable tbody tr {
  cursor: pointer;
}
.code-table tbody tr:hover {
  background: var(--surface-raised);
}
.code-table tbody tr.active {
  background: var(--primary-soft);
}
.code-table.compact td,
.code-table.compact th {
  padding: var(--space-2) var(--space-2);
}
.code-table .add {
  color: var(--success-strong);
  font-weight: 500;
}
.code-table .del {
  color: var(--danger-strong);
  font-weight: 500;
}
.sha-link {
  color: var(--primary, #0078d4);
  font-weight: 500;
}
.commit-msg {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nowrap {
  white-space: nowrap;
}

/* ---- Branches ---- */
.branch-name {
  font-weight: 500;
  margin-right: var(--space-2);
}
.default-badge {
  font-size: var(--text-xs);
  vertical-align: middle;
}
.branch-commit-msg {
  font-size: var(--text-xs);
  color: var(--muted, #6b7280);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.branch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.btn.secondary.small.danger {
  color: var(--danger-strong);
  border-color: var(--danger-muted);
}
.btn.secondary.small.danger:hover {
  background: var(--danger-soft);
}

/* ---- Merge conflict resolve ---- */
.merge-resolve {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: var(--space-4) var(--space-4) var(--space-4);
  min-height: calc(100vh - 240px);
  display: flex;
  flex-direction: column;
}
.merge-resolve-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.merge-resolve-title h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
  color: var(--text);
}
.merge-resolve-title p {
  margin: 0;
  font-size: var(--text-md);
}
.merge-resolve-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.merge-resolve-ready {
  border: 1px solid var(--success-muted);
  background: var(--success-soft);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  color: var(--success-strong);
  font-size: var(--text-base);
}
.merge-resolve-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  flex: 1;
  min-height: 480px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.merge-resolve-files {
  border-right: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.merge-resolve-files-head {
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.merge-file-list {
  list-style: none;
  margin: 0;
  padding: var(--space-2);
  overflow: auto;
  flex: 1;
}
.merge-file-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 2px;
}
.merge-file-item code {
  font-size: var(--text-sm);
  word-break: break-all;
  color: var(--text);
}
.merge-file-item:hover {
  background: var(--surface-hover);
}
.merge-file-item.active {
  background: var(--danger-soft);
  box-shadow: inset 3px 0 0 var(--danger);
}
.merge-resolve-editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  padding: var(--space-3);
}
.merge-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.merge-editor-path {
  font-size: var(--text-md);
  font-weight: 500;
}
.merge-editor-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.merge-editor-hint {
  font-size: var(--text-sm);
  margin: 0 0 var(--space-2);
}
.merge-conflict-textarea {
  flex: 1;
  min-height: 360px;
  width: 100%;
  resize: vertical;
  font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
  font-size: var(--text-md);
  line-height: 1.5;
  padding: var(--space-3);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}
@media (max-width: 900px) {
  .merge-resolve-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .merge-resolve-files {
    border-right: none;
    border-bottom: 1px solid var(--border, #e5e7eb);
    max-height: 160px;
  }
}

/* ---- Compare ---- */
.compare-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.compare-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.compare-selects {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.compare-arrow {
  color: var(--muted, #6b7280);
  font-size: var(--text-xl);
  padding-bottom: var(--space-2);
}
.compare-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.compare-body {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  min-height: 400px;
}
.compare-files {
  flex: 0 0 340px;
  min-width: 0;
}
.compare-diff-pane {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  background: var(--surface);
  max-height: 72vh;
  overflow: auto;
}
.status-pill {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
  text-transform: uppercase;
}
.status-A { background: var(--success-soft); color: var(--success-strong); }
.status-M { background: var(--warning-muted); color: var(--warning-strong); }
.status-D { background: var(--danger-soft); color: var(--danger-strong); }
.status-R { background: var(--primary-soft); color: var(--primary); }

/* ---- Diff viewer ---- */
.diff-viewer-wrap {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.diff-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.diff-view-toggle {
  display: flex;
  gap: var(--space-1);
}
.diff-view-toggle .btn.active {
  background: var(--primary, #0078d4);
  color: #fff;
  border-color: var(--primary, #0078d4);
}
.diff-scroll {
  max-height: 60vh;
  overflow: auto;
}
.diff-viewer-wrap.large {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.diff-scroll.large {
  max-height: none;
  flex: 1;
  min-height: 420px;
  overflow: auto;
}
.diff-viewer-msg {
  padding: var(--space-5);
  text-align: center;
}

/* ---- Pull Requests ---- */
.pr-layout {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  min-height: 420px;
}
.pr-list-pane {
  flex: 1;
  min-width: 0;
}
.pr-detail-pane {
  flex: 0 0 380px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  background: var(--surface);
  max-height: 72vh;
  overflow: auto;
}
.pr-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.pr-filters .btn.active {
  background: var(--primary, #0078d4);
  color: #fff;
  border-color: var(--primary, #0078d4);
}
.pr-title {
  font-weight: 600;
}
.pr-status {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-md);
  text-transform: uppercase;
}
.pr-open { background: var(--primary-soft); color: var(--primary); }
.pr-approved { background: var(--success-soft); color: var(--success-strong); }
.pr-rejected { background: var(--danger-soft); color: var(--danger-strong); }
.pr-merged { background: var(--accent-soft); color: var(--primary); }
.pr-closed { background: var(--slate-100); color: var(--muted); }
.pr-detail-head {
  margin-bottom: var(--space-3);
}
.pr-detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.pr-detail-title h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
}
.pr-branch-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
}
.pr-meta-grid {
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}
.pr-reviews {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pr-review-item {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-raised);
  font-size: var(--text-md);
}
.pr-review-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-1);
}
.pr-actions {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border, #e5e7eb);
}
.pr-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.pr-form-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.pr-form-row .field {
  flex: 1;
  min-width: 180px;
}

.pr-azure-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 480px;
}
.pr-azure-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.pr-azure-head h3 {
  margin: 0;
  font-size: var(--text-xl);
}
.pr-azure-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.pr-azure-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  min-height: 28px;
}
.pr-conflict-banner {
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm);
}
.pr-conflict-banner p {
  margin: var(--space-2) 0 0;
  font-size: var(--text-md);
}
.pr-conflict-banner ul {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
}
.pr-azure-body {
  display: flex;
  gap: 0;
  align-items: stretch;
  min-height: 420px;
  flex: 1;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

/* ---- Azure-style New Pull Request ---- */
.ado-pr-create {
  display: flex;
  flex-direction: column;
  margin: -20px -20px -24px;
  min-height: calc(100vh - 168px);
  background: var(--slate-50);
}
.ado-pr-create-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.ado-pr-create-bar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.ado-pr-create-bar-left h3 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--slate-800);
}
.ado-pr-create-repo {
  margin: 0;
  font-size: var(--text-sm);
}
.ado-pr-create-icon {
  font-size: var(--text-2xl);
  color: var(--primary);
  flex-shrink: 0;
}
.ado-pr-create-bar-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.ado-pr-branch-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.ado-pr-branch-pick {
  min-width: 220px;
  flex: 0 1 260px;
}
.ado-pr-branch-pick .ss-control {
  background: var(--input-bg, #fff);
  border: 1px solid var(--input-border, #8a8886);
  min-height: 32px;
}
.ado-pr-branch-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--slate-600);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-1);
}
.ado-pr-into {
  align-self: center;
  padding-top: var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-600);
}
.ado-pr-swap {
  align-self: center;
  margin-top: var(--space-4);
}
.ado-pr-branch-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-left: auto;
  padding: var(--space-2) 0 2px;
  font-size: var(--text-md);
  color: var(--slate-800);
}
.ado-pr-dot {
  color: var(--slate-500);
}
.ado-pr-banner {
  margin: 0 var(--space-5);
  margin-top: var(--space-3);
}
.ado-pr-banner-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.ado-pr-conflict {
  margin: var(--space-3) var(--space-5) 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xs);
  background: var(--warning-soft);
  border: 1px solid var(--warning);
  color: var(--slate-800);
}
.ado-pr-conflict strong {
  color: var(--warning-strong);
}
.ado-pr-conflict p {
  margin: var(--space-2) 0 0;
  font-size: var(--text-md);
}
.ado-pr-conflict ul {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
}
.ado-pr-conflict-note {
  font-weight: 500;
}
.ado-pr-empty-merge {
  margin: var(--space-3) var(--space-5) 0;
  padding: var(--space-3) var(--space-4);
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-xs);
  font-size: var(--text-md);
  color: var(--slate-600);
}
.ado-pr-create-body {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-5) var(--space-5);
  flex: 1;
  min-height: 0;
}
.ado-pr-create-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex: 1;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ado-pr-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-2);
}
.ado-pr-description {
  min-height: 88px;
  resize: vertical;
}
.ado-pr-tabs {
  display: flex;
  gap: 0;
  padding: 0 var(--space-3);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: #fff;
}
.ado-pr-tab {
  border: none;
  background: transparent;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--slate-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.ado-pr-tab:hover {
  color: var(--slate-800);
}
.ado-pr-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.ado-pr-tab-count {
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--slate-100);
  color: var(--primary);
  border-radius: var(--radius-md);
  padding: 1px var(--space-2);
}
.ado-pr-create-diff {
  flex: 1;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}
.ado-pr-create-diff .pr-azure-body {
  flex: 1;
  min-height: 360px;
  border: none;
  border-top: 1px solid var(--border, #e5e7eb);
  border-radius: 0;
}
.ado-pr-diff-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.ado-pr-session-hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
  background: var(--slate-50);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
}
.ado-pr-reviewers-field {
  max-width: 560px;
}
.ado-pr-reviewers-field .sms {
  width: 100%;
}
.ado-pr-side-hint {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  line-height: 1.45;
}
@media (max-width: 980px) {
  .ado-pr-create-body {
    padding: var(--space-3);
  }
}
.pr-change-tree {
  flex: 0 0 300px;
  min-width: 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  background: var(--surface);
  max-height: 72vh;
  overflow: auto;
}
.pr-azure-body .pr-change-tree {
  max-height: none;
  border: none;
  border-right: 1px solid var(--border, #e5e7eb);
  border-radius: 0;
}
.pr-azure-body .pr-commit-list {
  max-height: none;
  flex: 0 0 340px;
  overflow: auto;
  border-right: 1px solid var(--border, #e5e7eb);
}
.pr-azure-body .compare-diff-pane {
  max-height: none;
  border: none;
  border-radius: 0;
}
.pr-change-tree-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}
.pr-folder-count {
  margin-left: auto;
  font-size: var(--text-xs);
}
.pr-file-row .tree-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pr-file-stats {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.pr-file-stats .add { color: var(--success-strong); }
.pr-file-stats .del { color: var(--danger-strong); }
.pr-commit-list {
  flex: 0 0 340px;
  min-width: 0;
  max-height: 72vh;
  overflow: auto;
}
.pr-commit-files {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.pr-commit-file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-align: left;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface);
  border-radius: var(--radius-xs);
  padding: var(--space-2) var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
}
.pr-commit-file.active,
.pr-commit-file:hover {
  border-color: var(--primary, #0078d4);
  background: var(--primary-soft);
}
.ado-pr-tab-conflict.active {
  color: var(--danger-strong);
  border-bottom-color: var(--danger);
}
.ado-pr-conflict-pill {
  color: var(--danger-strong);
  font-weight: 600;
}
.status-C { background: var(--danger-soft); color: var(--danger-strong); }

/* ---- Statistics ---- */
.stats-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-3);
}
.stat-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  background: var(--surface);
}
.stat-card-label {
  font-size: var(--text-xs);
  color: var(--muted, #6b7280);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text);
}
.stat-card-sub {
  font-size: var(--text-xs);
  margin-top: 2px;
}
.stats-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}
.stats-panel {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  background: var(--surface);
}
.latest-commit-box,
.active-dev-box {
  font-size: var(--text-md);
}
.active-dev-name {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-1);
}
.stat-chart-label {
  font-size: var(--text-sm);
  color: var(--muted, #6b7280);
  margin-bottom: var(--space-3);
}
.stat-bars {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  height: 140px;
  padding-top: var(--space-2);
}
.stat-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}
.stat-bar {
  width: 100%;
  max-width: 36px;
  background: var(--primary, #0078d4);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  min-height: 4px;
  transition: height var(--duration-base);
}
.stat-bar-x {
  font-size: var(--text-xs);
  color: var(--muted, #6b7280);
  margin-top: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.contrib-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.contrib-bar-wrap span {
  font-size: var(--text-xs);
  color: var(--muted, #6b7280);
  min-width: 32px;
}
.contrib-bar {
  height: 8px;
  background: var(--primary, #0078d4);
  border-radius: var(--radius-xs);
  min-width: 4px;
  max-width: 120px;
}

/* ===== Resource Management enterprise UI ===== */
.panel-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.export-btns {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

/* Export actions are secondary: neutral buttons, the file-type icon is the only colour. */
.export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height-sm);
  height: var(--control-height-sm);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.export-btn svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.export-btn--excel svg { color: var(--success-strong); }
.export-btn--csv svg { color: var(--slate-600); }
.export-btn--pdf svg { color: var(--danger-strong); }
.export-btn--print svg { color: var(--slate-600); }

.export-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--slate-300);
}

.export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Export actions grouped in one dropdown */
.export-drop {
  position: relative;
  flex-wrap: nowrap;
}

.export-drop-caret {
  transition: transform var(--duration-base) ease;
}

.export-drop.is-open .export-drop-caret {
  transform: rotate(180deg);
}

.export-drop-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
  padding: var(--space-2);
  background: var(--surface, #fff);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08), 0 8px 24px rgba(60, 64, 67, 0.16);
  animation: export-drop-in var(--duration-base) cubic-bezier(0.2, 0.8, 0.2, 1);
}

.export-drop-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-base);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.export-drop-item svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.export-drop-item:hover,
.export-drop-item:focus-visible {
  background: var(--surface-hover, var(--slate-100));
}

@keyframes export-drop-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .export-drop-panel { animation: none; }
}

.panel-header-actions .btn,
.topbar .btn,
.toolbar .btn {
  min-height: 32px;
  height: 32px;
}

.rm-page .cards {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.rm-exec .cards,
.pm-exec .cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rm-kpi-hint {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
}

.rm-band {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
}

.rm-band-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.rm-band-green { color: var(--success-strong); }
.rm-band-yellow { color: var(--warning-strong); }
.rm-band-orange { color: var(--warning-strong); }
.rm-band-red { color: var(--danger-strong); }

.pill.blue { background: var(--primary-soft); color: var(--primary); }
.pill.neutral { background: var(--surface-hover); color: var(--text); }

.rm-flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-md);
}

.rm-flash-success {
  background: var(--success-soft);
  border: 1px solid var(--success-muted);
  color: var(--success-strong);
}

.rm-flash-error {
  background: var(--slate-100);
  border: 1px solid var(--danger-muted);
  color: var(--danger-strong);
}

.rm-flash-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: var(--text-xl);
  line-height: 1;
  color: inherit;
}

.rm-column-chooser {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.rm-column-chooser-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  cursor: pointer;
}

.rm-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.rm-skeleton-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--space-3);
}

.rm-skeleton-cell {
  height: 14px;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--bg) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%;
  animation: rm-shimmer 1.2s ease-in-out infinite;
}

@keyframes rm-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.rm-empty {
  text-align: center;
  padding: var(--space-7) var(--space-3);
}

.rm-empty-title {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 240px);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-xs);
  background: var(--surface, #fff);
}

/* Employees Working Hours — clear grid lines around rowspan blocks */
.pm-hours-table {
  border-collapse: collapse;
  width: 100%;
}
.pm-hours-table th,
.pm-hours-table td {
  border: 1px solid var(--border-strong, #b8bec8);
  padding: var(--space-2) var(--space-3);
  vertical-align: middle;
}
.pm-hours-table thead th {
  border-bottom: 2px solid var(--text-muted, #6b7280);
  background: var(--surface-muted, #f8fafc);
}
.table-scroll--sticky .pm-hours-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-muted, #f8fafc);
  box-shadow: inset 0 -2px 0 var(--text-muted, #6b7280);
}
html[data-theme="dark"] .table-scroll--sticky .pm-hours-table thead th {
  background: #1f2937;
}
.pm-hours-table tbody tr.pm-hours-emp-start > td {
  border-top: 2px solid var(--text, #374151);
}
.pm-hours-table td.pm-hours-span-cell {
  border-right: 2px solid var(--border-strong, #9aa3b2);
  background: var(--surface, #fff);
  vertical-align: middle;
}
.pm-hours-table tbody tr.pm-hours-total-row td {
  font-weight: 600;
  background: var(--surface-2, #f3f4f6);
  border-top: 1.5px solid var(--text-muted, #6b7280);
}
.pm-hours-link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  min-width: 32px;
}
.pm-hours-link:hover {
  color: var(--primary);
}
@media (max-width: 720px) {
  .pm-hours-link {
    min-height: 44px;
  }
}
html[data-theme="dark"] .pm-hours-table th,
html[data-theme="dark"] .pm-hours-table td {
  border-color: #4b5563;
}
html[data-theme="dark"] .pm-hours-table tbody tr.pm-hours-emp-start > td {
  border-top-color: #9ca3af;
}
html[data-theme="dark"] .pm-hours-table td.pm-hours-span-cell {
  background: var(--surface, #111827);
}
html[data-theme="dark"] .pm-hours-table tbody tr.pm-hours-total-row td {
  background: #1f2937;
}

@media print {
  .pm-hours-table th,
  .pm-hours-table td {
    border: 1px solid var(--slate-800) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .pm-hours-table tbody tr.pm-hours-emp-start > td {
    border-top: 2px solid #000 !important;
  }
  .pm-hours-table tbody tr.pm-hours-total-row td {
    background: var(--slate-150) !important;
  }
}

.table-scroll--sticky thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface, #fff);
  box-shadow: inset 0 -1px 0 var(--border, #e5e7eb);
}

.table-scroll td.pm-col-sticky,
.table-scroll th.pm-col-sticky {
  position: sticky !important;
  z-index: 4;
  background: var(--surface, #fff) !important;
  box-shadow: 2px 0 6px rgba(15, 23, 42, 0.08);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-scroll--sticky thead th.pm-col-sticky {
  z-index: 6;
  top: 0;
  background: var(--surface, #fff) !important;
}

.table-scroll tbody tr:nth-child(even) td.pm-col-sticky {
  background: var(--surface-muted, #f8fafc) !important;
}

.table-scroll tbody tr:hover td.pm-col-sticky {
  background: var(--surface-hover, #f3f2f1) !important;
}

.table-scroll td.pm-col-sticky.pm-project-cell--green,
.table-scroll tbody tr:nth-child(even) td.pm-col-sticky.pm-project-cell--green,
.table-scroll tbody tr:hover td.pm-col-sticky.pm-project-cell--green {
  background: color-mix(in srgb, var(--success-soft) 70%, var(--surface, #fff)) !important;
}
.table-scroll td.pm-col-sticky.pm-project-cell--yellow,
.table-scroll tbody tr:nth-child(even) td.pm-col-sticky.pm-project-cell--yellow,
.table-scroll tbody tr:hover td.pm-col-sticky.pm-project-cell--yellow {
  background: color-mix(in srgb, var(--warning-soft) 70%, var(--surface, #fff)) !important;
}
.table-scroll td.pm-col-sticky.pm-project-cell--red,
.table-scroll tbody tr:nth-child(even) td.pm-col-sticky.pm-project-cell--red,
.table-scroll tbody tr:hover td.pm-col-sticky.pm-project-cell--red {
  background: color-mix(in srgb, var(--danger-soft) 70%, var(--surface, #fff)) !important;
}

.pm-report-table--sticky-cols {
  border-collapse: separate;
  border-spacing: 0;
  min-width: max-content;
}

.pm-completion-pct {
  cursor: help;
  border-bottom: 1px dotted currentColor;
}

html[data-theme="dark"] .table-scroll td.pm-col-sticky,
html[data-theme="dark"] .table-scroll th.pm-col-sticky,
html[data-theme="dark"] .table-scroll--sticky thead th.pm-col-sticky {
  background: var(--surface-raised, #182235) !important;
}

html[data-theme="dark"] .table-scroll tbody tr:nth-child(even) td.pm-col-sticky {
  background: var(--surface, #111827) !important;
}

html[data-theme="dark"] .table-scroll td.pm-col-sticky.pm-project-cell--green,
html[data-theme="dark"] .table-scroll tbody tr:nth-child(even) td.pm-col-sticky.pm-project-cell--green,
html[data-theme="dark"] .table-scroll tbody tr:hover td.pm-col-sticky.pm-project-cell--green {
  background: color-mix(in srgb, #22c55e 22%, var(--surface-raised, #182235)) !important;
}
html[data-theme="dark"] .table-scroll td.pm-col-sticky.pm-project-cell--yellow,
html[data-theme="dark"] .table-scroll tbody tr:nth-child(even) td.pm-col-sticky.pm-project-cell--yellow,
html[data-theme="dark"] .table-scroll tbody tr:hover td.pm-col-sticky.pm-project-cell--yellow {
  background: color-mix(in srgb, #eab308 22%, var(--surface-raised, #182235)) !important;
}
html[data-theme="dark"] .table-scroll td.pm-col-sticky.pm-project-cell--red,
html[data-theme="dark"] .table-scroll tbody tr:nth-child(even) td.pm-col-sticky.pm-project-cell--red,
html[data-theme="dark"] .table-scroll tbody tr:hover td.pm-col-sticky.pm-project-cell--red {
  background: color-mix(in srgb, #ef4444 22%, var(--surface-raised, #182235)) !important;
}

.pm-link-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 120px;
}

.pm-link-stack a {
  white-space: nowrap;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th:hover {
  color: var(--primary-darker, #005a9e);
  background: var(--primary-soft);
}

.sortable-th.sorted {
  color: var(--primary-darker, #005a9e);
}

.sortable-th-ind {
  font-size: var(--text-xs);
  opacity: 0.85;
}

.rm-row-actions {
  white-space: nowrap;
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.mytasks-row-actions {
  flex-wrap: nowrap;
  min-width: 72px;
}

.rm-list {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
}

.rm-cal-legend {
  margin: 0 0 var(--space-3);
  font-size: var(--text-md);
}

.rm-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: var(--space-2);
  max-width: 860px;
  width: 100%;
}

.rm-cal-cell {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-1);
  padding: var(--space-3);
  font-size: var(--text-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  line-height: 1.3;
}

.rm-cal-day {
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: 2px;
}

.rm-cal-hours {
  font-size: var(--text-md);
  opacity: 0.95;
}

.rm-cal-hours-avail {
  font-weight: 500;
}

.rm-cal-hours-leave {
  font-weight: 500;
  color: var(--warning-strong);
}

.rm-cal-weekend { background: var(--surface-hover); color: var(--muted); }
.rm-cal-holiday { background: var(--danger-soft); color: var(--danger-strong); }
.rm-cal-allocated { background: var(--primary-soft); color: var(--primary); }
.rm-cal-available { background: var(--success-soft); color: var(--success-strong); }
.rm-cal-leave { background: var(--warning-muted); color: var(--warning-strong); }

@media (max-width: 1100px) {
  .rm-exec .cards,
  .pm-exec .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .rm-page .cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .rm-exec .cards,
  .pm-exec .cards {
    grid-template-columns: 1fr;
  }
  .panel-header-actions {
    width: 100%;
  }
  .ra-filters-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  .sidebar, .topbar, .toolbar, .panel-header-actions, .ra-filters, .export-btns, .export-btn, .btn {
    display: none !important;
  }
  .content { padding: 0; background: #fff; }
  .panel { border: none; box-shadow: none; }
}

/* ===== RM Charts & Executive Dashboard ===== */
.rm-exec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.rm-inline-report {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4) 0;
}

.rm-report-embedded {
  padding: 0;
}

.rm-report-embedded .rm-exec-head {
  margin-bottom: var(--space-2);
}

.rm-report-embedded .panel.ra-filters {
  margin-bottom: var(--space-2);
}

.rm-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.rm-chart-card h3 {
  font-weight: 600;
  color: var(--text, #323130);
}

.rm-chart-body {
  padding: var(--space-1) var(--space-1) var(--space-2);
  min-height: 180px;
}

.rm-chart-empty {
  padding: var(--space-6) var(--space-2);
  text-align: center;
}

.rm-hbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.rm-hbar-row {
  display: grid;
  grid-template-columns: minmax(80px, 140px) 1fr 48px;
  gap: var(--space-2);
  align-items: center;
}

.rm-hbar-label {
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-hbar-track {
  height: 10px;
  background: var(--surface-hover);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.rm-hbar-fill {
  height: 100%;
  border-radius: var(--radius-xs);
  transition: width var(--duration-base) ease;
}

.rm-hbar-value {
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: right;
}

.rm-vbar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.rm-vbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.rm-vbar-track {
  flex: 1;
  width: 100%;
  max-width: 36px;
  background: var(--surface-hover);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.rm-vbar-fill {
  width: 100%;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  transition: height var(--duration-base) ease;
}

.rm-vbar-value {
  font-size: var(--text-xs);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.rm-vbar-label {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--space-1);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-pie-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

.rm-pie-center {
  font-size: var(--text-lg);
  font-weight: 600;
  fill: var(--slate-800);
}

.rm-pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 160px;
}

.rm-pie-legend li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

.rm-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-xs);
}

.rm-legend-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rm-line-wrap {
  width: 100%;
}

.rm-line {
  width: 100%;
  height: 200px;
  display: block;
}

.rm-line-grid {
  stroke: var(--slate-150);
  stroke-width: 1;
}

.rm-line-xlabel {
  font-size: var(--text-xs);
  fill: var(--slate-600);
}

.rm-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-1) 0 var(--space-2);
}

@media (max-width: 960px) {
  .rm-chart-grid {
    grid-template-columns: 1fr;
  }
  .rm-hbar-row {
    grid-template-columns: minmax(60px, 100px) 1fr 40px;
  }
}

/* ===== RM Enterprise Reports ===== */
.rm-report-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.rm-report-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.rm-report-card-title {
  font-weight: 600;
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.rm-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-1) var(--space-1);
  flex-wrap: wrap;
}

.rm-pager-btns {
  display: flex;
  gap: var(--space-2);
}

.rm-report .ra-filters-row .field select,
.rm-report .ra-filters-row .field .ss {
  min-width: 100px;
}

/* ===== Work Item Queries ===== */
.wiq-page { display: flex; flex-direction: column; gap: var(--space-3); }
.wiq-toolbar-panel { padding-bottom: 0; }
.wiq-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.wiq-toolbar-left { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; }
.wiq-toolbar-right { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.wiq-name {
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-lg);
  font-weight: 600;
  min-width: 180px;
  background: transparent;
}
.wiq-name:hover, .wiq-name:focus {
  border-color: var(--border, #edebe9);
  background: var(--surface);
  outline: none;
}
.wiq-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
  color: var(--muted, #605e5c);
}
.wiq-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border, #edebe9);
  margin: 0 -24px;
  padding: 0 var(--space-6);
}
.wiq-tab {
  border: none;
  background: transparent;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  color: var(--muted, #605e5c);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
}
.wiq-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.wiq-results-panel { padding-bottom: var(--space-3); }
.wiq-split {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 0;
  border: 1px solid var(--border, #edebe9);
  border-radius: var(--radius-md);
  overflow: hidden;
  /* Cap height so list + detail each scroll inside their own pane */
  height: calc(100vh - 220px);
  min-height: 420px;
  max-height: calc(100vh - 160px);
  background: var(--surface);
}
.wiq-split-list {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border, #edebe9);
  background: var(--bg, #faf9f8);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.wiq-split-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border, #edebe9);
  font-weight: 600;
  font-size: var(--text-md);
  flex-shrink: 0;
}
.wiq-split-list-body {
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.wiq-split-row {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--border, #edebe9);
  background: transparent;
  padding: var(--space-3) var(--space-3);
  cursor: pointer;
}
.wiq-split-row:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.wiq-split-row.active {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  box-shadow: inset 3px 0 0 var(--primary, #0078d4);
}
.wiq-split-row-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.wiq-split-id { font-size: var(--text-sm); color: var(--muted, #605e5c); }
.wiq-split-state {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--muted, #605e5c);
}
.wiq-split-title {
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.wiq-split-meta { font-size: var(--text-xs); margin-top: var(--space-1); }
.wiq-split-detail {
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wiq-split-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  display: block;
  flex: 1 1 auto;
  background: var(--surface);
}
.wiq-split-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  padding: var(--space-6);
}
.app-embed-shell {
  min-height: 100vh;
  background: var(--bg, #f3f2f1);
  padding: var(--space-2);
}
.wif-embed {
  margin: 0;
  box-shadow: none;
}
@media (max-width: 960px) {
  .wiq-split {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: auto;
  }
  .wiq-split-list {
    border-right: none;
    border-bottom: 1px solid var(--border, #edebe9);
    height: 280px;
    max-height: 280px;
  }
  .wiq-split-detail {
    height: 65vh;
    min-height: 420px;
  }
  .wiq-split-frame {
    height: 100%;
    min-height: 0;
  }
}
.wiq-editor-panel { padding-top: var(--space-4); }
.wiq-editor-title { margin: 0 0 var(--space-4); font-size: var(--text-lg); font-weight: 600; }
.wiq-clause-builder {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}
.wiq-clause-head,
.wiq-clause-row {
  display: grid;
  grid-template-columns: 72px 96px minmax(150px, 1.1fr) minmax(130px, 0.9fr) minmax(180px, 1.3fr);
  gap: var(--space-3);
  align-items: center;
  padding: 0 var(--space-3);
}
.wiq-clause-head {
  min-height: 36px;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
}
.wiq-clause-row {
  min-height: 52px;
  border-bottom: 1px solid var(--border);
}
.wiq-clause-row:last-child { border-bottom: none; }
.wiq-clause-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.wiq-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wiq-icon-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--primary);
}
.wiq-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.wiq-icon-btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}
.wiq-icon-btn-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
}
.wiq-clause-dash { display: inline-block; padding-left: var(--space-1); }
.wiq-clause-select,
.wiq-clause-select .ss-control,
.wiq-clause-input,
.wiq-clause-row input[type="number"],
.wiq-clause-row input[type="text"]:not(.wiq-date-input) {
  width: 100%;
  min-width: 0;
  height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--text-md);
}
.wiq-clause-select.ss,
.wiq-clause-row .ss {
  width: 100%;
  min-width: 0;
}
.wiq-clause-select.ss {
  height: auto;
  padding: 0;
  border: none;
  background: transparent;
}
.wiq-clause-value .search-select,
.wiq-clause-value .ss { width: 100%; }
.wiq-date-value {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  z-index: 1;
}
.wiq-date-input {
  width: 100%;
  height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg, var(--surface));
  color: var(--heading, var(--text));
  font-size: var(--text-md);
  cursor: pointer;
  color-scheme: light dark;
}
.wiq-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 1.25rem;
  height: 1.25rem;
}
.wiq-add-clause { margin-top: var(--space-3); }
.wiq-clause-table select,
.wiq-clause-table input {
  width: 100%;
  min-width: 120px;
}
.wiq-chart { display: flex; flex-direction: column; gap: var(--space-3); max-width: 560px; }
.wiq-chart-row { display: grid; grid-template-columns: 120px 1fr 40px; gap: var(--space-3); align-items: center; }
.wiq-chart-label { font-size: var(--text-md); }
.wiq-chart-bar-wrap { background: var(--surface-hover); height: 18px; border-radius: var(--radius-xs); overflow: hidden; }
.wiq-chart-bar { height: 100%; border-radius: var(--radius-xs); min-width: 2px; }
.wiq-chart-count { text-align: right; font-weight: 600; font-size: var(--text-md); }
.wiq-title-link {
  font-size: inherit;
  font-weight: 600;
  text-align: left;
  padding: 0;
  color: var(--primary);
}
.wiq-title-link:hover {
  text-decoration: underline;
}
.panel.success {
  background: var(--success-soft);
  color: var(--success-strong);
  border: 1px solid var(--success);
  padding: var(--space-3) var(--space-4);
}

/* ===== User Stories Kanban board ===== */
.us-board-page { display: flex; flex-direction: column; gap: var(--space-3); min-height: 0; }
.us-board-header { padding: 0; margin-bottom: var(--space-1); }
.us-board-cols {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: var(--space-3);
  min-height: 420px;
}
.us-board-col {
  flex: 0 0 280px;
  min-width: 280px;
  max-width: 300px;
  background: var(--surface-hover, #f3f2f1);
  border: 1px solid var(--border, #edebe9);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: calc(100vh - 220px);
}
.us-board-col-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
  padding: 2px 2px var(--space-2);
}
.us-board-col-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.us-board-col-count { margin-left: auto; font-size: var(--text-sm); }
.us-board-col-count.over-wip { color: var(--danger-strong); font-weight: 600; }
.us-board-quick-add { margin-bottom: 2px; }
.us-board-new-link {
  width: 100%;
  text-align: left;
  border: 1px dashed var(--border, #c8c6c4);
  background: transparent;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  color: var(--primary);
  cursor: pointer;
  font-size: var(--text-md);
}
.us-board-new-link:hover { background: var(--surface, #fff); }
.us-board-add-form {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #c8c6c4);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.us-board-add-row { display: flex; align-items: center; gap: var(--space-2); }
.us-board-add-input {
  flex: 1;
  min-width: 0;
  height: var(--control-height-sm);
  border: 1px solid var(--border, #c8c6c4);
  border-radius: var(--radius-xs);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-md);
}
.us-board-add-actions { display: flex; gap: var(--space-2); }
.us-board-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
  min-height: 40px;
  padding-right: 2px;
}
.us-board-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #edebe9);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.us-board-card:active { cursor: grabbing; }
.us-board-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.us-board-card-id {
  font-size: var(--text-sm);
  color: var(--muted);
  padding: 0;
}
.us-board-card-title {
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: var(--space-2);
  word-break: break-word;
}
.us-board-card-meta { font-size: var(--text-sm); }
.us-board-empty { padding: var(--space-3) var(--space-1); font-size: var(--text-sm); }

/* ===== PM Enterprise Analytics ===== */
.pm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  align-items: flex-end;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-raised);
  border: 1px solid var(--border, #edebe9);
  border-radius: var(--radius-xs);
  margin-bottom: var(--space-4);
}
.pm-filter-bar .field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 120px;
}
.pm-filter-bar .field label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pm-filter-bar .field input,
.pm-filter-bar .field select,
.pm-filter-bar .field .ss-control {
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--input-border, #d1d5db);
  border-radius: var(--radius-xs);
  background-color: var(--input-bg, #f3f4f6);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.pm-filter-bar .field .ss {
  min-width: 140px;
  width: 100%;
}
.pm-filter-bar .pm-filter-actions {
  min-width: auto;
  flex: 0 0 auto;
}
.pm-filter-bar .pm-filter-actions-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-2);
}
.pm-filter-bar .pm-filter-actions-row .btn {
  white-space: nowrap;
  min-height: var(--control-height);
}
.pm-filter-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding-bottom: 2px;
}
.pm-filter-actions .btn,
.ra-filters-row > .btn {
  min-height: var(--control-height);
  height: var(--control-height);
  padding: 0 var(--space-3);
  background: var(--slate-200) !important;
  color: var(--heading, #201f1e) !important;
  border: none !important;
  border-radius: var(--radius-xs);
  box-shadow: none;
}
.pm-filter-actions .btn:hover,
.ra-filters-row > .btn:hover {
  background: var(--slate-300) !important;
  border: none !important;
  box-shadow: none;
}
.pm-kpi .card-link {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

.pm-page .pm-kpi.is-active {
  outline: 2px solid var(--primary, #0078d4);
  outline-offset: 1px;
}

.pm-badge {
  display: inline-block;
  margin-left: var(--space-2);
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  padding: 1px var(--space-2);
  vertical-align: middle;
}
.pm-health-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: var(--surface-hover);
  white-space: nowrap;
}
.pm-health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.pm-health-green { color: var(--success-strong); background: var(--success-soft); }
.pm-health-yellow { color: var(--warning-strong); background: var(--warning-soft); }
.pm-health-red { color: var(--danger-strong); background: var(--danger-soft); }
.pm-health-label {
  text-transform: none;
  font-weight: 500;
  opacity: 0.9;
}

.pm-project-health-box {
  display: inline-block;
  max-width: 100%;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-xs);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-project-cell--green {
  background: color-mix(in srgb, var(--success-soft) 55%, transparent);
}
.pm-project-cell--yellow {
  background: color-mix(in srgb, var(--warning-soft) 55%, transparent);
}
.pm-project-cell--red {
  background: color-mix(in srgb, var(--danger-soft) 55%, transparent);
}

.pm-productivity-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pm-productivity-table {
  width: 100%;
  min-width: 1200px;
  table-layout: auto;
  border-collapse: collapse;
}

.pm-productivity-table th,
.pm-productivity-table td {
  padding: var(--space-2) var(--space-3);
  vertical-align: middle;
}

.pm-productivity-table th {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
  vertical-align: bottom;
  font-size: var(--text-sm);
  max-width: 130px;
}

.pm-productivity-table th.sortable-th-has-hint {
  cursor: help;
}

.pm-productivity-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-productivity-table .pm-productivity-col-employee_name {
  min-width: 140px;
  max-width: 220px;
}

.pm-productivity-table .pm-productivity-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pm-health-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pm-health-table {
  width: 100%;
  min-width: 1320px;
  table-layout: auto;
  border-collapse: collapse;
}

.pm-health-table th,
.pm-health-table td {
  padding: var(--space-2) var(--space-3);
  vertical-align: middle;
}

.pm-health-table th {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
  vertical-align: bottom;
  font-size: var(--text-sm);
  max-width: 140px;
}

.pm-health-table th.sortable-th-has-hint {
  cursor: help;
}

.pm-health-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-health-table .pm-health-col-project {
  min-width: 120px;
  max-width: 200px;
}
.pm-health-table .pm-health-col-manager,
.pm-health-table .pm-health-col-ba {
  min-width: 100px;
  max-width: 160px;
}
.pm-health-table .pm-health-col-business_analyst {
  min-width: 100px;
  max-width: 160px;
}

.pm-health-table .pm-health-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pm-health-table td:nth-child(13) {
  overflow: visible;
}

.pm-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
  padding: var(--space-1) 0 var(--space-2);
}
.pm-insight-card {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-xs);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
}
.pm-insight-critical { border-left-color: var(--danger); }
.pm-insight-warning { border-left-color: var(--warning); }
.pm-insight-info { border-left-color: var(--primary); }
.pm-insight-title { font-weight: 600; margin-bottom: var(--space-2); }
.pm-insight-summary { font-size: var(--text-md); color: var(--text); margin-bottom: var(--space-2); }
.pm-insight-rec { font-size: var(--text-sm); color: var(--muted); }
.pm-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0;
}
.pm-chart-card {
  min-height: 320px;
}
.pm-chart-empty {
  padding: var(--space-8);
  text-align: center;
}
.pm-heatmap {
  overflow-x: auto;
}
.pm-heatmap table {
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.pm-heatmap th,
.pm-heatmap td {
  border: 1px solid var(--border);
  padding: var(--space-1) var(--space-2);
  text-align: center;
  min-width: 36px;
}
.pm-heatmap .cell-green { background: var(--success-soft); }
.pm-heatmap .cell-yellow { background: var(--warning-soft); }
.pm-heatmap .cell-red { background: var(--danger-soft); }
.pm-heatmap .cell-none { background: var(--surface-raised); }
.pm-analytics-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.pm-analytics-nav a,
.pm-analytics-nav button {
  text-decoration: none;
  font-size: var(--text-md);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  background: var(--surface);
  font: inherit;
  cursor: pointer;
}
.pm-analytics-nav a:hover,
.pm-analytics-nav a.active,
.pm-analytics-nav button:hover,
.pm-analytics-nav button.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.pm-analytics-hub-subtitle {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xl);
  font-weight: 600;
}

.pm-analytics-hub-panel {
  margin-top: var(--space-1);
}

.pm-analytics-embedded {
  width: 100%;
}

.rm-report-hub .rm-report-card {
  text-align: left;
  width: 100%;
  cursor: pointer;
}
@media (max-width: 960px) {
  .pm-filter-bar { flex-direction: column; align-items: stretch; }
  .pm-chart-grid { grid-template-columns: 1fr; }
}

/* ===== Team Chat (Teams-style) ===== */
.content.tc-page {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.tc-shell {
  display: flex;
  position: relative;
  flex: 1;
  min-height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.tc-realtime-banner {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: var(--warning-soft);
  border: 1px solid var(--warning);
  color: var(--warning-strong);
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.tc-sidebar {
  width: 320px;
  min-width: 280px;
  max-width: 360px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.tc-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-4) var(--space-2);
}
.tc-sidebar-head h2 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
}
.tc-new-actions {
  display: flex;
  gap: var(--space-2);
}
.tc-search {
  padding: 0 var(--space-3) var(--space-3);
}
.tc-search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-md);
  background: var(--surface);
  color: inherit;
}
.tc-search input::placeholder {
  color: var(--muted);
}
.tc-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-2) var(--space-3);
}
.tc-list-item {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: var(--radius-xs);
  color: inherit;
  cursor: pointer;
  padding: var(--space-3) var(--space-2);
}
.tc-list-item:hover {
  background: var(--surface-hover);
}
.tc-list-item.active {
  background: var(--primary-soft);
}
.tc-list-item.unread {
  background: var(--surface-hover);
}
.tc-list-item.unread:hover {
  background: var(--surface-hover);
}
.tc-list-item.unread.active {
  background: var(--primary-soft);
}
.tc-list-meta {
  flex: 1;
  min-width: 0;
}
.tc-list-top,
.tc-list-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.tc-list-title {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-list-item.unread .tc-list-title {
  font-weight: 600;
  color: var(--text);
}
.tc-list-top .muted {
  font-size: var(--text-xs);
  flex-shrink: 0;
}
.tc-list-item.unread .tc-list-top .muted {
  font-weight: 500;
  color: var(--primary);
}
.tc-preview {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.tc-list-item.unread .tc-preview {
  font-weight: 600;
  color: var(--text);
}
.tc-unread {
  background: var(--danger);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-2);
  flex-shrink: 0;
}
.tc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
}
.tc-avatar.lg {
  width: 40px;
  height: 40px;
  font-size: var(--text-base);
}
.tc-avatar.sm {
  width: 28px;
  height: 28px;
  font-size: var(--text-xs);
}
/* White icons/text only inside the round avatar strip */
.tc-avatar,
.tc-avatar .tc-group-ico {
  color: #fff !important;
  fill: none;
  stroke: currentColor;
}
.tc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  position: relative;
}
.tc-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: linear-gradient(180deg, var(--surface-raised) 0%, var(--surface-hover) 100%);
}
.tc-placeholder-card {
  max-width: 420px;
  text-align: center;
}
.tc-placeholder-card h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-2xl);
}
.tc-placeholder-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-4);
  flex-wrap: wrap;
}
.tc-thread-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tc-thread-head-meta {
  flex: 1;
  min-width: 0;
}
.tc-thread-head h3 {
  margin: 0;
  font-size: var(--text-lg);
}
.tc-thread-head p {
  margin: 2px 0 0;
  font-size: var(--text-sm);
}
.tc-thread-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.tc-video-btn {
  white-space: nowrap;
}
.tc-call-join {
  display: inline-flex;
  align-items: center;
  margin: var(--space-2) 0 2px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-xs);
  background: var(--success-strong);
  color: #fff !important;
  font-weight: 600;
  font-size: var(--text-md);
  text-decoration: none;
}
.tc-call-join:hover {
  background: var(--success-strong);
}
.tc-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-7) var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  background: var(--surface-raised);
}
.tc-empty {
  text-align: center;
  padding: var(--space-6) var(--space-3);
  margin: 0;
}
.tc-bubble-row {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  max-width: 72%;
  position: relative;
}
.tc-bubble-row.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.tc-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.tc-bubble-row.mine .tc-bubble {
  background: var(--primary-soft);
  border-color: var(--accent-muted);
}
.tc-bubble-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 2px;
}
.tc-bubble-body {
  font-size: var(--text-base);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}
.tc-bubble-body strong {
  font-weight: 600;
}
.tc-bubble-body em {
  font-style: italic;
}
.tc-md-code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
  padding: 1px var(--space-1);
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--text) 10%, transparent);
  border: 1px solid var(--border);
}
.tc-bubble-time {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--space-1);
  text-align: right;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  width: 100%;
}

.tc-ticks {
  font-size: var(--text-sm);
  letter-spacing: -2px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1;
}

.tc-ticks.seen {
  color: var(--primary);
}

.tc-ticks.pending {
  letter-spacing: 0;
  font-size: 10px;
  opacity: 0.7;
}

.tc-bubble-row.pending .tc-bubble {
  opacity: 0.82;
}

.tc-typing-line {
  color: var(--primary, #107c10) !important;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.tc-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: 2px;
}

.tc-typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: tc-typing-bounce 1.2s infinite ease-in-out;
}

.tc-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.tc-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes tc-typing-bounce {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.tc-composer {
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-4) var(--space-4);
  background: var(--surface);
}
.tc-composer textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-base);
  resize: none;
  font-family: inherit;
  min-height: 56px;
}
.tc-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  gap: var(--space-3);
}
.tc-error {
  position: absolute;
  bottom: 88px;
  left: 18px;
  right: 18px;
  margin: 0;
  font-size: var(--text-md);
  pointer-events: none;
}
.tc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.tc-modal {
  width: min(480px, 100%);
  max-height: min(80vh, 640px);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.tc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.tc-modal-head h3 {
  margin: 0;
  font-size: var(--text-xl);
}
.tc-people-list {
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.tc-person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-3) var(--space-3);
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.tc-person:hover {
  background: var(--surface-hover);
}
.tc-person.selected {
  background: var(--primary-soft);
}
.tc-person-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.tc-person-meta strong {
  font-size: var(--text-base);
}
.tc-person-meta .muted {
  font-size: var(--text-sm);
}
.tc-check {
  color: var(--primary);
  font-weight: 600;
}
.tc-modal-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--space-1);
}
.tc-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: visible;
}

.ai-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
}
.ai-topbar-btn:hover,
.ai-topbar-btn.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.ai-topbar-label {
  white-space: nowrap;
}

.ai-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  flex: 1;
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  min-height: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.ai-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface-raised);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.ai-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-sidebar-head h2 {
  margin: 0;
  font-size: var(--text-lg);
}
.ai-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3) 0;
  flex-shrink: 0;
}
.ai-pill {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.ai-pill.ok {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
}
.ai-pill.bad {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}
.ai-reindex-btn {
  margin: var(--space-3) var(--space-3);
  flex-shrink: 0;
}
.ai-conv-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-1) var(--space-2) var(--space-3);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--slate-400) transparent;
}
.ai-conv-list::-webkit-scrollbar {
  width: 8px;
}
.ai-conv-list::-webkit-scrollbar-track {
  background: transparent;
}
.ai-conv-list::-webkit-scrollbar-thumb {
  background: var(--slate-400);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background-clip: content-box;
}
.ai-conv-list::-webkit-scrollbar-thumb:hover {
  background: var(--slate-500);
  background-clip: content-box;
}
.ai-conv-list::-webkit-scrollbar-corner {
  background: transparent;
}
.ai-conv-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
}
.ai-conv-item:hover,
.ai-conv-item.active {
  background: var(--primary-soft);
}
.ai-conv-title {
  font-size: var(--text-md);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-conv-time {
  font-size: var(--text-xs);
}
.ai-empty-side {
  padding: var(--space-3);
  font-size: var(--text-md);
}
.ai-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}
.ai-main-head {
  padding: var(--space-4) var(--space-5) var(--space-2);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.ai-main-head h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
}
.ai-main-head p {
  margin: 0;
  font-size: var(--text-md);
}
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ai-welcome {
  margin: auto;
  max-width: 520px;
  text-align: center;
}
.ai-welcome h4 {
  margin: 0 0 var(--space-3);
}
.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}
.ai-suggest {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-md);
  cursor: pointer;
}
.ai-suggest:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.ai-hint {
  margin-top: var(--space-4);
  font-size: var(--text-md);
  color: var(--muted);
}
.ai-msg {
  max-width: min(720px, 92%);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.ai-msg.user {
  align-self: flex-end;
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
.ai-msg.assistant {
  align-self: flex-start;
}
.ai-msg-role {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: var(--space-1);
}
.ai-msg-body {
  font-size: var(--text-base);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg-body.ai-md {
  white-space: normal;
}
.ai-md-line {
  margin: 0 0 0.2em;
}
.ai-md-blank {
  height: 0.55em;
}
.ai-md-bullet-line {
  display: flex;
  gap: 0.4em;
  align-items: flex-start;
}
.ai-md-bullet {
  flex: 0 0 auto;
  color: var(--primary, #4f46e5);
  font-weight: 600;
  line-height: 1.5;
}
.ai-md strong {
  font-weight: 600;
  color: inherit;
}
.ai-thinking {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
  animation: ai-pulse-border 1.8s ease-in-out infinite;
}
.ai-thinking-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.ai-thinking-copy {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.ai-thinking-label {
  font-size: var(--text-base);
  color: var(--text);
  animation: ai-fade-swap 0.35s ease;
}
.ai-thinking-bar {
  margin-top: var(--space-3);
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, var(--border));
  overflow: hidden;
}
.ai-thinking-bar > span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--primary);
  animation: ai-indeterminate 1.2s ease-in-out infinite;
}
.ai-dots {
  display: inline-flex;
  gap: var(--space-1);
  align-items: center;
}
.ai-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.35;
  animation: ai-bounce 1.05s ease-in-out infinite;
}
.ai-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.ai-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
.ai-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-top-color: var(--primary);
  animation: ai-spin 0.7s linear infinite;
  flex-shrink: 0;
}
.ai-spinner-sm {
  width: 12px;
  height: 12px;
  border-width: 2px;
}
.ai-reindex-btn,
.ai-ask-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
}
@keyframes ai-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes ai-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
@keyframes ai-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(280%);
  }
}
@keyframes ai-pulse-border {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 0%, transparent);
  }
  50% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
  }
}
@keyframes ai-fade-swap {
  from {
    opacity: 0.45;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ai-sql-block {
  border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-5);
  background: var(--surface);
  font-size: var(--text-sm);
  max-height: 200px;
  overflow: auto;
}
.ai-sql-block summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.ai-sql-block summary::-webkit-details-marker {
  display: none;
}
.ai-msg-sql {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
}
.ai-msg-sql summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 500;
}
.ai-sql-block strong {
  display: inline;
  margin-bottom: 0;
}
.ai-sql-pre {
  margin: var(--space-2) 0 0;
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--slate-900);
  color: var(--slate-200);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-xs);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-sources {
  border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-5);
  background: var(--surface);
  font-size: var(--text-sm);
  max-height: 120px;
  overflow-y: auto;
}
.ai-sources ul {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
}
.ai-src-type {
  display: inline-block;
  min-width: 72px;
  font-weight: 600;
  color: var(--primary);
  text-transform: capitalize;
}
.ai-error {
  margin: 0 var(--space-5);
}
.ai-composer {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
  padding: var(--space-3) var(--space-5) var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.ai-composer textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-base);
  background: var(--bg);
  color: var(--text);
}
.ai-followups {
  padding: 0 var(--space-5) var(--space-3);
}
.ai-md-table-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-md);
}
.ai-md-table-row:first-of-type {
  font-weight: 600;
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}
.ai-md-table-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 860px) {
  .ai-shell {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: calc(100vh - 64px);
  }
  .ai-sidebar {
    max-height: 260px;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .ai-conv-list {
    max-height: 160px;
  }
}

.tc-topbar-btn:hover {
  background: var(--primary-soft);
  border-color: var(--accent-muted);
  color: var(--primary);
}
.tc-topbar-btn.has-unread {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger-strong);
  font-weight: 600;
  animation: tc-btn-pulse 1.4s ease-in-out infinite;
}
.tc-topbar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-md);
  background: var(--danger);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}
.tc-other-alert {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--accent-muted);
  background: var(--surface-hover);
  color: var(--primary);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  cursor: pointer;
  font-size: var(--text-md);
  animation: tc-notice-pulse 1.6s ease-in-out 3;
}
.tc-other-alert:hover {
  background: var(--surface-hover);
}
.tc-other-alert-cta {
  margin-left: auto;
  font-weight: 600;
  color: var(--primary);
  flex-shrink: 0;
}
@keyframes tc-btn-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 35%, transparent);
  }
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 0%, transparent);
  }
}
@media (max-width: 800px) {
  .tc-shell {
    flex-direction: column;
    max-height: none;
    min-height: calc(100vh - 56px);
  }
  .tc-sidebar {
    width: 100%;
    max-width: none;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .tc-topbar-label {
    display: none;
  }
  .tc-bubble-row {
    max-width: 90%;
  }
}

/* ===== Free Jitsi video call ===== */
.vc-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  background: var(--slate-900);
  color: var(--slate-100);
}
.vc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: var(--slate-800);
  border-bottom: 1px solid var(--slate-700);
}
.vc-bar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.vc-bar h2 {
  margin: 0;
  font-size: var(--text-lg);
  color: #fff;
}
.vc-bar .muted {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
}
.vc-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.vc-link-strip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-4);
  background: var(--slate-800);
  border-bottom: 1px solid var(--slate-700);
  font-size: var(--text-sm);
}
.vc-link {
  flex: 1;
  min-width: 180px;
  padding: var(--space-2) var(--space-2);
  background: var(--slate-900);
  border-radius: var(--radius-xs);
  color: var(--success-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vc-stage {
  flex: 1;
  min-height: 420px;
  background: var(--slate-900);
}
.vc-stage > iframe,
.vc-stage > div {
  width: 100% !important;
  height: 100% !important;
}
.vc-error {
  margin: 0;
  padding: var(--space-2) var(--space-4);
  background: var(--danger-strong);
}
.vc-ended {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}
@media (max-width: 800px) {
  .vc-page {
    max-height: none;
    min-height: calc(100vh - 56px);
  }
  .vc-stage {
    min-height: 60vh;
  }
}

/* ===== Teams-like chat composer, attachments, reply ===== */
.tc-bubble-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
  /* Reserve space so the emoji toolbar never covers the avatar or bubble text */
  padding-top: var(--space-8);
  margin-top: -8px;
}
.tc-bubble-row > .tc-avatar.sm {
  margin-top: var(--space-8);
  flex-shrink: 0;
}
.tc-hover-bar {
  position: absolute;
  top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: var(--space-1) var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  z-index: 6;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease, visibility var(--duration-fast);
}
/* Incoming messages: avatar is on the left — grow toolbar toward the chat center */
.tc-bubble-row:not(.mine) .tc-hover-bar {
  left: 0;
  right: auto;
}
/* Own messages: grow toolbar toward the chat center */
.tc-bubble-row.mine .tc-hover-bar {
  left: auto;
  right: 0;
}
.tc-bubble-wrap:hover .tc-hover-bar,
.tc-bubble-wrap:focus-within .tc-hover-bar {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.tc-hover-btn {
  border: 0;
  background: transparent;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tc-hover-btn:hover {
  background: var(--surface-hover);
}
.tc-hover-btn.tc-hover-danger:hover {
  background: var(--danger-soft);
  color: var(--danger-strong);
}
.tc-delete-chat {
  color: var(--danger-strong);
  border-color: var(--danger-muted);
}
.tc-hover-sep {
  width: 1px;
  height: 18px;
  background: var(--surface-hover);
  margin: 0 var(--space-1);
  flex-shrink: 0;
}
.tc-quote {
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: var(--space-2) var(--space-2);
  margin-bottom: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-sm);
  width: 100%;
  text-align: left;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}
.tc-quote:hover {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}
.tc-quote strong {
  color: var(--primary);
}
.tc-bubble-row.flash .tc-bubble {
  animation: tc-msg-flash 2.2s ease;
}
@keyframes tc-msg-flash {
  0%,
  100% {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  }
  20%,
  55% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 45%, transparent);
    border-color: var(--primary);
  }
}
.tc-pdf-card,
.tc-pending-pdf {
  display: block;
  margin-top: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  max-width: 320px;
}
.tc-pending-pdf {
  margin-top: 0;
  margin-bottom: var(--space-2);
  max-width: 100%;
}
.tc-pdf-card:hover {
  border-color: var(--accent-muted);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 12%, transparent);
}
.tc-pdf-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}
.tc-pdf-doc-icon {
  font-size: var(--text-2xl);
  flex-shrink: 0;
}
.tc-pdf-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tc-pdf-card-meta strong {
  font-size: var(--text-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-pdf-card-body {
  background: var(--surface-hover);
  padding: var(--space-2);
  display: flex;
  justify-content: center;
}
.tc-pdf-thumb {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  max-height: 140px;
  width: 100%;
}
.tc-pdf-thumb canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: cover;
  object-position: top;
}
.tc-pdf-loading,
.tc-pdf-fallback {
  padding: var(--space-6) var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}
.tc-pdf-fallback {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
}
.tc-attach-image {
  display: block;
  margin-top: var(--space-2);
}
.tc-attach-image img {
  max-width: min(320px, 100%);
  max-height: 240px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
}
.tc-attach-card {
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  text-decoration: none;
  color: inherit;
  max-width: 320px;
}
.tc-attach-card:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}
.tc-attach-icon {
  font-size: var(--text-2xl);
}
.tc-attach-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tc-attach-meta strong {
  font-size: var(--text-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-react-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}
.tc-react-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1px var(--space-2);
  font-size: var(--text-sm);
  cursor: pointer;
}
.tc-react-chip.mine {
  border-color: var(--primary);
  background: var(--surface-hover);
}
.tc-composer.teams-like {
  padding: var(--space-3) var(--space-4) var(--space-3);
}
.tc-reply-banner,
.tc-pending-file {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  border-left: 3px solid var(--primary);
}
.tc-reply-banner > div,
.tc-pending-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-sm);
}
.tc-pending-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}
.tc-pending-icon {
  font-size: 24px;
}
.tc-format-row {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}
.tc-format-row button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-xs);
  width: 32px;
  height: 28px;
  cursor: pointer;
}
.tc-composer-box {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: var(--space-2) var(--space-3);
  position: relative;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease;
}
.tc-composer-box.dragover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}
.tc-composer-box textarea {
  flex: 1;
  border: 0 !important;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 140px;
  padding: var(--space-1) 0 !important;
  font-size: var(--text-base);
  font-family: inherit;
  background: transparent;
}
.tc-drop-overlay {
  position: absolute;
  inset: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--primary);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
  font-size: var(--text-md);
  font-weight: 500;
  pointer-events: none;
  z-index: 2;
}
.tc-composer-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  position: relative;
}
.tc-icon-btn {
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  color: var(--slate-600);
  font-size: var(--text-base);
}
.tc-icon-btn:hover,
.tc-icon-btn.on {
  background: var(--surface-hover);
  color: var(--text);
}
.tc-tool-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 var(--space-1);
}
.tc-send-btn {
  border: 0;
  background: var(--primary);
  color: #fff;
  width: 34px;
  height: var(--control-height-sm);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 15px;
}
.tc-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.tc-tool-pop {
  position: relative;
}
.tc-emoji-pop,
.tc-plus-pop {
  position: absolute;
  right: 0;
  bottom: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  z-index: 20;
}
.tc-emoji-pop {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: var(--space-2);
  width: 280px;
}
.tc-emoji-pop button {
  border: 0;
  background: transparent;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: var(--text-lg);
}
.tc-emoji-pop button:hover {
  background: var(--surface-hover);
}
.tc-plus-pop {
  min-width: 220px;
  padding: var(--space-2);
}
.tc-plus-pop button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: var(--text-md);
}
.tc-plus-pop button:hover {
  background: var(--surface-hover);
}
.tc-composer-hint {
  margin: var(--space-2) 2px 0;
  font-size: var(--text-xs);
}

/* ===== Internal Outlook-style Email ===== */
.content.tc-page:has(.ml-shell) {
  padding: 0;
}
.ml-shell {
  display: grid;
  grid-template-columns: 180px 320px 1fr;
  min-height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.ml-folders {
  border-right: 1px solid var(--border);
  background: var(--surface-hover);
  padding: var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ml-new {
  width: 100%;
}
.ml-folders nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ml-folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: var(--text-md);
  color: var(--text);
}
.ml-folder:hover {
  background: var(--surface-hover);
}
.ml-folder.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.ml-folder-badge {
  background: var(--danger);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-1);
}
.ml-list-pane {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface-raised);
}
.ml-list-head {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.ml-list-head h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
}
.ml-list-head input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-md);
}
.ml-list {
  flex: 1;
  overflow-y: auto;
}
.ml-list-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-3) var(--space-3);
  cursor: pointer;
  color: inherit;
}
.ml-list-item:hover {
  background: var(--surface-hover);
}
.ml-list-item.active {
  background: var(--primary-soft);
}
.ml-list-item.unread .ml-list-from,
.ml-list-item.unread .ml-list-subject {
  font-weight: 600;
  color: var(--text);
}
.ml-list-top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-md);
}
.ml-list-from {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ml-list-subject {
  font-size: var(--text-md);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ml-list-snippet {
  font-size: var(--text-sm);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ml-empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
}
.ml-read-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: var(--surface);
}
.ml-read-empty {
  margin: auto;
  text-align: center;
  max-width: 360px;
  padding: var(--space-6);
}
.ml-read-empty h3 {
  margin: 0 0 var(--space-2);
}
.ml-read-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ml-read-head h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
}
.ml-read-head p {
  margin: 0 0 var(--space-1);
  font-size: var(--text-md);
}
.ml-recip-line {
  font-size: var(--text-sm) !important;
}
.ml-read-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-start;
}
.ml-read-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-base);
  line-height: 1.5;
}
.ml-read-body p {
  margin: 0 0 0.6em;
}
.ml-atts {
  padding: 0 var(--space-5) var(--space-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.ml-att-image img {
  max-width: 280px;
  max-height: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.ml-att-card,
.ml-pdf-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  text-decoration: none;
  color: inherit;
  max-width: 280px;
}
.ml-pdf-card {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.ml-pdf-head {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
}
.ml-pdf-head span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ml-pdf-body {
  background: var(--surface-hover);
  padding: var(--space-2);
  display: flex;
  justify-content: center;
}
.ml-error {
  position: absolute;
  bottom: 12px;
  left: 18px;
  right: 18px;
  margin: 0;
}
.ml-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
}
.ml-topbar-btn:hover {
  background: var(--primary-soft);
  border-color: var(--accent-muted);
  color: var(--primary);
}
.ml-topbar-btn.has-unread {
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning-strong);
  font-weight: 600;
}
.ml-topbar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-md);
  background: var(--danger);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
}
.ml-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.ml-modal {
  width: min(720px, 100%);
  max-height: min(90vh, 820px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ml-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ml-modal-head h3 {
  margin: 0;
}

/* Full-page compose (replaces the popup) */
.ml-compose-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ml-compose-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}
.ml-compose-head h2 {
  margin: 0;
  font-size: var(--text-xl);
  flex: 1;
}
.ml-compose-head-actions {
  display: flex;
  gap: var(--space-2);
}
.ml-compose-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ml-compose-foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-1);
}
.ml-people-field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-1);
}
.ml-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: var(--space-2) var(--space-2);
  min-height: 38px;
}
.ml-chip-row input {
  border: 0;
  outline: none;
  flex: 1;
  min-width: 120px;
  font-size: var(--text-md);
}
.ml-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--primary-soft);
  color: var(--primary-darker);
  border-radius: var(--radius-lg);
  padding: 2px var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
}
.ml-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: var(--text-base);
  line-height: 1;
  color: inherit;
}
.ml-chip.external {
  background: var(--primary-soft);
  color: var(--primary-darker);
}
.ml-mailbox-box {
  margin-top: auto;
  padding: var(--space-3) var(--space-3);
  border-top: 1px solid var(--border);
}
.ml-mailbox-toggle {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: var(--space-2) var(--space-1);
}
.ml-mailbox-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.ml-mailbox-panel input {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.ml-mailbox-panel label {
  font-size: var(--text-xs);
  font-weight: 500;
}
.ml-mailbox-hint,
.ml-mailbox-msg {
  font-size: var(--text-xs);
  margin: 0;
  line-height: 1.35;
}
.ml-mailbox-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.ml-channel-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary-darker);
  background: var(--primary-soft);
  border-radius: var(--radius-xs);
  padding: 1px var(--space-1);
  margin-left: var(--space-2);
}
.ml-people-suggest {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  max-height: 160px;
  overflow-y: auto;
  margin-top: var(--space-1);
}
.ml-people-suggest button {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}
.ml-people-suggest button:hover {
  background: var(--surface-hover);
}
.ml-pending {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.ml-pending-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-hover);
  border-radius: var(--radius-xs);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
}
.ml-pending-item button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.ml-modal-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding-top: var(--space-1);
}
.ml-modal-spacer {
  flex: 1;
}
@media (max-width: 960px) {
  .ml-shell {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .ml-folders,
  .ml-list-pane {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .ml-list-pane {
    max-height: 40vh;
  }
  .ml-topbar-label {
    display: none;
  }
}

/* ---- Per-employee theme picker (header) ---- */
.theme-picker {
  position: relative;
}
.theme-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-xs);
  padding: 0 var(--space-3);
  min-height: 32px;
  cursor: pointer;
  font-size: var(--text-md);
}
.theme-picker-btn:hover,
.theme-picker-btn.open {
  background: var(--sidebar-hover);
  border-color: var(--primary);
}
.theme-picker-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: var(--space-3);
  z-index: 1400;
}
.theme-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.theme-picker-hint {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
}
.theme-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.theme-mode-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  cursor: pointer;
  font-size: var(--text-md);
}
.theme-mode-btn.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary-darker);
  font-weight: 600;
}
html[data-theme="dark"] .theme-mode-btn.active {
  color: #fff;
}
.theme-color-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.theme-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
}
.theme-swatch.custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
  overflow: hidden;
}
.theme-swatch.custom input {
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.theme-picker-foot {
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .theme-picker-label {
    display: none;
  }
}

/* ================================================================
   Professional dark theme
   One consistent neutral palette across ERP, PM, Chat, and Mail.
   ================================================================ */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111827;
  --surface-raised: #182235;
  --surface-hover: #202c40;
  --app-bg: #0b1220;
  --shadow-btn:
    0 1px 1px rgba(0, 0, 0, 0.3),
    0 1px 3px -1px rgba(0, 0, 0, 0.45);
  --shadow-btn-hover:
    0 1px 1px rgba(0, 0, 0, 0.3),
    0 4px 12px -4px rgba(0, 0, 0, 0.6);
  --shadow-btn-active: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-card:
    0 1px 1px rgba(0, 0, 0, 0.28),
    0 8px 20px -14px rgba(0, 0, 0, 0.6);
  --shadow-card-hover:
    0 1px 1px rgba(0, 0, 0, 0.28),
    0 14px 28px -16px rgba(0, 0, 0, 0.7);
  --sidebar: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: var(--primary-soft);
  --text: #e5edf7;
  --heading: #f8fafc;
  --muted: #94a3b8;
  --border: #293548;
  --border-strong: #475569;
  --topbar-bg: #0f172a;
  --input-bg: #1a2436;
  --input-border: #3b4b63;
  --input-placeholder: #94a3b8;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .main,
html[data-theme="dark"] .content {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] strong {
  color: var(--heading);
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] small {
  color: var(--muted) !important;
}

/* Shell and navigation */
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar {
  background: var(--sidebar);
  border-color: var(--border);
  box-shadow: none;
}

html[data-theme="dark"] .sidebar.two-col {
  background: transparent;
  border: 0;
  box-shadow: none;
}


html[data-theme="dark"] .app-shell {
  background: #0b1220;
}

html[data-theme="dark"] .sidebar-rail {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .sidebar-mark {
  background: transparent;
}

html[data-theme="dark"] .sidebar-mark:hover {
  background: #1e293b;
}

html[data-theme="dark"] .sidebar-rail-mods::before,
html[data-theme="dark"] .sidebar-rail-tools::before {
  background: #1e293b;
}

html[data-theme="dark"] .sidebar-rail-btn {
  color: #64748b;
}

html[data-theme="dark"] .sidebar-rail-btn:hover,
html[data-theme="dark"] .sidebar-rail-btn.open {
  color: #94a3b8;
  background: transparent;
}

html[data-theme="dark"] .sidebar-rail-mods .sidebar-rail-btn.active {
  background: #ffffff;
  color: #0f172a;
}

html[data-theme="dark"] .sidebar-rail-mods .sidebar-rail-btn.active::before {
  background: #ffffff;
}

html[data-theme="dark"] .sidebar-rail-avatar {
  background: #ffffff;
  color: #0f172a;
}

html[data-theme="dark"] .sidebar-panel {
  background: var(--sidebar);
}

html[data-theme="dark"] .sidebar-rail-tip {
  background: #f3f2f1;
  color: #201f1e;
  border: none;
}

html[data-theme="dark"] .ui-hover-tip {
  background: #f3f2f1;
  color: #201f1e;
}

html[data-theme="dark"] .ui-hover-tip::after {
  border-top-color: #f3f2f1;
}

html[data-theme="dark"] .sidebar-rail-tip::before {
  border-right-color: #f3f2f1;
}

html[data-theme="dark"] .sidebar-rail-tip.is-floating::before {
  border-right-color: #f3f2f1;
}

html[data-theme="dark"] .sidebar-rail-user-menu,
html[data-theme="dark"] .sidebar-rail-tray {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .sidebar.two-col .nav-section {
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  color: var(--text);
}

html[data-theme="dark"] .sidebar.two-col .nav-link,
html[data-theme="dark"] .sidebar.two-col .nav-ico {
  color: #e2e8f0;
}

html[data-theme="dark"] .sidebar .brand {
  background: var(--sidebar);
  border-color: var(--border);
}

html[data-theme="dark"] .nav-group + .nav-group {
  border-color: var(--border);
}

html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .nav-parent-link,
html[data-theme="dark"] .nav-caret-btn {
  color: #cbd5e1;
}

html[data-theme="dark"] .nav-section {
  color: var(--muted);
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-parent-link:hover,
html[data-theme="dark"] .nav-caret-btn:hover {
  color: var(--heading);
  background: var(--sidebar-hover);
}

html[data-theme="dark"] .nav-link.active {
  color: var(--heading);
  background: var(--primary-soft);
  border-left-color: var(--primary);
}

html[data-theme="dark"] .nav-link.active .nav-ico,
html[data-theme="dark"] .nav-link.active svg {
  color: var(--primary);
}

html[data-theme="dark"] .topbar .title,
html[data-theme="dark"] .topbar .user,
html[data-theme="dark"] .back-btn {
  color: var(--heading);
}

html[data-theme="dark"] .back-btn:hover {
  color: var(--heading);
  background: var(--surface-hover);
  border-color: var(--primary);
}

html[data-theme="dark"] .badge {
  color: var(--heading);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent);
}

/* Surfaces, panels, KPI cards */
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .rm-report-card,
html[data-theme="dark"] .ra-filters {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

/* Work Items / PM filter toolbars (light #fafafa otherwise) */
html[data-theme="dark"] .wi-toolbar,
html[data-theme="dark"] .pm-filter-bar,
html[data-theme="dark"] .ra-filters-row {
  background: var(--surface-raised) !important;
  border-color: var(--border) !important;
  color: var(--text);
}

html[data-theme="dark"] .col-picker-panel {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .wi-date-field input[type="date"] {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--heading);
}

html[data-theme="dark"] .wi-filters select,
html[data-theme="dark"] .wi-search,
html[data-theme="dark"] .wi-filters .ss-control,
html[data-theme="dark"] .pm-filter-bar .field input,
html[data-theme="dark"] .pm-filter-bar .field select,
html[data-theme="dark"] .pm-filter-bar .field .ss-control {
  background-color: var(--input-bg) !important;
  color: var(--heading) !important;
  border-color: var(--input-border) !important;
}

html[data-theme="dark"] .pm-filter-actions .btn,
html[data-theme="dark"] .ra-filters-row > .btn {
  background: color-mix(in srgb, var(--surface-hover) 70%, #000) !important;
  color: var(--heading) !important;
  border: none !important;
  box-shadow: none;
}

html[data-theme="dark"] .pm-filter-actions .btn:hover,
html[data-theme="dark"] .ra-filters-row > .btn:hover {
  background: color-mix(in srgb, var(--surface-hover) 50%, #000) !important;
  border: none !important;
}

html[data-theme="dark"] .wi-table th {
  background: var(--surface-raised) !important;
  color: #a9b7ca !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .card-clickable:hover,
html[data-theme="dark"] .rm-report-card:hover {
  background: var(--surface-raised);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38), 0 4px 12px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .ui-btn:not(.ui-btn--solid) {
  border: none;
}

html[data-theme="dark"] .ui-btn--edit,
html[data-theme="dark"] .ui-btn--primary-soft {
  background: color-mix(in srgb, color-mix(in srgb, var(--primary) 22%, var(--surface)) 22%, var(--surface));
  color: var(--primary);
}

html[data-theme="dark"] .ui-btn--invite,
html[data-theme="dark"] .ui-btn--purple {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
  color: var(--primary);
}

html[data-theme="dark"] .ui-btn--docs,
html[data-theme="dark"] .ui-btn--amber {
  background: color-mix(in srgb, color-mix(in srgb, var(--primary) 22%, var(--surface)) 20%, var(--surface));
  color: var(--primary);
}

html[data-theme="dark"] .ui-btn--open,
html[data-theme="dark"] .ui-btn--green {
  background: color-mix(in srgb, #0b6a0b 22%, var(--surface));
  color: #81c995;
}

html[data-theme="dark"] .ui-btn--danger,
html[data-theme="dark"] .ui-btn--delete {
  background: color-mix(in srgb, #a4262c 22%, var(--surface));
  color: #f28b82;
}

html[data-theme="dark"] .ui-btn--neutral {
  background: var(--surface-hover);
  color: var(--text);
}

html[data-theme="dark"] .card .value,
html[data-theme="dark"] .pm-stat .value,
html[data-theme="dark"] .card-link,
html[data-theme="dark"] .rm-report-card-title {
  color: var(--primary);
}

html[data-theme="dark"] .card .label {
  color: var(--muted);
}

html[data-theme="dark"] .pm-stat-icon {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
  border: none;
}

html[data-theme="dark"] .export-btn {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .export-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .export-btn--excel svg { color: #4ade80; }
html[data-theme="dark"] .export-btn--pdf svg { color: #f87171; }
html[data-theme="dark"] .export-btn--csv svg,
html[data-theme="dark"] .export-btn--print svg { color: var(--muted); }

/* Tables */
html[data-theme="dark"] table {
  color: var(--text);
  background: transparent;
}

html[data-theme="dark"] th {
  color: #a9b7ca;
  background: var(--surface-raised);
  border-color: var(--border);
}

html[data-theme="dark"] td {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}

html[data-theme="dark"] tbody tr {
  background: transparent;
}

html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .pm-dash-project-row:hover,
html[data-theme="dark"] .wi-table tr:hover,
html[data-theme="dark"] .pm-projects-table tbody tr:hover,
html[data-theme="dark"] .pm-page tbody tr:hover,
html[data-theme="dark"] .code-table tbody tr:hover {
  background: var(--surface-hover) !important;
}

/* Light-theme hover paints the <td> — must override that in dark mode */
html[data-theme="dark"] tbody tr:hover td,
html[data-theme="dark"] .pm-dash-project-row:hover td,
html[data-theme="dark"] .wi-table tr:hover td,
html[data-theme="dark"] .pm-projects-table tbody tr:hover td,
html[data-theme="dark"] .pm-page tbody tr:hover td,
html[data-theme="dark"] table tbody tr:hover > td {
  background: var(--surface-hover) !important;
  color: var(--heading) !important;
}

html[data-theme="dark"] tbody tr:hover td a,
html[data-theme="dark"] tbody tr:hover td .muted,
html[data-theme="dark"] tbody tr:hover td strong {
  color: inherit;
}

html[data-theme="dark"] tbody tr:hover td a {
  color: var(--primary) !important;
}

html[data-theme="dark"] .sortable-th:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-raised));
}

/* Buttons and controls */
html[data-theme="dark"] .btn {
  color: #ffffff;
  background: var(--primary-dark);
  border-color: var(--primary);
}

html[data-theme="dark"] .btn:hover {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

html[data-theme="dark"] .btn.secondary,
html[data-theme="dark"] .theme-picker-btn,
html[data-theme="dark"] .tc-topbar-btn,
html[data-theme="dark"] .ml-topbar-btn,
html[data-theme="dark"] .ai-topbar-btn {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .btn.secondary:hover,
html[data-theme="dark"] .theme-picker-btn:hover,
html[data-theme="dark"] .tc-topbar-btn:hover,
html[data-theme="dark"] .ml-topbar-btn:hover,
html[data-theme="dark"] .ai-topbar-btn:hover {
  color: var(--heading);
  background: var(--surface-hover);
  border-color: var(--primary);
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="image"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .ss-control,
html[data-theme="dark"] .sms,
html[data-theme="dark"] .sms-search,
html[data-theme="dark"] .ss-search,
html[data-theme="dark"] .wi-search,
html[data-theme="dark"] .wi-filters select,
html[data-theme="dark"] .pm-filter-bar .field input,
html[data-theme="dark"] .pm-filter-bar .field select,
html[data-theme="dark"] .pm-filter-bar .field .ss-control,
html[data-theme="dark"] .ra-filters-row .field input,
html[data-theme="dark"] .ra-filters-row .field select,
html[data-theme="dark"] .ra-filters-row .field .ss-control,
html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .form-grid textarea,
html[data-theme="dark"] .panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="dark"] .panel select,
html[data-theme="dark"] .panel textarea,
html[data-theme="dark"] .modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="dark"] .modal select,
html[data-theme="dark"] .modal textarea {
  color: var(--heading);
  background-color: var(--input-bg);
  border-color: var(--input-border);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

html[data-theme="dark"] .sms-search,
html[data-theme="dark"] .ss-search {
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .sms {
  background-color: var(--input-bg);
  border-color: var(--input-border);
}

html[data-theme="dark"] .sms-chip {
  color: var(--heading);
  background: var(--surface-hover);
}

html[data-theme="dark"] .sms-chip button {
  color: var(--heading);
  background: color-mix(in srgb, var(--primary) 28%, transparent);
}

html[data-theme="dark"] select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-color: var(--input-bg);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] .sms-search::placeholder,
html[data-theme="dark"] .ss-search::placeholder {
  color: var(--input-placeholder);
  opacity: 1;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .ss-control:focus-within,
html[data-theme="dark"] .sms:focus-within,
html[data-theme="dark"] .sms-control:focus-within {
  outline: none;
  border-color: var(--primary, #0078d4);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary, #0078d4) 35%, transparent),
    0 1px 2px 0 rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 1;
  cursor: pointer;
}

/* Date inputs: keep calendar affordance visible and clickable app-wide */
input[type="date"].date-input,
input[type="date"].wiq-date-input,
.field input[type="date"],
.form-grid input[type="date"],
.panel input[type="date"],
.ra-filters input[type="date"],
.pm-filter-bar input[type="date"] {
  cursor: pointer;
  color-scheme: light dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 1.25rem;
  height: 1.25rem;
}

html[data-theme="dark"] .wiq-date-input,
html[data-theme="dark"] input[type="date"].date-input {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--heading);
  color-scheme: dark;
}

html[data-theme="dark"] .ss-pop,
html[data-theme="dark"] .sms-pop,
html[data-theme="dark"] .sms-list,
html[data-theme="dark"] .ss-list {
  background: var(--surface-raised);
  border-color: var(--border);
  color: var(--heading);
}

html[data-theme="dark"] .ss-item,
html[data-theme="dark"] .sms-item {
  border-bottom-color: var(--border);
  color: var(--heading);
}

html[data-theme="dark"] .ss-item:hover,
html[data-theme="dark"] .ss-item.active,
html[data-theme="dark"] .sms-item:hover {
  background: var(--surface-hover);
}

html[data-theme="dark"] .ss-disabled .ss-control {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--border);
}

/* Theme panel */
html[data-theme="dark"] .theme-picker-panel {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .theme-mode-btn {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .theme-mode-btn:hover {
  background: var(--surface-hover);
}

html[data-theme="dark"] .theme-mode-btn.active {
  color: var(--heading);
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* Chat */
html[data-theme="dark"] .tc-shell,
html[data-theme="dark"] .tc-main {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .tc-sidebar,
html[data-theme="dark"] .tc-thread-head,
html[data-theme="dark"] .tc-composer {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .tc-sidebar-head h2,
html[data-theme="dark"] .tc-thread-head h3,
html[data-theme="dark"] .tc-list-title {
  color: var(--heading);
}

html[data-theme="dark"] .tc-list-item {
  color: var(--text);
}

html[data-theme="dark"] .tc-list-item:hover {
  background: var(--surface-hover);
}

html[data-theme="dark"] .tc-list-item.active,
html[data-theme="dark"] .tc-list-item.unread.active {
  background: var(--primary-soft);
}

html[data-theme="dark"] .tc-list-item.unread {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

html[data-theme="dark"] .tc-list-item.unread .tc-list-title,
html[data-theme="dark"] .tc-list-item.unread .tc-preview {
  color: var(--heading);
}

html[data-theme="dark"] .tc-preview,
html[data-theme="dark"] .tc-thread-head p {
  color: var(--muted);
}

html[data-theme="dark"] .tc-messages {
  background: var(--bg);
}

html[data-theme="dark"] .tc-bubble {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--border);
  box-shadow: none;
}

html[data-theme="dark"] .tc-bubble-row.mine .tc-bubble {
  color: var(--heading);
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
}

html[data-theme="dark"] .tc-bubble-body {
  color: inherit;
}

html[data-theme="dark"] .tc-composer-box,
html[data-theme="dark"] .tc-reply-banner,
html[data-theme="dark"] .tc-pending-file {
  color: var(--text);
  background: #0d1626;
  border-color: var(--border);
}

html[data-theme="dark"] .tc-icon-btn {
  color: var(--muted);
}

html[data-theme="dark"] .tc-icon-btn:hover,
html[data-theme="dark"] .tc-icon-btn.on {
  color: var(--heading);
  background: var(--surface-hover);
}

/* Mail */
html[data-theme="dark"] .ml-shell,
html[data-theme="dark"] .ml-read-pane,
html[data-theme="dark"] .ml-compose-page {
  color: var(--text);
  background: var(--bg);
  border-color: var(--border);
}

html[data-theme="dark"] .ml-folders,
html[data-theme="dark"] .ml-list-pane,
html[data-theme="dark"] .ml-compose-head {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .ml-folder {
  color: var(--text);
}

html[data-theme="dark"] .ml-folder:hover,
html[data-theme="dark"] .ml-list-item:hover {
  background: var(--surface-hover);
}

html[data-theme="dark"] .ml-folder.active,
html[data-theme="dark"] .ml-list-item.active {
  color: var(--heading);
  background: var(--primary-soft);
}

html[data-theme="dark"] .ml-list-item {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .ml-list-item.unread .ml-list-from,
html[data-theme="dark"] .ml-list-item.unread .ml-list-subject {
  color: var(--heading);
}

html[data-theme="dark"] .ml-list-head,
html[data-theme="dark"] .ml-read-head,
html[data-theme="dark"] .ml-mailbox-box {
  border-color: var(--border);
}

html[data-theme="dark"] .ml-mailbox-toggle {
  color: var(--text);
}

html[data-theme="dark"] .ml-chip-row {
  color: var(--text);
  background: #0d1626;
  border-color: var(--border-strong);
}

html[data-theme="dark"] .ml-people-suggest {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .ml-people-suggest button {
  color: var(--text);
  background: transparent;
}

html[data-theme="dark"] .ml-people-suggest button:hover {
  background: var(--surface-hover);
}

/* Status chips and semantic tints: keep the hue, darken the surface. */
html[data-theme="dark"] .wif-banner-error {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #a4262c 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #f1aeb5 40%, var(--border)) !important;
}

html[data-theme="dark"] .wif-banner-success {
  background: color-mix(in srgb, #dff6dd 22%, var(--surface)) !important;
  color: color-mix(in srgb, #0b6a0b 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #9fd89f 40%, var(--border)) !important;
}

html[data-theme="dark"] .ra-avail-leave td {
  background: color-mix(in srgb, #fdf2f2 22%, var(--surface)) !important;
  color: color-mix(in srgb, #922b21 45%, #ffffff) !important;
}

html[data-theme="dark"] .pill.green {
  background: color-mix(in srgb, #dcfce7 22%, var(--surface)) !important;
  color: color-mix(in srgb, #166534 45%, #ffffff) !important;
}

html[data-theme="dark"] .pill.red {
  background: color-mix(in srgb, #fee2e2 22%, var(--surface)) !important;
  color: color-mix(in srgb, #991b1b 45%, #ffffff) !important;
}

html[data-theme="dark"] .pill.amber {
  background: color-mix(in srgb, #fef3c7 22%, var(--surface)) !important;
  color: color-mix(in srgb, #92400e 45%, #ffffff) !important;
}

html[data-theme="dark"] .cp-day.cp-weekend {
  background: color-mix(in srgb, #f5c6cb 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .cp-day.cp-holiday-col {
  background: color-mix(in srgb, #fdebd0 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .cp-holiday {
  background: color-mix(in srgb, #e67e22 70%, var(--surface)) !important;
  color: #fff !important;
}

html[data-theme="dark"] .cp-idle {
  background: color-mix(in srgb, #f5c6cb 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .feed-notice-strip.is-update {
  background: color-mix(in srgb, #fff4ce 22%, var(--surface)) !important;
  color: var(--text) !important;
  border-color: color-mix(in srgb, #f0e0a0 40%, var(--border)) !important;
}

html[data-theme="dark"] .feed-notice-strip.is-call {
  background: color-mix(in srgb, #dff6dd 22%, var(--surface)) !important;
  color: var(--text) !important;
  border-color: color-mix(in srgb, #a7e3a5 40%, var(--border)) !important;
}

html[data-theme="dark"] .feed-notice-strip.is-mail {
  background: color-mix(in srgb, #fff4ce 22%, var(--surface)) !important;
  color: var(--text) !important;
  border-color: color-mix(in srgb, #f0e0a0 40%, var(--border)) !important;
}

html[data-theme="dark"] .feed-icon-btn.recording {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #a4262c 45%, #ffffff) !important;
}

html[data-theme="dark"] .feed-delete-btn:hover:not(:disabled) {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .feed-voice-btn.recording {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #a4262c 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #a4262c 40%, var(--border)) !important;
}

html[data-theme="dark"] .chip.add {
  background: color-mix(in srgb, #e6ffec 22%, var(--surface)) !important;
  color: color-mix(in srgb, #1a7f37 45%, #ffffff) !important;
}

html[data-theme="dark"] .chip.del {
  background: color-mix(in srgb, #ffebe9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #cf222e 45%, #ffffff) !important;
}

html[data-theme="dark"] .btn.secondary.small.danger:hover {
  background: color-mix(in srgb, #ffebe9 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .merge-resolve-ready {
  background: color-mix(in srgb, #e6ffec 22%, var(--surface)) !important;
  color: color-mix(in srgb, #1a7f37 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #abf2bc 40%, var(--border)) !important;
}

html[data-theme="dark"] .merge-file-item.active {
  background: color-mix(in srgb, #ffebe9 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .status-A {
  background: color-mix(in srgb, #e6ffec 22%, var(--surface)) !important;
  color: color-mix(in srgb, #1a7f37 45%, #ffffff) !important;
}

html[data-theme="dark"] .status-M {
  background: color-mix(in srgb, #fff8c5 22%, var(--surface)) !important;
  color: color-mix(in srgb, #9a6700 45%, #ffffff) !important;
}

html[data-theme="dark"] .status-D {
  background: color-mix(in srgb, #ffebe9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #cf222e 45%, #ffffff) !important;
}

html[data-theme="dark"] .pr-approved {
  background: color-mix(in srgb, #e6ffec 22%, var(--surface)) !important;
  color: color-mix(in srgb, #1a7f37 45%, #ffffff) !important;
}

html[data-theme="dark"] .pr-rejected {
  background: color-mix(in srgb, #ffebe9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #cf222e 45%, #ffffff) !important;
}

html[data-theme="dark"] .pr-merged {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface)) !important;
  color: color-mix(in srgb, var(--primary) 45%, #ffffff) !important;
}

html[data-theme="dark"] .pr-closed {
  background: color-mix(in srgb, #f0f2f5 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .rm-flash-success {
  background: color-mix(in srgb, #ecfdf5 22%, var(--surface)) !important;
  color: color-mix(in srgb, #065f46 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #a7f3d0 40%, var(--border)) !important;
}

html[data-theme="dark"] .rm-flash-error {
  background: color-mix(in srgb, #fef2f2 22%, var(--surface)) !important;
  color: color-mix(in srgb, #991b1b 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #fecaca 40%, var(--border)) !important;
}

html[data-theme="dark"] .rm-cal-available {
  background: color-mix(in srgb, #dcfce7 22%, var(--surface)) !important;
  color: color-mix(in srgb, #166534 45%, #ffffff) !important;
}

html[data-theme="dark"] .rm-cal-leave {
  background: color-mix(in srgb, #fef3c7 22%, var(--surface)) !important;
  color: color-mix(in srgb, #92400e 45%, #ffffff) !important;
}

html[data-theme="dark"] .panel.success {
  background: color-mix(in srgb, #dff6dd 22%, var(--surface)) !important;
  color: color-mix(in srgb, #0b6a0b 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #9fd89f 40%, var(--border)) !important;
}

html[data-theme="dark"] .pm-health-green {
  background: color-mix(in srgb, #dff6dd 22%, var(--surface)) !important;
  color: color-mix(in srgb, #107c10 45%, #ffffff) !important;
}

html[data-theme="dark"] .pm-health-yellow {
  background: color-mix(in srgb, #fff4ce 22%, var(--surface)) !important;
  color: color-mix(in srgb, #8a6914 45%, #ffffff) !important;
}

html[data-theme="dark"] .pm-health-red {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #a4262c 45%, #ffffff) !important;
}

html[data-theme="dark"] .pm-project-cell--green {
  background: color-mix(in srgb, #22c55e 18%, var(--surface)) !important;
}
html[data-theme="dark"] .pm-project-cell--yellow {
  background: color-mix(in srgb, #eab308 18%, var(--surface)) !important;
}
html[data-theme="dark"] .pm-project-cell--red {
  background: color-mix(in srgb, #ef4444 18%, var(--surface)) !important;
}

html[data-theme="dark"] .pm-heatmap .cell-green {
  background: color-mix(in srgb, #dff6dd 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .pm-heatmap .cell-yellow {
  background: color-mix(in srgb, #fff4ce 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .pm-heatmap .cell-red {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .tc-realtime-banner {
  background: color-mix(in srgb, #fff8e6 22%, var(--surface)) !important;
  color: color-mix(in srgb, #7a5b00 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #f0d78c 40%, var(--border)) !important;
}

html[data-theme="dark"] .tc-topbar-btn.has-unread {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #a4262c 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #c4314b 40%, var(--border)) !important;
}

html[data-theme="dark"] .ml-topbar-btn.has-unread {
  background: color-mix(in srgb, #fff4ce 22%, var(--surface)) !important;
  color: color-mix(in srgb, #8a3711 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #ca5010 40%, var(--border)) !important;
}

html[data-theme="dark"] .report-total-row td {
  background: color-mix(in srgb, #f8fafc 12%, var(--surface)) !important;
  border-top-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .ui-alert-success {
  background: color-mix(in srgb, #e8f5e9 18%, var(--surface)) !important;
  border-color: color-mix(in srgb, #a5d6a7 35%, var(--border)) !important;
  color: color-mix(in srgb, #1b5e20 40%, #ffffff) !important;
}

html[data-theme="dark"] .ui-alert-error {
  background: color-mix(in srgb, #fdecea 18%, var(--surface)) !important;
  border-color: color-mix(in srgb, #f5c6cb 35%, var(--border)) !important;
  color: color-mix(in srgb, #b71c1c 40%, #ffffff) !important;
}

html[data-theme="dark"] .ui-alert-info {
  background: color-mix(in srgb, var(--primary) 18%, var(--surface)) !important;
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border)) !important;
  color: color-mix(in srgb, var(--primary) 40%, #ffffff) !important;
}

/* Employee home (holidays / leave / remote / events / announcements) */
html[data-theme="dark"] .emp-home .eh-card {
  background: var(--surface-raised) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .emp-home .eh-card-head {
  border-bottom-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .eh-card-head h3 {
  color: var(--muted) !important;
}

html[data-theme="dark"] .emp-home .eh-holiday {
  background: var(--surface) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .emp-home .eh-holiday .eh-card-head {
  border-bottom-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .eh-person-name {
  color: var(--heading, #f3f4f6) !important;
}

html[data-theme="dark"] .emp-home .eh-person-sub,
html[data-theme="dark"] .emp-home .muted {
  color: var(--muted) !important;
}

html[data-theme="dark"] .emp-home .eh-tabs {
  border-bottom-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .eh-tab {
  color: var(--muted) !important;
}

html[data-theme="dark"] .emp-home .eh-tab.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

html[data-theme="dark"] .emp-home .eh-balance {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .eh-clock {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .feed-card,
html[data-theme="dark"] .emp-home .feed-post {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none;
}

html[data-theme="dark"] .emp-home .feed-post-head {
  border-bottom-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .feed-composer-box {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .feed-list {
  scrollbar-color: #4b5563 transparent;
}

html[data-theme="dark"] .emp-home .feed-list::-webkit-scrollbar-thumb {
  background: #4b5563;
}

html[data-theme="dark"] .emp-home .feed-list::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

html[data-theme="dark"] .emp-home .feed-post-body,
html[data-theme="dark"] .emp-home .feed-post-body p,
html[data-theme="dark"] .emp-home .feed-post-body span,
html[data-theme="dark"] .emp-home .feed-post-body li,
html[data-theme="dark"] .emp-home .feed-post-body strong,
html[data-theme="dark"] .emp-home .feed-post-html,
html[data-theme="dark"] .emp-home .feed-post-html p,
html[data-theme="dark"] .emp-home .feed-post-html span,
html[data-theme="dark"] .emp-home .feed-post-html li,
html[data-theme="dark"] .emp-home .feed-post-html strong,
html[data-theme="dark"] .emp-home .feed-post-html b {
  color: var(--text) !important;
}

html[data-theme="dark"] .emp-home .feed-post-body a,
html[data-theme="dark"] .emp-home .feed-post-html a {
  color: var(--primary) !important;
}

html[data-theme="dark"] .emp-home .feed-post-html div,
html[data-theme="dark"] .emp-home .feed-post-html table,
html[data-theme="dark"] .emp-home .feed-post-html td {
  background-color: transparent !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .feed-post-modal {
  background: var(--surface-raised) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .emp-home .feed-banner,
html[data-theme="dark"] .emp-home .eh-banner {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* ── Manager / Team Dashboard ─────────────────────────── */
.manager-dash { max-width: 1200px; }

/* Section tabs (SUMMARY, ATTENDANCE, LEAVE, etc.) */
.mt-section-tabs {
  display: flex; gap: 0; border-bottom: 3px solid var(--border); margin-bottom: 0;
  background: var(--surface); padding: 0 var(--space-1); overflow-x: auto; scrollbar-width: thin;
}
.mt-section-tab {
  padding: var(--space-3) var(--space-5); background: none; border: none; font-size: var(--text-sm); font-weight: 500;
  letter-spacing: 0.03em; cursor: pointer; color: var(--text-muted);
  border-bottom: 3px solid transparent; margin-bottom: -4px; transition: all var(--duration-fast); white-space: nowrap;
}
.mt-section-tab:hover { color: var(--text); }
.mt-section-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Secondary tabs under each section */
.mt-subtabs {
  display: flex; gap: var(--space-2); padding: var(--space-4) 0 var(--space-1); overflow-x: auto; scrollbar-width: thin;
}
.mt-subtab {
  padding: var(--space-2) var(--space-4); border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-md); cursor: pointer; color: var(--text-muted); white-space: nowrap;
  font-size: var(--text-md); font-weight: 500;
}
.mt-subtab.active {
  color: var(--primary); border-color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.md-top-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.md-leave-panel, .md-notin-panel { padding: var(--space-4); }
.md-leave-panel h3, .md-notin-panel h3 { margin: 0 0 var(--space-3); font-size: var(--text-lg); }

.md-avatar-row { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: flex-start; }
.md-avatar-item { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); width: 60px; }
.md-avatar-name { font-size: var(--text-xs); color: var(--text-muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60px; }
.md-more-badge { display: flex; align-items: center; color: var(--primary); font-size: var(--text-md); font-weight: 600; }

/* Team Calendar */
.team-cal-wrap { margin-top: var(--space-2); }
.team-cal-search {
  max-width: 420px;
  margin: 0 0 var(--space-3);
}
@media (max-width: 800px) {
  .team-cal-search { max-width: none; }
}
.team-cal-header { font-size: var(--text-base); margin-bottom: var(--space-2); }
.team-cal-scroll { overflow-x: auto; }
.team-cal-table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
.team-cal-table th, .team-cal-table td { padding: var(--space-1) 2px; text-align: center; min-width: 32px; }
.team-cal-name-col { text-align: left !important; min-width: 160px; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.team-cal-emp-name { font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; display: inline-block; }
.team-cal-day-head { font-size: var(--text-xs); line-height: 1.2; }
.team-cal-day-head.weekend { color: var(--text-muted); }
.team-cal-day-head.today { color: var(--primary); font-weight: 600; }
.team-cal-cell.today { background: rgba(var(--primary-rgb, 99, 102, 241), 0.06); }
.team-cal-cell.marked { background: color-mix(in srgb, var(--primary) 3%, transparent); }
.team-cal-markers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.team-cal-markers.is-multi .team-cal-marker {
  width: 20px;
  height: 20px;
  font-size: 8px;
}
.team-cal-marker {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  margin: auto;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}
.team-cal-date {
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 24px;
}
.team-cal-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text-muted); }
.team-cal-legend-item { display: flex; align-items: center; gap: var(--space-1); }
.team-cal-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Employee Cards */
.emp-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.emp-card {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4);
  background: var(--surface); display: flex; flex-direction: column; gap: var(--space-2);
}
.emp-card-top { display: flex; align-items: center; gap: var(--space-3); }
.emp-card-badge {
  font-size: var(--text-xs); font-weight: 600; padding: 2px var(--space-2); border-radius: var(--radius-xs); text-transform: uppercase;
}
.emp-card-badge.red { background: var(--danger-soft); color: var(--danger-strong); }
.emp-card-badge.green { background: var(--success-soft); color: var(--success-strong); }
.emp-card-name { font-weight: 600; font-size: var(--text-lg); margin-top: var(--space-1); }
.emp-card-desg { font-size: var(--text-md); }
.emp-card-info { font-size: var(--text-sm); color: var(--text-muted); }

.mt-perf-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.mt-perf-side {
  padding: 0;
  overflow: hidden;
}
.mt-perf-side-head {
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mt-perf-search {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.mt-perf-search input {
  width: 100%;
}
.mt-perf-emp-list {
  max-height: 560px;
  overflow: auto;
}
.mt-perf-emp {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.mt-perf-emp.active {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.08);
}
.mt-perf-emp-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mt-perf-emp-meta strong {
  font-size: var(--text-md);
}
.mt-perf-emp-meta span {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.mt-perf-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.mt-perf-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mt-subtabs--compact {
  padding-top: 0;
}
.mt-feedback-list {
  display: grid;
  gap: var(--space-3);
}
.mt-feedback-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--surface);
}
.mt-feedback-card-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-2);
}
.mt-empty-state {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (max-width: 900px) {
  .md-top-row { grid-template-columns: 1fr; }
  .mt-perf-layout { grid-template-columns: 1fr; }
}


/* ===== Project Details workspace (pd-*) ===== */
.pd-page {
  --pd-accent: var(--primary);
  --pd-accent-soft: var(--primary-soft);
  --pd-border: color-mix(in srgb, var(--primary) 18%, var(--border, #e5e7eb));
  --pd-muted-bg: color-mix(in srgb, var(--primary) 6%, var(--surface, #fff));
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: var(--space-4);
}
.pd-page > * {
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, var(--slate-200));
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}
.pd-page > *:last-child {
  border-bottom: none;
}
.pd-header,
.pd-info-row,
.pd-actions,
.pd-sections,
.pd-workspace,
.pd-panel {
  border-radius: 0 !important;
  box-shadow: none !important;
}
.pd-header {
  padding: var(--space-3) var(--space-4);
}
.pd-info-row {
  gap: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: none;
  background: transparent;
}
.pd-info-card {
  border-radius: 0;
  border: none;
  border-right: 1px solid color-mix(in srgb, var(--primary) 10%, var(--slate-150));
  background: var(--surface, #fff);
  padding: var(--space-3) var(--space-3);
}
.pd-info-card:last-child,
button.pd-info-card:last-child {
  border-right: none;
}
.pd-actions {
  gap: var(--space-4);
  border: none;
  border-radius: 0;
  padding: var(--space-3) var(--space-4);
}
.pd-sections {
  border: none;
  border-radius: 0;
  padding: var(--space-2) var(--space-2);
}
.pd-workspace {
  padding-top: 0;
}
.pd-panel {
  border: none !important;
  border-radius: 0 !important;
  padding: var(--space-3) var(--space-4);
}
.pd-shell {
  gap: 0;
}
.pd-rail {
  border-radius: 0;
  border-right: 1px solid color-mix(in srgb, var(--primary) 12%, var(--slate-200));
  border-left: none;
  border-top: none;
  border-bottom: none;
}
.pd-main {
  border-left: 1px solid color-mix(in srgb, var(--primary) 10%, var(--slate-150));
  padding-left: 0;
}
.pd-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .pd-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-info-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-info-card { border-bottom: 1px solid color-mix(in srgb, var(--primary) 10%, var(--slate-150)); }
}
@media (max-width: 720px) {
  .pd-form-grid { grid-template-columns: 1fr; }
  .pd-info-row { grid-template-columns: 1fr; }
}

.pd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  background: var(--surface, #fff);
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
}
.pd-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.pd-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary));
  flex-shrink: 0;
}
.pd-title {
  margin: 0;
  font-size: var(--text-xl);
  color: var(--pd-accent);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.pd-code { font-weight: 500; }
.pd-chip {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--slate-500);
  background: var(--pd-muted-bg);
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
  padding: 2px var(--space-2);
}
.pd-sub {
  font-size: var(--text-sm);
  color: var(--slate-500);
  margin-top: 2px;
}
.pd-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.pd-ref { font-size: var(--text-sm); color: var(--slate-500); }
.pd-status-pill {
  background: var(--pd-accent);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
}
.pd-progress-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(var(--pd-accent) var(--pd-pct, 0%), var(--accent-soft) 0);
  display: grid;
  place-items: center;
}
.pd-progress-ring > span {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--pd-accent);
  line-height: 1.1;
}
.pd-progress-ring small {
  font-size: 8px;
  font-weight: 500;
  color: var(--slate-500);
}

.pd-info-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}
.pd-info-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--surface, #fff);
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-3);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: default;
}
button.pd-info-card { cursor: pointer; }
.pd-info-card--alert {
  background: var(--slate-50);
  border-color: var(--danger-muted);
}
.pd-info-ico {
  color: var(--pd-accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.pd-info-label {
  font-size: var(--text-xs);
  color: var(--slate-500);
  margin-bottom: 2px;
}
.pd-info-value {
  font-size: var(--text-md);
  font-weight: 500;
}
.pd-team-stack {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}
.pd-avatars {
  display: inline-flex;
  align-items: center;
}
.pd-avatars .pd-avatar { margin-left: -8px; border: 2px solid #fff; }
.pd-avatars .pd-avatar:first-child { margin-left: 0; }
.pd-avatars--lg { flex-wrap: wrap; gap: var(--space-1); }
.pd-avatars--lg .pd-avatar { margin-left: 0; }
.pd-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
}

.pd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  background: var(--surface, #fff);
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
}
.pd-action {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 56px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--slate-600);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
}
.pd-action-ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--primary) 35%, var(--border, #e5e7eb));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface, #fff));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}
.pd-action-ico svg {
  width: 18px !important;
  height: 18px !important;
  color: var(--primary);
  flex-shrink: 0;
}
.pd-action:hover .pd-action-ico {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.pd-action:hover {
  color: var(--primary-darker, var(--primary));
}
.pd-actions-hint { margin-left: auto; font-size: var(--text-sm); }

.pd-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.pd-form-grid label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--slate-700);
}
.pd-form-grid input,
.pd-form-grid select,
.pd-form-grid textarea {
  font: inherit;
  font-size: var(--text-base);
  font-weight: 400;
  border: 1px solid var(--pd-border, #cbd5e1);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  background: #fff;
  min-height: 40px;
  box-sizing: border-box;
  width: 100%;
}
.pd-form-span { grid-column: 1 / -1; }
.pd-inline-form-title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-base);
  color: var(--primary);
}
@media (max-width: 720px) {
  .pd-form-grid { grid-template-columns: 1fr; }
}

.pd-sections {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  padding: var(--space-1);
  background: var(--surface, #fff);
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
  scrollbar-width: thin;
}
.pd-section-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  border: none;
  background: transparent;
  color: var(--slate-600);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.pd-section-tab svg { width: 14px; height: 14px; }
.pd-section-tab:hover { background: var(--pd-accent-soft); color: var(--pd-accent); }
.pd-section-tab.is-active {
  background: var(--primary);
  color: #fff;
}

.pd-workspace { min-height: 320px; }
.pd-panel {
  background: var(--surface, #fff);
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-4);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 4%, transparent);
}
.pd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}
.pd-panel-head h2 {
  margin: 0;
  font-size: var(--text-lg);
  color: var(--slate-800);
}
.pd-panel-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.pd-count { margin: 0 0 var(--space-2); font-size: var(--text-sm); }

.pd-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.pd-kpi {
  border: 1px solid var(--pd-border);
  background: var(--pd-muted-bg);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-3);
  text-align: left;
  cursor: default;
  font: inherit;
  color: inherit;
}
button.pd-kpi { cursor: pointer; }
.pd-kpi strong {
  display: block;
  font-size: var(--text-3xl);
  color: var(--slate-800);
}
.pd-kpi span {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--slate-500);
}
.pd-kpi.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pd-kpi.is-active strong,
.pd-kpi.is-active span { color: #fff; }

.pd-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.pd-card {
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  background: #fff;
}
.pd-card h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
  color: var(--slate-700);
}
.pd-card p { margin: 0 0 var(--space-2); font-size: var(--text-md); line-height: 1.45; }
.pd-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin: var(--space-3) 0;
}
.pd-meta-grid span { display: block; font-size: var(--text-xs); }
.pd-meta-grid strong { font-size: var(--text-md); }
.pd-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pd-list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
}

.pd-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--pd-muted-bg);
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
}
.pd-filter-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--pd-accent);
}
.pd-filter-bar select,
.pd-search {
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  background: #fff;
  min-width: 120px;
}
.pd-search { min-width: 160px; }

.pd-table-wrap {
  overflow: auto;
  max-height: min(58vh, 560px);
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
}
.pd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-md);
}
.pd-table th,
.pd-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--slate-150);
  text-align: left;
  white-space: nowrap;
}
.pd-table th {
  position: sticky;
  top: 0;
  background: var(--pd-muted-bg);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--slate-600);
  z-index: 1;
}
.pd-table tbody tr:hover td { background: var(--slate-50); }
.pd-title-cell {
  font-weight: 400;
  color: var(--slate-800);
  max-width: 280px;
  white-space: normal;
}
.pd-inline-ico {
  vertical-align: -2px;
  margin-right: var(--space-1);
  color: var(--pd-accent);
}
.pd-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--primary);
}
.pd-badge--blue { background: var(--accent-soft); color: var(--primary); }
.pd-badge--purple { background: var(--accent-soft); color: var(--primary); }
.pd-badge--red { background: var(--danger-soft); color: var(--danger-strong); }
.pd-badge--green { background: var(--success-soft); color: var(--success-strong); }
.pd-badge--amber { background: var(--warning-soft); color: var(--warning-strong); }
.pd-badge--gray { background: var(--slate-100); color: var(--slate-600); }

html[data-theme="dark"] .pd-badge--blue {
  background: color-mix(in srgb, var(--primary) 20%, var(--surface-raised));
  color: var(--primary);
}
html[data-theme="dark"] .pd-badge--purple {
  background: color-mix(in srgb, var(--primary) 20%, var(--surface-raised));
  color: var(--primary);
}
html[data-theme="dark"] .pd-badge--red {
  background: color-mix(in srgb, #ef4444 20%, var(--surface-raised));
  color: #fca5a5;
}
html[data-theme="dark"] .pd-badge--green {
  background: color-mix(in srgb, #22c55e 20%, var(--surface-raised));
  color: #86efac;
}
html[data-theme="dark"] .pd-badge--amber {
  background: color-mix(in srgb, #f59e0b 20%, var(--surface-raised));
  color: #fbbf24;
}
html[data-theme="dark"] .pd-badge--gray {
  background: var(--surface-hover);
  color: var(--muted);
}

.pd-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}
.pd-report-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3);
  align-items: start;
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  background: var(--pd-muted-bg);
}
.pd-report-card h3 { margin: 0 0 var(--space-1); font-size: var(--text-md); }
.pd-report-card p { margin: 0 0 var(--space-1); font-size: var(--text-sm); }
.pd-report-ico { color: var(--pd-accent); width: 20px; height: 20px; }

.pd-inline-form {
  border: 1px solid var(--pd-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--pd-muted-bg);
}
.pd-inline-form-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  justify-content: flex-end;
}
.pd-member-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.pd-inline-actions { display: inline-flex; gap: var(--space-1); }

.pd-activity {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.pd-activity li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-md);
}
.pd-activity-ico {
  color: var(--pd-accent);
  margin-top: var(--space-1);
  flex-shrink: 0;
}
.pd-activity--timeline li {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--slate-150);
}
.pd-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}
.pd-page .linkish {
  background: none;
  border: none;
  color: var(--pd-accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

@media (max-width: 1100px) {
  .pd-info-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .pd-header { flex-direction: column; align-items: flex-start; }
  .pd-info-row { grid-template-columns: 1fr; }
  .pd-actions-hint { width: 100%; margin-left: 0; }
}

/* Project Details � left project list + main workspace */
.pd-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  min-height: calc(100vh - 120px);
}
.pd-rail {
  position: sticky;
  top: 8px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
  background: var(--surface, #fff);
  border: 1px solid var(--pd-border, #e4ddf7);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pd-rail-head {
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--pd-border, #e4ddf7);
  flex: 0 1 auto;
  min-height: 0;
}
.pd-rail-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--primary, #16a34a) 18%, var(--slate-200));
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--slate-700);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.pd-rail-nav-item:hover {
  border-color: var(--primary, #16a34a);
  background: color-mix(in srgb, var(--primary, #16a34a) 8%, #fff);
  color: var(--primary, #16a34a);
}
.pd-rail-nav-item.is-active {
  border-color: var(--primary, #16a34a);
  background: color-mix(in srgb, var(--primary, #16a34a) 12%, #fff);
  color: var(--primary, #16a34a);
  box-shadow: inset 3px 0 0 var(--primary, #16a34a);
}
.pd-rail-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.pd-rail-collapse {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--primary, #16a34a) 22%, var(--slate-200));
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--slate-500);
  cursor: pointer;
  padding: 0;
}
.pd-rail-collapse:hover {
  color: var(--primary, #16a34a);
  border-color: var(--primary, #16a34a);
  background: color-mix(in srgb, var(--primary, #16a34a) 8%, #fff);
}
.pd-shell--rail-collapsed {
  grid-template-columns: 44px minmax(0, 1fr) !important;
}
.pd-rail.is-collapsed {
  align-items: stretch;
  align-self: start;
  padding: var(--space-2) var(--space-1);
  min-height: 0;
  height: auto;
  max-height: none;
}
.pd-rail-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  width: 100%;
  min-height: 0;
  height: auto;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: var(--space-2) var(--space-1) var(--space-2);
  color: var(--slate-500);
  font: inherit;
}
.pd-rail-toggle:hover {
  color: var(--primary, #16a34a);
  background: color-mix(in srgb, var(--primary, #16a34a) 8%, #fff);
  border-radius: var(--radius-sm);
}
.pd-rail-toggle-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.pd-rail-head h2 {
  margin: 0;
  font-size: var(--text-lg);
  color: var(--slate-800);
}
.pd-rail-head p {
  margin: 2px 0 var(--space-3);
  font-size: var(--text-sm);
}
.pd-rail-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0 0 var(--space-3);
}
.pd-rail-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border: 1px solid var(--slate-300);
  background: #fff;
  color: var(--slate-600);
  border-radius: 999px;
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  font-family: inherit;
}
.pd-rail-status-badge .pd-rail-status-count {
  font-weight: 600;
  opacity: 0.75;
}
.pd-rail-status-badge:hover {
  border-color: var(--slate-400);
  color: var(--slate-900);
}
.pd-rail-status-badge.is-active {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.pd-rail-status-badge.is-active .pd-rail-status-count {
  opacity: 0.95;
}
.pd-rail-status-badge.tone-active.is-active { background: var(--success); border-color: var(--success); }
.pd-rail-status-badge.tone-planned.is-active { background: var(--primary); border-color: var(--primary); }
.pd-rail-status-badge.tone-on_hold.is-active { background: var(--warning); border-color: var(--warning); }
.pd-rail-status-badge.tone-completed.is-active { background: var(--primary-darker); border-color: var(--primary-darker); }
.pd-rail-status-badge.tone-cancelled.is-active { background: var(--danger); border-color: var(--danger); }
.pd-rail-status-badge.tone-all.is-active { background: var(--slate-700); border-color: var(--slate-700); }
.pd-rail-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--pd-border, #e4ddf7);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  background: var(--slate-50);
}
.pd-rail-meta {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--slate-500);
}
.pd-rail-list {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.pd-rail-empty { padding: var(--space-3); margin: 0; }
.pd-rail-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: var(--space-3) var(--space-3);
  cursor: pointer;
  border-left: 3px solid var(--slate-300);
  font: inherit;
  color: inherit;
}
/* Strip + soft background match project status (as on project summary) */
.pd-rail-item.status-planned {
  border-left-color: var(--primary, #16a34a);
  background: color-mix(in srgb, var(--primary, #16a34a) 12%, #fff);
}
.pd-rail-item.status-active {
  border-left-color: var(--success);
  background: var(--slate-50);
}
.pd-rail-item.status-hold {
  border-left-color: var(--warning);
  background: var(--warning-soft);
}
.pd-rail-item.status-completed {
  border-left-color: var(--primary);
  background: var(--slate-50);
}
.pd-rail-item.status-cancelled {
  border-left-color: var(--danger);
  background: var(--slate-100);
}
.pd-rail-item strong {
  font-size: var(--text-md);
  color: var(--slate-800);
}
.pd-rail-item span {
  font-size: var(--text-xs);
  color: var(--slate-500);
}
.pd-rail-item:hover {
  filter: brightness(0.98);
}
.pd-rail-item.is-active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
}
.pd-rail-item.is-active.status-planned {
  border-left-color: var(--primary, #15803d);
  background: color-mix(in srgb, var(--primary, #16a34a) 22%, #fff);
}
.pd-rail-item.is-active.status-active {
  border-left-color: var(--success);
  background: var(--success-soft);
}
.pd-rail-item.is-active.status-hold {
  border-left-color: var(--warning);
  background: var(--warning-muted);
}
.pd-rail-item.is-active.status-completed {
  border-left-color: var(--primary);
  background: var(--accent-soft);
}
.pd-rail-item.is-active.status-cancelled {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}
.pd-rail-item.is-active strong { color: var(--primary); }
.pd-rail-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--pd-border, #e4ddf7);
  font-size: var(--text-sm);
  color: var(--slate-500);
}
.pd-main { min-width: 0; }
@media (max-width: 960px) {
  .pd-shell { grid-template-columns: 1fr; }
  .pd-rail {
    position: static;
    max-height: none;
  }
}

/* Project Details — compact, no borders/dividers */
.pd-shell {
  gap: var(--space-3) !important;
  grid-template-columns: 240px minmax(0, 1fr) !important;
}
.pd-shell.pd-shell--rail-collapsed {
  grid-template-columns: 44px minmax(0, 1fr) !important;
}
.pd-rail,
.pd-rail-head,
.pd-rail-pager,
.pd-main,
.pd-page > *,
.pd-header,
.pd-info-row,
.pd-info-card,
.pd-actions,
.pd-sections,
.pd-panel,
.pd-card,
.pd-kpi,
.pd-table-wrap,
.pd-inline-form,
.pd-filter-bar,
.pd-report-card,
.pd-chip {
  border: none !important;
  border-bottom: none !important;
  border-right: none !important;
  border-left: none !important;
  border-top: none !important;
  box-shadow: none !important;
}
.pd-rail {
  border-radius: var(--radius-sm) !important;
  background: color-mix(in srgb, var(--primary) 4%, var(--surface, #fff)) !important;
}
.pd-rail-item {
  border-left: none !important;
  padding: var(--space-2) var(--space-2) !important;
  border-radius: var(--radius-sm) !important;
}
.pd-rail-item strong { font-size: var(--text-sm) !important; }
.pd-rail-item span { font-size: var(--text-xs) !important; }
.pd-rail-head { padding: var(--space-3) !important; }
.pd-rail-head h2 { font-size: var(--text-base) !important; }
.pd-rail-search { padding: var(--space-2) var(--space-3) !important; font-size: var(--text-xs) !important; }

.pd-page { gap: var(--space-2) !important; }
.pd-header {
  padding: var(--space-2) var(--space-3) !important;
  border-radius: var(--radius-sm) !important;
  gap: var(--space-3) !important;
}
.pd-logo {
  width: 32px !important;
  height: 32px !important;
  border-radius: var(--radius-sm) !important;
  font-size: var(--text-sm) !important;
}
.pd-title { font-size: var(--text-xl) !important; gap: var(--space-2) !important; }
.pd-sub { font-size: var(--text-xs) !important; }
.pd-status-pill { font-size: var(--text-xs) !important; padding: var(--space-1) var(--space-2) !important; }
.pd-progress-ring {
  width: 42px !important;
  height: 42px !important;
}
.pd-progress-ring > span {
  width: 32px !important;
  height: 32px !important;
  font-size: 10px !important;
}
.pd-progress-ring small { font-size: 7px !important; }

.pd-info-row {
  gap: var(--space-2) !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}
.pd-info-card {
  padding: var(--space-2) var(--space-2) !important;
  border-radius: var(--radius-sm) !important;
  gap: var(--space-2) !important;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface, #fff)) !important;
}
.pd-info-ico {
  width: 14px !important;
  height: 14px !important;
  margin-top: 1px !important;
}
.pd-info-label { font-size: var(--text-xs) !important; }
.pd-info-value { font-size: var(--text-sm) !important; }

.pd-actions {
  gap: var(--space-2) !important;
  padding: var(--space-2) var(--space-2) !important;
  border-radius: var(--radius-sm) !important;
}
.pd-action {
  min-width: 44px !important;
  gap: var(--space-1) !important;
  font-size: var(--text-xs) !important;
}
.pd-action-ico {
  width: 30px !important;
  height: 30px !important;
  border: none !important;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface, #fff)) !important;
}
.pd-action-ico svg {
  width: 14px !important;
  height: 14px !important;
}
.pd-actions-hint { font-size: var(--text-xs) !important; }

.pd-sections {
  padding: 2px !important;
  gap: 2px !important;
  border-radius: var(--radius-sm) !important;
  background: color-mix(in srgb, var(--primary) 4%, var(--surface, #fff)) !important;
}
.pd-section-tab {
  padding: var(--space-1) var(--space-2) !important;
  font-size: var(--text-xs) !important;
  gap: var(--space-1) !important;
  border-radius: var(--radius-sm) !important;
}
.pd-section-tab svg { width: 12px !important; height: 12px !important; }

.pd-panel {
  padding: var(--space-2) var(--space-3) !important;
  border-radius: var(--radius-sm) !important;
}
.pd-panel-head { margin-bottom: var(--space-2) !important; }
.pd-panel-head h2 { font-size: var(--text-base) !important; }

.pd-kpi-row {
  gap: var(--space-2) !important;
  margin-bottom: var(--space-2) !important;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)) !important;
}
.pd-kpi {
  padding: var(--space-2) var(--space-2) !important;
  border-radius: var(--radius-sm) !important;
}
.pd-kpi strong { font-size: var(--text-lg) !important; }
.pd-kpi span { font-size: var(--text-xs) !important; }

.pd-card {
  padding: var(--space-2) !important;
  border-radius: var(--radius-sm) !important;
  background: color-mix(in srgb, var(--primary) 4%, var(--surface, #fff)) !important;
}
.pd-card h3 { font-size: var(--text-sm) !important; margin-bottom: var(--space-2) !important; }
.pd-overview-grid { gap: var(--space-2) !important; }
.pd-report-grid { gap: var(--space-2) !important; }
.pd-report-card {
  padding: var(--space-2) !important;
  border-radius: var(--radius-sm) !important;
  background: color-mix(in srgb, var(--primary) 4%, var(--surface, #fff)) !important;
}
.pd-report-ico { width: 16px !important; height: 16px !important; }
.pd-inline-form {
  padding: var(--space-2) !important;
  border-radius: var(--radius-sm) !important;
  margin-bottom: var(--space-2) !important;
}
.pd-filter-bar {
  padding: var(--space-2) var(--space-2) !important;
  gap: var(--space-2) !important;
  border-radius: var(--radius-sm) !important;
  margin-bottom: var(--space-2) !important;
}
.pd-table-wrap { border-radius: var(--radius-sm) !important; }
.pd-table th,
.pd-table td { padding: var(--space-2) var(--space-2) !important; font-size: var(--text-sm) !important; }
.pd-badge { font-size: var(--text-xs) !important; padding: 1px var(--space-2) !important; }

.pd-repo-workspace {
  margin-top: var(--space-1);
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}
.pd-repo-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.pd-repo-workspace-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ===== Project Details: match mockup card + icon design ===== */
.pd-shell { gap: var(--space-4) !important; grid-template-columns: 260px minmax(0, 1fr) !important; }
.pd-page { gap: var(--space-3) !important; }
.pd-page > * { border: none !important; border-bottom: none !important; box-shadow: none !important; }

.pd-rail {
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--slate-200)) !important;
  border-radius: var(--radius-sm) !important;
  background: #fff !important;
}
.pd-rail-item.is-active {
  background: var(--primary-soft) !important;
  border-left: 3px solid var(--primary) !important;
}
.pd-rail-item.is-active strong { color: var(--primary) !important; }

.pd-header {
  background: transparent !important;
  border: none !important;
  padding: var(--space-2) 2px !important;
  border-radius: 0 !important;
}
.pd-logo {
  width: 40px !important; height: 40px !important; border-radius: var(--radius-sm) !important;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark, var(--primary))) !important;
}
.pd-title { font-size: var(--text-xl) !important; color: var(--slate-800) !important; font-weight: 600 !important; }
.pd-code {
  display: inline-flex !important; background: var(--primary-soft) !important; color: var(--primary) !important;
  border-radius: var(--radius-sm) !important; padding: var(--space-1) var(--space-3) !important; font-size: var(--text-sm) !important; font-weight: 500 !important;
}
.pd-chip { border: none !important; background: transparent !important; color: var(--danger-strong) !important; padding: 0 !important; font-weight: 500 !important; }
.pd-sub { display: none !important; }
.pd-status-pill {
  background: var(--primary) !important; color: #fff !important; border-radius: var(--radius-sm) !important;
  padding: var(--space-1) var(--space-3) !important; font-size: var(--text-xs) !important; font-weight: 600 !important;
}
.pd-header-mini {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.03em; color: var(--slate-500); text-align: right;
}
.pd-header-mini strong { color: var(--primary); font-size: var(--text-base); }
.pd-progress-ring { width: 54px !important; height: 54px !important; }
.pd-progress-ring > span { width: 42px !important; height: 42px !important; font-size: var(--text-xs) !important; color: var(--primary) !important; }

.pd-info-row {
  display: grid !important; grid-template-columns: repeat(5, minmax(0,1fr)) !important;
  gap: var(--space-3) !important; background: transparent !important; border: none !important; padding: 0 !important;
}
.pd-info-card {
  display: flex !important; align-items: flex-start !important; gap: var(--space-3) !important;
  background: #fff !important; border: 1px solid var(--slate-150) !important; border-radius: var(--radius-sm) !important;
  padding: var(--space-3) var(--space-4) !important; box-shadow: 0 1px 2px rgba(15,23,42,.04) !important;
  min-height: 64px !important; text-align: left !important;
}
.pd-info-card--alert { background: var(--slate-50) !important; border-color: var(--danger-muted) !important; }
.pd-info-card--alert .pd-info-ico,
.pd-info-card--alert .pd-info-value { color: var(--danger-strong) !important; }
.pd-info-ico { width: 18px !important; height: 18px !important; color: var(--primary) !important; margin-top: 2px !important; }
.pd-info-label {
  font-size: var(--text-xs) !important; font-weight: 500 !important; letter-spacing: 0.03em !important;
  text-transform: uppercase !important; color: var(--slate-500) !important; margin-bottom: var(--space-1) !important;
}
.pd-info-value { font-size: var(--text-md) !important; font-weight: 500 !important; color: var(--slate-800) !important; }
.pd-avatars .pd-avatar { width: 22px !important; height: 22px !important; font-size: 9px !important; }

.pd-actions {
  display: flex !important; flex-wrap: wrap !important; align-items: center !important;
  gap: var(--space-4) !important; padding: var(--space-1) 2px !important; background: transparent !important; border: none !important;
}
.pd-action {
  display: inline-flex !important; flex-direction: column !important; align-items: center !important;
  gap: var(--space-2) !important; min-width: 52px !important; border: none !important; background: transparent !important;
  color: var(--slate-500) !important; font-size: var(--text-xs) !important; font-weight: 500 !important;
}
.pd-action-ico {
  width: 36px !important; height: 36px !important; border-radius: 50% !important;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--slate-200)) !important;
  background: color-mix(in srgb, var(--primary) 7%, #fff) !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
}
.pd-action-ico svg { width: 16px !important; height: 16px !important; color: var(--primary) !important; }
.pd-action.is-active .pd-action-ico,
.pd-action:hover .pd-action-ico { background: var(--primary) !important; border-color: var(--primary) !important; }
.pd-action.is-active .pd-action-ico svg,
.pd-action:hover .pd-action-ico svg { color: #fff !important; }
.pd-action.is-active, .pd-action:hover { color: var(--primary) !important; }
.pd-actions-hint { margin-left: auto !important; color: var(--slate-500) !important; font-size: var(--text-sm) !important; }

.pd-sections { background: transparent !important; border: none !important; padding: 0 !important; }
.pd-section-tab { border-radius: var(--radius-sm) !important; padding: var(--space-2) var(--space-3) !important; font-size: var(--text-sm) !important; }
.pd-section-tab.is-active { background: var(--primary) !important; color: #fff !important; }

.pd-kpi-row {
  display: flex !important; flex-wrap: wrap !important; gap: 0 !important; margin-bottom: var(--space-3) !important;
  background: color-mix(in srgb, var(--primary) 5%, #fff) !important; border-radius: var(--radius-sm) !important;
  overflow: hidden !important; border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--slate-150)) !important;
}
.pd-kpi {
  flex: 1 1 110px !important; border: none !important;
  border-right: 1px solid color-mix(in srgb, var(--primary) 12%, var(--slate-150)) !important;
  border-radius: 0 !important; background: transparent !important; padding: var(--space-3) var(--space-4) !important; text-align: center !important;
}
.pd-kpi:last-child { border-right: none !important; }
.pd-kpi strong { font-size: var(--text-xl) !important; color: var(--primary) !important; }
.pd-kpi span { font-size: var(--text-xs) !important; color: var(--slate-500) !important; }
.pd-kpi.is-active { background: var(--primary) !important; }
.pd-kpi.is-active strong, .pd-kpi.is-active span { color: #fff !important; }

.pd-panel {
  background: var(--surface, #fff) !important; border: 1px solid var(--border, #e8eaf0) !important; border-radius: var(--radius-sm) !important;
  padding: var(--space-4) var(--space-4) !important; box-shadow: 0 1px 2px rgba(15,23,42,.03) !important;
  color: var(--text, #201f1e);
}
.pd-card, .pd-inline-form, .pd-filter-bar, .pd-report-card {
  border: 1px solid var(--border, #e8eaf0) !important; border-radius: var(--radius-sm) !important; background: var(--surface, #fff) !important;
  color: var(--text, #201f1e);
}
.pd-filter-bar { background: color-mix(in srgb, var(--primary) 5%, var(--surface, #fff)) !important; }
.pd-table th { background: color-mix(in srgb, var(--primary) 6%, var(--surface, #fff)) !important; color: var(--heading, inherit); }

html[data-theme="dark"] .pd-panel,
html[data-theme="dark"] .pd-card,
html[data-theme="dark"] .pd-inline-form,
html[data-theme="dark"] .pd-filter-bar,
html[data-theme="dark"] .pd-report-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
html[data-theme="dark"] .pd-filter-bar {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface)) !important;
}
html[data-theme="dark"] .pd-table th {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-raised)) !important;
  color: var(--heading) !important;
}
html[data-theme="dark"] .pd-table tbody tr:hover td {
  background: var(--surface-hover) !important;
}
html[data-theme="dark"] .pd-kpi-row {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface)) !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] .pd-kpi {
  border-color: var(--border) !important;
}
html[data-theme="dark"] .pd-kpi span {
  color: var(--muted) !important;
}
html[data-theme="dark"] .pd-action {
  color: var(--muted) !important;
}
html[data-theme="dark"] .pd-action-ico {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface)) !important;
  border-color: var(--border) !important;
}

@media (max-width: 1100px) {
  .pd-info-row { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .pd-shell { grid-template-columns: 1fr !important; }
}
@media (max-width: 720px) { .pd-info-row { grid-template-columns: 1fr !important; } }

.pd-color-orb {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: var(--space-1) !important;
  min-width: 68px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  position: relative !important;
  font-family: inherit !important;
}
.pd-color-orb-face {
  box-sizing: border-box !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  display: grid !important;
  place-items: center !important;
  flex-shrink: 0 !important;
  border: 0 !important;
  background: var(--slate-100) !important;
  color: var(--slate-500) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  clip-path: none !important;
  box-shadow: none !important;
}
.pd-color-orb.is-on .pd-color-orb-face {
  background: var(--primary, #0d9488) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
.pd-color-orb-face svg {
  width: 16px !important;
  height: 16px !important;
  color: inherit !important;
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  clip-path: none !important;
}
.pd-color-orb-lbl {
  font-size: var(--text-sm) !important;
  font-weight: 500 !important;
  color: var(--slate-500) !important;
  text-align: center !important;
  max-width: 104px !important;
}
.pd-color-orb.is-on .pd-color-orb-lbl {
  color: var(--primary, #0d9488) !important;
  font-weight: 600 !important;
}

.pd-premium .action-orbs .hm-orb-ring,
.pd-premium .action-orbs .orb-ring,
.pd-premium .action-orbs .pd-color-orb-face {
  width: 36px !important;
  height: 36px !important;
  border-radius: var(--radius-md) !important;
  clip-path: none !important;
  background: var(--slate-100) !important;
  color: var(--slate-500) !important;
  border: 0 !important;
  box-shadow: none !important;
}
.pd-premium .action-orbs .hm-orb.is-active .hm-orb-ring,
.pd-premium .action-orbs .orb-btn.active .orb-ring,
.pd-premium .action-orbs .pd-color-orb.is-on .pd-color-orb-face {
  background: var(--primary, #0d9488) !important;
  color: #fff !important;
}

.pd-premium .pd-workspace:has(.pd-git-sheet) {
  background: var(--slate-100) !important;
  padding: var(--space-4) !important;
}
.pd-premium .pd-git-sheet {
  background: #fff !important;
  border: 1px solid var(--slate-150) !important;
  border-radius: var(--radius-lg) !important;
  padding: var(--space-5) var(--space-5) var(--space-2) !important;
  box-shadow: none !important;
}
.pd-premium .pd-git-sheet.is-workspace {
  padding: 0 !important;
}
.pd-premium .pd-git-sheet-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: var(--space-4) !important;
  padding: 0 var(--space-1) var(--space-4) !important;
  margin: 0 !important;
  border: 0 !important;
}
.pd-premium .pd-git-sheet-head h2 {
  margin: 0 !important;
  font-size: var(--text-lg) !important;
  font-weight: 600 !important;
  color: var(--slate-800) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.pd-premium .pd-git-sheet-head p {
  margin: var(--space-2) 0 0 !important;
  font-size: var(--text-md) !important;
  color: var(--slate-500) !important;
  font-weight: 400 !important;
}
.pd-premium .pd-git-sheet-aside {
  font-size: var(--text-md) !important;
  color: var(--slate-500) !important;
}
.pd-premium .pd-git-new {
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
  color: var(--slate-500) !important;
  font-size: var(--text-md) !important;
  box-shadow: none !important;
}
.pd-premium .pd-git-row {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) 84px 128px 104px !important;
  align-items: center !important;
  gap: var(--space-3) var(--space-3) !important;
  padding: var(--space-4) var(--space-1) !important;
  border-top: 1px solid var(--slate-100) !important;
  background: transparent !important;
}
.pd-premium .pd-git-row-ico {
  width: 36px !important;
  height: 36px !important;
  border-radius: var(--radius-md) !important;
  background: var(--slate-100) !important;
  color: var(--slate-500) !important;
  border: 0 !important;
}
.pd-premium .pd-git-row-name {
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
  font-size: var(--text-base) !important;
  font-weight: 500 !important;
  color: var(--slate-900) !important;
  box-shadow: none !important;
}
.pd-premium .pd-git-row-meta {
  margin-top: var(--space-1) !important;
  font-size: var(--text-sm) !important;
  color: var(--slate-500) !important;
}
.pd-premium .pd-git-ready {
  display: inline-flex !important;
  padding: var(--space-1) var(--space-3) !important;
  border-radius: 999px !important;
  font-size: var(--text-xs) !important;
  font-weight: 500 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  background: var(--success-soft) !important;
  color: var(--success-strong) !important;
  border: 0 !important;
}
.pd-premium .pd-git-row-link {
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  font-size: var(--text-md) !important;
  font-weight: 500 !important;
  color: var(--slate-500) !important;
}
.pd-premium .pd-git-row-link--clone {
  color: var(--slate-500) !important;
}
.pd-premium .pd-git-empty {
  border: 0 !important;
  border-top: 1px solid var(--slate-100) !important;
  background: transparent !important;
  border-radius: 0 !important;
}

.pd-premium .pd-workspace:has(.pd-wi-panel) {
  background: var(--slate-100) !important;
  padding: var(--space-4) !important;
}
.pd-premium .hm-table-wrap {
  height: auto !important;
  max-height: min(70vh, 640px) !important;
  border: 1px solid var(--slate-150) !important;
  border-radius: var(--radius-lg) !important;
  background: #fff !important;
  overflow: auto !important;
}
.pd-premium .hm-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: var(--text-base) !important;
}
.pd-premium .hm-table th {
  background: var(--slate-50) !important;
  color: var(--slate-500) !important;
  font-size: var(--text-xs) !important;
  font-weight: 500 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  padding: var(--space-3) var(--space-5) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--slate-150) !important;
}
.pd-premium .hm-table td {
  padding: var(--space-4) var(--space-5) !important;
  font-size: var(--text-base) !important;
  font-weight: 400 !important;
  color: var(--slate-900) !important;
  background: #fff !important;
  border: 0 !important;
  border-bottom: 1px solid var(--slate-100) !important;
}
.pd-premium .hm-table .hm-title-cell,
.pd-premium .hm-table td:first-child {
  font-weight: 400 !important;
}
.pd-premium .hm-table tbody tr:hover td,
.pd-premium .hm-table .pd-row-clickable:hover td {
  background: var(--slate-50) !important;
}

/* ===== Scrollbars — thin, sleek, transparent track (app-wide) ===== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.32) transparent;
}

*:hover {
  scrollbar-color: rgba(100, 116, 139, 0.5) transparent;
}

/* Safari / older Chromium */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.32);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.55);
}

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

html[data-theme="dark"] * {
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
}

/* Column picker trigger — compact ⋮ icon button */
.col-picker-dots {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--slate-500);
  cursor: pointer;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}
.col-picker-dots:hover,
.col-picker-dots.active {
  background: var(--slate-100);
  color: var(--heading);
}
.col-picker-dots:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.col-picker {
  margin-left: auto;
}

/* One white container holding all KPI card rows */
.pm-kpi-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: #ffffff;
  border: 1px solid var(--slate-150, #e2e8f0);
  border-radius: var(--radius-lg);
}
.pm-kpi-panel > .cards {
  margin: 0 !important;
}
html[data-theme="dark"] .pm-kpi-panel {
  background: var(--surface);
  border-color: var(--border);
}
/* KPI cards in the white container — pure white text */
.pm-kpi-panel .card.pm-stat .value,
.pm-kpi-panel .card.pm-stat .label,
.pm-kpi-panel .card.pm-stat .muted,
.pm-kpi-panel .card.pm-stat .pm-stat-body * {
  color: #ffffff !important;
  opacity: 1 !important;
}
/* ===== Premium shimmer loaders ===== */

@keyframes vx-shimmer {
  0% {
    background-position: 220% 0;
  }
  100% {
    background-position: -220% 0;
  }
}

.vx-shimmer {
  display: inline-block;
  max-width: 100%;
  background: linear-gradient(
    100deg,
    var(--slate-150) 0%,
    var(--slate-100) 42%,
    var(--slate-150) 84%
  );
  background-size: 220% 100%;
  animation: vx-shimmer 1.85s ease-in-out infinite;
}

.vx-shimmer--circle {
  flex-shrink: 0;
}

/* ---- Buttons ---- */
.vx-btn-loader {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.vx-btn-loader--inline {
  display: inline-flex;
}

.vx-btn-shimmer {
  display: inline-block;
  border-radius: var(--radius-xs);
}

.vx-btn-shimmer--sm {
  width: 72px;
  height: 32px;
}

.vx-btn-shimmer--md {
  width: 96px;
  height: var(--control-height);
}

.vx-btn-shimmer--lg {
  width: 120px;
  height: var(--control-height);
}

/* ---- Cards (plain surface — no colored KPI tiles) ---- */
.vx-card-loader {
  --vx-card-cols: 4;
  grid-template-columns: repeat(var(--vx-card-cols), minmax(0, 1fr));
  pointer-events: none;
}

.vx-card-loader--hrms {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.vx-card-shimmer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 84px;
  padding: var(--space-4) var(--space-5);
  overflow: hidden;
  pointer-events: none;
  background: #ffffff;
  border: 1px solid var(--slate-150);
  border-radius: var(--radius-sm);
  box-shadow: none;
  transform: none;
  filter: none;
}

.vx-card-shimmer-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.vx-card-shimmer-label,
.vx-card-shimmer-value {
  display: block;
}

.vx-card-shimmer-icon {
  flex-shrink: 0;
  background: var(--slate-100);
}

/* ---- Table ---- */
.vx-table-loader {
  padding: 0;
  overflow: auto;
  pointer-events: none;
}

.vx-table-loader.hm-table-wrap {
  height: auto;
  max-height: 420px;
}

.vx-table-loader-table {
  margin: 0;
}

.vx-table-loader-table tbody tr:hover td {
  background: #ffffff;
}

.vx-table-shimmer-head,
.vx-table-shimmer-cell {
  display: block;
}

.vx-table-shimmer-actions {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
}

.vx-table-loader--compact .vx-table-loader-table th,
.vx-table-loader--compact .vx-table-loader-table td {
  padding: var(--space-3) var(--space-3);
}

.vx-table-inline-loader-row td {
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
}

.vx-table-inline-loader-row .vx-table-shimmer-cell {
  display: block;
}

/* ---- Form ---- */
.vx-form-loader {
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.vx-form-loader-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.vx-form-loader-grid {
  --vx-form-cols: 2;
  grid-template-columns: repeat(var(--vx-form-cols), minmax(0, 1fr));
}

.vx-form-loader-field {
  gap: var(--space-2);
}

.vx-form-loader-input {
  display: block;
  width: 100%;
}

.vx-form-loader-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* ---- List ---- */
.vx-list-loader {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-1) 0;
}

.vx-list-loader-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm);
}

.vx-list-loader-lines {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.vx-list-loader-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* ---- Chart ---- */
.vx-chart-loader {
  overflow: hidden;
  padding: var(--space-4) var(--space-5) var(--space-4);
  border: 1px solid var(--slate-150);
  border-radius: var(--radius-lg);
  background: #ffffff;
  pointer-events: none;
}

.vx-chart-loader-plot {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  min-height: 160px;
}

.vx-chart-bar-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.vx-chart-bar {
  display: block;
  width: 100%;
}

.vx-chart-loader-axis {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--slate-100);
}

/* ---- Page presets (body only — never a page header) ---- */
.vx-page-loader {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 0;
}

.vx-page-loader--dashboard .pm-chart-grid,
.vx-page-loader-charts {
  margin-bottom: 0;
}

.vx-page-loader--chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);
}

.vx-page-loader-auth {
  min-height: 240px;
}

/* ---- Premium spinner (inline / auth) ---- */
.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-9) var(--space-6);
  min-height: 120px;
  color: var(--muted);
}

.spinner-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--primary) 16%, transparent);
  border-top-color: var(--primary);
  animation: vx-spin 0.75s linear infinite;
}

.spinner-ring--sm {
  width: 22px;
  height: 22px;
  border-width: 2px;
}

.spinner-label {
  font-size: var(--text-md);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

@keyframes vx-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Legacy alias — keep rm-skeleton working via table loader */
.rm-skeleton {
  display: none;
}

@media (max-width: 1100px) {
  .vx-card-loader {
    --vx-card-cols: 2;
  }

  .vx-card-loader--hrms:not(.hm-stat-row--5) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .vx-card-loader {
    --vx-card-cols: 1;
  }

  .vx-card-loader--hrms {
    grid-template-columns: minmax(0, 1fr);
  }

  .vx-form-loader-grid {
    --vx-form-cols: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vx-shimmer {
    animation: none;
    background: var(--slate-150);
  }
}

html[data-theme="dark"] .vx-shimmer {
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--surface-hover) 90%, #000) 0%,
    color-mix(in srgb, var(--surface-raised) 80%, #334155) 45%,
    color-mix(in srgb, var(--surface-hover) 90%, #000) 90%
  );
  background-size: 220% 100%;
}

html[data-theme="dark"] .vx-card-shimmer {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .vx-card-shimmer-icon {
  background: var(--surface-hover, #1e293b);
}

html[data-theme="dark"] .vx-chart-loader {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .vx-chart-loader-axis {
  border-top-color: var(--border);
}

html[data-theme="dark"] .spinner-ring {
  border-color: color-mix(in srgb, var(--primary) 22%, transparent);
  border-top-color: var(--primary);
}
/* ============================================================================
   ERP typography layer
   ----------------------------------------------------------------------------
   Every size comes from the scale in styles.css :root (--text-xs … --text-4xl).
   Element defaults use :where() (zero specificity) so any component rule wins;
   the component rules below only pin the shared primitives to the scale.

   Weights: 400 normal · 500 labels/nav · 600 headings/buttons/values ·
            700 key metrics only.
   ========================================================================== */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-body);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* --- Headings -------------------------------------------------------------- */
:where(h1, h2, h3, h4, h5, h6) {
  font-weight: 600;
  line-height: var(--leading-heading);
}

:where(h1) {
  font-size: var(--text-page-title);
  line-height: var(--leading-title);
  letter-spacing: var(--tracking-title);
}

:where(h2) {
  font-size: var(--text-xl);
}

:where(h3) {
  font-size: var(--text-lg);
}

:where(h4) {
  font-size: var(--text-base);
}

:where(h5, h6) {
  font-size: var(--text-md);
}

:where(strong, b) {
  font-weight: 600;
}

:where(small) {
  font-size: var(--text-sm);
  line-height: 1.4;
}

.page-title {
  font-size: var(--text-page-title);
  font-weight: 600;
  line-height: var(--leading-title);
  letter-spacing: var(--tracking-title);
}

.section-title {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--leading-heading);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: var(--leading-heading);
}

.helper-text,
.field-hint,
.sprint-field-hint {
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.4;
}

.meta-text {
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.4;
}

/* --- Tables & numbers ------------------------------------------------------ */
table {
  line-height: var(--leading-table);
  font-variant-numeric: tabular-nums;
}

th {
  line-height: var(--leading-table);
}

/* Numeric columns: right-aligned, tabular figures (ResourcePage adds .num). */
table th.num,
table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table th.num .sortable-th-label {
  display: inline-block;
}

.num,
.value,
[class*="-value"],
[class*="-num"],
[class*="kpi"] strong,
.report-total-row td {
  font-variant-numeric: tabular-nums;
}

.report-total-row td {
  font-weight: 600;
}

/* --- Forms ----------------------------------------------------------------- */
/* Labels sit one step below the value they describe. */
.field label {
  font-weight: 500;
  line-height: 1.4;
}

/* --- Tabs ------------------------------------------------------------------ */
/* Inactive tabs are 500; only the selected tab carries 600. */
.ado-pr-tab.active,
.eh-tab.active,
.hrms-logs-tab.active,
.mt-section-tab.active,
.pd-section-tab.is-active,
.hm-emp-section-tab.is-active,
.hm-ov-tab.is-active,
.pd-ov-sprint-tab.is-active,
.pd-premium .pd-tp-tab.active,
.pd-rail-nav-item.is-active,
.pd-rail--card .pd-rail-nav-item.is-active {
  font-weight: 600;
}

/* --- Buttons --------------------------------------------------------------- */
.btn.secondary {
  font-weight: 500;
}

/* --- Badges ---------------------------------------------------------------- */
.badge,
.status-pill {
  line-height: 1.4;
}

/* --- Modals ---------------------------------------------------------------- */
.modal {
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

.modal > h2,
.modal > h3,
.modal .modal-title {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--leading-heading);
  letter-spacing: 0;
}

/* --- Navigation ------------------------------------------------------------ */
.nav-link {
  line-height: 1.4;
}
/* ============================================================================
   UI system layer — interaction states shared by every module
   ----------------------------------------------------------------------------
   Tokens live in styles.css :root (spacing, radius, heights, elevation, motion).
   This file only defines cross-cutting behaviour: focus, motion preferences,
   table rhythm and disabled states.
   ========================================================================== */

/* --- Focus ------------------------------------------------------------------
   Keyboard users always get a visible ring. Mouse clicks don't (focus-visible).
   !important because many legacy rules strip outlines on :focus. Text fields
   keep their own box-shadow ring from styles.css. */
:is(a, button, summary, [role="button"], [role="tab"], [role="menuitem"], [tabindex]:not([tabindex="-1"])):focus-visible,
input:is([type="checkbox"], [type="radio"]):focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px !important;
}

/* --- Tables ---------------------------------------------------------------- */
/* Data tables: rows are never shorter than --row-height. Dense grids
   (calendars, capacity/availability grids, code diffs) keep their own rhythm. */
table:not(.team-cal-table, .cp-grid, .att-reg, .ra-avail-table, .code-table, .compact, .vx-table-loader-table, .hm-att-table, .pm-hours-table) tbody td {
  height: var(--row-height);
}

tbody tr {
  transition: background-color var(--duration-fast) var(--ease-standard);
}

/* --- Disabled -------------------------------------------------------------- */
:is(button, .btn, .ui-btn, input, select, textarea):disabled {
  cursor: not-allowed;
}

/* --- Overlays -------------------------------------------------------------- */
/* Only floating layers are elevated; cards stay flat. */
.modal {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}

/* --- Pagination ------------------------------------------------------------ */
.erp-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-1) 0;
  font-size: var(--text-md);
  color: var(--muted);
}

.erp-pagination-summary {
  font-variant-numeric: tabular-nums;
}

.erp-pagination-pages {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.erp-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-width: var(--control-height-sm);
  height: var(--control-height-sm);
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.erp-pagination-btn:hover:not(:disabled) {
  background: var(--surface-hover);
}

.erp-pagination-btn:disabled {
  color: var(--slate-400);
}

.erp-pagination-num.is-current {
  border-color: var(--primary);
  background: var(--accent-soft);
  color: var(--primary-darker);
  font-weight: 600;
}

html[data-theme="dark"] .erp-pagination-num.is-current {
  background: var(--primary-soft);
  color: var(--primary);
}

.erp-pagination-gap {
  padding: 0 var(--space-1);
  color: var(--slate-400);
}

.erp-pagination-size {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.erp-pagination-size select {
  min-height: var(--control-height-sm);
  height: var(--control-height-sm);
  padding: 0 var(--space-7) 0 var(--space-3);
  font-size: var(--text-md);
}

@media (max-width: 640px) {
  .erp-pagination {
    justify-content: center;
  }
  .erp-pagination-num:not(.is-current) {
    display: none; /* Previous · current · Next is enough on phones */
  }
}

/* --- Menus (row "More" actions) -------------------------------------------- */
.erp-menu {
  position: fixed;
  z-index: 1000;
  min-width: 168px;
  padding: var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}

.erp-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  min-height: var(--control-height-sm);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.erp-menu-item:hover,
.erp-menu-item:focus-visible {
  background: var(--surface-hover);
}

.erp-menu-item.is-danger {
  color: var(--danger-strong);
}

.erp-menu-item.is-danger:hover,
.erp-menu-item.is-danger:focus-visible {
  background: var(--danger-soft);
}

/* --- Inline error with retry ----------------------------------------------- */
.erp-inline-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* --- Motion preferences ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Empty table cell placeholder (components/EmptyCell.jsx) */
.empty-cell {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 18px;
  border-radius: 999px;
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-400, #94a3b8);
  vertical-align: middle;
  cursor: default;
}
.empty-cell svg {
  display: block;
}
html[data-theme="dark"] .empty-cell {
  background: var(--surface-hover);
  color: var(--muted);
}
/* =====================================================================
   Form kit (.al-*) — compact themed form used by Apply Leave, Date
   Regularization, etc. Labels are uppercase micro text; fields 40px.
   ===================================================================== */
.al-form,
.hm-apply-leave {
  --al-accent: var(--primary, #0078d4);
  --al-label: var(--heading, var(--slate-900));
  --al-text: var(--heading, var(--slate-900));
  --al-muted: var(--slate-400, #94a3b8);
  --al-border: var(--slate-200, #e2e8f0);
  --al-field-bg: var(--surface, #fff);
}

.al-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-4);
  max-width: 560px;
}

.al-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.al-field--full,
.al-msg,
.al-actions {
  grid-column: 1 / -1;
}

.al-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  margin-bottom: var(--space-2);
  padding: 0;
  color: var(--al-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

label.al-field > .al-label {
  margin-bottom: 0;
}

.al-balance,
.al-days {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--al-accent) 10%, transparent);
  color: var(--al-accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.al-balance.is-empty {
  background: color-mix(in srgb, var(--danger-strong) 10%, transparent);
  color: var(--danger-strong);
}

.al-empty {
  margin: 0;
  color: var(--al-muted);
  font-size: var(--text-sm);
}

/* Radios */
.al-radios {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  min-height: 40px;
  align-items: center;
}

.al-radio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--slate-600, #475569);
  font-size: var(--text-md);
  cursor: pointer;
  user-select: none;
}

.al-radio input {
  appearance: none;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin: 0;
  border: 1.5px solid var(--slate-400, #94a3b8);
  border-radius: 50%;
  background: var(--al-field-bg);
  cursor: pointer;
  transition: border-color var(--duration-fast) ease;
}

.al-radio input::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--al-accent);
  transform: scale(0);
  transition: transform var(--duration-fast) ease;
}

.al-radio input:checked {
  border: 2.5px solid var(--al-accent);
}

.al-radio input:checked::after {
  transform: scale(0.6);
}

.al-radio input:checked + span {
  color: var(--al-label);
  font-weight: 500;
}

.al-radio input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--al-accent) 40%, transparent);
  outline-offset: 2px;
}

.al-radio:hover input:not(:checked) {
  border-color: var(--al-accent);
}

/* Inputs */
.al-input {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--al-border);
  border-radius: 4px;
  background: var(--al-field-bg);
  color: var(--al-text);
  font: inherit;
  font-size: var(--text-md);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.al-input::placeholder {
  color: var(--al-muted);
}

.al-input:hover:not(:disabled) {
  border-color: var(--slate-300, #cbd5e1);
}

.al-input:focus {
  outline: none;
  border-color: var(--al-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--al-accent) 12%, transparent);
}

.al-input:disabled {
  background: var(--slate-50, #f8fafc);
  color: var(--slate-500, #64748b);
  cursor: not-allowed;
}

textarea.al-input {
  height: auto;
  min-height: 84px;
  padding: var(--space-2) var(--space-3);
  line-height: 1.5;
  resize: vertical;
}

/* Date input with tinted calendar button on the right */
.al-date {
  position: relative;
  display: block;
}

.al-date .al-input {
  padding-right: 44px;
}

.al-date-icon {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--al-accent) 12%, transparent);
  color: var(--al-accent);
  line-height: 0;
  transform: translateY(-50%);
  pointer-events: none;
  transition: background var(--duration-fast) ease;
}

.al-date-icon svg {
  display: block;
}

.al-date:hover .al-date-icon {
  background: color-mix(in srgb, var(--al-accent) 18%, transparent);
}

/* Native picker trigger: invisible, laid exactly over the icon so clicking it opens the calendar */
.al-form .al-date input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  opacity: 0;
  cursor: pointer;
  transform: translateY(-50%);
}

.al-date .al-input:disabled + .al-date-icon {
  opacity: 0.5;
}

/* Messages */
.al-msg {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: 4px;
  font-size: var(--text-sm);
  font-weight: 500;
}

.al-msg.is-error {
  background: color-mix(in srgb, var(--danger-strong) 8%, transparent);
  color: var(--danger-strong);
}

.al-msg.is-ok {
  background: color-mix(in srgb, var(--success-strong) 8%, transparent);
  color: var(--success-strong);
}

/* Actions — left aligned like the mockup */
.al-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.al-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 86px;
  height: 34px;
  padding: 0 var(--space-4);
  border-radius: 4px;
  font: inherit;
  font-size: var(--text-md);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease,
    filter var(--duration-fast) ease;
}

.al-btn--primary {
  border: 1px solid var(--al-accent);
  background: var(--al-accent);
  color: #fff;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--al-accent) 30%, transparent);
}

.al-btn--primary:hover:not(:disabled) {
  filter: brightness(0.92);
}

.al-btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.al-btn--ghost {
  border: 1px solid var(--al-border);
  background: var(--al-field-bg);
  color: var(--al-label);
}

.al-btn--ghost:hover {
  border-color: var(--slate-300, #cbd5e1);
  background: var(--slate-50, #f8fafc);
}

@media (max-width: 640px) {
  .hm-apply-leave {
    max-width: none;
    padding: var(--space-4);
  }

  .al-form {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .al-input {
    font-size: var(--text-lg);
  }

  .al-actions .al-btn {
    flex: 1;
  }
}

html[data-theme="dark"] .al-form,
html[data-theme="dark"] .hm-apply-leave {
  --al-border: var(--border);
  --al-field-bg: var(--surface);
}

html[data-theme="dark"] .al-input:disabled {
  background: var(--surface-hover);
}

/* Card wrapper with icon header (same look as the Apply Leave card) */
.al-card {
  --al-accent: var(--primary, #0078d4);
  max-width: 640px;
  margin-bottom: var(--space-4);
  padding: var(--space-4) var(--space-5) var(--space-5);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.al-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
}

.al-card-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--al-accent) 12%, transparent);
  color: var(--al-accent);
}

.al-card-head h2,
.al-card-head h3 {
  margin: 0;
  color: var(--heading, var(--slate-900));
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.25;
}

.al-card-head p {
  margin: 2px 0 0;
  color: var(--slate-500, #64748b);
  font-size: var(--text-sm);
}

.al-hint {
  margin: 0;
  color: var(--slate-500, #64748b);
  font-size: 11px;
}

@media (max-width: 640px) {
  .al-card {
    max-width: none;
    padding: var(--space-4);
  }
}

html[data-theme="dark"] .al-card {
  border-color: var(--border);
  background: var(--surface);
}

html[data-theme="dark"] .al-card-head {
  border-bottom-color: var(--border);
}
/* ============================================================================
   Mobile responsiveness layer
   ----------------------------------------------------------------------------
   Everything in this file is scoped to <= 768px (and <= 480px). Desktop and
   tablet layouts are deliberately untouched: no rule here applies above the
   mobile breakpoint, so the existing design at 769px and up cannot regress.

   Loaded last so it wins ties against the base stylesheets.
   ========================================================================== */

/* Mobile-only chrome. These two elements are always in the DOM, so they are
   hidden by default and only revealed inside the mobile breakpoint below.
   This is the one rule here that is not media-scoped — it targets elements
   that did not exist before, so no existing layout is affected. */
.app-mobile-menu-btn,
.app-mobile-nav-backdrop {
  display: none;
}

/* ============================================================================
   1. MOBILE — structural shell
   ========================================================================== */
@media (max-width: 768px) {
  /* --- Overflow guards ---------------------------------------------------- */
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.has-mobile-nav-open {
    overflow: hidden;
  }

  img,
  video,
  canvas {
    max-width: 100%;
  }

  /* Flex/grid children default to min-width:auto, which is what makes long
     strings and wide tables push the page sideways. */
  .app-shell,
  .main,
  .content,
  .card,
  .panel,
  .hm-card,
  .hm-shell,
  .hm-sum-card {
    min-width: 0;
  }

  /* --- App shell ---------------------------------------------------------- */
  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .main {
    width: 100%;
    min-width: 0;
    /* Clear the floating drawer trigger. */
    padding-top: 56px;
  }

  .content,
  .content.content--flush {
    padding-left: 0;
    padding-right: 0;
  }

  /* --- Drawer trigger ----------------------------------------------------- */
  .app-mobile-menu-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: var(--control-height);
    padding: 0;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-md);
    background: var(--surface, #fff);
    color: var(--text, #0f172a);
    box-shadow: var(--shadow-btn, 0 1px 3px rgba(15, 23, 42, 0.12));
    cursor: pointer;
  }

  .app-mobile-menu-btn:active {
    transform: translateY(1px);
  }

  /* While the drawer is open the trigger would sit on top of the rail logo,
     so send it to the opposite edge, over the backdrop. */
  .app-shell.has-mobile-nav .app-mobile-menu-btn {
    left: auto;
    right: 12px;
  }

  /* --- Sidebar becomes a slide-in drawer ---------------------------------- */
  .sidebar.two-col,
  .sidebar.two-col.is-collapsed,
  .sidebar.two-col.is-expanded {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    /* The menu panel is conditionally rendered, so a fixed width left a blank
       column whenever only the rail was present. Shrink-wrap instead. */
    width: auto;
    max-width: 86vw;
    z-index: 1100;
    display: flex;
    flex-direction: row;
    background: var(--sidebar, #fafafa);
    border-right: 1px solid var(--border, #e2e8f0);
    box-shadow: 0 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(-100%);
    /* visibility keeps the closed drawer out of the tab order without killing
       the slide animation (it flips only after the transform finishes). */
    visibility: hidden;
    transition: transform var(--duration-base) cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0.26s;
    overflow: hidden;
  }

  .sidebar.two-col.is-mobile-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform var(--duration-base) cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0s;
  }

  @media (prefers-reduced-motion: reduce) {
    .sidebar.two-col,
    .app-mobile-nav-backdrop {
      transition: none;
    }
  }

  .sidebar-rail {
    margin: var(--space-2);
    border-radius: var(--radius-md);
    flex-shrink: 0;
  }

  .sidebar-panel {
    flex: 0 0 224px;
    width: 224px;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .app-mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-base) ease;
  }

  .app-shell.has-mobile-nav .app-mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Rail tooltips are hover affordances; on touch they fire on tap and hang. */
  .sidebar-rail-tip.is-floating {
    display: none;
  }

  /* The settings tray is positioned from JS against the rail; on mobile the
     rail lives inside the drawer, so pin it to the viewport instead. */
  .sidebar-rail-tray {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    width: auto !important;
    max-width: none !important;
    z-index: 1300;
  }

  /* ==========================================================================
     2. MOBILE — page chrome
     ======================================================================== */
  .hm-shell,
  .pm-page {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .hm-top {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-3) 0 var(--space-3);
  }

  .hm-top h1 {
    font-size: var(--text-2xl);
  }

  /* Module docks scroll sideways rather than wrapping into a tall block. */
  .hm-hrms-dock,
  .pm-page .hm-hrms-dock {
    margin-left: -12px;
    margin-right: -12px;
    padding: var(--space-2) var(--space-3);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hm-hrms-dock::-webkit-scrollbar {
    display: none;
  }

  /* NB: .hm-hrms-dock and .hm-ov-tabs are the same element, so the container
     must stay 100% wide and only its *contents* may exceed it. */
  .hm-hrms-dock,
  .hm-hrms-dock.hm-ov-tabs {
    flex-wrap: nowrap;
  }

  .hm-hrms-dock .idock {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
  }

  /* ==========================================================================
     3. MOBILE — grids collapse
     ======================================================================== */
  .cards,
  .hm-e360-lt-grid,
  .hm-sum,
  .hm-sum-today-grid,
  .hm-reports-grid,
  .hm-orbs,
  .dash-grid,
  .stats-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  /* Identity chips and stat tiles hold short label/value pairs, so they stay
     in a multi-column grid on phones. Stacking six chips one per row turned
     the profile header into a full screen of scrolling. */
  .hm-e360-chips,
  .hm-e360-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .hm-e360,
  .hm-e360.hm-e360--self,
  .hm-e360-split,
  .roles-layout,
  .files-layout,
  .eh-grid,
  .md-top-row,
  .mt-perf-layout,
  .commit-review-body,
  .merge-resolve-body {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Anything still declaring a fixed multi-column track at this width would
     overflow; fall back to auto-fit so columns wrap instead. */
  [class*="-grid"] {
    min-width: 0;
  }

  /* ==========================================================================
     4. MOBILE — tables
     ======================================================================== */
  .table-wrap,
  .table-scroll,
  .hm-table-wrap,
  .data-table,
  .code-table-wrap,
  .pd-table-wrap,
  .wi-table-wrap,
  [class*="table-wrap"],
  [class*="table-scroll"] {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Keep columns readable and let the wrapper scroll, rather than letting the
     browser crush every cell to fit 360px. */
  .table-wrap table,
  .table-scroll table,
  .hm-table-wrap table,
  [class*="table-wrap"] table,
  [class*="table-scroll"] table {
    min-width: 560px;
  }

  /* ~25 tables in the app have no scroll wrapper of their own (Dashboard,
     Employees, the code/* tabs, several CRM pages...). Rather than editing each
     call site, make whichever element directly contains a table the scroll
     container. :has() is already used elsewhere in this codebase. */
  .card:has(> table),
  .panel:has(> table),
  .hm-card:has(> table),
  section:has(> table),
  div:has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .card:has(> table) > table,
  .panel:has(> table) > table,
  .hm-card:has(> table) > table,
  section:has(> table) > table,
  div:has(> table) > table {
    min-width: 560px;
  }

  th,
  td {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-md);
  }

  /* ==========================================================================
     5. MOBILE — cards, forms, buttons, modals
     ======================================================================== */
  .card,
  .panel,
  .hm-card,
  .hm-sum-card {
    padding: var(--space-4);
  }

  .hm-card {
    min-height: 0;
  }

  /* Toolbars and header rows stack instead of squeezing. */
  .hm-card-head,
  .hm-panel-head,
  .hm-sum-card-head,
  .hm-emp-toolbar,
  .hm-emp-filters,
  .pm-projects-header,
  .page-head,
  .toolbar,
  .wi-toolbar {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  /* Form controls go full width and use a >=16px font so iOS Safari does not
     zoom the viewport on focus. */
  input,
  select,
  textarea {
    max-width: 100%;
    font-size: var(--text-lg);
  }

  .form-row,
  .form-grid,
  .hm-leave-form,
  .modal-form {
    grid-template-columns: minmax(0, 1fr);
    display: grid;
    gap: var(--space-3);
  }

  .hm-emp-search,
  .hm-emp-select,
  .filters input,
  .filters select {
    width: 100%;
    min-width: 0;
  }

  /* Action rows: let buttons wrap, and stop them shrinking below their label. */
  .actions,
  .modal-footer,
  .cpw-actions,
  .hm-leave-actions,
  .hm-sum-card-actions,
  .hm-card-head .actions {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .btn,
  .ui-btn,
  .hm-btn-primary,
  .hm-btn-ghost {
    flex-shrink: 0;
  }

  /* Modals sit inside the viewport with a gutter, and scroll internally. */
  .modal,
  .modal.modal-lg,
  .modal-wide,
  .cpw-modal,
  .tc-modal,
  .ml-modal,
  .feed-post-modal {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    margin: var(--space-3);
    padding: var(--space-4);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-backdrop,
  .tc-modal-backdrop,
  .ml-modal-backdrop,
  .feed-post-modal-backdrop {
    padding: 0;
    align-items: flex-start;
    overflow-y: auto;
  }

  /* ==========================================================================
     5b. MOBILE — login
     ======================================================================== */
  /* .login-card is a hard 380px, which overflows a 360px phone. */
  .login-wrap {
    min-height: 100dvh;
    padding: var(--space-4);
  }

  .login-card {
    width: 100%;
    max-width: 380px;
    padding: var(--space-7) var(--space-5);
  }

  /* ==========================================================================
     6. MOBILE — full-bleed app shells (chat / mail / AI)
     ======================================================================== */
  .tc-shell,
  .ml-shell,
  .ai-shell {
    flex-direction: column;
    height: auto;
    min-height: calc(100dvh - 56px);
  }

  .tc-sidebar,
  .ml-sidebar,
  .ai-sidebar {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--border, #e2e8f0);
  }

  .tc-main,
  .ml-main,
  .ai-main {
    width: 100%;
    min-width: 0;
  }

  .tc-topbar,
  .ml-topbar,
  .ai-topbar {
    flex-wrap: wrap;
    gap: var(--space-2);
    height: auto;
    padding: var(--space-2) var(--space-3);
  }
}

/* ============================================================================
   7. SMALL PHONES (<= 480px)
   ========================================================================== */
@media (max-width: 480px) {
  /* One column for the wide content cards, which need the full width. */
  .cards,
  .hm-e360-lt-grid,
  .hm-sum,
  .hm-reports-grid,
  .dash-grid,
  .stats-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Compact tiles stay two-up — six stacked chips is far too much scrolling. */
  .hm-e360-chips,
  .hm-e360-stats,
  .hm-sum-today-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .hm-e360-chip {
    padding: var(--space-2) var(--space-2);
    gap: 1px;
  }

  /* Touch has no real hover: the scale would latch on after a tap and, at
     two-up, push into the neighbouring tile. */
  .hm-e360-stat:hover,
  .hm-kpi:hover {
    transform: none;
    filter: none;
  }

  .hm-e360-chip-lbl {
    font-size: var(--text-xs);
    letter-spacing: 0.03em;
    white-space: normal;
  }

  .hm-e360-chip-val {
    font-size: var(--text-sm);
  }

  .hm-e360-chip-hint {
    font-size: var(--text-xs);
    white-space: normal;
  }

  .hm-shell,
  .pm-page {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .hm-hrms-dock,
  .pm-page .hm-hrms-dock {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .hm-top h1 {
    font-size: var(--text-2xl);
  }

  .card,
  .panel,
  .hm-card,
  .hm-sum-card {
    padding: var(--space-3);
  }

  /* Stat/identity tiles: the label + value stack reads fine, just tighter. */
  .hm-e360-stat {
    padding: var(--space-3) var(--space-3);
    gap: var(--space-1);
  }

  .hm-e360-stat-lbl {
    font-size: var(--text-xs);
    letter-spacing: 0.03em;
    white-space: normal;
  }

  .hm-e360-stat-val {
    font-size: var(--text-xl);
  }

  .hm-e360-stat-hint {
    font-size: var(--text-xs);
    white-space: normal;
  }

  /* Buttons in a stacked action row fill the width — easier tap targets. */
  .modal-footer .btn,
  .cpw-actions .btn,
  .hm-sum-card-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  th,
  td {
    padding: var(--space-2) var(--space-2);
    font-size: var(--text-md);
  }
}
