/* Modern Reset and Design Tokens */
:root {
  --bg-primary: #090a10;
  --bg-secondary: #121422;
  --bg-glass: rgba(22, 26, 46, 0.55);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-glass-focus: rgba(255, 255, 255, 0.15);
  --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --text-main: #f1f3f9;
  --text-muted: #8d95ab;
  
  /* Accent Colors */
  --color-primary: #8a2be2;
  --color-primary-glow: rgba(138, 43, 226, 0.4);
  
  --color-protein: #00d2ff;
  --color-protein-glow: rgba(0, 210, 255, 0.35);
  --color-protein-light: rgba(0, 210, 255, 0.1);
  
  --color-carbs: #ffae00;
  --color-carbs-glow: rgba(255, 174, 0, 0.35);
  
  --color-fats: #ff007b;
  --color-fats-glow: rgba(255, 0, 123, 0.35);
  
  --color-sugar: #ff5e00;
  --color-sugar-light: rgba(255, 94, 0, 0.1);
  
  --color-fibers: #00e676;
  --color-fibers-light: rgba(0, 230, 118, 0.1);
  
  --color-salt: #7c4dff;
  --color-salt-light: rgba(124, 77, 255, 0.1);

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 10% 20%, rgba(138, 43, 226, 0.1) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(0, 210, 255, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(255, 0, 123, 0.04) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalScaleUp {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Custom Text utilities */
.text-protein { color: var(--color-protein); }
.text-carbs { color: var(--color-carbs); }
.text-fats { color: var(--color-fats); }
.text-remaining { color: #5cffb6; }
.text-muted { color: var(--text-muted); }
.cursor-pointer { cursor: pointer; }
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar Navigation Styling */
.sidebar {
  width: 280px;
  background-color: #0c0e18;
  border-right: 1px solid var(--border-glass);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  z-index: 10;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.brand-logo {
  background: linear-gradient(135deg, var(--color-primary), var(--color-protein));
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}

.brand-icon {
  color: #fff;
  width: 22px;
  height: 22px;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.nav-btn {
  background: none;
  border: 0;
  color: var(--text-muted);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn i {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.nav-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), rgba(138, 43, 226, 0.4));
  box-shadow: 0 4px 20px var(--color-primary-glow);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-glass);
  padding-top: 1.5rem;
}

.calendar-quick {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calendar-quick label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-input {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  width: 100%;
  cursor: pointer;
  outline: none;
  transition: border 0.3s;
}

.date-input:focus {
  border-color: var(--color-primary);
}

/* Main Content Styling */
.main-content {
  flex-grow: 1;
  padding: 2.5rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
  width: calc(100% - 280px);
  overflow-y: auto;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.header-title h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.quick-stats-bar {
  display: flex;
  gap: 2rem;
}

.quick-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.qs-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.qs-value {
  font-size: 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.tab-panel.active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.col-span-2 {
  grid-column: span 2;
}

/* Goals Page Presets & Layout */
.goals-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  align-items: start;
}

/* Settings Page Layout */
.settings-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  align-items: start;
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
}

#mobile-calendar-toggle {
  display: none;
}

/* Responsiveness */
/* Responsive Media Queries & Visibility Utilities */
.hidden-desktop {
  display: none !important;
}

@media (max-width: 1024px) {
  .hidden-desktop {
    display: block !important;
  }
  .hidden-mobile {
    display: none !important;
  }
  
  .app-container {
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
  }
  
  /* Fixed Top brand header bar */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    border-right: 0;
    border-bottom: 1px solid var(--border-glass);
    padding: 0 2rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background-color: #0c0e18;
    z-index: 100;
    overflow: visible;
  }
  
  .brand {
    margin-bottom: 0;
  }
  
  /* Fixed Bottom Navigation Bar */
  .nav-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75px;
    background-color: #0c0e18;
    border-top: 1px solid var(--border-glass);
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 1rem;
    margin: 0;
    z-index: 100;
  }
  
  .nav-btn {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-align: center;
    width: auto;
    height: 100%;
    flex: 1;
    background: none;
    border: 0;
  }
  
  .nav-btn span {
    font-size: 0.75rem;
    display: block;
  }
  
  #mobile-calendar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.2s;
  }
  #mobile-calendar-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .sidebar-footer {
    display: none !important; /* Hide by default on mobile unless toggled open */
    position: absolute;
    top: 70px; /* aligns directly below header */
    left: 0;
    width: 100%;
    background-color: #0c0e18;
    border-bottom: 1px solid var(--border-glass);
    padding: 1.5rem !important;
    margin-top: 0 !important;
    z-index: 99;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .sidebar-footer.open {
    display: flex !important;
  }
  
  .sidebar-section {
    border-top: 1px solid var(--border-glass);
    padding: 1.5rem 0;
  }
  
  .main-content {
    width: 100%;
    padding: 2rem 1.5rem;
    margin-top: 70px; /* Offset for top brand bar */
    margin-bottom: 75px; /* Offset for bottom nav bar */
    overflow-y: visible;
    height: auto;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .col-span-2 {
    grid-column: span 1;
  }
  
  .sub-nutrients-grid {
    grid-template-columns: 1fr;
  }
  
  .goals-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    height: 60px;
    padding: 0 1.5rem;
    justify-content: space-between;
  }
  
  .sidebar-footer {
    top: 60px;
  }
  
  .nav-menu {
    height: 65px;
    padding: 0.25rem;
  }
  
  .nav-btn {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
    gap: 0.1rem;
  }
  
  .nav-btn span {
    display: none !important; /* Hide text on small screens */
  }
  
  .main-content {
    margin-top: 60px;
    margin-bottom: 65px;
    padding: 1.25rem 1rem;
  }
  
  .sidebar-section {
    padding: 1.25rem 0;
  }
  
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .header-right-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .quick-stats-bar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem 0.5rem;
  }
  
  .quick-stat {
    align-items: flex-start;
    flex: 1 1 30%;
    min-width: 100px;
  }
  
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Sections General Styling */
.sidebar-section {
  border-top: 1px solid var(--border-glass);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-section h5 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Monthly Calendar Styling */
.calendar-section {
  gap: 0.5rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.calendar-header h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.calendar-header .btn-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  padding: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.calendar-grid .weekday {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.cal-day:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.cal-day.empty {
  background: transparent;
  border: 0;
  cursor: default;
  pointer-events: none;
}

.cal-day.today {
  border: 1.5px solid var(--color-protein);
  color: #fff;
}

.cal-day.active {
  background: linear-gradient(135deg, var(--color-primary), rgba(138, 43, 226, 0.6)) !important;
  color: #fff !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.4);
}

/* Indicators in Calendar Cells */
.cal-day-indicators {
  position: absolute;
  bottom: 2px;
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
}

.indicator-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.indicator-dot.diet-met {
  background-color: #00e676; /* Green */
  box-shadow: 0 0 4px #00e676;
}

.indicator-dot.diet-over {
  background-color: #ff3366; /* Red */
  box-shadow: 0 0 4px #ff3366;
}

.indicator-dot.workout-done {
  background-color: var(--color-protein); /* Light Blue */
  box-shadow: 0 0 4px var(--color-protein);
}

/* Weight Logger Styling */
.weight-input-group {
  display: flex;
  gap: 0.5rem;
}

.weight-input-group input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
}

.weight-input-group input:focus {
  border-color: var(--color-primary);
}

.weight-input-group button {
  width: 38px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
}

/* Weight chart styling */
.chart-wrapper {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.5rem;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sparkline-chart {
  width: 100%;
  height: 100%;
}

/* Warning Banner Styling */
.warning-banner {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: fadeIn 0.4s ease;
  font-size: 0.85rem;
}

.warning-banner.past-date {
  border: 1px solid rgba(255, 145, 0, 0.25);
  box-shadow: 0 4px 15px rgba(255, 145, 0, 0.05);
}

.warning-banner.future-date {
  border: 1px solid rgba(0, 176, 255, 0.25);
  box-shadow: 0 4px 15px rgba(0, 176, 255, 0.05);
}

.warning-banner.hidden {
  display: none !important;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  font-weight: 500;
}

.banner-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.banner-icon.text-warning {
  color: #ffb300;
}

.banner-icon.text-info {
  color: #00b0ff;
}

.banner-action-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.banner-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Clickable Headers & Month Selector */
.clickable-header {
  cursor: pointer;
  transition: color 0.2s ease;
}

.clickable-header:hover {
  color: var(--color-primary) !important;
}

#cal-month-title {
  cursor: pointer;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

#cal-month-title:hover {
  color: var(--color-primary) !important;
  text-decoration: underline;
}

/* Large Calendar Weight Grid */
.weight-history-day {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  min-height: 90px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.weight-history-day:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-primary);
}

.weight-history-day.empty {
  background: transparent;
  border: 0;
  cursor: default;
  pointer-events: none;
}

.weight-history-day.today {
  border-color: var(--color-protein);
}

.weight-history-day.today .day-num {
  color: var(--color-protein);
}

.weight-history-day.active {
  border-color: var(--color-primary);
  background: rgba(138, 43, 226, 0.05);
}

.weight-history-day .day-num {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.weight-history-day .day-weight-val {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  text-align: right;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.2rem;
}

.weight-history-day .day-weight-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.weight-cell-edit-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  width: 75px;
  text-align: right;
  padding: 0.2rem 0.4rem;
  outline: none;
  box-shadow: 0 0 8px rgba(138, 43, 226, 0.3);
}

/* Remove default number input spinner styles */
.weight-cell-edit-input::-webkit-outer-spin-button,
.weight-cell-edit-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.weight-cell-edit-input {
  -moz-appearance: textfield;
}
/* Dashboard Cards & Layout */
.dashboard-card {
  border-radius: 20px;
  padding: 1.75rem;
  border: 1px solid var(--border-glass);
  transition: transform 0.3s, box-shadow 0.3s;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-glow);
}

.glass {
  background-color: #121422;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

/* Badges */
.badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-outline {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-muted);
}

.badge-protein {
  background: var(--color-protein-light);
  color: var(--color-protein);
}

.badge-cut {
  background: rgba(255, 0, 123, 0.1);
  color: var(--color-fats);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Circular SVG Progress Ring Chart */
.main-chart-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.circle-chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 230px;
  margin: 1rem auto;
  width: 230px;
}

.progress-ring {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 7;
}

.ring-fg {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 251.2; /* 2 * PI * 40 */
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 6px var(--color-primary));
}

.ring-center-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
}

.ring-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ring-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Macro Rows Progress Bars */
.macros-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
  height: 100%;
  min-height: 200px;
}

.macro-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.macro-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.macro-name {
  font-weight: 700;
  font-family: var(--font-display);
}

.macro-values {
  font-weight: 600;
  color: var(--text-main);
}

.progress-bar-bg {
  height: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.progress-bar-fg {
  height: 100%;
  border-radius: 6px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.progress-bar-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
  z-index: 2;
  pointer-events: none;
  display: none;
}

.bg-protein {
  background: linear-gradient(90deg, #0084ff, var(--color-protein));
  box-shadow: 0 0 10px var(--color-protein-glow);
}

.bg-carbs {
  background: linear-gradient(90deg, #ff8c00, var(--color-carbs));
  box-shadow: 0 0 10px var(--color-carbs-glow);
}

.bg-fats {
  background: linear-gradient(90deg, #d500f9, var(--color-fats));
  box-shadow: 0 0 10px var(--color-fats-glow);
}

.macro-remaining {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

/* Secondary Sub-nutrients Grid */
.sub-nutrients-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.sub-nutrient-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1.25rem;
  border-radius: 16px;
}

.sn-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bg-sugar-light { background-color: var(--color-sugar-light); }
.bg-fibers-light { background-color: var(--color-fibers-light); }
.bg-salt-light { background-color: var(--color-salt-light); }

.text-sugar { color: var(--color-sugar); }
.text-fibers { color: var(--color-fibers); }
.text-salt { color: var(--color-salt); }

.sn-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-grow: 1;
}

.sn-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sn-val {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.sn-bar-bg {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.2rem;
}

.sn-bar-fg {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.6s ease;
}

.bg-sugar { background-color: var(--color-sugar); }
.bg-fibers { background-color: var(--color-fibers); }
.bg-salt { background-color: var(--color-salt); }

/* Table design */
.table-container {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.log-table th {
  padding: 1rem;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.log-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.log-table tr:last-child td {
  border-bottom: 0;
}

.log-item-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.log-food-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
}

.log-item-details {
  display: flex;
  flex-direction: column;
}

.log-food-name {
  font-weight: 600;
}

.log-food-brand {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.empty-state-row {
  text-align: center;
}

.table-empty-state {
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.empty-icon {
  width: 40px;
  height: 40px;
  color: var(--text-muted);
  opacity: 0.5;
}

.table-empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Buttons */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #6f1cc0);
  color: #fff;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(138, 43, 226, 0.5);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-glass-focus);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ff3366;
}

/* Forms & Inputs */
.narrow-container {
  max-width: 600px;
  margin: 0 auto;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  padding: 2rem;
}

.form-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.relative {
  position: relative;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="number"] {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.2);
}

.form-group input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.custom-select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.custom-select option {
  background-color: var(--bg-secondary);
  color: var(--text-main);
}

.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-suffix input {
  width: 100%;
  padding-right: 2.5rem !important;
}

.input-with-suffix .suffix {
  position: absolute;
  right: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Suggestions Autocomplete Box */
.suggestions-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #16192e;
  border: 1px solid var(--border-glass-focus);
  border-radius: 10px;
  margin-top: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow-glow);
}

.suggestions-box.hidden {
  display: none;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.suggestion-item:last-child {
  border-bottom: 0;
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.suggestion-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
}

.suggestion-info {
  display: flex;
  flex-direction: column;
}

.suggestion-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.suggestion-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Selected Food Preview Card */
.selected-food-preview {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.5rem;
  animation: fadeIn 0.3s ease;
}

.selected-food-preview.hidden {
  display: none;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.food-logo-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.preview-titles h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.preview-titles p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.preview-stat-box {
  background: rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  border-radius: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.preview-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.preview-stat-val {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Live portion calculation box */
.live-calc-card {
  background: rgba(138, 43, 226, 0.05);
  border: 1px solid rgba(138, 43, 226, 0.15);
  border-radius: 12px;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.live-calc-card.hidden {
  display: none;
}

.calc-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.calc-item {
  display: flex;
  flex-direction: column;
}

.calc-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.calc-val {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

/* Foods Library catalog search & grid */
.library-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 2rem;
}

.search-bar-container {
  position: relative;
  flex-grow: 1;
  max-width: 500px;
}

.search-bar-container input {
  width: 100%;
  background: rgba(22, 26, 46, 0.55);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s;
}

.search-bar-container input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

.foods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.food-card {
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  background: #121422;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  transition: all 0.3s;
  position: relative;
}

.food-card:hover {
  box-shadow: var(--shadow-glow);
  border-color: var(--border-glass-focus);
}

.food-card-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.food-card-delete-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ff6b6b;
}

.food-card-edit-btn {
  position: absolute;
  top: 12px;
  right: 46px;
  z-index: 10;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.food-card-edit-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.food-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.food-card-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.food-card-title {
  display: flex;
  flex-direction: column;
  padding-right: 76px; /* Prevents text overlapping with edit/delete buttons */
}

.food-card-title h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.food-card-brand {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.food-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: auto;
}

.stat-box {
  background: rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  text-align: center;
}

.stat-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
  text-transform: uppercase;
}

.stat-val {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Modals & Dialog Drawers */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 7, 13, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 650px;
  border-radius: 20px;
  border: 1px solid var(--border-glass-focus);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-body-scroll {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-divider {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.5rem;
  margin-top: 0.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.1);
}

/* Image Upload Widgets */
.image-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.custom-file-upload {
  border: 1px dashed var(--border-glass-focus);
  border-radius: 8px;
  padding: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}

.custom-file-upload input[type="file"] {
  display: none;
}

.custom-file-upload:hover {
  border-color: var(--color-primary);
  color: #fff;
  background: rgba(255, 255, 255, 0.02);
}

.upload-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview img.hidden {
  display: none;
}

/* Goals Presets Cards */
.presets-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.presets-body .description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.presets-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.preset-card {
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
  padding: 1.25rem;
  transition: all 0.2s;
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-primary);
}

.preset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.preset-header h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.preset-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.preset-values {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.preset-values span {
  margin: 0 0.25rem;
}

/* Workout Tracker Styles */
.workout-exercises-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.workout-exercise-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 1.25rem;
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}

.workout-exercise-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.we-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.we-title-area {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.we-number {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-protein);
  letter-spacing: 0.5px;
}

.we-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.we-target {
  font-size: 0.8rem;
}

.we-skip-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

.we-skip-toggle:hover {
  background: rgba(255, 0, 123, 0.1);
  color: var(--color-fats);
  border-color: rgba(255, 0, 123, 0.2);
}

.we-skip-toggle input {
  cursor: pointer;
}

.we-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.skipped-exercise {
  opacity: 0.4;
  border-color: rgba(255, 255, 255, 0.02) !important;
  background: rgba(0, 0, 0, 0.1) !important;
}

.skipped-exercise .we-number {
  color: var(--text-muted);
}

.skipped-exercise .we-skip-toggle {
  background: rgba(255, 0, 123, 0.2);
  color: #fff;
  border-color: rgba(255, 0, 123, 0.3);
}

@media (max-width: 576px) {
  .we-inputs-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Sodium-Potassium-Fluid Balancing Widget Custom Styles */
.balance-widget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .balance-widget-grid {
    grid-template-columns: 1fr;
  }
}

.balance-gauge-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1.25rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.bg-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.bg-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--color-protein);
  text-shadow: 0 0 10px var(--color-protein-glow);
}

.bg-bar-wrapper {
  margin-bottom: 1.25rem;
}

.bg-bar-track {
  height: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bg-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #00b0ff, var(--color-protein));
  box-shadow: 0 0 10px var(--color-protein-glow);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-details-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.bg-detail-item {
  display: flex;
  gap: 0.25rem;
}

.bg-detail-lbl {
  color: var(--text-muted);
}

.bg-detail-val {
  font-weight: 700;
  color: #fff;
}

.strain-indicator-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1.25rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.si-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.si-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.si-ratio-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.si-tiers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.si-tier {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  opacity: 0.4;
  transition: all 0.3s ease;
}

.si-tier.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.04);
}

#tier-optimum.active {
  border-color: rgba(0, 230, 118, 0.3);
  background: rgba(0, 230, 118, 0.06);
}
#tier-optimum.active .tier-icon, 
#tier-optimum.active .tier-name {
  color: #00e676;
}

#tier-moderate.active {
  border-color: rgba(255, 140, 0, 0.3);
  background: rgba(255, 140, 0, 0.06);
}
#tier-moderate.active .tier-icon, 
#tier-moderate.active .tier-name {
  color: #ff8c00;
}

#tier-high.active {
  border-color: rgba(255, 51, 102, 0.3);
  background: rgba(255, 51, 102, 0.06);
}
#tier-high.active .tier-icon, 
#tier-high.active .tier-name {
  color: #ff3366;
}

.tier-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tier-info {
  display: flex;
  flex-direction: column;
}

.tier-name {
  font-weight: 700;
  font-size: 0.85rem;
}

.tier-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.balance-buffer-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 12px;
}

.bbf-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bbf-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bbf-info {
  display: flex;
  flex-direction: column;
}

.bbf-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bbf-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

/* Smart Portion Advisor Card & Preview Banner */
.advisor-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.advisor-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.suggestion-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem;
  border-radius: 12px;
}

.suggestion-food-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.suggestion-food-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.suggestion-food-details {
  display: flex;
  flex-direction: column;
}

.suggestion-food-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.suggestion-action-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.suggestion-savings {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.8rem;
  color: #00e676; /* Green color representing savings */
}

.suggestion-savings-value {
  font-weight: 700;
}

/* Hypothetical Preview Banner */
.preview-banner {
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(213, 0, 249, 0.2));
  border: 1px solid rgba(255, 140, 0, 0.3);
  box-shadow: 0 0 15px rgba(255, 140, 0, 0.1);
  color: #fff;
}
.preview-banner.warning-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}
.preview-banner-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
#preview-confirm-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Advisor Mode Selector Group */
.advisor-mode-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0.25rem;
  margin-bottom: 1.25rem;
  gap: 0.25rem;
}

.advisor-mode-selector .btn {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-display);
  font-weight: 600;
}

.advisor-mode-selector .btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.advisor-mode-selector .btn.active {
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 0 10px rgba(0, 180, 255, 0.3);
}

/* Suggestion badges for different actions */
.suggestion-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 0.5rem;
  display: inline-block;
  vertical-align: middle;
}

.suggestion-badge.badge-remove {
  background: rgba(255, 51, 102, 0.15);
  color: #ff3366;
}

.suggestion-badge.badge-add {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
}

.suggestion-badge.badge-replace {
  background: rgba(0, 180, 255, 0.15);
  color: var(--color-primary);
}

.advisor-mode-selector button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
}

/* --- Premium Light Theme Tokens & Overrides --- */
body.light-theme {
  --bg-primary: #f3f4f6;
  --bg-secondary: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-glass-focus: rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
  
  --text-main: #1f2937;
  --text-muted: #4b5563;
}

body.light-theme {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 10% 20%, rgba(138, 43, 226, 0.03) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(0, 210, 255, 0.03) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(255, 0, 123, 0.02) 0px, transparent 50%);
  color: var(--text-main);
}

body.light-theme .sidebar {
  background-color: #f9fafb;
  border-right: 1px solid var(--border-glass);
}

body.light-theme .brand-text h1 {
  background: linear-gradient(to right, #1f2937, #4b5563);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .nav-btn:hover {
  background-color: rgba(0, 0, 0, 0.02);
  color: var(--text-main);
}

body.light-theme .nav-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), rgba(138, 43, 226, 0.7));
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.25);
}

body.light-theme .date-input,
body.light-theme select {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #1f2937 !important;
}

body.light-theme select option {
  background-color: #ffffff !important;
  color: #1f2937 !important;
}

body.light-theme .dashboard-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-glow);
}

body.light-theme .dashboard-card h3,
body.light-theme .dashboard-card h4,
body.light-theme .dashboard-card h5 {
  color: #111827;
}

body.light-theme .ring-center-content .ring-number {
  color: #111827;
}

body.light-theme .progress-ring .ring-bg {
  stroke: rgba(0, 0, 0, 0.05);
}

body.light-theme .progress-bar-bg,
body.light-theme .sn-bar-bg,
body.light-theme .bg-bar-track {
  background: rgba(0, 0, 0, 0.05);
}

body.light-theme .cal-day {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.03);
  color: #1f2937;
}

body.light-theme .cal-day:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #000;
}

body.light-theme .cal-day.today {
  border-color: var(--color-protein);
}

body.light-theme .cal-day.active {
  background: linear-gradient(135deg, var(--color-primary), rgba(138, 43, 226, 0.8)) !important;
  color: #fff !important;
}

body.light-theme .log-table th {
  background: rgba(0, 0, 0, 0.02);
  color: #4b5563;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .log-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: #1f2937;
}

body.light-theme .log-food-name,
body.light-theme .we-name {
  color: #111827;
}

body.light-theme .weight-history-day {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .weight-history-day:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--color-primary);
}

body.light-theme .weight-history-day .day-weight-val {
  color: #111827;
}

body.light-theme .modal-card {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body.light-theme .modal-card h3 {
  color: #111827;
}

body.light-theme .form-group label {
  color: #374151;
}

body.light-theme .form-group input:not([type="checkbox"]):not([type="radio"]) {
  background-color: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1f2937;
}

body.light-theme .form-group input:focus {
  border-color: var(--color-primary);
  background-color: #fff;
}

body.light-theme .workout-exercise-card {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .workout-exercise-card.skipped-exercise {
  background: rgba(0, 0, 0, 0.04) !important;
  opacity: 0.65;
}

body.light-theme .advisor-mode-selector {
  background: rgba(0, 0, 0, 0.04);
}

body.light-theme .advisor-mode-selector .btn:hover {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-main);
}

body.light-theme .advisor-mode-selector .btn.active {
  background: var(--color-primary);
  color: #fff;
}

body.light-theme .warning-banner {
  background: rgba(0, 0, 0, 0.02);
}

body.light-theme .warning-banner.past-date {
  border-color: rgba(255, 145, 0, 0.35);
}

body.light-theme .warning-banner.future-date {
  border-color: rgba(0, 176, 255, 0.35);
}

/* Specific Light Theme Input & Button Overrides for visual excellence */
body.light-theme input[type="text"],
body.light-theme input[type="number"],
body.light-theme input[type="date"],
body.light-theme select,
body.light-theme textarea,
body.light-theme .custom-select,
body.light-theme .search-bar-container input,
body.light-theme .weight-input-group input,
body.light-theme .weight-cell-edit-input {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #1f2937 !important;
}

body.light-theme input::placeholder {
  color: #9ca3af !important;
}

body.light-theme .btn-outline {
  color: #1f2937 !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  background: transparent !important;
}

body.light-theme .btn-outline:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #111827 !important;
}

body.light-theme .btn-icon {
  color: #4b5563 !important;
}

body.light-theme .btn-icon:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #111827 !important;
}

body.light-theme .sidebar-section h5,
body.light-theme .sidebar-section h5 i {
  color: #1f2937 !important;
}

body.light-theme #cal-month-title {
  color: #1f2937 !important;
}

@media (max-width: 1024px) {
  body.light-theme .sidebar {
    background-color: #f9fafb;
    border-bottom: 1px solid var(--border-glass);
  }
  body.light-theme .nav-menu {
    background-color: #f9fafb;
    border-top: 1px solid var(--border-glass);
  }
}

/* --- Arabic RTL Text Wrapping & Order Alignments --- */
body.lang-rtl {
  text-align: right;
}

body.lang-rtl p,
body.lang-rtl h1,
body.lang-rtl h2,
body.lang-rtl h3,
body.lang-rtl h4,
body.lang-rtl h5,
body.lang-rtl span,
body.lang-rtl label,
body.lang-rtl input,
body.lang-rtl textarea,
body.lang-rtl select,
body.lang-rtl td,
body.lang-rtl th,
body.lang-rtl div {
  text-align: right;
}

body.lang-rtl .nav-btn {
  text-align: right;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 1rem;
}

body.lang-rtl .brand {
  flex-direction: row-reverse;
}

body.lang-rtl .card-header {
  flex-direction: row-reverse;
}

body.lang-rtl .top-header {
  flex-direction: row-reverse;
}

body.lang-rtl .quick-stats-bar {
  flex-direction: row-reverse;
}

body.lang-rtl .quick-stat {
  align-items: flex-start;
}

body.lang-rtl .we-header {
  flex-direction: row-reverse;
}

body.lang-rtl .we-title-area {
  text-align: right;
}

body.lang-rtl .form-group label i {
  margin-left: 0.5rem;
  margin-right: 0;
}

body.lang-rtl .input-with-suffix {
  flex-direction: row-reverse;
}

body.lang-rtl .sn-info {
  text-align: right;
  margin-left: 0;
  margin-right: 1rem;
}

body.lang-rtl .sn-val {
  text-align: right;
}

body.lang-rtl .bbf-info {
  margin-left: 0;
  margin-right: 1rem;
}

body.lang-rtl .si-ratio-badge {
  text-align: right;
}

body.lang-rtl .si-tier {
  flex-direction: row-reverse;
}

body.lang-rtl .tier-info {
  margin-left: 0;
  margin-right: 1.25rem;
}

body.lang-rtl .log-item-details {
  margin-left: 0;
  margin-right: 1rem;
}

body.lang-rtl .suggestion-food-details {
  margin-left: 0;
  margin-right: 1rem;
}

body.lang-rtl .suggestion-badge {
  margin-right: 0;
  margin-left: 0.5rem;
}

body.lang-rtl .suggestion-item-row {
  flex-direction: row-reverse;
}

body.lang-rtl .suggestion-savings {
  align-items: flex-start;
}

body.lang-rtl .preset-header {
  flex-direction: row-reverse;
}

body.lang-rtl .modal-header {
  flex-direction: row-reverse;
}

body.lang-rtl .modal-header h3 {
  text-align: right;
}

body.lang-rtl .modal-footer {
  flex-direction: row-reverse;
}

/* --- Import Conflict Resolution Layout styles --- */
.conflict-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s;
}

body.light-theme .conflict-item-card {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.08);
}

.conflict-date-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.5rem;
}

body.light-theme .conflict-date-title {
  color: #111827;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.conflict-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .conflict-columns {
    grid-template-columns: 1fr;
  }
}

.conflict-col {
  background: rgba(255, 255, 255, 0.01);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .conflict-col {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

.conflict-col:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
}

body.light-theme .conflict-col:hover {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.02);
}

.conflict-col.active {
  border-color: #00e676;
  background: rgba(0, 230, 118, 0.03);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.15);
}

.conflict-col.imported-col.active {
  border-color: #00b0ff;
  background: rgba(0, 176, 255, 0.03);
  box-shadow: 0 0 12px rgba(0, 176, 255, 0.15);
}

.col-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

body.lang-rtl .col-badge {
  right: auto;
  left: 0.75rem;
}

.col-badge.badge-imported {
  background: rgba(0, 176, 255, 0.15);
  color: #00b0ff;
}

.col-summary {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-top: 1rem;
}

.col-detail-items {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  max-height: 80px;
  overflow-y: auto;
  margin: 0.25rem 0 0.5rem 0;
  padding-left: 0.5rem;
  border-left: 2px solid var(--border-glass);
}

body.lang-rtl .col-detail-items {
  padding-left: 0;
  padding-right: 0.5rem;
  border-left: none;
  border-right: 2px solid var(--border-glass);
}

/* Global utilities */
.hidden {
  display: none !important;
}

body.light-theme .chart-wrapper {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Light Theme overrides for Food Cards in Food Library */
body.light-theme .food-card {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: var(--shadow-glow);
}

body.light-theme .food-card:hover {
  border-color: var(--color-primary) !important;
}

body.light-theme .food-card-title h4 {
  color: #111827 !important;
}

body.light-theme .stat-box {
  background: rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .food-card-edit-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #4b5563 !important;
}

body.light-theme .food-card-edit-btn:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #111827 !important;
}

body.light-theme .food-card-logo {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Light Theme overrides for Log Intake suggestions dropdown and preview card */
body.light-theme .selected-food-preview {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: var(--shadow-glow);
}

body.light-theme .preview-stat-box {
  background: rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .preview-titles h4 {
  color: #111827 !important;
}

body.light-theme .suggestions-box {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .suggestion-item {
  border-bottom-color: rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .suggestion-item:hover {
  background: rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .suggestion-name {
  color: #111827 !important;
}

body.light-theme .suggestion-logo {
  background: rgba(0, 0, 0, 0.02) !important;
}

/* Cloud Sync / Auth Panel Custom Styles */
.text-error {
  color: #ff1744 !important;
}

.text-success {
  color: #00e676 !important;
}

#auth-form input:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

#settings-auth-card .btn-outline:hover {
  background: rgba(255, 23, 68, 0.1) !important;
}

/* Light Theme overrides for Auth Card */
body.light-theme #auth-logged-in div[style*="background: rgba(0, 230, 118, 0.05)"] {
  background: rgba(0, 200, 83, 0.05) !important;
  border-color: rgba(0, 200, 83, 0.2) !important;
}

/* Header Account Widget */
.header-account-widget {
  position: relative;
}

.user-dropdown-container {
  position: relative;
}

.user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 0.5rem 0.85rem;
  border-radius: 50px;
  cursor: pointer;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.user-profile-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #ab47bc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  min-width: 180px;
  padding: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-dropdown-menu.hidden {
  display: none;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.dropdown-item.text-error:hover {
  background: rgba(255, 23, 68, 0.08);
  color: #ff1744;
}

/* Light Theme overrides for Account Widget */
body.light-theme .user-profile-trigger {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #111827 !important;
}

body.light-theme .user-profile-trigger:hover {
  background: rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .user-dropdown-menu {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .dropdown-item {
  color: #4b5563 !important;
}

body.light-theme .dropdown-item:hover {
  background: rgba(0, 0, 0, 0.03) !important;
  color: #111827 !important;
}

/* Light Theme overrides for Balancing Widget */
body.light-theme .bg-detail-val {
  color: #111827 !important;
}

body.light-theme .si-ratio-badge {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #111827 !important;
}

body.light-theme .balance-gauge-card,
body.light-theme .strain-indicator-card {
  background: rgba(0, 0, 0, 0.015) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .bbf-val {
  color: #111827 !important;
}

/* Light Theme overrides for Glass cards and titles */
body.light-theme .glass {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: var(--shadow-glow);
}

body.light-theme .narrow-container h3,
body.light-theme .narrow-container h4,
body.light-theme .narrow-container h5,
body.light-theme .narrow-container p,
body.light-theme .narrow-container label,
body.light-theme .glass h3,
body.light-theme .glass h4,
body.light-theme .glass h5,
body.light-theme .glass label {
  color: #111827 !important;
}

/* Extra Responsive Mobile Overrides */
@media (max-width: 600px) {
  .warning-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
  }
  .banner-action-btn {
    align-self: flex-start !important;
  }
}

@media (max-width: 480px) {
  .preview-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .calc-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
}

