:root {
  --blue: #006A91;
  --cyan: #51C3CA;
  --gold: #F9B401;
  --bright-blue: #0086AC;
  --gray: #A6A6A6;
  --ink: #113244;
  --muted: #6d7a82;
  --line: #e4eef2;
  --soft: #eef8fa;
  --white: #FFFFFF;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #f6fafb;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: var(--white);
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
}

button:hover { background: #055a79; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--white);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hidden { display: none !important; }

.shell { min-height: 100vh; }

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(0,106,145,.92), rgba(0,134,172,.86)),
    radial-gradient(circle at 70% 18%, rgba(81,195,202,.34), transparent 32%);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--white);
  position: absolute;
  top: 28px;
  left: 32px;
}

.brand-mark.compact {
  position: static;
  color: var(--ink);
}

.brand-symbol {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--white);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark small,
.user-box small,
.section-title small {
  display: block;
  color: inherit;
  opacity: .7;
}

.login-card {
  width: min(520px, 100%);
  display: grid;
  gap: 18px;
  padding: 38px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 24px 80px rgba(17, 50, 68, .22);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.02;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: .04em;
}

.message { min-height: 20px; color: var(--danger); }

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.user-box {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: right;
}

.user-box button {
  background: #eaf4f7;
  color: var(--blue);
  padding: 9px 14px;
}

.hero-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 36px 6vw;
  background: linear-gradient(90deg, #006A91, #0086AC);
  color: var(--white);
}

.hero-band h1 {
  max-width: 920px;
  margin: 8px 0 0;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1.03;
}

.status-card {
  min-width: 245px;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.24);
}

.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto auto auto auto minmax(180px, 1fr);
  justify-content: start;
  align-items: end;
  gap: 14px;
  padding: 22px 6vw;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.sync-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.filterbar {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(260px, 520px);
  gap: 14px;
  padding: 16px 6vw;
  background: #f8fbfc;
  border-bottom: 1px solid var(--line);
}

.grid-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 0;
}

.course-list {
  padding: 24px;
  background: var(--white);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title.accent {
  padding-top: 14px;
  border-top: 7px solid var(--gold);
}

.course-button {
  width: 100%;
  text-align: left;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  padding: 14px;
}

.course-button:hover,
.course-button.active {
  background: var(--soft);
  border-color: var(--cyan);
}

.course-button strong,
.course-button span { display: block; }

.course-button small {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
}

.detail-panel {
  padding: 28px 6vw 44px;
  overflow: auto;
}

.empty-state {
  max-width: 620px;
  padding: 40px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-header {
  margin: -28px -6vw 28px;
  padding: 36px 6vw 34px;
  color: var(--white);
  background: linear-gradient(90deg, var(--blue), var(--bright-blue));
}

.report-header h2 {
  margin: 6px 0 16px;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1;
}

.pill {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.facts,
.diagnostic-strip,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.fact,
.diagnostic,
.metric {
  padding: 18px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
}

.fact small,
.diagnostic small,
.metric small {
  display: block;
  color: var(--gray);
  text-transform: uppercase;
  font-weight: 900;
}

.fact strong,
.diagnostic strong,
.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.metric strong {
  color: var(--blue);
  font-size: 40px;
}

.report-preview,
.raw-table {
  margin-top: 28px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.quote {
  padding: 14px 16px;
  border-left: 5px solid var(--cyan);
  background: #f7fbfc;
}

.quote small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.table-scroll { overflow: auto; }

.diagnostic-debug {
  border-top: 5px solid var(--bright-blue);
}

.diagnostic-debug h3 {
  margin: 22px 0 10px;
  font-size: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--blue);
  background: #f2f9fb;
  font-size: 12px;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .topbar,
  .hero-band,
  .user-box { align-items: flex-start; }

  .topbar,
  .hero-band { flex-direction: column; }

  .toolbar,
  .grid-layout { grid-template-columns: 1fr; }

  .course-list { border-right: 0; border-bottom: 1px solid var(--line); }

  .brand-mark { position: static; margin-bottom: 24px; }

  .login-panel { place-items: start center; }
}
