/* ============================================================================
   My Progress — the student's placement portfolio hub (#section-my-progress):
   completion overview + attendance history + portfolio export. Rendered by
   app.js loadMyProgress/renderMyProgress. Neutral palette biased to the app's
   navy/teal; works on web and native.
   ============================================================================ */

.mp-header {
  margin: 0 0 16px;
}
.mp-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #16233f;
}
.mp-header .card-subtitle {
  margin: 4px 0 0;
  color: #5d6b84;
}

/* ---- completion overview -------------------------------------------------- */
.mp-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.mp-loading,
.mp-empty {
  grid-column: 1 / -1;
  padding: 22px 4px;
  color: #6b7890;
  font-size: 0.95rem;
}
.mp-stat {
  border: 1px solid #e6ebf3;
  border-radius: 14px;
  padding: 14px 15px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}
.mp-stat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.mp-stat-label {
  font-size: 12.5px;
  font-weight: 500;
  color: #5d6b84;
  letter-spacing: 0.01em;
}
.mp-stat-val {
  font-size: 20px;
  font-weight: 600;
  color: #16233f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mp-stat-total {
  color: #9aa6bd;
  font-weight: 600;
  font-size: 15px;
}
.mp-bar {
  height: 7px;
  border-radius: 999px;
  background: #eef1f7;
  overflow: hidden;
}
.mp-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 480ms cubic-bezier(0.22, 1, 0.36, 1);
}
.mp-stat-sub {
  font-size: 12.5px;
  color: #8a97ad;
}

/* ---- attendance record ---------------------------------------------------- */
.mp-block {
  margin-top: 6px;
}
.mp-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 10px;
}
.mp-block-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #16233f;
}
.mp-att-summary {
  font-size: 12.5px;
  font-weight: 600;
  color: #5d6b84;
  font-variant-numeric: tabular-nums;
}
.mp-att-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e6ebf3;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.mp-att-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-top: 1px solid #eef1f7;
}
.mp-att-row:first-child {
  border-top: none;
}
.mp-att-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mp-att-title {
  font-weight: 600;
  color: #16233f;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-att-date {
  font-size: 12.5px;
  color: #8a97ad;
  font-variant-numeric: tabular-nums;
}
.mp-att-badge {
  flex: none;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.mp-att-badge.is-in {
  background: #dcfce7;
  color: #15803d;
}
.mp-att-badge.is-ex {
  background: #fef3c7;
  color: #b45309;
}
.mp-att-badge.is-miss {
  background: #fee2e2;
  color: #b91c1c;
}
.mp-att-badge.is-pending {
  background: #eef2ff;
  color: #4f46e5;
}
.mp-att-actions {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-direction: column;
}
.mp-att-report {
  appearance: none;
  border: 0;
  background: transparent;
  color: #2459a9;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.mp-att-empty {
  padding: 18px 15px;
  color: #8a97ad;
  font-size: 0.92rem;
}

.mp-att-issue-dialog {
  width: min(94vw, 520px);
  max-height: min(88vh, 720px);
  border: 0;
  border-radius: 20px;
  padding: 0;
  color: #16233f;
  box-shadow: 0 30px 80px rgba(15, 32, 66, 0.28);
}
.mp-att-issue-dialog::backdrop {
  background: rgba(15, 25, 48, 0.5);
  backdrop-filter: blur(3px);
}
.mp-att-issue-card {
  padding: 22px;
}
.mp-att-issue-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.mp-att-issue-head h3,
.mp-att-issue-head p {
  margin: 0;
}
.mp-att-issue-head > div > p:last-child {
  margin-top: 4px;
  color: #64718a;
  font-size: 13px;
}
.mp-att-issue-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #f3f6fa;
  color: #52617a;
  font-size: 24px;
  cursor: pointer;
}
.mp-att-issue-field {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  font-size: 13px;
  font-weight: 600;
}
.mp-att-issue-field select,
.mp-att-issue-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d9e0eb;
  border-radius: 11px;
  background: #fff;
  color: #16233f;
  font: inherit;
  font-weight: 500;
  padding: 11px 12px;
}
.mp-att-issue-note,
.mp-att-issue-status {
  color: #64718a;
  font-size: 12.5px;
  line-height: 1.45;
}
.mp-att-issue-status {
  min-height: 18px;
  color: #b42318;
}
.mp-att-issue-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}

@media (max-width: 560px) {
  .mp-att-row {
    align-items: flex-start;
  }
  .mp-att-issue-dialog {
    width: calc(100vw - 20px);
    margin: auto 10px 10px;
  }
  .mp-att-issue-actions .btn {
    flex: 1;
  }
}

/* ---- export --------------------------------------------------------------- */
.mp-export {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #eef1f7;
}
.mp-export-btn {
  width: 100%;
}
.mp-export-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: #8a97ad;
  text-align: center;
}

@media (min-width: 720px) {
  .mp-overview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .mp-export-btn {
    width: auto;
  }
  .mp-export {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .mp-export-note {
    margin: 0;
    text-align: left;
  }
}

/* Today ledger → My Progress entry point (the sign-off completion stat is a
   link into #section-my-progress). Keep it looking like the stat, not a link. */
a.tm-ledge-stat--link {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.tm-ledge-stat--link:active {
  opacity: 0.7;
}

/* ============================================================
   Obs Chart — mobile layer. The section plots the placement as
   a clinical chart (cumulative school-approved sign-offs), then
   Settings-grammar grouped cards. Desktop (>768px) keeps the
   original overview; these nodes hide there.
   Accent (per hospital) arrives as --mpc-accent* on the section.
   ============================================================ */

/* Always-on eyebrow (also used by the attendance-correction dialog). */
.mpc-eyebrow {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a97ad;
  margin: 0;
}

/* Injected mobile nodes are hidden on desktop; the overview shows instead. */
#mp-doc,
#mpc-signoffs,
#mpc-selfdecl,
#mpc-att-kick,
#mpc-exp-kick {
  display: none;
}

@media (max-width: 768px) {
  #mp-doc,
  #mpc-signoffs,
  #mpc-selfdecl { display: block; }
  #mpc-att-kick,
  #mpc-exp-kick { display: flex; }

  #section-my-progress .mp-overview { display: none; }
  #section-my-progress > .mp-export-note { display: none; }
  #section-my-progress .mp-block-head h3 { display: none; }

  /* ---- hero: the chart card ---- */
  .mpc-hero {
    background: #fff;
    border: 1px solid #e9edf4;
    border-radius: 18px;
    padding: 17px 16px 15px;
    box-shadow: 0 16px 38px -24px rgba(8, 31, 71, 0.4);
    margin-bottom: 14px;
  }
  .mpc-eyebrow--dot { display: flex; align-items: center; gap: 6px; }
  .mpc-eyebrow--dot::before {
    content: "";
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--mpc-accent, #3fc1b4);
  }
  /* Identity header doubles as a tap target into the placement's details. */
  .mpc-idlink {
    display: flex; align-items: center; gap: 10px;
    width: 100%; text-align: left;
    padding: 0; border: 0; background: none; color: inherit;
    font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .mpc-idlink:active { opacity: 0.65; }
  .mpc-idlink-main { flex: 1 1 auto; min-width: 0; }
  .mpc-idlink .mpc-title,
  .mpc-idlink .mpc-sub { display: block; }
  .mpc-idlink-chev {
    flex: 0 0 auto; font-size: 22px; line-height: 1;
    color: #c2ccdb; margin-top: 2px;
  }
  .mpc-title {
    font-size: 19px; font-weight: 600; letter-spacing: -0.02em;
    color: #16233f; margin: 7px 0 0; line-height: 1.2;
  }
  .mpc-sub {
    font-size: 12.5px; color: #5d6b84; margin: 4px 0 0;
    font-variant-numeric: tabular-nums;
  }

  .mpc-chartwrap {
    display: block; width: 100%; margin: 13px 0 0;
    padding: 0; border: 0; background: none; cursor: pointer;
  }
  .mpc-chartwrap:active { opacity: 0.85; }
  .mpc-chart { width: 100%; height: auto; display: block; }
  .mpc-chart-loading { display: block; padding: 34px 0; color: #8a97ad; font-size: 12.5px; }

  .mpc-grid { stroke: #f1f4f9; stroke-width: 1; }
  .mpc-ylab { font-size: 7px; font-weight: 600; fill: #b3bfd2; text-anchor: end; }
  .mpc-xlab { font-size: 7px; font-weight: 600; letter-spacing: 0.06em; fill: #b3bfd2; text-anchor: middle; }
  .mpc-now { stroke: var(--mpc-accent, #3fc1b4); stroke-width: 1.4; opacity: 0.5; }
  .mpc-dest { fill: none; stroke: #cdd7e6; stroke-width: 1.5; stroke-dasharray: 3 3; }
  .mpc-trace {
    fill: none; stroke: #22345c; stroke-width: 2.2;
    stroke-linejoin: round; stroke-linecap: round;
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: mpc-draw 720ms cubic-bezier(0.22, 1, 0.36, 1) 150ms forwards;
  }
  @keyframes mpc-draw { to { stroke-dashoffset: 0; } }
  .mpc-dot { fill: #22345c; }
  .mpc-plab { font-size: 7.5px; font-weight: 600; letter-spacing: 0.04em; fill: #8a97ad; text-anchor: middle; }
  .mpc-endring { fill: none; stroke: var(--mpc-accent, #3fc1b4); stroke-width: 1.8; }
  .mpc-endcore { fill: #22345c; }
  .mpc-mark { opacity: 0; animation: mpc-fade 280ms ease 640ms forwards; }
  @keyframes mpc-fade { to { opacity: 1; } }

  .mpc-truth {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 8px;
    margin-top: 13px;
  }
  .mpc-count {
    font-size: 15px; font-weight: 600; letter-spacing: -0.015em; color: #16233f;
    font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .mpc-verdict {
    align-self: center;
    display: inline-flex; align-items: center;
    border-radius: 999px; min-height: 23px; padding: 0 10px;
    font-size: 11.5px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap;
  }
  .mpc-verdict--accent {
    background: var(--mpc-accent-bg, #e2f5f3);
    color: var(--mpc-accent-ink, #2f8285);
  }
  .mpc-verdict--navy { background: #e9edf6; color: #22345c; }
  .mpc-verdict--mist { background: #f1f4f9; color: #5d6b84; }
  .mpc-waitchip {
    margin-left: auto; align-self: center;
    border-radius: 999px; background: #f1f4f9; color: #5d6b84;
    font-size: 11.5px; font-weight: 500; min-height: 28px; padding: 5px 11px;
    white-space: nowrap; text-decoration: none;
  }
  .mpc-strip {
    margin: 11px 0 0;
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: #8a97ad;
    font-variant-numeric: tabular-nums;
  }
  .mpc-strip:empty { display: none; }
  .mpc-nextpill {
    display: inline-flex; align-items: center; margin-top: 12px;
    min-height: 34px; padding: 0 15px; border-radius: 999px;
    background: var(--mpc-accent-bg, #e2f5f3); color: var(--mpc-accent-ink, #2f8285);
    font-size: 13px; font-weight: 500; letter-spacing: -0.01em;
    text-decoration: none;
  }
  .mpc-nextpill:active { transform: scale(0.97); }

  /* ---- section kickers ---- */
  .mpc-sect {
    display: flex; align-items: center; gap: 6px;
    min-height: 30px; padding: 12px 2px 6px;
    font-size: 10px; font-weight: 500; letter-spacing: 0.08em;
    text-transform: uppercase; color: #8a97ad;
  }
  .mpc-sect-glyph {
    width: 12px; height: 12px; flex: none; border-radius: 50%;
    border: 1.5px solid #22345c; position: relative;
  }
  .mpc-sect-glyph::after {
    content: ""; position: absolute; inset: 2.6px; border-radius: 50%;
    border: 1px solid #22345c;
  }
  .mpc-sect b {
    margin-left: auto; color: #16233f; font-size: 11px; letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
  }
  .mpc-sect b:empty { display: none; }

  /* ---- grouped cards ---- */
  .mpc-card { margin-bottom: 4px; }
  .mpc-group {
    background: #fff; border: 1px solid #e9edf4; border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(20, 33, 64, 0.04), 0 2px 8px rgba(20, 33, 64, 0.05);
  }
  .mpc-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px; text-decoration: none;
  }
  .mpc-row + .mpc-row,
  .mpc-caption + .mpc-row { border-top: 1px solid #f1f4f9; }
  .mpc-row-main { flex: 1; min-width: 0; }
  .mpc-row-t {
    font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: #16233f;
    overflow: hidden; text-overflow: ellipsis;
  }
  .mpc-row-s {
    font-size: 12px; color: #8a97ad; margin-top: 2.5px; line-height: 1.45;
    font-variant-numeric: tabular-nums;
  }
  .mpc-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
  .mpc-count-sm { font-size: 12px; font-weight: 600; color: #8a97ad; font-variant-numeric: tabular-nums; }

  .mpc-st {
    display: inline-flex; align-items: center; flex: none;
    border-radius: 6px; padding: 3.5px 8px;
    font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
    white-space: nowrap;
  }
  .mpc-st--approved { background: #e9edf6; color: #22345c; }
  .mpc-st--school { background: #f1f4f9; color: #5d6b84; }
  .mpc-st--todo { background: #fff; color: #8a97ad; border: 1px solid #d3dae6; }
  .mpc-st--returned { background: #faeae8; color: #c23b2f; }

  .mpc-pill {
    display: inline-flex; align-items: center; flex: none;
    min-height: 34px; padding: 0 15px; border: 0; border-radius: 999px;
    font-size: 12.5px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap;
    cursor: pointer; text-decoration: none;
  }
  .mpc-pill:active { transform: scale(0.97); }
  .mpc-pill--accent { background: var(--mpc-accent-bg, #e2f5f3); color: var(--mpc-accent-ink, #2f8285); }
  .mpc-pill--purple { background: #f1edfc; color: #7c5cd6; }
  .mpc-pill--plan { background: #f1f4f9; color: #5d6b84; }

  .mpc-row--foot { min-height: 44px; }
  .mpc-row--foot .mpc-row-t { font-size: 13.5px; color: #22345c; }
  .mpc-arrow { margin-left: auto; color: #8a97ad; font-size: 16px; font-weight: 600; }
  .mpc-row--more { padding: 11px 14px; }
  .mpc-row--more span { font-size: 12px; color: #8a97ad; }

  .mpc-caption {
    padding: 11px 14px; font-size: 12px; color: #5d6b84; line-height: 1.5;
    background: #fbfcfe;
  }
  .mpc-meter { display: flex; gap: 3px; margin-top: 7px; max-width: 156px; }
  .mpc-meter i { flex: 1; height: 5px; border-radius: 3px; background: #e8ecf4; }
  .mpc-meter i.on { background: #7c5cd6; }

  /* ---- attendance register: re-dress the shared list as a grouped card ---- */
  #section-my-progress .mp-block { margin-top: 0; margin-bottom: 4px; }
  #section-my-progress .mp-block-head {
    margin: 0 2px 6px; min-height: 20px;
  }
  #section-my-progress .mp-att-summary { font-size: 12px; color: #5d6b84; }
  .mp-att-list {
    border: 1px solid #e9edf4; border-radius: 16px;
    box-shadow: 0 1px 2px rgba(20, 33, 64, 0.04), 0 2px 8px rgba(20, 33, 64, 0.05);
  }
  .mp-att-row { padding: 13px 14px; border-top-color: #f1f4f9; }
  .mp-att-title { font-size: 14px; font-weight: 600; }
  .mp-att-badge {
    font-size: 10px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
    border-radius: 6px; padding: 3.5px 8px;
  }
  .mp-att-badge.is-in { background: #e4f5eb; color: #1a9e54; }
  .mp-att-badge.is-ex { background: #fdf1df; color: #b96f0c; }
  .mp-att-badge.is-miss { background: #faeae8; color: #c23b2f; }
  .mp-att-badge.is-pending { background: #f1f4f9; color: #5d6b84; }
  .mp-att-report {
    text-decoration: none;
    border: 1px solid #e9edf4; border-radius: 999px;
    color: #8a97ad; font-size: 12px; font-weight: 600;
    min-height: 30px; padding: 5px 12px;
  }

  /* ---- portfolio export ---- */
  .mp-export.mpc-export {
    margin-top: 0; padding-top: 0; border-top: 0;
  }
  .mpc-export .mp-export-btn {
    width: 100%;
    background: #16233f; border: 0; border-radius: 999px;
    min-height: 44px; font-weight: 600;
  }
  .mpc-export .mp-export-note { text-align: left; }

  /* ---- audit sheet rows (reuses the shared .pp-sheet) ---- */
  .mp-audit-note { font-size: 12px; color: #8a97ad; margin: 2px 0 8px; line-height: 1.5; }
  .mp-audit-row { padding: 10px 0; border-bottom: 1px solid #f2f5fa; }
  .mp-audit-row:last-child { border-bottom: 0; }
  .mp-audit-row b { font-size: 13.5px; color: #16233f; font-variant-numeric: tabular-nums; }
  .mp-audit-row p { font-size: 11.5px; color: #8a97ad; margin: 3px 0 0; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  .mpc-trace { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
  .mpc-mark { animation: none; opacity: 1; }
  .mpc-pill:active,
  .mpc-nextpill:active { transform: none; }
}
