
:root {
  --bg-deep: #020b18;
  --bg-card: #040f1f;
  --bg-panel: #071525;
  --bg-hover: #0a1f35;
  --neon-primary: #00b4d8;
  --neon-bright: #48cae4;
  --neon-dim: #0077a8;
  --neon-glow: rgba(0, 180, 216, 0.25);
  --neon-glow-strong: rgba(0, 180, 216, 0.5);
  --accent-teal: #00f5d4;
  --accent-blue: #023e8a;
  --text-primary: #e0f4ff;
  --text-secondary: #7ab8d4;
  --text-muted: #3d7a96;
  --border: rgba(0, 180, 216, 0.2);
  --border-bright: rgba(0, 180, 216, 0.5);
  --danger: #ff4655;
  --success: #00f5d4;
  --warning: #ffd60a;
  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Exo 2', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-neon: 0 0 20px rgba(0, 180, 216, 0.3), 0 0 60px rgba(0, 180, 216, 0.1);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 17px; }

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== RESPONSIVE DESKTOP SCALE ===== */
@media (min-width: 768px) {
  html { font-size: 18px; }

  /* Layout */
  .content { max-width: 960px; margin: 0 auto; padding: 32px 40px; }
  .topbar { padding: 20px 40px; }
  .tab-nav { padding: 0 40px; }

  /* Topbar */
  .topbar-logo { font-size: 30px; letter-spacing: 5px; }
  .topbar-user { font-size: 15px; }
  .topbar-user strong { font-size: 17px; }

  /* Login */
  #screen-login { padding: 40px; }
  .login-logo h1 { font-size: 64px; letter-spacing: 8px; }
  .login-logo p { font-size: 16px; letter-spacing: 3px; }
  .login-logo .icon { width: 100px; height: 100px; font-size: 48px; border-radius: 28px; }
  .login-logo { margin-bottom: 48px; }
  .login-card { padding: 44px 40px; max-width: 480px; }
  .role-tab { font-size: 16px; padding: 13px; }

  /* Tabs */
  .tab-btn { font-size: 16px; padding: 18px 16px; min-width: 120px; }
  .tab-btn .tab-icon { font-size: 26px; margin-bottom: 6px; }

  /* Sections & Cards */
  .section-title { font-size: 30px; margin-bottom: 20px; }
  .card { padding: 28px 32px; margin-bottom: 20px; border-radius: 16px; }
  .card-title { font-size: 22px; }
  .card-subtitle { font-size: 16px; margin-top: 4px; }
  .card-actions { gap: 10px; }

  /* Stats */
  .stat-box { padding: 24px 16px; border-radius: 16px; }
  .stat-num { font-size: 48px; }
  .stat-label { font-size: 14px; margin-top: 6px; }
  .grid-3 { gap: 16px; margin-bottom: 24px; }

  /* Buttons */
  .btn { font-size: 18px; padding: 17px 20px; border-radius: 10px; }
  .btn-sm { padding: 11px 22px; font-size: 15px; border-radius: 8px; }
  .btn-icon { width: 42px; height: 42px; font-size: 18px; }

  /* Tags */
  .tag { font-size: 14px; padding: 6px 16px; border-radius: 22px; }

  /* Forms */
  .form-group { margin-bottom: 20px; }
  .form-group label { font-size: 14px; letter-spacing: 2px; margin-bottom: 10px; }
  .form-group input, .form-group select, .form-group textarea {
    font-size: 17px; padding: 15px 18px; border-radius: 10px;
  }
  .form-section { padding: 28px; border-radius: 16px; }
  .form-section-title { font-size: 16px; margin-bottom: 18px; }

  /* Exercises */
  .exercise-item { padding: 18px 20px; gap: 18px; margin-bottom: 12px; border-radius: 10px; }
  .exercise-num { width: 46px; height: 46px; font-size: 19px; }
  .exercise-name { font-size: 19px; }
  .exercise-meta { font-size: 15px; margin-top: 5px; }
  .exercise-video { width: 44px; height: 44px; font-size: 20px; border-radius: 10px; }

  /* Day pills */
  .day-pills { gap: 10px; margin-bottom: 20px; }
  .day-pill { font-size: 16px; padding: 10px 22px; border-radius: 24px; }

  /* Meals */
  .meal-card { padding: 22px 24px; margin-bottom: 14px; border-radius: 12px; }
  .meal-time { font-size: 15px; letter-spacing: 3px; margin-bottom: 8px; }
  .meal-content { font-size: 17px; line-height: 1.7; }

  /* Client hero */
  .client-hero { padding: 32px 24px; margin-bottom: 24px; border-radius: 16px; }
  .client-avatar { width: 90px; height: 90px; font-size: 40px; margin-bottom: 14px; }
  .client-name { font-size: 32px; letter-spacing: 3px; }
  .client-plan { font-size: 17px; margin-top: 6px; }

  /* Modal */
  .modal-overlay { align-items: center; justify-content: center; padding: 24px; }
  .modal { border-radius: 20px; max-width: 640px; width: 100%; max-height: 85vh; padding: 36px 32px; }
  .modal-title { font-size: 28px; margin-bottom: 28px; }
  .modal-close { width: 38px; height: 38px; font-size: 20px; }

  /* Misc */
  .divider { margin: 20px 0; }
  .hint { font-size: 14px; margin-top: 18px; }
  .empty-state { padding: 60px 20px; }
  .empty-state .emoji { font-size: 52px; margin-bottom: 16px; }
  .empty-state p { font-size: 17px; }
}

@media (min-width: 1200px) {
  html { font-size: 19px; }
  .content { max-width: 1100px; padding: 36px 48px; }
  .topbar { padding: 22px 48px; }
  .tab-nav { padding: 0 48px; }
  .card-title { font-size: 24px; }
  .stat-num { font-size: 54px; }
  .exercise-name { font-size: 20px; }
  .meal-content { font-size: 18px; }
  .section-title { font-size: 32px; }
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 60% 40% at 10% 0%, rgba(0, 119, 168, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 90% 100%, rgba(0, 180, 216, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== SCREENS ===== */
.screen { display: none; min-height: 100vh; position: relative; z-index: 1; }
.screen.active { display: flex; flex-direction: column; }

/* ===== LOGIN ===== */
#screen-login {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-logo {
  text-align: center;
  margin-bottom: 40px;
}
.login-logo .icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--neon-dim), var(--neon-primary));
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-neon);
}
.login-logo h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--neon-bright);
  text-shadow: 0 0 20px var(--neon-primary);
}
.login-logo p { color: var(--text-secondary); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-card);
}

.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg-deep);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.role-tab {
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}
.role-tab.active {
  background: linear-gradient(135deg, var(--neon-dim), var(--neon-primary));
  color: white;
  box-shadow: 0 0 15px rgba(0, 180, 216, 0.4);
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--neon-primary);
  box-shadow: 0 0 12px rgba(0, 180, 216, 0.2);
}
.form-group select option { background: var(--bg-card); }
.form-group textarea { resize: vertical; min-height: 80px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}
.btn-primary {
  background: linear-gradient(135deg, var(--neon-dim), var(--neon-primary));
  color: white;
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.3);
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(0, 180, 216, 0.5); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--neon-bright);
}
.btn-outline:hover { background: var(--neon-glow); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 8px 14px; font-size: 13px; letter-spacing: 1px; width: auto; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 8px; font-size: 16px; }

.hint { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.hint span { color: var(--neon-bright); }

/* ===== TOPBAR ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(4, 15, 31, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 100;
}
.topbar-logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--neon-bright);
  letter-spacing: 3px;
  text-shadow: 0 0 12px var(--neon-primary);
}
.topbar-user { font-size: 13px; color: var(--text-secondary); text-align: right; }
.topbar-user strong { display: block; color: var(--text-primary); }
.topbar-actions { display: flex; gap: 8px; }

/* ===== TABS NAV ===== */
.tab-nav {
  display: flex;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1; min-width: 60px;
  padding: 10px 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tab-btn .tab-icon { font-size: 18px; }
.tab-btn.active {
  color: var(--neon-bright);
  border-bottom-color: var(--neon-primary);
  background: rgba(0, 180, 216, 0.05);
}

/* ===== CONTENT ===== */
.content { flex: 1; padding: 20px; overflow-y: auto; padding-bottom: 80px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.section-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--neon-bright);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-bright), transparent);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--neon-dim); box-shadow: 0 0 20px rgba(0, 180, 216, 0.1); }

.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.card-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.card-actions { display: flex; gap: 6px; }

.tag {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.tag-blue { background: rgba(0, 180, 216, 0.15); color: var(--neon-bright); border: 1px solid rgba(0, 180, 216, 0.3); }
.tag-teal { background: rgba(0, 245, 212, 0.1); color: var(--accent-teal); border: 1px solid rgba(0, 245, 212, 0.3); }
.tag-red { background: rgba(255, 70, 85, 0.1); color: var(--danger); border: 1px solid rgba(255, 70, 85, 0.3); }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--neon-bright);
  text-shadow: 0 0 15px var(--neon-primary);
  display: block;
}
.stat-label { font-size: 12px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }

/* ===== EXERCISE LIST ===== */
.exercise-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
}
.exercise-num {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--neon-dim), var(--neon-primary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.exercise-info { flex: 1; min-width: 0; }
.exercise-name {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.exercise-meta { font-size: 13px; color: var(--neon-bright); margin-top: 3px; }
.exercise-video {
  width: 34px; height: 34px;
  background: rgba(0, 180, 216, 0.1);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--neon-bright);
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.2s;
}
.exercise-video:hover { background: var(--neon-glow); border-color: var(--neon-primary); }

/* ===== DAY TABS ===== */
.day-pills-wrapper {
  position: relative;
  margin-bottom: 16px;
}
.day-pills-wrapper::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 4px;
  width: 32px;
  background: linear-gradient(to right, transparent, var(--bg-deep));
  pointer-events: none;
  border-radius: 0 20px 20px 0;
}
.day-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  padding-right: 32px;
  margin-bottom: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.day-pills::-webkit-scrollbar { display: none; }
.day-pill {
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.day-pill.active {
  background: linear-gradient(135deg, var(--neon-dim), var(--neon-primary));
  color: white;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(0, 180, 216, 0.4);
}
.day-pill.rest {
  border-color: rgba(255, 214, 10, 0.3);
  color: var(--warning);
}
.day-pill.rest.active {
  background: rgba(255, 214, 10, 0.15);
  color: var(--warning);
  box-shadow: 0 0 12px rgba(255, 214, 10, 0.2);
}

/* ===== MEAL PLAN ===== */
.meal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}
.meal-time {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-teal);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.meal-content { font-size: 15px; color: var(--text-secondary); line-height: 1.6; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(2, 11, 24, 0.92);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: flex-end;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 20px;
  box-shadow: 0 -8px 40px rgba(0, 180, 216, 0.2);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--neon-bright);
  letter-spacing: 2px;
  margin-bottom: 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-close {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

/* ===== CLIENT VIEW ===== */
.client-hero {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}
.client-avatar {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--neon-dim), var(--neon-primary));
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.4);
}
.client-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
}
.client-plan { font-size: 13px; color: var(--neon-bright); margin-top: 4px; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  background: var(--bg-deep);
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-dim), var(--neon-bright));
  border-radius: 10px;
  box-shadow: 0 0 8px var(--neon-primary);
  transition: width 0.6s ease;
}

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .emoji { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== NOTIFICATION ===== */
.notif {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-panel);
  border: 1px solid var(--neon-primary);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  color: var(--neon-bright);
  box-shadow: var(--shadow-neon);
  z-index: 2000;
  transition: transform 0.3s ease;
  white-space: nowrap;
}
.notif.show { transform: translateX(-50%) translateY(0); }

/* ===== INSTALL BANNER ===== */
.install-banner {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-bright);
  padding: 16px 20px;
  z-index: 500;
  box-shadow: 0 -8px 30px rgba(0, 180, 216, 0.15);
  flex-direction: column;
  gap: 12px;
}
.install-banner.visible { display: flex; }
.install-banner p { font-size: 14px; color: var(--text-secondary); }
.install-banner strong { color: var(--neon-bright); }
.install-banner .btn-row { display: flex; gap: 10px; }
.install-banner .btn-row .btn { flex: 1; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--neon-dim); border-radius: 4px; }

/* ===== FORM SECTION ===== */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}
.form-section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--neon-bright);
  letter-spacing: 2px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.exercise-row {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 10px 12px 12px;
  margin-bottom: 16px;
  margin-top: 8px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.exercise-row .row-num {
  position: absolute; top: -8px; left: 12px;
  background: var(--neon-dim);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 1px;
}
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; width: 100%; box-sizing: border-box; padding-right: 2px; }

.meal-row {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}
.meal-row label {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--accent-teal);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

/* ===== HISTORIAL MEDIDAS — RESPONSIVE ===== */
.historial-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.historial-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: border-color 0.2s;
}
.historial-card:hover { border-color: var(--neon-dim); }

.historial-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.historial-fecha {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--neon-bright);
  letter-spacing: 1px;
}

.historial-del-btn {
  background: transparent;
  border: 1px solid rgba(255,70,85,0.3);
  color: var(--danger);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.historial-del-btn:hover { background: rgba(255,70,85,0.1); }

.historial-medidas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (min-width: 480px) {
  .historial-medidas-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 768px) {
  .historial-medidas-grid { grid-template-columns: repeat(6, 1fr); }
  .historial-cards { gap: 8px; }
}

.historial-medida-item {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
}

.historial-medida-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.historial-medida-val {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.historial-unit {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.historial-nota {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}


/* ===== CALENDARIO ASISTENCIA ===== */
.cal-mes {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.cal-mes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--neon-bright);
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dia-label {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 0;
  font-weight: 600;
  letter-spacing: 1px;
}
.cal-dia {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
}
.cal-dia.cal-asistio {
  background: linear-gradient(135deg, var(--neon-dim), var(--neon-primary));
  color: white;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(0,180,216,0.4);
}
.cal-dia.cal-hoy {
  border: 2px solid var(--neon-bright);
  color: var(--neon-bright);
  font-weight: 700;
}
.cal-dia.cal-hoy.cal-asistio {
  border: 2px solid var(--accent-teal);
}
.cal-dia.cal-futuro { opacity: 0.25; }

/* Animación logro */
@keyframes logro-pop {
  from { transform: translate(-50%,-50%) scale(0.8); opacity: 0; }
  to   { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
}


/* ===== BUSCADOR DASHBOARD ===== */
#dash-search:focus {
  border-color: var(--neon-primary);
  box-shadow: 0 0 12px rgba(0,180,216,0.2);
}
#dash-search::placeholder { color: var(--text-muted); }


/* ===== CHAT MENSAJES ===== */
.msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}
.msg-bubble.enviado {
  background: linear-gradient(135deg, var(--neon-dim), var(--neon-primary));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-bubble.recibido {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-hora {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}
.chat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.chat-item:hover { border-color: var(--neon-dim); background: var(--bg-hover); }
.chat-item.unread { border-color: rgba(0,180,216,0.5); }
.chat-avatar {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--neon-dim), var(--neon-primary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.chat-info { flex: 1; min-width: 0; }
.chat-nombre {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.chat-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.chat-badge {
  background: var(--danger);
  color: white;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}
.tab-btn { position: relative; }


/* ===== DISCLAIMER PIE DE APP ===== */
.disclaimer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(2, 11, 24, 0.95);
  border-top: 1px solid rgba(0,180,216,0.15);
  padding: 6px 16px;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  z-index: 50;
  backdrop-filter: blur(6px);
  line-height: 1.4;
}
.disclaimer-bar a {
  color: var(--neon-dim);
  text-decoration: none;
}
/* Cuando hay install-banner visible, subir el disclaimer */
.install-banner.visible ~ .disclaimer-bar {
  bottom: 0;
}


/* ===== MOBILE OVERFLOW FIX ===== */
.content, .modal, .form-section, .input-row {
  max-width: 100%;
  box-sizing: border-box;
}
.exercise-row {
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.modal input, .modal textarea, .modal select,
.form-section input, .form-section textarea {
  max-width: 100%;
  box-sizing: border-box;
}


/* ===== MEDALLAS ===== */
.medalla-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}
.medalla-card {
  position: relative;
  border-radius: 16px;
  padding: 18px 16px 16px;
  text-align: center;
  overflow: hidden;
  background: #091c30;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.201);
}

.medalla-card.desbloqueada {
  background: linear-gradient(145deg, rgba(31, 18, 52, 0.96), rgba(9, 20, 36, 0.96));
  border: 1px solid rgba(255, 214, 10, 0.28);
  box-shadow: 0 10px 30px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.04);
}
.medalla-card.bloqueada {
  background: linear-gradient(145deg, rgba(4,15,31,0.96), rgba(7,21,37,0.96));
  border: 1px solid var(--border);
  opacity: .46;
}
.medalla-card::after {
  content: '';
  position: absolute;
  inset: auto -40px -40px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,214,10,0.12), transparent 68%);
  pointer-events: none;
}
.medalla-icon-wrap {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
}
.medalla-card.bloqueada .medalla-icon-wrap {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
}
.medalla-icon {
  font-size: 26px;
  line-height: 1;
}
.medalla-logo {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,214,10,0.95), rgba(255,162,10,0.95));
  color: #241100;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(255,162,10,0.25);
}

.medalla-logo-img {
  display: block;
  margin: 0 auto 12px;
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 10px rgba(4, 103, 165, 0.274);
}
.medalla-nombre {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
}
.medalla-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 6px;
}
.medalla-fecha {
  margin-top: 10px;
  font-size: 11px;
  color: var(--warning);
  letter-spacing: 1px;
}

/* ===== DESCARGO ===== */
.modal-descargo {
  max-width: 760px;
  border-radius: 20px;
}
.descargo-intro {
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(0,180,216,0.08);
  border: 1px solid rgba(0,180,216,0.18);
  color: var(--text-secondary);
  line-height: 1.5;
}
.descargo-text {
  max-height: 44vh;
  overflow-y: auto;
  padding: 18px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  line-height: 1.7;
  color: var(--text-secondary);
}
.descargo-text strong {
  color: var(--text-primary);
}
.descargo-text p + p {
  margin-top: 12px;
}
.descargo-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,180,216,0.15);
  color: var(--neon-bright);
  font-size: 12px;
}
.descargo-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 12px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(4,15,31,0.94);
  border: 1px solid var(--border);
  cursor: pointer;
}
.descargo-check input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--neon-primary);
}
.descargo-check span {
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
}
