:root {
  /* ── North Star / Brand Colors ── */
  --ns-black:        #0a0a0a;
  --ns-yellow:       #C9A020;
  --ns-white:        #ffffff;

  /* ── App Theme Colors ── */
  --workout-navy:    #070c1c;
  --workout-blue:    #4ab3f4;
  --habits-red:      #dc2626;
  --sleep-gold:      #c9a86b;
  --sleep-purple:    #9b6bc9;
  --expenses-green:  #16a34a;
  --journal-navy:    #1e3a5f;

  /* ── Badge Colors (Workout Tracker) ── */
  --badge-lift:        #4ab3f4;   /* icy blue  */
  --badge-skill:       #9b6bc9;   /* purple    */
  --badge-conditioning:#155e75;   /* slate cyan — NO orange */
  --badge-sprint:      #dc4856;   /* crimson   */
  --badge-run:         #226633;   /* forest green */

  /* ── Text ── */
  --text-primary:    #ffffff;
  --text-dim:        #9aa3b2;
  --text-faint:      #4a5568;
  --text-muted:      #6b7280;

  /* ── Surfaces ── */
  --border-subtle:   rgba(255,255,255,0.08);
  --border-yellow:   rgba(201,160,32,0.3);
  --card-bg:         rgba(255,255,255,0.04);
  --card-bg-hover:   rgba(255,255,255,0.07);
  --overlay-bg:      rgba(0,0,0,0.85);

  /* ── Spacing ── */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   12px;
  --space-lg:   16px;
  --space-xl:   24px;
  --space-2xl:  32px;
  --space-3xl:  48px;
  --space-4xl:  64px;

  /* ── Radius ── */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  /* ── Shadows ── */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 24px rgba(201,160,32,0.25);

  /* ── Transitions ── */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--ns-black);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

a {
  color: var(--ns-yellow);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Utility ── */
.text-yellow  { color: var(--ns-yellow); }
.text-dim     { color: var(--text-dim); }
.text-faint   { color: var(--text-faint); }
.text-center  { text-align: center; }
.text-upper   { text-transform: uppercase; letter-spacing: 0.1em; }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-sm       { gap: var(--space-sm); }
.gap-md       { gap: var(--space-md); }
.gap-lg       { gap: var(--space-lg); }

.hidden       { display: none !important; }
.sr-only      { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Card ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
}

/* ── Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px var(--space-xl);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  text-decoration: none;
}

.btn:hover   { opacity: 0.85; transform: translateY(-1px); }
.btn:active  { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--ns-yellow);
  color: #000;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  border-color: var(--ns-yellow);
  color: var(--ns-yellow);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-full { width: 100%; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a1a;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--ns-yellow);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 9999;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  opacity: 0;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Loading Spinner ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255,255,255,0.12);
  border-top-color: var(--ns-yellow);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Overlay Backdrop ── */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.overlay-sheet {
  background: #111;
  border-top: 2px solid var(--ns-yellow);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-2xl) var(--space-xl) var(--space-3xl);
  width: 100%;
  max-width: 480px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ── Input ── */
.input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 12px var(--space-lg);
  transition: border-color var(--transition);
  outline: none;
}

.input:focus {
  border-color: var(--ns-yellow);
}

.input::placeholder {
  color: var(--text-faint);
}
