/* ============================================================
   ALLEVIATE PHYSIOTHERAPY — SHARED DESIGN SYSTEM
   site/assets/css/shared.css

   Import in every page with:
   <link rel="stylesheet" href="./assets/css/shared.css">

   Google Fonts are loaded separately in each page <head>.
   ============================================================ */

/* ── DESIGN TOKENS ── */
:root {
  --bg:        #f7f5f0;
  --surface:   #ffffff;
  --surface2:  #f0ede6;
  --ink:       #1a1714;
  --ink2:      #4a4540;
  --muted:     #9a948a;
  --border:    #e4e0d8;
  --green:     #2d6a4f;
  --green-lt:  #d8f3dc;
  --red:       #c1121f;
  --red-lt:    #ffe0e0;
  --gold:      #b5832a;
  --gold-lt:   #fdf0d5;
  --blue:      #1d4e89;
  --blue-lt:   #dbeafe;
  --purple:    #6d28d9;
  --purple-lt: #ede9fe;
  --teal:      #0e7490;
  --teal-lt:   #cffafe;
  --radius:    14px;
  --shadow:    0 2px 24px rgba(26,23,20,0.07);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

/* ── LAYOUT ── */
.shell { display: flex; min-height: 100vh; }

/* ── TOPBAR (used by dept pages) ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #0e0c0a;
  display: flex; align-items: stretch;
  height: 52px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.topbar-logo {
  padding: 0 24px; display: flex; align-items: center; gap: 12px;
  border-right: 1px solid rgba(255,255,255,0.07); flex-shrink: 0;
}
.topbar-logo-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem; font-weight: 700; color: #fff; letter-spacing: -0.01em;
}
.topbar-logo-sub { font-size: 0.6rem; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.1em; }
.topbar-nav { display: flex; flex: 1; overflow-x: auto; }
.dept-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px;
  font-size: 0.76rem; font-weight: 500;
  color: rgba(255,255,255,0.38);
  cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all 0.15s; letter-spacing: 0.01em;
  text-decoration: none;
}
.dept-tab:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.04); }
.dept-tab.active { color: #fff; border-bottom-color: #c9a84c; background: rgba(255,255,255,0.06); }
.topbar-right {
  padding: 0 20px; display: flex; align-items: center;
  border-left: 1px solid rgba(255,255,255,0.07); flex-shrink: 0;
}
.updated-chip { font-size: 0.65rem; color: rgba(255,255,255,0.22); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── SIDEBAR ── */
.sidebar {
  width: 240px; background: var(--ink);
  padding: 24px 0; display: flex; flex-direction: column;
  flex-shrink: 0; position: fixed; top: 52px; left: 0;
  height: calc(100vh - 52px); overflow-y: auto;
}
.sidebar-logo { padding: 0 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 12px; }
.sidebar-logo-name { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-weight: 700; color: #fff; }
.sidebar-logo-sub  { font-size: 0.67rem; color: rgba(255,255,255,0.32); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 2px; }
.nav-section-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.2); padding: 0 20px; margin: 14px 0 4px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 20px; font-size: 0.81rem;
  color: rgba(255,255,255,0.4); cursor: pointer;
  border-left: 3px solid transparent;
  background: none; border-right: none; border-top: none; border-bottom: none;
  width: 100%; text-align: left; transition: all 0.15s;
}
.nav-item:hover { color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.04); }
.nav-item.active { color: #fff; background: rgba(255,255,255,0.07); border-left-color: #c9a84c; font-weight: 500; }
.nav-back {
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px 14px; font-size: 0.72rem;
  color: rgba(255,255,255,0.28); text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.07); margin-bottom: 6px;
}
.nav-back:hover { color: rgba(255,255,255,0.5); }
.ni { font-size: 0.85rem; width: 16px; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.07); }
.sidebar-updated { font-size: 0.65rem; color: rgba(255,255,255,0.2); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── MAIN CONTENT ── */
.main { flex: 1; margin-left: 240px; padding: 36px 40px; min-height: calc(100vh - 52px); }
.page { display: none; }
.page.active { display: block; }

/* ── PAGE HEADER ── */
.ph { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.ph-title { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.ph-desc  { font-size: 0.81rem; color: var(--muted); margin-top: 5px; font-weight: 300; max-width: 520px; line-height: 1.5; }

/* ── GRID ── */
.g  { display: grid; gap: 16px; margin-bottom: 18px; }
.g1 { grid-template-columns: 1fr; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g21 { grid-template-columns: 2fr 1fr; }
.g12 { grid-template-columns: 1fr 2fr; }
.g13 { grid-template-columns: 1fr 3fr; }
.g31 { grid-template-columns: 3fr 1fr; }

/* ── CARD ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); animation: fadeUp 0.35s ease both;
}
.card:nth-child(1) { animation-delay: .03s; }
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .09s; }
.card:nth-child(4) { animation-delay: .12s; }
.card:nth-child(5) { animation-delay: .15s; }
.card:nth-child(6) { animation-delay: .18s; }

.ey  { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.cv  { font-family: 'Cormorant Garamond', serif; font-size: 2.3rem; font-weight: 700; line-height: 1; color: var(--ink); }
.cs  { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.cd  { display: inline-flex; align-items: center; gap: 4px; font-size: 0.73rem; font-weight: 500; margin-top: 7px; padding: 3px 8px; border-radius: 100px; }
.du  { background: var(--green-lt); color: var(--green); }
.dd  { background: var(--red-lt);   color: var(--red); }
.df  { background: var(--gold-lt);  color: var(--gold); }
.ct  { font-family: 'Cormorant Garamond', serif; font-size: 1.12rem; font-weight: 700; margin-bottom: 14px; color: var(--ink); }
.ct small { display: block; font-family: 'Outfit', sans-serif; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 400; margin-bottom: 3px; }

/* ── INSIGHT BOX ── */
.ib { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; display: flex; gap: 12px; align-items: flex-start; }
.ib-icon  { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.ib-label { font-size: 0.61rem; text-transform: uppercase; letter-spacing: 0.13em; color: rgba(255,255,255,0.36); margin-bottom: 4px; font-weight: 500; }
.ib-text  { font-size: 0.81rem; line-height: 1.6; color: rgba(255,255,255,0.82); }
.ib-text strong { color: #c9a84c; }

/* ── TABLES ── */
.dt { width: 100%; border-collapse: collapse; }
.dt th { font-size: 0.61rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 500; padding: 0 11px 9px; text-align: left; border-bottom: 1px solid var(--border); }
.dt td { padding: 10px 11px; font-size: 0.78rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dt tr:last-child td { border-bottom: none; }

/* ── PROGRESS BARS ── */
.pr       { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.pr-label { width: 140px; font-size: 0.75rem; color: var(--ink2); flex-shrink: 0; line-height: 1.3; }
.pr-track { flex: 1; height: 6px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
.pr-fill  { height: 100%; border-radius: 100px; }
.pr-val   { width: 36px; text-align: right; font-size: 0.75rem; font-weight: 600; color: var(--ink); flex-shrink: 0; }

/* ── BADGES ── */
.badge  { display: inline-block; font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; padding: 2px 8px; border-radius: 100px; }
.bg     { background: var(--green-lt);  color: var(--green); }
.br     { background: var(--red-lt);    color: var(--red); }
.bo     { background: var(--gold-lt);   color: var(--gold); }
.bb     { background: var(--blue-lt);   color: var(--blue); }
.bm     { background: var(--surface2);  color: var(--muted); }
.bp     { background: var(--purple-lt); color: var(--purple); }
.bt     { background: var(--teal-lt);   color: var(--teal); }
/* gap chip aliases */
.gp { background: var(--green-lt); color: var(--green); }
.gn { background: var(--red-lt);   color: var(--red); }
.go { background: var(--gold-lt);  color: var(--gold); }

/* ── AI PANEL ── */
.ai-input {
  width: 100%; border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 13px; font-family: 'Outfit', sans-serif;
  font-size: 0.8rem; color: var(--ink); background: var(--surface2);
  resize: vertical; outline: none; min-height: 76px;
}
.ai-btn {
  margin-top: 9px; padding: 8px 20px;
  background: var(--ink); color: #fff; border: none;
  border-radius: 100px; font-family: 'Outfit', sans-serif;
  font-size: 0.76rem; font-weight: 500; cursor: pointer; letter-spacing: 0.02em;
}
.ai-btn:hover { background: #2d2926; }
.ai-out {
  margin-top: 12px; padding: 14px; background: var(--surface2);
  border-radius: 9px; font-size: 0.79rem; line-height: 1.7;
  color: var(--ink2); display: none;
}
.ai-out h4 { font-size: 0.86rem; color: var(--ink); margin: 11px 0 4px; font-weight: 600; }
.ai-out ul { padding-left: 15px; }
.ai-out li { margin-bottom: 4px; }

/* ── DOT PULSE (loading indicator) ── */
.dp { display: none; gap: 4px; align-items: center; margin-top: 9px; }
.dp span { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: pulse 1.4s infinite; }
.dp span:nth-child(2) { animation-delay: .2s; }
.dp span:nth-child(3) { animation-delay: .4s; }
.dp-text { margin-left: 7px; font-size: 0.77rem; color: var(--muted); }

/* ── RECO GRID ── */
.rg    { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.rc    { border-radius: 9px; padding: 14px; }
.rc-label { font-size: 0.61rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-bottom: 5px; }
.rc-text  { font-size: 0.78rem; color: var(--ink); line-height: 1.5; }
.rc-r { background: var(--red-lt); }   .rc-r .rc-label { color: var(--red); }
.rc-o { background: var(--gold-lt); }  .rc-o .rc-label { color: var(--gold); }
.rc-g { background: var(--green-lt); } .rc-g .rc-label { color: var(--green); }
.rc-b { background: var(--blue-lt); }  .rc-b .rc-label { color: var(--blue); }

/* ── SURVEY BARS ── */
.sq         { background: var(--surface2); border-radius: 11px; padding: 16px; margin-bottom: 12px; }
.sq-text    { font-size: 0.85rem; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.sq-bar     { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.sq-opt     { font-size: 0.74rem; color: var(--ink2); width: 150px; flex-shrink: 0; }
.sq-track   { flex: 1; height: 7px; background: var(--border); border-radius: 100px; overflow: hidden; }
.sq-fill    { height: 100%; border-radius: 100px; }
.sq-pct     { font-size: 0.74rem; font-weight: 600; color: var(--ink); width: 32px; text-align: right; }

/* ── ZONE GRID ── */
.zg          { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.zc          { border-radius: 11px; padding: 14px; border: 1px solid transparent; }
.zs          { background: var(--green-lt); border-color: #b7e4c7; }
.zw          { background: var(--red-lt);   border-color: #ffb3b3; }
.zp          { background: var(--gold-lt);  border-color: #f5d689; }
.zc-tag      { font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.zs .zc-tag  { color: var(--green); }
.zw .zc-tag  { color: var(--red); }
.zp .zc-tag  { color: var(--gold); }
.zc-name     { font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; }
.zc-detail   { font-size: 0.74rem; line-height: 1.4; color: var(--ink2); }

/* ── EMAIL TEMPLATE CARD ── */
.tc       { background: var(--surface2); border-radius: 11px; padding: 16px; margin-bottom: 12px; border-left: 3px solid var(--teal); }
.tc-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 3px; }
.tc-use   { font-size: 0.69rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 9px; }
.tc-body  { font-size: 0.76rem; color: var(--ink2); line-height: 1.6; white-space: pre-line; background: var(--surface); padding: 11px; border-radius: 7px; border: 1px solid var(--border); }
.copy-btn { margin-top: 7px; padding: 5px 13px; background: var(--ink); color: #fff; border: none; border-radius: 100px; font-size: 0.7rem; cursor: pointer; font-family: 'Outfit', sans-serif; }

/* ── MONTH GRID ── */
.mg      { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.mc      { border-radius: 9px; padding: 10px 7px; text-align: center; border: 1px solid transparent; }
.mc-h    { background: var(--green-lt); border-color: #b7e4c7; }
.mc-l    { background: var(--red-lt);   border-color: #ffb3b3; }
.mc-m    { background: var(--surface2); }
.mc-h .mc-val { color: var(--green); }
.mc-l .mc-val { color: var(--red); }
.mc-m .mc-val { color: var(--ink); }
.mc-name { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
.mc-val  { font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; font-weight: 700; }
.mc-tag  { font-size: 0.56rem; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; color: var(--muted); }

/* ── EFFICIENCY BAR ── */
.eb       { display: flex; align-items: center; gap: 7px; }
.eb-track { flex: 1; height: 5px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
.eb-fill  { height: 100%; border-radius: 100px; }

/* ── UPLOAD ZONE ── */
.uz          { border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; background: var(--surface2); cursor: pointer; transition: border-color .2s; margin-bottom: 12px; }
.uz:hover    { border-color: var(--muted); }
.uz-icon     { font-size: 1.8rem; margin-bottom: 8px; }
.uz-text     { font-size: 0.81rem; color: var(--muted); line-height: 1.5; }
.uz-btn      { margin-top: 11px; display: inline-block; padding: 8px 20px; background: var(--ink); color: #fff; border-radius: 100px; font-size: 0.75rem; font-weight: 500; cursor: pointer; }

/* ── CHECKLIST ITEM ── */
.cl-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.cl-item:last-child { border-bottom: none; }

/* ── POST CARD ── */
.pc      { background: var(--surface2); border-radius: 11px; padding: 14px; margin-bottom: 12px; }
.pc-plat { font-size: 0.63rem; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.pc-idea { font-size: 0.82rem; color: var(--ink); font-weight: 500; margin-bottom: 5px; }
.pc-cap  { font-size: 0.74rem; color: var(--ink2); line-height: 1.5; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(13px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 80%, 100% { opacity: .2; transform: scale(.8); }
  40%            { opacity: 1; transform: scale(1); }
}

canvas { max-height: 260px; }
