/* ==========================================================================
   AURA Design System - Glassmorphism & High-Fidelity Gym Visuals
   ========================================================================== */

:root {
  --font-primary: 'Outfit', sans-serif;

  /* Theme harmonic colors */
  --bg-dark: #07070b;
  --bg-deep: #0e0e16;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-glow: rgba(122, 162, 247, 0.15);

  /* Accents based on Tokyo Night theme */
  --accent-primary: #7aa2f7;   /* Cyan-Blue Glow */
  --accent-secondary: #bb9af3; /* Purple Accent */
  --color-success: #9ece6a;    /* Recovered Green */
  --color-warning: #ff9e64;    /* Recovering Orange */
  --color-danger: #f7768e;     /* Fatigued Red */
  --color-inactive: #565f89;   /* Slate Gray */

  --text-main: #c0caf5;
  --text-bright: #ffffff;
  --text-muted: #7982a9;

  /* Border radius */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-spring: all 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Background Glows */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}
.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(122,162,247,0.2) 0%, rgba(0,0,0,0) 70%);
  top: -100px;
  left: -100px;
}
.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(187,154,243,0.15) 0%, rgba(0,0,0,0) 70%);
  bottom: -100px;
  right: -100px;
}
.glow-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(247,118,142,0.12) 0%, rgba(0,0,0,0) 70%);
  top: 40%;
  left: 30%;
}

/* Premium Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.app-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  color: var(--text-bright);
  box-shadow: 0 4px 15px rgba(122, 162, 247, 0.4);
}
.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-bright);
}
.sub-brand {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Session Status Bar */
.session-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.status-pill {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}
.status-inactive {
  background: rgba(86, 95, 137, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(86, 95, 137, 0.3);
}
.status-active {
  background: rgba(122, 162, 247, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(122, 162, 247, 0.4);
  box-shadow: 0 0 10px rgba(122, 162, 247, 0.2);
  animation: pulse-border 2s infinite;
}
.timer-display {
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
}

/* Pro Toggle Container */
.pro-toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(187, 154, 243, 0.06);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid rgba(187, 154, 243, 0.15);
}
.pro-badge {
  background: linear-gradient(90deg, #ff007f, var(--accent-secondary));
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
  box-shadow: 0 0 8px rgba(187, 154, 243, 0.6);
}
.toggle-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Navigation Tabs */
.navigation-tabs {
  display: flex;
  gap: 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 6px;
}
.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition-smooth);
}
.tab-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}
.tab-btn.active {
  background: rgba(122, 162, 247, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(122, 162, 247, 0.2);
  box-shadow: inset 0 0 8px rgba(122, 162, 247, 0.05);
}

/* Viewport & View transitions */
.app-viewport {
  flex: 1;
  position: relative;
}
.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.tab-content.active-content {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Glass Cards & Elements
   ========================================================================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
}
.card-glow:hover {
  box-shadow: 0 0 30px var(--glass-glow);
  border-color: rgba(122, 162, 247, 0.2);
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Grid Layouts */
.grid-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
}

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

/* Forms & Selects */
.control-group, .form-group {
  margin-bottom: 20px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.select-wrapper {
  position: relative;
}
.select-wrapper::after {
  content: "▼";
  font-size: 10px;
  color: var(--text-muted);
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
select, input[type="number"], input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-bright);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: var(--transition-smooth);
  -webkit-appearance: none;
}
select:focus, input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(122, 162, 247, 0.15);
}
.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Button UI */
button {
  font-family: var(--font-primary);
  cursor: pointer;
  outline: none;
  border: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--text-bright);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(122, 162, 247, 0.25);
  width: 100%;
  font-size: 14px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(122, 162, 247, 0.4);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-bright);
}
.btn-success {
  background: linear-gradient(135deg, var(--color-success), #73d216);
  color: var(--text-bright);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  width: 100%;
  font-size: 14px;
}
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(158, 206, 106, 0.4);
}
.btn-danger {
  background: rgba(247, 118, 142, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(247, 118, 142, 0.3);
  padding: 10px 16px;
  border-radius: var(--radius-md);
}
.btn-danger:hover {
  background: rgba(247, 118, 142, 0.3);
  color: var(--text-bright);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}
.hidden {
  display: none !important;
}

/* ==========================================================================
   Workout Logger Panel
   ========================================================================== */
.logger-ctrl-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.session-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Rest Timer Widget */
.rest-timer-widget {
  background: rgba(122, 162, 247, 0.03);
  border: 1px solid rgba(122, 162, 247, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.timer-header {
  text-align: center;
}
.timer-header h3 {
  font-size: 14px;
  color: var(--text-bright);
}
.timer-subtitle {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 500;
}
.timer-circle-container {
  position: relative;
  width: 110px;
  height: 110px;
}
.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.timer-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 6;
}
.timer-progress {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283; /* 2 * PI * r (r=45) = 282.7 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}
.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: monospace;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-bright);
}
.timer-controls {
  display: flex;
  gap: 10px;
}

/* Active Exercise Logger Panel */
.active-exercise-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 480px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 16px;
}
.exercise-info h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 4px;
}
.muscle-badge {
  font-size: 11px;
  color: var(--accent-primary);
  background: rgba(122, 162, 247, 0.1);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
}
.live-growth-pill {
  background: rgba(158, 206, 106, 0.12);
  color: var(--color-success);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.live-growth-pill.negative {
  background: rgba(247, 118, 142, 0.12);
  color: var(--color-danger);
}
.arrow-indicator {
  font-size: 14px;
}

/* Logger Set Table */
.set-table-container {
  flex: 1;
  overflow-x: auto;
}
.set-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.set-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  letter-spacing: 0.5px;
}
.set-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}
.set-number-cell {
  font-weight: 700;
  color: var(--text-muted);
}
.prev-set-val {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}
.set-input-td input {
  padding: 8px 12px;
  width: 75px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
}
.set-note-td input {
  width: 130px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  font-size: 12px;
}

/* Custom Styled Checkbox */
.checkbox-container {
  display: block;
  position: relative;
  width: 24px;
  height: 24px;
  cursor: pointer;
}
.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 24px;
  width: 24px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  transition: var(--transition-smooth);
}
.checkbox-container:hover input ~ .checkmark {
  background-color: rgba(255, 255, 255, 0.1);
}
.checkbox-container input:checked ~ .checkmark {
  background-color: var(--color-success);
  border-color: var(--color-success);
  box-shadow: 0 0 10px rgba(158, 206, 106, 0.4);
}
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 11px;
  border: solid var(--bg-dark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.logger-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}
.plate-kb-trigger-btn {
  background: rgba(122, 162, 247, 0.08);
  border: 1px dashed rgba(122, 162, 247, 0.3);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.plate-kb-trigger-btn:hover {
  background: rgba(122, 162, 247, 0.15);
  transform: scale(1.03);
}

/* ==========================================================================
   Anatomical Muscle Heatmap & SVG View
   ========================================================================== */
.heatmap-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

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

.muscle-legend {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 20px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.legend-item:last-child {
  margin-bottom: 0;
}
.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.muscle-status-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.muscle-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}
.muscle-item-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}
.muscle-label-group h4 {
  font-size: 14px;
  color: var(--text-bright);
  font-weight: 600;
  margin-bottom: 2px;
}
.muscle-label-group span {
  font-size: 11px;
  color: var(--text-muted);
}
.muscle-state-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  display: inline-block;
  white-space: nowrap;
  width: auto;
}
.muscle-state-badge.state-green {
  background: rgba(158, 206, 106, 0.12) !important;
  color: var(--color-success) !important;
  border: 1px solid rgba(158, 206, 106, 0.25) !important;
}
.muscle-state-badge.state-orange {
  background: rgba(255, 158, 100, 0.12) !important;
  color: var(--color-warning) !important;
  border: 1px solid rgba(255, 158, 100, 0.25) !important;
}
.muscle-state-badge.state-red {
  background: rgba(247, 118, 142, 0.12) !important;
  color: var(--color-danger) !important;
  border: 1px solid rgba(247, 118, 142, 0.25) !important;
}

/* SVG Anatomical Silhouette Styling */
.heatmap-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.heatmap-view-wrapper {
  display: flex;
  justify-content: center;
  gap: 40px;
  width: 100%;
}
.svg-figure-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.svg-figure-container h3 {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.anatomy-svg {
  width: 180px;
  height: 400px;
}
.muscle-path {
  fill: rgba(255, 255, 255, 0.04); /* Sleek translucent mannequin default */
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 0.4;
  transition: fill 0.8s ease, stroke 0.4s ease;
  cursor: pointer;
}
.muscle-path:hover {
  stroke: var(--text-bright);
  stroke-width: 0.8;
}
.structural-path {
  fill: rgba(255, 255, 255, 0.02);
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 0.3;
  transition: fill 0.8s ease;
}

/* ==========================================================================
   SVG Line Charts & Filtering
   ========================================================================== */
.analytics-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

@media (max-width: 850px) {
  .analytics-layout {
    grid-template-columns: 1fr;
  }
}

.chart-container {
  position: relative;
  min-height: 320px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.analytics-chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.chart-line-path {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0px 0px 8px rgba(122, 162, 247, 0.6));
}
.chart-grid line {
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 1;
}
.chart-grid path {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1.5;
}
.chart-point {
  fill: var(--bg-dark);
  stroke: var(--accent-primary);
  stroke-width: 3;
  transition: var(--transition-smooth);
  cursor: pointer;
}
.chart-point:hover {
  fill: var(--text-bright);
  r: 7px;
  filter: drop-shadow(0px 0px 12px var(--accent-primary));
}
.chart-text {
  font-family: monospace;
  font-size: 9px;
  fill: var(--text-muted);
}
.chart-empty-state {
  position: absolute;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Calculators Screen UI
   ========================================================================== */
.calculator-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
}

@media (max-width: 850px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }
}

.result-box-glow {
  background: linear-gradient(135deg, rgba(122,162,247,0.1), rgba(187,154,243,0.1));
  border: 1px solid rgba(122, 162, 247, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-top: 24px;
  box-shadow: 0 0 20px rgba(122, 162, 247, 0.1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.result-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-primary);
}
.result-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-bright);
}

.calc-table-wrapper {
  overflow-x: auto;
}
.percent-table {
  width: 100%;
  border-collapse: collapse;
}
.percent-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.percent-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 14px;
}
.percent-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-bright);
}

/* ==========================================================================
   Slide-Up Barbell Plate Calculator (Overlay)
   ========================================================================== */
.plate-kb-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.plate-kb-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.plate-kb-container {
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  background: #0b0b12;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px 24px 0 0;
  padding: 24px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.plate-kb-overlay.active .plate-kb-container {
  transform: translateY(0);
}

.plate-kb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}
.plate-kb-header h3 {
  font-size: 16px;
  color: var(--text-bright);
  font-weight: 700;
}
.close-kb-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close-kb-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-bright);
}

.kb-display-section {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.kb-input-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kb-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
}
.kb-value-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kb-value-input {
  width: 90px;
  text-align: right;
  font-size: 24px;
  font-weight: 800;
  border: none;
  background: transparent;
  padding: 0;
  color: var(--text-bright);
}
.kb-unit {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Barbells Loading Plate Visualization */
.barbell-visualizer {
  height: 40px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 8px;
  overflow: hidden;
}
.barbell-shaft {
  width: 80%;
  height: 6px;
  background: #7982a9;
  border-radius: 3px;
  position: absolute;
  z-index: 1;
}
.barbell-sleeve {
  width: 25%;
  height: 10px;
  background: #a6adc8;
  border: 1px solid #45475a;
  position: absolute;
  z-index: 2;
  display: flex;
  gap: 2px;
  padding: 0 4px;
}
.sleeve-left {
  left: 10%;
  justify-content: flex-end;
  border-radius: 4px 0 0 4px;
}
.sleeve-right {
  right: 10%;
  justify-content: flex-start;
  border-radius: 0 4px 4px 0;
}
.vis-plate {
  width: 8px;
  border-radius: 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* Styled Weights Keypad */
.plate-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.plate-key {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}
.plate-key:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}
.plate-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--bg-dark);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.4);
}
.plate-key span:last-child {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Gym Plate Standard Colors */
.key-red .plate-circle, .vis-plate-25 { background: #f7768e; color: #fff; }
.key-blue .plate-circle, .vis-plate-20 { background: #7aa2f7; color: #fff; }
.key-yellow .plate-circle, .vis-plate-15 { background: #e0af68; color: #fff; }
.key-green .plate-circle, .vis-plate-10 { background: #9ece6a; color: #fff; }
.key-white .plate-circle, .vis-plate-5 { background: #c0caf5; color: #000; }
.key-black .plate-circle, .vis-plate-2_5 { background: #24283b; color: #fff; }
.key-fractional .plate-circle, .vis-plate-1_25 { background: #565f89; color: #fff; }

.key-clear .plate-circle {
  background: transparent;
  border: 1px dashed var(--color-danger);
  color: var(--color-danger);
}

.kb-quick-nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ==========================================================================
   Utility Animations
   ========================================================================== */
@keyframes pulse-border {
  0% {
    box-shadow: 0 0 10px rgba(122, 162, 247, 0.2);
    border-color: rgba(122, 162, 247, 0.4);
  }
  50% {
    box-shadow: 0 0 20px rgba(122, 162, 247, 0.4);
    border-color: rgba(122, 162, 247, 0.8);
  }
  100% {
    box-shadow: 0 0 10px rgba(122, 162, 247, 0.2);
    border-color: rgba(122, 162, 247, 0.4);
  }
}

/* Premium toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  transition: .4s;
  border: 1px solid var(--glass-border);
}
.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .4s;
}
input:checked + .slider {
  background-color: rgba(187, 154, 243, 0.2);
  border-color: rgba(187, 154, 243, 0.4);
}
input:checked + .slider:before {
  background-color: var(--accent-secondary);
  transform: translateX(18px);
  box-shadow: 0 0 8px var(--accent-secondary);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

/* Active Workout Session Logged Exercises list summary */
.active-session-summary {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
}
.logged-exercises-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.logged-exercise-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.logged-exercise-item:hover {
  background: rgba(122, 162, 247, 0.06);
  border-color: rgba(122, 162, 247, 0.3);
  transform: translateX(4px);
}
.logged-exercise-name {
  font-weight: 600;
  color: var(--text-bright);
}
.logged-exercise-count {
  font-size: 11px;
  color: var(--accent-primary);
  background: rgba(122, 162, 247, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}

/* Video Demo Modal Overlay styles */
.video-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  z-index: 101; /* Above plate keyboard */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}
.video-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.video-modal-container {
  width: 100%;
  max-width: 550px;
  background: #0b0b12;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.video-modal-overlay.active .video-modal-container {
  transform: scale(1);
}

.video-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.video-modal-header h3 {
  font-size: 16px;
  color: var(--text-bright);
  font-weight: 700;
}
.close-video-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}
.close-video-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-bright);
}

.video-player-frame {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}
.video-player-frame iframe {
  width: 100%;
  height: 100%;
}

.video-instructions {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.video-instructions h4 {
  font-size: 13px;
  color: var(--accent-primary);
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.instructions-ol {
  list-style-position: inside;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.instructions-ol li {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

.btn-demo-video {
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-demo-video:hover {
  background: rgba(122, 162, 247, 0.25) !important;
  transform: scale(1.05);
}

/* ==========================================================================
   Premium Glassmorphic SaaS Auth Layout
   ========================================================================== */
.btn-logout {
  background: rgba(247, 118, 142, 0.12);
  color: #f7768e;
  border: 1px solid rgba(247, 118, 142, 0.3);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-logout:hover {
  background: rgba(247, 118, 142, 0.22) !important;
  box-shadow: 0 0 15px rgba(247, 118, 142, 0.4);
  transform: translateY(-1px);
}

.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 4, 6, 0.85); /* Deep space dark backdrop overlay */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000000; /* Set higher than mobile bottom navigation bar (99999) to completely cover it when logged out */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
}

.auth-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Enforce body scroll lock when login screen is active (prevents background scrolling) */
body:has(#auth-overlay:not(.hidden)) {
  overflow: hidden !important;
  height: 100vh !important;
  height: 100dvh !important;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(11, 11, 18, 0.7) !important; /* Premium Obsidian Glass */
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(187, 154, 243, 0.05) !important;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: auth-card-entrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes auth-card-entrance {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.brand-group-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.brand-logo-auth {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 26px;
  color: var(--text-bright);
  box-shadow: 0 4px 20px rgba(122, 162, 247, 0.4);
}

.brand-text-auth h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text-bright);
  margin: 0;
}

.sub-brand-auth {
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--accent-secondary);
  font-weight: 700;
  text-transform: uppercase;
}

.auth-form-container h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 8px;
  text-align: center;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group-auth label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group-auth input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-bright);
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group-auth input:focus {
  border-color: var(--accent-secondary);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 10px rgba(187, 154, 243, 0.2);
  outline: none;
}

.btn-auth-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: 10px;
  color: var(--text-bright);
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(122, 162, 247, 0.3);
  margin-top: 8px;
}

.btn-auth-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(122, 162, 247, 0.5), 0 0 15px rgba(187, 154, 243, 0.3);
}

.btn-auth-primary:active {
  transform: translateY(0);
}

.auth-switch-text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
}

.auth-switch-text a {
  color: var(--accent-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-switch-text a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.auth-error-msg {
  background: rgba(247, 118, 142, 0.1);
  border: 1px solid rgba(247, 118, 142, 0.25);
  border-radius: 8px;
  color: #f7768e;
  padding: 12px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  font-weight: 500;
  margin-top: 8px;
}

/* ==========================================================================
   SaaS Weekly Planner & Recommendation Alert Styles
   ========================================================================== */
.smart-recommendation-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(90deg, rgba(187, 154, 243, 0.15), rgba(122, 162, 247, 0.1));
  border: 1px solid rgba(187, 154, 243, 0.35);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(187, 154, 243, 0.15);
  animation: banner-fade-in 0.5s ease-out forwards;
}

@keyframes banner-fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-icon {
  font-size: 20px;
}

.banner-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
}

.btn-banner-action {
  background: var(--accent-secondary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(187, 154, 243, 0.4);
}

.btn-banner-action:hover {
  background: var(--accent-primary);
  box-shadow: 0 0 15px rgba(122, 162, 247, 0.6);
  transform: translateY(-1px);
}

.btn-banner-action.filtering-active {
  background: #f7768e !important;
  box-shadow: 0 0 12px rgba(247, 118, 142, 0.5) !important;
}

.planner-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.planner-header-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.planner-legend {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.legend-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.planner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

.day-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(11, 11, 18, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: var(--radius-md);
}

.day-card:hover {
  transform: translateY(-4px);
  background: rgba(11, 11, 18, 0.7) !important;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.day-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-bright);
}

.day-indicator {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-card.today {
  border-color: rgba(122, 162, 247, 0.3) !important;
}

.day-card.today .day-indicator {
  color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(122, 162, 247, 0.5);
}

.split-badge {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.split-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Neon color states for Planner splits */
.split-push {
  background: rgba(247, 118, 142, 0.1) !important;
  color: #f7768e !important;
  border: 1px solid rgba(247, 118, 142, 0.25) !important;
}
.day-card.active-push {
  border-color: rgba(247, 118, 142, 0.35) !important;
  box-shadow: 0 8px 30px rgba(247, 118, 142, 0.08), 0 0 15px rgba(247, 118, 142, 0.03) !important;
}

.split-pull {
  background: rgba(122, 162, 247, 0.1) !important;
  color: #7aa2f7 !important;
  border: 1px solid rgba(122, 162, 247, 0.25) !important;
}
.day-card.active-pull {
  border-color: rgba(122, 162, 247, 0.35) !important;
  box-shadow: 0 8px 30px rgba(122, 162, 247, 0.08), 0 0 15px rgba(122, 162, 247, 0.03) !important;
}

.split-legs {
  background: rgba(187, 154, 243, 0.1) !important;
  color: #bb9af7 !important;
  border: 1px solid rgba(187, 154, 243, 0.25) !important;
}
.day-card.active-legs {
  border-color: rgba(187, 154, 243, 0.35) !important;
  box-shadow: 0 8px 30px rgba(187, 154, 243, 0.08), 0 0 15px rgba(187, 154, 243, 0.03) !important;
}

.split-rest {
  background: rgba(86, 95, 137, 0.15) !important;
  color: var(--text-muted) !important;
  border: 1px solid rgba(86, 95, 137, 0.25) !important;
}
.day-card.active-rest {
  border-color: rgba(255, 255, 255, 0.03) !important;
  box-shadow: none !important;
}

/* ==========================================================================
   SaaS Administration Panel Styles
   ========================================================================== */
.admin-layout {
  display: flex;
  gap: 20px;
  width: 100%;
  flex-wrap: wrap;
}

.admin-users-panel {
  flex: 2 1 600px;
  padding: 24px;
}

.admin-create-panel {
  flex: 1 1 350px;
  padding: 24px;
  height: fit-content;
}

.admin-table-wrapper {
  overflow-x: auto;
  margin-top: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table td {
  padding: 16px;
  font-size: 13px;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-bright);
}

/* Expiry and Subscription Status Badges */
.status-pill.status-active-saas {
  background: rgba(144, 238, 144, 0.1) !important;
  color: #9ece6a !important;
  border: 1px solid rgba(144, 238, 144, 0.3) !important;
  box-shadow: 0 0 10px rgba(144, 238, 144, 0.1);
}

.status-pill.status-expired-saas {
  background: rgba(247, 118, 142, 0.1) !important;
  color: #f7768e !important;
  border: 1px solid rgba(247, 118, 142, 0.3) !important;
  box-shadow: 0 0 10px rgba(247, 118, 142, 0.15);
  animation: pulse-border-red 2s infinite;
}

@keyframes pulse-border-red {
  0% { box-shadow: 0 0 5px rgba(247, 118, 142, 0.15); }
  50% { box-shadow: 0 0 15px rgba(247, 118, 142, 0.35); }
  100% { box-shadow: 0 0 5px rgba(247, 118, 142, 0.15); }
}

.status-pill.status-blocked-saas {
  background: rgba(255, 158, 100, 0.1) !important;
  color: #ff9e64 !important;
  border: 1px solid rgba(255, 158, 100, 0.3) !important;
}

/* License Extension Button Groups */
.btn-group-license {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-license-action {
  background: rgba(122, 162, 247, 0.08);
  color: var(--accent-primary);
  border: 1px solid rgba(122, 162, 247, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-license-action:hover {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 0 8px rgba(122, 162, 247, 0.4);
}

.btn-license-block {
  background: rgba(247, 118, 142, 0.08);
  color: #f7768e;
  border: 1px solid rgba(247, 118, 142, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-license-block:hover {
  background: #f7768e;
  color: white;
  box-shadow: 0 0 8px rgba(247, 118, 142, 0.4);
}

.btn-license-unblock {
  background: rgba(144, 238, 144, 0.08);
  color: #9ece6a;
  border: 1px solid rgba(144, 238, 144, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-license-unblock:hover {
  background: #9ece6a;
  color: white;
  box-shadow: 0 0 8px rgba(144, 238, 144, 0.4);
}

/* Modality Selector Active Styles */
.modality-btn {
  background: transparent;
  border: none;
  color: var(--text-muted) !important;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
}
.modality-btn.active {
  background: var(--accent-primary) !important;
  color: white !important;
  box-shadow: 0 0 8px rgba(122, 162, 247, 0.3);
}
.modality-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-bright) !important;
}


/* ==========================================================================
   Exercise Master Management — Admin Panel Styles
   ========================================================================== */

/* File upload input styled to match glassmorphism system */
#admin-ex-video {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(122, 162, 247, 0.3);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
#admin-ex-video:hover {
  border-color: rgba(122, 162, 247, 0.6);
  background: rgba(122, 162, 247, 0.05);
}

/* Tier badge for exercise table */
.tier-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tier-badge.tier-1 {
  background: rgba(158, 206, 106, 0.12);
  color: #9ece6a;
  border: 1px solid rgba(158, 206, 106, 0.25);
}
.tier-badge.tier-2 {
  background: rgba(224, 175, 104, 0.12);
  color: #e0af68;
  border: 1px solid rgba(224, 175, 104, 0.25);
}
.tier-badge.tier-3 {
  background: rgba(247, 118, 142, 0.12);
  color: #f7768e;
  border: 1px solid rgba(247, 118, 142, 0.25);
}

/* Exercise row action buttons */
.btn-ex-preview {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(122, 162, 247, 0.3);
  background: rgba(122, 162, 247, 0.08);
  color: #7aa2f7;
  transition: all 0.2s;
}
.btn-ex-preview:hover {
  background: rgba(122, 162, 247, 0.2);
  box-shadow: 0 0 8px rgba(122, 162, 247, 0.25);
}

.btn-ex-delete {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(247, 118, 142, 0.3);
  background: rgba(247, 118, 142, 0.08);
  color: #f7768e;
  transition: all 0.2s;
  margin-left: 4px;
}
.btn-ex-delete:hover {
  background: rgba(247, 118, 142, 0.2);
  box-shadow: 0 0 8px rgba(247, 118, 142, 0.25);
}

/* Upload progress indicator */
#admin-ex-upload-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  display: none;
  align-items: center;
  gap: 6px;
}
#admin-ex-upload-status.uploading {
  display: flex;
  color: #e0af68;
}
#admin-ex-upload-status.done {
  display: flex;
  color: #9ece6a;
}

.upload-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(224, 175, 104, 0.2);
  border-top-color: #e0af68;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* No-video badge for exercises without demo */
.no-video-badge {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
}

/* ==========================================================================
   AURA Fit - Mobile Responsiveness & Premium Styling (max-width: 600px)
   ========================================================================== */
@media (max-width: 600px) {
  /* Global viewport stability (prevent horizontal scrolling) */
  html, body {
    width: 100%;
    overflow-x: hidden;
    position: static !important; /* Force static positioning to keep viewport as containing block */
  }
  
  .app-container {
    padding: 12px;
    gap: 16px;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    position: static !important; /* Remove relative positioning context for fixed children */
    min-height: 100dvh !important; /* Dynamically adjusts to address bar status */
  }

  /* Compact Premium Header Layout */
  .app-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    padding: 12px 16px;
  }
  
  .brand-group {
    justify-content: center;
  }
  
  .session-status-bar {
    justify-content: center;
    padding: 6px 16px;
  }
  
  .header-controls {
    justify-content: space-between;
    width: 100%;
    display: flex !important;
  }
  
  .pro-toggle-container {
    padding: 6px 12px;
    flex: 1;
    justify-content: center;
  }
  
  .btn-logout {
    padding: 8px 14px;
  }

  /* Premium Floating Bottom Navigation Bar */
  .navigation-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    border-radius: 0;
    border-top: 1px solid var(--glass-border);
    border-left: none;
    border-right: none;
    border-bottom: none;
    background: rgba(11, 11, 18, 0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px)) !important; /* Lock to safe area inset */
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    gap: 6px;
    margin: 0 !important;
    box-sizing: border-box;
    transform: translate3d(0, 0, 0); /* Force GPU composite layer to prevent scroll bounce */
    will-change: transform;
  }
  
  .tab-btn {
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 6px 4px;
    font-size: 10px;
    border-radius: 8px;
  }
  
  .tab-btn span {
    font-size: 9px;
    font-weight: 500;
  }
  
  .tab-icon {
    width: 18px;
    height: 18px;
  }
  
  /* Space for fixed bottom navigation bar */
  .app-viewport {
    padding-bottom: 76px;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .tab-content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Premium Centered Glassmorphic Authentication Page */
  .auth-overlay {
    width: 100vw;
    height: 100vh;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .auth-card {
    padding: 28px 20px;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(187, 154, 243, 0.05) !important;
    box-sizing: border-box;
  }
  
  .brand-group-auth {
    gap: 12px;
    margin-bottom: 4px;
  }
  
  .brand-logo-auth {
    width: 42px;
    height: 42px;
    font-size: 22px;
    border-radius: 10px;
  }
  
  .brand-text-auth h2 {
    font-size: 18px;
    letter-spacing: 2px;
  }
  
  .sub-brand-auth {
    font-size: 8px;
    letter-spacing: 2px;
  }
  
  .auth-form-container h3 {
    font-size: 16px;
    margin-bottom: 4px;
  }
  
  .auth-subtitle {
    font-size: 12px;
    margin-bottom: 16px;
    padding: 0 4px;
  }
  
  .form-group-auth input,
  .form-group-auth select,
  .form-group-auth textarea {
    padding: 10px 14px;
    font-size: 16px !important; /* Prevent iOS Safari auto-zoom on focus by enforcing >= 16px font-size */
    border-radius: 8px;
  }
  
  .btn-auth-primary {
    padding: 12px;
    font-size: 13px;
    border-radius: 8px;
  }

  /* Dashboard Sub-layouts & Prevent Data Table Leaks */
  .grid-layout {
    grid-template-columns: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    min-width: 0 !important;
  }

  .workout-logging-right-col {
    gap: 16px !important;
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  
  .admin-table-wrapper, .set-table-container, .calc-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
  
  .set-table th, .set-table td {
    padding: 8px 6px;
    font-size: 11px;
  }
  
  .set-table input.weight-input,
  .set-table input.reps-input {
    width: 52px !important;
    padding: 4px 2px !important;
    font-size: 16px !important;
    text-align: center;
  }
  
  .set-table input.note-input {
    width: 80px !important;
    padding: 4px 6px !important;
    font-size: 16px !important;
  }
  
  /* Compact Plate Keyboard Overlay */
  .plate-kb-overlay {
    z-index: 1000000 !important; /* Stand on top of bottom navigation tabs (99999) */
  }
  .plate-kb-container {
    padding: 16px 12px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 20px 20px 0 0;
  }
  
  .kb-display-section {
    padding: 12px;
    gap: 12px;
    margin-bottom: 12px;
  }
  
  .plate-keypad {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px;
  }
  
  .plate-key {
    padding: 8px 4px !important;
    border-radius: var(--radius-sm);
    gap: 4px !important;
  }
  
  .plate-circle {
    width: 30px !important;
    height: 30px !important;
    font-size: 11px !important;
  }
  
  .plate-key span:last-child {
    font-size: 9px !important;
  }
  
  /* Edit Exercise & Video Guide Modals */
  .video-modal-container {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  /* General Mobile Spacing & Padding Optimization */
  .glass-card {
    padding: 16px !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  /* Muscle Map Tab Mobile Scale-Down & Padding Fixes */
  .heatmap-container {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  .heatmap-sidebar {
    order: 2 !important;
    padding: 16px !important;
  }
  
  .muscle-status-list {
    max-height: 280px !important;
  }
  
  .muscle-item-card {
    padding: 10px 14px !important;
  }
  
  .muscle-label-group h4 {
    font-size: 13px !important;
  }
  
  .muscle-label-group span {
    font-size: 10px !important;
  }

  .heatmap-visual {
    order: 1 !important;
    padding: 16px !important;
  }

  .heatmap-view-wrapper {
    gap: 16px !important;
    justify-content: space-around !important;
    width: 100% !important;
  }

  .svg-figure-container {
    gap: 8px !important;
    flex: 1 !important;
    max-width: 135px !important;
  }

  .svg-figure-container h3 {
    font-size: 11px !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 4px !important;
  }

  .anatomy-svg {
    width: 100% !important;
    max-width: 125px !important;
    height: 260px !important;
  }

  /* Stack session action buttons vertically on mobile to prevent stretching */
  .session-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .session-actions button {
    width: 100% !important;
    flex: none !important;
  }

  /* Allow exercise header to stack and title to wrap safely */
  .panel-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .title-with-demo {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .exercise-info h2 {
    font-size: 16px !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }

  /* Compacting previous session card and ensuring its tables scroll elegantly */
  .previous-session-card {
    padding: 16px !important;
  }
  .previous-session-card h3 {
    display: flex !important;
    flex-wrap: wrap !important;
    font-size: 14px !important;
    word-break: break-word !important;
    white-space: normal !important;
    gap: 8px !important;
  }
  .previous-session-card table {
    min-width: 450px !important;
  }

  /* Hide the redundant "Previous" column on mobile and scale down the set table to fit without horizontal scrolling */
  .set-table th:nth-child(2),
  .set-table td:nth-child(2) {
    display: none !important;
  }
  .set-table {
    min-width: 100% !important;
    width: 100% !important;
  }
  .set-table th, .set-table td {
    padding: 8px 4px !important;
    text-align: center !important;
    font-size: 11px !important;
  }
  .set-table th:first-child, .set-table td:first-child {
    text-align: left !important;
  }
  .set-table td:nth-child(6),
  .set-table td:nth-child(7) {
    text-align: center !important;
  }

  /* Handle active session summary exercise list items wrapping */
  .logged-exercise-item {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .logged-exercise-name {
    word-break: break-word !important;
    flex: 1 1 150px !important;
    white-space: normal !important;
  }

  /* Prevent auto-zoom on select focus on iOS devices */
  select {
    font-size: 16px !important;
  }
}

/* Muscle Pills Premium UI */
.muscle-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px;
}

.muscle-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #a9b1d6);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  font-weight: 500;
}

.muscle-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-bright, #fff);
  border-color: rgba(255, 255, 255, 0.2);
}

.muscle-pill.selected {
  background: rgba(187, 154, 243, 0.15);
  border-color: rgba(187, 154, 243, 0.4);
  color: #bb9af3;
  box-shadow: 0 0 10px rgba(187, 154, 243, 0.2);
}

