/* ============ SAMMYFITNESSONERD — Design System ============ */
:root {
  /* Tema basado en logo: negro + cian turquesa + plata */
  --navy-900: #060808;
  --navy-800: #0c1110;
  --navy-700: #151c1b;
  --navy-600: #1f2928;
  --panel: #0e1413;
  --panel-2: #121a19;
  --line: #2a3635;
  --line-soft: #1b2322;
  --ink: #eef5f4;
  --ink-soft: #a4b6b4;
  --ink-mute: #647877;
  --accent: #00e5d2;
  --accent-2: #00b3a4;
  --accent-glow: rgba(0,229,210,.32);
  --silver: #c4d0cf;
  --ring: #5e8a8a;
  --green: #22c55e;
  --green-soft: rgba(34,197,94,.15);
  --yellow: #f5b73d;
  --yellow-soft: rgba(245,183,61,.15);
  --red: #ef4444;
  --red-soft: rgba(239,68,68,.15);
  --blue: #38bdf8;
  --blue-soft: rgba(56,189,248,.15);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --shadow-sm: 0 4px 14px rgba(0,0,0,.3);
  --sidebar-w: 256px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #0a2e2b 0%, transparent 60%), var(--navy-900);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============ Fondo vívido animado ============ */
.bg-photo {
  position: fixed; inset: -30px; z-index: 0; pointer-events: none;
  background: url('../assets/fondo-gym.jpg') center 30%/cover no-repeat;
  filter: blur(5px) brightness(.6) saturate(1.15);
  transform: scale(1.05);
}
.bg-photo::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, var(--navy-900) 0%, rgba(6,8,8,.32) 22%, rgba(6,8,8,.32) 78%, var(--navy-900) 100%),
    radial-gradient(1000px 560px at 12% 0%, rgba(0,229,210,.10), transparent 60%);
}
.bg-fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-fx i {
  position: absolute; display: block; border-radius: 50%; filter: blur(90px);
  opacity: .4; will-change: transform;
}
.bg-fx i:nth-child(1) {
  width: 620px; height: 620px; left: -180px; top: -200px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  animation: sfDrift1 26s ease-in-out infinite;
}
.bg-fx i:nth-child(2) {
  width: 520px; height: 520px; right: -160px; top: 14%;
  background: radial-gradient(circle, rgba(56,189,248,.30), transparent 70%);
  animation: sfDrift2 32s ease-in-out infinite;
}
.bg-fx i:nth-child(3) {
  width: 560px; height: 560px; left: 18%; bottom: -240px;
  background: radial-gradient(circle, rgba(0,179,164,.28), transparent 70%);
  animation: sfDrift3 30s ease-in-out infinite;
}
.bg-fx i:nth-child(4) {
  width: 360px; height: 360px; right: 8%; bottom: -120px;
  background: radial-gradient(circle, rgba(245,183,61,.14), transparent 70%);
  animation: sfDrift2 22s ease-in-out infinite reverse;
}
@keyframes sfDrift1 { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(90px,70px) scale(1.15); } }
@keyframes sfDrift2 { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-80px,60px) scale(1.1); } }
@keyframes sfDrift3 { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(70px,-50px) scale(1.12); } }
#app { position: relative; }  /* z-index removido: evita que el fondo del menú móvil tape los botones */
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

#app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ============ Sidebar ============ */
.sidebar {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #04332f);
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
  box-shadow: 0 0 0 2px var(--ring), 0 6px 18px var(--accent-glow);
  position: relative; overflow: hidden; flex: none;
}
.brand-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.brand-fallback { color: #042421; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 14px; letter-spacing: .3px; }
.brand-accent { color: var(--accent); }
.brand-sub { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

.nav {
  display: flex; flex-direction: column; gap: 4px; margin-top: 8px;
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 4px; scrollbar-width: thin;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 8px; }
.nav-item { flex: none; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  background: transparent; border: 0; color: var(--ink-soft);
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; text-align: left; transition: all .15s;
}
.nav-item:hover { background: var(--navy-700); color: var(--ink); }
.nav-item.active { background: linear-gradient(90deg, var(--accent-2), transparent); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.nav-ico { width: 20px; text-align: center; font-size: 15px; opacity: .9; transition: transform .18s ease; }
.nav-item:hover .nav-ico { transform: translateX(2px) scale(1.08); }
@media (max-height: 760px) {
  .nav-item { padding: 8px 12px; font-size: 13px; }
  .brand { padding-bottom: 10px; }
  .sidebar { padding: 14px 12px; }
}

.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 0; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); padding: 7px 10px; border-radius: 8px; font-size: 12px; }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }
.version { font-size: 11px; color: var(--ink-mute); }

/* ============ Main / Topbar ============ */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 26px; border-bottom: 1px solid var(--line-soft);
  background: rgba(10,15,31,.7); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.hamburger { display: none; background: transparent; border: 0; color: var(--ink); font-size: 22px; }
.topbar-title { font-size: 19px; font-weight: 700; }
.topbar-search { margin-left: auto; }
.topbar-search input {
  width: 280px; max-width: 40vw; background: var(--navy-800); border: 1px solid var(--line);
  color: var(--ink); padding: 10px 14px; border-radius: 10px; font-size: 13px; outline: none; transition: border .15s;
}
.topbar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.today { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }

.content { padding: 26px; flex: 1; }
.content > * { animation: sfRise .5s cubic-bezier(.22,1,.36,1) both; }
.content > *:nth-child(1) { animation-delay: .02s; }
.content > *:nth-child(2) { animation-delay: .08s; }
.content > *:nth-child(3) { animation-delay: .14s; }
.content > *:nth-child(4) { animation-delay: .20s; }
.content > *:nth-child(5) { animation-delay: .26s; }
.content > *:nth-child(6) { animation-delay: .32s; }

/* ============ Reusable ============ */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 800; }
.page-head p { color: var(--ink-mute); font-size: 13px; margin-top: 3px; }

.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #042421; border: 0; padding: 11px 18px; border-radius: 10px;
  font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 16px var(--accent-glow); transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 8px 13px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); box-shadow: none; }
.btn-outline:hover { border-color: var(--accent); color: var(--ink); filter: none; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; box-shadow: 0 6px 16px rgba(239,68,68,.3); }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px;
  position: relative; overflow: hidden;
}
.stat::after { content: ''; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent-glow); opacity: .25; filter: blur(8px); }
.stat .s-label { font-size: 12px; color: var(--ink-mute); font-weight: 500; }
.stat .s-value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.stat .s-foot { font-size: 12px; margin-top: 6px; color: var(--ink-soft); }
.stat.green .s-value { color: var(--green); } .stat.green::after { background: var(--green-soft); }
.stat.yellow .s-value { color: var(--yellow); } .stat.yellow::after { background: var(--yellow-soft); }
.stat.red .s-value { color: var(--red); } .stat.red::after { background: var(--red-soft); }
.stat.blue .s-value { color: var(--blue); } .stat.blue::after { background: var(--blue-soft); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.green { background: var(--green-soft); color: #7ef0a6; } .badge.green .dot { background: var(--green); }
.badge.yellow { background: var(--yellow-soft); color: #ffd98a; } .badge.yellow .dot { background: var(--yellow); }
.badge.red { background: var(--red-soft); color: #ffa3a3; } .badge.red .dot { background: var(--red); }
.badge.blue { background: var(--blue-soft); color: #9bdcff; } .badge.blue .dot { background: var(--blue); }
.badge.gray { background: rgba(107,118,156,.18); color: var(--ink-soft); } .badge.gray .dot { background: var(--ink-mute); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line-soft); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px; }
.tbl thead th {
  background: var(--navy-800); color: var(--ink-soft); text-align: left;
  padding: 13px 16px; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--navy-700); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .row-actions { display: flex; gap: 6px; }
.cell-strong { font-weight: 600; }
.cell-mute { color: var(--ink-mute); font-size: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-2), #05423d); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; margin-right: 9px; vertical-align: middle; }
.name-cell { display: flex; align-items: center; }

/* Horarios de clientes */
.hz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.hz-card { display: flex; flex-direction: column; }
.hz-top { display: flex; align-items: center; gap: 10px; }
.hz-top .avatar { margin-right: 0; width: 38px; height: 38px; flex: 0 0 auto; }
.hz-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }

/* Creador de facturas */
.fc-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.fc-row .fc-c { flex: 1; }
.fc-row .fc-m { width: 120px; }
.fc-row input { background: var(--navy-800); border: 1px solid var(--line); color: var(--ink); padding: 9px 11px; border-radius: 8px; font-size: 13px; }
.fc-total { margin-top: 14px; text-align: right; font-size: 15px; color: var(--ink-soft); }
.fc-total b { color: var(--accent); font-size: 19px; margin-left: 6px; }

/* Calendario del cliente */
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 14px; }
.cal-title { font-weight: 800; font-size: 18px; letter-spacing: .3px; min-width: 150px; text-align: center; }
.cal-arrow { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--navy-800); color: var(--ink-soft); font-size: 13px; cursor: pointer; transition: .12s; }
.cal-arrow:hover { border-color: var(--accent); color: var(--accent); }
.cal-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cal-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 5px 11px; border-radius: 999px; background: var(--navy-800); border: 1px solid var(--line-soft); color: var(--ink-soft); }
.cal-chip b { color: var(--ink); font-size: 13px; }
.cal-chip.green b { color: #7ef0a6; } .cal-chip.red b { color: #ff9b9b; } .cal-chip.yellow b { color: #ffd479; } .cal-chip.cyan b { color: var(--accent); } .cal-chip.blue { color: #9bdcff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-wd { margin-bottom: 6px; }
.cal-wdh { text-align: center; font-size: 11px; color: var(--ink-mute); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.cal-cell { position: relative; min-height: 60px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 6px 7px; background: linear-gradient(180deg, var(--panel), var(--panel-2)); text-align: left; cursor: pointer; transition: transform .1s, border-color .1s, box-shadow .1s; display: flex; flex-direction: column; gap: 2px; font-family: inherit; }
.cal-cell:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 14px rgba(0,0,0,.25); }
.cal-cell.empty { border: none; background: transparent; cursor: default; }
.cal-cell.empty:hover { transform: none; box-shadow: none; }
.cal-cell.has { background: linear-gradient(180deg, var(--panel-2), var(--navy-800)); }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.classday { box-shadow: inset 3px 0 0 var(--accent-2); }
.cal-cell.classday.today { box-shadow: inset 3px 0 0 var(--accent-2), inset 0 0 0 1px var(--accent); }
.cal-num { font-size: 13px; font-weight: 700; color: var(--ink); }
.cal-hoy { position: absolute; top: 6px; right: 7px; font-size: 8px; font-weight: 800; color: #042421; background: var(--accent); padding: 1px 5px; border-radius: 999px; letter-spacing: .5px; }
.cal-clase { font-size: 10px; color: var(--accent); font-weight: 600; }
.cal-marks { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; align-items: center; }
.cal-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cal-ic { font-size: 12px; line-height: 1; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; font-size: 12px; color: var(--ink-soft); padding-top: 14px; border-top: 1px solid var(--line-soft); }
.cal-legend span { display: inline-flex; align-items: center; }
.cal-legend i { margin-right: 5px; }
.cal-cd { color: var(--accent); }
.cal-hint { margin-top: 10px; font-size: 12px; color: var(--ink-mute); text-align: center; }
/* detalle de día */
.dd-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.dd-row { display: flex; align-items: center; gap: 11px; background: var(--navy-800); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; }
.dd-ic { font-size: 18px; }
.dd-row b { font-size: 14px; }

/* Progress */
.progress { height: 8px; background: var(--navy-700); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #16a34a); border-radius: 999px; transition: width .4s; }
.progress.warn > span { background: linear-gradient(90deg, var(--yellow), #d97706); }
.progress.crit > span { background: linear-gradient(90deg, var(--red), #b91c1c); }

/* ============ Agenda grid ============ */
.agenda-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.lg-green { background: var(--green); } .lg-yellow { background: var(--yellow); } .lg-red { background: var(--red); } .lg-blue { background: var(--blue); }

.agenda-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.agenda { display: grid; grid-template-columns: 70px repeat(7, minmax(128px, 1fr)); min-width: 1040px; }
.agenda .ag-head { background: var(--navy-800); padding: 12px 8px; text-align: center; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.agenda .ag-time { background: var(--navy-800); padding: 10px 8px; text-align: center; font-size: 12px; color: var(--ink-soft); font-weight: 600; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: center; }
.slot { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 7px; min-height: 64px; cursor: pointer; transition: background .12s; position: relative; }
.slot:hover { background: var(--navy-700); }
.slot .slot-state { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; }
.slot.s-green .slot-state { background: var(--green); } .slot.s-green { box-shadow: inset 3px 0 0 var(--green); }
.slot.s-yellow .slot-state { background: var(--yellow); } .slot.s-yellow { box-shadow: inset 3px 0 0 var(--yellow); }
.slot.s-red .slot-state { background: var(--red); } .slot.s-red { box-shadow: inset 3px 0 0 var(--red); }
.slot.s-blue .slot-state { background: var(--blue); } .slot.s-blue { box-shadow: inset 3px 0 0 var(--blue); }
.slot-client { font-size: 11.5px; background: var(--navy-600); border-radius: 6px; padding: 3px 7px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.slot-client .pdot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.slot-free { font-size: 11px; color: var(--ink-mute); padding: 2px 4px; }

/* ============ Modal ============ */
.modal-overlay { position: fixed; inset: 0; background: rgba(5,8,18,.7); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal-overlay[hidden] { display: none; }
.modal { background: linear-gradient(180deg, var(--panel), var(--navy-800)); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; overflow-x: hidden; box-shadow: var(--shadow); animation: pop .18s ease; }
.modal.wide { max-width: 720px; }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-head .sub { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }
.modal-close { background: transparent; border: 0; color: var(--ink-soft); font-size: 22px; line-height: 1; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: var(--panel); }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--navy-800); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 12px; border-radius: 9px; font-size: 13px; outline: none; transition: border .15s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.field textarea { resize: vertical; min-height: 70px; }

/* Client detail */
.detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.detail-avatar { width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(135deg, var(--accent-2), #05423d); display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.detail-meta h3 { font-size: 18px; }
.detail-meta .muted { color: var(--ink-mute); font-size: 13px; margin-top: 3px; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 16px 0; }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv .k { font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .4px; }
.kv .v { font-size: 14px; font-weight: 600; }
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-mute); margin: 18px 0 10px; font-weight: 600; }

/* Tabs in modal */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line-soft); margin-bottom: 16px; }
.tab { background: transparent; border: 0; color: var(--ink-soft); padding: 9px 14px; font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* Filters bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filters select, .filters input { background: var(--navy-800); border: 1px solid var(--line); color: var(--ink); padding: 9px 12px; border-radius: 9px; font-size: 13px; outline: none; }
.filters select:focus, .filters input:focus { border-color: var(--accent); }

/* Two-col layout */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Mini chart bars */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 44px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 7px 7px 0 0; min-height: 4px; transition: height .4s; position: relative; }
.bar:hover::after { content: attr(data-val); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); background: var(--navy-900); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; font-size: 11px; white-space: nowrap; }
.bar-label { font-size: 11px; color: var(--ink-mute); }

/* Ranking list */
.rank { display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: flex; align-items: center; gap: 12px; }
.rank-row .r-name { font-size: 13px; width: 130px; flex: none; color: var(--ink-soft); }
.rank-row .r-bar { flex: 1; height: 10px; background: var(--navy-700); border-radius: 999px; overflow: hidden; }
.rank-row .r-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }
.rank-row .r-val { font-size: 12px; font-weight: 600; width: 36px; text-align: right; }

/* Empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--ink-mute); }
.empty .e-ico { font-size: 40px; opacity: .5; margin-bottom: 10px; }

/* Toast */
.toast-host { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 13px 18px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); animation: slideIn .2s ease; min-width: 220px; }
.toast.ok { border-left-color: var(--green); }
.toast.warn { border-left-color: var(--yellow); }
.toast.err { border-left-color: var(--red); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }

/* Chips list (clients in slot) */
.chip-list { display: flex; flex-direction: column; gap: 8px; }
.chip { display: flex; align-items: center; gap: 10px; background: var(--navy-700); padding: 10px 12px; border-radius: 10px; }
.chip .c-info { flex: 1; min-width: 0; }
.chip .c-name { font-size: 13px; font-weight: 600; }
.chip .c-sub { font-size: 11px; color: var(--ink-mute); }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; }
.icon-btn:hover { border-color: var(--red); color: var(--red); }
.icon-btn.ok:hover { border-color: var(--green); color: var(--green); }

.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--navy-700); border-left: 3px solid var(--line); }
.alert-item.warn { border-left-color: var(--yellow); }
.alert-item.crit { border-left-color: var(--red); }
.alert-item .a-ico { font-size: 18px; }
.alert-item .a-txt { flex: 1; }
.alert-item .a-txt b { font-size: 13px; }
.alert-item .a-txt span { display: block; font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .25s; width: 260px; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .hamburger { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: 1fr; }
  .topbar-search input { width: 160px; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
  .stat .s-value { font-size: 24px; }
  .topbar-search { display: none; }
  .legend { width: 100%; }

  /* Modal a pantalla casi completa, sin cortes */
  .modal-overlay { padding: 8px; place-items: start center; }
  .modal, .modal.wide { max-width: 100%; max-height: 94vh; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-head { padding-top: 14px; padding-bottom: 14px; }
  .modal-body { padding-top: 16px; padding-bottom: 16px; }
  .modal-foot { padding: 12px 16px; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  .tab { padding: 8px 11px; font-size: 12px; }
  .detail-avatar { width: 48px; height: 48px; font-size: 19px; }

  /* Tablas -> tarjetas apiladas (con .tbl-cards en el contenedor) */
  .tbl-cards { overflow-x: visible; border: 0; }
  .tbl-cards table.tbl { min-width: 0; font-size: 13px; }
  .tbl-cards .tbl thead { display: none; }
  .tbl-cards .tbl, .tbl-cards .tbl tbody, .tbl-cards .tbl tr, .tbl-cards .tbl td { display: block; width: 100%; }
  .tbl-cards .tbl tr { border: 1px solid var(--line-soft); border-radius: 12px; margin-bottom: 10px; background: var(--panel-2); overflow: hidden; }
  .tbl-cards .tbl tr:hover { background: var(--panel-2); }
  .tbl-cards .tbl td { border: 0; border-bottom: 1px solid var(--line-soft); padding: 9px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: right; min-width: 0 !important; }
  .tbl-cards .tbl td:last-child { border-bottom: 0; }
  .tbl-cards .tbl td::before { content: attr(data-label); color: var(--ink-mute); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; text-align: left; flex: none; }
  .tbl-cards .tbl td.td-main { display: block; text-align: left; background: var(--navy-700); padding: 11px 14px; }
  .tbl-cards .tbl td.td-main::before { display: none; }
  .tbl-cards .tbl td .progress { flex: 1; max-width: 150px; }
  .tbl-cards .tbl td .row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .tbl-cards .tbl td .row-actions .btn { flex: 1 1 auto; }
}

/* Backdrop for mobile sidebar */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; display: none; }
.backdrop.show { display: block; }

/* Tarjetas de planes (Lista de Precio) */
.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.plan-card {
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  color: #04211e; box-shadow: 0 12px 30px rgba(0,0,0,.45); border: 1px solid rgba(0,0,0,.25);
}
.plan-head {
  background: #10201f; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: .8px;
  text-transform: uppercase; text-align: center; padding: 11px 12px; margin: 14px 14px 0; border-radius: 10px;
}
.plan-feats { padding: 16px 18px 4px; text-align: center; display: flex; flex-direction: column; gap: 7px; font-size: 15px; font-weight: 600; color: #06302b; }
.plan-feats .pf-strong { font-size: 17px; font-weight: 800; letter-spacing: .4px; }
.plan-price { text-align: center; font-size: 28px; font-weight: 900; color: #062b27; padding: 4px 0 6px; }
.plan-price span { font-size: 15px; font-weight: 700; }
.plan-admin { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 14px 14px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,.2); }
.plan-cnt { font-size: 12px; font-weight: 700; color: #04211e; background: rgba(0,0,0,.18); padding: 4px 10px; border-radius: 999px; }
.plan-admin .row-actions { display: flex; gap: 8px; }
.plan-admin .mini { background: rgba(0,0,0,.3); color: #fff; border: 0; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s; }
.plan-admin .mini:hover { background: rgba(0,0,0,.5); }
.plan-admin .mini.danger { background: rgba(140,18,18,.6); }
.plan-admin .mini.danger:hover { background: rgba(170,22,22,.85); }
@media (max-width: 720px) { .plan-grid { grid-template-columns: 1fr; } }

/* Horario personalizado en celda de agenda */
.slot-time { font-size: 11px; font-weight: 800; color: var(--accent); margin-bottom: 3px; letter-spacing: .2px; }

/* Pasar lista (asistencia de hoy) */
.roll-list { display: flex; flex-direction: column; gap: 8px; }
.roll-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--navy-700); border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 12px; }
.roll-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.roll-info .avatar.sm { width: 30px; height: 30px; font-size: 11px; margin-right: 0; flex: none; }
.roll-name { font-size: 13px; font-weight: 600; }
.roll-hora { font-size: 11px; color: var(--ink-mute); }
.roll-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.roll-actions .rb { width: 38px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--navy-800); font-size: 16px; cursor: pointer; transition: all .12s; }
.roll-actions .rb.ok:hover { border-color: var(--green); background: rgba(34,197,94,.15); }
.roll-actions .rb.late:hover { border-color: var(--yellow); background: rgba(234,179,8,.15); }
.roll-actions .rb.no:hover { border-color: var(--red); background: rgba(239,68,68,.15); }

/* Buscador de cliente (agenda) */
.search-results { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; margin-top: 8px; }
.search-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--navy-700); border: 1px solid var(--line-soft); color: var(--ink); padding: 9px 12px; border-radius: 10px; cursor: pointer; transition: border .12s; }
.search-item:hover { border-color: var(--accent); }
.search-item .avatar.sm { width: 28px; height: 28px; font-size: 11px; flex: none; margin-right: 0; }
.search-item .si-name { flex: 1; font-size: 13px; font-weight: 600; }
.search-item .si-sub { font-size: 11px; color: var(--ink-mute); }

/* Login gate */
#authGate { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(800px 400px at 50% -10%, rgba(0,229,210,.16), transparent 60%), var(--navy-900); }
.auth-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(180deg, var(--panel), var(--navy-800)); border: 1px solid var(--line); border-radius: 18px; padding: 30px 24px; box-shadow: var(--shadow); text-align: center; }
.auth-logo img { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; background: #000; box-shadow: 0 0 0 2px var(--accent), 0 0 26px var(--accent-glow); }
.auth-card h2 { font-size: 21px; font-weight: 800; margin-top: 6px; }
.auth-sub { color: var(--ink-mute); font-size: 13px; margin-bottom: 6px; }
.auth-card input { background: var(--navy-800); border: 1px solid var(--line); color: var(--ink); padding: 12px 14px; border-radius: 10px; font-size: 14px; outline: none; }
.auth-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.auth-card .btn { margin-top: 4px; padding: 12px; font-size: 15px; }
.auth-remember { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; text-align: left; }
.auth-remember input { width: auto; accent-color: var(--accent); }
.auth-err { color: var(--red); font-size: 13px; min-height: 16px; }

/* Print */
@media print {
  .sidebar, .topbar, .btn, .filters, .page-head .btn { display: none !important; }
  #app { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
  .card, .stat { border: 1px solid #ccc; box-shadow: none; background: #fff; color: #000; }
}

/* ============ Mejoras estéticas: animaciones + color ============ */
@keyframes sfRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sfGrowY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sfGlow {
  0%, 100% { box-shadow: 0 0 0 2px var(--ring), 0 0 16px var(--accent-glow); }
  50%      { box-shadow: 0 0 0 2px var(--accent), 0 0 30px var(--accent-glow); }
}
@keyframes sfSheen { 0% { transform: translateX(-140%) skewX(-18deg); } 60%, 100% { transform: translateX(340%) skewX(-18deg); } }
@keyframes sfFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }

/* Entrada escalonada — se re-dispara en cada cambio de vista */
.content .page-head { animation: sfRise .5s ease both; }
.content .stat-grid > .stat,
.content .grid-2 > *,
.content .grid-3 > *,
.content > .card,
.content .table-wrap,
.content .agenda-wrap,
.content .hz-grid > .hz-card,
.content .plan-grid > .plan-card { animation: sfRise .5s cubic-bezier(.22,1,.36,1) both; }
.content .stat-grid > .stat:nth-child(1) { animation-delay: .02s; }
.content .stat-grid > .stat:nth-child(2) { animation-delay: .08s; }
.content .stat-grid > .stat:nth-child(3) { animation-delay: .14s; }
.content .stat-grid > .stat:nth-child(4) { animation-delay: .20s; }
.content .grid-2 > *:nth-child(2), .content .grid-3 > *:nth-child(2) { animation-delay: .08s; }
.content .grid-3 > *:nth-child(3) { animation-delay: .16s; }
.content .hz-grid > .hz-card:nth-child(even) { animation-delay: .08s; }
.content .plan-grid > .plan-card:nth-child(2) { animation-delay: .09s; }
.content .plan-grid > .plan-card:nth-child(3) { animation-delay: .18s; }

/* KPIs: barra de acento de color + elevación al pasar el cursor */
.stat { transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent); z-index: 1;
}
.stat.green::before  { background: linear-gradient(90deg, var(--green), transparent); }
.stat.yellow::before { background: linear-gradient(90deg, var(--yellow), transparent); }
.stat.red::before    { background: linear-gradient(90deg, var(--red), transparent); }
.stat.blue::before   { background: linear-gradient(90deg, var(--blue), transparent); }
.stat:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.4); border-color: var(--accent); }
.card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0,0,0,.45); border-color: var(--line); }

/* Barras del mini-gráfico: crecen desde abajo */
.bars .bar { transform-origin: bottom; animation: sfGrowY .6s cubic-bezier(.34,1.56,.64,1) both; }
.bars .bar:nth-child(1) { animation-delay: .05s; }
.bars .bar-col:nth-child(2) .bar { animation-delay: .10s; }
.bars .bar-col:nth-child(3) .bar { animation-delay: .16s; }
.bars .bar-col:nth-child(4) .bar { animation-delay: .22s; }
.bars .bar-col:nth-child(5) .bar { animation-delay: .28s; }
.bars .bar-col:nth-child(6) .bar { animation-delay: .34s; }
.bars .bar-col:nth-child(7) .bar { animation-delay: .40s; }

/* Barras de ranking: crecen a lo ancho */
.rank-row .r-bar > span { transform-origin: left; animation: sfGrowY .7s cubic-bezier(.22,1,.36,1) both; animation-name: sfGrowX; }
@keyframes sfGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Logo con resplandor pulsante */
.brand-logo { animation: sfGlow 3.2s ease-in-out infinite; }

/* Menú: deslizamiento al pasar el cursor */
.nav-item:hover { transform: translateX(3px); }

/* Foto del coach en la barra superior */
.coach-av {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none;
  background: #000; box-shadow: 0 0 0 2px var(--accent), 0 0 18px var(--accent-glow);
  animation: sfGlow 3.2s ease-in-out infinite;
}
.topbar-actions { display: flex; align-items: center; gap: 14px; }

/* Conteo animado: evita saltos de layout */
.s-value { font-variant-numeric: tabular-nums; }

/* ---- Hero de bienvenida / hero de sección (misma familia, con foto propia) ---- */
.hero-panel {
  position: relative; overflow: hidden; border-radius: 20px; margin-bottom: 18px;
  min-height: 190px; display: flex; align-items: center;
  border: 1px solid var(--line);
  background-color: #0c211f;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  animation: sfRise .5s ease both;
  transition: transform .25s ease, box-shadow .25s ease;
}
.hero-panel:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(0,0,0,.4); }
/* Variante compacta para el resto de las secciones */
.hero-panel.hero-sm { min-height: 130px; margin-bottom: 22px; }
.hero-panel.hero-sm .hero-inner { padding: 18px 26px; gap: 7px; max-width: 560px; }
.hero-panel.hero-sm .hero-h { font-size: 20px; }
.hero-panel.hero-sm .hero-sub { font-size: 13px; max-width: 460px; }
.hero-panel.hero-sm .hero-actions { margin-top: 2px; }
.hero-glow {
  position: absolute; right: -50px; top: -50px; width: 220px; height: 220px; border-radius: 50%;
  background: var(--accent-glow); filter: blur(34px); animation: sfFloat 5s ease-in-out infinite;
}
.hero-sheen {
  position: absolute; top: 0; bottom: 0; left: 0; width: 70px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  animation: sfSheen 5s ease-in-out 1s infinite;
}
.hero-inner { position: relative; padding: 26px 30px; display: flex; flex-direction: column; gap: 12px; max-width: 620px; }
.hero-date { font-size: 12px; font-weight: 600; letter-spacing: .5px; color: var(--accent); text-transform: uppercase; }
.hero-h { margin: 0; font-size: 28px; line-height: 1.1; }
.hero-sub { margin: 0; color: var(--ink-soft); font-size: 14px; max-width: 460px; }
.hero-sub b { color: #fff; }
.hero-sub b.hero-warn { color: var(--yellow); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.btn.ghost { background: rgba(255,255,255,.06); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(255,255,255,.12); }

/* ---- Gráfica de barras semanal (aislada, no toca .bars de Reportes) ---- */
.muted-sm { font-size: 12px; font-weight: 500; color: var(--ink-mute); margin-left: 8px; }
.week-bars { display: flex; align-items: flex-end; gap: 12px; height: 168px; padding-top: 10px; }
.wb-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.wb-track { flex: 1; width: 100%; max-width: 42px; display: flex; align-items: flex-end; }
.wb-fill {
  width: 100%; min-height: 4px; border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transform-origin: bottom; animation: sfGrowY .6s cubic-bezier(.34,1.56,.64,1) both;
}
.wb-col.is-today .wb-fill { box-shadow: 0 0 18px var(--accent-glow); }
.wb-col:nth-child(1) .wb-fill { animation-delay: .05s; } .wb-col:nth-child(2) .wb-fill { animation-delay: .10s; }
.wb-col:nth-child(3) .wb-fill { animation-delay: .16s; } .wb-col:nth-child(4) .wb-fill { animation-delay: .22s; }
.wb-col:nth-child(5) .wb-fill { animation-delay: .28s; } .wb-col:nth-child(6) .wb-fill { animation-delay: .34s; }
.wb-col:nth-child(7) .wb-fill { animation-delay: .40s; }
.wb-lbl { font-size: 11px; color: var(--ink-mute); }
.wb-col.is-today .wb-lbl { color: var(--accent); font-weight: 700; }
.wb-num { font-size: 11px; font-weight: 700; color: var(--ink-soft); }

/* ---- Anillo de sesiones completadas ---- */
.ring-card { display: flex; flex-direction: column; }
.ring-wrap { flex: 1; display: grid; place-items: center; padding: 12px 0; }
.ring {
  --pct: 0; position: relative; width: 148px; height: 148px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), #16201f 0);
  display: grid; place-items: center;
}
.ring-hole {
  width: 110px; height: 110px; border-radius: 50%; background: var(--panel);
  display: grid; place-items: center; text-align: center; box-shadow: inset 0 0 0 1px var(--line-soft);
}
.ring-val { font-family: 'Space Grotesk', var(--font, sans-serif); font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1; }
.ring-cap { font-size: 11px; color: var(--ink-mute); margin-top: 3px; }
.ring-foot { text-align: center; font-size: 12px; color: var(--ink-soft); border-top: 1px solid var(--line-soft); padding-top: 12px; }
.ring-foot b { color: var(--ink); }


/* ============ Agenda: interruptor Semana / Por dia ============ */
.ag-toggle { display: inline-flex; gap: 4px; margin-bottom: 14px; background: var(--navy-800); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.ag-tg { background: transparent; border: 0; color: var(--ink-soft); font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 7px; transition: all .15s; }
.ag-tg.active { background: var(--accent-2); color: #fff; }
.dia-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.dia-tab { background: var(--navy-800); border: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; font-weight: 600; padding: 8px 15px; border-radius: 8px; transition: all .15s; }
.dia-tab:hover { border-color: var(--accent); color: var(--ink); }
.dia-tab.active { background: var(--accent-2); border-color: var(--accent); color: #fff; }
.dia-cnt { color: var(--ink-soft); font-size: 14px; margin-bottom: 14px; }
.dia-list { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.dia-block { background: var(--navy-800); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: border-color .15s, transform .15s; }
.dia-block:hover { border-color: var(--accent); transform: translateY(-1px); }
.dia-hora { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.dia-cupo { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-mute); background: var(--navy-700); padding: 3px 10px; border-radius: 999px; }
.dia-clientes { display: flex; flex-direction: column; gap: 9px; }
.dia-cli { display: flex; align-items: center; }
.dia-cli-info { min-width: 0; }
.dia-cli-info .cell-mute { display: flex; align-items: center; gap: 6px; margin-top: 2px; }

/* ============ Reportes mensuales ============ */
.rep-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.rep-controls input[type="month"], .rep-controls select {
  background: var(--navy-800); border: 1px solid var(--line); color: var(--ink);
  padding: 8px 10px; border-radius: 8px; font-size: 13px;
}
.rep-controls input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(1); }
.print-title { display: none; }

/* ---------- Historial completo de composición corporal ----------
   Todas las métricas (filas) por cada medición (columnas). La columna de
   nombres y la fila de fechas quedan fijas al desplazar. */
.co-hist-wrap {
  overflow: auto; max-height: 60vh;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--navy-800);
}
.co-hist { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.co-hist th, .co-hist td { padding: 8px 12px; text-align: right; }
.co-hist th:first-child, .co-hist .co-met {
  text-align: left; position: sticky; left: 0; z-index: 1;
  background: var(--navy-800); color: var(--ink-soft); font-weight: 600;
}
.co-hist thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel); color: var(--accent);
  font-size: 11px; font-weight: 800; letter-spacing: .03em;
  border-bottom: 1px solid var(--line);
}
.co-hist thead th.co-met { z-index: 3; }
.co-hist tbody td { color: var(--ink); font-variant-numeric: tabular-nums; }
.co-hist tbody tr:nth-child(odd) td { background: rgba(255,255,255,.02); }
.co-hist .co-na { color: var(--ink-mute); }
.co-hist .co-tg td {
  text-align: left; background: rgba(0,229,210,.08) !important;
  color: var(--accent); font-size: 10.5px; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase; padding: 7px 12px;
}
.co-fl { font-style: normal; font-size: 10px; margin-left: 5px; }
.co-fl.ok { color: var(--green); }
.co-fl.no { color: var(--yellow); }

/* ---------- Visor de la ficha del ejercicio ----------
   Las láminas son muy altas (≈ 941×1672). Se ajustan al ALTO de la ventana,
   no al ancho: así se ve la lámina entera sin hacer scroll. Para la letra
   pequeña está el clic, que la abre a tamaño real. */
.rt-ficha-modal {
  max-width: min(92vw, 620px);
  display: flex; flex-direction: column; max-height: 94vh;
  overflow: hidden;          /* la base .modal trae overflow-y:auto -> doble scroll */
}
.rt-ficha-body {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 10px !important;
}
.rt-ficha-img {
  max-height: 74vh; max-width: 100%; width: auto; height: auto;
  display: block; border-radius: 10px; background: #fff; cursor: zoom-in;
}
/* Tamaño real, con scroll para recorrerla.
   .modal-overlay es grid con place-items:center; si la imagen es más alta que
   la ventana, centrarla deja la parte de arriba fuera de alcance. Por eso se
   alinea arriba. */
.rt-ficha-zoom {
  z-index: 99999; overflow: auto; padding: 16px;
  place-items: start center;
}
.rt-ficha-zoom img {
  width: auto; max-width: none; height: auto;
  border-radius: 10px; background: #fff; cursor: zoom-out;
}
@media (max-width: 700px) {
  .rt-ficha-modal { max-width: 96vw; }
  .rt-ficha-img { max-height: 68vh; }
  .rt-ficha-zoom img { max-width: 100%; }   /* en móvil, ancho completo y scroll vertical */
}

/* ---------- Fotos de progreso (3 ángulos × antes/después) ---------- */
.fp-ang { margin-bottom: 14px; }
.fp-ang-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.fp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fp-slot {
  background: var(--navy-800); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px;
}
.fp-slot-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; font-size: 13px; }
.fp-prev {
  position: relative; width: 100%; aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--navy-900);
  border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; margin-bottom: 9px;
}
.fp-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-empty, .fp-load, .fp-fail {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; color: var(--ink-mute); font-size: 26px; padding: 12px;
}
.fp-empty span, .fp-fail span { font-size: 11px; line-height: 1.4; }
.fp-load, .fp-fail { font-size: 12px; }
.fp-lbl { display: block; font-size: 11px; color: var(--ink-mute); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.fp-tag { font-size: 11px; color: var(--accent); }

/* Print (extendido para reportes) */
@media print {
  .tabs, .rep-controls, .row-actions, .toast-host, .ag-toggle { display: none !important; }
  .print-title { display: block; font-size: 18px; font-weight: 800; margin: 0 0 14px; color: #000; }
  .card-title, .section-label, .cell-mute, .cell-strong, .kv .k, .kv .v,
  .rank-row .r-name, .rank-row .r-val, .stat .s-label, .stat .s-value, .stat .s-foot,
  .page-head h2, .page-head p { color: #000 !important; }
  .stat::after { display: none; }
  .tbl thead th { background: #f0f0f0; color: #000; position: static; }
  .tbl tbody td { color: #000; border-color: #ddd; }
  .tbl tbody tr:hover { background: transparent; }
  .badge { background: #fff !important; color: #000 !important; border: 1px solid #999; }
  .progress, .rank-row .r-bar { background: #eee; }
  .card, .table-wrap { break-inside: avoid; }
}

/* ============ Ficha de evaluación inicial ============ */
.ficha-sec { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; background: var(--navy-900); }
.ficha-sec[open] { border-color: var(--accent); }
.ficha-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 13px;
  background: transparent; border: 0; cursor: pointer; font-family: inherit; text-align: left; color: var(--ink);
}
.ficha-head:hover { background: var(--navy-800); }
.ficha-n {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; background: var(--navy-800);
  border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink-mute);
}
.ficha-sec[open] .ficha-n { background: var(--accent); border-color: var(--accent); color: #04211e; }
.ficha-ic { font-size: 15px; flex: 0 0 auto; }
.ficha-t { flex: 1; font-size: 13.5px; font-weight: 700; min-width: 0; }
.ficha-chev { flex: 0 0 auto; color: var(--ink-mute); font-size: 18px; transition: transform .18s ease; }
.ficha-sec[open] .ficha-chev { transform: rotate(90deg); }
.ficha-body { display: none; padding: 4px 13px 14px; border-top: 1px solid var(--line-soft); }
.ficha-sec[open] .ficha-body { display: block; }
.ficha-body .field label { display: block; }
