@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
/* HealYou Wellness Platform — Design System
   Tightened pass modeled on istrata-mgmt-app: Inter type, cool slate neutrals,
   compact cards/tables, soft single shadows. Teal stays the brand accent and all
   class + variable names are preserved so existing pages restyle with no markup
   changes. */
:root {
  --teal:        #0d9488;
  --teal-dark:   #0f766e;
  --teal-light:  #ccfbf1;
  --teal-bg:     #f0fdfa;
  /* Neutrals → cool slate (names kept; values refined) */
  --gray-50:     #f8fafc;
  --gray-100:    #f1f5f9;
  --gray-200:    #e2e8f0;
  --gray-300:    #cbd5e1;
  --gray-400:    #94a3b8;
  --gray-500:    #64748b;
  --gray-600:    #475569;
  --gray-800:    #1e293b;
  --red:         #ef4444;
  --red-light:   #fee2e2;
  --amber:       #f59e0b;
  --amber-light: #fef3c7;
  --green:       #10b981;
  --green-light: #d1fae5;
  --blue:        #3b82f6;
  --blue-light:  #dbeafe;
  --purple:      #8b5cf6;
  --purple-light:#ede9fe;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 1px 3px rgba(15,23,42,.08);
  --shadow-md:   0 4px 10px rgba(15,23,42,.08);
  --shadow-lg:   0 20px 50px rgba(15,23,42,.18);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Header ── */
.header {
  background: var(--teal);
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(15,23,42,.12);
  position: sticky; top: 0; z-index: 50;
}
.header-logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em;
  text-decoration: none; color: #fff;
}
.header-logo img  { height: 40px; width: auto; }
.header-logo span { font-weight: 300; }

/* ── Left sidebar ── */
.sidebar {
  position: fixed; left: 0; top: 56px;
  width: 220px; height: calc(100vh - 56px);
  background: #fff; border-right: 1px solid var(--gray-200);
  overflow-y: auto; z-index: 40;
  display: flex; flex-direction: column;
}
.sidebar-nav { padding: 10px 0; flex: 1; }
.sidebar-section {
  font-size: .67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--gray-400); padding: 14px 20px 5px;
}
.sidebar-item {
  display: flex; align-items: center;
  padding: 8px 20px; font-size: .85rem; font-weight: 500;
  color: var(--gray-600); text-decoration: none;
  border-left: 3px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.sidebar-item:hover  { background: var(--gray-50); color: var(--teal); }
.sidebar-item.active { background: var(--teal-bg); color: var(--teal); border-left-color: var(--teal); font-weight: 600; }

/* ── Layout ── */
.container { max-width: 1140px; margin: 0 auto; padding: 28px 28px; }
.container.has-sidebar { margin-left: 220px; max-width: none; padding: 28px 32px; }
.page-title    { font-size: 1.4rem; font-weight: 700; color: var(--gray-800); letter-spacing: -.02em; margin-bottom: 4px; }
.page-subtitle { color: var(--gray-400); margin-bottom: 24px; font-size: .9rem; }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 18px 20px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
a.stat-card:hover {
  border-color: var(--teal); box-shadow: 0 6px 16px rgba(13,148,136,.14);
  transform: translateY(-2px); cursor: pointer;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; color: var(--teal); line-height: 1.1; letter-spacing: -.02em; margin-bottom: 4px; }
.stat-card .stat-label { font-size: .72rem; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-icon  { font-size: 1.35rem; margin-bottom: 8px; }

/* ── Cards ── */
.card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 10px; padding: 22px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.card-title { font-size: .95rem; font-weight: 600; margin-bottom: 16px; color: var(--gray-800); }
/* Optional istrata-style header/body split (no-ops for single-padding cards) */
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-body   { padding: 20px; }

/* ── Two-column grid ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Form ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.full   { grid-template-columns: 1fr; }
@media (max-width: 600px) { .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span-2 { grid-column: 1 / -1; }
.form-group.span-3 { grid-column: 1 / -1; }
label { font-size: .8rem; font-weight: 500; color: var(--gray-600); }
input, select, textarea {
  padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius);
  font-size: .9rem; font-family: inherit; color: var(--gray-800); background: #fff;
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
input::placeholder, textarea::placeholder { color: #9aa7b8; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
textarea { resize: vertical; min-height: 80px; }
.form-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--gray-100); }
.form-section-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--teal); margin-bottom: 14px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 7px;
  font-size: .86rem; font-weight: 600; cursor: pointer; line-height: 1.1;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s, opacity .15s; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-ghost { background: #fff; color: var(--gray-600); border: 1px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--teal); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: .78rem; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; text-transform: capitalize; letter-spacing: .01em;
}
/* status */
.badge-scheduled  { background: var(--blue-light);   color: #1d4ed8; }
.badge-completed  { background: var(--green-light);  color: #047857; }
.badge-cancelled  { background: var(--red-light);    color: #b91c1c; }
.badge-no_show    { background: var(--amber-light);  color: #b45309; }
.badge-active     { background: var(--green-light);  color: #047857; }
.badge-inactive   { background: var(--gray-100);     color: var(--gray-600); }
.badge-achieved   { background: var(--teal-light);   color: var(--teal-dark); }
/* risk */
.badge-low        { background: var(--green-light);  color: #047857; }
.badge-moderate   { background: var(--amber-light);  color: #b45309; }
.badge-high       { background: var(--red-light);    color: #b91c1c; }
.badge-critical   { background: #991b1b;             color: #fff; }
.badge-crisis     { background: #fce7f3;             color: #9d174d; }
.badge-normal     { background: var(--green-light);  color: #047857; }
.badge-elevated   { background: var(--amber-light);  color: #b45309; }
.badge-borderline { background: var(--amber-light);  color: #b45309; }
.badge-onsite     { background: var(--blue-light);   color: #1d4ed8; }
.badge-virtual    { background: var(--purple-light); color: #5b21b6; }

/* ── Data table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th {
  text-align: left; font-size: .72rem; font-weight: 600;
  color: var(--gray-400); text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 14px; border-bottom: 1px solid var(--gray-200);
  white-space: nowrap; background: #fff;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--gray-50); cursor: pointer; }
.data-table .actions { display: flex; gap: 6px; }
/* Opt-in zebra striping for long scanning lists (e.g. Bookings Data records).
   Hover must be a different tone from the stripe or it vanishes on even rows. */
.data-table.striped tbody tr:nth-child(even) td { background: var(--gray-50); }
.data-table.striped tbody tr:hover td { background: var(--teal-bg); }
/* Right-aligned tabular numerals keep count columns readable down the column. */
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* Cells that should truncate rather than force the table wide. */
.data-table .clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Biometric result card ── */
.biometric-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.bio-tile {
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 10px; padding: 14px; text-align: center;
}
.bio-tile.risk-high    { background: var(--red-light);    border-color: #fca5a5; }
.bio-tile.risk-moderate{ background: var(--amber-light);  border-color: #fcd34d; }
.bio-tile.risk-normal  { background: var(--green-light);  border-color: #6ee7b7; }
.bio-tile-value { font-size: 1.5rem; font-weight: 700; color: var(--gray-800); line-height: 1.2; }
.bio-tile-unit  { font-size: .72rem; color: var(--gray-400); margin-bottom: 4px; }
.bio-tile-label { font-size: .75rem; font-weight: 500; color: var(--gray-600); margin-top: 4px; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: var(--radius-lg);
  padding: 26px 28px; width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px); overflow-y: auto;
}
.modal-lg { max-width: 760px; }
.modal-title  { font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--gray-100); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--gray-800); color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-size: .875rem; font-weight: 500; opacity: 0; pointer-events: none;
  box-shadow: 0 8px 24px rgba(15,23,42,.25);
  transform: translateY(10px); transition: opacity .25s, transform .25s; z-index: 300;
  max-width: 360px; max-height: 40vh; overflow: hidden;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Login wall ── */
.login-wall { text-align: center; padding: 80px 20px; }
.login-wall h2 { font-size: 1.4rem; margin-bottom: 8px; }
.login-wall p  { color: var(--gray-400); margin-bottom: 24px; }
.demo-hint {
  margin-top: 20px; padding: 14px 18px;
  background: var(--teal-bg); border: 1px solid var(--teal-light); border-radius: 10px; text-align: left;
  max-width: 320px; margin-left: auto; margin-right: auto;
}
.demo-hint-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--teal); margin-bottom: 8px; }
.demo-hint-row   { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--gray-600); margin-bottom: 4px; }
.demo-hint-row strong { min-width: 60px; font-weight: 500; color: var(--gray-800); }
.demo-hint-row code   { background: rgba(13,148,136,.1); padding: 1px 6px; border-radius: 4px; font-size: .8rem; color: var(--teal-dark); }

/* ── Misc ── */
.empty { text-align: center; padding: 40px 0; color: var(--gray-400); font-size: .9rem; }
.save-bar { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--gray-100); align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-size: .86rem; font-weight: 500; text-decoration: none; margin-bottom: 20px; }
.back-link:hover { text-decoration: underline; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-header h3 { font-size: .95rem; font-weight: 600; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search-bar { position: relative; }
.search-bar input { padding-left: 36px; }
.search-bar::before { content: '🔍'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: .8rem; opacity: .6; }

/* ── SOC selector ── */
.soc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 8px; margin-bottom: 16px; }
.soc-option {
  border: 1px solid var(--gray-200); border-radius: 10px; padding: 10px; cursor: pointer;
  text-align: center; font-size: .82rem; transition: border-color .15s, background .15s;
}
.soc-option.selected { border-color: var(--teal); background: var(--teal-bg); color: var(--teal); box-shadow: 0 0 0 1px var(--teal) inset; }
.soc-option:hover:not(.selected) { border-color: var(--gray-400); }
.soc-label { font-weight: 600; display: block; margin-bottom: 2px; font-size: .8rem; }
.soc-desc  { font-size: .72rem; color: var(--gray-400); }

/* ── Participant header ── */
.participant-header {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.participant-avatar {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: var(--teal-light); display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 700; color: var(--teal);
}
.participant-info h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.participant-info .meta { font-size: .85rem; color: var(--gray-400); }

/* ── Risk summary strip ── */
.risk-strip {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.risk-item {
  display: flex; flex-direction: column; align-items: center;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 10px 16px; min-width: 90px; text-align: center;
}
.risk-item-value { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); }
.risk-item-label { font-size: .7rem; color: var(--gray-400); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--gray-200); }
.tab {
  padding: 9px 16px; font-size: .86rem; font-weight: 500; font-family: inherit;
  color: var(--gray-400); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.tab.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.tab:hover:not(.active) { color: var(--gray-600); }

/* ── Control Panel tile grid ── */
.cp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 980px;
}
@media (max-width: 860px) { .cp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cp-grid { grid-template-columns: 1fr; } }

.cp-tile {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.cp-tile:hover { border-color: var(--teal); box-shadow: 0 6px 16px rgba(13,148,136,.12); transform: translateY(-1px); }

.cp-tile-icon {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.cp-tile-icon svg {
  width: 26px; height: 26px; stroke: var(--teal);
}

.cp-tile-title {
  font-size: .95rem; font-weight: 700;
  text-align: center; color: var(--gray-800);
  margin-bottom: 10px;
}

.cp-tile-divider {
  border: none; border-top: 1px solid var(--gray-100);
  margin: 0 0 12px;
}

.cp-tile-links { list-style: none; }
.cp-tile-links li { margin-bottom: 5px; }
.cp-tile-links a {
  font-size: .83rem; color: var(--gray-600);
  text-decoration: none; display: flex; align-items: center; gap: 5px;
  transition: color .12s;
}
.cp-tile-links a::before { content: '›'; color: var(--gray-400); font-size: 1rem; line-height: 1; }
.cp-tile-links a:hover { color: var(--teal); }
.cp-tile-links a:hover::before { color: var(--teal); }

/* ── Rich-text / content areas ── */
.content-preview {
  font-size: .85rem; color: var(--gray-600); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Status pill selector ── */
.status-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill {
  padding: 4px 14px; border-radius: 99px; font-size: .78rem; font-weight: 600;
  border: 1px solid var(--gray-200); cursor: pointer; transition: all .12s;
  background: #fff; color: var(--gray-600);
}
.status-pill.active { border-color: var(--teal); background: var(--teal-bg); color: var(--teal); box-shadow: 0 0 0 1px var(--teal) inset; }
.status-pill:hover:not(.active) { border-color: var(--gray-400); }
