/* ═══════════════════════════════════════════════════════════
   FORJA · Esfuerzo. Constancia. Resultados.
   Paleta: blanco · azul noche · dorado champán
   Modo claro por defecto; modo oscuro desde Ajustes.
   ═══════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --card: #F7F8FB;
  --card-2: #FFFFFF;
  --ink: #0E1A33;
  --ink-2: #26355A;
  --muted: #5E677C;
  --faint: #8B93A7;
  --line: #E5E8F0;
  --line-2: #D3D9E6;

  --navy: #0E1A33;
  --navy-2: #16264A;
  --gold: #B8935A;
  --gold-2: #D9BF8C;
  --gold-text: #86672F;
  --gold-soft: #F6EFE0;
  --gold-grad: linear-gradient(135deg, #E6CF9E 0%, #C4A064 55%, #A98448 100%);

  --btn-bg: #0E1A33;
  --btn-ink: #FFFFFF;
  --btn-hover: #16264A;

  --c-p: #B8935A;
  --c-c: #1B2A4E;
  --c-f: #B8BFD0;
  --track: #E6E9F1;

  --hero: linear-gradient(135deg, #0E1A33 0%, #172850 100%);
  --on-gold: #0E1A33;
  --accent2: #B8935A;
  --accent2-soft: #F6EFE0;
  --accent-line: rgba(212, 178, 122, .45);
  --accent-glow: rgba(212, 178, 122, .3);
  --hero-line: transparent;
  --shadow: 0 1px 2px rgba(14, 26, 51, .04), 0 10px 30px -16px rgba(14, 26, 51, .18);
  --danger: #B0452F;
  --overlay: rgba(14, 26, 51, .55);
  --radius: 16px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1426;
  --card: #121D35;
  --card-2: #0E182D;
  --ink: #FFFFFF;
  --ink-2: #DCE3F2;
  --muted: #A3AEC5;
  --faint: #76829C;
  --line: #22314F;
  --line-2: #30426A;

  --gold: #D4B27A;
  --gold-2: #EBD3A2;
  --gold-text: #E2C58D;
  --gold-soft: rgba(212, 178, 122, .12);

  --btn-bg: #D4B27A;
  --btn-ink: #0B1426;
  --btn-hover: #E2C58D;

  --c-p: #D4B27A;
  --c-c: #7F98CC;
  --c-f: #4A5A7E;
  --track: #1C2A47;

  --hero: linear-gradient(135deg, #15264D 0%, #0E1A33 100%);
  --on-gold: #0E1A33;
  --accent2: #D4B27A;
  --accent2-soft: rgba(212, 178, 122, .12);
  --accent-line: rgba(212, 178, 122, .45);
  --accent-glow: rgba(212, 178, 122, .3);
  --hero-line: rgba(212, 178, 122, .28);
  --shadow: none;
  --danger: #E88E78;
  --overlay: rgba(3, 8, 18, .7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select { touch-action: manipulation; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: Manrope, 'DM Sans', sans-serif; margin: 0; color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--btn-bg); color: var(--btn-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.ic { vertical-align: middle; flex-shrink: 0; }

/* ───────── Barra lateral ───────── */
aside {
  position: fixed; inset: 0 auto 0 0; width: 252px; height: 100dvh;
  background: var(--bg); border-right: 1px solid var(--line);
  padding: 28px 18px 18px; display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brandmark { display: grid; place-items: center; filter: drop-shadow(0 4px 10px rgba(14, 26, 51, .18)); }
.bm-bg { fill: var(--navy); }
:root[data-theme="dark"] .bm-bg { fill: var(--navy-2); stroke: var(--accent-line); stroke-width: 1.5; }
.brandname { font-family: Manrope, sans-serif; font-weight: 800; font-size: 31px; letter-spacing: -1.4px; color: var(--ink); }
.brandname .dot { color: var(--gold); margin-left: 1px; }
.aside-label { font-size: 9.5px; letter-spacing: 1.8px; color: var(--faint); margin: 38px 14px 12px; font-weight: 700; }
nav button {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 12px 14px; margin: 2px 0; border-radius: 12px; color: var(--muted);
  font-weight: 500; position: relative; transition: background .15s, color .15s;
}
nav button:hover { background: var(--card); color: var(--ink); }
nav button.active { background: var(--gold-soft); color: var(--ink); font-weight: 700; }
nav button.active::before {
  content: ''; position: absolute; left: -18px; top: 10px; bottom: 10px; width: 4px;
  background: var(--gold); border-radius: 0 4px 4px 0;
}
nav button.active .nav-icon { color: var(--gold-text); }
.nav-icon { width: 22px; display: grid; place-items: center; }
.aside-bottom {
  margin: auto 4px 14px; padding: 18px 16px; border-radius: 14px;
  background: var(--navy); color: #fff; border: 1px solid var(--hero-line);
}
:root[data-theme="dark"] .aside-bottom { background: var(--card); }
.pillar-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 9px; }
.pillar-list li { display: grid; gap: 1px; padding-left: 11px; border-left: 2px solid var(--gold); }
.pillar-list b { font-family: Manrope, sans-serif; font-size: 13px; }
.pillar-list span { font-size: 11px; color: #AEB9D1; }
.profile {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  border-top: 1px solid var(--line); padding: 16px 6px 0; margin-top: 4px;
}
.profile small { display: block; font-size: 11px; color: var(--muted); }
.profile > span:nth-child(2) { font-weight: 600; flex: 1; min-width: 0; }
.profile-gear { color: var(--muted); display: grid; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-grad); color: var(--on-gold); font-family: Manrope, sans-serif; font-weight: 800;
}

/* ───────── Contenido ───────── */
main { margin-left: 252px; padding: 34px 44px 24px; max-width: 1400px; }
header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; }
.eyebrow { font-size: 10px; letter-spacing: 2px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.eyebrow.gold { color: var(--gold-text); }
h1 { font-size: 30px; letter-spacing: -1.1px; margin: 8px 0 0; line-height: 1.15; }
h2 { font-size: 18px; letter-spacing: -.4px; }
h3 { font-size: 15px; margin-bottom: 6px; }
.header-right { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; background: var(--card-2); color: var(--ink);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold-text); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.card-head p { margin: 4px 0 0; }
.sub { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 0; }
p.sub { margin: 6px 0; }
.muted { color: var(--muted); }
.section-intro { margin: -8px 0 22px; color: var(--muted); font-size: 14px; }
.lower-grid { margin-top: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 42px; padding: 10px 20px; border-radius: 12px; font-weight: 600; font-size: 13px;
  background: var(--btn-bg); color: var(--btn-ink); transition: background .15s, transform .1s;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(.98); }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn.secondary:hover { border-color: var(--gold); background: var(--gold-soft); }
.btn.gold { background: var(--gold-grad); color: var(--on-gold); }
.btn.gold:hover { filter: brightness(1.06); background: var(--gold-grad); }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 12px; border-radius: 10px; }
.btn.block { width: 100%; }
form .btn { margin-top: 18px; }
.text-btn { color: var(--gold-text); font-size: 12px; font-weight: 600; padding: 6px 4px; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; }
.text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-btn.danger, .danger { color: var(--danger); }
.new-badge {
  display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 7px; border-radius: 99px;
  background: var(--gold-soft); color: var(--gold-text); border: 1px solid var(--gold);
  font: 700 9px/1.5 'DM Sans', sans-serif; letter-spacing: 1px; text-transform: uppercase;
}
.pill {
  display: inline-block; border-radius: 99px; padding: 4px 10px; font-size: 11px; font-weight: 600;
  background: var(--gold-soft); color: var(--gold-text);
}
.pill.navy { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .pill.navy { background: var(--line); }

/* ───────── Portada ───────── */
.hero {
  background: var(--hero); border: 1px solid var(--hero-line); border-radius: 22px; color: #fff;
  display: grid; grid-template-columns: 1.35fr 1fr; min-height: 250px; position: relative; overflow: hidden;
}
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--gold-grad); }
.hero-content { padding: 36px 36px 32px; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; }
.hero .eyebrow { color: var(--gold-2); }
.hero h2 { color: #fff; font-size: 38px; line-height: 1.1; letter-spacing: -1.6px; margin: 14px 0 12px; font-weight: 800; }
.hero p { color: #BAC5DC; font-size: 14px; line-height: 1.65; max-width: 380px; margin: 0 0 20px; }
.motto { margin-top: 20px; font: 600 11px/1 Manrope, sans-serif; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-2); }
.hero-art { position: relative; }
.hero-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; font-weight: 500; }
.stat-icon {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-text);
}
.number { font-family: Manrope, sans-serif; font-size: 32px; font-weight: 800; letter-spacing: -1.4px; margin: 14px 0 8px; line-height: 1; }
.number small { font: 500 12px 'DM Sans', sans-serif; color: var(--muted); letter-spacing: 0; }

/* Tres pilares */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.pillar { padding: 4px 24px; border-left: 1px solid var(--line-2); }
.pillar:first-child { padding-left: 0; border-left: 0; }
.pillar:last-child { padding-right: 0; }
.pillar-top { display: flex; align-items: center; gap: 8px; font: 800 11px/1 Manrope, sans-serif; letter-spacing: 1.8px; color: var(--gold-text); text-transform: uppercase; }
.pillar .number { font-size: 28px; margin: 12px 0 6px; }

/* Barras y anillo */
.bar { height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar span { display: block; height: 100%; background: var(--gold-grad); border-radius: 99px; transition: width .4s ease; }
.ring {
  width: 120px; height: 120px; flex-shrink: 0; position: relative; display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(var(--gold) var(--progress), var(--track) 0);
}
.ring::before { content: ''; position: absolute; inset: 10px; background: var(--card); border-radius: 50%; }
.ring div { position: relative; text-align: center; font: 800 25px Manrope, sans-serif; letter-spacing: -1px; line-height: 1.1; }
.ring small { display: block; font: 400 10px 'DM Sans', sans-serif; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.nutrition-row { display: flex; align-items: center; gap: 22px; }
.macro { flex: 1; min-width: 0; }
.macro-line { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-top: 12px; }
.macro-line b { font-weight: 600; }
.macro-line span { color: var(--muted); display: flex; align-items: center; gap: 7px; }
.macro-line span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.bar.m span { background: var(--dot); }

/* Semana */
.week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day {
  border: 1px solid var(--line); background: var(--card-2); border-radius: 14px; padding: 11px 2px 10px;
  display: grid; gap: 5px; justify-items: center; color: var(--muted); font-size: 11px; font-weight: 500;
  transition: border-color .15s;
}
.day:hover { border-color: var(--gold); }
.day b { font: 800 16px Manrope, sans-serif; color: var(--ink); height: 22px; display: grid; place-items: center; }
.day small { font-size: 9.5px; color: var(--faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day.train small { color: var(--gold-text); font-weight: 600; }
.day.done b { color: var(--gold-text); }
.day.selected { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.day.selected b, .day.selected small { color: var(--btn-ink); }
.session-preview { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
.session-icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-text);
}
.session-text { flex: 1; min-width: 0; }
.session-text h3 { margin: 0 0 3px; }

/* Gráfico */
.chart { height: 200px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 5; }
.chart .axis { fill: var(--faint); font-size: 10px; }
.chart .target-line { stroke: var(--c-c); stroke-width: 2; stroke-dasharray: 5 5; fill: none; opacity: .75; }
.chart .real-line { stroke: var(--gold); stroke-width: 2.8; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .real-dot { fill: var(--card); stroke: var(--gold); stroke-width: 2.5; }
.chart .empty-text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 20px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; background: var(--gold); border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend i.target { background: transparent; border: 2px dashed var(--c-c); }

/* Foco */
.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.focus-tile {
  background: var(--card-2); border: 1px solid var(--line); min-height: 124px; border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; text-align: left;
  transition: border-color .15s, transform .15s;
}
.focus-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.focus-tile .ic-wrap { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-text); }
.focus-tile b { font-family: Manrope, sans-serif; font-size: 15px; }
.focus-tile small { font-size: 11px; color: var(--muted); display: block; }
.focus-detail { padding: 18px; background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 12px; margin-bottom: 8px; line-height: 1.7; font-size: 13px; }

/* Pestañas */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs button {
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: 99px; padding: 9px 18px;
  color: var(--muted); font-size: 13px; font-weight: 500; transition: all .15s;
}
.tabs button:hover { border-color: var(--gold); color: var(--ink); }
.tabs button.active { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); font-weight: 600; }

/* Ejercicios */
.exercise {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.exercise:last-child { border-bottom: 0; }
.ex-index {
  font: 800 12px Manrope, sans-serif; color: var(--gold-text); background: var(--gold-soft);
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
}
.exercise.logged .ex-index { background: var(--gold-grad); color: var(--on-gold); }
.exercise h3 { margin-bottom: 4px; }
.exercise p { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.ex-actions { display: flex; gap: 6px; align-items: center; }
.last-log { font-size: 11.5px; color: var(--muted); }
.last-log b { color: var(--gold-text); font-weight: 600; }
.session-progress { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.session-progress .bar { flex: 1; margin: 0; max-width: 220px; }

.notice {
  border-radius: 12px; background: var(--gold-soft); border: 1px solid transparent; border-left: 3px solid var(--gold);
  padding: 13px 16px; font-size: 12px; color: var(--ink-2); line-height: 1.75; margin: 14px 0;
}
.notice b { color: var(--ink); }
.notice .text-btn { padding: 0; }
.empty { padding: 24px 10px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; }
.history-item { padding: 13px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.history-item:last-child { border-bottom: 0; }

/* Comidas */
.meal { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.meal:last-of-type { border-bottom: 0; }
.meal-icon { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 13px; background: var(--gold-soft); color: var(--gold-text); }
.meal > div:nth-child(2) { flex: 1; min-width: 0; }
.meal h3 { margin: 4px 0 3px; font-size: 14px; }
.meal p { font-size: 12px; color: var(--muted); margin: 0 0 5px; }
.meal-meta { font-size: 12px; font-weight: 600; }
.meal-actions { margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.meal-actions .eaten { color: var(--gold-text); }
.week-total { padding: 16px 0 4px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: baseline; border-top: 1px solid var(--line-2); }

/* Progreso */
.goal-line { padding: 14px 0; border-bottom: 1px solid var(--line); }
.goal-line:last-of-type { border-bottom: 0; }
.goal-line > div:first-child { display: flex; justify-content: space-between; font-size: 13px; }
.goal-line b { font-family: Manrope, sans-serif; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.photo-card { position: relative; }
.photo-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; display: block; background: var(--track); }
.photo-card p { font-size: 11px; color: var(--muted); margin: 6px 0 0; }
.photo-card button {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(14, 26, 51, .72); color: #fff; display: grid; place-items: center; backdrop-filter: blur(4px);
}
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 460px; margin-bottom: 18px; }
.compare h3 { grid-column: 1 / -1; margin: 0; font-size: 13px; }

/* ───────── Formularios y ventanas ───────── */
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; font-weight: 500; }
input, select, textarea {
  border: 1px solid var(--line-2); background: var(--card-2); border-radius: 11px; padding: 11px 12px; width: 100%;
  color: var(--ink); outline: none; min-height: 44px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
input[type="file"] { padding: 9px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mt { margin-top: 14px; }

dialog {
  border: 1px solid var(--line-2); border-radius: 22px; width: min(560px, calc(100% - 24px)); max-height: 90dvh;
  padding: 0; color: var(--ink); background: var(--bg); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
}
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(4px); }
#modalContent { padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { font-size: 20px; }
.icon-x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); flex-shrink: 0; }
.icon-x:hover { border-color: var(--gold); }

.set-row { display: grid; grid-template-columns: 28px 70px 1fr 1fr 44px; gap: 9px; align-items: center; margin: 10px 0; }
.set-row.head { font-size: 11px; color: var(--faint); font-weight: 600; letter-spacing: .4px; margin-bottom: 2px; text-transform: uppercase; }
.set-n { font: 800 14px Manrope, sans-serif; color: var(--gold-text); text-align: center; }
.set-prev { font-size: 12px; color: var(--muted); white-space: nowrap; }
.set-row input[type="number"] { text-align: center; font-weight: 600; font-size: 16px; padding: 9px 6px; }
.check-wrap { position: relative; display: grid; place-items: center; margin: 0; cursor: pointer; width: 44px; height: 44px; }
.check-wrap input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; min-height: 0; }
.check-ui {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center;
  color: transparent; transition: all .15s; background: var(--card-2);
}
.check-wrap input:checked + .check-ui { background: var(--gold-grad); border-color: transparent; color: var(--on-gold); }
.check-wrap input:focus-visible + .check-ui { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Interruptores */
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-2); gap: 4px; }
.seg button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-ink); }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pref:last-of-type { border-bottom: 0; }
.pref b { display: block; font-size: 13px; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; margin: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; min-height: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--gold); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Temporizador */
.timer {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; min-width: 280px; padding: 14px 16px 16px;
  border-radius: 18px; background: var(--navy); color: #fff; border: 1px solid var(--accent-line);
  box-shadow: 0 18px 44px -12px rgba(5, 12, 30, .55);
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center;
}
.timer .t-label { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold-2); font-weight: 700; grid-column: 1 / 5; display: flex; align-items: center; gap: 7px; }
.timer .t-time { font: 800 32px Manrope, sans-serif; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.timer button { height: 34px; padding: 0 11px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.timer button:hover { background: rgba(255, 255, 255, .2); }
.timer .t-bar { grid-column: 1 / 5; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.timer .t-bar span { display: block; height: 100%; width: 0; background: var(--gold-grad); transition: width .25s linear; }
.timer.done { border-color: var(--gold); animation: pulse 1s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--accent-glow), 0 18px 44px -12px rgba(5, 12, 30, .55); } }

#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--navy); color: #fff; padding: 13px 22px; border-radius: 14px; z-index: 200; max-width: min(90%, 460px);
  border: 1px solid var(--accent-line); box-shadow: 0 14px 40px -10px rgba(5, 12, 30, .5); font-size: 13px; text-align: center;
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 10px; letter-spacing: 1.2px; color: var(--faint); }
footer b { font-weight: 700; }
footer span { letter-spacing: 0; font-size: 11px; }
footer button { color: var(--gold-text); font-size: 11px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
#mobileNav { display: none; }

/* ───────── Adaptación ───────── */
@media (max-width: 1150px) {
  aside { width: 216px; padding: 24px 12px 14px; }
  main { margin-left: 216px; padding: 28px 26px; }
  nav button.active::before { left: -12px; }
  .hero h2 { font-size: 32px; }
  .stats { gap: 12px; }
  .card { padding: 18px; }
  .number { font-size: 28px; }
  .ring { width: 100px; height: 100px; }
  .nutrition-row { gap: 14px; }
  .pillar { padding: 4px 16px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-main { grid-template-columns: 1.3fr 1fr; }
}

@media (max-width: 850px) {
  aside { display: none; }
  main { margin: 0; padding: 22px 18px calc(110px + env(safe-area-inset-bottom)); }
  header { align-items: center; margin-bottom: 20px; }
  h1 { font-size: 25px; }
  .header-right #dateLabel { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { position: absolute; inset: 0; opacity: .3; pointer-events: none; }
  .hero-content { padding: 28px 22px 26px; }
  .hero h2 { font-size: 31px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-main, .two-col { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; gap: 14px; }
  .pillar { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line-2); }
  .pillar:first-child { padding-top: 0; border-top: 0; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  #mobileNav {
    position: fixed; inset: auto 0 0 0; z-index: 40; display: flex; gap: 2px;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  }
  #mobileNav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 0; padding: 8px 0 4px;
    font-size: 10px; font-weight: 500; border-radius: 10px; background: none; color: var(--muted); min-width: 0;
  }
  #mobileNav button::before { display: none; }
  #mobileNav button.active { background: none; color: var(--ink); font-weight: 700; }
  #mobileNav button.active .nav-icon { color: var(--gold-text); }
  #mobileNav button.active::after { content: ''; width: 18px; height: 3px; border-radius: 3px; background: var(--gold); position: absolute; top: 0; }
  #mobileNav button { position: relative; }
  .timer { bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; left: 12px; min-width: 0; }
  dialog .timer, #modal .timer { bottom: 14px; }
  #toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

@media (max-width: 560px) {
  main { padding: 20px 14px calc(110px + env(safe-area-inset-bottom)); }
  h1 { font-size: 23px; }
  .eyebrow { font-size: 9px; }
  .hero h2 { font-size: 29px; letter-spacing: -1.2px; }
  .card { padding: 18px 16px; border-radius: 16px; }
  .number { font-size: 27px; }
  .nutrition-row { gap: 16px; }
  .ring { width: 104px; height: 104px; }
  .ring div { font-size: 22px; }
  .week-row { gap: 5px; }
  .day { padding: 10px 0 8px; border-radius: 12px; }
  .day small { font-size: 9px; }
  .session-preview { flex-wrap: wrap; }
  .session-preview .btn { width: 100%; }
  .focus-grid { gap: 8px; }
  .focus-tile { padding: 12px; min-height: 112px; }
  .exercise { grid-template-columns: 34px 1fr; gap: 10px 12px; }
  .ex-index { width: 32px; height: 32px; }
  .ex-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .field-grid { gap: 12px; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .tabs button { padding: 9px 14px; font-size: 12px; }
  #modalContent { padding: 20px 16px; }
  .set-row { grid-template-columns: 22px 54px 1fr 1fr 40px; gap: 7px; }
  .check-wrap { width: 40px; height: 40px; }
  .check-ui { width: 34px; height: 34px; }
  .card-head { flex-wrap: wrap; }
  .meal { gap: 11px; }
  .meal-icon { width: 40px; height: 40px; }
  .seg button { padding: 9px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   Ampliación: cuentas, panel de administración, chat y estilo neutro
   ═══════════════════════════════════════════════════════════ */
[hidden] { display: none !important; }

/* Tokens extra del estilo clásico */
:root { --accent2-text: #86672F; --on-accent2: #0E1A33; }
:root[data-theme="dark"] { --accent2-text: #E2C58D; --on-accent2: #0E1A33; }

/* ───────── Estilo NEUTRO: blanco y negro con detalles azules y rojos ───────── */
:root[data-style="neutral"] {
  --bg: #FFFFFF; --card: #F6F6F6; --card-2: #FFFFFF; --ink: #0A0A0A; --ink-2: #262626; --muted: #5F5F5F; --faint: #8A8A8A;
  --line: #E6E6E6; --line-2: #D0D0D0; --navy: #0A0A0A; --navy-2: #1A1A1A;
  --gold: #1D4ED8; --gold-2: #7FA1F4; --gold-text: #1D4ED8; --gold-soft: #EAF0FE;
  --gold-grad: linear-gradient(135deg, #4F7BF0 0%, #1D4ED8 60%, #173FAE 100%);
  --btn-bg: #0A0A0A; --btn-ink: #FFFFFF; --btn-hover: #262626;
  --c-p: #1D4ED8; --c-c: #0A0A0A; --c-f: #DC2626; --track: #E9E9E9;
  --hero: linear-gradient(135deg, #0A0A0A 0%, #1C1C1C 100%); --hero-line: transparent;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px -16px rgba(0, 0, 0, .18);
  --danger: #DC2626; --overlay: rgba(0, 0, 0, .55);
  --on-gold: #FFFFFF; --accent2: #DC2626; --accent2-soft: #FDECEC; --accent2-text: #B91C1C; --on-accent2: #FFFFFF;
  --accent-line: rgba(29, 78, 216, .55); --accent-glow: rgba(220, 38, 38, .35);
}
:root[data-style="neutral"][data-theme="dark"] {
  --bg: #0A0A0A; --card: #141414; --card-2: #0F0F0F; --ink: #FFFFFF; --ink-2: #E4E4E4; --muted: #A8A8A8; --faint: #7A7A7A;
  --line: #262626; --line-2: #373737; --navy: #171717; --navy-2: #222222;
  --gold: #4C8DFF; --gold-2: #8DB4FF; --gold-text: #7AA7FF; --gold-soft: rgba(76, 141, 255, .14);
  --gold-grad: linear-gradient(135deg, #6FA1FF 0%, #3B7BFF 60%, #2A62D9 100%);
  --btn-bg: #4C8DFF; --btn-ink: #0A0A0A; --btn-hover: #7AA7FF;
  --c-p: #4C8DFF; --c-c: #E5E5E5; --c-f: #FF5C5C; --track: #262626;
  --hero: linear-gradient(135deg, #161616 0%, #0A0A0A 100%); --hero-line: rgba(76, 141, 255, .4);
  --shadow: none; --danger: #FF6B6B; --overlay: rgba(0, 0, 0, .75);
  --on-gold: #0A0A0A; --accent2: #FF5C5C; --accent2-soft: rgba(255, 92, 92, .14); --accent2-text: #FF8A8A; --on-accent2: #0A0A0A;
  --accent-line: rgba(76, 141, 255, .5); --accent-glow: rgba(255, 92, 92, .35);
}
:root[data-style="neutral"] .pillar-list li { border-left-color: var(--accent2); }
:root[data-style="neutral"] .hero::after { background: linear-gradient(90deg, #1D4ED8, #DC2626); }
:root[data-style="neutral"][data-theme="dark"] .hero::after { background: linear-gradient(90deg, #4C8DFF, #FF5C5C); }

/* Etiquetas, avisos y botones con el segundo color de acento */
.new-badge { background: var(--accent2-soft); color: var(--accent2-text); border-color: var(--accent2); }
.pill.warn { background: var(--accent2-soft); color: var(--accent2-text); }
.danger-btn { background: var(--danger); color: #fff; }
.danger-btn:hover { background: var(--danger); filter: brightness(1.08); }
.btn.secondary.danger, .btn.small.secondary.danger { color: var(--danger); }
.badge-dot { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent2); color: var(--on-accent2); font: 700 11px/20px 'DM Sans', sans-serif; text-align: center; }
.badge-dot.sm { min-width: 17px; height: 17px; font-size: 10px; line-height: 17px; padding: 0 5px; margin-left: 6px; }
nav button .badge-dot.sm { margin-left: auto; }
.nav-lock { margin-left: auto; display: grid; color: var(--faint); }
.av { border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--gold-grad); color: var(--on-gold); font-family: Manrope, sans-serif; font-weight: 800; flex-shrink: 0; vertical-align: middle; }
#avatar { display: inline-grid; flex-shrink: 0; }

/* ───────── Carga y acceso ───────── */
.boot { min-height: 100dvh; display: grid; place-items: center; color: var(--muted); text-align: center; }
.boot-box { display: grid; gap: 14px; justify-items: center; }
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { background: var(--hero); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px; position: relative; overflow: hidden; border-right: 1px solid var(--hero-line); }
.auth-side::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--gold-grad); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brandname { color: #fff; font-size: 38px; }
.auth-side h1 { color: #fff; font-size: 54px; line-height: 1.02; letter-spacing: -2.2px; margin: 0; }
.auth-side p { color: #BAC5DC; max-width: 420px; font-size: 15px; line-height: 1.65; margin: 0; }
.auth-card { margin: auto; width: min(480px, calc(100% - 32px)); padding: 28px; }
.auth-seg { display: flex; width: 100%; margin-bottom: 18px; }
.auth-seg button { flex: 1; justify-content: center; }
.auth-error { color: var(--danger); font-size: 13px; line-height: 1.5; margin-bottom: 12px; font-weight: 500; }
.auth-error:empty { display: none; }
.auth form { display: grid; gap: 14px; }
.auth form .btn { margin-top: 6px; }
.pw { position: relative; }
.pw input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); border-radius: 10px; }
.pw-eye:hover { color: var(--ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.link-btn { color: var(--gold-text); font-weight: 600; font-size: 13px; text-align: center; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }
.auth .sub { margin: 0; }

/* ───────── Panel: invitación al chat ───────── */
.idea-banner { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 18px; margin-bottom: 18px; border-radius: 16px; background: var(--gold-soft); border: 1px solid var(--accent-line); color: var(--ink); transition: transform .15s; }
.idea-banner:hover { transform: translateY(-1px); }
.idea-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-grad); color: var(--on-gold); flex-shrink: 0; }
.idea-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.idea-text b { font-size: 14px; }
.idea-text small { color: var(--muted); font-size: 12px; }

/* ───────── Entrenamiento ───────── */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tab-add { border-style: dashed !important; display: inline-flex; align-items: center; gap: 4px; }
.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.start-grid.one { grid-template-columns: 1fr; }
.start-tile { display: grid; gap: 6px; justify-items: start; align-content: space-between; text-align: left; padding: 18px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--ink); min-height: 118px; transition: border-color .15s, transform .15s; }
.start-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.start-tile b { font-family: Manrope, sans-serif; font-size: 15px; }
.start-tile small { color: var(--muted); font-size: 12px; }
.start-tile .ic { color: var(--gold-text); }
.start-tile.primary { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.start-tile.primary small { color: inherit; opacity: .8; }
.start-tile.primary .ic { color: inherit; }
.ex-card { border: 1px solid var(--line); background: var(--card-2); border-radius: 16px; padding: 14px 14px 10px; margin: 12px 0; }
.ex-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ex-card-title { flex: 1; min-width: 0; }
.ex-card-title h3 { margin: 0 0 2px; font-size: 15px; }
.ex-card-title p { margin: 0; }
.ex-tools { display: flex; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 99px; background: var(--gold-soft); color: var(--gold-text); font-size: 12px; font-weight: 600; }
.ex-photo { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--track); flex-shrink: 0; }
.ex-photo.sm { width: 40px; height: 40px; border-radius: 10px; }
.ex-index.sm { width: 34px; height: 34px; flex-shrink: 0; }
.ex-foot { display: flex; justify-content: space-between; align-items: center; }
.wk { border-bottom: 1px solid var(--line); }
.wk:last-child { border-bottom: 0; }
.wk summary { list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 13px 0; cursor: pointer; font-size: 13px; }
.wk summary::-webkit-details-marker { display: none; }
.wk-body { padding: 0 0 14px; }
.wk-ex { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.search { position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 36px; }
.ex-results { display: grid; gap: 6px; margin-top: 12px; max-height: 46dvh; overflow: auto; }
.ex-row { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); text-align: left; }
.ex-row:hover { border-color: var(--gold); }
.ex-row b { display: block; font-size: 14px; }
.ex-row small { color: var(--muted); font-size: 12px; }
.tpl-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tpl-row:last-child { border-bottom: 0; }
.tpl-row b { display: block; }
.tpl-row small { display: block; color: var(--muted); font-size: 12px; }
.tpl-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.tpl-items { display: grid; gap: 12px; margin: 14px 0; }
.tpl-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--card-2); }
.tpl-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tpl-item-head b { flex: 1; min-width: 0; }
.tpl-item-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
dialog.wide { width: min(720px, calc(100% - 24px)); }
.check-line { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; cursor: pointer; }
.check-line input { width: 18px; height: 18px; min-height: 0; accent-color: var(--gold); padding: 0; }

/* ───────── Ajustes y perfil ───────── */
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.style-opt { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 12px; border-radius: 14px; border: 2px solid var(--line-2); background: var(--card-2); color: var(--ink); }
.style-opt[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.style-opt b { font-size: 14px; }
.style-opt small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.sw { display: flex; gap: 4px; margin-bottom: 4px; }
.sw i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(128, 128, 128, .35); }
.sw.classic i:nth-child(1), .sw.neutral i:nth-child(1) { background: #fff; }
.sw.classic i:nth-child(2) { background: #0E1A33; } .sw.classic i:nth-child(3) { background: #C4A064; }
.sw.neutral i:nth-child(2) { background: #0A0A0A; } .sw.neutral i:nth-child(3) { background: #1D4ED8; } .sw.neutral i:nth-child(4) { background: #DC2626; }
.obj-row { display: flex; gap: 10px; align-items: center; }
.obj-row input { max-width: 110px; }
.btn.secondary.on { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.locked { text-align: center; padding: 56px 24px; max-width: 560px; margin: 20px auto; }
.locked h2 { font-size: 26px; margin-bottom: 10px; }
.locked p { margin: 6px 0; }
.lock-ic { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--gold-soft); color: var(--gold-text); }
.locked-card { border-style: dashed; box-shadow: none; }
.locked-card .card-head { margin-bottom: 10px; }
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head > div { min-width: 0; }
.avatar-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.file-btn { cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip-link { padding: 5px 11px; border-radius: 99px; background: var(--gold-soft); color: var(--gold-text); font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.chip-link:hover { border-color: var(--gold); }
.social-soon { border-style: dashed; }
.seg[aria-disabled="true"] button { opacity: .6; cursor: not-allowed; }

/* ───────── Panel de administración ───────── */
.admin-tabs .badge-dot { margin-left: 6px; }
.admin-stats { margin: 0 0 16px; }
.admin-stats .number { font-size: 30px; }
.chart.bars { height: 190px; }
.bar-rect { fill: var(--gold); }
.user-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.user-row:last-child { border-bottom: 0; }
.user-row:hover { background: var(--gold-soft); }
.user-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.user-main small, .user-meta small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta { display: grid; justify-items: end; gap: 1px; flex-shrink: 0; }
.user-meta b { font: 800 18px Manrope, sans-serif; }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-self: flex-start; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { flex: 1; min-width: 200px; }
.toolbar select { width: auto; min-width: 150px; }
.card-head .search { min-width: 240px; }
.ex-admin-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ex-admin-main { flex: 1; min-width: 160px; display: grid; }
.ex-admin-main small { color: var(--muted); font-size: 12px; }
.ex-admin-actions { display: flex; gap: 6px; align-items: center; }
.temp-pw { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px; border: 1px dashed var(--gold); border-radius: 12px; background: var(--gold-soft); }
.temp-pw code { font-size: 20px; font-weight: 700; letter-spacing: 1px; }

/* ───────── Chat ───────── */
.chat { display: grid; gap: 12px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; max-height: 46dvh; min-height: 180px; overflow: auto; padding: 4px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14px; }
.bubble p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble time { font-size: 10.5px; opacity: .7; }
.bubble.mine { align-self: flex-end; background: var(--btn-bg); color: var(--btn-ink); border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }
.chat-form .btn { margin-top: 0; padding: 0 16px; }

/* ───────── Menú "Más" (móvil) ───────── */
.more-list { display: grid; gap: 8px; }
.more-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); text-align: left; color: var(--ink); }
.more-item:hover { border-color: var(--gold); }

@media (max-width: 850px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 22px 30px; gap: 14px; border-right: 0; }
  .auth-side h1 { font-size: 34px; letter-spacing: -1.4px; }
  .auth-side .pillar-list { display: none; }
  .auth-card { margin: -18px auto 28px; position: relative; z-index: 1; }
  .idea-banner { padding: 12px 14px; }
  #mobileNav button .badge-dot.sm { position: absolute; top: 2px; right: 22%; margin: 0; }
  #mobileNav .nav-lock { position: absolute; top: 4px; right: 24%; margin: 0; }
  .card-head .search { min-width: 0; width: 100%; }
}
@media (max-width: 560px) {
  .start-grid { grid-template-columns: 1fr; }
  .start-tile { min-height: 0; }
  .tpl-item-fields { gap: 8px; }
  .style-grid { grid-template-columns: 1fr; }
  .user-meta { display: none; }
  .profile-head { gap: 14px; }
  .bubble { max-width: 90%; }
  .auth-card { padding: 22px 18px; }
}

.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
