/* Sion Sport Gym: negro profundo, marfil y verde lima, a partir del prototipo aprobado. */
:root {
  --ink: #17201c; --muted: #5f6a62; --lime: #d2f45c; --line: #e4e8df; --paper: #f5f6f0; --card: #fff;
  --side: #15201b; --side-text: #c2ccc4; --ok-bg: #eaf5dc; --ok: #3b5523; --warn-bg: #fff1d5; --warn: #7d5716;
  --bad-bg: #fde6e2; --bad: #9c4335; --neutral-bg: #f0f1ed; --neutral: #5f675c;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); }
button, input, select { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid #7d9c22; outline-offset: 2px; }

button { cursor: pointer; border: 0; border-radius: 8px; padding: 11px 16px; background: var(--ink); color: #fff; font-weight: 600; min-height: 44px; }
button:hover { filter: brightness(1.15); }
button:disabled { opacity: .55; cursor: default; filter: none; }
.primary { background: var(--lime); color: var(--ink); }
.ghost { background: #eef1e8; color: #344432; font-size: 13px; padding: 8px 12px; min-height: 38px; }
.danger { background: var(--bad-bg); color: var(--bad); font-size: 13px; padding: 8px 12px; min-height: 38px; }
.link { background: none; color: inherit; padding: 0; min-height: 0; font-weight: 600; text-decoration: underline; text-align: left; }

/* Estructura */
aside { width: 230px; background: var(--side); color: var(--side-text); position: fixed; inset: 0 auto 0 0; padding: 32px 20px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { color: #fff; font-size: 24px; font-weight: 900; letter-spacing: 2px; }
.brand span { color: var(--lime); }
.sub { font-size: 10px; letter-spacing: 3px; margin: 5px 0 40px; color: #a3aea4; }
nav a { display: block; color: #bcc8bf; text-decoration: none; margin: 5px 0; padding: 12px 13px; border-radius: 8px; font-weight: 600; }
nav a:hover { background: #22302a; }
nav a.active { background: var(--lime); color: #192214; }
aside footer { margin-top: auto; font-size: 13px; line-height: 1.6; border-top: 1px solid #344038; padding-top: 18px; }
aside footer strong { display: block; color: #fff; overflow-wrap: anywhere; }
aside footer .link { color: var(--lime); margin-top: 8px; display: block; }
main { margin-left: 230px; padding: 28px 42px 48px; max-width: 1500px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.top small { letter-spacing: 2px; font-size: 11px; color: var(--muted); }
h1 { font-size: 32px; letter-spacing: -1px; margin: 28px 0 4px; line-height: 1.15; overflow-wrap: anywhere; }
h2 { font-size: 17px; margin: 0 0 14px; }
p { color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 22px; }
.stat, .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.stat { color: inherit; text-decoration: none; display: block; }
a.stat:hover { border-color: #b7c49a; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 30px; margin: 8px 0 2px; overflow-wrap: anywhere; }
.stat small { font-size: 12px; color: var(--muted); }
.grid { display: grid; grid-template-columns: 1.8fr 1fr; gap: 22px; align-items: start; }
.stack > * + * { margin-top: 22px; }

.banner { background: #1e3025; color: #fff; border-radius: 12px; padding: 22px 24px; }
.banner h2 { margin: 0 0 6px; font-size: 19px; }
.banner p { color: #c6d3c9; margin: 0 0 12px; }
.notice { border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; font-size: 14px; line-height: 1.5; background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice a { font-weight: 700; }

.pill { display: inline-block; border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 600; background: var(--ok-bg); color: var(--ok); white-space: nowrap; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.neutral { background: var(--neutral-bg); color: var(--neutral); }

/* Tablas: en celular cada fila se vuelve una tarjeta */
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: 11px; letter-spacing: 1px; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: 1px solid var(--line); text-transform: uppercase; }
td { padding: 13px 10px; border-bottom: 1px solid #eef0e9; font-size: 14px; vertical-align: top; overflow-wrap: anywhere; }
td small, .hint { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
tr:last-child td { border-bottom: 0; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.toolbar input[type=search], .toolbar .grow { flex: 1; min-width: 180px; }
input, select { border: 1px solid #c9cfc0; border-radius: 7px; padding: 10px 11px; background: #fff; color: var(--ink); min-height: 44px; max-width: 100%; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* Formularios */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 24px; width: 480px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; color: var(--ink); }
dialog::backdrop { background: #14201b99; }
form label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0; }
form label input, form label select { display: block; width: 100%; margin-top: 5px; font-weight: 400; font-size: 16px; }
form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; line-height: 1.45; }
form label.check input { width: 22px; min-height: 22px; height: 22px; margin: 1px 0 0; flex: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-top: 12px; }
.summary { background: var(--paper); border-radius: 8px; padding: 12px 14px; font-size: 14px; margin: 12px 0; }
.mono { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--paper); border-radius: 8px; padding: 12px; font-size: 14px; }
.qr { width: 220px; height: 220px; display: block; margin: 12px auto; background: #fff; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

/* Acceso */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: var(--side); }
.auth .card { width: 100%; max-width: 420px; }
.auth .brand { color: var(--ink); }
.auth .brand span { color: #7d9c22; }
.auth .sub { color: var(--muted); margin-bottom: 22px; }
.auth h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: -.5px; }
.auth button[type=submit] { width: 100%; margin-top: 8px; }
.legal { color: #a3aea4; font-size: 12px; text-align: center; margin-top: 14px; }
.auth-foot a { color: var(--muted); font-size: 13px; }

#toasts { position: fixed; bottom: 20px; right: 20px; left: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; z-index: 50; }
.toast { padding: 13px 18px; background: #1c3023; color: #fff; border-radius: 8px; box-shadow: 0 5px 20px #0003; max-width: 420px; }
.toast.bad { background: var(--bad); }
.loading { padding: 40px; color: var(--muted); text-align: center; }

@media (max-width: 1050px) {
  aside { width: 180px; padding: 24px 14px; }
  main { margin-left: 180px; padding: 22px; }
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  aside { position: static; width: auto; padding: 14px 16px 10px; flex-direction: column; }
  .sub { margin: 2px 0 8px; }
  nav { display: flex; overflow-x: auto; gap: 4px; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  nav a { white-space: nowrap; margin: 0; padding: 9px 12px; font-size: 14px; }
  aside footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 0; margin-top: 6px; padding-top: 4px; }
  aside footer strong { display: inline; }
  aside footer .role { display: none; }
  aside footer .link { margin: 0; flex: none; }
  main { margin: 0; padding: 14px 16px 40px; }
  .top { display: none; }
  h1 { font-size: 26px; margin-top: 12px; }
  .stats { gap: 10px; }
  .stat, .card { padding: 15px; }
  .stat strong { font-size: 24px; }
  .heading > button, .heading .actions, .heading .actions button { width: 100%; }
  table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.cards tr:last-child { border-bottom: 0; }
  table.cards td { border: 0; padding: 4px 0; }
  table.cards td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 11px; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; }
  .toast { max-width: 100%; }
  .form-actions button { flex: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: in .18s ease-out; }
  @keyframes in { from { opacity: 0; transform: translateY(6px); } }
}
