/* ===== Kirigym · temas (manual de marca v2.0, 28-10-2026: tres colores de marca) =====
   El tema va en <html data-kt="turquesa | ambar | rojo"> (+ «-noche»). El gimnasio elige el color líder (turquesa, ámbar o rojo)
   y cada persona claro, oscuro o automático (ver layout.php). Todo el CSS usa estos tokens: nada de colores sueltos. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 900; font-stretch: 62% 125%; font-display: swap; src: url(../fonts/archivo-latin.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/hanken-grotesk-latin.woff2) format("woff2"); }
:root, [data-kt="turquesa"] {
  /* los tres colores de marca: los mismos en todos los temas (manual 2.0) */
  --turquesa: #3CCFD4; --ambar: #F0A23B; --rojo: #E5484D; --on-marca: #141619;
  --turquesa-ink: #0B7479; --ambar-ink: #9A5B0A; --rojo-ink: #B8282F;
  --bg: #F3F2EE; --surface: #FFFFFF; --surface-2: #E9E7E0; --text: #141619; --muted: #5E646B; --line: #D9D6CC;
  --primary: var(--turquesa); --on-primary: var(--on-marca); --primary-ink: var(--turquesa-ink); --accent: #8FE6DA; --deep: #141619; --on-deep: #F3F2EE;
  --socios: var(--rojo); --clases: var(--ambar); --totem: var(--turquesa); --cobros: #2E8B57; --accesos: #1B5FAA;
  /* Iconos del menú: cada sección con su color, sin repetir ninguno */
  --m-centro: #64748B; --m-zonas: #7E57C2; --m-captacion: #F2711C; --m-avisos: #D63384; --m-pago: #7CB518; --m-conta: #9C6B3F; --m-totem: var(--turquesa);
  --ok: #2E8B57; --warn: #9A5B0A; --bad: #A61B1B; --info: #1B5FAA;
  color-scheme: light;
}
[data-kt="ambar"] { --bg: #F6F3EC; --surface-2: #EDE7DA; --text: #10151F; --muted: #5B6475; --line: #DDD5C5; --deep: #10151F; --on-deep: #F6F3EC; }
[data-kt="rojo"] { --bg: #F6F2EF; --surface-2: #ECE5E1; --line: #DDD3CE; --on-deep: #F6F2EF; }
[data-kt$="-noche"] {
  --bg: #10151F; --surface: #171E2B; --surface-2: #1E2737; --text: #EEF2F8; --muted: #8A93A6; --line: #2A3346; --deep: #0B0F17; --on-deep: #EEF2F8;
  --on-marca: #10151F; --turquesa-ink: #5ED9DB; --ambar-ink: #F6B65E; --rojo-ink: #FF7A7E;
  --cobros: #3BA66E; --accesos: #3B82F6;
  --m-centro: #94A3B8; --m-zonas: #9F7AEA; --m-captacion: #FB8C3C; --m-avisos: #EC5FA5; --m-pago: #A3D93B; --m-conta: #C08A57;
  --ok: #3BA66E; --warn: #F6B65E; --bad: #F28B82; --info: #6AA5F0;
  color-scheme: dark;
}
/* color líder que elige el gimnasio (el mismo para panel, área del socio y tótem) */
[data-kt^="ambar"] { --primary: var(--ambar); --primary-ink: var(--ambar-ink); --accent: #F9D49B; }
[data-kt^="rojo"] { --primary: var(--rojo); --primary-ink: var(--rojo-ink); --accent: #F4B3AE; }
:root {
  /* derivados: valen para los cuatro temas */
  --soft: color-mix(in srgb, var(--surface-2) 40%, var(--surface));
  --line-2: color-mix(in srgb, var(--text) 16%, var(--line));
  --text-2: color-mix(in srgb, var(--text) 80%, var(--surface));
  --ok-bg: color-mix(in srgb, var(--ok) 13%, var(--surface));   --ok-line: color-mix(in srgb, var(--ok) 40%, var(--surface));
  --warn-bg: color-mix(in srgb, var(--warn) 14%, var(--surface)); --warn-line: color-mix(in srgb, var(--warn) 40%, var(--surface));
  --bad-bg: color-mix(in srgb, var(--bad) 12%, var(--surface));  --bad-line: color-mix(in srgb, var(--bad) 38%, var(--surface));
  --info-bg: color-mix(in srgb, var(--info) 12%, var(--surface)); --info-line: color-mix(in srgb, var(--info) 38%, var(--surface));
  /* nombres de antes (siguen usándose en todo el CSS y en algunas páginas) */
  --card: var(--surface); --ink: var(--text); --brand: var(--deep); --gym: var(--primary); --radius: 6px;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 4px;
  --solapa: .5s cubic-bezier(.25,.9,.3,1);
  font-family: var(--body);
  color: var(--text);
  background: var(--bg);
}

/* Kirigym — estilos de los paneles (superadmin y gimnasio) */
/* Los colores salen de los temas de Kirigym (bloque «Kirigym · temas» al principio). */
[hidden] { display: none !important; }   /* lo oculto con «hidden» no lo vuelve a mostrar el display de .btn, small… */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: inherit; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
code, .mono { font-family: ui-monospace, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.dim { opacity: .5; }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex-shrink: 0; background: var(--brand); color: var(--line); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.brand strong { display: block; color: #fff; }
.brand small { color: var(--muted); }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); flex-shrink: 0; display: inline-block; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--line-2); }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.area-panel .sidebar nav a.active { box-shadow: inset 3px 0 0 var(--gym); }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.sidebar-foot .who small { display: block; color: var(--muted); }
.sidebar-foot .logout { display: inline-block; margin: 8px 0; color: #fca5a5; }
.sidebar-foot .env { display: block; color: var(--muted); }
.content { flex: 1; padding: 24px 28px 48px; min-width: 0; }
.page-head { margin-bottom: 18px; }
.impersonation { background: #7c2d12; color: #fff; padding: 8px 16px; font-size: 14px; }
.impersonation a { color: #fed7aa; margin-left: 10px; }

/* Cards, grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2.wide-left { grid-template-columns: 2fr 1fr; }
.grid-2 > div > .card:last-child { margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat span { display: block; font-size: 13px; color: var(--muted); }
.stat strong { display: block; font-size: 24px; margin-top: 2px; }
.stat small { color: var(--muted); font-size: 12px; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.new-plan { border-style: dashed; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.order { width: 54px; white-space: nowrap; }

/* Forms */
.form label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.form input:not([type=checkbox]):not([type=color]), .form select, .form textarea, .toolbar select, .toolbar input {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-weight: 400; background: var(--surface); color: var(--ink);
}
.toolbar select, .toolbar input { display: inline-block; width: auto; margin: 0; }
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.form label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.form legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; margin-bottom: 18px; }
.inline, .inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }
input.tiny { width: 70px !important; display: inline-block !important; padding: 4px 6px; }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.colors input[type=color] { display: block; width: 100%; height: 38px; margin-top: 5px; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; background: var(--surface); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--deep); }
.area-panel .btn-primary { background: var(--deep); }
.btn-ghost { background: transparent; }
.btn-small { padding: 5px 9px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 24px; height: 24px; font-size: 10px; cursor: pointer; padding: 0; color: var(--text-2); }
.icon-btn[disabled] { opacity: .3; cursor: default; }

/* Badges, alerts */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert-error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.license-banner { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid var(--line); background: var(--surface); }
.license-trial { border-left: 4px solid var(--info); }
.license-active { border-left: 4px solid var(--ok); }
.license-grace { border-left: 4px solid var(--warn); background: var(--warn-bg); }
.license-suspended { border-left: 4px solid var(--bad); background: var(--bad-bg); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-on { background: var(--ok); }
.dot-off { background: var(--muted); }
.danger-zone { border-color: var(--bad-line); }

/* Media */
.thumb { width: 64px; height: 36px; object-fit: cover; border-radius: 4px; display: inline-block; vertical-align: middle; background: var(--line); }
.thumb-empty { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--line) 4px, var(--line) 8px); }
.thumb-video { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.thumb-lg { max-width: 100%; max-height: 180px; border-radius: 8px; display: block; margin-bottom: 10px; }
.video-preview { width: 100%; max-height: 260px; border-radius: 8px; background: #000; margin-bottom: 10px; }
.logo-preview { padding: 18px; border-radius: 8px; margin-bottom: 10px; text-align: center; }
.logo-preview img { max-width: 100%; max-height: 110px; }
.upload-progress { margin-top: 10px; }
.upload-progress .bar { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--primary) var(--p, 0%), var(--line) var(--p, 0%)); }
.upload-progress span { font-size: 13px; color: var(--muted); }

/* Branding swatch */
.swatch { background: var(--bg); color: var(--tx); padding: 18px; border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.swatch strong { grid-column: 1 / -1; font-size: 18px; }
.swatch-tile { background: var(--sf); padding: 22px 12px; border-radius: 8px; border-bottom: 3px solid var(--p); font-weight: 700; }
.swatch-btn { grid-column: 1 / -1; background: var(--p); color: var(--bg); padding: 10px; text-align: center; border-radius: 8px; font-weight: 700; }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 9px; width: 18px; height: 18px; border: 2px solid var(--line-2); border-radius: 50%; }
.checklist li.done::before { background: var(--ok); border-color: var(--ok); }
.checklist li.done::after { content: "✓"; position: absolute; left: 4px; top: 8px; color: #fff; font-size: 13px; font-weight: 700; }
.checklist li.done a { color: var(--muted); }

/* Screens */
.screens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.screen-status { margin-bottom: 8px; font-size: 14px; }
.code-big { font-size: 30px; font-weight: 700; letter-spacing: .08em; background: var(--surface-2); padding: 10px; border-radius: 8px; text-align: center; }
.sim-device { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sim-device:last-child { border-bottom: 0; }
.sim-device .inline-form { margin-top: 6px; }
pre.json { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; font-size: 12px; overflow: auto; max-height: 560px; }

/* Preview */
.preview-wrap { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.totem { width: 405px; height: 720px; border: 14px solid #111; border-radius: 22px; background: #000; box-shadow: 0 20px 40px rgba(0,0,0,.25); overflow: hidden; }
.totem iframe { width: 1080px; height: 1920px; border: 0; transform: scale(.375); transform-origin: 0 0; }
.preview-side { display: flex; flex-direction: column; gap: 10px; max-width: 260px; }

/* Auth */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--deep); }
.auth-card { background: var(--surface); padding: 28px; border-radius: 14px; width: 100%; max-width: 380px; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { margin-bottom: 16px; }
.auth-brand { font-weight: 700; display: flex; gap: 8px; align-items: center; margin-bottom: 18px; }
.auth-brand small { color: var(--muted); font-weight: 400; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .table { display: block; overflow-x: auto; }
}

/* Músculos y máquinas */
.muscle-picker { display: grid; grid-template-columns: 1fr 170px; gap: 14px; align-items: start; margin-bottom: 12px; }
.mp-zone { margin-bottom: 8px; }
.mp-zone strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.mp-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.mpill { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.mpill:hover { border-color: var(--muted); }
.mpill[data-state="primary"] { background: #e53935; border-color: #e53935; color: #fff; font-weight: 600; }
.mpill[data-state="secondary"] { background: #ffe0d6; border-color: #ff9f80; color: #9a3412; }
.mp-legend { color: var(--muted); margin: 6px 0 0; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 8px; vertical-align: -1px; }
.lg-p { background: #e53935; margin-left: 0; } .lg-s { background: #ff9f80; }
.mp-map { position: sticky; top: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.bodymap { display: block; width: 100%; height: auto; }
.mthumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; overflow: hidden; }
.mthumb-map .bodymap { width: auto; height: 52px; }
.num-badge { display: inline-block; min-width: 26px; padding: 2px 7px; border-radius: 6px; background: var(--deep); color: #fff; font-weight: 700; font-size: 13px; text-align: center; }
.catalog-pick { max-height: 620px; overflow-y: auto; }
.pick-row { display: flex !important; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); margin: 0 !important; font-weight: 400 !important; }
.pick-row > span { flex: 1; }
.pick-row small { display: block; }
.pick-row input.tiny { width: 56px !important; margin: 0 !important; }
.catalog-pick .btn-block { position: sticky; bottom: 0; margin-top: 10px; }
.machine-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-bottom: 4px; }
.machine-checks label.check { margin-bottom: 6px; }
.plain-list { list-style: none; padding: 0; margin: 0 0 12px; }
.plain-list li { padding: 5px 0; border-bottom: 1px solid var(--line); }

/* Planes */
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; }
.day-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.day-head .day-name { font-size: 17px !important; font-weight: 700 !important; max-width: 260px; margin: 0 !important; }
.day-head select { width: auto !important; margin: 0 !important; }
.day-head .spacer { flex: 1; }
.plan-table input { margin: 0 !important; }
.plan-table input.tiny { width: 76px !important; }
.add-row { margin-top: 10px; }
.add-row select { width: auto !important; min-width: 280px; margin: 0 !important; display: inline-block !important; }
.master-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.master-tile { border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; background: var(--surface); text-decoration: none; }
.master-tile .bodymap, .master-tile img { height: 120px; width: auto; max-width: 100%; margin: 0 auto 6px; object-fit: contain; }
.master-tile strong { display: block; font-size: 13px; }

@media (max-width: 900px) {
  .muscle-picker { grid-template-columns: 1fr 110px; }
  .machine-checks { grid-template-columns: 1fr; }
}
.bm-lazy { display: block; height: 100%; }
.bm-lazy .bodymap { height: 100%; width: auto; margin: 0 auto; }
.master-tile .bm-lazy { height: 120px; margin-bottom: 6px; }
.mthumb-map .bm-lazy { height: 52px; }

/* ---------- Marca y pantalla ---------- */
.brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.brand-main { display: flex; flex-direction: column; gap: 18px; }
.brand-main .card { margin: 0; }
.brand-side .sticky { position: sticky; top: 16px; }
@media (max-width: 1000px) { .brand-layout { grid-template-columns: 1fr; } .brand-side .sticky { position: static; } }
.card.locked { background: var(--soft); }
.card.locked h2 .badge { margin-left: 6px; vertical-align: middle; }
.lock-note { padding: 12px 14px; border-radius: 8px; background: var(--surface-2); border-left: 4px solid var(--muted); margin: 8px 0; }
.custom-fields.off { opacity: .45; }
.big-check { font-weight: 600; }
.bg-thumb { display: block; max-height: 120px; border-radius: 8px; margin: 6px 0; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-card { position: relative; display: flex; flex-direction: column; gap: 4px; cursor: pointer; padding: 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,24,39,.12); }
.theme-card:has(input:checked) .tc-name::after { content: ' ✓'; }
.tc-mock { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 8px; background: var(--bg); color: var(--tx); height: 112px; font-family: var(--fb); }
.tc-mock.tc-bg-gradient { background: radial-gradient(120% 70% at 100% 0%, color-mix(in srgb, var(--p) 35%, transparent), transparent 70%), var(--bg); }
.tc-title { font-family: var(--fh); font-weight: 800; font-size: 17px; line-height: 1.05; }
.tc-title.up { text-transform: uppercase; }
.tc-title b { color: var(--p); }
.tc-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; flex: 1; }
.tc-tiles i { background: var(--sf); border-radius: 6px; border-bottom: 3px solid var(--p); }
.tc-btn { background: var(--p); color: var(--onp); font-family: var(--fh); font-weight: 700; font-size: 11px; text-align: center; padding: 4px; border-radius: 6px; }
.tc-square .tc-tiles i, .tc-square .tc-btn { border-radius: 0; }
.tc-pill .tc-tiles i { border-radius: 12px; } .tc-pill .tc-btn { border-radius: 999px; }
.tc-name { font-weight: 700; font-size: 14px; }

.totem-mock { position: relative; overflow: hidden; width: 100%; aspect-ratio: 9 / 16; border-radius: 14px; background-color: var(--bg); background-size: cover; background-position: center; color: var(--tx); font-family: var(--fb); padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; border: 6px solid #111; }
.totem-mock.bg-gradient { background-image: radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--p) 35%, transparent), transparent 70%); }
.totem-mock > * { position: relative; }
.totem-mock .tm-wm { position: absolute; inset: 20% -15% auto; height: 60%; background: center / contain no-repeat; opacity: .07; pointer-events: none; }
.tm-top { min-height: 34px; display: flex; align-items: center; }
.tm-logo { max-height: 34px; max-width: 60%; object-fit: contain; }
.logo-large .tm-top { justify-content: center; min-height: 64px; } .logo-large .tm-logo { max-height: 64px; max-width: 80%; }
.tm-name { font-family: var(--fh); font-weight: 800; font-size: 18px; }
.up .tm-name, .up .tm-h1 { text-transform: uppercase; }
.tm-h1 { font-family: var(--fh); font-weight: 900; font-size: 26px; line-height: 1; }
.tm-h1 span { color: var(--p); }
.tm-sub { font-size: 11px; opacity: .7; margin-top: 4px; }
.tm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; align-content: start; }
.tm-tile { background: var(--sf); border-radius: 10px; padding: 10px 8px; font-family: var(--fh); font-weight: 700; font-size: 12px; height: 86px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.tm-tile i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--p); }
.tm-bar { display: flex; gap: 8px; } .tm-bar span { flex: 1; text-align: center; padding: 9px; border-radius: 8px; background: var(--sf); font-weight: 700; font-size: 12px; font-family: var(--fh); }
.tm-bar .p { background: var(--p); color: var(--onp); }
.c-square .tm-tile, .c-square .tm-bar span { border-radius: 0; }
.c-pill .tm-tile { border-radius: 18px; } .c-pill .tm-bar span { border-radius: 999px; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; padding: 3px; flex-shrink: 0; }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Superseries en el editor de planes */
.plan-table tr.ss-head td { background: var(--warn-bg); border-left: 4px solid var(--clases); font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
.plan-table tr.ss-row td { background: var(--warn-bg); }
.plan-table tr.ss-row td:first-child { border-left: 4px solid var(--clases); }
.ss-tag { display: inline-block; min-width: 26px; text-align: center; font-weight: 700; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--clases); color: #111; }
.plan-table td.actions { white-space: nowrap; }

/* Migas de pan */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; padding: 2px 0; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { color: var(--line-2); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.demo-banner { margin: 0 0 14px; padding: 8px 14px; border-radius: var(--radius); background: var(--warn-bg); border: 1px solid var(--warn); color: var(--warn); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.zone-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--zc) 12%, var(--surface)); color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.zone-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--zc); }
fieldset.opts { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px 10px; margin: 0 0 12px; }
fieldset.opts legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
fieldset.opts label.check { display: inline-flex; margin: 4px 14px 4px 0; }
.form input[type=color] { display: block; width: 64px; height: 40px; margin-top: 6px; padding: 3px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); cursor: pointer; }

/* ===== Experiencia de uso (v8): animaciones, archivador y filtros en vivo ===== */
@keyframes popIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; background: var(--warn-bg); } to { opacity: 1; background: transparent; } }
@keyframes spin { to { transform: rotate(360deg); } }
.content { animation: fadeSlide .25s ease-out; }
.pop-in { animation: popIn .35s ease-out both; animation-delay: var(--d, 0ms); }
.card, .stat { transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.stat:hover, .summary-box:hover { box-shadow: 0 6px 18px rgba(17,24,39,.08); transform: translateY(-2px); }
.btn { transition: background .15s ease, transform .1s ease, box-shadow .15s ease; }
.btn:active { transform: scale(.97); }
.btn-primary:hover { box-shadow: 0 4px 12px rgba(17,24,39,.25); }
.btn.is-busy { opacity: .7; pointer-events: none; }
.btn.is-busy::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.alert { animation: fadeSlide .3s ease-out; transition: opacity .4s ease, transform .4s ease; }
.alert.fade-out { opacity: 0; transform: translateY(-6px); }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: var(--soft); }
.table tr.row-in { animation: rowIn .45s ease-out; }
.sidebar nav a { transition: background .15s ease, color .15s ease, padding-left .15s ease; }
.sidebar nav a:hover { padding-left: 14px; }
details[open] > *:not(summary) { animation: fadeSlide .2s ease-out; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Cabecera de la ficha */
.member-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: linear-gradient(120deg, var(--surface) 60%, color-mix(in srgb, var(--primary) 10%, var(--surface))); }
.hero-photo { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--gym), 0 6px 16px rgba(0,0,0,.12); flex-shrink: 0; }
.hero-photo.empty { display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; color: var(--muted); }
.hero-main { flex: 1; min-width: 220px; }
.hero-main h2 { font-size: 24px; margin: 2px 0 8px; }
.hero-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Archivador: pestañas que sobresalen por arriba de la carpeta */
.folder { margin-bottom: 18px; }
.folder-tabs { display: flex; gap: 4px; padding-left: 10px; overflow-x: auto; scrollbar-width: thin; position: relative; z-index: 1; }
.folder-tabs a { display: flex; align-items: center; gap: 7px; padding: 10px 18px 9px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--text-2); white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; position: relative; top: 1px;
  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease; transform: translateY(4px); }
.folder-tabs a:hover { background: var(--soft); color: var(--ink); transform: translateY(1px); }
.folder-tabs a.active { background: var(--card); color: var(--ink); transform: none; box-shadow: inset 0 3px 0 var(--gym), 0 -4px 10px rgba(0,0,0,.04); }
.tab-count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--text-2); }
.tab-count.warn { background: var(--warn-bg); color: var(--warn); }
.tab-count.ok { background: var(--ok-bg); color: var(--ok); }
.folder-panel { background: var(--card); border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 20px; min-height: 220px; box-shadow: 0 8px 24px rgba(17,24,39,.05); }
.folder-panel.enter { animation: fadeSlide .25s ease-out; }
.panel-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--soft); transition: box-shadow .2s ease, transform .2s ease; }
.summary-box span { display: block; font-size: 12px; color: var(--muted); }
.summary-box strong { display: block; font-size: 18px; margin: 2px 0; }
.summary-box small { display: block; color: var(--muted); font-size: 12px; }
.summary-box.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.summary-box.bad { border-color: var(--bad-line); background: var(--bad-bg); }
.summary-box.ok { border-color: var(--ok-line); background: var(--ok-bg); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0 0 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.mini-row:last-of-type { margin-bottom: 14px; }
.side-box { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.quote-box { margin: 10px 0 14px; transition: opacity .2s ease; }
.quote-box.loading { opacity: .4; }
.sticky-actions { position: sticky; bottom: 0; z-index: 2; background: var(--card); margin: 8px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 14px rgba(17,24,39,.05); }

/* Buscador y filtros en vivo */
.live-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; }
.lf-search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.lf-search span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; }
.lf-search input { width: 100%; padding: 8px 10px 8px 30px; border: 1px solid var(--line-2); border-radius: 999px; font: inherit; font-size: 14px; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.lf-search input:focus, .toolbar input[type=search]:focus { outline: 0; border-color: var(--gym); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.lf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: all .15s ease; }
.chip small { color: var(--muted); font-size: 11px; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip.on small { color: inherit; opacity: .75; }
.lf-count { margin-left: auto; }
.lf-empty { padding: 14px 8px; text-align: center; }
@media (max-width: 900px) {
  .member-hero { align-items: flex-start; }
  .hero-photo { width: 76px; height: 76px; }
  .folder-panel { padding: 14px; }
  .lf-count { margin-left: 0; }
}

/* Selector segmentado (Activos / De baja / Todos) */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 999px; text-decoration: none; font-size: 13px; font-weight: 600; color: var(--text-2); transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.seg a small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.mthumb-ini { width: 44px; height: 44px; border-radius: 50%; font-weight: 700; font-size: 15px; letter-spacing: .02em;
  background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 45% 32%); }

/* Pestañas: punto de color, pestaña «+» y barra de herramientas dentro del panel */
.tab-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.folder-tabs .tab-add { color: var(--muted); background: transparent; border-style: dashed; }
.folder-tabs .tab-add:hover { color: var(--ink); background: var(--surface); }
.panel-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: -4px 0 14px; }
.panel-toolbar .muted { font-size: 13px; }
.folder > .folder-panel + .folder-panel { border-top-left-radius: var(--radius); }
.popover { position: relative; display: inline-block; }
.popover > summary { list-style: none; cursor: pointer; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-box { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(17,24,39,.15); padding: 14px; animation: fadeSlide .2s ease-out; }
.popover-box.right { left: auto; right: 0; }
.folder-tabs { overflow: visible; flex-wrap: wrap; }
.tab-add-wrap { align-self: flex-end; }
.tab-add-btn { display: flex; align-items: center; gap: 6px; padding: 9px 14px 8px; font-weight: 600; font-size: 14px; color: var(--muted); border: 1px dashed var(--line-2); border-bottom: 0; border-radius: 12px 12px 0 0; transform: translateY(4px); transition: color .15s ease, background .15s ease, transform .2s ease; white-space: nowrap; }
.tab-add-btn:hover, .tab-add-wrap[open] .tab-add-btn { color: var(--ink); background: var(--surface); transform: translateY(1px); }
.color-pick { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.color-pick input[type=radio] { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--c); margin: 0; cursor: pointer; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); transition: transform .15s ease, box-shadow .15s ease; }
.color-pick input[type=radio]:checked { box-shadow: 0 0 0 2px var(--ink); transform: scale(1.1); }
.table tr.row-editing td { background: var(--warn-bg); }
@keyframes flashCard { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 70%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.card.flash { animation: flashCard .7s ease-out; }

/* ---------- Fase 5: captación, clases y avisos ---------- */
.fade-out { opacity: 0; transform: translateY(-6px); transition: opacity .4s ease, transform .4s ease; }
.empty-state { text-align: center; padding: 28px 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary-ink); cursor: pointer; font: inherit; }
.link-btn.small { font-size: 13px; }

/* Etapas del interesado */
.lead-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.lead-steps form { margin: 0; }
.lead-step { --c: var(--muted); display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.lead-step span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: 12px; }
.lead-step:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(17,24,39,.08); }
.lead-step.done { color: var(--ink); }
.lead-step.done span { background: var(--c); color: #fff; }
.lead-step.current { background: var(--c); border-color: var(--c); color: #fff; cursor: default; }
.lead-step.current span { background: rgba(255,255,255,.25); color: #fff; }
.lead-step:disabled { cursor: default; }

/* Historial (línea de tiempo) */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { display: flex; gap: 12px; padding: 0 0 14px; position: relative; animation: fadeSlide .25s ease-out both; }
.timeline li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-ico { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font-size: 15px; }
.timeline p { margin: 4px 0 2px; }
.timeline .tl-system p { color: var(--muted); font-size: 13px; }

/* Botones de elección (tipo de contacto, días de la semana) */
.seg-choice { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.seg-choice label { margin: 0; font-weight: 400; }
.seg-choice input { position: absolute; opacity: 0; pointer-events: none; }
.seg-choice span { display: inline-block; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.seg-choice input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.seg-choice input:focus-visible + span { outline: 2px solid var(--primary-ink); outline-offset: 2px; }

/* Calendario semanal de clases */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.week-day { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 140px; }
.week-day.is-today { border-color: var(--gym); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gym) 35%, transparent); background: var(--surface); }
.week-day.is-past { opacity: .6; }
.week-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.week-head strong { font-size: 18px; color: var(--ink); }
.class-block { --c: var(--primary); display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 13px; line-height: 1.3; transition: transform .15s ease, box-shadow .15s ease; animation: fadeSlide .25s ease-out both; }
.class-block:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(17,24,39,.1); }
.class-block strong { display: block; }
.class-block small { color: var(--muted); }
.class-block.is-cancelled { opacity: .55; text-decoration: line-through; }
.cb-bar { display: block; height: 4px; border-radius: 4px; background: var(--line); margin: 4px 0 3px; overflow: hidden; }
.cb-bar i { display: block; height: 100%; background: var(--c, var(--primary-ink)); border-radius: 4px; transition: width .6s ease; }
.cb-bar.wide { display: inline-block; width: 90px; vertical-align: middle; height: 6px; }
@media (max-width: 900px) { .week-grid { grid-template-columns: 1fr; } .week-day { min-height: 0; } }

/* Horario semanal */
.slot-row { --c: var(--primary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 14px; }
.slot-row form { margin-left: auto; }

/* Avisos */
.msg-list { display: grid; gap: 10px; }
.msg-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; animation: fadeSlide .25s ease-out both; transition: opacity .4s ease, transform .4s ease; }
.msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg-body { margin: 8px 0; padding: 10px 12px; background: #dcf8c6; color: #10151F; border-radius: 10px 10px 10px 2px; font-size: 14px; max-width: 640px; }
.msg-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.rule-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); padding: 12px 14px; transition: background .2s ease, border-color .2s ease; }
.rule-card.on { background: var(--surface); border-color: var(--ok-line); box-shadow: 0 0 0 1px var(--ok-line); }
.rule-card .rule-body { display: none; margin-top: 10px; }
.rule-card.on .rule-body { display: block; animation: fadeSlide .2s ease-out; }
.switch-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin: 0; }
.switch-row input { margin-top: 4px; width: 18px; height: 18px; }
.switch-row small { display: block; color: var(--muted); font-weight: 400; }
.paylink-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.paylink-box input { flex: 1 1 260px; min-width: 0; }

/* Menú lateral con carpetas (v12) */
.sidebar nav { overflow-y: auto; min-height: 0; flex: 1 1 auto; scrollbar-width: thin; }
.nav-group > summary { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--muted); cursor: pointer; list-style: none;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; user-select: none; transition: color .15s ease, background .15s ease; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .2s ease; opacity: .7; }
.nav-group[open] > summary::after { transform: rotate(45deg); }
.nav-group > summary:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-group[data-current] > summary { color: var(--line); }
.nav-group-items { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px 12px; padding-left: 6px; border-left: 1px solid rgba(255,255,255,.08); }
.nav-group[open] .nav-group-items { animation: fadeSlide .2s ease-out; }
.sidebar nav > a + .nav-group, .nav-group + a { margin-top: 4px; }
@media (max-width: 900px) {
  .sidebar nav { overflow: visible; }
  .nav-group { width: 100%; }
  .nav-group-items { flex-direction: row; flex-wrap: wrap; margin-left: 0; border-left: 0; }
}

/* Recibos: Cobrar, Impagado, Anular */
.receipt-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.receipt-actions select { padding: 6px; }
.btn.btn-warn { color: var(--bad); border-color: var(--bad-line); }
.btn.btn-warn:hover { background: var(--bad-bg); }
.tab-count.bad { background: var(--bad-bg); color: var(--bad); }
.steps-list { margin: 6px 0 10px; padding-left: 20px; }
.steps-list li { margin-bottom: 4px; }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.form .check-row label.check { margin: 0; }

/* ---------- Músculos, tipos y ubicaciones (v13) ---------- */
.grid-2.wide-right { grid-template-columns: 1fr 2fr; }
.muscle-group { margin-bottom: 22px; animation: fadeSlide .3s ease both; }
.mg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.mg-head h2 { margin: 0; font-size: 18px; }
.mg-head h2 a { color: inherit; text-decoration: none; }
.mg-head .btn { margin-left: auto; }
.master-tile { background: #1f2124; color: #fff; border-color: #2c2f33; transition: transform .15s ease, box-shadow .15s ease; display: flex; flex-direction: column; align-items: center; }
.master-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.master-tile .muted { color: #a8adb4 !important; }
.master-tile.add { background: var(--surface); color: var(--text); border-style: dashed; justify-content: center; min-height: 170px; }
.master-tile.add span { font-size: 32px; line-height: 1; color: var(--muted); }
.master-tile .bm-none { height: 120px; display: flex; align-items: center; color: #8b9097; font-size: 12px; }
.mini-map { width: 46px; }
.mini-map .bm-lazy { height: 56px; width: 40px; background: #1f2124; border-radius: 6px; overflow: hidden; }
.area-preview { background: #1f2124; border-radius: 12px; padding: 10px; }
.area-preview .bodymap { max-height: 460px; }
.inline-danger { margin-top: 18px; display: flex; gap: 10px; align-items: center; border: 0; padding: 0; }
.add-links { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--soft); }
.add-links-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.add-links-head input[type=search] { flex: 1; min-width: 180px; margin: 0 !important; }
.add-links-head select { width: auto !important; margin: 0 0 0 6px !important; display: inline-block !important; }
.check-list { max-height: 240px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 14px; }
.check-list .check { margin: 0; padding: 4px 2px; font-weight: 400; }
.inline-label { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; }
.inline-label select { width: auto !important; margin: 0 !important; }
.assign-bar { position: sticky; top: 0; z-index: 3; background: var(--surface); padding: 8px 0; }
.enable-card { max-width: 620px; }
@media (max-width: 900px) { .grid-2.wide-right { grid-template-columns: 1fr; } }
.form .lf-search input { padding: 8px 10px 8px 30px !important; border-radius: 999px !important; margin: 0 !important; }
.form td select { margin: 0 !important; max-width: 220px; }
.table td .badge { white-space: nowrap; }

/* ---------- Contabilidad ---------- */
.table th.num, .table td.num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.acc-toolbar .inline-label { font-size: 14px; font-weight: 600; color: var(--text-2); }

/* Resumen: gráfico de ingresos y gastos por mes */
.acc-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.acc-chart-head h2 { margin: 0; }
.acc-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink); }
.acc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.acc-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #c3c2b7; flex-shrink: 0; }
.acc-sw.s1 { background: #2a78d6; }
.acc-sw.s2 { background: #eb6834; }
.acc-chart { position: relative; min-height: 210px; }
.acc-chart svg { display: block; overflow: visible; }
.acc-chart rect[tabindex] { outline: none; cursor: default; }
.acc-tip { position: absolute; top: 0; z-index: 5; pointer-events: none; min-width: 180px; display: grid; gap: 3px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(17,24,39,.14); font-size: 13px; color: var(--ink); }
.acc-tip strong { margin-bottom: 2px; }
.acc-tip > span { display: flex; align-items: center; gap: 7px; }
.acc-tip b { margin-left: auto; padding-left: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-twin { margin-top: 10px; }
.acc-twin > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.acc-twin .table { margin-top: 8px; }
.acc-row-on td { background: var(--soft); font-weight: 600; }

/* Resumen: gastos por categoría */
.acc-hbars { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 9px; }
.acc-hbars li { display: grid; grid-template-columns: minmax(120px, 36%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.acc-hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-hbar-track { height: 12px; }
.acc-hbar-track i { display: block; height: 100%; min-width: 2px; background: #2a78d6; border-radius: 0 4px 4px 0; animation: accGrow .5s ease-out both; transform-origin: left; }
.acc-hbar-val { min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
@keyframes accGrow { from { transform: scaleX(0); } to { transform: none; } }

/* Plazo y lo que falta */
.acc-deadline { margin-bottom: 18px; }
.acc-deadline p { margin: 0 0 8px; }
.acc-deadline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.acc-todo { list-style: none; margin: 0 0 10px; padding: 0; }
.acc-todo li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.acc-todo li:last-child { border-bottom: 0; }
.acc-todo small { margin-left: 4px; white-space: nowrap; }
.acc-todo a { margin-left: 6px; font-weight: 600; }
.acc-todo-ico { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--info-bg); color: var(--info); }
.acc-todo li.tone-warn .acc-todo-ico { background: var(--warn-bg); color: var(--warn); }
.acc-todo li.tone-bad .acc-todo-ico { background: var(--bad-bg); color: var(--bad); }
.acc-all-ok { color: var(--ok); font-weight: 600; }

/* Bandeja */
.inbox-top { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.inbox-drop { flex: 1 1 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 24px 16px; text-align: center; border: 2px dashed var(--line-2); border-radius: 12px; background: var(--soft); cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.inbox-drop:hover { border-color: var(--muted); background: var(--soft); }
.inbox-drop.over { border-color: var(--gym); background: var(--warn-bg); transform: scale(1.01); }
.inbox-drop-ico { font-size: 26px; line-height: 1; color: var(--muted); }
.inbox-drop .btn { margin-top: 6px; }
.inbox-folder { flex: 0 1 300px; }
.inbox-folder p { margin: 0 0 8px; }
.inbox-new-box { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--info-line); border-radius: var(--radius); background: var(--info-bg); animation: fadeSlide .25s ease-out; }
.inbox-new-box .panel-toolbar { margin: 0 0 8px; }
.inbox-new { display: flex !important; gap: 8px; align-items: flex-start; }
.inbox-new small { display: block; }
.inbox-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.inbox-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.inbox-chip strong { font-size: 15px; }
.inbox-chip:hover { border-color: var(--muted); transform: translateY(-1px); }
.inbox-chip.ok strong { color: var(--ok); }
.inbox-chip.warn strong { color: var(--warn); }
.inbox-chip.bad strong { color: var(--bad); }
.inbox-chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.inbox-chip.on strong { color: inherit; }
.inbox-bulk { flex-wrap: wrap; justify-content: flex-end; }
.inbox-bulk .check { margin: 0; }
.inbox-list[data-filter] .inbox-card:not([data-group]) , .inbox-list[data-filter="ok"] .inbox-card:not([data-group="ok"]), .inbox-list[data-filter="warn"] .inbox-card:not([data-group="warn"]),
.inbox-list[data-filter="error"] .inbox-card:not([data-group="error"]), .inbox-list[data-filter="queue"] .inbox-card:not([data-group="queue"]) { display: none; }
.inbox-card { position: relative; }
.inbox-pick { position: absolute; top: 6px; left: 6px; z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(0,0,0,.15); cursor: pointer; }
.inbox-pick input { margin: 0; width: 16px; height: 16px; cursor: pointer; }
.inbox-card.picked { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(17,24,39,.15); }
.inbox-head { margin-top: 4px; }
.inbox-head .panel-h { display: flex; align-items: center; gap: 8px; margin: 0; }
.inbox-list { display: grid; gap: 10px; }
.inbox-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: opacity .5s ease, transform .5s ease, box-shadow .2s ease; }
.inbox-card:hover { box-shadow: 0 4px 14px rgba(17,24,39,.06); }
.inbox-card.pop { animation: popIn .3s ease-out both; }
.inbox-card.leaving { opacity: 0; transform: translateX(16px); transition-delay: 1.1s; }
.inbox-card[data-status="done"] { border-color: var(--ok-line); background: var(--ok-bg); }
.inbox-card[data-status="error"] { border-color: var(--bad-line); }
.inbox-card[data-status="discarded"] { opacity: .8; }
.inbox-thumb { width: 64px; height: 80px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); text-decoration: none; }
.inbox-thumb img { width: 100%; height: 100%; object-fit: cover; }
.inbox-pdf { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--bad); }
.inbox-title { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.inbox-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 6px; font-size: 13px; color: var(--muted); }
.inbox-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line-2); border-top-color: var(--info); border-radius: 50%; animation: spin .8s linear infinite; }
.inbox-error { margin: 4px 0 0; font-size: 13px; color: var(--bad); }
.inbox-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.inbox-fact { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.inbox-warn { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--warn); }
.inbox-warn li { margin-bottom: 2px; }
.inbox-match { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--info-bg); font-size: 13px; color: var(--info); }
.inbox-match.soft { background: var(--surface-2); color: var(--text-2); }
.inbox-match a { font-weight: 600; }
.inbox-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 150px; }
.inbox-total { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inbox-total.in { color: var(--ok); }
.inbox-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.inbox-ok { color: var(--ok); }
.inbox-more { margin-top: 16px; }
.inbox-more > summary { cursor: pointer; padding: 6px 0; font-weight: 600; color: var(--text-2); }
.inbox-more .inbox-list { margin-top: 8px; }
.inbox-usage { margin-top: 16px; }
.inbox-toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px; background: var(--deep); color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: opacity .2s ease, transform .2s ease; }
.inbox-toast.on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.inbox-toast.err { background: var(--bad); }
.inbox-toast a { color: var(--warn-line); font-weight: 600; }

/* Gastos e ingresos */
.acc-table .acc-who { min-width: 180px; }
.acc-table .acc-badges .badge { margin: 1px 2px 1px 0; }
.acc-table tr.acc-off td { opacity: .55; }
.acc-table tfoot td { padding-top: 10px; border-top: 2px solid var(--line); font-weight: 600; }
.acc-table .acc-file a { font-size: 16px; text-decoration: none; }
.badge.acc-src { background: var(--surface-2); color: var(--text-2); }
.acc-filter-note { padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); font-size: 14px; color: var(--warn); }

/* Trimestre */
.tax-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; margin-bottom: 18px; }
.tax-card { margin-bottom: 0; }
.tax-card.is-filed { border-color: var(--ok-line); }
.tax-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.tax-head h2 { margin: 0; }
.tax-head h2 small { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.tax-result { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.tax-result span { font-size: 13px; color: var(--muted); }
.tax-result strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.tax-boxes td { padding: 6px; font-size: 13px; }
.tax-box { width: 48px; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; color: var(--muted); }
.tax-boxes tr.tax-total td { border-top: 2px solid var(--line); font-weight: 700; }
.tax-copy { margin-left: 6px; opacity: .45; transition: opacity .15s ease; }
.tax-boxes tr:hover .tax-copy, .tax-copy:focus-visible { opacity: 1; }
.tax-notes p { margin: 8px 0 0; }
.tax-notes .tone-warn { color: var(--warn); }
.tax-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.acc-package .inline { margin-top: 6px; }
.acc-year td.num small { display: block; }

/* Un apunte (con su factura al lado) */
.acc-entry { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.acc-form .acc-kind { margin-bottom: 14px; }
.acc-breakdown { display: flex; flex-wrap: wrap; gap: 18px; padding: 8px 0 2px; font-variant-numeric: tabular-nums; }
.acc-breakdown span { display: flex; flex-direction: column; }
.acc-breakdown small { font-size: 12px; font-weight: 400; color: var(--muted); }
.acc-breakdown strong { font-size: 15px; }
.acc-more { margin: 4px 0 14px; }
.acc-more > summary { cursor: pointer; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.acc-doc { display: block; width: 100%; height: 72vh; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.acc-doc-img { display: block; width: 100%; max-height: 72vh; object-fit: contain; border-radius: 8px; background: var(--surface-2); }
.acc-side > * { margin-bottom: 14px; }
.acc-file-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.acc-attach { margin-top: 8px; }
.acc-attach input[type=file] { max-width: 100%; font-size: 13px; }
.inline-danger-btn { color: var(--bad); }

@media (max-width: 900px) {
  .acc-entry { grid-template-columns: minmax(0, 1fr); }
  .acc-doc { height: 60vh; min-height: 320px; }
}
@media (max-width: 700px) {
  .inbox-card { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .inbox-thumb { width: 52px; height: 64px; }
  .inbox-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; min-width: 0; }
  .acc-hbars li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .acc-hbar-track { grid-column: 1 / -1; grid-row: 2; }
  .tax-grid { grid-template-columns: minmax(0, 1fr); }
  /* En el móvil los menús desplegables salen abajo, como una hoja, para que no se corten dentro de las tablas. */
  .popover[open] > .popover-box { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 75vh; overflow: auto; z-index: 80; }
}
.acc-cats input:not([type=checkbox]) { margin: 0 !important; }
.acc-cats td:first-child { min-width: 220px; }
.acc-cats select { margin: 0 !important; }
.acc-tvat td:first-child { min-width: 0; }
.acc-tvat select { min-width: 128px; }
.acc-meter { height: 4px; border-radius: 2px; background: var(--line); margin-top: 4px; overflow: hidden; min-width: 80px; }
.acc-meter span { display: block; height: 100%; background: var(--ok); border-radius: 2px; transition: width .6s ease; }
.acc-meter span.warn { background: var(--warn); }
.acc-meter span.bad { background: var(--bad); }
.acc-table td.num, .tax-boxes td.num, .acc-suppliers td.num { white-space: nowrap; }
.acc-filter select { display: inline-block; width: auto; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-weight: 400; background: var(--surface); color: var(--ink); }
.acc-year-zip { margin: 14px 0 18px !important; }
/* Un desplegable abierto dentro de una tarjeta queda por encima de las tarjetas de al lado. */
.card:has(.popover[open]), .tax-card:focus-within { position: relative; z-index: 30; }
@media (max-width: 700px) {
  /* Gastos e ingresos en el móvil: cada apunte en dos líneas (fecha y quién, con el total a la derecha). */
  .acc-table thead { display: none; }
  .acc-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  .acc-table tbody td { display: block; padding: 0; border: 0; }
  .acc-table tbody td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 12px; color: var(--muted); }
  .acc-table tbody td.acc-who { grid-column: 1; grid-row: 2; min-width: 0; }
  .acc-table tbody td.acc-badges { grid-column: 1 / -1; grid-row: 3; }
  .acc-table tbody td:nth-child(4), .acc-table tbody td:nth-child(5) { display: none; }
  .acc-table tbody td:nth-child(6) { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .acc-table tbody td.acc-file { grid-column: 2; grid-row: 3; text-align: right; }
  .acc-table tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
  .acc-table tfoot td { display: block; border: 0; }
  .acc-table tfoot td:nth-child(2), .acc-table tfoot td:nth-child(3), .acc-table tfoot td:nth-child(5) { display: none; }
}

/* ---------- Socios: categorías, lista a todo lo ancho, modal «Alta de socio» y Mi centro › Alta rápida (v17) ---------- */
.badge.cat-badge { background: color-mix(in srgb, var(--cat) 14%, var(--surface)); color: color-mix(in srgb, var(--cat) 80%, var(--text)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat) 30%, transparent); }
.badge.cat-badge::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cat); margin-right: 5px; vertical-align: 1px; }
.req-mark { color: var(--bad); margin-left: 3px; font-weight: 700; }
.form .label-like { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.form .hint { display: block; font-weight: 400; margin-top: 4px; }
.hint-link { font-weight: 400; color: var(--primary-ink); margin-left: 8px; text-decoration: none; }
.hint-link:hover { text-decoration: underline; }
.cat-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cat-opt { margin: 0 !important; position: relative; }
.cat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .15s ease; }
.cat-opt span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--cat); }
.cat-opt span:hover { border-color: var(--cat); }
.cat-opt input:checked + span { background: var(--cat); border-color: var(--cat); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--cat) 35%, transparent); }
.cat-opt input:checked + span::before { background: var(--surface); }
.cat-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Lista de socios */
.members-toolbar { justify-content: flex-start; }
.members-toolbar .inline-form input[type=search] { min-width: 300px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 999px; font: inherit; background: var(--surface); }
.members-toolbar .inline-form input[type=search]:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.toolbar-gap { flex: 1; }
.table-wrap { overflow-x: auto; }
.members-table td, .members-table th { vertical-align: middle; }
.members-table .col-check { width: 28px; padding-right: 0; }
.members-table .col-check input { width: 16px; height: 16px; cursor: pointer; }
.members-table tr.is-picked td { background: var(--warn-bg); }
.col-picker .popover-box label.check { display: flex; gap: 8px; align-items: center; margin: 4px 0; font-weight: 400; }
.bulk-bar { position: sticky; bottom: 12px; z-index: 15; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 14px; background: var(--brand); color: #fff; border-radius: 12px; box-shadow: 0 12px 30px rgba(17,24,39,.25); animation: fadeSlide .2s ease-out; }
.bulk-bar select, .bulk-bar input[type=date] { padding: 6px 10px; border-radius: 8px; border: 0; font: inherit; }
.bulk-bar .bulk-sep { padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); }
.bulk-bar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }

/* Modal */
dialog.modal { padding: 0; border: 0; border-radius: 14px; width: min(1040px, calc(100vw - 32px)); height: min(860px, calc(100vh - 32px)); max-height: calc(100vh - 32px); background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px rgba(17,24,39,.35); overflow: hidden; }
dialog.modal[open] { display: flex; animation: modalIn .22s ease-out; }
dialog.modal::backdrop { background: rgba(17,24,39,.55); backdrop-filter: blur(2px); animation: fadeIn .2s ease-out; }
body.modal-open { overflow: hidden; }
.modal-form { display: flex; flex-direction: column; width: 100%; height: 100%; margin: 0; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-x { margin-left: auto; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--muted); width: 34px; height: 34px; border-radius: 8px; }
.modal-x:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 16px 20px 6px; overflow: auto; flex: 1; }
.modal-body .folder { margin-bottom: 8px; }
.modal-body .folder-panel { min-height: 300px; }
.modal-foot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 12px 20px; background: var(--card); border-top: 1px solid var(--line); }
.modal-foot > span { margin-right: auto; }
.mf-quick { column-count: 2; column-gap: 24px; }
.mf-quick .mf-section { break-inside: avoid; margin-bottom: 6px; }
.mf-cols.one { max-width: 640px; }
.form fieldset.mf-section { margin-top: 4px; }
.quote-box.loading { opacity: .5; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Mi centro › Categorías de socio */
.cat-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cat-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 150px auto; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: box-shadow .15s ease; }
.cat-row > * { min-width: 0; }
.cat-row:hover { box-shadow: 0 4px 14px rgba(17,24,39,.06); }
.cat-edit { display: flex; gap: 8px; align-items: center; margin: 0; }
.cat-edit input[type=color] { width: 36px; height: 32px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); cursor: pointer; flex-shrink: 0; }
.cat-edit input[name=name] { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; }
.cat-count { text-decoration: none; font-size: 13px; color: var(--muted); }
.cat-count strong { color: var(--ink); font-size: 15px; }
.cat-tools { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.cat-tools .popover-box { left: auto; right: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cat-swatch { margin: 0 !important; position: relative; padding: 0 !important; background: none !important; }
.cat-swatch input { position: absolute; opacity: 0; left: 0; top: 0; width: 1px; height: 1px; margin: 0; }
.cat-swatch span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--cat); cursor: pointer; transition: transform .15s ease; }
.cat-swatch input:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--cat); transform: scale(1.05); }

/* Mi centro › Alta rápida: cada campo se marca en verde (se pide) o rojo (no se pide); ★ = obligatorio */
.sf { position: relative; border: 2px solid var(--bad-line); background: var(--bad-bg); border-radius: 10px; padding: 10px 12px 10px; margin-bottom: 14px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .12s ease; user-select: none; }
.sf:hover { transform: translateY(-1px); }
.sf:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sf .sf-body { pointer-events: none; opacity: .55; transition: opacity .18s ease; }
.sf .sf-body label, .sf .sf-body .label-like { margin-bottom: 4px; }
.sf[data-state=proposed], .sf[data-state=required] { border-color: var(--ok-line); background: var(--ok-bg); }
.sf[data-state=proposed] .sf-body, .sf[data-state=required] .sf-body { opacity: 1; }
.sf[data-state=required] { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.sf.sf-lock { cursor: default; border-color: var(--ok-line); background: var(--ok-bg); }
.sf.sf-lock:hover { transform: none; }
.sf-tag { position: absolute; top: -10px; left: 10px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--bad); color: #fff; }
.sf .sf-on { display: none; }
.sf[data-state=proposed] .sf-tag, .sf[data-state=required] .sf-tag, .sf.sf-lock .sf-tag { background: var(--ok); }
.sf[data-state=proposed] .sf-on, .sf[data-state=required] .sf-on { display: inline; }
.sf[data-state=proposed] .sf-off, .sf[data-state=required] .sf-off { display: none; }
.sf-req { position: absolute; bottom: -11px; right: 10px; font: inherit; font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); cursor: pointer; transition: all .15s ease; }
.sf-req:hover { border-color: var(--warn); color: var(--warn); }
.sf-req[aria-pressed=true] { background: var(--warn); border-color: var(--warn); color: #fff; }
.sf .row-2, .sf .row-3 { gap: 8px; }
.row-2 > .sf, .row-3 > .sf { margin-bottom: 14px; }
.sf-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13px; }
.sf-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.sf-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.sf-summary .badge { font-weight: 600; }
.sf-preview .mf-section { break-inside: avoid; }
.sticky-save { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; align-items: center; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }

@media (max-width: 760px) {
  .mf-quick { column-count: 1; }
  dialog.modal { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .modal-form { max-height: 100vh; }
  .modal-body { padding: 12px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot > span { width: 100%; }
  dialog.modal { max-width: 100vw; margin: 0; }
  .cat-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cat-edit { grid-column: 1 / -1; }
  .sidebar .nav-sep { flex-basis: 100%; }
  .members-toolbar .inline-form input[type=search] { min-width: 0; width: 100%; }
  .members-toolbar .inline-form { width: 100%; }
}
/* Separador «Módulos» del menú del CRM: lo que se contrata aparte, cada uno con su sección. */
.sidebar .nav-sep { margin: 14px 10px 4px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Socios: filtros, grupos guardados y detectados (v18) ---------- */
.mf-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mf-quick-btn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13.5px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; transition: all .15s ease; list-style: none; }
.mf-quick-btn::-webkit-details-marker { display: none; }
.mf-quick-btn span { color: var(--muted); font-size: 11px; }
.mf-quick-btn:hover { border-color: var(--muted); background: var(--soft); }
.mf-quick-btn.on { border-color: var(--primary-ink); box-shadow: inset 0 0 0 1px var(--primary-ink); font-weight: 600; }
.mf-quick-btn.mf-add { border-style: dashed; color: var(--muted); }
.mf-groups .popover-box { width: 260px; display: flex; flex-direction: column; gap: 2px; }
.mf-group-link { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.mf-group-link:hover { background: var(--surface-2); }
.mf-group-link i { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mf-active { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin: -4px 0 12px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); animation: fadeSlide .2s ease-out; }
.mf-chip { display: inline-flex; align-items: stretch; background: var(--deep); color: var(--on-deep); border-radius: 999px; font-size: 13px; overflow: hidden; }
.mf-chip button { background: none; border: 0; color: inherit; font: inherit; padding: 5px 4px 5px 12px; cursor: pointer; }
.mf-chip a { color: inherit; opacity: .75; text-decoration: none; padding: 5px 10px 5px 6px; }
.mf-chip a:hover, .mf-chip button:hover { color: var(--primary); text-decoration: underline; }
.mf-seg { font-weight: 700; color: color-mix(in srgb, var(--cat) 80%, var(--text)); padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--cat) 14%, var(--surface)); }
.mf-match select { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-2); font: inherit; font-size: 13px; }
.mf-editor { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(17,24,39,.18); padding: 14px; display: flex; flex-direction: column; gap: 10px; animation: fadeSlide .18s ease-out; }
.mf-editor select, .mf-editor input[type=text], .mf-editor input[type=number], .mf-editor input[type=date], .mf-editor input[type=search] { font: inherit; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 8px; max-width: 100%; }
.mf-editor .mf-ed-head select { width: 100%; font-weight: 600; }
.mf-ed-body { display: flex; flex-direction: column; gap: 8px; }
.mf-val { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mf-val input[type=number] { width: 110px; }
.mf-val:empty { display: none; }
.mf-list { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 2px; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.mf-list label.check { font-weight: 400; margin: 0; padding: 3px 0; }
.mf-find { width: 100%; }
.mf-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mf-preset { border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 10px; font: inherit; font-weight: 600; cursor: pointer; transition: all .15s ease; }
.mf-preset:hover { border-color: var(--primary); }
.mf-preset.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.mf-or { margin: 0; }
.mf-ed-foot { display: flex; gap: 6px; flex-wrap: wrap; }
.mf-ed-head { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.mf-back { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.mf-back:hover { color: var(--primary-ink); text-decoration: underline; }
.mf-secs { display: flex; flex-direction: column; gap: 4px; max-height: min(56vh, 430px); overflow: auto; margin: 0 -4px; padding: 0 4px; }
.mf-sec { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .15s ease; }
.mf-sec.open { border-color: var(--line-2); background: var(--soft); }
.mf-sec-btn { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 9px 10px; font: inherit; font-weight: 600; text-align: left; cursor: pointer; color: var(--ink); border-radius: 10px; }
.mf-sec-btn:hover { background: var(--surface-2); }
.mf-sec-name { flex: 1; }
.mf-sec-n { font-size: 11.5px; font-weight: 500; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }
.mf-sec-n.on { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); color: var(--primary-ink); }
.mf-sec-arrow { color: var(--muted); font-size: 11px; transition: transform .15s ease; }
.mf-sec.open .mf-sec-arrow { transform: rotate(90deg); }
.mf-sec-list { display: flex; flex-direction: column; padding: 0 6px 6px; animation: fadeSlide .15s ease-out; }
.mf-field { background: none; border: 0; text-align: left; font: inherit; font-size: 13.5px; padding: 6px 8px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.mf-field:hover, .mf-field:focus-visible { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary-ink); outline: none; }
.mf-field.used::after { content: ' ●'; color: var(--primary-ink); font-size: 10px; }
.mf-none { margin: 4px 0 0; }
.mf-editor.shake { animation: mfShake .35s; }
@keyframes mfShake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.grp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 26px; }
.grp-grid.compact { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grp-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--radius); transition: transform .15s ease, box-shadow .15s ease; }
.grp-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(17,24,39,.08); }
.grp-card.is-bad { border-left-color: var(--bad); }
.grp-card.is-warn { border-left-color: var(--warn); }
.grp-card.is-ok { border-left-color: var(--ok); }
.grp-card.is-cat { border-left-color: var(--cat); }
.grp-main { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.grp-n { font-size: 26px; font-weight: 800; line-height: 1; }
.grp-card.is-bad .grp-n { color: var(--bad); }
.grp-card.is-ok .grp-n { color: var(--ok); }
.grp-title { font-weight: 600; }
.grp-hint { font-size: 12.5px; color: var(--muted); }
.grp-grid.compact .grp-n { font-size: 20px; }
.grp-del { position: absolute; top: 6px; right: 6px; }
@media (max-width: 700px) {
  .mf-active { margin-top: 0; }
  .grp-grid, .grp-grid.compact { grid-template-columns: 1fr 1fr; }
}
.import-mode { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; max-width: 620px; display: flex; flex-direction: column; gap: 8px; }
.import-mode legend { font-weight: 600; padding: 0 6px; }
.import-mode label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 0; }
.import-data { border-top: 1px solid var(--line); padding: 8px 0; }
.import-data summary { cursor: pointer; }
.import-data .kv { margin: 8px 0 0; }
/* Historial de Trainingym en la ficha y paso a Kirigym (24-10-2026) */
.month-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.month-bar { display: grid; grid-template-columns: 110px 1fr 28px; gap: 8px; align-items: center; }
.month-bar .bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.month-bar .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.month-bar strong { text-align: right; }
.pack-log { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); white-space: normal; max-width: 320px; }
.pack-log div { padding: 2px 0; }
.cut-form .table input[type=number] { padding: 4px 6px; }

/* Estado deducido del historial de Trainingym (v20) */
.ext-state { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
/* Cupón al contratar (ficha y alta) */
.coupon-msg { margin: -4px 0 4px; padding: 6px 10px; border-radius: 8px; }
.coupon-msg.ok { background: var(--ok-bg); color: var(--ok); }
.coupon-msg.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- Clases: gestión cómoda en el móvil (filtro por actividad, días, selección de varias y arrastrar) ---------- */
.week-nav, .tb-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cls-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.cls-chips .chip .tab-dot { margin: 0; }
.day-empty { text-align: center; margin: 10px 0; }
.day-strip { display: none; }
.week-day.enter { animation: fadeSlide .22s ease-out both; }
.class-block, .slot-row { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.is-filtered, .sg-row.no-match { display: none !important; }
.slot-row { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.slot-row:hover { box-shadow: 0 4px 12px rgba(17,24,39,.08); }
.slot-row:focus-visible { outline: 2px solid var(--primary-ink); outline-offset: 1px; }
.slot-row .sr-time { min-width: 44px; }
.slot-row .sr-main { flex: 1; min-width: 0; }
.slot-row .sr-main small { display: block; font-size: 12px; }
.sr-grip { color: var(--line-2); font-size: 12px; letter-spacing: -2px; cursor: grab; display: none; }
@media (pointer: fine) { .sr-grip { display: inline; } }
.slot-row.is-dragging { opacity: .4; }
/* Horario semanal en rejilla: una fila por hora para toda la semana; huecos largos en una fila estrecha. */
.slot-grid-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; }
.slot-grid { display: flex; flex-direction: column; gap: 6px; }
.slot-grid .slot-row { display: block; position: relative; padding-right: 18px; }
.slot-grid .slot-row .sr-time { display: block; min-width: 0; font-size: 12.5px; line-height: 1.2; }
.slot-grid .slot-row .sr-main { display: block; font-weight: 600; line-height: 1.25; }
.slot-grid .slot-row .sr-main small { font-weight: 400; }
.slot-grid .slot-row .sr-grip { position: absolute; right: 6px; top: 8px; }
.sg-row { display: grid; grid-template-columns: var(--cols); gap: 8px; align-items: stretch; }
.sg-head { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 2px 0 4px; }
.sg-day { margin: 0; font-size: 14px; padding: 4px; border-radius: 8px; }
.sg-time { font-weight: 700; font-size: 13px; color: var(--muted); padding-top: 9px; font-variant-numeric: tabular-nums; position: sticky; left: 0; z-index: 1; background: var(--surface); }
.sg-cell { min-height: 48px; border-radius: 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; transition: background .15s ease, box-shadow .15s ease; }
.sg-cell.is-empty { background: color-mix(in srgb, var(--surface-2) 45%, transparent); border: 1px dashed var(--line); }
.sg-cell .slot-row { margin-bottom: 0; flex: 1; }
.sg-empty .sg-cell { min-height: 34px; }
.sg-gap { align-items: center; }
.sg-gap .sg-time { padding-top: 0; }
.sg-gap-label { grid-column: 2 / -1; text-align: left; font-size: 12.5px; color: var(--muted); padding: 5px 8px; border-radius: 8px; border: 1px dashed var(--line); background: repeating-linear-gradient(135deg, transparent 0 8px, var(--surface-2) 8px 16px); }
.sg-day.drop-on, .sg-cell.drop-on { background: color-mix(in srgb, var(--gym, var(--primary-ink)) 12%, var(--surface)); box-shadow: inset 0 0 0 2px var(--gym, var(--primary-ink)); }
/* Modo selección: cada clase lleva su círculo; las elegidas, marcadas. */
.selecting [data-sel-id] { position: relative; padding-left: 34px; }
.selecting [data-sel-id]::before { content: ''; position: absolute; left: 9px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2px solid var(--muted); background: var(--surface); transition: all .12s ease; }
.selecting [data-sel-id].is-picked { background: color-mix(in srgb, var(--c, var(--primary-ink)) 10%, var(--surface)); border-color: var(--c, var(--primary-ink)); }
.selecting [data-sel-id].is-picked::before { border-color: var(--c, var(--primary-ink)); background: var(--c, var(--primary-ink)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.selecting .class-block:hover, .selecting .slot-row:hover { transform: none; }
.selecting [data-sel-group] { cursor: pointer; color: var(--ink); text-decoration: underline dotted; text-underline-offset: 3px; }
.sel-bar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 8px; border-radius: 14px; background: var(--brand); color: #fff; box-shadow: 0 14px 40px rgba(17,24,39,.35); animation: popIn .2s ease-out; max-width: calc(100vw - 20px); }
.sel-bar[hidden] { display: none; }
.sel-bar .sel-count { font-weight: 600; white-space: nowrap; margin-right: 4px; }
.sel-bar .btn.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.sel-bar .btn[disabled] { opacity: .45; }
.sel-x { border: 0; background: rgba(255,255,255,.12); color: #fff; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; flex-shrink: 0; }
body.has-sel-bar .content { padding-bottom: 90px; }
/* Actividades en tarjetas */
.act-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.act-card { --c: var(--primary); display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: var(--radius); animation: fadeSlide .25s ease-out both; }
.act-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 10px 12px; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.act-main strong { font-size: 15px; }
.act-main small { font-size: 12.5px; }
.act-tools { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px; border-left: 1px solid var(--line); }
.act-del { color: var(--bad) !important; }
.act-card.dim { opacity: .65; }
.impact-list { margin: 0 0 12px; padding-left: 20px; }
.impact-list li { margin-bottom: 4px; }
/* Ventanas pequeñas (una sola cosa que rellenar): altura según su contenido; en el móvil suben desde abajo. */
dialog.modal.modal-sm { width: min(560px, calc(100vw - 32px)); height: auto; }
dialog.modal.modal-sm .modal-body { flex: 0 1 auto; }
.seg-choice.stack { flex-direction: column; }
.seg-choice.stack span { display: block; border-radius: 10px; padding: 9px 12px; }
.seg-choice input[type=radio] + span { cursor: pointer; }
@media (max-width: 900px) {
  .day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; position: sticky; top: 60px; z-index: 5; background: var(--card); padding: 6px 0 8px; margin: 0 0 6px; }
  .ds-day { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 5px 0 4px; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.1; position: relative; }
  .ds-day small { font-size: 11px; color: var(--muted); }
  .ds-day strong { font-size: 17px; }
  .ds-day i { font-style: normal; font-size: 10px; color: var(--muted); min-height: 12px; }
  .ds-day.is-today { border-color: var(--gym, var(--primary-ink)); }
  .ds-day.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
  .ds-day.on small, .ds-day.on i { color: inherit; opacity: .75; }
  .week-day { display: none; background: transparent; border: 0; padding: 0; box-shadow: none !important; }
  .week-day.is-shown { display: block; }
  .week-day.is-past { opacity: 1; }
  .week-day .week-head { font-size: 15px; }
  .class-block { padding: 10px 12px; font-size: 15px; }
  .class-block strong { font-size: 16px; }
  .cls-chips { flex-wrap: nowrap; overflow-x: auto; margin-left: -4px; margin-right: -4px; padding: 0 4px 2px; scrollbar-width: none; }
  .cls-chips .chip { flex-shrink: 0; padding: 6px 12px; }
  .slot-row { padding: 8px 10px; font-size: 14px; }
  .act-list { grid-template-columns: 1fr; }
  .sel-bar { left: 10px; right: 10px; transform: none; justify-content: flex-end; }
  .sel-bar .sel-count { margin-right: auto; }
}
@media (max-width: 760px) {
  dialog.modal.modal-sm { position: fixed; inset: auto 0 0 0; width: 100vw; max-width: 100vw; height: auto; max-height: 92vh; margin: 0; border-radius: 16px 16px 0 0; }
  dialog.modal.modal-sm[open] { animation: sheetIn .24s ease-out; }
  dialog.modal.modal-sm .modal-foot { flex-wrap: nowrap; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  dialog.modal.modal-sm .modal-foot > span { width: auto; }
}
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Menú lateral en el móvil: barra arriba con botón ☰ (el menú se despliega al pulsarlo) ---------- */
.nav-burger { display: none; }
@media (max-width: 900px) {
  .sidebar { position: sticky; top: 0; z-index: 40; padding: 10px 12px; max-height: 100vh; overflow-y: auto; }
  .sidebar .brand { padding: 0; min-height: 40px; }
  .nav-burger { display: inline-flex; margin-left: auto; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #fff; font-size: 20px; cursor: pointer; }
  .sidebar:not(.is-open) nav, .sidebar:not(.is-open) .sidebar-foot { display: none; }
  .sidebar.is-open nav { flex-direction: column; flex-wrap: nowrap; flex-shrink: 0; margin-top: 12px; animation: fadeSlide .2s ease-out; }
  .sidebar.is-open .sidebar-foot { flex-shrink: 0; }
}
.form .color-pick input[type=radio] { display: inline-block; width: 30px; height: 30px; padding: 0; margin: 0; border: 3px solid var(--surface); border-radius: 50%; background: var(--c); }
.site-pick { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.site-pick .chip { text-decoration: none; color: inherit; flex-shrink: 0; padding: 6px 12px; }
.site-pick .chip.on { color: #fff; }
.publish-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 12px; border-radius: var(--radius); background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info); font-size: 14px; }
.publish-note form { margin: 0; }
.btn-noshow { color: var(--bad); border-color: var(--bad-line); }
tr.row-noshow td { background: var(--bad-bg); }
.miss-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.miss-list li { padding: 10px 12px; border: 1px solid var(--line, var(--line)); border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
@media (max-width: 640px) {
  .attend-table th:nth-child(3), .attend-table td:nth-child(3) { display: none; }
  .attend-table td:first-child { width: 44px !important; padding-right: 0; }
  .attend-table .btn-small { padding: 8px 12px; }
}
.att-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.att-list li { padding: 12px 14px; border: 1px solid var(--line, var(--line)); border-radius: var(--radius); }
.att-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.att-list .cb-bar { display: block; width: 100%; }
.att-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; color: var(--muted, var(--muted)); }
.camp-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.camp-card { border: 1px solid var(--line, var(--line)); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.camp-card.dim { opacity: .7; }
.camp-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.camp-reach { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok); font-size: 14px; }
.camp-reach.zero { background: var(--bad-bg); color: var(--bad); }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 4px; }
.var-chips .chip { font-family: ui-monospace, monospace; font-size: 12px; }
.notify-box { margin: 8px 0; padding: 10px 12px; border-radius: var(--radius); background: var(--soft); border: 1px solid var(--line, var(--line)); }
.notify-box p { margin: 4px 0 0 26px; }

/* ===================================================================================================
   Kirigym v29 (27-10-2026): la marca nueva sobre todo el panel. Letra Archivo (títulos y cifras) y Hanken Grotesk
   (texto); menú oscuro con cada módulo en su color; pliegos con la esquina doblada; pestañas de archivador con filo
   del color de marca; fondo de pliegues a 45°; la «solapa» al aparecer. Va al final para mandar sobre lo de arriba.
   =================================================================================================== */
body { font-family: var(--body); font-size: 15px; line-height: 1.5; color: var(--text);
  background: var(--bg) repeating-linear-gradient(135deg, transparent 0 26px, color-mix(in srgb, var(--text) 3.5%, transparent) 26px 27px) fixed; }
a { color: inherit; }
.content a:not(.btn):not([role=tab]):not(.chip):not(.master-tile):not(.mf-group-link):not(.grp-main):not(.class-block):not(.cat-count) { text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; }
h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; font-stretch: 118%; letter-spacing: -.01em; line-height: 1.05; }
h2 { font-size: 17px; font-weight: 700; font-stretch: 110%; letter-spacing: 0; }
h3 { font-weight: 700; font-stretch: 105%; }
.eyebrow, .panel-h { font-family: var(--display); font-stretch: 90%; font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.k-num, .stat strong, .summary-box strong, .grp-n, .inbox-total, .tax-result strong, .code-big, .week-head strong, .ds-day strong {
  font-family: var(--display); font-stretch: 75%; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0; }
::selection { background: color-mix(in srgb, var(--primary) 40%, transparent); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- Menú lateral ---- */
.sidebar { width: 248px; background: var(--deep); color: var(--on-deep); padding: 16px 12px 14px; border-right: 1px solid color-mix(in srgb, var(--on-deep) 6%, transparent); }
.brand { flex-direction: column; align-items: stretch; gap: 12px; padding: 2px 6px 14px; }
.k-logo { display: block; height: 30px; width: auto; max-width: 150px; margin-left: -6px; }
.k-logo-ambar, [data-kt^="ambar"] .k-logo-turquesa { display: none; }
[data-kt^="ambar"] .k-logo-ambar { display: block; }
.k-gym { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); background: color-mix(in srgb, var(--on-deep) 6%, transparent); min-width: 0; }
.k-gym > div { min-width: 0; }
.k-gym strong { display: block; color: var(--on-deep); font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-gym small { display: block; color: color-mix(in srgb, var(--on-deep) 55%, transparent); font-size: 12px; }
.k-gym .brand-logo { width: 30px; height: 30px; border-radius: var(--r); }
.brand-dot { background: var(--primary); }
.brand-row { display: flex; align-items: center; gap: 10px; }
.sidebar nav { gap: 1px; }
.sidebar nav a, .nav-group > summary { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r); text-decoration: none; font-size: 14px; font-weight: 500;
  color: color-mix(in srgb, var(--on-deep) 74%, transparent); letter-spacing: 0; text-transform: none; }
.sidebar nav a svg { opacity: .8; flex-shrink: 0; }
.sidebar nav a:hover, .nav-group > summary:hover { background: color-mix(in srgb, var(--on-deep) 7%, transparent); color: var(--on-deep); }
.sidebar nav a.active, .area-panel .sidebar nav a.active { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--on-deep); box-shadow: inset 3px 0 0 var(--primary); }
.sidebar nav a.active svg { opacity: 1; color: var(--primary); }
.nav-group[data-current] > summary { color: var(--on-deep); }
.nav-group-items { margin: 1px 0 6px 15px; padding-left: 8px; border-left: 1px solid color-mix(in srgb, var(--on-deep) 12%, transparent); gap: 1px; }
.nav-group-items a { font-size: 13.5px; padding: 7px 10px; }
.nav-group > summary::after { opacity: .5; }
/* Triángulo de papel del color del módulo (manual: iconos de módulo) */
.k-tri { width: 11px; height: 11px; flex-shrink: 0; background: var(--c, var(--on-deep)); clip-path: polygon(0 0, 100% 0, 0 100%); margin: 0 4px 0 3px; }
.sidebar .nav-sep { margin: 16px 10px 4px; padding: 0; border: 0; font-family: var(--display); font-stretch: 90%; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: color-mix(in srgb, var(--on-deep) 45%, transparent); }
.sidebar nav > .nav-sep:first-child { margin-top: 2px; }
.sidebar-foot { border-top: 1px solid color-mix(in srgb, var(--on-deep) 10%, transparent); padding: 12px 6px 0; font-size: 13px; display: grid; gap: 8px; }
.sidebar-foot .who { color: var(--on-deep); font-weight: 600; line-height: 1.25; }
.sidebar-foot .who small { color: color-mix(in srgb, var(--on-deep) 55%, transparent); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .foot-links { display: flex; gap: 12px; flex-wrap: wrap; }
.sidebar-foot .foot-links a { color: color-mix(in srgb, var(--on-deep) 70%, transparent); text-decoration: none; }
.sidebar-foot .foot-links a:hover { color: var(--primary); }
.sidebar-foot .logout { margin: 0; color: color-mix(in srgb, var(--on-deep) 70%, transparent); }
.sidebar-foot .env { color: color-mix(in srgb, var(--on-deep) 35%, transparent); font-size: 11px; }
/* Claro / oscuro / automático (cada persona) */
.k-mode { display: inline-flex; padding: 2px; gap: 2px; border-radius: 999px; background: color-mix(in srgb, var(--on-deep) 8%, transparent); width: max-content; }
.k-mode button { border: 0; background: transparent; color: color-mix(in srgb, var(--on-deep) 65%, transparent); font: 600 12px var(--body); padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.k-mode button:hover { color: var(--on-deep); }
.k-mode button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.nav-burger { border-color: color-mix(in srgb, var(--on-deep) 20%, transparent); color: var(--on-deep); }
.impersonation { background: var(--warn-bg); color: var(--text); border-bottom: 2px solid var(--warn); }
.impersonation a { color: var(--primary-ink); font-weight: 600; }

/* ---- Cabecera de la página ---- */
.content { padding: 22px 30px 56px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin-top: 2px; }
.crumbs { font-size: 12.5px; }
.crumbs .sep { color: var(--line-2); }
.demo-banner { border-radius: var(--r); background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--text); border-left: 4px solid var(--warn); }

/* ---- Botones (manual: principal con la esquina doblada) ---- */
.btn { border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 14px/1.2 var(--body); padding: 9px 15px; }
.btn:hover { background: var(--surface-2); }
.btn-primary, .area-panel .btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--text)); box-shadow: none; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-primary.btn-small { clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%); }
.icon-btn { background: var(--surface); border-color: var(--line); color: var(--text-2); border-radius: var(--r); }
.link-btn, .hint-link { color: var(--primary-ink); }

/* ---- Campos ---- */
.form label, .form .label-like, .acc-toolbar .inline-label { color: var(--text-2); }
.form input:not([type=checkbox]):not([type=radio]):not([type=color]), .form select, .form textarea, .toolbar select, .toolbar input, .acc-filter select,
.members-toolbar .inline-form input[type=search], .lf-search input, .mf-editor select, .mf-editor input, .cat-edit input[name=name], .mf-match select {
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); }
.lf-search input, .members-toolbar .inline-form input[type=search], .form .lf-search input { border-radius: 999px !important; }
.form input:focus, .form select:focus, .form textarea:focus, .lf-search input:focus, .toolbar input[type=search]:focus, .members-toolbar .inline-form input[type=search]:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary-ink); }
.form fieldset, fieldset.opts { border-color: var(--line); border-radius: var(--r); }

/* ---- Tarjetas = pliegos: filo de color y esquina doblada ---- */
.card { position: relative; border-radius: var(--r); border-color: var(--line); background: var(--surface); }
.card::after, .stat::after, .k-pliego::after { content: ""; position: absolute; top: -1px; right: -1px; width: 16px; height: 16px; pointer-events: none;
  background: linear-gradient(225deg, var(--bg) 50%, color-mix(in srgb, var(--c, var(--primary)) 50%, var(--surface)) 50%); border-top-right-radius: 2px; }
.card h2 { font-size: 17px; }
.stats { gap: 12px; }
.stat, .k-pliego { position: relative; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--c, var(--primary)); border-radius: var(--r); padding: 13px 16px 14px; }
.stat span, .k-pliego .l { font-size: 13px; color: var(--muted); }
.stat strong { font-size: 32px; line-height: 1; margin-top: 6px; }
.stat small { color: var(--muted); }
a.stat { text-decoration: none; color: inherit; }
.stat:hover, .summary-box:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--text) 10%, transparent); }
.summary-box { border-radius: var(--r); background: var(--soft); }
.summary-box strong { font-size: 22px; }
.license-banner { position: relative; border-radius: var(--r); background: var(--surface); }
.side-box { background: var(--soft); border-radius: var(--r); }
.popover-box, .mf-editor, .acc-tip { background: var(--surface); border-radius: var(--r); box-shadow: 0 14px 34px color-mix(in srgb, #000 22%, transparent); }

/* ---- Tablas ---- */
.table th { font-size: 11.5px; letter-spacing: .07em; color: var(--muted); border-bottom-color: var(--line); }
.table td { border-bottom-color: var(--line); }
.table tbody tr:hover { background: var(--soft); }

/* ---- Etiquetas y avisos ---- */
.badge { background: var(--surface-2); color: var(--text-2); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.alert { border: 0; border-left: 4px solid var(--c, var(--info)); border-radius: 0 var(--r) var(--r) 0; background: color-mix(in srgb, var(--c, var(--info)) 11%, var(--surface)); color: var(--text); }
.alert-success { --c: var(--ok); } .alert-error { --c: var(--bad); } .alert-info { --c: var(--info); } .alert-warn, .alert-warning { --c: var(--warn); }
.dot-on { background: var(--ok); } .dot-off { background: var(--muted); }

/* ---- Pestañas de archivador: la activa se levanta con el filo de la marca ---- */
.folder-tabs a { border-radius: var(--r) var(--r) 0 0; background: var(--surface-2); color: var(--text-2); clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); padding: 10px 20px 9px 16px; }
.folder-tabs a:hover { background: var(--soft); color: var(--text); }
.folder-tabs a.active { background: var(--surface); color: var(--text); box-shadow: inset 0 3px 0 var(--primary); }
.folder-panel { border-radius: 0 var(--r) var(--r) var(--r); box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 5%, transparent); }
.tab-count { background: var(--surface-2); color: var(--text-2); }
.folder-tabs a.active .tab-count:not(.warn):not(.ok):not(.bad) { background: color-mix(in srgb, var(--primary) 22%, var(--surface)); color: var(--text); }
.tab-add-btn { border-radius: var(--r) var(--r) 0 0; border-color: var(--line-2); }
.seg { background: var(--surface-2); }
.seg a { color: var(--text-2); }
.seg a.on { background: var(--surface); color: var(--text); }
.chip { background: var(--surface); border-color: var(--line-2); color: var(--text); }

/* ---- Ventanas ---- */
dialog.modal { border-radius: 8px; }
dialog.modal::backdrop { background: color-mix(in srgb, #0B0F17 60%, transparent); }
.modal-head h2 { font-size: 19px; }

/* ---- Barras flotantes y avisos de abajo ---- */
.bulk-bar, .sel-bar, .inbox-toast { background: var(--deep); color: var(--on-deep); border: 1px solid color-mix(in srgb, var(--on-deep) 12%, transparent); }
.bulk-bar, .sel-bar { border-radius: var(--r); }
.inbox-toast a { color: var(--primary); }

/* ---- La solapa: lo nuevo se abre desde su borde (0,5 s) ---- */
@keyframes solapa { from { transform: perspective(700px) rotateX(-80deg); opacity: .15; } to { transform: none; opacity: 1; } }
.stats > .stat, .k-pliegos > * { animation: solapa var(--solapa) both; transform-origin: 50% 0; }
.stats > .stat:nth-child(2), .k-pliegos > :nth-child(2) { animation-delay: 60ms; }
.stats > .stat:nth-child(3), .k-pliegos > :nth-child(3) { animation-delay: 120ms; }
.stats > .stat:nth-child(4), .k-pliegos > :nth-child(4) { animation-delay: 180ms; }
.stats > .stat:nth-child(n+5), .k-pliegos > :nth-child(n+5) { animation-delay: 240ms; }

/* ---- Acceso (login) y páginas sueltas ---- */
.auth-page { background: var(--bg) repeating-linear-gradient(135deg, transparent 0 26px, color-mix(in srgb, var(--text) 4%, transparent) 26px 27px); color: var(--text); }
.auth-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 20px 50px color-mix(in srgb, var(--text) 10%, transparent); }
.auth-card::after { content: ""; position: absolute; top: -1px; right: -1px; width: 22px; height: 22px; background: linear-gradient(225deg, var(--bg) 50%, color-mix(in srgb, var(--primary) 55%, var(--surface)) 50%); }
.auth-brand { color: var(--text); }
.k-login { width: 100%; max-width: 980px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  box-shadow: 0 24px 60px color-mix(in srgb, #000 16%, transparent); animation: solapa .6s cubic-bezier(.25,.9,.3,1) both; transform-origin: 50% 0; }
.k-login-side { position: relative; overflow: hidden; background: var(--deep); color: var(--on-deep); padding: 36px 34px; display: flex; flex-direction: column; gap: 18px; min-height: 460px; }
.k-login-side .k-logo { height: 40px; max-width: 200px; margin-left: -8px; }
.k-login-side h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 900; font-stretch: 125%; letter-spacing: -.02em; line-height: 1; margin: auto 0 0; max-width: 9ch; position: relative; }
.k-login-side p { margin: 0; color: color-mix(in srgb, var(--on-deep) 70%, transparent); max-width: 34ch; position: relative; }
/* La k de papel (kirigym_paper_k): tallo en el color de marca, brazo y pierna como pliegues. Turquesa: brazo menta y pierna clara; ámbar: brazo claro y pierna gris. */
/* manual 2.0: la k lleva siempre los tres colores (fuste turquesa, brazo ámbar, pierna roja) en cualquier tema */
.k-paper { --kp-s1: #5ED9DB; --kp-s2: #3CCFD4; --kp-s3: #2FB9C0;
  --kp-a1: #F0A23B; --kp-a2: #F6B65E; --kp-a3: #D98A22;
  --kp-l1: #E5484D; --kp-l2: #C7363C; display: block; overflow: visible; }
.k-paper polygon { stroke-width: .6; stroke-linejoin: round; transform-box: fill-box; animation: kp-fold .5s cubic-bezier(.25,.9,.3,1) both; animation-delay: calc(var(--i) * 70ms + .25s); }
.k-paper .kp-s1 { fill: var(--kp-s1); stroke: var(--kp-s1); } .k-paper .kp-s2 { fill: var(--kp-s2); stroke: var(--kp-s2); } .k-paper .kp-s3 { fill: var(--kp-s3); stroke: var(--kp-s3); }
.k-paper .kp-a1 { fill: var(--kp-a1); stroke: var(--kp-a1); transform-origin: 0 100%; } .k-paper .kp-a2 { fill: var(--kp-a2); stroke: var(--kp-a2); transform-origin: 0 0; } .k-paper .kp-a3 { fill: var(--kp-a3); stroke: var(--kp-a3); transform-origin: 0 0; }
.k-paper .kp-l1 { fill: var(--kp-l1); stroke: var(--kp-l1); transform-origin: 0 0; } .k-paper .kp-l2 { fill: var(--kp-l2); stroke: var(--kp-l2); transform-origin: 100% 0; }
@keyframes kp-fold { from { opacity: 0; transform: perspective(600px) rotateY(-70deg); } to { opacity: 1; transform: none; } }
.k-login-side .k-paper { position: absolute; right: 34px; top: 34px; width: 38%; max-width: 230px; height: auto; }
.k-login-form { padding: 40px 38px; display: flex; flex-direction: column; justify-content: center; }
.k-login-form h1 { font-size: 28px; margin: 0 0 6px; }
.k-login-form .lead { color: var(--muted); margin: 0 0 22px; }
.k-login-form .btn-primary { padding: 12px 16px; font-size: 15px; }
.k-login-foot { margin-top: 18px; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .k-login { grid-template-columns: minmax(0, 1fr); }
  .k-login-side { min-height: 0; padding: 24px 22px 30px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), 0 100%); }
  .k-login-side h2 { margin-top: 26px; font-size: 32px; }
  .k-login-side .k-paper { top: 22px; right: 22px; width: 64px; }
  .k-login-form { padding: 22px 20px 30px; }
}

/* ---- Hoy (resumen del gimnasio) ---- */
.k-hello { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.k-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.k-module { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--primary)); border-radius: 0 var(--r) var(--r) 0; text-decoration: none; color: inherit; }
.k-module strong { font-family: var(--display); font-stretch: 110%; font-weight: 700; }
.k-module span { font-size: 13px; color: var(--muted); }
.k-module.off { opacity: .6; border-left-style: dashed; }

@media (max-width: 900px) {
  .sidebar { width: 100%; padding: 10px 12px; }
  .brand { flex-direction: row; align-items: center; padding: 0; }
  .brand .k-gym { display: none; }
  .sidebar.is-open .brand .k-gym { display: flex; }
  .brand { flex-wrap: wrap; }
  .k-logo { height: 26px; }
  .content { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .stats > .stat, .k-pliegos > *, .k-login, .k-paper polygon { animation: none; } }
/* Mi cuenta › Aspecto */
.k-mode-light { background: var(--surface-2); }
.k-mode-light button { color: var(--text-2); }
.k-mode-light button:hover { color: var(--text); }
.k-themes { display: flex; gap: 12px; flex-wrap: wrap; }
.k-theme { display: flex !important; align-items: center; gap: 10px; margin: 0 !important; padding: 10px 16px 10px 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; font-weight: 600 !important; color: var(--text) !important; }
.k-theme { position: relative; }
.k-theme input { position: absolute; opacity: 0; pointer-events: none; width: 1px !important; height: 1px; margin: 0 !important; }
.k-theme-sw { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.k-theme:has(input:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.k-theme:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Plan único de Kirigym (v30): áreas de un plan y módulos agrupados */
.badge.area-crm, .badge.area-totem { --a: var(--socios); background: color-mix(in srgb, var(--a) 14%, var(--surface)); color: color-mix(in srgb, var(--a) 70%, var(--text)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a) 32%, transparent); }
.badge.area-totem { --a: var(--primary); }
.plan-areas { margin: -4px 0 10px; }
.plan-mods { margin-top: 10px; }
.plan-mods legend { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 13px; }
.k-plan { display: grid; gap: 14px; }
.k-plan-areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.k-plan-area { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.k-plan-area.off { opacity: .6; border-style: dashed; }
.k-plan-area h3 { margin: 0 0 6px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.k-plan-area ul { margin: 0; padding-left: 18px; }
.k-plan-area li.extra::after { content: " · añadido"; color: var(--muted); font-size: 12px; }
.mod-table td.mod-plan { white-space: nowrap; }

/* ---- Iconos de módulo y movimiento del manual (27-10) ---- */
/* Icono de módulo: el cuadrado de papel del color del módulo con su pliegue (el mismo que la web pública). */
.k-ico { width: 16px; height: 16px; flex-shrink: 0; background: var(--c, var(--primary)); border-radius: 2px; position: relative; overflow: hidden; display: inline-block; margin: 0 1px; }
.k-ico::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, #fff 38%, transparent); }
.k-ico.f1::before { clip-path: polygon(0 0, 100% 0, 0 100%); }
.k-ico.f2::before { clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%); }
.k-ico.f3::before { clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%); }
.k-ico.f4::before { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.k-ico.f5::before { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.k-ico.f6::before { clip-path: polygon(0 0, 50% 0, 0 50%); }
.k-ico.f7::before { clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%); }
.sidebar nav a:hover .k-ico, .nav-group > summary:hover .k-ico { transform: rotate(-8deg) scale(1.08); }
.sidebar .k-ico { transition: transform .2s ease; }
/* Chips con el triangulito del módulo */
.chip[style*="--c"]::before { content: ""; width: 7px; height: 7px; background: var(--c); clip-path: polygon(0 0, 100% 0, 0 100%); display: inline-block; margin-right: 6px; }

/* Respuesta: al pulsar, el botón se hunde 1 px; al pasar por encima se levanta un poco. */
.btn { transition: background .2s ease, transform .15s ease, box-shadow .2s ease; }
.btn:not([disabled]):hover { transform: translateY(-1px); }
.btn:not([disabled]):active { transform: translateY(1px); }

/* Solapa: carpetas del menú, pestañas, desplegables y tarjetas se abren desde su borde superior (0,5 s, 70 ms entre uno y otro). */
.nav-group[open] > .nav-group-items > a { animation: solapa var(--solapa) both; transform-origin: 50% 0; }
.nav-group[open] > .nav-group-items > a:nth-child(2) { animation-delay: 70ms; }
.nav-group[open] > .nav-group-items > a:nth-child(3) { animation-delay: 140ms; }
.nav-group[open] > .nav-group-items > a:nth-child(4) { animation-delay: 210ms; }
.nav-group[open] > .nav-group-items > a:nth-child(n+5) { animation-delay: 280ms; }
.nav-group > summary::after { transition: transform .25s ease; }
.folder-panel.enter, .week-day.enter { animation: solapa var(--solapa) both; transform-origin: 50% 0; }
details.popover[open] > :not(summary), .inbox-more[open] > :not(summary), .acc-more[open] > :not(summary), .acc-tip { animation: solapa .35s cubic-bezier(.25,.9,.3,1) both; transform-origin: 50% 0; }
.content > .card, .content > .grid-2 > *, .content > .grid-2 > div > .card { animation: solapa var(--solapa) both; transform-origin: 50% 0; }
.content > .card:nth-of-type(2), .content > .grid-2 > :nth-child(2) { animation-delay: 70ms; }
.content > .card:nth-of-type(3) { animation-delay: 140ms; }
.content > .card:nth-of-type(n+4) { animation-delay: 210ms; }

/* Aviso de «guardado»: sale abajo, en la tarjeta oscura con la esquina doblada, y se pliega solo a los 3 s. */
.k-toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.k-toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; background: var(--deep); color: var(--on-deep); padding: 11px 16px; border-radius: var(--r); font-size: 14px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); box-shadow: 0 12px 30px color-mix(in srgb, #000 30%, transparent); animation: solapa var(--solapa) both; transform-origin: 50% 100%; }
.k-toast b { color: var(--primary); }
.k-toast a { color: var(--primary); }
.k-toast.out { animation: k-fold-out .45s ease-in both; }
@keyframes k-fold-out { to { transform: perspective(700px) rotateX(85deg); opacity: 0; } }

/* Móvil: barra de abajo y «Más», que despliega el menú como una hoja con los cuatro triángulos de los módulos. */
.k-tabbar { display: none; }
@media (max-width: 900px) {
  .has-tabbar .nav-burger { display: none; }
  .has-tabbar .content { padding-bottom: 92px; }
  .k-tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px color-mix(in srgb, #000 10%, transparent); }
  .k-tabbar a, .k-tabbar button { display: grid; justify-items: center; gap: 4px; padding: 7px 2px 4px; border: 0; background: none; font: 600 11px var(--body); color: var(--muted); text-decoration: none; cursor: pointer; border-radius: var(--r); }
  .k-tabbar .k-ico { opacity: .75; }
  .k-tabbar a.on, .k-tabbar button[aria-expanded="true"] { color: var(--primary-ink); }
  .k-tabbar a.on .k-ico { opacity: 1; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 35%, transparent); }
  .k-more-ico { position: relative; width: 16px; height: 16px; display: block; }
  .k-more-ico i { position: absolute; width: 8px; height: 8px; background: var(--c); transition: transform .35s cubic-bezier(.25,.9,.3,1); }
  .k-more-ico i:nth-child(1) { left: 0; top: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
  .k-more-ico i:nth-child(2) { right: 0; top: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); }
  .k-more-ico i:nth-child(3) { left: 0; bottom: 0; clip-path: polygon(0 0, 100% 100%, 0 100%); }
  .k-more-ico i:nth-child(4) { right: 0; bottom: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
  .k-more[aria-expanded="true"] .k-more-ico i:nth-child(1) { transform: translate(-3px, -3px) rotate(-12deg); }
  .k-more[aria-expanded="true"] .k-more-ico i:nth-child(2) { transform: translate(3px, -3px) rotate(12deg); }
  .k-more[aria-expanded="true"] .k-more-ico i:nth-child(3) { transform: translate(-3px, 3px) rotate(12deg); }
  .k-more[aria-expanded="true"] .k-more-ico i:nth-child(4) { transform: translate(3px, 3px) rotate(-12deg); }
  .sidebar.is-open nav { animation: none; }
  .sidebar.is-open nav > a, .sidebar.is-open nav > details, .sidebar.is-open nav > .nav-sep { animation: solapa var(--solapa) both; transform-origin: 50% 0; }
  .sidebar.is-open nav > :nth-child(2) { animation-delay: 40ms; } .sidebar.is-open nav > :nth-child(3) { animation-delay: 80ms; }
  .sidebar.is-open nav > :nth-child(4) { animation-delay: 120ms; } .sidebar.is-open nav > :nth-child(5) { animation-delay: 160ms; }
  .sidebar.is-open nav > :nth-child(6) { animation-delay: 200ms; } .sidebar.is-open nav > :nth-child(n+7) { animation-delay: 240ms; }
  .k-toasts { bottom: 86px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-group[open] > .nav-group-items > a, .folder-panel.enter, .week-day.enter, details.popover[open] > *, .inbox-more[open] > *, .acc-more[open] > *, .acc-tip, .content > .card, .content > .grid-2 > *, .content > .grid-2 > div > .card,
  .k-toast, .k-toast.out, .sidebar.is-open nav > *, .k-more-ico i { animation: none !important; transition: none !important; }
  .btn:not([disabled]):hover, .btn:not([disabled]):active { transform: none; }
}
/* Subtítulo dentro de una carpeta del menú (Tótem táctil › Ejercicios y máquinas) */
.sidebar .nav-subsep { margin: 8px 10px 2px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--on-deep) 42%, transparent); }
/* ---------- Superadmin: contratos, cuotas y facturas de los gimnasios (migración 31) ---------- */
.kg-contract { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.kg-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 10px 0 6px; }
.kg-items fieldset, .kg-tiers { border: 1px solid var(--line); border-radius: var(--r, var(--radius)); padding: 10px 14px 12px; margin: 0; }
.kg-items legend, .kg-tiers legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
.kg-item { display: flex; gap: 8px; align-items: flex-start; margin: 5px 0; font-weight: 400; }
.kg-item .kg-incl { display: none; margin-left: 6px; }
.kg-item.is-included .kg-incl { display: inline-block; }
.kg-item .kg-base { display: none; margin-left: 6px; }
.kg-item.is-base .kg-base { display: inline-block; }
.kg-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 4px 0 10px; }
.kg-block { border: 1px solid var(--line); border-top: 3px solid var(--c, var(--primary)); border-radius: var(--r, var(--radius)); padding: 12px 16px 14px; margin: 0; min-width: 0; }
.kg-block[data-kg-block="crm"] { --c: var(--cobros); }
.kg-block[data-kg-block="totem"] { --c: var(--m-totem, var(--primary)); }
.kg-block legend { font-weight: 700; padding: 0 6px; }
.kg-block-items { margin-top: 8px; }
.kg-on { font-weight: 600; }
.kg-legacy { margin: 4px 0 0; }
.form .kg-when input[type=radio], .form .kg-item input, .form .kg-on input { width: auto; flex: none; margin: 0; padding: 0; }
.kg-item.is-included .kg-price { text-decoration: line-through; }
.kg-item.is-off { opacity: .45; }
.kg-screens { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 400; margin-bottom: 6px; }
.kg-screens input { width: 70px; }
.kg-preview { position: sticky; top: 14px; padding: 14px 16px; transition: opacity .2s ease; }
.kg-preview.is-loading { opacity: .6; }
.kg-preview h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.kg-lines-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.kg-lines-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.kg-lines-list strong { white-space: nowrap; font-weight: 600; }
.kg-sub[hidden] { display: none; }
.kg-sub { display: flex; justify-content: space-between; font-size: 13px; margin: 6px 0 0; color: var(--ok); }
.kg-total { margin: 10px 0 4px; }
.kg-total > span { display: block; font-size: 26px; font-weight: 700; }
.kg-total small { color: var(--muted); font-size: 12px; }
.kg-up { color: var(--warn); } .kg-down { color: var(--ok); }
.kg-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kg-state { font-size: 20px !important; }
.kg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kg-actions .popover-box label { display: block; margin-bottom: 8px; }
.kg-when { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: flex-start; }
.kg-when label.check { display: flex; gap: 8px; align-items: center; width: auto; flex: 0 1 auto; margin: 0; font-weight: 400; }
.kg-when .btn { margin-left: auto; }
.kg-request { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.kg-lines > summary { cursor: pointer; }
.kg-lines ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.kg-package.off { opacity: .6; }
.kg-save { margin: 0 0 8px; font-size: 14px; }
.kg-save strong { font-size: 22px; }
.kg-old > summary { cursor: pointer; }
.kg-plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kg-plan-cards .card { margin: 0; }
@media (max-width: 860px) {
  .kg-contract { grid-template-columns: 1fr; }
  .kg-preview { position: static; }
}
a.stat { color: inherit; text-decoration: none; display: block; }

/* ---- Equipo y permisos (crm/team.php, includes/team.php) */
.team-ro { margin: 0 0 14px; padding: 8px 14px; border-radius: var(--r, 6px); background: var(--info-bg); border: 1px solid var(--info-line); border-left: 4px solid var(--info); font-size: 13px; }
.team-ro-form { opacity: .78; }
.team-ro-form button[disabled] { cursor: not-allowed; }
.team-matrix { width: 100%; border-collapse: collapse; }
.team-matrix th, .team-matrix td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.team-matrix th:first-child, .team-matrix td:first-child { text-align: left; }
.team-matrix td:first-child small { display: block; color: var(--muted); font-size: 12px; }
.team-matrix input[type=radio] { width: 18px; height: 18px; accent-color: var(--primary); }
.team-flags { display: grid; gap: 8px; margin-top: 14px; }
.team-flags label { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.team-flags label small { display: block; font-weight: 400; color: var(--muted); }
.team-tpls { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.team-tpls button[aria-pressed=true] { background: var(--primary); color: var(--on-primary, #fff); border-color: var(--primary); }
.team-owner-note { padding: 10px 12px; border-radius: var(--r, 6px); background: var(--soft); border: 1px dashed var(--line-2); }
.masked { color: var(--muted); letter-spacing: .04em; }
@media (max-width: 640px) {
  .team-matrix thead { display: none; }
  .team-matrix tr { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); padding: 6px 0; }
  .team-matrix td { border: 0; padding: 4px; font-size: 12px; }
  .team-matrix td:first-child { grid-column: 1 / -1; }
  .team-matrix td[data-l]::after { content: attr(data-l); display: block; color: var(--muted); font-size: 11px; }
}
.team-scope { display: grid; gap: 6px; }
.team-zones { display: grid; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r, 6px); background: var(--soft); }
.team-zones fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.team-zones legend { width: 100%; margin-bottom: 4px; }
.mz-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mz-src { font-size: 11px; color: var(--muted); }

/* Reiniciar gimnasio (ficha › Modo) */
.kg-reset { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 12px 0; }
.kg-reset fieldset { border: 1px solid var(--line); border-radius: var(--r, 6px); padding: 10px 12px; margin: 0; display: grid; gap: 8px; align-content: start; }
.kg-reset legend { font-weight: 600; padding: 0 4px; }
.form .kg-reset .check, .kg-reset .check { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
.form .kg-reset .check input, .kg-reset .check input { width: auto; flex: none; margin: 3px 0 0; padding: 0; }
.kg-reset .check > span { flex: 1; min-width: 0; }
.kg-reset .hint { display: block; margin-top: 2px; }
.popover-box.is-floating { position: fixed; right: auto; z-index: 90; animation: none !important; }
td .popover-box { text-align: left; white-space: normal; }
.kg-site-mode { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.kg-site-mode label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.kg-site-mode input[type=radio] { width: auto !important; flex: none; margin: 0; padding: 0; }
.kg-site-mode label { white-space: nowrap; }

/* Tarifas: arrastrar y soltar, selección múltiple y modal (28-10) */
.tariff-table .col-check { width: 28px; padding-right: 0; }
.tariff-table .col-check input { width: 16px; height: 16px; cursor: pointer; }
.tariff-table .col-grip { width: 26px; padding: 0 2px; }
.t-grip { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 34px; border-radius: 6px; color: var(--muted); font-size: 17px; line-height: 1; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.t-grip:hover { background: var(--surface-2, var(--soft)); color: var(--ink); }
.t-grip-hint { display: inline-block; padding: 0 3px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }
.tariff-row { cursor: pointer; transition: background .15s, opacity .15s; }
.tariff-row:hover td { background: var(--surface-2, var(--soft)); }
.tariff-row.is-picked td { background: color-mix(in srgb, var(--primary, #2563eb) 9%, transparent); }
.tariff-row.was-dragged td { animation: tFlash .5s ease-out; }
@keyframes tFlash { from { background: color-mix(in srgb, var(--primary, #2563eb) 22%, transparent); } }
.t-slot td { padding: 0 !important; border: 0 !important; background: color-mix(in srgb, var(--primary, #2563eb) 7%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary, #2563eb) 45%, transparent); border-radius: 8px; transition: height .15s, opacity .15s; }
.t-slot.is-off td { opacity: .35; }
body.t-dragging, body.t-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.t-ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; margin: 0; table-layout: fixed; border-collapse: collapse; background: var(--card, #fff); border-radius: 10px; box-shadow: 0 18px 40px rgba(17,24,39,.28), 0 0 0 1px var(--line); transform-origin: 30px 20px; transition: opacity .17s; }
.t-ghost td { border-bottom: 0 !important; background: transparent !important; }
.t-ghost.to-tab { opacity: .9; }
.t-ghost.landing { transition: transform .17s ease, opacity .17s; box-shadow: 0 4px 10px rgba(17,24,39,.12); }
.t-ghost.is-stack { box-shadow: 0 18px 40px rgba(17,24,39,.28), 0 0 0 1px var(--line), 6px 6px 0 -1px var(--card, #fff), 6px 6px 0 0 var(--line); }
.t-stack-count { position: absolute; top: -10px; right: -10px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--primary, #2563eb); color: #fff; font-weight: 700; font-size: 13px; line-height: 24px; text-align: center; }
.t-ghost .t-grip { color: var(--ink); }
.folder-tabs [data-tab].t-drop-tab { outline: 2px dashed var(--primary, #2563eb); outline-offset: -3px; background: color-mix(in srgb, var(--primary, #2563eb) 12%, transparent); }
.t-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 210; padding: 10px 16px; border-radius: 10px; background: var(--deep, #111827); color: var(--on-deep, #fff); font-size: 14px; box-shadow: 0 12px 30px rgba(17,24,39,.3); animation: fadeSlide .2s ease-out; transition: opacity .4s; }
.t-toast.out { opacity: 0; }
#tariff-bulk .bulk-sep:empty { padding-left: 0; height: 20px; }
dialog.modal.tariff-modal { width: min(640px, calc(100vw - 32px)); height: auto; }
.tariff-modal .modal-body { flex: 0 1 auto; }
.tariff-modal .modal-foot > span { display: flex; gap: 6px; }
.tariff-modal .t-del { color: var(--bad, #dc2626); }
/* Tarifas híbridas: cada zona con su propio límite (28-10) */
.tz-zones .tz-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.tz-zones .tz-row:last-of-type { border-bottom: 0; }
.tz-zones .tz-row label.check { margin: 0; }
.tz-zones .tz-limit { display: inline-flex; gap: 6px; align-items: center; }
.form .tz-zones .tz-limit select { width: auto; min-width: 150px; margin: 0; }
.form .tz-zones .tz-limit input { width: 76px; margin: 0; }
.tz-zones .tz-row.is-own .tz-limit select { border-color: var(--accent, #0ea5a4); font-weight: 600; }
.tz-classes .tc-name { font-size: 14px; }
@media (max-width: 760px) {
  dialog.modal.tariff-modal { width: 100vw; height: 100vh; }
  .tariff-modal .modal-body { flex: 1; }
  .tariff-modal .modal-foot > span { width: auto; margin-right: auto; }
  .tariff-modal .modal-foot { flex-wrap: wrap; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .t-grip { width: 34px; height: 40px; font-size: 20px; }
}

/* ---------- Entidades enlazadas (includes/entity_links.php): el nombre lleva a su ficha o maestro ---------- */
.content a.ent { color: inherit; text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
.content a.ent:hover, .content a.ent:focus-visible { color: var(--primary-ink, var(--primary)); text-decoration-style: solid; text-decoration-color: currentColor; }
.content a.ent > .badge, .content a.ent > .chip, .content a.ent > .zone-chip { cursor: pointer; }
.content a.ent:hover > .badge, .content a.ent:hover > .chip, .content a.ent:hover > .zone-chip { filter: brightness(.95); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent); }
.content a.ent:has(> .badge, > .chip, > .zone-chip) { text-decoration: none; }
[data-ent].ent-hit, tr[data-ent].ent-hit > td { animation: entHit 2.4s ease-out; }
@keyframes entHit { 0%, 35% { background: color-mix(in srgb, var(--primary) 18%, transparent); } 100% { background: transparent; } }
tr:target > td, [id]:target.cat-row { animation: entHit 2.4s ease-out; }

/* Mensajes: número de conversaciones sin leer en el menú lateral y en «Más» del móvil (lo pone al día app.js). */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 800 11.5px/20px var(--body); text-align: center; flex: none; }
.k-tabbar .k-more { position: relative; }
.k-tabbar .k-more .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; line-height: 18px; font-size: 10.5px; padding: 0 5px; }


/* ===== Manual 2.0: banda de tres (turquesa 5 : ámbar 3 : rojo 2, extremos a 45°). Una por pantalla. ===== */
.k-banda { display: block; height: 6px; background: linear-gradient(90deg, var(--turquesa) 0 50%, var(--ambar) 50% 80%, var(--rojo) 80%); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.sidebar .brand::after { content: ""; display: block; height: 5px; margin: 12px 0 2px; background: linear-gradient(90deg, var(--turquesa) 0 50%, var(--ambar) 50% 80%, var(--rojo) 80%); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
/* insignias de marca: ámbar destaca, rojo empuja (texto siempre casi negro encima) */
.k-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .74rem; padding: 3px 9px 3px 7px; background: var(--c, var(--ambar)); color: var(--on-marca); clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%); }
