﻿:root {
  --ink: #16161d;
  --muted: #70707c;
  --line: #e3e3eb;
  --paper: #ffffff;
  --canvas: #f5f5f8;
  --green: #1c0bd7;
  --green-dark: #1200a8;
  --green-soft: #eeedff;
  --lime: #2d19ff;
  --orange: #f0edff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", sans-serif;
  display: grid;
  grid-template-columns: 236px 1fr;
}

button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.auth-screen {
  position: fixed; inset: 0; z-index: 1000; padding: 24px;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(45,25,255,.22), transparent 32%),
    radial-gradient(circle at 90% 80%, rgba(28,11,215,.16), transparent 35%),
    #08080d;
}
.auth-screen[hidden] { display: none; }
.auth-card {
  width: min(430px, 100%); padding: 34px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 22px;
  background: rgba(255,255,255,.97); box-shadow: 0 30px 80px rgba(0,0,0,.38);
}
.auth-logo { width: 64px; height: 64px; margin-bottom: 24px; border-radius: 13px; object-fit: cover; }
.auth-card h1 { margin: 8px 0 7px; font: 800 28px/1.15 Manrope, sans-serif; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.auth-card form { display: grid; gap: 15px; }
.auth-card form label { color: #4f4f5b; font-size: 12px; font-weight: 700; }
.auth-card form input {
  width: 100%; height: 46px; margin-top: 7px; padding: 0 13px;
  border: 1px solid #dcdce6; border-radius: 10px; outline: 0; background: white;
}
.auth-card form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.auth-submit { min-height: 46px; margin-top: 3px; }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-card .auth-message { min-height: 19px; margin: 15px 0 0; color: #3d3980; font-size: 12px; }
.auth-card .auth-message.error { color: #b3261e; }
.auth-mode {
  width: 100%; margin-top: 7px; padding: 8px; border: 0;
  color: var(--green); background: transparent; font-size: 12px; font-weight: 800;
}
body.auth-locked .app-header,
body.auth-locked main,
body.auth-locked > .toast { visibility: hidden; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  background: #050507;
  color: white;
  padding: 28px 18px 20px;
  display: flex;
  flex-direction: column;
  z-index: 5;
}

.brand {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-bottom: 30px;
}
.brand img { display: block; width: 142px; height: 142px; object-fit: contain; border-radius: 14px; background: #050507; }
.brand img.is-missing { display: none; }
.brand-fallback { display: none; width: 142px; min-height: 96px; align-content: center; justify-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: #050507; color: white; text-align: center; }
.brand img.is-missing + .brand-fallback { display: grid; }
.brand-fallback strong { display: block; color: white; font: 800 43px/1 Manrope, sans-serif; letter-spacing: 0; }
.brand-fallback small { display: block; margin-top: 7px; color: white; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }

nav { display: grid; gap: 8px; }
.nav-link {
  color: #b9bac8;
  text-decoration: none;
  padding: 12px 13px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-link span { width: 20px; text-align: center; font-size: 18px; }
.nav-link.active, .nav-link:hover { background: #1c1648; color: white; }
.nav-link.disabled { opacity: .42; cursor: default; }
.nav-link.disabled:hover { background: transparent; color: #b9bac8; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 8px 2px;
  border-top: 1px solid rgba(255,255,255,.11);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #2515b8; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 13px; }
.sidebar-footer small { color: #9293a3; font-size: 11px; margin-top: 2px; }

main { grid-column: 2; padding: 38px 44px 70px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 24px; max-width: 1500px; margin: 0 auto 27px; }
.back { color: var(--green); text-decoration: none; font-size: 13px; font-weight: 700; }
.title-row { display: flex; align-items: center; gap: 12px; margin-top: 7px; }
.plan-name { width: min(480px, 45vw); border: 0; outline: 0; background: transparent; color: var(--ink); font: 800 29px/1.2 Manrope, sans-serif; margin: 0; padding: 0; letter-spacing: -.04em; }
.plan-name:focus { color: var(--green); }
.status { color: #3c31a4; background: #ebe9ff; border-radius: 20px; padding: 5px 10px; font-size: 11px; font-weight: 700; }
.header-actions { display: flex; gap: 9px; }
.btn { border-radius: 9px; border: 1px solid var(--line); padding: 10px 15px; font-weight: 700; font-size: 13px; }
.btn.secondary { background: white; color: var(--ink); }
.btn.primary { background: var(--green); border-color: var(--green); color: white; box-shadow: 0 4px 12px rgba(28,11,215,.18); }
.btn.primary:hover { background: var(--green-dark); }

.athlete-card, .day-section { max-width: 1500px; margin-left: auto; margin-right: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 8px rgba(22,44,34,.03); }
.athlete-card { min-height: 86px; display: flex; align-items: center; padding: 18px 24px; gap: 24px; margin-bottom: 16px; }
.field { min-width: 120px; }
.field.grow { flex: 1; }
.field label { display: block; color: #87918c; font-size: 10px; font-weight: 800; letter-spacing: .11em; margin-bottom: 7px; }
.field input { border: 0; outline: 0; padding: 0; width: 100%; color: var(--ink); font-weight: 700; background: transparent; }
.field input:focus { color: var(--green); }
.static-value { font-size: 14px; font-weight: 700; white-space: nowrap; }
.date-field { min-width: 140px; }
.date-field input { color-scheme: light; }
.divider { height: 38px; width: 1px; background: var(--line); }

.day-section { overflow: hidden; }
.day-tabs-bar { min-height: 58px; padding: 10px 18px 0; display: flex; align-items: end; justify-content: space-between; gap: 16px; background: #f7f9f7; border-bottom: 1px solid var(--line); }
.day-tabs { display: flex; align-items: end; gap: 5px; overflow-x: auto; }
.day-management, .week-management { display: flex; align-items: center; gap: 6px; }
.day-tab { min-width: 86px; padding: 12px 15px 11px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #7d8882; font-size: 11px; font-weight: 800; letter-spacing: .07em; white-space: nowrap; }
.day-tab:hover { color: var(--green); }
.day-tab.active { color: var(--green-dark); border-bottom-color: var(--green); background: white; border-radius: 8px 8px 0 0; }
.add-day { padding: 7px 11px; border: 1px solid #c8c4e9; border-radius: 7px; background: white; color: var(--green); font-size: 10px; font-weight: 800; white-space: nowrap; }
.add-day:hover { background: var(--green-soft); }
.add-day:disabled { opacity: .4; cursor: not-allowed; }
.day-management { margin-bottom: 9px; }
.manage-btn { padding: 7px 9px; border: 1px solid #dedee8; border-radius: 7px; background: white; color: #60606d; font-size: 10px; font-weight: 700; white-space: nowrap; }
.manage-btn:hover { border-color: #b9b5df; color: var(--green-dark); }
.manage-btn.danger:hover { border-color: #edc2c2; color: #b53636; background: #fff7f7; }
.manage-btn:disabled { opacity: .35; cursor: not-allowed; }
.day-heading { padding: 22px 25px 19px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.eyebrow { display: block; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .13em; margin-bottom: 4px; }
.day-title { display: block; width: 330px; max-width: 55vw; border: 0; outline: 0; background: transparent; font: 800 20px Manrope, sans-serif; padding: 0; }
.week-toolbar { min-height: 47px; padding: 8px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: #fcfdfc; color: #87918c; font-size: 11px; }
.week-toolbar strong { color: var(--ink); font-size: 12px; }
.week-management select { height: 30px; padding: 0 25px 0 9px; border: 1px solid #d8e0dc; border-radius: 7px; background: white; color: #53615a; font-size: 10px; font-weight: 700; }
.add-week { padding: 7px 11px; border: 1px solid #c8c4e9; border-radius: 7px; background: white; color: var(--green); font-size: 10px; font-weight: 800; }
.add-week:hover { background: var(--green-soft); }
.add-week:disabled { opacity: .4; cursor: not-allowed; }

.planner-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.planner { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 1320px; }
.planner th { height: 45px; background: #f7f7fa; color: #7d7d89; font-size: 9px; letter-spacing: .1em; text-align: left; padding: 0 12px; border-bottom: 1px solid var(--line); }
.planner th:not(:last-child), .planner td:not(:last-child) { border-right: 1px solid var(--line); }
.block-col { width: 130px; }
.exercise-col { width: 25%; }
.actions-col { width: 43px; }
.week-headings th[colspan] { text-align: center; color: #5b5b69; font-size: 10px; }
.metric-headings th { height: 31px; padding: 0 7px; text-align: center; font-size: 8px; background: #fbfbfd; }
.metric-headings th:nth-child(even) { color: var(--green); }
.planner td { padding: 0; border-bottom: 1px solid var(--line); vertical-align: middle; background: white; }
.planner input { border: 0; outline: 0; width: 100%; min-height: 49px; padding: 10px 12px; background: transparent; color: var(--ink); font-size: 12px; }
.planner td.kg-cell { background: #f7f7fc; }
.planner td.kg-cell input { text-align: center; color: var(--green-dark); font-weight: 800; padding-left: 6px; padding-right: 6px; }
.planner td.kg-cell input::placeholder { color: #b7c4bd; font-weight: 600; }
.planner input:focus { background: #f1f0ff; box-shadow: inset 0 0 0 2px var(--green); }
.exercise-input { font-weight: 650; }
.exercise-editor { position: relative; }
.exercise-name-row { display: flex; align-items: center; }
.exercise-name-row .exercise-input { flex: 1; min-width: 0; }
.video-toggle {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-right: 7px;
  border: 1px solid #d9e2dd;
  border-radius: 7px;
  background: white;
  color: #819089;
  font-size: 12px;
  line-height: 1;
}
.video-toggle:hover, .video-toggle.has-video { color: #c62f2f; border-color: #efc6c6; background: #fff6f6; }
.video-editor { display: none; align-items: center; gap: 6px; padding: 0 8px 8px 12px; }
.video-editor.open { display: flex; }
.planner .video-editor input { min-height: 31px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 10px; background: #fff; }
.video-editor input:focus { box-shadow: 0 0 0 1px var(--green); }
.video-open { flex: 0 0 auto; padding: 7px 9px; border-radius: 6px; background: #d93636; color: white; text-decoration: none; font-size: 9px; font-weight: 800; }
.video-open.hidden { display: none; }
.block-cell { padding: 13px !important; vertical-align: top !important; }
.block-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; }
.block-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--block-color); }
.planner input.block-type {
  display: block;
  width: calc(100% - 15px);
  min-height: 24px;
  padding: 3px 4px;
  margin: 3px 0 0 11px;
  border-radius: 5px;
  color: #89938e;
  font-size: 9px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.planner input.block-type:hover { background: #f4f3fa; }
.planner input.block-type:focus { background: #eeedff; color: var(--green-dark); box-shadow: inset 0 0 0 1px var(--green); }
.row-action { width: 100%; height: 49px; border: 0; background: transparent; color: #9ca5a0; font-size: 17px; opacity: 0; }
tr:hover .row-action { opacity: 1; }
.row-action:hover { color: #bb3d3d; background: #fff4f4; }

.pause-row td { background: #f2f0ff; height: 33px; }
.pause-row td:first-child { border-right: 0; }
.pause-content { display: flex; align-items: center; justify-content: center; gap: 8px; color: #5547a7; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.pause-content input { width: 90px; min-height: 25px; padding: 2px 6px; text-align: center; color: #332887; font-weight: 800; }
.pause-content::before { content: "?"; font-size: 13px; }

.add-exercise-row td { height: 38px; }
.add-exercise { border: 0; color: var(--green); background: transparent; font-size: 11px; font-weight: 700; padding: 8px 12px; }
.add-exercise:hover { text-decoration: underline; }
.add-block { margin: 15px 24px 19px; padding: 10px 14px; color: var(--green); background: white; border: 1px dashed #aaa4db; border-radius: 9px; font-size: 12px; font-weight: 800; }
.add-block:hover { background: var(--green-soft); }
.pse-panel { margin: 0 24px 24px; padding: 20px; border: 1px solid #dcd9f6; border-radius: 12px; background: #f9f8ff; }
.pse-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.pse-heading h2 { margin: 0; font: 700 16px Manrope, sans-serif; }
.pse-panel > p { margin: 7px 0 16px; color: var(--muted); font-size: 11px; }
.pse-scale { padding: 5px 9px; border-radius: 20px; background: white; color: var(--green); font-size: 9px; font-weight: 800; }
.pse-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 9px; }
.pse-week { padding: 11px; border: 1px solid #e3e1f5; border-radius: 9px; background: white; }
.pse-week label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #747481; font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.pse-week input { width: 54px; height: 34px; border: 1px solid #d8d5ee; border-radius: 7px; outline: 0; color: var(--green); text-align: center; font-size: 15px; font-weight: 800; }
.pse-week input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.pse-completed { display: block; min-height: 13px; margin-top: 7px; color: #8077bd; font-size: 8px; }
.add-block span { margin-right: 5px; }

.toast { position: fixed; right: 28px; bottom: 28px; padding: 13px 18px; border-radius: 10px; background: #12121a; color: white; font-size: 13px; font-weight: 700; box-shadow: 0 10px 28px rgba(0,0,0,.18); transform: translateY(90px); opacity: 0; transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

.section-kicker { display: block; margin-bottom: 5px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.title-row h1 { margin: 0; font: 800 29px/1.2 Manrope, sans-serif; letter-spacing: -.04em; }
.counter { min-width: 25px; height: 25px; padding: 0 8px; display: grid; place-items: center; border-radius: 20px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; }
.section-description { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.athletes-topbar { align-items: center; }
.athletes-panel { max-width: 1500px; min-height: 460px; margin: 0 auto; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 8px rgba(22,22,35,.03); }
.athletes-toolbar { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.search-box { width: min(360px, 100%); height: 38px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fafafd; color: #8a8a96; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.athletes-grid { padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 13px; }
.athlete-item { padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: white; transition: .18s ease; }
.athlete-item:hover { border-color: #c8c4eb; box-shadow: 0 7px 18px rgba(28,11,215,.07); transform: translateY(-1px); }
.athlete-item-head { display: flex; align-items: center; gap: 11px; }
.athlete-initials { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; }
.athlete-item h3 { margin: 0; font: 700 14px Manrope, sans-serif; }
.athlete-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.athlete-goal { min-height: 32px; margin: 15px 0; color: #666673; font-size: 11px; line-height: 1.45; }
.athlete-item-actions { padding-top: 12px; display: flex; justify-content: flex-start; align-items: center; gap: 12px; border-top: 1px solid #efeff4; }
.athlete-item-actions button { border: 0; background: transparent; font-size: 10px; font-weight: 800; }
.open-athlete { color: var(--green); }
.invite-athlete { color: #226746; }
.delete-athlete { color: #a7a7b0; }
.athlete-item-actions .delete-athlete { margin-left: auto; }
.delete-athlete:hover { color: #bd3434; }
.athlete-link-state { width: fit-content; margin: -7px 0 12px; padding: 5px 8px; display: inline-flex; align-items: center; border-radius: 20px; background: #f2f2f5; color: #777783; font-size: 9px; font-weight: 800; }
.athlete-link-state.linked { background: #eaf8ef; color: #26734a; }
.empty-state { min-height: 360px; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state.hidden + * { display: initial; }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--green-soft); color: var(--green); font-size: 27px; }
.empty-state h2 { margin: 15px 0 5px; font: 700 18px Manrope, sans-serif; }
.empty-state p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.plans-list { padding: 10px 20px 20px; display: grid; }
.plan-row { min-height: 76px; padding: 13px 10px; display: grid; grid-template-columns: minmax(190px, 1.4fr) minmax(150px, 1fr) 110px 125px auto; align-items: center; gap: 16px; border-bottom: 1px solid #ececf2; }
.plan-row:hover { background: #fafaff; }
.plan-main strong, .plan-athlete strong { display: block; color: var(--ink); font-size: 12px; }
.plan-main span, .plan-athlete span, .plan-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.plan-status { width: fit-content; padding: 5px 9px; border-radius: 20px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.plan-row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.plan-row-actions button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #5e5e6c; font-size: 9px; font-weight: 800; }
.plan-row-actions .open-plan { border-color: #c8c4e9; color: var(--green); }

.profile-header, .profile-plans { max-width: 1500px; margin-left: auto; margin-right: auto; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 8px rgba(22,22,35,.03); }
.profile-header { margin-bottom: 16px; padding: 24px; }
.profile-back { display: inline-block; margin-bottom: 19px; color: var(--green); text-decoration: none; font-size: 11px; font-weight: 800; }
.profile-identity { display: flex; align-items: center; gap: 15px; }
.profile-identity .athlete-initials { width: 54px; height: 54px; flex-basis: 54px; font-size: 15px; }
.profile-identity h1 { margin: 0; font: 800 24px Manrope, sans-serif; }
.profile-identity p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.profile-details { margin-top: 22px; padding-top: 19px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; align-items: center; gap: 20px; border-top: 1px solid var(--line); }
.profile-detail small { display: block; margin-bottom: 5px; color: #9898a3; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.profile-detail strong { font-size: 12px; font-weight: 600; }
.profile-section-head { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.profile-section-head h2 { margin: 0; font: 700 17px Manrope, sans-serif; }
.profile-empty { padding: 45px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.pse-history-section { border-top: 1px solid var(--line); }
.pse-history { padding: 8px 24px 22px; display: grid; }
.pse-history-row { min-height: 55px; display: grid; grid-template-columns: 1.3fr .7fr .9fr 70px 110px; align-items: center; gap: 12px; border-bottom: 1px solid #eeeeF4; font-size: 10px; }
.pse-history-row strong { font-size: 11px; }
.pse-score { width: 38px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 800; }
.pse-history-empty { padding: 28px 0; color: var(--muted); text-align: center; font-size: 11px; }

.athlete-dialog { width: min(540px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 15px; color: var(--ink); box-shadow: 0 25px 70px rgba(0,0,0,.28); }
.athlete-dialog::backdrop { background: rgba(8,7,18,.55); backdrop-filter: blur(3px); }
.athlete-dialog form { padding: 25px; display: grid; gap: 16px; }
.dialog-heading { margin-bottom: 2px; display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-heading h2 { margin: 0; font: 800 21px Manrope, sans-serif; }
.dialog-close { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #777784; font-size: 20px; }
.athlete-dialog label { display: grid; gap: 6px; color: #62626e; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.athlete-dialog label input { width: 100%; height: 41px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.athlete-dialog label input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { padding-top: 5px; display: flex; justify-content: flex-end; gap: 8px; }
.invite-dialog-content { padding: 25px; display: grid; gap: 16px; }
.invite-dialog-content > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.invite-dialog-content > label { display: grid; gap: 7px; color: #62626e; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.invite-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.invite-link-row input { min-width: 0; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: #565663; background: #fafafd; font-size: 11px; }
.invite-expiration { color: var(--muted); font-size: 10px; }
.invite-share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.invite-share-actions .btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.whatsapp { color: white; background: #1f9d55; border-color: #1f9d55; }
.invite-done { width: 100%; }

body.athlete-view .sidebar, body.athlete-view .header-actions .primary, body.athlete-view .add-block, body.athlete-view .add-exercise-row, body.athlete-view .actions-col, body.athlete-view .row-action, body.athlete-view .day-management, body.athlete-view .week-management { display: none; }
body.athlete-view { grid-template-columns: 1fr; }
body.athlete-view main { grid-column: 1; }
body.athlete-view input { pointer-events: none; }
body.athlete-view .pse-week input { pointer-events: auto; }
body.athlete-view .video-toggle:not(.has-video) { visibility: hidden; }

@media (max-width: 900px) {
  body { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 15px 18px; flex-direction: row; align-items: center; }
  .brand { margin: 0 auto 0 0; padding: 0; }
  .sidebar-footer { display: none; }
  .brand img { width: 64px; height: 64px; border-radius: 10px; }
  .brand-fallback { width: 92px; min-height: 56px; border-radius: 10px; }
  .brand-fallback strong { font-size: 26px; }
  .brand-fallback small { margin-top: 3px; font-size: 8px; }
  nav { display: flex; }
  .nav-link { font-size: 0; padding: 9px; }
  .nav-link span { font-size: 18px; }
  main { padding: 25px 18px 50px; }
  .topbar { align-items: flex-start; }
  .header-actions { margin-top: 5px; }
  .athlete-card { flex-wrap: wrap; gap: 17px; }
  .divider { display: none; }
  .field.grow { flex-basis: 40%; }
}

@media (max-width: 620px) {
  main { padding: 18px 14px 42px; }
  .topbar, .athletes-topbar { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: stretch; margin-bottom: 16px; }
  .title-row { align-items: flex-start; gap: 8px; }
  .title-row h1 { font-size: 24px; }
  .section-description { font-size: 12px; line-height: 1.35; }
  .header-actions { margin-top: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .topbar > .btn, .athletes-topbar > .btn { width: 100%; min-height: 42px; }
  .btn { min-height: 40px; padding: 9px 12px; white-space: normal; }
  .athlete-card { display: grid; gap: 14px; padding: 16px; }
  .day-heading { align-items: flex-start; }
  .day-tabs-bar { padding-left: 10px; padding-right: 10px; }
  .day-tab { min-width: 68px; padding-left: 10px; padding-right: 10px; }
  .day-tabs-bar { flex-wrap: wrap; }
  .day-tabs { width: 100%; }
  .day-management { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .day-management .manage-btn, .day-management .add-day { flex: 1 1 92px; }
  .week-toolbar { align-items: flex-start; gap: 8px; padding: 10px 12px; }
  .week-toolbar > div:first-child { display: none; }
  .week-management { width: 100%; flex-wrap: wrap; align-items: stretch; }
  .week-management select { flex: 1 1 100%; height: 36px; }
  .week-management .manage-btn, .week-management .add-week { flex: 1 1 92px; min-height: 34px; }
  .plan-name { width: 100%; max-width: none; font-size: 24px; line-height: 1.15; }
  .status { margin-top: 3px; white-space: nowrap; }
  .form-row { grid-template-columns: 1fr; }
  .plans-list, .athletes-grid { padding: 12px; }
  .plan-row { grid-template-columns: 1fr auto; gap: 8px; }
  .plan-row-actions { display: grid; grid-template-columns: 1fr; }
  .plan-athlete, .plan-meta, .plan-status { display: none; }
  .planner-wrap { position: relative; margin: 0 -1px; border-top: 1px solid var(--line); }
  .planner { min-width: 1000px; }
  .block-col { width: 106px; }
  .planner th { padding: 0 8px; }
  .planner input { padding: 9px 8px; font-size: 11px; }
  .day-title { width: 100%; max-width: none; font-size: 18px; }
  .add-block { width: calc(100% - 24px); margin: 12px; }
  .pse-panel { margin: 0 12px 16px; padding: 15px; }
  .pse-heading { display: grid; gap: 8px; }
  .pse-grid { grid-template-columns: 1fr; }
  .profile-header { padding: 18px; }
  .profile-section-head { padding: 16px; display: grid; grid-template-columns: 1fr; gap: 12px; align-items: stretch; }
  .profile-section-head .btn { width: 100%; }
  .profile-details { grid-template-columns: 1fr; }
  .profile-plans .plans-list, .pse-history { padding-left: 12px; padding-right: 12px; }
  .pse-history-row { grid-template-columns: 1fr auto; }
  .pse-history-row span:not(.pse-score), .pse-history-row time { display: none; }
  .athlete-dialog form { padding: 18px; }
  .dialog-actions { display: grid; grid-template-columns: 1fr; }
  .invite-dialog-content { padding: 18px; }
  .invite-link-row, .invite-share-actions { grid-template-columns: 1fr; }
}

/* Cabecera de navegación por rol */
body { display: block; padding-top: 78px; }
.app-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 78px;
  padding: 10px 28px; display: flex; align-items: center; gap: 22px;
  color: white; background: #050507; box-shadow: 0 8px 30px rgba(5,5,7,.18);
}
.app-header .brand { margin: 0; padding: 0; flex: 0 0 auto; justify-content: flex-start; }
.app-header .brand img, .app-header .brand-fallback { width: 58px; height: 58px; min-height: 0; border-radius: 9px; }
.app-header .brand-fallback strong { font-size: 21px; }
.app-header .brand-fallback small { margin-top: 3px; font-size: 6px; }
.header-menu { position: relative; display: none; }
.account-menu { position: relative; margin-left: auto; }
.header-shortcuts {
  display: flex; align-items: center; gap: 8px;
}
.header-shortcuts[hidden] { display: none; }
.header-shortcut.nav-link {
  min-height: 48px; padding: 7px 13px; gap: 9px;
  border: 1px solid transparent; border-radius: 12px;
  color: #c8c8d2; background: transparent;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.header-shortcut.nav-link > span:last-child { width: auto; }
.header-shortcut.nav-link:hover {
  color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1);
  transform: translateY(-1px);
}
.header-shortcut.nav-link.active {
  color: white; background: linear-gradient(135deg, #3322e8, #1c0bd7);
  border-color: rgba(255,255,255,.18); box-shadow: 0 7px 20px rgba(28,11,215,.32);
}
.header-shortcut.nav-link.pending { color: #a8a8b4; }
.header-shortcut.nav-link.pending:hover { color: white; }
.shortcut-icon {
  width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px;
  border-radius: 9px; color: currentColor; background: rgba(255,255,255,.08);
}
.header-shortcut.active .shortcut-icon { background: rgba(255,255,255,.16); }
.shortcut-icon svg {
  width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.menu-trigger, .account-trigger {
  height: 54px; padding: 7px 13px; display: flex; align-items: center; gap: 11px;
  border: 1px solid rgba(255,255,255,.13); border-radius: 12px;
  color: white; background: rgba(255,255,255,.055); text-align: left;
}
.menu-trigger:hover, .account-trigger:hover,
.menu-trigger[aria-expanded="true"], .account-trigger[aria-expanded="true"] { background: #191629; border-color: rgba(255,255,255,.24); }
.menu-trigger-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #2515b8; }
.menu-trigger small, .menu-trigger strong, .account-copy small, .account-copy strong { display: block; }
.menu-trigger small { color: #8f90a0; font-size: 8px; font-weight: 800; letter-spacing: .12em; margin-bottom: 2px; }
.menu-trigger strong, .account-copy strong { font-size: 13px; }
.account-copy small { color: #9293a3; font-size: 10px; margin-top: 2px; }
.menu-chevron { color: #9495a5; font-size: 17px; margin-left: 5px; transition: transform .18s ease; }
[aria-expanded="true"] .menu-chevron { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: calc(100% + 10px); width: 360px; padding: 10px;
  color: var(--ink); background: white; border: 1px solid var(--line);
  border-radius: 15px; box-shadow: 0 22px 55px rgba(12,10,32,.22);
}
.role-dropdown { left: 0; }
.account-dropdown { right: 0; width: 285px; }
.dropdown-heading { padding: 10px 10px 13px; margin-bottom: 6px; border-bottom: 1px solid #ececf1; }
.dropdown-heading small { display: block; margin-bottom: 4px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.dropdown-heading strong { font: 800 18px Manrope, sans-serif; }
.dropdown nav { display: grid; gap: 3px; }
.dropdown .nav-link { padding: 10px; color: var(--ink); border-radius: 11px; font-size: 13px; }
.dropdown .nav-link > span { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 9px; background: #f0efff; color: var(--green); font-size: 16px; }
.dropdown .nav-link div { min-width: 0; }
.dropdown .nav-link div strong, .dropdown .nav-link div small { display: block; }
.dropdown .nav-link div small { margin-top: 2px; color: #81818d; font-size: 13px; line-height: 1.3; font-weight: 500; }
.dropdown .nav-link div strong { font-size: 13px; line-height: 1.3; }
.dropdown .nav-link em { margin-left: auto; color: #92929d; font: normal 800 7px/1 DM Sans, sans-serif; letter-spacing: .07em; }
.dropdown .nav-link.active, .dropdown .nav-link:hover { color: var(--green-dark); background: var(--green-soft); }
.account-summary { display: flex; align-items: center; gap: 10px; padding: 8px 8px 13px; margin-bottom: 5px; border-bottom: 1px solid #ececf1; }
.account-summary strong, .account-summary small { display: block; }
.account-summary small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.account-summary strong { font-size: 13px; }
.account-dropdown > button { width: 100%; padding: 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; font-size: 13px; font-weight: 600; }
.account-dropdown > button:hover { background: var(--green-soft); }
.account-dropdown > button > span:first-child { width: 22px; color: var(--green); text-align: center; }
.dropdown-divider { height: 1px; margin: 5px 0; background: #ececf1; }
.account-dropdown .danger-text { color: #b3261e; }
main { padding: 38px 44px 70px; }
body.student-view #chooseAthleteBtn,
body.student-view #emptyChooseAthleteBtn,
body.student-view #newAthleteBtn,
body.student-view #emptyNewAthleteBtn,
body.student-view #newAthletePlanBtn {
  display: none;
}
body.student-view .plan-row-actions [data-delete-plan],
body.student-view #editorView .header-actions,
body.student-view #editorView .day-management,
body.student-view #editorView .week-management,
body.student-view #editorView .add-block,
body.student-view #editorView .add-exercise-row,
body.student-view #editorView .actions-col,
body.student-view #editorView .row-action {
  display: none;
}
body.student-view #editorView input:not(.pse-input):not(.kg-input),
body.student-view #editorView select {
  pointer-events: none;
}
body.student-view #editorView .kg-input {
  color: var(--green-dark);
  background: #f3f1ff;
  border: 1px solid #c9c4ff;
  font-weight: 800;
}

@media (max-width: 900px) {
  body { padding-top: 70px; }
  .app-header { height: 70px; padding: 8px 16px; gap: 12px; }
  .app-header .brand img, .app-header .brand-fallback { width: 48px; height: 48px; }
  .header-menu { display: none; }
  .header-shortcuts { flex: 1; justify-content: center; }
  .header-shortcut.nav-link { padding: 7px 9px; }
  .header-shortcut.nav-link > span:last-child { display: none; }
  main { padding-top: 24px; }
}

@media (max-width: 620px) {
  .app-header { padding: 8px 10px; }
  .app-header .brand img, .app-header .brand-fallback { width: 44px; height: 44px; }
  .menu-trigger, .account-trigger { height: 48px; padding: 6px 9px; }
  .header-menu { display: block; }
  .header-shortcuts { display: none; }
  .menu-trigger-icon { width: 28px; height: 28px; }
  .menu-trigger small, .account-copy { display: none; }
  .menu-trigger strong { font-size: 11px; }
  .dropdown { position: fixed; top: 66px; left: 10px; right: 10px; width: auto; }
  .account-dropdown { left: auto; width: min(285px, calc(100vw - 20px)); }
}
