/* ---------------------------------------------------------------------------
   Consultation prep briefing — anne healthcare house-style demo.
   Self-contained stylesheet. Tokens match the bloods tool and hub page.
--------------------------------------------------------------------------- */

:root {
  --cta:            #1a67cc;
  --cta-dark:       #14509f;
  --accent:         #18d6c4;
  --accent-dark:    #13a89a;
  --cream:          #f4eed7;
  --cream-border:   #e9ddaf;
  --cool:           #e5eef8;
  --cool-border:    #bdd4ed;
  --dark:           #333;
  --grey:           #4d4d4d;
  --grey-soft:      #676767;
  --grey-line:      #e0e0e0;
  --light:          #fff;
  --danger:         #c12727;

  --amber:          #d4930a;
  --amber-bg:       #fff8e1;
  --amber-border:   #ffe082;
  --red-bg:         #fff5f5;
  --red-border:     #f5c7c7;
  --green:          #2e7d32;
  --green-bg:       #e8f5e9;
  --green-border:   #c8e6c9;

  --font-heading:   "Inter", system-ui, sans-serif;
  --font-body:      "DM Sans", system-ui, sans-serif;

  --radius-sm:      0.5rem;
  --radius-md:      1.5rem;
  --radius-pill:    100em;
  --shadow-soft:    0 3px 6px 0 rgba(0, 0, 0, 0.06);
  --shadow-lift:    0 12px 32px -16px rgba(20, 80, 159, 0.22),
                    0  3px  6px  0   rgba(0, 0, 0, 0.06);

  --content-max:    112rem;
  --gutter:         clamp(2rem, 5vw, 6rem);
}

/* 10px rem base */
html { font-size: 62.5%; -webkit-text-size-adjust: 100%; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--light);
  color: var(--dark);
  font-family: var(--font-body);
  font-size: 1.6rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(ellipse 90rem 50rem at 8% -10%,  rgba(229, 238, 248, 0.9), transparent 60%),
    radial-gradient(ellipse 70rem 40rem at 100% 5%,  rgba(244, 238, 215, 0.65), transparent 55%);
  background-repeat: no-repeat;
}

a { color: var(--cta); text-decoration: none; }
a:hover { color: var(--cta-dark); text-decoration: underline; }


/* --- Skip link ------------------------------------------------------------ */

.skip-link {
  position: absolute; left: -9999px;
  background: var(--cta); color: var(--light);
  padding: 1rem 1.6rem; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; }


/* --- Header --------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.4rem var(--gutter);
  max-width: var(--content-max);
  margin: 0 auto;
}
.brand { display: inline-flex; }
.brand img { height: 3.6rem; width: auto; display: block; }

.brand-group { display: flex; flex-direction: column; gap: 0.6rem; }
.back-links { display: flex; gap: 1.2rem; }


.back-link {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--grey-soft);
  text-decoration: none;
}
.back-link:hover { color: var(--cta); text-decoration: none; }

.chip {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  background: var(--cream);
  color: var(--cta-dark);
  border: 1px solid var(--cream-border);
  white-space: nowrap;
}


/* --- Main layout ---------------------------------------------------------- */

main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem var(--gutter) 8rem;
}


/* --- Schedule view (today's consultations) -------------------------------- */

.schedule {
  max-width: 72rem;
}

.schedule__date {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cta);
  margin: 0 0 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}
.schedule__date::before {
  content: "";
  width: 2.4rem;
  height: 0.2rem;
  background: var(--accent);
  border-radius: 2px;
  display: inline-block;
}

.schedule h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(3.2rem, 4.5vw, 5.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1.2rem;
  color: var(--dark);
}

.schedule__sub {
  font-size: 1.7rem;
  color: var(--grey);
  margin: 0 0 3.6rem;
  max-width: 52rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.slot {
  background: var(--light);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 2rem 2.4rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.slot::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0.4rem;
  background: var(--cta);
}
.slot:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
.slot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 103, 204, 0.18);
}

.slot--amber::before { background: var(--amber); }
.slot--red::before { background: var(--danger); }
.slot--green::before { background: var(--accent-dark); }

.slot__time {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2rem;
  color: var(--cta);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 5.6rem;
}
.slot--amber .slot__time { color: var(--amber); }
.slot--red .slot__time { color: var(--danger); }

.slot__info { flex: 1; min-width: 0; }
.slot__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--dark);
  margin: 0;
  line-height: 1.25;
}
.slot__type {
  font-size: 1.3rem;
  color: var(--grey-soft);
  margin: 0.2rem 0 0;
}

.slot__arrow {
  color: var(--grey-line);
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}
.slot:hover .slot__arrow {
  color: var(--cta);
  transform: translateX(2px);
}

/* Slot alert dots */
.slot__alerts {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.slot__dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
}
.slot__dot--red { background: var(--danger); }
.slot__dot--amber { background: var(--amber); }


/* --- Briefing layout ------------------------------------------------------ */

.briefing {
  opacity: 0;
  animation: brief-in 0.4s cubic-bezier(.22, 1, .36, 1) forwards;
}
@keyframes brief-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .briefing { animation: none; opacity: 1; }
}

.briefing__back {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--grey-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.4rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.briefing__back:hover { color: var(--cta); }


/* --- Member header -------------------------------------------------------- */

.member-header {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  margin-bottom: 2.8rem;
  flex-wrap: wrap;
}

.member-avatar {
  width: 7.2rem;
  height: 7.2rem;
  border-radius: 50%;
  background: var(--cool);
  border: 2px solid var(--cool-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 2.4rem;
  color: var(--cta);
}

.member-info { flex: 1; min-width: 0; }
.member-info__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(2.6rem, 3.2vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--dark);
  margin: 0 0 0.4rem;
}
.member-info__meta {
  font-size: 1.5rem;
  color: var(--grey-soft);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
}
.member-info__meta span { white-space: nowrap; }

.member-info__meta .sep {
  color: var(--grey-line);
}


/* --- At a glance strip ---------------------------------------------------- */

.glance {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
  margin-bottom: 2.8rem;
}
@media (max-width: 860px) {
  .glance { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .glance { grid-template-columns: 1fr; }
}

.glance-card {
  border-radius: var(--radius-md);
  padding: 1.6rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1px solid transparent;
  box-shadow: var(--shadow-soft);
}
.glance-card--cool {
  background: var(--cool);
  border-color: var(--cool-border);
}
.glance-card--cream {
  background: var(--cream);
  border-color: var(--cream-border);
}
.glance-card--green {
  background: var(--green-bg);
  border-color: var(--green-border);
}
.glance-card--accent {
  background: rgba(24, 214, 196, 0.1);
  border-color: rgba(24, 214, 196, 0.3);
}

.glance-card__label {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-soft);
}
.glance-card__value {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--dark);
  line-height: 1.3;
}


/* --- Alerts / flags ------------------------------------------------------- */

.alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.8rem;
}

.alert-badge {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1;
}
.alert-badge--red {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--danger);
}
.alert-badge--amber {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber);
}

.alert-badge__dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.alert-badge--red .alert-badge__dot { background: var(--danger); }
.alert-badge--amber .alert-badge__dot { background: var(--amber); }


/* --- Section headings ----------------------------------------------------- */

.section-heading {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-soft);
  margin: 0 0 1.2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--grey-line);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.section-heading::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.section-heading:first-of-type {
  border-top: none;
  padding-top: 0;
}


/* --- Card wrapper for sections -------------------------------------------- */

.brief-card {
  background: var(--light);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 2rem 2.4rem;
  margin-bottom: 2.4rem;
}


/* --- Medications table ---------------------------------------------------- */

.med-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.4rem;
}
.med-table thead {
  border-bottom: 1px solid var(--grey-line);
}
.med-table th {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-soft);
  padding: 0.8rem 1.2rem 0.8rem 0;
  text-align: left;
  white-space: nowrap;
}
.med-table td {
  padding: 1rem 1.2rem 1rem 0;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
  color: var(--dark);
}
.med-table tbody tr:last-child td {
  border-bottom: none;
}
.med-table .med-name {
  font-weight: 600;
}
.med-table .med-changed {
  font-size: 1.2rem;
  color: var(--grey-soft);
}


/* --- Blood results table -------------------------------------------------- */

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.4rem;
}
.results-table thead {
  border-bottom: 1px solid var(--grey-line);
}
.results-table th {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-soft);
  padding: 0.8rem 1.2rem 0.8rem 0;
  text-align: left;
  white-space: nowrap;
}
.results-table td {
  padding: 1rem 1.2rem 1rem 0;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
  color: var(--dark);
}
.results-table tbody tr:last-child td {
  border-bottom: none;
}
.results-table .marker-name {
  font-weight: 500;
}
.results-table .marker-value {
  font-family: var(--font-heading);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.results-table .ref-range {
  color: var(--grey-soft);
  font-size: 1.3rem;
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  vertical-align: middle;
}
.status-dot--green { background: var(--green); box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15); }
.status-dot--amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(212, 147, 10, 0.15); }
.status-dot--red   { background: var(--danger); box-shadow: 0 0 0 3px rgba(193, 39, 39, 0.15); }


/* --- Last consultation notes ---------------------------------------------- */

.consult-notes { margin-bottom: 2.4rem; }

.consult-notes__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  font-size: 1.3rem;
  color: var(--grey-soft);
  margin-bottom: 1rem;
}
.consult-notes__meta strong {
  color: var(--dark);
  font-weight: 600;
}

.consult-notes__text {
  font-size: 1.5rem;
  color: var(--grey);
  line-height: 1.6;
  margin: 0;
}


/* --- Outstanding actions -------------------------------------------------- */

.actions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.action-item {
  font-size: 1.5rem;
  color: var(--dark);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.8rem 0;
  line-height: 1.4;
}

.action-check {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
  border: 1.5px solid var(--grey-line);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}
.action-check--done {
  background: var(--accent);
  border-color: var(--accent-dark);
}
.action-check--done svg {
  display: block;
}
.action-item--done {
  color: var(--grey-soft);
  text-decoration: line-through;
  text-decoration-color: var(--grey-line);
}

.action-item__text { flex: 1; }
.action-item__tag {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  margin-left: 0.4rem;
}
.action-item__tag--overdue {
  background: var(--red-bg);
  color: var(--danger);
}
.action-item__tag--pending {
  background: var(--amber-bg);
  color: var(--amber);
}


/* --- Action buttons ------------------------------------------------------- */

.brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 3.2rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--grey-line);
}

.btn {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  padding: 1.2rem 2.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--cta);
  color: var(--light);
  box-shadow: 0 4px 12px -4px rgba(26, 103, 204, 0.4);
}
.btn--primary:hover {
  background: var(--cta-dark);
  color: var(--light);
  text-decoration: none;
}

.btn--secondary {
  background: var(--light);
  color: var(--cta);
  border: 1.5px solid var(--grey-line);
  box-shadow: var(--shadow-soft);
}
.btn--secondary:hover {
  border-color: var(--cta);
  color: var(--cta-dark);
  text-decoration: none;
}

.btn--video {
  background: var(--accent-dark);
  color: var(--light);
  box-shadow: 0 4px 12px -4px rgba(19, 168, 154, 0.4);
}
.btn--video:hover {
  background: #109080;
  color: var(--light);
  text-decoration: none;
}


/* --- Two-column layout for briefing --------------------------------------- */

.brief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.4rem;
  margin-bottom: 2.4rem;
}
@media (max-width: 860px) {
  .brief-grid { grid-template-columns: 1fr; }
}


/* --- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--grey-line);
  padding: 3rem var(--gutter) 4rem;
  max-width: var(--content-max);
  margin: 4rem auto 0;
  color: var(--grey-soft);
  font-size: 1.35rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--cta); }
.site-footer a:hover { color: var(--cta-dark); }


/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 720px) {
  :root { --gutter: 2rem; }
  .site-header { padding: 1.8rem var(--gutter); }
  main { padding: 1.6rem var(--gutter) 6rem; }

  .member-header { gap: 1.6rem; }
  .member-avatar { width: 5.6rem; height: 5.6rem; font-size: 2rem; }

  .brief-card { padding: 1.6rem; }

  .med-table,
  .results-table { font-size: 1.3rem; }
  .med-table th,
  .results-table th { font-size: 1rem; }

  .slot-grid { grid-template-columns: 1fr; }
}

/* Hide non-essential table columns on very small screens */
@media (max-width: 540px) {
  .med-table .col-route,
  .med-table td:nth-child(3) { display: none; }

  .med-table .col-changed,
  .med-table td:nth-child(5) { display: none; }
}


/* --- Print ---------------------------------------------------------------- */

@media print {
  body {
    background: none;
    color: #000;
    font-size: 10pt;
  }
  .site-header .chip,
  .site-footer,
  .skip-link,
  .back-link,
  .briefing__back,
  .brief-actions,
  .slot__arrow { display: none !important; }

  main { padding: 0 1cm; max-width: none; }

  .brief-card {
    box-shadow: none;
    border: 1pt solid #ccc;
    break-inside: avoid;
  }
  .glance-card {
    box-shadow: none;
    border: 1pt solid #ccc;
  }
  .alert-badge {
    border: 1pt solid #999;
  }
  .brand img { filter: grayscale(1); }
}
