/* Design tokens and base layouts. Component refinements load afterwards. */
:root {
  --ink: #151515;
  --muted: #706c69;
  --paper: #f3f1ee;
  --card: #fff;
  --line: #dedfd8;
  --lime: #d5373f;
  --lime-dark: #a52128;
  --orange: #c43138;
  --blue: #e4d8d8;
  --lavender: #ddd9d6;
  --radius: 22px;
  --shadow: 0 14px 40px rgba(16, 23, 20, .08);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
h1,h2,h3,p { margin-top: 0; }
h1,h2,h3,.metric strong { font-family: "DM Sans", sans-serif; }
.app { min-height: 100vh; }
.topbar { height: 74px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(244,244,239,.9); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; min-width: 116px; line-height:.75; transform:rotate(-1deg); }
.brand-lockup { position:relative; display:inline-block; padding-right:32px; }
.brand-name { font-family:"Bebas Neue",sans-serif; font-size:28px; letter-spacing:1.2px; }
.brand-gym { position:absolute; right:0; bottom:-3px; color:var(--lime); font-family:"Permanent Marker",cursive; font-size:17px; transform:rotate(-7deg); }
.login-visual .brand-name { color:white; }
.role-switch { display: flex; gap: 4px; padding: 4px; background: #e7e8e1; border-radius: 99px; }
.role-switch button { border: 0; background: transparent; padding: 8px 15px; border-radius: 99px; color: var(--muted); font-weight: 600; }
.role-switch .active { background: white; color: var(--ink); box-shadow: 0 2px 8px #00000012; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: white; font-weight: 700; border:2px solid var(--lime); }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 74px); }
.sidebar { padding: 28px 18px; border-right: 1px solid var(--line); }
.nav { display: grid; gap: 7px; }
.nav button { border: 0; background: transparent; border-radius: 13px; padding: 12px 14px; text-align: left; color: var(--muted); font-weight: 600; display: flex; gap: 12px; align-items: center; }
.nav button.active { background: var(--ink); color: white; }
.main { padding: 34px 4vw 70px; max-width: 1440px; width: 100%; margin: 0 auto; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: 1.6px; font-size: 12px; font-weight: 700; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -2px; margin: 4px 0 0; }
.btn { border: 0; padding: 12px 18px; border-radius: 13px; background: var(--ink); color: white; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
.btn.lime { background: #bc2832; color: white; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 21px; }
.metric span { color: var(--muted); font-size: 14px; }
.metric strong { display: block; font-size: 31px; margin: 10px 0 4px; }
.metric small { color: var(--lime-dark); font-weight: 700; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card-head { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom: 20px; }
.card-head h2 { font-size: 19px; margin: 0; }
.week-chart { display: flex; height: 180px; align-items: end; justify-content: space-between; gap: 12px; padding-top: 20px; }
.bar-wrap { flex: 1; height:100%; display:flex; flex-direction:column; justify-content:flex-end; text-align: center; color: var(--muted); font-size: 12px; }
.bar { flex:none; width: 100%; max-width: 45px; margin: 0 auto 9px; background: linear-gradient(180deg,var(--lime),#992029); border-radius: 10px 10px 4px 4px; transition: height .4s ease; }
.activity { display: grid; gap: 9px; }
.activity-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #ecece7; }
.activity-row:last-child { border: 0; }
.activity-icon { width: 38px; height:38px; border-radius: 12px; display:grid; place-items:center; background: #eff1ea; }
.activity-row p { margin: 0; font-weight: 600; font-size:14px; }
.activity-row small { color:var(--muted); }
.status { padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; background:#f2dddd; color:#8f242a; }
.toolbar { display:flex; gap:10px; margin-bottom: 18px; flex-wrap:wrap; }
.search { flex:1; min-width:230px; border:1px solid var(--line); background:white; padding:12px 15px; border-radius:13px; outline:none; }
.search:focus { border-color:#a4ab9d; }
.filter { border:1px solid var(--line); background:white; padding:12px 14px; border-radius:13px; color:var(--ink); }
.client-list { display:grid; gap:10px; }
.client-row { background:white; border:1px solid var(--line); padding:15px 18px; border-radius:17px; display:grid; grid-template-columns: minmax(180px,1.2fr) .7fr .7fr .7fr 30px; align-items:center; gap:12px; transition:.2s; }
.client-row:hover { transform:translateY(-2px); box-shadow:var(--shadow); border-color:#c8aaa9; }
.person { display:flex; align-items:center; gap:12px; }
.person .avatar { background:#262424; color:white; border-color:#d65359; }
.person strong { display:block; }
.person small,.client-row > span { color:var(--muted); font-size:13px; }
.level { justify-self:start; padding:6px 10px; border-radius:99px; background:#f0eee8; color:#595c58 !important; font-weight:700; }
.level.experto { background:#f7dfd5; color:#a64320 !important; }
.level.intermedio { background:#ebe3e3; color:#6e3639 !important; }
.exercise-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:15px; }
.exercise { overflow:hidden; padding:0; }
.exercise-art { height:145px; display:grid; place-items:center; position:relative; background:var(--blue); }
.exercise:nth-child(2n) .exercise-art { background:var(--lavender); }
.exercise:nth-child(3n) .exercise-art { background:#f9d9c5; }
.exercise-art .figure { font-size:62px; filter:grayscale(1); opacity:.72; }
.exercise-body { padding:18px; }
.exercise-body h3 { margin:0 0 5px; font-size:17px; }
.exercise-body p { color:var(--muted); font-size:13px; margin:0 0 13px; line-height:1.5; }
.tag { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; }
.templates { display:grid; grid-template-columns:repeat(3,1fr); gap:15px; }
.template { min-height:210px; display:flex; flex-direction:column; }
.template .kicker { font-size:12px; color:var(--muted); font-weight:700; }
.template h3 { font-size:22px; letter-spacing:-.6px; margin:15px 0 7px; }
.template p { color:var(--muted); font-size:14px; line-height:1.5; }
.template footer { margin-top:auto; display:flex; justify-content:space-between; align-items:center; }
.dots { display:flex; }
.dots i { width:28px; height:28px; border:3px solid white; margin-left:-7px; border-radius:50%; background:var(--lime); display:grid; place-items:center; font-style:normal; font-size:9px; }
.mobile-shell { min-height:100vh; max-width:560px; margin:0 auto; padding:0 20px 100px; }
.mobile-head { padding:22px 0 20px; display:flex; justify-content:space-between; align-items:center; }
.mobile-head .brand { font-size:19px; }
.greeting { padding:20px 0 18px; }
.greeting h1 { font-size:36px; line-height:1.08; letter-spacing:-1.5px; margin:7px 0; }
.greeting p { color:var(--muted); }
.hero-workout { background:var(--ink); color:white; border-radius:28px; padding:25px; position:relative; overflow:hidden; }
.hero-workout:after { content:""; position:absolute; width:180px; height:180px; border:28px solid var(--lime); border-radius:50%; right:-85px; top:-75px; opacity:.72; }
.hero-workout .tag { color:var(--lime); }
.hero-workout h2 { font-size:28px; letter-spacing:-1px; margin:17px 0 8px; }
.hero-workout p { color:#b8beba; max-width:310px; }
.workout-meta { display:flex; gap:18px; font-size:13px; margin:20px 0; color:#d9dedb; }
.hero-workout .btn { width:100%; background:var(--lime); color:white; padding:15px; position:relative; z-index:1; }
.section-title { display:flex; align-items:center; justify-content:space-between; margin:27px 0 13px; }
.section-title h2 { font-size:19px; margin:0; }
.section-title button { border:0; background:none; color:var(--muted); font-size:13px; }
.day-strip { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.day { background:white; border:1px solid var(--line); border-radius:13px; text-align:center; padding:10px 2px; font-size:11px; color:var(--muted); }
.day strong { display:block; color:var(--ink); font-size:15px; margin-top:5px; }
.day.done { background:#f1dddd; border-color:#e3babc; }
.day.today { background:var(--ink); color:white; }
.day.today strong { color:white; }
.day.rest strong { color:#a5aaa7; }
.next-card { background:white; border:1px solid var(--line); border-radius:18px; padding:16px; display:flex; align-items:center; gap:14px; }
.mini-art { width:60px; height:60px; border-radius:15px; background:var(--lavender); display:grid; place-items:center; font-size:27px; }
.next-card h3 { font-size:15px; margin:0 0 4px; }
.next-card p { font-size:12px; color:var(--muted); margin:0; }
.bottom-nav { position:fixed; bottom:14px; left:50%; transform:translateX(-50%); max-width:520px; width:calc(100% - 32px); padding:8px; border-radius:20px; background:var(--ink); display:grid; grid-template-columns:repeat(3,1fr); z-index:20; box-shadow:0 18px 45px #10171442; }
.bottom-nav button { border:0; background:transparent; color:#929a95; padding:9px 4px; border-radius:13px; font-size:11px; display:grid; gap:3px; place-items:center; }
.bottom-nav button span:first-child { font-size:18px; }
.bottom-nav button.active { color:var(--lime); background:#202a25; }
.training { min-height:100vh; max-width:560px; margin:0 auto; padding:20px; display:flex; flex-direction:column; }
.training-top { display:flex; align-items:center; justify-content:space-between; }
.icon-btn { border:1px solid var(--line); background:white; width:42px; height:42px; border-radius:13px; font-size:18px; }
.training-progress { height:5px; background:#dcddd7; border-radius:99px; overflow:hidden; margin:24px 0; }
.training-progress i { display:block; height:100%; background:var(--ink); transition:width .35s; }
.training-art { height:235px; border-radius:26px; background:var(--lavender); display:grid; place-items:center; font-size:100px; }
.training-info { padding:22px 4px 0; }
.training-info h1 { font-size:31px; letter-spacing:-1.3px; margin:8px 0; }
.training-info > p { color:var(--muted); line-height:1.55; font-size:14px; }
.prescription { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:18px 0; }
.prescription div { background:white; border:1px solid var(--line); border-radius:15px; padding:12px; text-align:center; }
.prescription strong { display:block; font-family:"Manrope"; font-size:18px; }
.prescription span { font-size:11px; color:var(--muted); }
.coach-note { padding:13px 15px; background:#fff3d9; border-radius:14px; font-size:13px; line-height:1.45; }
.series { display:flex; justify-content:center; gap:12px; margin:22px 0 15px; }
.series i { width:14px; height:14px; border-radius:50%; border:2px solid var(--ink); }
.series i.done { background:var(--ink); }
.training-actions { margin-top:auto; display:grid; grid-template-columns:48px 1fr 48px; gap:10px; align-items:center; }
.training-actions .btn { padding:16px 10px; }
.history-week { margin-bottom:12px; background:white; border:1px solid var(--line); border-radius:18px; overflow:hidden; }
.history-week summary { list-style:none; padding:17px; display:flex; justify-content:space-between; cursor:pointer; font-weight:700; }
.history-week summary::-webkit-details-marker { display:none; }
.history-days { padding:0 17px 12px; }
.history-day { display:grid; grid-template-columns:34px 1fr auto; gap:10px; align-items:center; padding:12px 0; border-top:1px solid #ecece7; }
.history-day .check { width:30px; height:30px; border-radius:50%; background:#f1dddd; color:#992029; display:grid; place-items:center; }
.history-day p { margin:0; font-size:14px; font-weight:600; }
.history-day small { color:var(--muted); }
.login { min-height:100vh; display:grid; grid-template-columns:1.1fr .9fr; background:var(--paper); }
.login-visual { background:var(--ink); color:white; padding:8vw; display:flex; flex-direction:column; justify-content:space-between; position:relative; overflow:hidden; }
.login-visual:after { content:""; position:absolute; width:45vw; height:45vw; border:8vw solid var(--lime); border-radius:50%; right:-24vw; bottom:-20vw; opacity:.75; }
.login-visual h1 { font-size:clamp(44px,7vw,90px); line-height:.97; letter-spacing:-5px; max-width:700px; margin:0; position:relative; z-index:1; }
.login-visual p { color:#aeb6b1; max-width:440px; line-height:1.6; position:relative; z-index:1; }
.login-panel { display:grid; place-items:center; padding:30px; }
.login-box { width:min(410px,100%); }
.login-box h2 { font-size:34px; letter-spacing:-1.2px; margin:24px 0 8px; }
.login-box > p { color:var(--muted); }
.field { display:grid; gap:7px; margin:18px 0; font-size:13px; font-weight:700; }
.field input { border:1px solid var(--line); background:white; padding:14px; border-radius:13px; outline:none; }
.login-box .btn { width:100%; padding:15px; margin-top:8px; }
.demo-note { margin-top:20px; padding:13px; background:#e8e2df; border-radius:13px; font-size:12px; color:var(--muted); text-align:center; }
.client-profile { display:grid; grid-template-columns:1fr 1.7fr; gap:18px; }
.profile-card { text-align:center; }
.profile-avatar { width:88px; height:88px; display:grid; place-items:center; border-radius:28px; margin:0 auto 16px; background:var(--ink); color:white; border:4px solid var(--lime); font-size:27px; font-weight:800; }
.profile-card h2 { margin-bottom:4px; }
.profile-card > p { color:var(--muted); }
.profile-meta { display:grid; gap:0; margin-top:22px; text-align:left; }
.profile-meta div { display:flex; justify-content:space-between; padding:12px 0; border-top:1px solid var(--line); font-size:13px; }
.routine-banner { background:var(--ink); color:white; border-radius:18px; padding:20px; display:flex; justify-content:space-between; align-items:center; gap:15px; margin-bottom:16px; }
.routine-banner h3 { margin:4px 0; font-size:21px; }
.routine-banner p { color:#aaa5a2; margin:0; font-size:13px; }
.routine-days { display:grid; gap:8px; }
.routine-day { display:grid; grid-template-columns:48px 1fr auto; align-items:center; gap:12px; border:1px solid var(--line); border-radius:15px; padding:12px; }
.routine-day > b { width:43px; height:43px; border-radius:12px; display:grid; place-items:center; background:#eee9e6; }
.routine-day p { margin:0; font-weight:700; font-size:14px; }
.routine-day small { color:var(--muted); }
.timeline { border-left:2px solid #d9d3cf; margin:18px 0 0 8px; padding-left:20px; display:grid; gap:18px; }
.timeline-item { position:relative; }
.timeline-item:before { content:""; position:absolute; left:-27px; top:4px; width:10px; height:10px; border-radius:50%; background:var(--lime); border:3px solid var(--paper); }
.timeline-item h4 { margin:0 0 3px; }
.timeline-item small { color:var(--muted); }
.editor-days { display:flex; gap:7px; flex-wrap:wrap; margin:16px 0; }
.editor-days button { border:1px solid var(--line); background:white; padding:9px 12px; border-radius:11px; font-weight:700; }
.editor-days button.active { background:var(--ink); color:white; }
.editor-exercise { display:grid; grid-template-columns:32px 1fr repeat(3,70px); gap:9px; align-items:center; padding:12px 0; border-top:1px solid var(--line); }
.editor-exercise input { width:100%; border:1px solid var(--line); border-radius:9px; padding:8px; }
.modal-backdrop { position:fixed; inset:0; background:#1017147d; z-index:40; display:grid; place-items:center; padding:20px; backdrop-filter:blur(4px); }
.modal { background:var(--paper); width:min(560px,100%); border-radius:24px; padding:26px; max-height:90vh; overflow:auto; }
.modal-head { display:flex; justify-content:space-between; align-items:center; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.modal .field { margin:8px 0; }
.modal footer { display:flex; justify-content:flex-end; gap:9px; margin-top:20px; }
.toast { position:fixed; right:22px; bottom:22px; background:var(--ink); color:white; padding:13px 18px; border-radius:13px; transform:translateY(100px); opacity:0; transition:.3s; z-index:60; box-shadow:var(--shadow); }
.toast.show { transform:translateY(0); opacity:1; }
.empty { padding:50px; text-align:center; color:var(--muted); }
@media (max-width: 980px) {
  .grid-4 { grid-template-columns:repeat(2,1fr); }
  .two-col { grid-template-columns:1fr; }
  .exercise-grid,.templates { grid-template-columns:repeat(2,1fr); }
  .client-row { grid-template-columns:1.4fr .7fr .7fr 30px; }
  .client-row .hide-tablet { display:none; }
}
@media (max-width: 700px) {
  .desktop-only { display:none; }
  .topbar { padding:0 18px; }
  .shell { display:block; }
  .sidebar { display:none; }
  .main { padding:25px 18px 55px; }
  .page-head { align-items:flex-start; }
  .page-head h1 { font-size:33px; }
  .grid-4 { grid-template-columns:1fr 1fr; gap:9px; }
  .metric { padding:16px; }
  .metric strong { font-size:25px; }
  .exercise-grid,.templates { grid-template-columns:1fr; }
  .client-row { grid-template-columns:1fr auto; }
  .client-row > span,.client-row .level { display:none; }
  .login { grid-template-columns:1fr; }
  .login-visual { min-height:35vh; padding:35px 25px; }
  .login-visual h1 { font-size:50px; letter-spacing:-3px; }
  .login-visual p { display:none; }
  .login-panel { align-items:start; }
  .form-grid { grid-template-columns:1fr; }
  .client-profile { grid-template-columns:1fr; }
  .routine-banner { align-items:flex-start; flex-direction:column; }
  .editor-exercise { grid-template-columns:26px 1fr; }
  .editor-exercise input { grid-column:auto; }
}
