/* Reform Coach — brand: onyx, graphite, rose gold, cream */
:root {
  --bg: #0b0b0c;
  --surface: #141416;
  --card: #1a1a1c;
  --line: #2a2a2d;
  --text: #f3f2f0;
  --muted: #a19c97;
  --rose: #c08a78;
  --rose-deep: #9c7463;
  --ok: #8fb59a;
  --warn: #d9a25f;
  --bad: #d07a6e;
  --radius: 14px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--rose); }
h1, h2, h3 { font-weight: 500; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font: 500 30px/1.15 var(--serif); }
h2 { font: 500 24px/1.2 var(--serif); }
h3 { font-size: 15px; font-weight: 600; }
.serif { font-family: var(--serif); }
.italic { font-style: italic; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 80px; }
.narrow { max-width: 560px; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 10; background: rgba(11,11,12,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1040px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; }
.mark { font: 600 12px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--text); white-space: nowrap; }
.mark em { font: italic 500 19px/1 var(--serif); letter-spacing: 0; text-transform: none; color: var(--rose); margin-left: 6px; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab { white-space: nowrap; background: none; border: 0; color: var(--muted); padding: 8px 12px; border-radius: 999px; font: 500 14px var(--sans); cursor: pointer; position: relative; }
.tab.on { color: var(--text); background: var(--card); }
.count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--rose); color: #111; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

/* cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card, .stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .side { grid-template-columns: 1.4fr 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--rose-deep), transparent); border: 0; margin: 20px 0; opacity: .6; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 9px 14px; border-radius: 10px; font: 500 14px var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--rose-deep); }
.btn.primary { background: linear-gradient(135deg, var(--rose), var(--rose-deep)); border-color: transparent; color: #141414; font-weight: 600; }
.btn.ghost { background: none; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; padding: 13px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 6px; font-size: 16px; }
.icon-btn:hover { color: var(--text); }

/* forms */
label { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
input, textarea, select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font: 15px var(--sans); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--rose-deep); }
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 12px; }
.fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.check input { width: auto; }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.daypick button { width: 42px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: 600 12px var(--sans); cursor: pointer; }
.daypick button.on { background: var(--rose); color: #141414; border-color: var(--rose); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--muted); padding: 8px 14px; font: 500 14px var(--sans); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); }

/* badges & status */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.rose { color: var(--rose); border-color: rgba(192,138,120,.4); }
.pill.ok { color: var(--ok); border-color: rgba(143,181,154,.35); }
.pill.warn { color: var(--warn); border-color: rgba(217,162,95,.35); }
.pill.bad { color: var(--bad); border-color: rgba(208,122,110,.35); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(143,181,154,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(143,181,154,0); } 100% { box-shadow: 0 0 0 0 rgba(143,181,154,0); } }
.dots { display: flex; gap: 4px; flex-wrap: wrap; }
.dots span { width: 12px; height: 12px; border-radius: 3px; background: var(--line); }
.dots .done { background: var(--rose); }
.dots .miss { background: transparent; border: 1.5px solid var(--bad); }
.stat { font: 500 30px/1 var(--serif); }
.stat small { font: 500 12px var(--sans); color: var(--muted); margin-left: 4px; }

/* lists */
.list > * { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.client-card { cursor: pointer; transition: border-color .15s; }
.client-card:hover { border-color: var(--rose-deep); }
.feed { max-height: 420px; overflow: auto; }
.feed div { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed time { color: var(--muted); font-size: 12px; margin-right: 8px; }

/* plan editor */
.workout { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); }
.workout + .workout { margin-top: 12px; }
.ex-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 0; border-top: 1px dashed var(--line); }
@media (min-width: 760px) { .ex-row { grid-template-columns: 2.2fr .6fr .9fr 1.1fr .8fr 1.6fr auto; align-items: end; } }
.ex-row input { padding: 7px 9px; font-size: 14px; }
.ex-head { display: none; }
@media (min-width: 760px) { .ex-head { display: grid; grid-template-columns: 2.2fr .6fr .9fr 1.1fr .8fr 1.6fr auto; gap: 6px; font-size: 11.5px; color: var(--muted); padding-top: 8px; } .ex-row label { display: none; } }

/* client logging */
.set-row { display: grid; grid-template-columns: 34px 1fr 1fr 74px 46px; gap: 6px; align-items: center; margin-top: 6px; }
.set-row input, .set-row select { padding: 9px 6px; text-align: center; font-size: 15px; }
.set-no { color: var(--muted); font-size: 13px; text-align: center; }
.tick { width: 46px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 18px; cursor: pointer; }
.tick.on { background: var(--rose); color: #141414; border-color: var(--rose); }
.ex-block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.ex-block:last-child { border-bottom: 0; }
.rx { color: var(--rose); font-size: 14px; font-weight: 500; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice button { padding: 12px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 14px var(--sans); cursor: pointer; }
.choice button.on { border-color: var(--rose); background: rgba(192,138,120,.15); color: var(--rose); }
.effort { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.effort button { padding: 10px 0; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-weight: 600; cursor: pointer; }
.effort button.on { background: var(--rose); color: #141414; border-color: var(--rose); }

/* misc */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--text); color: #111; padding: 10px 16px; border-radius: 10px; font-weight: 500; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: calc(100% - 32px); }
.banner { padding: 10px 14px; border-radius: 10px; background: rgba(192,138,120,.12); border: 1px solid rgba(192,138,120,.35); color: var(--text); font-size: 14px; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.pre { white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.hidden { display: none !important; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal-bg { align-items: center; } }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 20px 16px 28px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; }
@media (min-width: 640px) { .modal { border-radius: 18px; } }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
@media (min-width: 760px) { .ex-row.meal-row { grid-template-columns: 1fr 110px 2fr auto; } .ex-row.supp-row { grid-template-columns: 1.4fr 1fr 1.4fr auto; } }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 12px; border: 1.5px dashed var(--rose-deep); border-radius: 12px; cursor: pointer; color: var(--text); text-align: center; }
.dropzone.over, .dropzone:hover { background: rgba(192,138,120,.08); }
.mtable { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.mtable th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 6px 10px 8px 0; white-space: nowrap; border-bottom: 1px solid var(--line); }
.mtable td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.mtable td.small { white-space: normal; min-width: 140px; }
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rating button { padding: 10px 0; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-weight: 600; cursor: pointer; }
.rating button.on { background: var(--rose); color: #141414; border-color: var(--rose); }
.section-title { flex-wrap: wrap; gap: 8px; }
input[type=checkbox] { accent-color: var(--rose); }
