/* =========================================
   THEME VARIABLES
   ========================================= */
:root {
  --bg: #0b1220;
  --fg: #e5e7eb;
  --muted: #94a3b8;
  --card: #111827;
  --accent: #0ea5e9;
  --ok: #10b981;
  --warn: #f59e0b;

  /* Layout constants */
  --header-h: 56px;  /* adjust if your header is taller */
  --tabs-h: 44px;
}

/* =========================================
   BASE / RESETS
   ========================================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial;
}

ul {
  padding-left: 18px;
}

button {
  cursor: pointer;
}

/* =========================================
   HEADER & TOP BAR
   ========================================= */
.header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0f172a;

  /* sticky + visual polish */
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  font-size: 22px;
}

.title {
  font-weight: 700;
  font-size: 20px;
}

.badge {
  background: #1f2937;
  color: #cbd5e1;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

/* Actions row in header */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.actions .inline {
  font-size: 13px;
  color: var(--fg);
}

.actions input[type="number"],
.actions input[type="text"] {
  width: 70px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1325;
  color: var(--fg);
}

.actions button {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1325;
  color: var(--fg);
  cursor: pointer;
}

.actions button.primary {
  background: var(--accent);
  border-color: transparent;
}

/* =========================================
   TABS (NAV)
   ========================================= */
.tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #0f172a;

  /* sticky under header */
  position: sticky;
  top: var(--header-h);
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,.18) inset;
}

.tabs button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1325;
  color: #cbd5e1;
  cursor: pointer;
}

.tabs button.active {
  background: #172554;
  color: #fff;
  border-color: #1d4ed8;
}

/* Show one tab at a time */
.tab {
  display: none;
}

.tab.active {
  display: block;
}

/* Slide-in animation on tab change */
@keyframes slideIn {
  from { transform: translateX(6%); opacity: 0; }
  to   { transform: translateX(0);  opacity: 1; }
}
.tab-enter {
  animation: slideIn 240ms ease both;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tab-enter { animation: none; }
}

/* =========================================
   LAYOUT WRAPPERS
   ========================================= */
main {
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.panel {
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Grid helpers */
.grid.two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 800px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

/* Flex helpers */
.space-between {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

/* =========================================
   FORMS & INPUTS
   ========================================= */
#sessionNotes {
  min-height: 60px;
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1325;
  color: var(--fg);
}

.setRow {
  display: grid;
  grid-template-columns: 60px 200px 1fr 80px;
  gap: 8px;
  align-items: center;
}

.setRow input {
  width: 100%;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1325;
  color: var(--fg);
}

/* Buttons */
button.primary {
  background: var(--accent);
  border-color: transparent;
  color: #001;
}

button.secondary {
  background: #0b1325;
  border: 1px solid #334155;
  color: var(--fg);
}

/* =========================================
   EXERCISE CARDS & TIMERS
   ========================================= */
.exercise {
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
}

.exercise.done {
  background: #062a1f;
  border-color: #0f5132;
}

.timerBox {
  border: 1px solid #283248;
  border-radius: 12px;
  padding: 10px;
}

.timerBox .title {
  font-size: 13px;
  color: #cbd5e1;
}

.timerBox .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
}

/* Goal bar */
.bar {
  flex: 1;
  height: 10px;
  background: #0b1325;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #334155;
}

.bar #goalBar {
  height: 100%;
  background: var(--ok);
  width: 0%;
}

/* =========================================
   MISC / UTILITIES
   ========================================= */
.hidden {
  display: none;
}

.muted {
  color: var(--muted);
}

.big {
  font-size: 24px;
  font-weight: 700;
}

.small {
  font-size: 12px;
  color: #99a;
}

/* Chips (badges/PRs) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips .chip {
  background: #052e1a;
  color: #9ef2c0;
  border: 1px solid #0f5132;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

/* Footer */
.footer {
  padding: 24px;
  color: #8aa;
  text-align: center;
}

/* =========================================
   RESPONSIVE TWEAKS
   ========================================= */
@media (max-width: 640px) {
  .header { padding: 10px 12px; }
  .tabs { padding: 6px 10px; }
  main { padding: 12px; }
}
