:root {
  --green-900: #073c25;
  --green-800: #07542f;
  --green-700: #086b3c;
  --green-600: #0a7c45;
  --green-500: #15945a;
  --green-100: #dff5e8;
  --green-50: #f0faf4;
  --ink: #111713;
  --muted: #68726c;
  --line: #dfe5e1;
  --surface: #ffffff;
  --canvas: #f5f7f5;
  --amber: #f2a900;
  --red: #d74b4b;
  --blue: #377dff;
  --shadow-sm: 0 1px 2px rgba(7, 35, 21, .06), 0 5px 16px rgba(7, 35, 21, .05);
  --shadow-md: 0 14px 40px rgba(7, 35, 21, .12);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --topbar-h: 72px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100%; margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img, video { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(21, 148, 90, .24);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  padding: 0 max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(12, 66, 39, .11);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(18px) saturate(150%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 6px;
  cursor: pointer;
}
.brand-button > span:last-child { display: grid; line-height: 1; text-align: left; }
.brand-button strong { letter-spacing: -.04em; font-size: 1.2rem; }
.brand-button small { margin-top: 3px; font-size: .62rem; letter-spacing: .22em; color: var(--green-700); font-weight: 800; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--green-700); display: grid; place-items: center; position: relative; overflow: hidden; }
.brand-mark i { position: absolute; height: 3px; width: 16px; background: white; border-radius: 99px; transform: rotate(-24deg); }
.brand-mark i:nth-child(1) { margin-top: -10px; margin-left: -6px; }
.brand-mark i:nth-child(2) { width: 20px; }
.brand-mark i:nth-child(3) { margin-top: 10px; margin-left: 7px; width: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.sync-pill { display: none; align-items: center; gap: 8px; color: var(--muted); font-size: .83rem; border: 1px solid var(--line); border-radius: 99px; padding: 7px 10px; background: white; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 5px rgba(21,148,90,.11); }
.avatar-button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ink); color: white; font-size: .75rem; font-weight: 800; cursor: pointer; }

.page { animation: page-in .34s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 110px; }
.eyebrow { color: var(--green-700); text-transform: uppercase; letter-spacing: .16em; font-size: .73rem; font-weight: 850; margin: 0 0 8px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 7vw, 4rem); line-height: .98; letter-spacing: -.055em; margin-bottom: 14px; }
h2 { font-size: clamp(1.45rem, 3vw, 2.2rem); line-height: 1.07; letter-spacing: -.04em; }
h3 { letter-spacing: -.025em; }
.subtle { color: var(--muted); line-height: 1.55; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-title-row h2, .section-title-row h3 { margin-bottom: 0; }
.section-gap { margin-top: 34px; }

.btn { min-height: 46px; border-radius: 13px; padding: 0 17px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 750; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green-700); color: white; box-shadow: 0 8px 18px rgba(8,107,60,.2); }
.btn-primary:hover { background: var(--green-800); box-shadow: 0 11px 23px rgba(8,107,60,.25); }
.btn-dark { background: var(--ink); color: white; }
.btn-soft { background: var(--green-50); color: var(--green-800); border-color: #ccebd8; }
.btn-ghost { background: white; border-color: var(--line); }
.btn-danger { color: var(--red); background: #fff2f2; border-color: #ffd7d7; }
.btn-small { min-height: 38px; padding: 0 12px; font-size: .88rem; border-radius: 11px; }
.icon { width: 20px; height: 20px; display: inline-grid; place-items: center; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.login-page { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: #fff; }
.login-header { padding: 24px max(22px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: center; }
.login-header .brand-button { pointer-events: none; }
.login-badge { font-size: .78rem; padding: 8px 11px; border-radius: 99px; background: var(--green-50); color: var(--green-800); font-weight: 750; }
.login-main { width: min(1160px, calc(100% - 34px)); margin: auto; display: grid; gap: 34px; padding: 26px 0 50px; }
.login-copy { max-width: 700px; }
.login-copy h1 span { color: var(--green-700); }
.login-copy .subtle { max-width: 560px; font-size: 1.03rem; }
.role-grid { display: grid; gap: 13px; }
.role-card { text-align: left; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: white; cursor: pointer; display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.role-card:hover { transform: translateY(-3px); border-color: #a8dabb; box-shadow: var(--shadow-md); }
.role-card.selected { border-color: var(--green-600); background: var(--green-50); box-shadow: 0 0 0 3px rgba(21,148,90,.1); }
.role-card h3 { margin: 0 0 5px; font-size: 1rem; }
.role-card p { margin: 0; font-size: .86rem; color: var(--muted); }
.role-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; }
.role-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.chev { color: var(--muted); font-size: 1.3rem; }
.login-panel { padding: 22px; border-radius: 24px; background: var(--ink); color: white; position: relative; overflow: hidden; }
.login-panel::after { content: ""; position: absolute; width: 230px; height: 230px; border-radius: 50%; background: var(--green-600); filter: blur(0); right: -130px; top: -130px; opacity: .45; }
.login-panel > * { position: relative; z-index: 1; }
.login-panel h2 { font-size: 1.45rem; margin-bottom: 7px; }
.login-panel .subtle { color: #bac3bd; font-size: .9rem; }
.field { display: grid; gap: 7px; margin-top: 15px; }
.field label { font-size: .82rem; font-weight: 730; }
.field input, .field textarea, .field select, .search-input {
  width: 100%; border: 1px solid var(--line); background: white; min-height: 46px; border-radius: 12px; padding: 10px 13px; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 92px; }
.login-panel .field input { background: #252d28; color: white; border-color: #3c4740; }
.login-panel .field input::placeholder { color: #9ea8a2; }
.login-panel .btn { width: 100%; margin-top: 17px; background: white; color: var(--ink); }
.demo-note { font-size: .76rem; color: #9ea8a2; text-align: center; margin: 10px 0 0; }
.login-footer { padding: 20px; font-size: .77rem; color: var(--muted); text-align: center; }

.dashboard-hero { padding: 24px; border-radius: var(--radius-lg); background: var(--ink); color: white; overflow: hidden; position: relative; }
.dashboard-hero::before { content: ""; position: absolute; inset: auto -80px -110px auto; width: 260px; height: 260px; border-radius: 50%; border: 55px solid rgba(21,148,90,.35); }
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero .eyebrow { color: #9be5b9; }
.dashboard-hero h1 { max-width: 760px; font-size: clamp(2.2rem, 6.4vw, 4.5rem); }
.dashboard-hero .subtle { color: #c5cdc8; max-width: 590px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 21px; }
.dashboard-hero .btn-primary { background: white; color: var(--ink); box-shadow: none; }
.dashboard-hero .btn-ghost { background: transparent; color: white; border-color: #48524c; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.stat-card { padding: 17px; min-height: 125px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card .stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .82rem; }
.stat-card strong { font-size: 1.9rem; letter-spacing: -.05em; }
.stat-trend { color: var(--green-700); font-weight: 750; font-size: .77rem; }

.week-strip { display: grid; grid-template-columns: repeat(7, minmax(48px, 1fr)); gap: 7px; overflow-x: auto; padding-bottom: 4px; }
.day-pill { min-width: 52px; min-height: 68px; border-radius: 15px; border: 1px solid var(--line); background: white; display: grid; place-items: center; align-content: center; gap: 3px; cursor: pointer; }
.day-pill small { color: var(--muted); text-transform: uppercase; font-size: .67rem; font-weight: 750; }
.day-pill strong { font-size: .98rem; }
.day-pill.active { background: var(--green-700); color: white; border-color: var(--green-700); box-shadow: 0 8px 18px rgba(8,107,60,.2); }
.day-pill.active small { color: #bde7cc; }
.day-pill.done::after { content: ""; width: 5px; height: 5px; background: var(--green-500); border-radius: 50%; }
.day-pill.active.done::after { background: white; }

.progress-card { padding: 18px; }
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.progress-head h3 { margin-bottom: 5px; }
.progress-head p { margin: 0; color: var(--muted); font-size: .86rem; }
.progress-ring { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green-600) calc(var(--progress, 0) * 1%), #e5eae6 0); position: relative; flex: 0 0 auto; }
.progress-ring::before { content: ""; position: absolute; width: 54px; height: 54px; background: white; border-radius: 50%; }
.progress-ring strong { position: relative; z-index: 1; font-size: .9rem; }

.workout-list { display: grid; gap: 14px; }
.workout-card { overflow: hidden; display: grid; }
.exercise-media { background: #edf5ef; aspect-ratio: 16/10; position: relative; overflow: hidden; }
.exercise-media img { width: 100%; height: 100%; object-fit: cover; }
.exercise-media::after { content: "Demostración"; position: absolute; left: 10px; top: 10px; color: white; background: rgba(10,20,13,.72); backdrop-filter: blur(6px); border-radius: 99px; padding: 5px 8px; font-size: .68rem; font-weight: 750; }
.exercise-details { padding: 17px; }
.exercise-heading { display: flex; justify-content: space-between; gap: 12px; }
.exercise-heading h3 { margin-bottom: 5px; font-size: 1.08rem; }
.tag { display: inline-flex; align-items: center; border-radius: 99px; padding: 5px 9px; font-size: .69rem; font-weight: 780; background: var(--green-50); color: var(--green-800); white-space: nowrap; }
.exercise-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.exercise-meta div { background: var(--canvas); border-radius: 10px; padding: 9px; }
.exercise-meta small { display: block; color: var(--muted); font-size: .65rem; }
.exercise-meta strong { font-size: .84rem; }
.coach-note { border-left: 3px solid var(--green-600); padding: 9px 11px; background: var(--green-50); border-radius: 0 10px 10px 0; color: #405047; font-size: .83rem; line-height: 1.4; }
.exercise-actions { display: flex; gap: 8px; margin-top: 14px; }
.exercise-actions .btn { flex: 1; }
.complete-btn.complete { background: var(--green-100); color: var(--green-800); border-color: #aedfc0; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-card { padding: 18px; min-height: 140px; border: 0; text-align: left; cursor: pointer; position: relative; overflow: hidden; }
.quick-card h3 { margin: 40px 0 5px; }
.quick-card p { font-size: .8rem; color: var(--muted); margin: 0; }
.quick-card .role-icon { position: absolute; left: 16px; top: 16px; width: 39px; height: 39px; border-radius: 12px; }

.member-search-card { padding: 18px; }
.search-row { display: grid; gap: 10px; }
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; left: 13px; top: 13px; color: var(--muted); }
.search-wrap input { padding-left: 42px; }
.member-result { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.member-person { display: flex; align-items: center; gap: 11px; }
.member-avatar { width: 43px; height: 43px; border-radius: 14px; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; font-weight: 850; }
.member-person h3 { margin: 0 0 3px; font-size: .96rem; }
.member-person p { margin: 0; color: var(--muted); font-size: .77rem; }

.trainer-layout { display: grid; gap: 20px; }
.trainer-sidebar { display: grid; gap: 14px; align-content: start; }
.selected-member { padding: 18px; }
.selected-member .member-person { margin-bottom: 16px; }
.member-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.member-facts div { border-radius: 11px; background: var(--canvas); padding: 10px; }
.member-facts small { display: block; color: var(--muted); font-size: .67rem; }
.member-facts strong { font-size: .84rem; }
.routine-draft { padding: 18px; }
.routine-draft h3 { margin-bottom: 5px; }
.draft-empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: .84rem; }
.draft-list { display: grid; gap: 8px; margin: 14px 0; }
.draft-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.draft-item strong { display: block; font-size: .83rem; }
.draft-item small { color: var(--muted); font-size: .71rem; }
.draft-item button { border: 0; background: transparent; color: var(--red); cursor: pointer; }

.catalog-toolbar { display: grid; gap: 10px; margin-bottom: 15px; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: white; border-radius: 99px; padding: 9px 12px; white-space: nowrap; font-size: .79rem; font-weight: 700; cursor: pointer; }
.chip.active { background: var(--ink); border-color: var(--ink); color: white; }
.catalog-grid { display: grid; gap: 13px; }
.catalog-card { overflow: hidden; display: grid; grid-template-columns: 110px 1fr; min-height: 130px; }
.catalog-card .exercise-media { aspect-ratio: auto; min-height: 100%; }
.catalog-card .exercise-media::after { display: none; }
.catalog-info { padding: 13px; display: flex; flex-direction: column; align-items: flex-start; }
.catalog-info h3 { font-size: .95rem; margin-bottom: 4px; }
.catalog-info p { color: var(--muted); font-size: .74rem; line-height: 1.4; margin-bottom: 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.catalog-info .btn { margin-top: auto; }

.nutrition-hero { background: var(--green-800); color: white; border-radius: var(--radius-lg); padding: 24px; }
.nutrition-hero .eyebrow { color: #aee9c5; }
.nutrition-hero h1 { font-size: clamp(2.2rem, 8vw, 4rem); }
.nutrition-hero .subtle { color: #cce2d4; }
.macro-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.macro { background: rgba(255,255,255,.12); padding: 12px; border-radius: 13px; }
.macro small { display: block; color: #cce2d4; font-size: .68rem; }
.macro strong { font-size: 1.08rem; }
.meal-list { display: grid; gap: 10px; }
.meal-card { padding: 16px; display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; }
.meal-time { width: 42px; height: 42px; border-radius: 12px; background: var(--green-50); display: grid; place-items: center; color: var(--green-800); font-size: .71rem; font-weight: 800; }
.meal-card h3 { font-size: .92rem; margin: 0 0 4px; }
.meal-card p { margin: 0; color: var(--muted); font-size: .76rem; }
.meal-kcal { color: var(--muted); font-size: .72rem; white-space: nowrap; }

.agenda-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--green-100); color: var(--green-800); font-size: .68rem; }
.chip.active .count-badge { background: rgba(255,255,255,.2); color: white; }
.class-list { display: grid; gap: 13px; }
.class-card { display: grid; grid-template-columns: 76px 1fr; overflow: hidden; border-left: 5px solid var(--class-color, var(--green-700)); transition: transform .18s ease, box-shadow .18s ease; }
.class-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.class-card.cancelled { opacity: .62; }
.class-date { display: grid; place-items: center; align-content: center; padding: 15px 8px; background: color-mix(in srgb, var(--class-color, var(--green-700)) 12%, white); text-align: center; }
.class-date strong { font-size: 1rem; text-transform: capitalize; }
.class-date span { color: var(--muted); font-size: .7rem; margin-top: 4px; }
.class-main { padding: 15px; min-width: 0; }
.class-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.class-title-row h3 { margin: 7px 0 5px; font-size: 1rem; }
.class-main > p { margin: 0; color: var(--muted); font-size: .78rem; }
.availability { white-space: nowrap; border-radius: 99px; background: var(--green-50); color: var(--green-800); padding: 6px 9px; font-size: .7rem; font-weight: 800; }
.availability.full { background: #fff3e0; color: #9b5c00; }
.capacity-bar { height: 5px; border-radius: 99px; background: #e5ebe7; overflow: hidden; margin: 13px 0; }
.capacity-bar span { display: block; height: 100%; border-radius: inherit; background: var(--class-color, var(--green-700)); }
.class-actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.class-actions small { color: var(--muted); font-size: .72rem; }
.roster-list { display: grid; gap: 9px; margin-top: 14px; }
.roster-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 13px; }
.roster-row strong, .roster-row small { display: block; }
.roster-row strong { font-size: .88rem; }
.roster-row small { color: var(--muted); font-size: .72rem; margin-top: 3px; }

.qr-panel { padding: 20px; text-align: center; }
.scanner-frame { width: min(100%, 310px); aspect-ratio: 1; margin: 16px auto; border-radius: 24px; background: #111; overflow: hidden; position: relative; display: grid; place-items: center; color: white; }
.scanner-frame video { width: 100%; height: 100%; object-fit: cover; }
.scanner-corners::before, .scanner-corners::after { content: ""; position: absolute; inset: 19px; border: 3px solid transparent; pointer-events: none; }
.scanner-corners::before { border-top-color: #6ef4a7; border-left-color: #6ef4a7; }
.scanner-corners::after { border-right-color: #6ef4a7; border-bottom-color: #6ef4a7; }
.scan-line { position: absolute; left: 25px; right: 25px; height: 2px; background: #6ef4a7; box-shadow: 0 0 14px #6ef4a7; animation: scan 2s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translateY(-100px); } 50% { transform: translateY(100px); } }
.manual-code { display: flex; gap: 8px; max-width: 430px; margin: 0 auto; }
.manual-code input { flex: 1; min-width: 0; }
.machine-card { margin-top: 18px; text-align: left; padding: 16px; }
.machine-card h3 { margin-bottom: 5px; }
.machine-card p { color: var(--muted); font-size: .84rem; }

.machine-grid { display: grid; gap: 12px; }
.machine-row { padding: 15px; display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; }
.machine-row h3 { margin: 0 0 4px; font-size: .93rem; }
.machine-row p { margin: 0; color: var(--muted); font-size: .74rem; }
.machine-code { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: white; font-size: .66rem; font-weight: 800; }

.nutri-patients { display: grid; gap: 10px; }
.patient-card { padding: 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; cursor: pointer; }
.patient-card h3 { margin: 0 0 3px; font-size: .94rem; }
.patient-card p { margin: 0; color: var(--muted); font-size: .75rem; }

.empty-state { text-align: center; padding: 40px 18px; }
.empty-state .role-icon { margin: 0 auto 14px; width: 54px; height: 54px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); max-width: 370px; margin: 0 auto 16px; }

.mobile-nav { position: fixed; z-index: 45; bottom: 0; left: 0; right: 0; padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); background: rgba(255,255,255,.93); backdrop-filter: blur(18px); border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.nav-item { border: 0; background: transparent; min-height: 54px; border-radius: 12px; color: var(--muted); display: grid; justify-items: center; align-content: center; gap: 3px; cursor: pointer; }
.nav-item .icon { width: 21px; height: 21px; }
.nav-item span:last-child { font-size: .64rem; font-weight: 750; }
.nav-item.active { color: var(--green-700); background: var(--green-50); }

.modal-layer { position: fixed; inset: 0; z-index: 100; background: rgba(4,15,8,.55); backdrop-filter: blur(7px); padding: 18px; overflow-y: auto; }
.modal { width: min(610px, 100%); margin: max(18px, 5vh) auto; background: white; border-radius: 24px; box-shadow: 0 30px 100px rgba(0,0,0,.28); animation: modal-in .25s ease both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-header { padding: 19px 20px 13px; display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 1.3rem; margin: 0 0 4px; }
.modal-header p { margin: 0; color: var(--muted); font-size: .78rem; }
.close-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: white; font-size: 1.3rem; cursor: pointer; }
.modal-body { padding: 5px 20px 20px; }
.modal-footer { padding: 15px 20px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; }
.form-grid .field.full { grid-column: 1/-1; }
.preset-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.preset { border: 1px solid var(--line); border-radius: 99px; padding: 7px 9px; background: white; font-size: .72rem; cursor: pointer; }
.upload-box { margin-top: 15px; min-height: 130px; border: 1.5px dashed #abcdb8; background: var(--green-50); border-radius: 15px; display: grid; place-items: center; text-align: center; padding: 18px; cursor: pointer; }
.upload-box p { margin: 7px 0 0; color: var(--muted); font-size: .78rem; }

.toast-region { position: fixed; z-index: 150; right: 14px; bottom: 88px; display: grid; gap: 9px; width: min(350px, calc(100% - 28px)); }
.toast { padding: 13px 15px; border-radius: 14px; background: var(--ink); color: white; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 10px; animation: toast-in .25s ease both; }
.toast.success::before { content: "✓"; width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; background: var(--green-600); font-weight: 900; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 700px) {
  .sync-pill { display: inline-flex; }
  .page-wrap { padding-top: 36px; }
  .login-main { grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); align-items: center; }
  .role-grid { grid-template-columns: repeat(3, 1fr); }
  .role-card { grid-template-columns: 48px 1fr; align-content: start; }
  .role-card .chev { display: none; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .workout-list { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .macro-grid { grid-template-columns: repeat(4, 1fr); }
  .machine-grid, .nutri-patients { grid-template-columns: repeat(2, 1fr); }
  .class-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-row { grid-template-columns: 1fr auto; }
  .catalog-toolbar { grid-template-columns: minmax(250px, .7fr) 1.3fr; align-items: center; }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1020px) {
  .page-wrap { padding-bottom: 52px; }
  .mobile-nav { top: var(--topbar-h); bottom: 0; left: 0; right: auto; width: 92px; padding: 20px 10px; border-top: 0; border-right: 1px solid var(--line); grid-auto-flow: row; grid-auto-rows: 70px; grid-auto-columns: auto; align-content: start; }
  .page.with-nav { padding-left: 92px; }
  .nav-item { min-height: 64px; }
  .nav-item span:last-child { font-size: .68rem; }
  .trainer-layout { grid-template-columns: 310px minmax(0, 1fr); align-items: start; }
  .trainer-sidebar { position: sticky; top: calc(var(--topbar-h) + 20px); }
  .workout-card { grid-template-columns: 185px 1fr; }
  .exercise-media { aspect-ratio: auto; min-height: 100%; }
  .catalog-grid { grid-template-columns: repeat(3, 1fr); }
  .catalog-card { grid-template-columns: 1fr; }
  .catalog-card .exercise-media { aspect-ratio: 16/9; min-height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
