:root {
  --bg: #0B0D10;
  --surface: #14181F;
  --card: #1A1F29;
  --border: #262D3B;
  --yellow: #FACC15;
  --yellow-hover: #FDE047;
  --red: #EF4444;
  --emerald: #10B981;
  --sky: #38BDF8;
  --text: #F8FAFC;
  --muted: #94A3B8;
}

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

html, body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  min-height: 100vh;
}

input, select, textarea, button {
  font-family: inherit;
  color: inherit;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Layout */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.top-header-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 16px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-container {
  flex: 1;
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 16px 16px 110px 16px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 35;
  background: rgba(11, 13, 16, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}

.bottom-nav-inner {
  max-width: 540px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 64px;
  padding: 0 6px;
}

.nav-btn {
  position: relative;
  background: transparent;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s ease;
}

.nav-btn:hover {
  color: #E2E8F0;
}

.nav-btn.active {
  color: var(--yellow);
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 32px;
  height: 3px;
  border-radius: 99px;
  background: var(--yellow);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  display: inline-block;
  box-shadow: 0 0 8px var(--emerald);
}

/* Panels & Cards */
.panel {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
}

.panel-highlight {
  background: linear-gradient(145deg, #14181F 0%, #191F2A 60%, #0B0D10 100%);
  border: 1px solid #333C4D;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.panel-yellow {
  border: 2px solid var(--yellow);
}

.panel-sky {
  background: linear-gradient(90deg, #14181F 0%, rgba(12, 74, 110, 0.35) 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.subcard {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
}

.subcard-hover {
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.subcard-hover:hover {
  border-color: rgba(250, 204, 21, 0.6);
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(1, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.grid-7 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

@media (min-width: 640px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-7 { grid-template-columns: repeat(7, 1fr); }
  .sm-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-yellow {
  background-color: var(--yellow);
  color: #000000;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.15);
}
.btn-yellow:hover { background-color: var(--yellow-hover); }

.btn-dark {
  background-color: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.btn-dark:hover { border-color: var(--yellow); color: var(--yellow); }

.btn-emerald {
  background-color: var(--emerald);
  color: #000000;
}

.btn-outline-yellow {
  background-color: var(--bg);
  color: var(--yellow);
  border-color: var(--yellow);
}
.btn-outline-yellow:hover {
  background-color: var(--yellow);
  color: #000;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-icon:hover { border-color: var(--yellow); color: var(--yellow); }

/* Inputs */
.input {
  width: 100%;
  background-color: var(--bg);
  border: 1px solid #334155;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.input:focus { border-color: var(--yellow); }

.label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Badges & Pills */
.badge-yellow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: var(--yellow);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-sky {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.15);
  color: #7DD3FC;
  font-size: 10px;
  font-weight: 800;
}

.badge-dark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: #CBD5E1;
  font-size: 11px;
  font-weight: 600;
}

.pill-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-pill {
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg);
  color: #CBD5E1;
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
}
.filter-pill.active {
  background: var(--yellow);
  color: #000000;
  border-color: var(--yellow);
}

/* Floating Timer */
.floating-timer {
  position: fixed;
  bottom: 76px;
  right: 14px;
  z-index: 40;
}

.floating-timer-box {
  width: 310px;
  max-width: calc(100vw - 28px);
  background: rgba(20, 24, 31, 0.97);
  border: 1px solid rgba(250, 204, 21, 0.6);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.85);
}

/* Barbell Visual Plates */
.barbell-Stage {
  min-height: 135px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 12px 8px;
}

.plate-node {
  width: 40px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  margin-right: 4px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.plate-20 { height: 112px; background: #2563EB; border: 2px solid #60A5FA; color: #fff; }
.plate-15 { height: 96px; background: #FACC15; border: 2px solid #FEF08A; color: #000; }
.plate-10 { height: 82px; background: #059669; border: 2px solid #34D399; color: #fff; }
.plate-5  { height: 66px; background: #E2E8F0; border: 2px solid #FFFFFF; color: #000; }
.plate-2_5 { height: 54px; background: #EF4444; border: 2px solid #FCA5A5; color: #fff; }

/* Utilities */
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.text-yellow { color: var(--yellow); }
.text-red { color: var(--red); }
.text-sky { color: var(--sky); }
.text-emerald { color: var(--emerald); }
.text-muted { color: var(--muted); }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; font-weight: 900; }
.text-xl { font-size: 22px; font-weight: 900; }
.text-2xl { font-size: 26px; font-weight: 900; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.w-full { width: 100%; }
