:root {
  --primary: #0b1f33;
  --primary-2: #123452;
  --accent: #2563eb;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft-line: #edf2f7;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
  --radius: 8px;
  --sidebar: 280px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 760px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px;
  color: #dbeafe;
  background: var(--primary);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--primary);
  font-family: "DM Sans", Inter, sans-serif;
  font-weight: 800;
}

.brand-block strong,
.brand-block span {
  display: block;
}

.brand-block strong {
  color: #ffffff;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: 15px;
}

.brand-block span {
  color: #93c5fd;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  color: #bfdbfe;
  border-radius: var(--radius);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 #60a5fa;
}

.nav-item svg,
.topbar svg,
.btn svg,
.icon-btn svg,
.stat-icon svg,
.empty-state svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-footer span,
.sidebar-footer strong {
  display: block;
}

.sidebar-footer span {
  color: #93c5fd;
  font-size: 12px;
}

.sidebar-footer strong {
  color: #ffffff;
  font-size: 13px;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 86px;
  padding: 18px 30px;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar h1,
.question-band h2,
.spotlight h2,
.profile-hero h2 {
  margin: 0;
  font-family: "DM Sans", Inter, sans-serif;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 24px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  max-width: 310px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-chip svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--success);
}

.date-chip,
.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.date-chip {
  min-height: 40px;
  padding: 0 12px;
  color: var(--muted);
}

.btn {
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.btn.ghost {
  background: #ffffff;
}

.btn.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

.icon-btn {
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--muted);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.icon-btn:hover {
  color: var(--accent);
  border-color: #bfdbfe;
  background: #eff6ff;
}

.icon-btn.danger:hover {
  color: var(--danger);
  border-color: #fecaca;
  background: #fef2f2;
}

.page {
  padding: 28px 30px 44px;
}

.page-stack {
  display: grid;
  gap: 22px;
}

.question-band,
.spotlight,
.profile-hero {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.question-band.compact {
  align-items: flex-start;
}

.question-band h2,
.spotlight h2,
.profile-hero h2 {
  margin-top: 2px;
  font-size: 30px;
}

.question-band p,
.spotlight p,
.profile-hero p,
.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.target-card {
  width: min(360px, 40%);
  min-width: 260px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.panel,
.mini-stat,
.leader-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.stat-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  min-height: 136px;
  padding: 18px;
  overflow: hidden;
}

.stat-card p,
.mini-stat span,
.metric-pair span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-card strong,
.mini-stat strong {
  display: block;
  margin-top: 6px;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: 25px;
  line-height: 1.12;
}

.stat-card small,
.mini-stat small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  color: var(--accent);
  background: #eff6ff;
}

.stat-card.success .stat-icon {
  color: var(--success);
  background: #ecfdf5;
}

.stat-card.accent .stat-icon {
  color: var(--accent);
  background: #eff6ff;
}

.trend-pill {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 800;
}

.trend-pill.positive {
  color: #047857;
  background: #ecfdf5;
}

.trend-pill.negative {
  color: #b91c1c;
  background: #fef2f2;
}

.content-grid {
  display: grid;
  gap: 18px;
}

.content-grid.two-one {
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
}

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

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: 18px;
}

.text-link {
  color: var(--accent);
  font-weight: 800;
}

.chart-frame {
  position: relative;
  height: 318px;
}

.leader-list,
.comparison-list,
.employee-list,
.insight-grid,
.bullet-list,
.timeline {
  display: grid;
  gap: 10px;
}

.leader-row,
.comparison-row,
.data-row,
.data-head {
  display: grid;
  align-items: center;
  gap: 12px;
}

.leader-row {
  grid-template-columns: 34px 38px 1fr auto;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}

.leader-main strong,
.leader-main span,
.score-cluster strong,
.score-cluster span {
  display: block;
}

.leader-main span,
.score-cluster span {
  color: var(--muted);
  font-size: 12px;
}

.score-cluster {
  text-align: right;
}

.rank-medal {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  background: #f1f5f9;
  font-weight: 900;
}

.rank-medal.gold {
  color: #92400e;
  background: #fef3c7;
}

.rank-medal.silver {
  color: #475569;
  background: #e2e8f0;
}

.rank-medal.bronze {
  color: #9a3412;
  background: #ffedd5;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #ffffff;
  background: var(--avatar);
  font-family: "DM Sans", Inter, sans-serif;
  font-weight: 900;
}

.avatar-md {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.avatar-lg {
  width: 58px;
  height: 58px;
  font-size: 18px;
}

.avatar-xl {
  width: 74px;
  height: 74px;
  font-size: 22px;
}

.insight-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: #ffffff;
}

.insight-card strong,
.insight-card span {
  display: block;
}

.insight-card p {
  margin: 6px 0;
  color: #334155;
}

.insight-card span {
  color: var(--muted);
  font-size: 13px;
}

.insight-card.success {
  border-left-color: var(--success);
}

.insight-card.accent {
  border-left-color: var(--accent);
}

.insight-card.warning {
  border-left-color: var(--warning);
}

.insight-card.danger {
  border-left-color: var(--danger);
}

.insight-card.neutral {
  border-left-color: #64748b;
}

.progress-wrap {
  display: grid;
  gap: 8px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: #e2e8f0;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.spotlight-person,
.profile-id,
.leader-identity {
  display: flex;
  gap: 14px;
  align-items: center;
}

.spotlight-score,
.profile-score {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.score-badge {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: var(--accent);
  background: #eff6ff;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: 20px;
  font-weight: 900;
}

.score-badge.success {
  color: var(--success);
  background: #ecfdf5;
}

.score-badge.warning {
  color: var(--warning);
  background: #fffbeb;
}

.score-badge.danger {
  color: var(--danger);
  background: #fef2f2;
}

.leader-table {
  display: grid;
  gap: 12px;
}

.leader-card {
  display: grid;
  grid-template-columns: 96px minmax(180px, 1.3fr) repeat(3, minmax(110px, 0.7fr)) 90px;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.leader-rank {
  display: flex;
  gap: 8px;
  align-items: center;
}

.movement {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 800;
}

.movement svg {
  width: 14px;
  height: 14px;
}

.movement.up {
  color: var(--success);
}

.movement.down {
  color: var(--danger);
}

.movement.neutral {
  color: var(--muted);
}

.metric-pair strong {
  display: block;
  margin-top: 3px;
}

.leader-score {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.leader-score .score-badge {
  width: 48px;
  height: 48px;
  font-size: 17px;
}

.badge-row {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-row span {
  padding: 4px 8px;
  border-radius: var(--radius);
  color: var(--primary);
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 800;
}

.leader-card .progress-wrap {
  grid-column: 2 / -1;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-grid,
.filter-bar {
  display: grid;
  gap: 12px;
}

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

.form-grid.three {
  grid-template-columns: 1.2fr 0.8fr 0.9fr;
}

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

.entry-form,
.settings-form {
  display: grid;
  gap: 16px;
}

.service-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.locked-employee {
  display: grid;
  gap: 4px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.locked-employee span {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.locked-employee strong,
.locked-employee small {
  display: block;
}

.locked-employee small {
  color: var(--muted);
}

.form-actions,
.modal-actions,
.sticky-actions,
.export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 14px 0;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(14px);
}

.data-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.record-grid {
  grid-template-columns: 150px minmax(160px, 1fr) 160px 120px minmax(90px, auto);
}

.data-head {
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.data-row {
  min-height: 54px;
  padding: 0 12px;
  border-top: 1px solid var(--soft-line);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.profiles-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
}

.employee-rail {
  position: sticky;
  top: 108px;
  align-self: start;
}

.employee-tab {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #ffffff;
  cursor: pointer;
  text-align: left;
}

.employee-tab.active,
.employee-tab:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.employee-tab:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.employee-tab.active:disabled {
  opacity: 1;
}

.employee-tab strong,
.employee-tab small {
  display: block;
}

.employee-tab small {
  color: var(--muted);
}

.access-note {
  margin: 12px 0 0;
  padding: 10px;
  border-radius: var(--radius);
  color: #475569;
  background: #f8fafc;
  font-size: 13px;
}

.profile-main {
  display: grid;
  gap: 18px;
}

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

.mini-stat {
  padding: 16px;
}

.bullet-list p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.timeline {
  position: relative;
}

.timeline-item {
  padding: 12px 12px 12px 18px;
  border-left: 3px solid #bfdbfe;
  background: #ffffff;
}

.timeline-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline-item strong,
.timeline-item p {
  display: block;
  margin: 2px 0 0;
}

.filter-bar {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  align-items: end;
}

.report-filter {
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
}

.comparison-row {
  grid-template-columns: minmax(140px, 1fr) 160px 120px;
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}

.heatmap {
  overflow-x: auto;
}

.heatmap-head,
.heatmap-row {
  display: grid;
  grid-template-columns: 94px repeat(8, minmax(70px, 1fr));
  gap: 6px;
  align-items: center;
  min-width: 700px;
}

.heatmap-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.heatmap-row {
  margin-top: 6px;
}

.heatmap-row span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: var(--radius);
  color: var(--primary);
  background: rgba(37, 99, 235, calc(0.08 + var(--heat) * 0.28));
  font-weight: 800;
}

.slab-list {
  display: grid;
  gap: 10px;
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

.employee-editor {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.directory-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.directory-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #ffffff;
}

.directory-row.inactive {
  opacity: 0.68;
}

.directory-row strong,
.directory-row small {
  display: block;
}

.directory-row small {
  color: var(--muted);
}

.slab-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 38px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  color: #94a3b8;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal {
  width: min(460px, 100%);
  padding: 18px;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal h2 {
  margin: 0;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: 20px;
}

.modal p {
  color: var(--muted);
}

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 240px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--success);
  box-shadow: var(--shadow);
}

.toast.danger {
  background: var(--danger);
}

.skeleton {
  min-height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2e8f0, #f8fafc, #e2e8f0);
  background-size: 180% 100%;
  animation: shimmer 1.25s infinite linear;
}

@keyframes shimmer {
  from {
    background-position: 180% 0;
  }
  to {
    background-position: -180% 0;
  }
}

@media (max-width: 1180px) {
  :root {
    --sidebar: 238px;
  }

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

  .content-grid.two-one,
  .content-grid.one-one,
  .profiles-layout {
    grid-template-columns: 1fr;
  }

  .employee-rail {
    position: static;
  }

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

  .leader-card {
    grid-template-columns: 82px minmax(180px, 1fr) repeat(2, minmax(110px, 0.7fr));
  }

  .leader-score,
  .leader-card .metric-pair:nth-of-type(4) {
    grid-column: auto;
  }

  .filter-bar,
  .service-entry-grid,
  .form-grid.four {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .sidebar {
    padding: 16px 12px;
  }

  .brand-block {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand-block div:last-child,
  .nav-item span,
  .sidebar-footer {
    display: none;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .topbar {
    padding: 16px 20px;
  }

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

  .page {
    padding: 22px 20px 38px;
  }

  .question-band,
  .spotlight,
  .profile-hero,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .target-card {
    width: 100%;
  }

  .form-grid.three,
  .form-grid.two,
  .filter-bar,
  .report-filter,
  .service-entry-grid,
  .form-grid.four,
  .slab-row {
    grid-template-columns: 1fr 1fr;
  }

  .record-grid {
    grid-template-columns: 130px minmax(150px, 1fr) 120px 90px 80px;
  }
}
