/* =============================================================
   JB LIFE PLATFORM — DESIGN SYSTEM
   dashboard.css  |  Version 1.0  |  March 2026
   
   Load this on every dashboard page.
   All modules inherit from these variables and base classes.
   
   SECTIONS:
     1.  CSS Variables (design tokens)
     2.  Reset & Base
     3.  Typography
     4.  Layout — Desktop 3-Column
     5.  Layout — Mobile Card Stack
     6.  Layout — TV Display
     7.  Card Components
     8.  Module Headers
     9.  Data Display (stats, numbers, progress)
     10. Status & Color States
     11. Forms & Quick Entry
     12. Navigation
     13. Tribe Components
     14. Animations & Transitions
     15. Utility Classes
     16. Time-Based Mode Overrides
============================================================= */


/* =============================================================
   1. CSS VARIABLES — DESIGN TOKENS
   Never hardcode colors or fonts — always use these variables.
   Hex colors in CF <cfoutput> blocks need ## prefix.
============================================================= */

:root {
  /* --- Core Palette --- */
  --bg-base:       #121212;   /* page background */
  --bg-card:       #1f1f1f;   /* card / panel background */
  --bg-elevated:   #2a2a2a;   /* raised elements, dropdowns, hover */
  --bg-input:      #1a1a1a;   /* form inputs */
  --bg-overlay:    rgba(0, 0, 0, 0.75); /* modals, bottom sheets */

  /* --- Borders --- */
  --border:        #333333;
  --border-light:  #404040;
  --border-focus:  #D4622A;

  /* --- Text --- */
  --text-primary:  #f0f0f0;
  --text-secondary: #b0b0b0;
  --text-muted:    #707070;
  --text-cream:    #e8dcc8;
  --text-inverse:  #121212;

  /* --- Brand Accents --- */
  --accent:        #D4622A;   /* ember orange — CTAs, active states, alerts */
  --accent-hover:  #e8722e;
  --accent-dim:    rgba(212, 98, 42, 0.15);

  /* --- Semantic Colors --- */
  --positive:      #3ecf8e;   /* completed, revenue up, success */
  --positive-dim:  rgba(62, 207, 142, 0.12);
  --critical:      #e04040;   /* overdue, missed, danger */
  --critical-dim:  rgba(224, 64, 64, 0.12);
  --warning:       #f5a623;   /* due soon, approaching, caution */
  --warning-dim:   rgba(245, 166, 35, 0.12);
  --info:          #4a9eff;   /* informational, links */
  --info-dim:      rgba(74, 158, 255, 0.12);

  /* --- Module Identity Colors --- */
  --tribe:         #7B4FBF;   /* purple — all tribe/community context */
  --tribe-dim:     rgba(123, 79, 191, 0.15);
  --fitness:       #E05252;   /* red-orange — workout, fitness */
  --nutrition:     #52B08A;   /* green — food, nutrition */
  --finance:       #F0B429;   /* gold — money, revenue */
  --garden:        #6B9E3A;   /* natural green — garden, growing */
  --wellness:      #9B7FD4;   /* lavender — mindfulness, recovery */
  --learning:      #4A9EFF;   /* blue — knowledge, reading */
  --sustainability: #5EA85E;  /* forest green — sustainability, prep */

  /* --- Typography --- */
  --font-display:  'Oswald', 'Impact', sans-serif;
  --font-body:     'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

  /* --- Type Scale --- */
  --text-xs:    0.75rem;   /* 12px */
  --text-sm:    0.875rem;  /* 14px */
  --text-base:  1rem;      /* 16px */
  --text-lg:    1.125rem;  /* 18px */
  --text-xl:    1.25rem;   /* 20px */
  --text-2xl:   1.5rem;    /* 24px */
  --text-3xl:   1.875rem;  /* 30px */
  --text-4xl:   2.25rem;   /* 36px */
  --text-5xl:   3rem;      /* 48px */
  --text-tv:    4rem;      /* 64px — TV display numbers */
  --text-tv-lg: 6rem;      /* 96px — TV clock/primary stat */

  /* --- Spacing --- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* --- Radius --- */
  --radius-sm:  4px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow:      0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 30px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px rgba(212, 98, 42, 0.25);

  /* --- Transitions --- */
  --transition-fast:   0.15s ease;
  --transition:        0.25s ease;
  --transition-slow:   0.4s ease;

  /* --- Layout --- */
  --header-height:    64px;
  --sidebar-width:    280px;
  --column-gap:       20px;
  --card-padding:     1.5rem;
  --card-padding-sm:  1rem;
}


/* =============================================================
   2. RESET & BASE
============================================================= */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-hover); }

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
}

ul, ol { list-style: none; }

::selection {
  background-color: var(--accent-dim);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* =============================================================
   3. TYPOGRAPHY
============================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); text-transform: uppercase; letter-spacing: 0.08em; }

.text-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Module label — small uppercase label above a section */
.module-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* Stat number — the big number in a metric card */
.stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent  { color: var(--accent); }
.text-positive { color: var(--positive); }
.text-critical { color: var(--critical); }
.text-warning  { color: var(--warning); }


/* =============================================================
   4. LAYOUT — DESKTOP 3-COLUMN
============================================================= */

/* Full dashboard wrapper */
.dashboard-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top header bar */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.dashboard-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.dashboard-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Main content area below header */
.dashboard-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left sidebar — quick nav, profile, quick-add */
.dashboard-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Main columns container */
.dashboard-columns {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--column-gap);
  padding: var(--column-gap);
  overflow-y: auto;
  align-items: start;
}

/* Individual column */
.dashboard-column {
  display: flex;
  flex-direction: column;
  gap: var(--column-gap);
  min-width: 0;
}


/* =============================================================
   5. LAYOUT — MOBILE CARD STACK
============================================================= */

@media (max-width: 768px) {
  .dashboard-header {
    padding: 0 var(--space-4);
  }

  .dashboard-sidebar {
    display: none; /* replaced by bottom nav on mobile */
  }

  .dashboard-columns {
    grid-template-columns: 1fr;
    padding: var(--space-4);
    gap: var(--space-4);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-body {
    flex-direction: column;
    padding-bottom: 80px; /* bottom nav clearance */
  }

  /* Mobile bottom navigation */
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2);
    color: var(--text-muted);
    font-size: var(--text-xs);
    transition: color var(--transition-fast);
    min-width: 48px;
  }

  .mobile-nav-item.active,
  .mobile-nav-item:hover {
    color: var(--accent);
  }

  /* Mobile quick-add button */
  .mobile-fab {
    position: fixed;
    bottom: 84px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background-color: var(--accent);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    z-index: 201;
    transition: transform var(--transition-fast),
                background-color var(--transition-fast);
  }
  .mobile-fab:hover,
  .mobile-fab:active {
    background-color: var(--accent-hover);
    transform: scale(1.05);
  }
}


/* =============================================================
   6. LAYOUT — TV DISPLAY
   Applied when body has class .tv-mode
============================================================= */

.tv-mode {
  overflow: hidden;
  cursor: none; /* No cursor on TV */
}

.tv-mode .dashboard-sidebar,
.tv-mode .mobile-nav,
.tv-mode .mobile-fab {
  display: none;
}

.tv-mode .dashboard-header {
  padding: 0 var(--space-12);
  height: 80px;
}

.tv-mode .dashboard-columns {
  grid-template-columns: 1fr 1fr 1fr;
  padding: var(--space-8);
  gap: var(--space-6);
  height: calc(100vh - 80px);
  overflow: hidden;
}

/* TV numbers are enormous */
.tv-mode .stat-number {
  font-size: var(--text-tv);
}

.tv-mode .stat-number.stat-number--xl {
  font-size: var(--text-tv-lg);
}

.tv-mode h4 {
  font-size: var(--text-2xl);
}

.tv-mode .card {
  padding: var(--space-8);
}

.tv-mode .module-label {
  font-size: var(--text-sm);
}

/* TV clock */
.tv-clock {
  font-family: var(--font-display);
  font-size: var(--text-tv-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-primary);
}

.tv-date {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}


/* =============================================================
   7. CARD COMPONENTS
============================================================= */

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  transition: border-color var(--transition-fast);
}

.card:hover {
  border-color: var(--border-light);
}

.card--elevated {
  background-color: var(--bg-elevated);
  box-shadow: var(--shadow);
}

/* Card with colored left border — module identity */
.card--accent    { border-left: 3px solid var(--accent); }
.card--positive  { border-left: 3px solid var(--positive); }
.card--critical  { border-left: 3px solid var(--critical); }
.card--warning   { border-left: 3px solid var(--warning); }
.card--tribe     { border-left: 3px solid var(--tribe); }
.card--fitness   { border-left: 3px solid var(--fitness); }
.card--nutrition { border-left: 3px solid var(--nutrition); }
.card--finance   { border-left: 3px solid var(--finance); }
.card--garden    { border-left: 3px solid var(--garden); }
.card--wellness  { border-left: 3px solid var(--wellness); }
.card--learning  { border-left: 3px solid var(--learning); }
.card--sustainability { border-left: 3px solid var(--sustainability); }

/* Card inner sections */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.card-body {
  flex: 1;
}

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Metric card — single big stat */
.metric-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.metric-card .metric-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.metric-card .metric-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card .metric-change {
  font-size: var(--text-sm);
  font-weight: 600;
}

.metric-card .metric-change.up   { color: var(--positive); }
.metric-card .metric-change.down { color: var(--critical); }

/* Revenue/finance specific large display */
.revenue-display {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 700;
  color: var(--positive);
  letter-spacing: -0.03em;
  line-height: 1;
}

/* Quick stat row — 2-4 mini stats in a row */
.stat-row {
  display: flex;
  gap: var(--space-4);
}

.stat-mini {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-mini .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
}

.stat-mini .stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* =============================================================
   8. MODULE HEADERS
============================================================= */

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.module-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.module-icon {
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

.module-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Module empty state — motivational, not generic */
.module-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.module-empty .empty-headline {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  font-style: normal;
}


/* =============================================================
   9. DATA DISPLAY
============================================================= */

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  transition: width var(--transition-slow);
}

.progress-bar-fill--positive  { background-color: var(--positive); }
.progress-bar-fill--warning   { background-color: var(--warning); }
.progress-bar-fill--critical  { background-color: var(--critical); }
.progress-bar-fill--tribe     { background-color: var(--tribe); }

/* Progress with label */
.progress-labeled {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.progress-labeled-header {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.progress-labeled-header .label { color: var(--text-secondary); }
.progress-labeled-header .value { font-weight: 600; }

/* Streak counter */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background-color: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-display);
}

.streak-badge.streak-dead {
  background-color: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
}

/* Readiness score ring / display */
.readiness-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.readiness-number {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1;
}

/* Item list — schedule, tasks, bills, supplements */
.item-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.item-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background-color: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.item-row:hover {
  border-color: var(--border-light);
}

.item-row.completed {
  opacity: 0.5;
}

.item-row.completed .item-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.item-time {
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 48px;
}

.item-name {
  font-weight: 500;
  flex: 1;
}

.item-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Macro bar — nutrition totals */
.macro-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.macro-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.macro-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  width: 56px;
  flex-shrink: 0;
}

.macro-track {
  flex: 1;
}

.macro-value {
  font-size: var(--text-sm);
  font-weight: 600;
  min-width: 64px;
  text-align: right;
}


/* =============================================================
   10. STATUS & COLOR STATES
============================================================= */

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.badge--accent    { background-color: var(--accent-dim);    color: var(--accent);    border: 1px solid var(--accent); }
.badge--positive  { background-color: var(--positive-dim);  color: var(--positive);  border: 1px solid var(--positive); }
.badge--critical  { background-color: var(--critical-dim);  color: var(--critical);  border: 1px solid var(--critical); }
.badge--warning   { background-color: var(--warning-dim);   color: var(--warning);   border: 1px solid var(--warning); }
.badge--info      { background-color: var(--info-dim);      color: var(--info);      border: 1px solid var(--info); }
.badge--tribe     { background-color: var(--tribe-dim);     color: var(--tribe);     border: 1px solid var(--tribe); }
.badge--muted     { background-color: var(--bg-elevated);   color: var(--text-muted); border: 1px solid var(--border); }

/* Severity indicators — pulse animation for critical */
.severity-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.severity-dot--critical {
  background-color: var(--critical);
  animation: pulse-critical 1.5s ease-in-out infinite;
}

.severity-dot--warning   { background-color: var(--warning); }
.severity-dot--positive  { background-color: var(--positive); }
.severity-dot--info      { background-color: var(--info); }

@keyframes pulse-critical {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

/* Habit check circles */
.habit-check {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.habit-check.checked {
  background-color: var(--positive);
  border-color: var(--positive);
}

.habit-check:hover {
  border-color: var(--positive);
}


/* =============================================================
   11. FORMS & QUICK ENTRY
============================================================= */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  width: 100%;
  transition: border-color var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Inline quick-entry (one-liner, no label) */
.quick-input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  transition: border-color var(--transition-fast);
}

.quick-input:focus-within {
  border-color: var(--accent);
}

.quick-input input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: var(--text-sm);
}

/* AI chat input */
.ai-input-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ai-input-bar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.ai-input-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: var(--text-base);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border-light);
}
.btn-secondary:hover {
  background-color: var(--bg-elevated);
  border-color: var(--text-muted);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background-color: var(--bg-elevated);
}

.btn-danger {
  background-color: var(--critical-dim);
  color: var(--critical);
  border-color: var(--critical);
}
.btn-danger:hover {
  background-color: var(--critical);
  color: white;
}

.btn-tribe {
  background-color: var(--tribe-dim);
  color: var(--tribe);
  border-color: var(--tribe);
}
.btn-tribe:hover {
  background-color: var(--tribe);
  color: white;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}


/* =============================================================
   12. NAVIGATION
============================================================= */

/* Sidebar nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.sidebar-nav-item:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background-color: var(--accent-dim);
  color: var(--accent);
}

.sidebar-nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-nav-item .nav-badge {
  margin-left: auto;
  background-color: var(--accent);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

/* Section divider in sidebar */
.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--space-4) var(--space-4) var(--space-2);
}

/* Tab navigation — within a module */
.tab-bar {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

.tab-item {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-item:hover:not(.active) {
  color: var(--text-primary);
}


/* =============================================================
   13. TRIBE COMPONENTS
============================================================= */

/* Tribe member avatar row */
.member-avatars {
  display: flex;
  align-items: center;
}

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-card);
  background-color: var(--bg-elevated);
  overflow: hidden;
  margin-left: -8px;
  flex-shrink: 0;
}

.member-avatar:first-child { margin-left: 0; }

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-avatar-count {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--tribe-dim);
  color: var(--tribe);
  font-size: var(--text-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
  margin-left: -8px;
}

/* Resource listing card */
.listing-card {
  padding: var(--space-4);
  background-color: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color var(--transition-fast);
}

.listing-card:hover {
  border-color: var(--tribe);
}

.listing-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.listing-type-chip {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tribe);
  background-color: var(--tribe-dim);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}

/* Tribe feed post */
.tribe-post {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tribe-post:last-child { border-bottom: none; }

.tribe-post-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.tribe-post-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.tribe-post-content {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

.tribe-post-reactions {
  display: flex;
  gap: var(--space-3);
}

.reaction-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background-color: var(--bg-elevated);
  transition: all var(--transition-fast);
}

.reaction-btn:hover,
.reaction-btn.reacted {
  background-color: var(--tribe-dim);
  color: var(--tribe);
}

/* Tribe alert banner */
.tribe-alert {
  background-color: var(--critical-dim);
  border: 1px solid var(--critical);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--critical);
  font-size: var(--text-sm);
  font-weight: 500;
}

/* Map placeholder for tribe member map */
.tribe-map {
  width: 100%;
  height: 200px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

/* Readiness score gauge */
.readiness-gauge {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.readiness-gauge-bar {
  height: 12px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.readiness-gauge-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Color based on score */
.readiness-gauge-fill[data-score-class="low"]    { background-color: var(--critical); }
.readiness-gauge-fill[data-score-class="medium"] { background-color: var(--warning); }
.readiness-gauge-fill[data-score-class="good"]   { background-color: var(--positive); }
.readiness-gauge-fill[data-score-class="high"]   { background-color: #00e5b0; }


/* =============================================================
   14. ANIMATIONS & TRANSITIONS
============================================================= */

/* Module content fade-in on load */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* Staggered card reveal */
.card:nth-child(1) { animation: fadeIn 0.3s 0.05s ease both; }
.card:nth-child(2) { animation: fadeIn 0.3s 0.10s ease both; }
.card:nth-child(3) { animation: fadeIn 0.3s 0.15s ease both; }
.card:nth-child(4) { animation: fadeIn 0.3s 0.20s ease both; }
.card:nth-child(5) { animation: fadeIn 0.3s 0.25s ease both; }

/* Loading skeleton */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--bg-card)     50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-text  { height: 14px; width: 70%; margin-bottom: var(--space-2); }
.skeleton-title { height: 24px; width: 40%; margin-bottom: var(--space-4); }
.skeleton-block { height: 80px; width: 100%; }

/* Streak fire animation */
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  25%       { transform: scale(1.1) rotate(2deg); }
  75%       { transform: scale(0.95) rotate(-1deg); }
}

.streak-fire {
  display: inline-block;
  animation: flicker 0.8s ease-in-out infinite;
}

/* Number counter animation */
.counter-animate {
  transition: color 0.3s ease;
}

/* Bottom sheet slide up */
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.bottom-sheet {
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* TV content swap */
@keyframes tvFadeSlide {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.tv-content-enter {
  animation: tvFadeSlide 0.5s ease forwards;
}


/* =============================================================
   15. UTILITY CLASSES
============================================================= */

/* Display */
.d-flex         { display: flex; }
.d-grid         { display: grid; }
.d-block        { display: block; }
.d-none         { display: none; }
.d-inline-flex  { display: inline-flex; }

/* Flex */
.flex-col        { flex-direction: column; }
.flex-wrap       { flex-wrap: wrap; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.items-end       { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.ml-auto { margin-left: auto; }

/* Text alignment */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

/* Text sizes */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }

/* Font weight */
.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }
.font-display { font-family: var(--font-display); }

/* Spacing */
.p-0  { padding: 0; }
.p-2  { padding: var(--space-2); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* Width / sizing */
.w-full    { width: 100%; }
.h-full    { height: 100%; }
.min-w-0   { min-width: 0; }

/* Borders */
.border-top    { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Divider */
.divider {
  height: 1px;
  background-color: var(--border);
  margin: var(--space-4) 0;
}

/* Visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* =============================================================
   16. TIME-BASED MODE OVERRIDES
   Applied via JS class on body: .time-morning, .time-evening, etc.
   Subtle ambient shifts — same palette, different emphasis.
============================================================= */

/* Morning mode — slight warm tint, energized */
.time-morning .dashboard-header {
  border-bottom-color: #2a1f10;
}

.time-morning .tv-clock {
  color: var(--accent);
  text-shadow: 0 0 40px rgba(212, 98, 42, 0.3);
}

/* Night mode — reduce brightness slightly */
.time-night body {
  background-color: #0d0d0d;
}

.time-night .card {
  background-color: #181818;
}

.time-night .stat-number,
.time-night .revenue-display {
  opacity: 0.9;
}

/* TV night mode — even dimmer for late viewing */
.tv-mode.time-night {
  filter: brightness(0.85);
}

/* Emergency / alert mode — red wash when tribe alert fires */
.emergency-mode .dashboard-header {
  background-color: #1a0808;
  border-bottom-color: var(--critical);
}

.emergency-mode .tv-clock {
  color: var(--critical);
}


/* =============================================================
   END OF JB LIFE PLATFORM DESIGN SYSTEM v1.0
   
   USAGE NOTES FOR CF2016:
   - In <cfoutput>, hex colors: ##121212 not #121212
   - Import this file: <link rel="stylesheet" href="/assets/css/dashboard.css">
   - Google Fonts import (add to <head>):
     <link href="https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=DM+Sans:wght@400;500;600&display=swap" rel="stylesheet">
   - Capacitor native wrapper: no changes needed — all CSS works in WebView
============================================================= */

/* ============================================================
   ONBOARDING
   ============================================================ */

.ob-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-base);
}

.ob-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.ob-wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.ob-wordmark span { color: var(--accent); }

.ob-progress {
  display: flex;
  gap: 0.35rem;
  margin: 1.25rem 0;
  align-items: center;
}

.ob-progress-step {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background 0.3s;
}

.ob-progress-step.active  { background: var(--accent); }
.ob-progress-step.done    { background: var(--positive); }

.ob-screen-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.ob-screen-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Role selection grid */
.ob-roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ob-role-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.ob-role-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.ob-role-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.ob-role-check {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.65rem;
  color: #fff;
}

.ob-role-btn.selected .ob-role-check {
  background: var(--accent);
  border-color: var(--accent);
}

/* Option buttons (single select) */
.ob-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.ob-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.ob-option:hover    { border-color: var(--accent); }

.ob-option.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-primary);
}

.ob-option-dot {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}

.ob-option.selected .ob-option-dot {
  border-color: var(--accent);
  background: var(--accent);
}

/* Rank drag list */
.ob-rank-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.ob-rank-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
  font-size: 0.875rem;
  color: var(--text-primary);
  user-select: none;
}

.ob-rank-item:active { cursor: grabbing; }

.ob-rank-num {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  width: 1.25rem;
  flex-shrink: 0;
}

.ob-rank-handle {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: auto;
}

/* Commitment checkboxes */
.ob-commits {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.ob-commit {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ob-commit:hover    { border-color: var(--positive); }

.ob-commit.selected {
  border-color: var(--positive);
  background: var(--positive-dim);
}

.ob-commit-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
  margin-top: 1px;
  transition: background 0.15s, border-color 0.15s;
}

.ob-commit.selected .ob-commit-check {
  background: var(--positive);
  border-color: var(--positive);
}

.ob-commit-text {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.4;
}

.ob-commit-label  { font-weight: 500; color: var(--text-primary); }
.ob-commit-cat    { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

/* Goal textarea */
.ob-goal-input {
  width: 100%;
  min-height: 90px;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.55;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.ob-goal-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Navigation row */
.ob-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  align-items: center;
}

.ob-nav-back {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: border-color 0.15s, color 0.15s;
}

.ob-nav-back:hover { border-color: var(--text-muted); color: var(--text-primary); }

.ob-skip {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: var(--font-body);
}

.ob-skip:hover { color: var(--text-secondary); }

/* DOB row */
.ob-dob-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* Onboarding error */
.ob-error {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  background: var(--critical-dim);
  border: 1px solid var(--critical);
  color: var(--critical);
  display: none;
}

.ob-error.show { display: block; }

/* Premium locked feature card */
.premium-lock {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.premium-lock::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(212,98,42,0.05));
  pointer-events: none;
}

.premium-lock-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.premium-lock-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.premium-lock-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.premium-lock-for {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.75rem;
}


/* ============================================================
   LOYALTY CARDS
   ============================================================ */
.loyalty-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.loyalty-card:hover { border-color: var(--accent); }
.loyalty-card-store {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.loyalty-card-number {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.loyalty-card-points {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}
.loyalty-card-cat {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.loyalty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
@media (max-width: 480px) { .loyalty-grid { grid-template-columns: 1fr; } }

/* Barcode display overlay */
.barcode-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
}
.barcode-overlay-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  max-width: 360px;
  width: 100%;
}
.barcode-store-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 1rem;
}
.barcode-number {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #555;
  letter-spacing: 0.1em;
  margin-top: 0.75rem;
}

/* ============================================================
   WINS / GRATITUDE LOG
   ============================================================ */
.win-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.win-entry:last-child { border-bottom: none; }
.win-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--positive);
  flex-shrink: 0;
  margin-top: 5px;
}
.win-text {
  font-size: 0.875rem;
  flex: 1;
  line-height: 1.5;
}
.win-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.win-input-wrap {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.win-cat-pills {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.win-cat-pill {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.win-cat-pill.active {
  background: var(--positive-dim);
  color: var(--positive);
  border-color: var(--positive);
}

/* ============================================================
   BODY MEASUREMENTS
   ============================================================ */
.measurement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.measurement-label {
  color: var(--text-secondary);
  min-width: 80px;
}
.measurement-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}
.measurement-delta {
  font-size: 0.75rem;
  margin-left: 0.35rem;
}
.measurement-delta.up { color: var(--critical); }
.measurement-delta.down { color: var(--positive); }
.measurement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
}

/* ============================================================
   INCOME STREAMS
   ============================================================ */
.stream-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.6rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 0.35rem;
}
.stream-name {
  font-weight: 600;
  font-size: 0.875rem;
}
.stream-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stream-amount {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--positive);
}

/* ============================================================
   PREMIUM LOCK
   ============================================================ */
.premium-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #D4622A, #e8883a);
  color: #fff;
}

/* ============================================================
   WATER MODULE
   ============================================================ */
.water-glass {
  width: 32px;
  height: 40px;
  border-radius: 4px 4px 6px 6px;
  cursor: pointer;
  border: 2px solid var(--wellness);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg-elevated);
  transition: border-color 0.15s;
}
.water-glass:hover { border-color: var(--accent); }
.water-glass-fill {
  width: 100%;
  background: var(--wellness);
  transition: height 0.3s;
}
