/* GymOrbita — the gym's management panel (desktop first). Uses the app's tokens and components (styles.css):
   a fixed side menu, a wide work area, tables, a weekly calendar and side drawers. */

body.pn { --side-w: 248px; min-height: 100vh; background:
  radial-gradient(60% 40% at 100% 0%, rgb(168 85 247 / 0.10), transparent 70%),
  radial-gradient(50% 40% at 0% 100%, rgb(59 130 246 / 0.08), transparent 70%), var(--bg); background-attachment: fixed; }
.pn #toast { bottom: 24px; left: calc(50% + var(--side-w) / 2); }

/* ---------- side menu ---------- */
.pn-side {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--side-w);
  display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 14px; overflow-y: auto;
  background: rgb(13 18 36 / 0.92); border-right: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.pn-brand { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; text-decoration: none; color: inherit; }
.pn-brand .wordmark { font-size: 24px; }
.pn-brand .tag { align-self: flex-start; margin-top: 6px; letter-spacing: 0.08em; font-size: 10px; text-transform: uppercase; }
.pn-gym { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.pn-gym .tile-icon { width: 36px; height: 36px; }
.pn-gym .name { font-weight: var(--fw-bold); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-gym select { min-height: 32px; padding: 0 8px; margin-top: 4px; font-size: var(--fs-sm); }
.pn-nav { display: flex; flex-direction: column; gap: 2px; }
.pn-nav .label { padding: 12px 10px 6px; color: var(--text-3); font-size: 11px; font-weight: var(--fw-bold); letter-spacing: 0.08em; text-transform: uppercase; }
.pn-nav a {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: var(--fw-bold);
}
.pn-nav a:hover { background: var(--surface); color: var(--text); }
.pn-nav a.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.pn-nav a.on .icon { color: var(--accent); }
.pn-nav a .grow { flex: 1; }
.pn-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; background: var(--danger); color: #fff; font-size: 11px; }
.pn-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.pn-me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.pn-me .grow { min-width: 0; display: flex; flex-direction: column; }
.pn-me .grow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- work area ---------- */
.pn-body { margin-left: var(--side-w); min-height: 100vh; }
.pn-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 32px;
  background: rgb(11 15 26 / 0.8); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.pn-title { flex: 1; margin: 0; font-size: var(--fs-xl); line-height: 1.2; }
.pn-actions { display: flex; gap: 8px; align-items: center; }
.pn-menu { display: none; }
.pn-view { padding: 28px 32px 64px; max-width: 1360px; }
.pn-view > * + * { margin-top: 28px; }
.pn-loading { opacity: 0.55; pointer-events: none; transition: opacity 0.2s; }

.pn h2 { margin: 0 0 12px; font-size: var(--fs-lg); }
.pn h3 { margin: 0 0 8px; font-size: var(--fs-md); }
.pn .hint { margin: -4px 0 12px; color: var(--text-3); font-size: var(--fs-sm); }
.pn-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; align-items: start; }
.pn-grid > .c4 { grid-column: span 4; } .pn-grid > .c5 { grid-column: span 5; } .pn-grid > .c6 { grid-column: span 6; }
.pn-grid > .c7 { grid-column: span 7; } .pn-grid > .c8 { grid-column: span 8; } .pn-grid > .c12 { grid-column: span 12; }
.pn-box { padding: 20px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.pn-box > h2:first-child { display: flex; align-items: center; gap: 8px; }
.pn-box > h2 .more { margin-left: auto; font-size: var(--fs-sm); color: var(--accent); text-decoration: none; }

/* KPIs */
.pn-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.pn-kpi { padding: 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.pn-kpi .v { font-size: 30px; font-weight: var(--fw-bold); line-height: 1.1; font-variant-numeric: tabular-nums; }
.pn-kpi .v.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pn-kpi .k { margin-top: 4px; color: var(--text-2); font-size: var(--fs-sm); }
.pn-kpi .d { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-3); }

/* quick actions */
.pn-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pn-quick button { justify-content: flex-start; min-height: 64px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.pn-quick button:hover { border-color: var(--accent-line); }
.pn-quick .tile-icon { width: 36px; height: 36px; }

/* rows inside boxes */
.pn-rows { display: flex; flex-direction: column; }
.pn-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pn-row:first-child { border-top: 0; padding-top: 0; }
.pn-row .grow { flex: 1; min-width: 0; }
.pn-row .title { font-weight: var(--fw-bold); }
.pn-row .meta { color: var(--text-3); font-size: var(--fs-sm); }
.pn-row button { min-height: 36px; padding: 0 12px; }
.pn-row.link { cursor: pointer; border-radius: 10px; }
.pn-row.link:hover .title { color: var(--accent); }
.pn-empty { padding: 20px 0 8px; text-align: center; color: var(--text-3); }
.pn-empty .icon { width: 28px; height: 28px; display: block; margin: 0 auto 8px; }
.pn-empty b { display: block; color: var(--text); margin-bottom: 4px; }
.time-chip { flex: none; width: 56px; padding: 6px 0; border-radius: 10px; text-align: center; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.time-chip b { display: block; } .time-chip small { color: var(--text-3); }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter > div { height: 100%; background: var(--grad); border-radius: 3px; }
.meter > div.full { background: var(--danger); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgb(52 211 153 / 0.18); }

/* toolbar */
.pn-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pn-tools .search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.pn-tools .search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.pn-tools .search input { padding-left: 42px; min-height: 42px; }
.pn-tools select { width: auto; min-height: 42px; }
.pn-tools .segmented { min-width: 360px; }
.pn button.sm, .pn .button.sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); }
.pn .icon-btn { min-height: 36px; width: 36px; padding: 0; }

/* ---------- table ---------- */
.pn-table-wrap { border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); overflow: auto; }
.pn-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.pn-table th { position: sticky; top: 0; padding: 12px 14px; text-align: left; font-size: var(--fs-sm); color: var(--text-3); font-weight: var(--fw-bold); background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap; }
.pn-table th.sortable { cursor: pointer; user-select: none; }
.pn-table th.sortable:hover { color: var(--text); }
.pn-table td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.pn-table tr:hover td { background: rgb(255 255 255 / 0.02); }
.pn-table .who { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.pn-table .who .grow { display: flex; flex-direction: column; min-width: 0; }
.pn-table select { min-height: 34px; padding: 0 10px; width: auto; font-size: var(--fs-sm); }
.pn-table .num { text-align: right; }
.pn-table .acts { width: 1%; text-align: right; white-space: nowrap; }
.pn-table .acts > * { display: inline-flex; vertical-align: middle; }
.pn-table input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--violet); }
.pn-table input.cell { min-height: 36px; padding: 0 10px; width: 84px; text-align: right; }
.pn-table input.cell.wide { width: 100%; min-width: 320px; text-align: left; }
.pn-bulk { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.pn-bulk .grow { flex: 1; font-weight: var(--fw-bold); }
.pill-warn { color: var(--gold); }

/* ---------- weekly calendar ---------- */
.cal { --hour: 56px; display: grid; grid-template-columns: 56px repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.cal-head { position: sticky; top: 72px; z-index: 3; display: contents; }
.cal-day-h { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); }
.cal-day-h .d { font-size: var(--fs-sm); color: var(--text-3); text-transform: capitalize; }
.cal-day-h .n { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.cal-day-h.today .n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; }
.cal-corner { border-bottom: 1px solid var(--line); background: var(--surface); }
.cal-hours { position: relative; }
.cal-hours div { height: var(--hour); padding: 2px 8px 0 0; text-align: right; font-size: 11px; color: var(--text-3); transform: translateY(-8px); }
.cal-col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px) var(--hour)); cursor: copy; }
.cal-col.today { background-color: rgb(124 140 255 / 0.04); }
.cal-col.past { background-color: rgb(0 0 0 / 0.12); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.cal-ev {
  position: absolute; left: 4px; right: 4px; z-index: 1; overflow: hidden; padding: 6px 8px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, rgb(59 130 246 / 0.32), rgb(168 85 247 / 0.32)); border: 1px solid var(--accent-line);
  font-size: var(--fs-sm); line-height: 1.25; text-align: left; color: var(--text); display: block; min-height: 0; font-weight: var(--fw);
}
.cal-ev:hover { border-color: #c4b5fd; box-shadow: var(--glow); }
.cal-ev.full { background: linear-gradient(135deg, rgb(255 90 122 / 0.28), rgb(168 85 247 / 0.22)); border-color: rgb(255 90 122 / 0.5); }
.cal-ev.past { opacity: 0.5; }
.cal-ev b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev .t { color: var(--text-2); }
.cal-ev .occ { margin-top: 4px; }
.cal-ev .icon { width: 12px; height: 12px; vertical-align: -1px; }
.cal-ghost { position: absolute; left: 4px; right: 4px; border-radius: 10px; border: 1px dashed var(--accent-line); background: var(--accent-soft); pointer-events: none; display: grid; place-items: center; color: var(--accent); font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.cal-week { font-weight: var(--fw-bold); min-width: 220px; text-align: center; }

/* ---------- modal / drawer ---------- */
.pn-scrim { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: center; padding: 24px; background: rgb(3 6 16 / 0.66); backdrop-filter: blur(2px); animation: pn-fade 0.15s ease; }
.pn-scrim.drawer { justify-content: flex-end; align-items: stretch; padding: 0; }
.pn-modal { width: 100%; max-width: 560px; max-height: calc(100vh - 48px); overflow: auto; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 64px rgb(0 0 0 / 0.5); animation: pn-pop 0.18s ease; }
.pn-modal.wide { max-width: 820px; }
.drawer .pn-modal { max-width: 480px; max-height: none; height: 100%; border-radius: 0; border-width: 0 0 0 1px; animation: pn-slide 0.2s ease; }
.pn-modal-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pn-modal-head h2 { flex: 1; margin: 0; }
.pn-modal-body { padding: 20px; }
.pn-modal-body > * + * { margin-top: 16px; }
.pn-modal-foot { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; background: var(--surface); border-top: 1px solid var(--line); }
@keyframes pn-fade { from { opacity: 0; } }
@keyframes pn-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes pn-slide { from { transform: translateX(40px); opacity: 0; } }
.pn .field textarea { min-height: 110px; }
.pn-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pn-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.pn .field input, .pn .field select { min-height: 44px; }
.days-pick { display: flex; gap: 6px; }
.days-pick button { flex: 1; min-height: 40px; padding: 0; background: var(--surface-2); color: var(--text-2); }
.days-pick button.on { background: var(--grad); color: #fff; }
.pn .seg-inline { display: inline-grid; }
.check-line { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-line input { width: 18px; min-height: 18px; accent-color: var(--violet); }

/* ---------- routines, machines ---------- */
.pn-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pn-card { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; white-space: normal; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); overflow: hidden; text-align: left; padding: 0; min-height: 0; font-weight: var(--fw); color: inherit; text-decoration: none; cursor: pointer; }
.pn-card:hover { border-color: var(--accent-line); }
.pn-card .ph { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; color: var(--text-3); }
.pn-card .ph > .icon { width: 36px; height: 36px; }
.pn-card .ph .tag { position: absolute; top: 10px; right: 10px; background: rgb(11 15 26 / 0.8); }
.pn-card .bd { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.pn-card .bd .title { font-weight: var(--fw-bold); font-size: var(--fs-md); }
.pn-card .bd .meta { color: var(--text-3); font-size: var(--fs-sm); }
.pn-card.add { border-style: dashed; align-items: center; justify-content: center; min-height: 200px; color: var(--text-2); gap: 8px; }
.pn-card.add .tile-icon { width: 48px; height: 48px; }
.strip { display: flex; gap: 2px; height: 72px; background: var(--surface-2); }
.strip > * { flex: 1; background: #fff center / cover no-repeat; }
.strip > .none { background: var(--surface-2); }
.ex-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 52vh; overflow: auto; padding: 2px; }
.ex-pick button { flex-direction: column; align-items: stretch; padding: 0; min-height: 0; background: var(--surface-2); border-radius: 12px; overflow: hidden; text-align: left; font-weight: var(--fw); }
.ex-pick button .im { aspect-ratio: 4 / 3; background: #fff center / cover no-repeat; }
.ex-pick button span { padding: 8px 10px; font-size: var(--fs-sm); white-space: normal; }
.ex-pick button span small { display: block; color: var(--text-3); }
.ex-pick button.added { outline: 2px solid var(--violet); }
.thumb-sq { width: 44px; height: 44px; flex: none; border-radius: 10px; background: #fff center / cover no-repeat; }
.thumb-sq.none { background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.upload-box { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-sm); border: 1px dashed rgb(255 255 255 / 0.18); }
.upload-box .prev { width: 96px; height: 64px; flex: none; border-radius: 10px; background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; color: var(--text-3); }
.upload-box .grow { flex: 1; min-width: 0; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); transition: width 0.2s; }

/* announcements */
.ann { padding: 16px; border-radius: var(--r-md); background: var(--surface-2); }
.ann .row { align-items: flex-start; }
.ann p { margin: 6px 0 0; color: var(--text-2); white-space: pre-line; }
.ann .meta { margin-top: 8px; color: var(--text-3); font-size: var(--fs-sm); }
.preview-phone { padding: 16px; border-radius: 22px; background: #070a14; border: 1px solid var(--line); }
.preview-phone .notif { display: flex; gap: 10px; padding: 12px; border-radius: 14px; background: rgb(255 255 255 / 0.06); }
.preview-phone .notif .grow { min-width: 0; }
.preview-phone .notif .t { font-weight: var(--fw-bold); }
.preview-phone .notif .b { color: var(--text-2); font-size: var(--fs-sm); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* reports: when people train */
.hours { display: grid; grid-template-columns: 40px repeat(18, 1fr); gap: 3px; font-size: 11px; color: var(--text-3); }
.hours .c { aspect-ratio: 1; border-radius: 4px; background: var(--surface-2); }
.hours .l { display: grid; place-items: center start; }
.hours .h { text-align: center; }

/* gate screens (not logged in, no gym, not verified) */
.pn-gate { max-width: 520px; margin: 12vh auto; text-align: center; }
.pn-gate .tile-icon { width: 64px; height: 64px; margin: 0 auto 16px; }
.pn-gate .tile-icon .icon { width: 30px; height: 30px; }
.pn-gate h2 { font-size: var(--fs-xl); }
.pn-gate p { color: var(--text-2); }
.pn-gate .row { justify-content: center; margin-top: 20px; }

/* ---------- smaller screens: the menu becomes a drawer ---------- */
@media (max-width: 1100px) {
  .pn-grid > [class^="c"] { grid-column: span 12; }
  .pn-quick { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  body.pn { --side-w: 0px; }
  .pn-side { width: 270px; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow); }
  body.menu-open .pn-side { transform: none; }
  .pn-menu { display: inline-flex; }
  .pn-top { padding: 10px 16px; }
  .pn-view { padding: 20px 16px 48px; }
  .pn-title { font-size: var(--fs-lg); }
  .cal { overflow-x: auto; grid-template-columns: 44px repeat(7, minmax(110px, 1fr)); }
  .pn-two, .pn-three { grid-template-columns: 1fr; }
  .pn-tools .segmented { min-width: 0; width: 100%; }
}
.pn .pn-view > p.hint { margin: -14px 0 0; }

/* gym card (Ajustes): map, opening hours and services */
.map-box { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.map { display: block; width: 100%; height: 260px; border: 0; filter: saturate(0.9) brightness(0.92); }
.map-empty { height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-3); background: var(--surface-2); text-align: center; padding: 16px; }
.geo-results { display: flex; flex-direction: column; gap: 4px; }
.geo-result { justify-content: flex-start; min-height: 40px; padding: 8px 12px; text-align: left; white-space: normal; font-weight: var(--fw); background: var(--surface-2); }
.hours-list { display: flex; flex-direction: column; gap: 6px; }
.hours-row { display: grid; grid-template-columns: 150px 120px auto 120px 1fr; gap: 10px; align-items: center; }
.hours-row input[type="time"] { min-height: 38px; padding: 0 10px; }
.hours-row input[type="time"]:disabled { opacity: 0.35; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-tog { min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: var(--fs-sm); background: var(--surface-2); color: var(--text-2); border: 1px solid transparent; }
.chip-tog.on { background: var(--accent-soft); color: var(--text); border-color: var(--accent-line); }
@media (max-width: 860px) { .hours-row { grid-template-columns: 1fr 1fr auto 1fr; } .hours-row > .check-line { grid-column: 1 / -1; } }
