/* ============================================================
   Champ Tracker — HJproud (Herff Jones Proud) theme
   Tokens pulled from live hjproud.com CSS: navy #2d4788 + royal
   #3d60b8, slate text #56585e, pill buttons, Poppins (free
   stand-in for their licensed Circular Std) + Open Sans body.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Open+Sans:wght@400;600;700&display=swap');

:root {
  --navy: #2d4788;        /* primary brand (hjproud buttons/CTAs) */
  --navy-dark: #22376b;
  --royal: #3d60b8;       /* links, active accents, badges */
  --sky: #4590ca;         /* light inline links */
  --charcoal: #3c3e49;    /* header/footer shell */
  --slate: #56585e;       /* headings + strong text */
  --gold: #f3bb00;        /* star/rating accent */
  --green: #39892f;       /* delivered */
  --brick: #bd2f26;       /* warnings, declines */
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --surface: #eff2f4;     /* pale panel fill (hjproud dropdowns) */
  --hairline: #e4e9f0;
  --border-input: #d0d6e0;
  --text: #3c3e49;
  --text-body: #56585e;
  --text-muted: #7a7e87;
  --display: 'Poppins', 'Segoe UI', Arial, sans-serif;
  --body: 'Open Sans', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4, .display {
  font-family: var(--display);
  color: var(--slate);
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

a { color: var(--royal); text-decoration: none; }
a:hover { color: var(--navy); }

:focus-visible { outline: 2px solid var(--royal); outline-offset: 2px; }

/* eyebrow labels — uppercase Poppins, the one place uppercase lives (hjproud pattern) */
.eyebrow, .field label, .panel-head, .stage-col-head, .contact-line .who,
.activity-item .when, .card-tags {
  font-family: var(--display);
}

/* ---------- header (charcoal shell, royal accent — hjproud footer treatment) ---------- */
.site-header {
  background: var(--charcoal);
  border-bottom: 3px solid var(--royal);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; flex-direction: column; gap: 1px; }
.brand .wordmark {
  font-family: var(--display);
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.brand .tagline {
  font-family: var(--display);
  color: #aabfe8;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.header-actions { display: flex; gap: 12px; align-items: center; }

/* ---------- buttons (hjproud signature: pills, capitalize, navy) ---------- */
.btn {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 10px 24px;
  border-radius: 50px;
  border: 2px solid var(--surface);
  background: var(--surface);
  color: var(--navy);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  display: inline-block;
  text-align: center;
}
.btn:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-inverse { background: transparent; border-color: #fff; color: #fff; }
.btn-inverse:hover { background: #fff; border-color: #fff; color: var(--navy); }
.btn-ghost { background: transparent; border-color: var(--border-input); color: var(--text-body); }
.btn-ghost:hover { background: var(--surface); border-color: var(--border-input); color: var(--navy); }
.btn-brick { background: transparent; border-color: var(--brick); color: var(--brick); }
.btn-brick:hover { background: var(--brick); border-color: var(--brick); color: #fff; }
.btn-sm { padding: 7px 16px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- page scaffolding ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 32px; }
.page--narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 38px; font-weight: 700; }
.page-head .sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.head-rule { width: 56px; height: 4px; background: var(--royal); border-radius: 2px; margin-top: 10px; }

/* ---------- pipeline board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(165px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 16px;
}
.stage-col { background: var(--bg-subtle); border: 1px solid var(--hairline); border-radius: 10px; min-height: 220px; overflow: hidden; }
.stage-col-head {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  background: var(--charcoal);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--royal);
}
.stage-col-head .count {
  background: var(--royal);
  color: #fff;
  font-size: 11px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 11px;
}
.stage-col.delivered .stage-col-head { border-bottom-color: var(--green); }
.stage-col.delivered .stage-col-head .count { background: var(--green); }
.stage-cards { padding: 10px; display: flex; flex-direction: column; gap: 10px; }

.order-card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--royal);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s, transform .1s, box-shadow .15s;
  display: block;
  color: inherit;
}
.order-card:hover {
  border-left-color: var(--navy);
  color: inherit;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(45, 71, 136, .10);
}
.order-card .school {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: var(--slate);
  line-height: 1.3;
}
.order-card .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-tags { font-size: 11.5px; font-weight: 500; color: var(--royal); margin-top: 4px; }
.order-card .row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-card .price { font-weight: 700; color: var(--slate); }
.order-card .due { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.order-card .stale { color: var(--brick); font-size: 11px; margin-top: 6px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.order-card .stale svg { flex: none; }

.empty-col { color: var(--text-muted); font-size: 12px; text-align: center; padding: 18px 8px; }

/* ---------- order detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
.panel + .panel { margin-top: 20px; }
.panel-head {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate);
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-body { padding: 18px; }
.form-footer { border-top: 1px solid var(--hairline); display: flex; gap: 12px; justify-content: flex-end; padding: 18px; }

/* stage stepper */
.stepper { display: flex; gap: 0; }
.step {
  flex: 1; text-align: center; position: relative; padding: 14px 4px 10px;
  cursor: pointer; border: none; background: none; font: inherit;
  border-bottom: 3px solid var(--hairline);
}
.step .dot {
  width: 28px; height: 28px; margin: 0 auto 8px;
  border: 2px solid var(--border-input); background: #fff; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 12px; font-weight: 600;
  border-radius: 50%;
}
.step .lbl { font-family: var(--display); font-size: 10.5px; font-weight: 500; letter-spacing: .2px; color: var(--text-muted); display: block; }
.step.done { border-bottom-color: var(--navy); }
.step.done .dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.step.done .lbl { color: var(--navy); }
.step.current { border-bottom-color: var(--royal); }
.step.current .dot { background: var(--royal); border-color: var(--royal); color: #fff; }
.step.current .lbl { color: var(--royal); font-weight: 600; }
.step:hover .lbl { color: var(--navy); }

/* forms */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.label-hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.field input, .field select, .field textarea, .login-card input {
  width: 100%;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  padding: 9px 12px;
  font-family: var(--body);
  font-size: 14px;
  color: var(--text);
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus, .login-card input:focus {
  outline: none;
  border-color: var(--royal);
  box-shadow: 0 0 0 1px var(--royal);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* one-time first-login tour */
#tour-overlay { position: fixed; inset: 0; background: transparent; z-index: 300; }
#tour-overlay.dim { background: rgba(20, 24, 38, .55); }  /* used when no element is spotlighted */
#tour-spot {
  position: fixed; display: none; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(20, 24, 38, .55), 0 0 0 3px var(--royal);
  background: transparent; transition: all .25s ease;
}
#tour-card {
  position: fixed; left: 50%; transform: translateX(-50%); top: 20%;
  width: min(480px, calc(100vw - 32px));
  background: #fff; border-radius: 12px; border-top: 4px solid var(--royal);
  padding: 22px 24px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); z-index: 301;
}
#tour-step-label { font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); }
#tour-card h2 { font-size: 19px; margin: 6px 0 8px; }
#tour-card p { font-size: 14px; line-height: 1.65; color: var(--text-body); }
#tour-controls { display: flex; gap: 8px; align-items: center; margin-top: 16px; }

/* email previews panel */
.email-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.email-tab {
  font-family: var(--display); font-size: 12px; font-weight: 600;
  padding: 6px 13px; border-radius: 50px; border: 1px solid var(--border-input);
  background: #fff; color: var(--text-body); cursor: pointer; white-space: nowrap;
}
.email-tab:hover { border-color: var(--royal); color: var(--royal); }
.email-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.email-meta { font-size: 13px; color: var(--text-body); margin-bottom: 10px; line-height: 1.6; }
.email-meta .subj { font-weight: 700; color: var(--text); }
.email-meta .to { color: var(--text-muted); }
.email-meta .chip {
  display: inline-block; font-family: var(--display); font-size: 10.5px; font-weight: 600;
  letter-spacing: .5px; padding: 2px 9px; border-radius: 50px; margin-left: 4px;
}
.email-meta .chip.on { background: #e7f0e7; color: #2f6b2f; }
.email-meta .chip.off { background: #fbe9e7; color: var(--brick); }
.email-frame { width: 100%; height: 600px; border: 1px solid var(--hairline); border-radius: 8px; background: #f4f6f9; }

/* ring price math: unit × students = total */
.price-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.price-grid .field { margin-bottom: 0; }
.price-x {
  font-family: var(--display);
  font-size: 18px;
  color: var(--text-muted);
  padding-bottom: 9px;
  text-align: center;
}
input.auto-total {
  background: var(--bg-subtle);
  border-color: var(--royal) !important;
  color: var(--navy);
  font-weight: 700;
}

/* artwork */
.artwork-drop {
  border: 2px dashed var(--border-input);
  border-radius: 10px;
  background: var(--bg-subtle);
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--display);
  font-weight: 500;
}
.artwork-drop:hover, .artwork-drop.drag { border-color: var(--royal); color: var(--navy); }
.artwork-preview { background: var(--charcoal); text-align: center; padding: 14px; }
.artwork-preview img { max-width: 100%; max-height: 420px; }
.sketch-preview { background: var(--bg-subtle); text-align: center; padding: 14px; border-bottom: 1px solid var(--hairline); }
.sketch-preview img { max-width: 100%; max-height: 380px; border-radius: 6px; }
.artwork-file { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; gap: 10px; }
.artwork-file svg { flex: none; vertical-align: -2px; margin-right: 4px; }

/* contacts + activity */
.contact-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: 13.5px; align-items: baseline; gap: 10px; }
.contact-line:last-child { border-bottom: none; }
.contact-line .who { text-transform: uppercase; letter-spacing: .8px; font-size: 10.5px; font-weight: 600; color: var(--text-muted); }
.contact-line .email { color: var(--text); }
.activity-item { padding: 10px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.activity-item:last-child { border-bottom: none; }
.activity-item .when { color: var(--text-muted); font-size: 10.5px; font-weight: 500; letter-spacing: .3px; text-transform: uppercase; }
.activity-item.email-ok { border-left: 3px solid var(--royal); padding-left: 10px; }
.activity-item.email-fail { border-left: 3px solid var(--brick); padding-left: 10px; }

/* badges / pills */
.pill {
  display: inline-block;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .5px;
  padding: 4px 14px;
  border-radius: 50px;
  background: var(--navy);
  color: #fff;
}
.pill.delivered { background: var(--green); }
.rev-badge {
  display: inline-block;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--brick);
  color: #fff;
}
.hint-chip {
  display: inline-block;
  font-size: 10.5px;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--brick);
  border: 1px solid var(--brick);
  border-radius: 50px;
  padding: 2px 10px;
  margin-left: 10px;
  text-transform: none;
}

/* toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--charcoal); color: #fff; padding: 12px 26px;
  font-family: var(--display); font-size: 13px; font-weight: 500;
  border-left: 3px solid var(--royal); border-radius: 8px;
  transition: transform .25s; z-index: 100; max-width: calc(100% - 28px);
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.err { border-left-color: var(--brick); }

/* login / password overlay */
#login-overlay {
  position: fixed; inset: 0; background: rgba(20, 24, 38, .94); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.login-card { background: #fff; padding: 40px; width: 380px; text-align: center; border-top: 4px solid var(--royal); border-radius: 10px; }
.login-brand { font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: 3px; color: var(--charcoal); }
.login-sub { font-family: var(--display); font-size: 11px; font-weight: 500; letter-spacing: 2px; color: var(--text-muted); text-transform: uppercase; margin: 4px 0 22px; }
.login-card input { margin-bottom: 12px; text-align: left; }
.login-card .btn { width: 100%; }
.login-err { color: var(--brick); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* signed-in user chip */
.user-wrap { display: inline-flex; gap: 10px; align-items: center; }
.user-chip {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  color: #fff;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--royal);
  padding: 4px 2px;
  cursor: pointer;
}
.user-chip:hover { color: #aabfe8; border-bottom-color: #aabfe8; }

/* misc */
.muted { color: var(--text-muted); }
.muted-sm { color: var(--text-muted); font-size: 13px; }
.banner-warn {
  background: var(--bg-subtle); border: 1px solid var(--hairline); border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 10px 16px; font-size: 13px; color: var(--text-body); margin-bottom: 20px;
}
.banner-error {
  background: #fbe9e7; border: 1px solid #f3c7c0; border-left: 3px solid var(--brick);
  border-radius: 8px;
  padding: 11px 16px; font-size: 13px; color: #7a241c; margin-bottom: 20px; line-height: 1.5;
}

/* email-delivery flag on board cards */
.order-card.has-email-err { border-left-color: var(--brick); }
.email-flag { color: var(--brick); font-size: 11px; margin-top: 6px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.email-flag svg { flex: none; }
.back-link { font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: .5px; color: var(--royal); }
.back-link:hover { color: var(--navy); }

@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(7, 220px); }
}

/* ============================================================
   Mobile — board stacks into stage sections, everything one column
   ============================================================ */
@media (max-width: 768px) {
  .site-header { padding: 0 12px; height: 56px; gap: 8px; }
  .brand { flex: none; }
  .brand .wordmark { font-size: 15px; letter-spacing: 1.5px; white-space: nowrap; }
  .brand .tagline { display: none; }
  .header-actions { gap: 6px; flex-wrap: nowrap; }
  .header-actions .btn { padding: 6px 11px; font-size: 11px; white-space: nowrap; }
  .user-chip { font-size: 11px; white-space: nowrap; }
  .hide-mobile { display: none; }

  .page { padding: 16px 14px 40px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 26px; }
  .page-head .sub { font-size: 13px; }

  /* board: vertical stage sections instead of 7 columns */
  .board { display: block; overflow-x: visible; }
  .stage-col { min-height: 0; margin-bottom: 12px; }
  .stage-col-head { font-size: 12px; padding: 11px 14px; }
  .stage-cards { padding: 10px; gap: 8px; }
  .stage-col.is-empty .stage-cards { display: none; }   /* collapse empty stages to just their header */
  .stage-col.is-empty { opacity: .65; }
  .order-card { padding: 14px; }                        /* bigger touch target */
  .order-card .school { font-size: 16px; }

  /* order detail */
  .detail-grid { grid-template-columns: 1fr; gap: 16px; }
  .panel-head { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .panel-body { padding: 14px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .price-grid { grid-template-columns: 1fr; gap: 0; }
  .price-grid .field { margin-bottom: 14px; }
  .price-x { display: none; }
  .field input, .field select, .field textarea, .login-card input { font-size: 16px; padding: 11px 12px; } /* 16px stops iOS zoom-on-focus */
  .btn { padding: 11px 20px; }
  .btn-sm { padding: 8px 14px; }

  /* stepper: swipe horizontally */
  .stepper { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .step { min-width: 86px; padding: 12px 4px 10px; }
  .step .lbl { font-size: 9.5px; }

  .artwork-drop { padding: 22px 14px; }
  #toast { width: calc(100% - 28px); text-align: center; }
  .login-card { width: calc(100% - 32px); padding: 30px 22px; }
}
