:root {
  --navy: #082a60;
  --navy-2: #0b3677;
  --blue: #315f9f;
  --ink: #15233d;
  --muted: #6e7787;
  --gold: #d5a633;
  --gold-2: #f0d07a;
  --line: #d9dfeb;
  --paper: #f7f8fb;
  --white: #ffffff;
  --green: #2f9461;
  --amber: #ba7514;
  --red: #bd3346;
  --shadow: 0 18px 40px rgba(8, 42, 96, .09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 31px, rgba(8,42,96,.035) 32px),
    linear-gradient(180deg, #fff, #f3f6fb 520px, #eef2f7);
  background-size: 32px 100%, 100% 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body[data-role="coach"] .ops-bar .file-control,
body[data-role="coach"] #downloadTemplate {
  opacity: .45;
  pointer-events: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.92), rgba(255,255,255,.75)),
    url("/assets/highmark-journey-hero.png") center/cover no-repeat;
}

.login-screen.hidden {
  display: none;
}

.login-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 24px 70px rgba(8,42,96,.18);
  padding: 28px;
}

.login-panel img {
  width: 260px;
  max-width: 100%;
  display: block;
  margin-bottom: 20px;
}

.login-panel h1 {
  margin: 0;
  color: var(--navy);
  font-size: 30px;
}

.login-panel p,
.login-help {
  color: var(--muted);
  line-height: 1.7;
}

.login-panel form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-weight: 900;
}

.login-panel input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  font: inherit;
}

.login-help {
  margin-top: 14px;
  font-size: 12px;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1460px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 44px 0 34px;
}

.brand-board {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}

.top-system {
  display: grid;
  grid-template-columns: 430px 1fr 460px;
  align-items: center;
  gap: 28px;
  padding: 24px 38px 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,255,255,.86)),
    url("/assets/highmark-journey-hero.png") right center / 620px auto no-repeat;
}

.user-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1px;
  margin: 0 38px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.user-bar > div,
.user-bar > button {
  background: #fff;
}

.user-bar > div {
  padding: 13px 15px;
}

.user-bar span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.user-bar strong {
  color: var(--navy);
}

.user-bar .button {
  border-radius: 0;
  min-width: 120px;
}

.brand-shell {
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: min(360px, 100%);
  height: auto;
}

.system-title {
  border-left: 1px solid #aab5c9;
  border-right: 1px solid #aab5c9;
  padding: 2px 28px;
}

.system-title h1 {
  margin: 0;
  color: var(--navy);
  font-size: 35px;
  letter-spacing: 2px;
  line-height: 1.15;
}

.system-title p {
  margin: 8px 0 0;
  color: #1b2d4c;
  font-size: 20px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.system-note {
  color: #5f6776;
  font-size: 14px;
  line-height: 1.85;
  max-width: 430px;
}

.system-note::before,
.system-note::after {
  content: "";
  display: block;
  width: 170px;
  height: 2px;
  margin: 0 0 10px auto;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.system-note::after {
  margin: 12px 0 0 auto;
  opacity: .45;
}

.ops-bar {
  margin: 0 38px;
  padding: 22px 0;
  display: grid;
  grid-template-columns: minmax(380px, 1fr) auto;
  gap: 22px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--navy);
  font-weight: 900;
  letter-spacing: .4px;
  margin-bottom: 12px;
}

.section-kicker span {
  color: #8a93a3;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.section-kicker::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--navy);
  border-radius: 4px;
  box-shadow: inset 0 0 0 4px #fff;
  background: var(--gold);
}

.upload-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.file-control,
.control {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink);
}

.file-control {
  border-style: dashed;
  min-width: 310px;
}

.button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 15px;
  background: #fff;
  color: var(--navy);
  font-weight: 900;
}

.button.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #17223a;
}

.sync-state {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.main {
  padding: 22px 38px 24px;
}

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

.stat {
  min-height: 126px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 38px;
  line-height: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.blue { background: #eaf2ff; color: var(--navy-2); }
.green { background: #e8f5ee; color: var(--green); }
.amber { background: #fff3de; color: var(--amber); }
.red { background: #ffe8ec; color: var(--red); }
.gold { background: #fff7dc; color: #80600e; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 22px;
  align-items: start;
}

.panel,
.journey-card,
.info-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.panel-head {
  min-height: 58px;
  padding: 16px 17px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  letter-spacing: .4px;
}

.student-list {
  padding: 12px;
  display: grid;
  gap: 10px;
  max-height: 640px;
  overflow: auto;
}

.student-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  background: linear-gradient(180deg, #fff, #fbfcff);
  cursor: pointer;
  transition: .15s ease;
}

.student-card:hover,
.student-card.active {
  border-color: var(--navy-2);
  box-shadow: 0 8px 24px rgba(8,42,96,.08);
}

.student-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.student-name {
  color: var(--navy);
  font-size: 18px;
  font-weight: 900;
}

.student-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.58;
}

.mini-progress {
  height: 7px;
  margin-top: 13px;
  border-radius: 999px;
  background: #edf1f6;
  overflow: hidden;
}

.mini-progress div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy), var(--gold));
}

.detail {
  display: grid;
  gap: 14px;
}

.journey-card,
.customer-view {
  position: relative;
  padding: 20px;
  overflow: hidden;
}

.customer-view {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.customer-view::before {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 620px;
  height: 310px;
  background: url("/assets/highmark-journey-hero.png") center/cover no-repeat;
  opacity: .24;
  pointer-events: none;
}

.service-order-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  border: 1px solid #e3e9f3;
  background: #e3e9f3;
}

.service-order-strip div {
  background: rgba(255,255,255,.94);
  padding: 13px 14px;
  min-height: 74px;
}

.service-order-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.service-order-strip strong {
  color: var(--navy);
  font-size: 15px;
  line-height: 1.35;
}

.customer-hero,
.learner-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 20px;
  align-items: start;
}

.customer-copy h2 {
  margin: 10px 0 0;
  color: var(--navy);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.customer-copy p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
  max-width: 720px;
}

.customer-facts {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.customer-facts div {
  min-height: 78px;
  border: 1px solid rgba(8,42,96,.12);
  border-radius: 4px;
  background: rgba(255,255,255,.84);
  padding: 12px;
}

.customer-facts span,
.visual-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.customer-facts strong {
  color: var(--navy);
  font-size: 16px;
  line-height: 1.35;
}

.learner-title h2 {
  margin: 10px 0 0;
  color: var(--navy);
  font-size: 34px;
  line-height: 1.15;
}

.learner-title p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.ring-box {
  min-height: 168px;
  border: 1px solid #e2e8f2;
  border-radius: 4px;
  background: rgba(255,255,255,.86);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px;
}

.visual-summary {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.visual-metric {
  min-height: 118px;
  border: 1px solid #e3e9f3;
  border-radius: 4px;
  background: rgba(255,255,255,.88);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.visual-metric::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -26px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 12px solid rgba(213,166,51,.18);
}

.visual-metric strong {
  display: block;
  color: var(--navy);
  font-size: 36px;
  line-height: 1;
}

.visual-metric small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.visual-metric.navy-block {
  color: #fff;
  background: linear-gradient(135deg, var(--navy), #123f86);
  border-color: transparent;
}

.visual-metric.navy-block span,
.visual-metric.navy-block small,
.visual-metric.navy-block strong {
  color: #fff;
}

.ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side, #fff 70%, transparent 71%),
    conic-gradient(var(--gold) var(--pct), #dfe6f0 0);
}

.ring strong {
  color: var(--navy);
  font-size: 28px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.summary-item {
  min-height: 76px;
  border: 1px solid #e3e9f3;
  border-radius: 4px;
  background: rgba(255,255,255,.84);
  padding: 12px;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.summary-item strong {
  font-size: 14px;
  line-height: 1.45;
}

.journey-line {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 9px;
}

.journey-line::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(8,42,96,.2));
  z-index: -1;
}

.stage {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px;
  background: rgba(255,255,255,.92);
  position: relative;
}

.after-sale-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  margin-top: 14px;
}

.service-record,
.next-action-box {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255,255,255,.92);
  padding: 16px;
}

.record-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 12px;
}

.record-head h3,
.next-action-box h3 {
  margin: 0;
  color: var(--navy);
  font-size: 17px;
}

.record-head span {
  color: var(--muted);
  font-size: 12px;
}

.service-timeline {
  display: grid;
  gap: 0;
}

.timeline-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  position: relative;
  padding: 0 0 18px;
}

.timeline-row:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: #dfe6f0;
}

.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid #cfd8e6;
  position: relative;
  z-index: 1;
}

.timeline-row.done .timeline-dot {
  border-color: var(--green);
}

.timeline-row.current .timeline-dot {
  border-color: var(--gold);
  box-shadow: 0 0 0 6px rgba(213,166,51,.18);
}

.timeline-row.next .timeline-dot {
  border-color: var(--navy-2);
}

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

.timeline-row strong {
  display: block;
  margin-top: 2px;
  color: var(--navy);
  font-size: 15px;
}

.timeline-row p {
  margin: 6px 0 0;
  color: var(--ink);
  line-height: 1.55;
}

.next-action-box {
  background:
    linear-gradient(180deg, rgba(255,247,220,.72), rgba(255,255,255,.94)),
    #fff;
}

.next-action-visual {
  min-height: 92px;
  margin: 12px 0;
  border-radius: 4px;
  border: 1px solid rgba(213,166,51,.45);
  background:
    linear-gradient(135deg, rgba(8,42,96,.92), rgba(15,79,168,.72)),
    url("/assets/highmark-journey-hero.png") center/cover no-repeat;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 900;
}

.stage.done {
  background: #f6fbf8;
  border-color: #a8d9ba;
}

.stage.current {
  background: #fffaf0;
  border-color: var(--gold);
}

.stage-num {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 9px;
  color: var(--muted);
  background: #edf2f7;
  font-size: 12px;
  font-weight: 900;
}

.stage-icon {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(8,42,96,.15);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 9px;
}

.done .stage-num {
  color: #fff;
  background: var(--green);
}

.current .stage-num {
  color: var(--navy);
  background: var(--gold);
}

.stage strong {
  display: block;
  color: var(--navy);
  font-size: 13px;
  line-height: 1.35;
}

.stage span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

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

.info-card {
  padding: 17px;
}

.info-card h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 17px;
}

.visual-card {
  min-height: 236px;
  position: relative;
  overflow: hidden;
  padding-top: 74px;
}

.card-visual {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: #fff7dc;
  border: 1px solid rgba(213,166,51,.45);
  font-weight: 900;
}

.visual-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 58px;
  background: linear-gradient(90deg, rgba(8,42,96,.08), rgba(213,166,51,.14), transparent);
}

.done-card .card-visual { background: #e8f5ee; color: var(--green); }
.action-card .card-visual { background: #fff3de; color: var(--amber); }
.asset-card .card-visual { background: #eaf2ff; color: var(--navy-2); }
.risk-card .card-visual { background: #f4f6fa; color: var(--navy); }

.visual-list {
  display: grid;
  gap: 8px;
}

.visual-chip {
  min-height: 40px;
  border: 1px solid #e2e8f2;
  border-radius: 4px;
  background: #fbfcff;
  padding: 9px 10px 9px 34px;
  line-height: 1.45;
  position: relative;
}

.visual-chip::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 15px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(213,166,51,.16);
}

.signal-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #e2e8f2;
  border-radius: 4px;
  padding: 12px;
  background: #fbfcff;
}

.signal-panel strong {
  color: var(--navy);
  line-height: 1.55;
}

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

.parent-note {
  border-left: 4px solid var(--gold);
  background: #fffaf0;
  border-radius: 0 4px 4px 0;
  padding: 13px 15px;
  color: #4d3a14;
  line-height: 1.75;
}

.coach-console {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, #fff, #f9fbff);
  padding: 18px;
}

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

.console-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
}

.console-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.coach-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.coach-form label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-weight: 900;
  font-size: 13px;
}

.coach-form input,
.coach-form select,
.coach-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}

.coach-form textarea {
  resize: vertical;
}

.coach-form .wide {
  grid-column: span 2;
}

.coach-form small {
  color: var(--muted);
  font-weight: 500;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f6f8fb;
}

.empty {
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  padding: 46px 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  border-radius: 4px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 30;
}

.toast.show {
  display: block;
}

@media (max-width: 1280px) {
  .top-system {
    grid-template-columns: 1fr;
    background-size: 520px auto;
  }

  .system-title {
    border-right: 0;
  }

  .ops-bar,
  .workspace,
  .learner-head,
  .customer-hero {
    grid-template-columns: 1fr;
  }

  .visual-summary,
  .customer-facts,
  .service-order-strip,
  .after-sale-layout,
  .coach-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: calc(100vw - 24px);
    padding-top: 12px;
  }

  .top-system,
  .main,
  .ops-bar,
  .user-bar {
    padding-left: 16px;
    padding-right: 16px;
    margin-left: 0;
    margin-right: 0;
  }

  .brand-logo {
    width: min(300px, 100%);
  }

  .system-title h1 {
    font-size: 26px;
  }

  .upload-row,
  .filters,
  .stats,
  .cards-grid,
  .visual-summary,
  .customer-facts,
  .service-order-strip,
  .after-sale-layout,
  .coach-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .user-bar {
    grid-template-columns: 1fr;
    padding-left: 0;
    padding-right: 0;
  }

  .coach-form .wide {
    grid-column: span 1;
  }

  .file-control,
  .control,
  .button {
    width: 100%;
    min-width: 0;
  }
}
