:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #1f2937;
  --ink-strong: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --amber: #c77b12;
  --red: #b42318;
  --red-soft: #fde7e5;
  --yellow: #facc15;
  --yellow-dark: #eab308;
  --shadow: 0 16px 45px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  min-height: 100vh;
  background:
    radial-gradient(circle, rgba(17, 24, 39, 0.12) 1px, transparent 1.4px) 0 0 / 24px 24px,
    var(--bg);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 40px;
  overflow: hidden;
  background: transparent;
  color: var(--ink-strong);
}

.brand-lockup,
.mobile-brand,
.loader-header > div {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  display: block;
  width: 126px;
  height: auto;
  flex: 0 0 auto;
}

.brand-copy {
  width: min(760px, 92%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--ink-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy .eyebrow,
.topbar .eyebrow,
.review-band .eyebrow {
  color: var(--ink-strong);
}

.brand-copy h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.5rem, 7vw, 6.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.brand-copy p:last-child {
  max-width: 620px;
  color: rgba(17, 24, 39, 0.72);
  font-size: 1.08rem;
  line-height: 1.7;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border);
}

.signal-strip div {
  padding: 18px;
  background: var(--surface);
}

.signal-strip span {
  display: block;
  margin-bottom: 8px;
  color: rgba(17, 24, 39, 0.62);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.signal-strip strong {
  font-size: 1.1rem;
}

.login-card {
  align-self: center;
  width: min(420px, calc(100% - 40px));
  margin: 40px auto;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mobile-brand {
  display: none;
  margin-bottom: 28px;
}

.login-card h2 {
  margin: 0 0 10px;
  font-size: 1.75rem;
}

.login-note {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

label {
  display: block;
  margin: 18px 0 8px;
  color: #314239;
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--ink-strong);
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.34);
}

.primary-button,
.ghost-button {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  padding: 0 18px;
  background: var(--yellow);
  color: var(--ink-strong);
}

.primary-button:hover {
  background: var(--yellow-dark);
}

.ghost-button {
  width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: #fff;
  color: var(--ink-strong);
}

.form-error {
  min-height: 20px;
  margin: 12px 0;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 700;
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.78) 0 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.78) 0 1px, transparent 1px) 0 0 / 56px 56px,
    var(--yellow);
  color: var(--ink-strong);
}

.loading-shell {
  width: min(780px, 100%);
  padding: 32px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.loader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.loader-header strong {
  font-size: 1.4rem;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.14);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ink-strong), #ef4444);
  transition: width 0.35s ease;
}

.loading-shell h2 {
  margin: 26px 0 8px;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
}

.loading-shell p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.loading-list {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.loading-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.loading-list li::after {
  content: "Complete";
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}

.sidebar .brand-logo {
  width: 108px;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 40px;
}

.nav-list a {
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a.active {
  background: var(--yellow);
  color: var(--ink-strong);
}

.sidebar .ghost-button {
  margin-top: auto;
}

.dashboard-main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar .eyebrow {
  color: var(--ink-strong);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  letter-spacing: 0;
}

.employee-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.employee-chip img {
  width: 52px;
  height: 52px;
  border-radius: 0;
  object-fit: cover;
  background: var(--surface-2);
}

.employee-chip span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.review-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

.summary-copy h2 {
  margin: 12px 0 10px;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
}

.summary-copy p,
.summary-text {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.section-loader {
  display: grid;
  gap: 8px;
  max-width: 720px;
}

.section-loader strong {
  color: var(--ink-strong);
  font-size: 1rem;
}

.section-loader p {
  margin: 0;
  color: var(--muted);
}

.loader-kicker {
  color: var(--red);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loader-line {
  position: relative;
  display: block;
  width: min(320px, 100%);
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef0f3;
}

.loader-line span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), #ef4444);
  animation: scan-line 1.1s ease-in-out infinite;
}

.loading-card,
.loading-item,
.loading-section {
  position: relative;
  overflow: hidden;
}

.loading-card h3,
.loading-item strong {
  color: var(--ink-strong);
}

.loading-card p,
.loading-item p {
  color: var(--muted);
}

.mini-line.pending span {
  background: linear-gradient(90deg, var(--yellow), #ef4444);
  animation: pending-width 1.4s ease-in-out infinite;
}

.loading-section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 35%, rgba(250, 204, 21, 0.18) 45%, transparent 55% 100%);
  animation: section-sweep 1.8s linear infinite;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

@keyframes scan-line {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(240%);
  }
}

@keyframes pending-width {
  0%,
  100% {
    width: 28%;
  }

  50% {
    width: 84%;
  }
}

@keyframes section-sweep {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 10px;
  background: var(--yellow);
}

.score-panel span,
.score-panel small {
  color: rgba(17, 24, 39, 0.68);
  font-weight: 700;
}

.score-panel strong {
  margin: 10px 0;
  color: var(--ink-strong);
  font-size: 4.2rem;
  line-height: 1;
}

.threshold-card,
.panel,
.metric-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.05);
}

.threshold-card {
  margin: 18px 0;
  padding: 22px;
}

.threshold-labels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.threshold-labels span:nth-child(2) {
  text-align: right;
}

.threshold-line {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4a3f 0 10%, #f2c94c 10% 95%, #2e9b5f 95% 100%);
}

.danger-zone,
.promotion-zone {
  position: absolute;
  top: -6px;
  bottom: -6px;
  border-left: 2px solid rgba(0, 0, 0, 0.3);
}

.danger-zone {
  left: 10%;
}

.promotion-zone {
  left: 95%;
}

.score-marker {
  position: absolute;
  top: 50%;
  left: var(--score-left, 12%);
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #111;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  transition: left 0.12s linear;
  will-change: left;
}

.score-marker strong {
  position: absolute;
  left: 50%;
  bottom: 28px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #111;
  color: #fff;
  font-size: 0.8rem;
  transform: translateX(-50%);
}

.threshold-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.threshold-legend div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.threshold-legend strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-strong);
  font-size: 0.88rem;
}

.threshold-legend span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 190px;
  padding: 20px;
}

.metric-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card h3 {
  margin: 0;
  font-size: 1rem;
}

.metric-card .score {
  color: var(--red);
  font-size: 1.8rem;
  font-weight: 900;
}

.mini-line {
  height: 8px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #f3f4f6;
}

.mini-line span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  transition: width 0.14s linear;
  will-change: width;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.custom-metric-card {
  border-color: rgba(250, 204, 21, 0.7);
  background:
    linear-gradient(180deg, rgba(250, 204, 21, 0.13), transparent 90px),
    var(--surface);
}

.signal-bars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 7px;
  height: 54px;
  margin: 14px 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.signal-bars span {
  display: block;
  height: var(--bar);
  min-height: 8px;
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(180deg, var(--yellow), #ef4444);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
  gap: 18px;
}

.panel {
  padding: 22px;
}

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

.panel-heading h2 {
  margin: 0;
}

.badge.muted {
  background: #edf0ed;
  color: var(--muted);
}

.evidence-list,
.comment-list {
  display: grid;
  gap: 12px;
}

.evidence-item,
.comment-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfb;
}

.evidence-item strong,
.comment-item strong {
  display: block;
  margin-bottom: 6px;
}

.evidence-item p,
.comment-item p,
.action-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.action-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: center;
  margin-top: 18px;
}

.action-panel h2 {
  margin: 0 0 8px;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .login-screen,
  .dashboard,
  .review-band,
  .action-panel {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    display: none;
  }

  .mobile-brand {
    display: flex;
  }

  .login-screen {
    min-height: 100vh;
    place-items: center;
    padding: 20px;
  }

  .login-card {
    width: min(460px, 100%);
    margin: 0;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
  }

  .sidebar .ghost-button {
    margin-top: 18px;
  }

  .dashboard-main {
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-chip {
    min-width: 0;
  }
}

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

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

  .threshold-legend {
    grid-template-columns: 1fr;
  }

  .score-panel strong {
    font-size: 3.3rem;
  }

  .panel-heading {
    flex-direction: column;
  }
}
