/* ==========================================================================
   バルクアップ処方箋 - 筋トレ＆栄養＆ストレッチ管理アプリ CSS
   Theme: Vibrant Clean Light Mode + Theme Switcher Support
   ========================================================================== */

/* Light Theme Variables (Default) */
:root, body.light-theme {
  --bg-dark: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --border-color: rgba(226, 232, 240, 0.8);
  --border-focus: rgba(2, 132, 199, 0.5);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  /* Accent Colors - High Vibrancy for Light Theme */
  --primary: #0284c7;         /* Ocean Blue */
  --primary-glow: rgba(2, 132, 199, 0.15);
  --accent: #6366f1;          /* Indigo */
  --success: #059669;         /* Emerald Green */
  --success-glow: rgba(5, 150, 105, 0.2);
  --warning: #d97706;         /* Amber */
  --danger: #e11d48;          /* Rose */
  --cyan: #0891b2;

  /* Header & Sub-boxes */
  --header-bg: rgba(255, 255, 255, 0.88);
  --box-bg: rgba(241, 245, 249, 0.7);
  --input-bg: #ffffff;

  /* Fonts */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Spacing & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.2);
}

/* Dark Theme Variables Override */
body.dark-theme {
  --bg-dark: #0a0d14;
  --bg-card: rgba(22, 28, 45, 0.75);
  --bg-card-hover: rgba(30, 38, 60, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.5);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --accent: #818cf8;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.25);
  --warning: #fbbf24;
  --danger: #f43f5e;
  --cyan: #06b6d4;

  --header-bg: rgba(10, 13, 20, 0.85);
  --box-bg: rgba(15, 23, 42, 0.5);
  --input-bg: rgba(15, 23, 42, 0.8);

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(2, 132, 199, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(5, 150, 105, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* Glassmorphism Card Style */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(2, 132, 199, 0.25);
  box-shadow: var(--shadow-md);
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s ease;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-size: 1.15rem;
  line-height: 1.2;
}

.brand-text .badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.04);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

body.dark-theme .main-nav {
  background: rgba(255, 255, 255, 0.04);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(2, 132, 199, 0.08);
}

.nav-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.nav-btn i {
  width: 18px;
  height: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* App Main Layout */
.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Profile Banner */
.profile-banner {
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff, #f1f5f9);
  border-left: 5px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

body.dark-theme .profile-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.profile-info .avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(2, 132, 199, 0.1);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.profile-info .avatar i {
  width: 28px;
  height: 28px;
}

.profile-info h2 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.profile-info .sub-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.profile-meta i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.profile-targets {
  display: flex;
  gap: 1rem;
}

.target-card {
  background: var(--box-bg);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-width: 160px;
}

.target-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.target-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.target-sub {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

/* Grids & Cards */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.grid-3-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .grid-3-1 { grid-template-columns: 1fr; }
}

.card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title i {
  width: 22px;
  height: 22px;
}

.card-title h3 {
  font-size: 1.15rem;
}

/* Today Workout Card & Stretch Widget */
.today-routine-box, .stretch-widget-box {
  background: var(--box-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.routine-badge-large {
  display: inline-block;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: var(--primary);
  font-weight: 800;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.exercise-mini-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.exercise-mini-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border-color);
}

.exercise-mini-item:last-child {
  border-bottom: none;
}

/* 15-Minute Stretch Player Banner */
.stretch-player-banner {
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(16, 185, 129, 0.08));
  border: 2px solid var(--warning);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.player-current-step h3 {
  font-size: 1.3rem;
  margin: 0.3rem 0;
}

.player-timer-box {
  text-align: right;
}

.player-main-timer {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--warning);
  line-height: 1;
}

.player-sub-timer {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-tips-box {
  background: var(--box-bg);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--warning);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.margin-left-auto { margin-left: auto; }

/* 7 Stretch Cards Grid */
.stretch-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.stretch-card {
  padding: 1.25rem;
  background: var(--box-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.stretch-card.active-step {
  border: 2px solid var(--warning);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
  transform: scale(1.02);
}

.stretch-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.stretch-num-badge {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.82rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.stretch-time-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.stretch-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.stretch-title-group h4 {
  font-size: 1.05rem;
}

.stretch-tips-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Progress Sections */
.progress-section {
  margin-bottom: 1rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.protein-fill {
  background: linear-gradient(90deg, var(--cyan), var(--primary));
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.3);
}

.quick-add-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Principle Boxes */
.principle-box {
  background: var(--box-bg);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  position: relative;
}

.principle-num {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.06);
}

body.dark-theme .principle-num {
  color: rgba(255, 255, 255, 0.06);
}

.principle-box h4 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.principle-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.btn-success:hover {
  background: linear-gradient(135deg, #047857, #059669);
}

.btn-danger {
  background: rgba(225, 29, 72, 0.1);
  color: var(--danger);
  border-color: rgba(225, 29, 72, 0.25);
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

body.dark-theme .btn-outline {
  background: rgba(255, 255, 255, 0.04);
}

.btn-outline:hover {
  background: rgba(2, 132, 199, 0.08);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

body.dark-theme .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-xs { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
.btn-lg { padding: 0.8rem 1.75rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-icon { padding: 0.55rem; border-radius: var(--radius-sm); }

.input-field {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-family);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.select-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
}

/* Workout Logger Section */
.routine-selector-group {
  display: flex;
  gap: 0.75rem;
}

.workout-session-container {
  padding: 1.75rem;
  margin-top: 1.5rem;
}

.workout-session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.workout-date-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.exercise-card {
  background: var(--box-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s ease;
}

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

.exercise-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.exercise-name-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.exercise-name-area h4 {
  font-size: 1.1rem;
}

.exercise-meta-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.previous-record-tag {
  font-size: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--cyan);
  font-weight: 600;
}

body.dark-theme .previous-record-tag {
  background: rgba(255, 255, 255, 0.05);
}

/* Sets Table inside Exercise Card */
.sets-table {
  width: 100%;
  border-collapse: collapse;
}

.sets-table th {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.4rem;
  font-weight: 600;
}

.sets-table td {
  padding: 0.4rem;
  text-align: center;
}

.set-num-cell {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary);
  width: 50px;
}

.set-input-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.set-input-group .input-field {
  width: 75px;
  text-align: center;
}

.set-done-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

body.dark-theme .set-done-btn {
  background: rgba(255, 255, 255, 0.05);
}

.set-done-btn.done {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
  box-shadow: 0 0 12px var(--success-glow);
}

.workout-finish-bar {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.workout-summary-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.workout-summary-stats strong {
  color: var(--primary);
  font-size: 1.1rem;
}

/* Floating Timer Bar */
.timer-float-bar {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 2px solid var(--primary);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 20px rgba(2, 132, 199, 0.2);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-theme .timer-float-bar {
  background: rgba(15, 23, 42, 0.92);
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.timer-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.timer-info strong {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--primary);
}

.timer-controls {
  display: flex;
  gap: 0.4rem;
}

/* Nutrition Timeline Component */
.timing-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  padding-left: 2rem;
}

.timing-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 15px;
  bottom: 15px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--cyan), var(--accent));
}

.timing-step {
  position: relative;
  background: var(--box-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.timing-step-node {
  position: absolute;
  left: -2rem;
  top: 1.25rem;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-dark);
  border: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timing-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.timing-title-group h4 {
  font-size: 1.05rem;
  color: var(--primary);
}

.timing-nutrients-tag {
  font-size: 0.82rem;
  background: rgba(8, 145, 178, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(8, 145, 178, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-top: 0.2rem;
  display: inline-block;
  font-weight: 600;
}

.timing-food-recommendation {
  background: rgba(0, 0, 0, 0.03);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-top: 0.5rem;
  color: var(--text-muted);
}

body.dark-theme .timing-food-recommendation {
  background: rgba(255, 255, 255, 0.03);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 1.75rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.form-group .input-field {
  width: 100%;
}

/* Badges & Utilities */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.6rem;
  border-radius: var(--radius-sm);
}

.badge-primary { background: rgba(2, 132, 199, 0.12); color: var(--primary); border: 1px solid rgba(2, 132, 199, 0.3); }
.badge-success { background: rgba(5, 150, 105, 0.12); color: var(--success); border: 1px solid rgba(5, 150, 105, 0.3); }
.badge-warning { background: rgba(217, 119, 6, 0.12); color: var(--warning); border: 1px solid rgba(217, 119, 6, 0.3); }

.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-cyan { color: var(--cyan); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }

.divider {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 1.25rem 0;
}

.margin-top-xs { margin-top: 0.25rem; }
.margin-top-sm { margin-top: 0.5rem; }
.margin-top-md { margin-top: 1rem; }
.margin-top-lg { margin-top: 1.75rem; }
.margin-bottom-lg { margin-bottom: 1.75rem; }

.hidden { display: none !important; }

/* Table Styles */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--box-bg);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
  background: rgba(2, 132, 199, 0.04);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 260px;
}

.spin-icon {
  animation: spin 3s linear infinite;
}

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

.logs-list-compact {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-height: 230px;
  overflow-y: auto;
}

.logs-list-compact li {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  background: var(--box-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.split-schedule-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.schedule-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  padding: 0.5rem 0.75rem;
  background: var(--box-bg);
  border-radius: var(--radius-sm);
}

.day-badge {
  font-weight: 700;
  width: 60px;
  text-align: center;
}

.routine-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  width: 100px;
  text-align: center;
}

.tag-a { background: rgba(2, 132, 199, 0.12); color: var(--primary); }
.tag-b { background: rgba(99, 102, 241, 0.12); color: var(--accent); }
.tag-rest { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

/* Overload Alert Box */
.overload-alert {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), rgba(8, 145, 178, 0.1));
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.overload-alert-text h4 {
  color: var(--success);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.overload-alert-text p {
  font-size: 0.85rem;
  color: var(--text-main);
}
