/* Tokens, base, layout, and the log screen.
   Propshaft's :app includes every stylesheet here, alphabetically:
   application.css, then charts.css, then forms.css. */

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e4e6eb;
  --accent: #1f6feb;

  /* Cardio, lift and accent were validated together for colorblind separation
     on a white surface — do not nudge them independently. */
  --cardio: #0f9d76;
  --lift: #4a3aa7;

  --good: #006300;
  --danger: #d03b3b;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.shell {
  max-width: 460px;
  margin: 0 auto;
  background: var(--card);
  min-height: 100dvh;
}

@media (min-width: 500px) {
  .shell {
    margin: 24px auto 48px;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  }
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand span { color: var(--accent); }

.bar .who {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.bar .back {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
.bar .title { font-weight: 700; font-size: 14px; }

.body { padding: 16px; }

/* --- flash --- */
.flash {
  margin: 12px 16px 0;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
}
.flash.notice { background: #e9f5ee; color: var(--good); }
.flash.alert  { background: #fdecec; color: var(--danger); }

/* --- buttons --- */
.btn {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn.ghost  { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.cardio { background: var(--cardio); border-color: var(--cardio); }
.btn.lift   { background: var(--lift); border-color: var(--lift); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--line); }

.fabrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.hint { font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; }
.hint a { color: var(--accent); text-decoration: none; }

/* --- tabs & stats --- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs a {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  color: var(--muted);
  background: #f0f1f4;
  text-decoration: none;
}
.tabs a.on { background: var(--ink); color: #fff; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat {
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.stat b { display: block; font-size: 18px; line-height: 1.2; }
.stat span { font-size: 11px; color: var(--muted); }

/* --- the log feed --- */
.daygroup {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.daygroup:first-child { margin-top: 0; }

.entry {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.entry:last-child { border-bottom: 0; }

.pill {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .03em;
}
.pill.c { background: var(--cardio); }
.pill.l { background: var(--lift); }

.entry .grow { flex: 1; min-width: 0; }
.entry .name { font-weight: 600; font-size: 14px; }
.entry .name a { color: inherit; text-decoration: none; }
.entry .meta { font-size: 13px; color: var(--muted); }
.entry .notes { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 2px; }
.entry .edit {
  font-size: 12px;
  color: var(--accent);
  align-self: center;
  text-decoration: none;
}

.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty .big { font-size: 28px; margin-bottom: 8px; }
.empty .lead { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty p { font-size: 13px; margin: 0; }

.bar .save {
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  min-width: 56px;
  text-align: right;
}
.bar .save.cardio { color: var(--cardio); }
.bar .save.lift { color: var(--lift); }
