:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #182230;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
.app-shell { width: min(1280px, calc(100% - 32px)); margin: 28px auto 48px; }

.auth-view {
  align-items: center;
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr 320px;
  min-height: calc(100vh - 96px);
}

.auth-panel {
  background: #ffffff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  padding: 24px;
}

.eyebrow {
  color: #245bdb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1 { font-size: 40px; line-height: 1.1; margin: 0; }
h2 { font-size: 18px; line-height: 1.2; margin: 0; }
.lead { color: #536071; font-size: 18px; line-height: 1.6; margin: 16px 0 0; max-width: 620px; }
.muted { color: #667085; margin: 0; }

.dashboard { display: grid; gap: 20px; }
.topbar, .user-strip, .panel, .metric-tile {
  background: #ffffff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 22px;
}

.toolbar { align-items: end; display: flex; gap: 10px; }
.range-control { color: #536071; display: grid; font-size: 13px; font-weight: 700; gap: 6px; }
select, input {
  background: #ffffff;
  border: 1px solid #cfd7e3;
  border-radius: 6px;
  color: #182230;
  min-height: 40px;
  padding: 8px 32px 8px 10px;
}

.primary-button, .secondary-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  text-decoration: none;
}
.primary-button { background: #245bdb; color: #ffffff; width: 100%; }
.secondary-button { background: #eef3fb; border-color: #d6deeb; color: #20324d; }
.secondary-button:disabled { cursor: wait; opacity: .55; }
.primary-button:disabled { cursor: wait; opacity: .55; }

.user-strip {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}
.user-strip div { display: grid; gap: 6px; padding: 16px 18px; }
.user-strip span, .metric-tile span, .employee-row span, .score-row span, .trend-row span {
  color: #667085;
  font-size: 13px;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
}
.metric-tile { display: grid; gap: 10px; min-height: 116px; padding: 18px; }
.metric-tile strong { font-size: 36px; line-height: 1; }

.layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 360px;
}
.main-column, .side-column { display: grid; gap: 20px; min-width: 0; }
.panel { padding: 18px; }
.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-heading.compact { margin-bottom: 10px; }
.section-actions, .view-switch {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.view-switch {
  background: #eef3fb;
  border: 1px solid #d6deeb;
  border-radius: 6px;
  padding: 3px;
}
.view-button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #536071;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  min-height: 30px;
  padding: 5px 10px;
}
.view-button.active {
  background: #ffffff;
  color: #182230;
  box-shadow: 0 1px 2px rgba(24, 34, 48, .12);
}

.text-link, td a {
  color: #245bdb;
  font-weight: 700;
  text-decoration: none;
}

.notice {
  background: #fff8e6;
  border: 1px solid #f2cf74;
  border-radius: 8px;
  color: #594300;
  margin-bottom: 12px;
  padding: 12px;
}

.plan-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 180px 120px 140px;
  margin-bottom: 14px;
}
.plan-form label {
  color: #536071;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}
.plan-form .primary-button { width: auto; }
.plan-result { display: grid; gap: 14px; }
.plan-summary {
  background: #f6f8fb;
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  display: grid;
  gap: 1px;
  grid-template-columns: 1.2fr .6fr .6fr 1.4fr;
  overflow: hidden;
}
.plan-summary div {
  background: #ffffff;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}
.plan-summary span {
  color: #667085;
  font-size: 12px;
}
.plan-summary strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.plan-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 720px; width: 100%; }
th, td {
  border-bottom: 1px solid #e7ecf3;
  padding: 12px 8px;
  text-align: left;
  vertical-align: middle;
}
th { color: #667085; font-size: 13px; font-weight: 700; }

.calendar-view { display: grid; gap: 16px; }
.calendar-week {
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  overflow: hidden;
}
.calendar-week h3 {
  background: #f6f8fb;
  border-bottom: 1px solid #e1e7ef;
  color: #344054;
  font-size: 14px;
  margin: 0;
  padding: 10px 12px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  min-width: 840px;
}
.calendar-day {
  border-right: 1px solid #e7ecf3;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 132px;
  padding: 10px;
}
.calendar-day:last-child { border-right: 0; }
.calendar-day-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.calendar-day-head strong { font-size: 13px; }
.calendar-day-head span { color: #667085; font-size: 12px; }
.calendar-event {
  background: #e8f1ff;
  border: 1px solid #c9dcff;
  border-radius: 6px;
  display: grid;
  gap: 3px;
  padding: 7px;
}
.calendar-event strong { font-size: 13px; line-height: 1.3; }
.calendar-event span { color: #475467; font-size: 12px; }

.badge {
  background: #e8f1ff;
  border: 1px solid #c9dcff;
  border-radius: 999px;
  color: #174ea6;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.employee-list { display: grid; gap: 10px; }
.employee-row, .trend-row {
  align-items: center;
  border-bottom: 1px solid #e7ecf3;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 62px;
  padding: 10px 0;
}
.employee-row:last-child, .trend-row:last-child { border-bottom: 0; }
.employee-row > div:first-child, .trend-row > div:first-child { display: grid; gap: 4px; min-width: 160px; }
.employee-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.employee-stats span {
  background: #f3f6fa;
  border-radius: 999px;
  min-width: 64px;
  padding: 5px 8px;
  text-align: center;
}

.score-stack, .trend-list { display: grid; gap: 10px; }
.score-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 100px 42px;
  align-items: center;
  min-height: 54px;
}
.score-row > div:first-child { display: grid; gap: 4px; }
.bar {
  background: #edf1f6;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.bar span {
  background: #20a67a;
  display: block;
  height: 100%;
}
.trend-row b { font-size: 20px; }

@media (max-width: 960px) {
  .auth-view, .layout, .user-strip, .metric-grid { grid-template-columns: 1fr; }
  .topbar, .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar { width: 100%; }
  .secondary-button, .range-control select { width: 100%; }
  .plan-form, .plan-summary { grid-template-columns: 1fr; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-actions { align-items: stretch; flex-direction: column; }
  .view-switch { width: 100%; }
  .view-button { flex: 1; }
  .calendar-view { overflow-x: auto; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 20px, 1280px); margin-top: 16px; }
  h1 { font-size: 30px; }
  .lead { font-size: 16px; }
  .employee-row, .trend-row { align-items: stretch; flex-direction: column; }
  .employee-stats { justify-content: flex-start; }
  .score-row { grid-template-columns: 1fr 80px 36px; }
}
