/* ============================================================
   ALMA FUERTE GYM — Design System
   Estética: negro profundo · plata metálica · azul eléctrico
   Dark por defecto · Light disponible en toda vista
   ============================================================ */

/* ---------- TOKENS ---------- */
:root,
[data-theme="dark"] {
  --bg-primary:    #0A0B0E;
  --bg-secondary:  #101217;
  --bg-tertiary:   #171A21;
  --surface:       #101217;
  --surface-2:     #14171E;
  --text-primary:  #ECEEF2;
  --text-secondary:#A6ADB8;
  --text-muted:    #6B7280;
  --border:        #23262F;
  --border-strong: #2E323D;
  --accent:        #1E63D8;
  --accent-hover:  #3B7BEE;
  --accent-press:  #164FB0;
  --accent-text:   #FFFFFF;
  --accent-glow:   rgba(30,99,216,.40);
  --silver-1:      #EDF0F5;
  --silver-2:      #B4BCC9;
  --silver-3:      #7E8798;
  --danger:        #E0524E;
  --success:       #34C07A;
  --warning:       #E8A00A;
  --shadow:        rgba(0,0,0,.55);
  --ripple:        rgba(255,255,255,.22);
  --header-bg:     rgba(10,11,14,.82);
  --metal-a:       #F4F6FA;
  --metal-b:       #9BA4B4;
  --metal-c:       #C9D0DB;
}

[data-theme="light"] {
  --bg-primary:    #EEF0F3;
  --bg-secondary:  #FFFFFF;
  --bg-tertiary:   #E3E6EC;
  --surface:       #FFFFFF;
  --surface-2:     #F5F6F9;
  --text-primary:  #0C0E13;
  --text-secondary:#464C58;
  --text-muted:    #838A97;
  --border:        #D4D8E0;
  --border-strong: #C1C7D1;
  --accent:        #1750B8;
  --accent-hover:  #1E63D8;
  --accent-press:  #123F92;
  --accent-text:   #FFFFFF;
  --accent-glow:   rgba(23,80,184,.28);
  --silver-1:      #1A1D24;
  --silver-2:      #3A4150;
  --silver-3:      #5B6474;
  --danger:        #C0392B;
  --success:       #1A7A4A;
  --warning:       #B8650A;
  --shadow:        rgba(20,30,50,.14);
  --ripple:        rgba(23,80,184,.18);
  --header-bg:     rgba(255,255,255,.85);
  --metal-a:       #1C2430;
  --metal-b:       #4A5568;
  --metal-c:       #2B3444;
}

/* ---------- RESET ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  min-height: 100vh;
  transition: background .25s ease, color .25s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 15px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

.label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-muted); font-weight: 600;
}
.metal {
  background: linear-gradient(145deg, var(--metal-a) 0%, var(--metal-b) 42%, var(--metal-c) 60%, var(--metal-b) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.font-display { font-family: Rajdhani, Inter, sans-serif; letter-spacing: .02em; }

/* ---------- SPLASH ---------- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(120% 90% at 50% 0%, #12151C 0%, #07080A 70%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease;
}
.splash-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 40% at 50% 30%, rgba(30,99,216,.22), transparent 70%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.015) 0 2px, transparent 2px 9px);
  pointer-events: none;
}
.splash-inner { position: relative; text-align: center; padding: 1.5rem; }
.splash-logo {
  width: 160px; max-width: 55vw; margin: 0 auto 1.25rem;
  filter: drop-shadow(0 8px 30px rgba(30,99,216,.35));
  animation: splashPulse 2.6s ease-in-out infinite;
}
@keyframes splashPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }
.splash-name {
  font-family: Rajdhani, Inter, sans-serif; font-size: 2rem; letter-spacing: .04em;
  margin: 0 0 .4rem;
  background: linear-gradient(145deg,#F4F6FA,#9BA4B4 55%,#DDE3EC);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.splash-lema { color: var(--text-secondary); font-size: 11px; letter-spacing: .18em; margin: 0 0 1.8rem; }
.splash-bar { width: 190px; height: 3px; margin: 0 auto; background: #23262F; border-radius: 3px; overflow: hidden; }
.splash-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#1E63D8,#6FA0FF); box-shadow: 0 0 12px var(--accent-glow); transition: width .1s linear; }

/* ---------- HEADER ---------- */
.app-header {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.25rem;
  padding-top: calc(.7rem + env(safe-area-inset-top));
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.app-header .brand { display: flex; align-items: center; gap: .6rem; min-width: 0; flex-shrink: 1; }
.app-header .brand img { height: 34px; width: auto; flex-shrink: 0; }
.app-header .brand .name {
  font-family: Rajdhani, sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header .spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
@media (max-width: 400px) {
  .app-header { padding-left: 1rem; padding-right: 1rem; gap: .5rem; }
  .app-header .brand { gap: .45rem; }
  .app-header .brand img { height: 28px; }
  .app-header .brand .name { font-size: 13px; }
}
.header-nav { display: flex; gap: .2rem; }
.header-nav a {
  padding: .5rem .8rem; border-radius: 9px; color: var(--text-secondary);
  font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: .4rem;
}
.header-nav a i { width: 17px; height: 17px; }
.header-nav a:hover { color: var(--text-primary); background: var(--surface-2); }
.header-nav a.active { color: var(--accent); background: rgba(30,99,216,.12); }
@media (max-width: 768px) { .header-nav { display: none; } }

.icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-secondary); transition: .15s;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.icon-btn i { width: 19px; height: 19px; }

/* Campana de notificaciones — badge de no leídas sobre el icon-btn */
.notif-bell-wrap { position: relative; }
.notif-badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--header-bg);
}

/* Theme toggle — un solo ícono por vez según el tema (todo por CSS, sin estilos inline) */
#theme-toggle .icon-light { display: inline-flex; }
#theme-toggle .icon-dark  { display: none; }
[data-theme="dark"] #theme-toggle .icon-light { display: none; }
[data-theme="dark"] #theme-toggle .icon-dark  { display: inline-flex; }

/* ---------- LAYOUT ---------- */
.view { min-height: 100vh; }
.container {
  max-width: 1160px; margin: 0 auto;
  padding: 2rem 1.5rem;
}
.container-narrow { max-width: 720px; margin: 0 auto; padding: 2rem 1.5rem; }
.main-content { padding-bottom: 2rem; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.2rem; border-radius: 11px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; letter-spacing: .01em; line-height: 1;
  transition: .15s; white-space: nowrap;
}
.btn i { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--accent-text);
  box-shadow: 0 6px 20px -6px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 8px 26px -6px var(--accent-glow); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: var(--surface-2); color: var(--text-primary); border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: .95rem 1.5rem; font-size: 15.5px; }
.btn:disabled { opacity: .55; pointer-events: none; }

/* ---------- CARDS / PANELS ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
  position: relative;
}
.panel-accent {
  border-color: var(--border-strong);
  background:
    linear-gradient(180deg, rgba(30,99,216,.06), transparent 60%),
    var(--surface);
}
.tile {
  display: flex; flex-direction: column; gap: .35rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 15px; padding: 1.15rem 1.2rem; position: relative; overflow: hidden;
  transition: .18s;
}
.tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: .0; transition: .18s;
}
.tile.clickable { cursor: pointer; }
.tile.clickable:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.tile.clickable:hover::before { opacity: 1; }
.tile .tile-icon {
  width: 42px; height: 42px; border-radius: 11px; margin-bottom: .5rem;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(30,99,216,.16), rgba(30,99,216,.04));
  color: var(--accent); border: 1px solid rgba(30,99,216,.25);
}
.tile .tile-icon i { width: 21px; height: 21px; }
.tile .tile-value { font-family: Rajdhani, sans-serif; font-size: 30px; font-weight: 700; line-height: 1; }
.tile .tile-label { font-size: 13px; color: var(--text-secondary); }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---------- FORMS ---------- */
.field { margin-bottom: 1.05rem; }
.field > label {
  display: block; margin-bottom: .4rem;
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); font-weight: 600;
}
.input, .textarea, .select {
  width: 100%; padding: .8rem .9rem; font-size: 15px; font-family: inherit;
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 11px; outline: none;
  transition: .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.textarea { resize: vertical; min-height: 90px; }
.password-field { position: relative; }
.password-field .input { padding-right: 46px; }
.toggle-password,
.toggle-password.ripple {
  /* Selector compuesto: reafirma position:absolute por encima de .ripple
     (position:relative), que se agrega vía JS al inicializar el botón y de
     lo contrario lo saca del posicionamiento absoluto dejándolo en el flujo normal. */
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.toggle-password:hover { color: var(--text-primary); }
.toggle-password i { width: 19px; height: 19px; }

/* ---------- TOAST ---------- */
#toast-wrap {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  z-index: 10000; display: flex; flex-direction: column; gap: .5rem; align-items: center;
  pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  padding: .7rem 1.1rem; border-radius: 11px; font-size: 14px; font-weight: 500;
  color: #fff; box-shadow: 0 10px 30px -8px var(--shadow);
  display: flex; align-items: center; gap: .5rem;
  animation: toastIn .25s ease;
}
.toast i { width: 17px; height: 17px; }
.toast-error { background: var(--danger); }
.toast-success { background: var(--success); }
.toast-warning { background: var(--warning); color: #1a1200; }
.toast-info { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-strong); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }

/* ---------- MODAL ---------- */
.modal-wrapper {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.62); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
}
.modal-header {
  padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.modal-header h3 { font-size: 17px; }
.modal-body { flex: 1; overflow-y: auto; padding: 1.35rem; }
.modal-footer {
  padding: 1rem 1.35rem; border-top: 1px solid var(--border);
  display: flex; gap: .7rem; justify-content: flex-end; background: var(--surface);
}
@media (max-width: 560px) {
  .modal-wrapper { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
}

/* ---------- EMPTY / ERROR STATES ---------- */
.state {
  text-align: center; padding: 3rem 1.5rem; max-width: 440px; margin: 0 auto;
}
.state .state-icon {
  width: 66px; height: 66px; border-radius: 18px; margin: 0 auto 1.1rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted);
}
.state .state-icon i { width: 30px; height: 30px; }
.state h3 { margin-bottom: .45rem; }
.state p { color: var(--text-secondary); margin: 0 0 1.3rem; font-size: 14.5px; }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite; margin: 3rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- HERO / HOME ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(70% 55% at 50% 0%, rgba(30,99,216,.20), transparent 65%),
    repeating-linear-gradient(120deg, rgba(255,255,255,.015) 0 2px, transparent 2px 10px);
}
.hero-inner { position: relative; max-width: 780px; margin: 0 auto; }
.hero-logo { width: 120px; margin: 0 auto 1.4rem; filter: drop-shadow(0 10px 34px rgba(30,99,216,.3)); }
.hero h1 {
  font-family: Rajdhani, sans-serif; font-size: clamp(2.2rem, 8vw, 3.6rem);
  letter-spacing: .03em; line-height: 1; margin-bottom: .8rem;
}
.hero .lema { font-size: 12.5px; letter-spacing: .22em; color: var(--accent); font-weight: 700; margin-bottom: .5rem; }
.hero .lema-2 { color: var(--text-secondary); font-size: 15px; margin-bottom: 2rem; }
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

.info-strip { display: grid; gap: 1rem; grid-template-columns: repeat(3,1fr); }
.info-strip .info-item { display: flex; gap: .7rem; align-items: flex-start; }
.info-strip .info-item .ii-ic {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--accent);
}
.info-strip .info-item .ii-ic i, .info-strip .info-item .ii-ic svg { width: 19px; height: 19px; }
.info-item .ii-t { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }
.info-item .ii-v { font-size: 14px; color: var(--text-primary); }

/* ---------- WHATSAPP FLOAT ---------- */
/* Por defecto pegado abajo a la derecha. Solo se sube cuando hay barra de
   navegación inferior (páginas con footer mobile), para no taparla. En el HOME
   no hay footer, así que queda abajo del todo, no flotando en el medio. */
.whatsapp-float,
.whatsapp-float.ripple {
  /* El selector compuesto reafirma position:fixed por encima de .ripple
     (position:relative), que se agrega vía JS al inicializar el botón y de
     lo contrario lo saca del posicionamiento fijo dejándolo en el flujo normal. */
  position: fixed; right: 16px; bottom: 24px; z-index: 900;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25D366; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
}

/* ---------- MOBILE FOOTER NAV ---------- */
.app-footer-nav { display: none; }
@media (max-width: 768px) {
  .app-footer-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
    height: 64px; display: flex;
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .app-footer-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 10px; color: var(--text-muted); font-weight: 600;
    text-decoration: none;
  }
  .app-footer-nav a i { width: 21px; height: 21px; }
  .app-footer-nav a.active { color: var(--accent); }
  body.has-footer .main-content { padding-bottom: 84px; }
  body.has-footer .whatsapp-float { bottom: 84px; }
  .container, .container-narrow { padding: 1.25rem 1rem; }
  .info-strip { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* "Ver más" modal grid */
.mas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.mas-item {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1rem .5rem; border-radius: 13px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-primary);
  font-size: 12px; font-weight: 600;
}
.mas-item i { width: 23px; height: 23px; color: var(--accent); }
.mas-item.danger i { color: var(--danger); }

/* ---------- RIPPLE ---------- */
.ripple { position: relative; overflow: hidden; }
.ripple-wave {
  position: absolute; border-radius: 50%; background: var(--ripple);
  transform: scale(0); animation: ripple-anim .6s linear; pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

/* ---------- UTILIDADES ---------- */
.row { display: flex; align-items: center; gap: .75rem; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.text-muted{color:var(--text-muted)}.text-sec{color:var(--text-secondary)}
.text-accent{color:var(--accent)}.text-c{text-align:center}
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .28rem .6rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary);
}
.badge-accent { background: rgba(30,99,216,.14); border-color: rgba(30,99,216,.3); color: var(--accent-hover); }
.badge-success { background: rgba(52,192,122,.14); border-color: rgba(52,192,122,.3); color: var(--success); }
.badge-danger { background: rgba(224,82,78,.14); border-color: rgba(224,82,78,.3); color: var(--danger); }
.badge-warning { background: rgba(232,160,10,.14); border-color: rgba(232,160,10,.3); color: var(--warning); }
.section-title {
  display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem;
}
.section-title i { width: 20px; height: 20px; color: var(--accent); }
.avatar {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: Rajdhani, sans-serif; font-weight: 700; font-size: 17px;
  background: linear-gradient(135deg, var(--accent), var(--accent-press));
  color: #fff;
}
.list-row {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 13px;
  background: var(--surface); transition: .15s; margin-bottom: .6rem;
}
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { border-color: var(--border-strong); }
.list-row .lr-main { min-width: 0; flex: 1; }
.list-row .lr-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .lr-sub { font-size: 13px; color: var(--text-secondary); }

/* ---------- NOTIFICACIONES ---------- */
.notif-row { align-items: flex-start; }
.notif-row .notif-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  flex-shrink: 0; margin-top: 8px; visibility: hidden;
}
.notif-row.unread .notif-dot { visibility: visible; }
.notif-row.unread .lr-title { color: var(--text-primary); }
.notif-row .notif-time { font-size: 11px; color: var(--text-muted); margin-top: .3rem; }
.notif-row .notif-del { width: 32px; height: 32px; flex-shrink: 0; }
.notif-row .notif-del i { width: 15px; height: 15px; }

/* ---------- CONSTRUCTOR DE RUTINAS ---------- */
.cb-sesion {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 15px; padding: 1rem; margin-bottom: 1.1rem;
}
.cb-sesion-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.cb-sesion-head .badge {
  font-family: Rajdhani, sans-serif; font-size: 15px; min-width: 30px; justify-content: center;
}
.cb-s-nombre { flex: 1; font-weight: 700; font-family: Rajdhani, sans-serif; font-size: 16px; }
.cb-bloques { display: flex; flex-direction: column; gap: .8rem; margin-bottom: .8rem; }
.cb-bloque {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 12px; padding: .8rem;
}
.cb-bloque-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .7rem; }
.cb-b-nombre { flex: 1; font-weight: 600; }
.cb-ejercicios { display: flex; flex-direction: column; gap: .6rem; }
.cb-ej {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .6rem;
}
.cb-ej-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.cb-ej-head .cb-ej-in { flex: 1; font-weight: 500; }
.cb-ej-btns { display: flex; gap: .25rem; flex-shrink: 0; }
.cb-ej-btns .icon-btn { width: 34px; height: 34px; }
.cb-ej-btns .icon-btn i { width: 16px; height: 16px; }
.cb-ej-grid { display: grid; grid-template-columns: 80px 100px 1fr; gap: .4rem; }
.cb-ej-grid .input { padding: .55rem .6rem; font-size: 14px; }
.cb-bloque-head .icon-btn, .cb-sesion-head .icon-btn { width: 34px; height: 34px; flex-shrink: 0; }
.cb-bloque-head .icon-btn i, .cb-sesion-head .icon-btn i { width: 16px; height: 16px; }
@media (max-width: 520px) {
  .cb-ej-grid { grid-template-columns: 1fr 1fr; }
  .cb-ej-grid .input:last-child { grid-column: 1 / -1; }
}

/* ---------- MI RUTINA (alumno) — ficha colapsable ---------- */
.mr-sesion {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 15px; margin-bottom: 1rem; overflow: hidden;
}
.mr-sesion-head {
  display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem;
  cursor: pointer; user-select: none;
}
.mr-chevron { width: 18px; height: 18px; color: var(--accent); transition: transform .18s; flex-shrink: 0; }
.mr-sesion.open .mr-chevron { transform: rotate(90deg); }
.mr-s-nombre { flex: 1; font-weight: 700; font-family: Rajdhani, sans-serif; font-size: 16.5px; letter-spacing: .01em; }
.mr-sesion-body { display: none; padding: 0 1.1rem 1.1rem; }
.mr-sesion.open .mr-sesion-body { display: flex; flex-direction: column; gap: .8rem; }

.mr-bloque {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 12px; padding: .85rem;
}
.mr-bloque-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .7rem; }
.mr-bloque-head i { width: 16px; height: 16px; color: var(--accent); }
.mr-b-nombre { font-weight: 600; font-size: 14.5px; }
.mr-ejercicios { display: flex; flex-direction: column; gap: .6rem; }

.mr-ej {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: .8rem .9rem;
}
.mr-ej-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.mr-ej-nombre { font-weight: 600; font-size: 15px; }
.mr-ej-head .icon-btn { width: 34px; height: 34px; flex-shrink: 0; }
.mr-ej-head .icon-btn i { width: 16px; height: 16px; }
.mr-ej-meta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .5rem; font-size: 13px; color: var(--text-secondary); }
.mr-ej-meta span { display: flex; align-items: center; gap: .3rem; }
.mr-ej-meta i { width: 14px; height: 14px; color: var(--silver-3); }
.mr-ej-obs { margin-top: .5rem; font-size: 13px; color: var(--text-muted); font-style: italic; }
.mr-ultima {
  display: flex; align-items: center; gap: .4rem; margin-top: .7rem;
  padding-top: .6rem; border-top: 1px dashed var(--border);
  font-size: 12.5px; color: var(--success);
}
.mr-ultima i { width: 14px; height: 14px; flex-shrink: 0; }
.mr-ultima-vacia { color: var(--text-muted); }
.mr-ultima-pendiente { color: var(--warning); }

.mr-historial { display: flex; flex-direction: column; gap: .35rem; max-height: 180px; overflow-y: auto; }
.mr-historial-row {
  display: flex; align-items: center; gap: .7rem; font-size: 13px;
  padding: .45rem .6rem; border-radius: 8px; background: var(--bg-tertiary);
}
.mr-historial-fecha { font-family: Rajdhani, sans-serif; font-weight: 700; color: var(--accent); flex-shrink: 0; min-width: 40px; }

/* ---------- TABS ---------- */
.tabs { display: flex; gap: .4rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.tab {
  padding: .5rem 1rem; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary);
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- SWITCH (toggle activo/inactivo) ---------- */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border-strong); transition: .18s;
}
.switch-track::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--silver-2); transition: .18s;
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(18px); background: #fff; }
.switch input:disabled + .switch-track { opacity: .45; pointer-events: none; }

/* ---------- UPLOAD DE IMAGEN (logo / OG) ---------- */
.upload-box { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.upload-preview {
  width: 76px; height: 76px; border-radius: 13px; overflow: hidden; flex-shrink: 0;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview i { width: 26px; height: 26px; }

/* ---------- OFFLINE BANNER ---------- */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1200;
  display: none; align-items: center; justify-content: center; gap: .5rem;
  padding: .55rem 1rem; padding-top: calc(.55rem + env(safe-area-inset-top));
  background: var(--warning); color: #1a1200; font-size: 13px; font-weight: 600;
  text-align: center;
}
.offline-banner.visible { display: flex; }
.offline-banner i { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- MÉTRICAS (dashboard admin) ---------- */
.metric-tile { position: relative; }
.metric-tile .tile-icon.metric-alumnos { background: linear-gradient(135deg, rgba(30,99,216,.18), rgba(30,99,216,.05)); }
.metric-tile .tile-icon.metric-warn { color: var(--warning); background: linear-gradient(135deg, rgba(232,160,10,.18), rgba(232,160,10,.05)); border-color: rgba(232,160,10,.28); }
.metric-tile .tile-icon.metric-success { color: var(--success); background: linear-gradient(135deg, rgba(52,192,122,.18), rgba(52,192,122,.05)); border-color: rgba(52,192,122,.28); }
