/* ============================================================
   ClubManager — Sistema de diseño SaaS
   Aesthetic: refined, profesional, deportivo. Sidebar tinta
   profunda + acento esmeralda. Tipografias Sora + Figtree.
   ============================================================ */
:root {
  --bg:          #eef1f5;
  --bg-soft:     #f7f9fb;
  --surface:     #ffffff;
  --ink:         #0d1526;
  --ink-2:       #334155;
  --muted:       #6b7686;
  --line:        #e4e8ee;
  --line-soft:   #eef1f5;

  --sidebar:     #0d1526;
  --sidebar-2:   #131d33;
  --sidebar-txt: #aab4c5;

  --accent:      #10b981;
  --accent-2:    #059669;
  --accent-soft: #e7f8f1;

  --amber:       #f59e0b;
  --amber-soft:  #fef3e2;
  --red:         #ef4444;
  --red-soft:    #fde8e8;
  --blue:        #3b82f6;
  --blue-soft:   #e8f0fe;
  --slate-soft:  #eef1f5;

  --shadow-sm: 0 1px 2px rgba(13,21,38,.05), 0 1px 3px rgba(13,21,38,.04);
  --shadow:    0 4px 14px rgba(13,21,38,.06), 0 2px 6px rgba(13,21,38,.04);
  --shadow-lg: 0 24px 60px rgba(13,21,38,.18);

  --r:    16px;
  --r-sm: 10px;
  --r-lg: 22px;

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body:    'Figtree', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; color: var(--ink); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ====================== LOGIN ====================== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
}
.auth-art {
  position: relative;
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(16,185,129,.35), transparent 55%),
    radial-gradient(700px 500px at 90% 90%, rgba(59,130,246,.28), transparent 55%),
    linear-gradient(155deg, #0d1526, #14213d 60%, #0d1526);
  color: #fff;
  padding: 52px 56px 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 40px;
  overflow: hidden;
}
.auth-art::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .6;
  pointer-events: none;
}
/* Fondo atmosférico: luces que respiran + líneas de cancha */
.art-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.art-bg .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.art-bg .b1 { width: 360px; height: 360px; top: -80px; left: -60px; background: rgba(16,185,129,.5); animation: blobMove 14s ease-in-out infinite; }
.art-bg .b2 { width: 420px; height: 420px; bottom: -120px; right: -80px; background: rgba(59,130,246,.42); animation: blobMove 18s ease-in-out infinite reverse; }
@keyframes blobMove { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(26px,-22px) scale(1.1); } }
@keyframes floaty { 0%,100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-12px); } }
@keyframes chipFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.auth-art .brand-mark { display: inline-flex; align-items: center; gap: 12px; position: relative; align-self: flex-start; z-index: 2; }
.auth-art .brand-mark .logo { width: 42px; height: 42px; }
.auth-art .brand-mark span { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.auth-art > *:not(.art-bg) { position: relative; z-index: 1; }
.auth-art .brand-mark, .auth-hero, .auth-preview, .auth-features { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.auth-art .brand-mark { animation-delay: .02s; }
.auth-hero { animation-delay: .12s; }
.auth-preview { animation-delay: .22s; }
.auth-features { animation-delay: .32s; }

.auth-mid { display: flex; flex-direction: row; align-items: center; gap: 40px; flex-wrap: wrap; margin-top: auto; }
.auth-hero { flex: 1 1 300px; max-width: 480px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: #9ff0d2; background: rgba(16,185,129,.14); border: 1px solid rgba(16,185,129,.3);
  padding: 7px 14px; border-radius: 999px; margin-bottom: 24px;
}
.hero-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(16,185,129,.25); }
.auth-hero h1 { color: #fff; font-size: clamp(38px, 4.2vw, 60px); line-height: 1.04; font-weight: 700; letter-spacing: -.01em; }
.auth-hero h1 em { font-style: normal; color: #34d399; }
.auth-hero p { color: #c3ccdb; margin-top: 22px; font-size: 19px; line-height: 1.5; max-width: 520px; }

/* Previsualización del producto (vidrio) */
.auth-preview { position: relative; flex: 1 1 400px; align-self: center; width: 100%; max-width: 560px; margin: 0 0 0 auto; }
.ap-card {
  background: rgba(255,255,255,.07); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 22px; padding: 26px 26px 24px;
  box-shadow: 0 36px 70px -22px rgba(0,0,0,.62); transform: rotate(-3deg); animation: floaty 7s ease-in-out infinite;
}
.ap-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.ap-ava { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg,#10b981,#0ea5e9); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; color: #fff; flex: 0 0 auto; }
.ap-id { flex: 1; min-width: 0; }
.ap-id b { color: #fff; font-size: 18px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-id span { color: #9fb0c7; font-size: 14px; }
.ap-live { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #6ee7b7; font-weight: 600; flex: 0 0 auto; }
.ap-live i { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.ap-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; margin-bottom: 16px; }
.ap-kpis div { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 13px; padding: 14px 8px; text-align: center; }
.ap-kpis b { display: block; color: #fff; font-family: var(--font-display); font-size: 27px; }
.ap-kpis span { color: #9fb0c7; font-size: 13px; }
.ap-spark { width: 100%; height: 84px; display: block; margin-bottom: 14px; }
.ap-rows { display: flex; flex-direction: column; gap: 8px; }
.ap-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: #d7deea; }
.ap-row i { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.ap-row i.ok { background: #34d399; }
.ap-row i.warn { background: #fbbf24; }
.ap-chip {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.96); color: #0d1526; font-size: 12.5px; font-weight: 600;
  padding: 8px 13px; border-radius: 999px; box-shadow: 0 16px 34px -10px rgba(0,0,0,.5); white-space: nowrap;
}
.ap-chip-1 { top: -16px; left: -24px; animation: chipFloat 5.5s ease-in-out infinite; }
.ap-chip-2 { bottom: -14px; right: -18px; animation: chipFloat 6.5s ease-in-out infinite .8s; }
.ap-chip.green { color: #047857; }

/* Pills de características */
.auth-features { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: auto; }
.auth-features > div {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 10px 13px;
}
.auth-features i { display: flex; color: #34d399; }
.auth-features i svg { width: 18px; height: 18px; }
.auth-features strong { font-family: var(--font-display); display: block; font-size: 14px; color: #fff; }
.auth-features span { color: #9fb0c7; font-size: 11.5px; }

.auth-form-side {
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 26px; }
.auth-card .sub { color: var(--muted); margin: 8px 0 30px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.field input, .field select {
  width: 100%; min-width: 0; max-width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg-soft); font-size: 15px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-row > .field { min-width: 0; }
/* Contraseña enmascarada: puntos pequeños y espaciados (más ligeros y elegantes) */
input.pw-elegant { -webkit-text-security: circle; font-size: 13px; letter-spacing: 3px; }
/* Los inputs de fecha en iOS ignoran el ancho por su apariencia nativa; la quitamos */
.field input[type="date"] { -webkit-appearance: none; appearance: none; text-align: left; }
/* Filas de permisos del entrenador */
.perm-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.perm-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: none; border-radius: var(--r-sm);
  font-weight: 600; font-size: 15px; transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(16,185,129,.30); }
.btn-primary:hover { background: var(--accent-2); }
.btn-block { width: 100%; }
.btn-ghost { background: var(--slate-soft); color: var(--ink-2); }
.btn-ghost:hover { background: #e4e8ee; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fcdcdc; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }

.alert { padding: 11px 14px; border-radius: var(--r-sm); font-size: 14px; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert-error { background: var(--red-soft); color: #b91c1c; }
.alert-ok { background: #dcfce7; color: #15803d; }
.auth-alt { text-align: center; margin-top: 16px; }
.auth-alt a { color: var(--accent); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.demo-creds {
  margin-top: 24px; padding: 14px; border: 1px dashed var(--line);
  border-radius: var(--r-sm); font-size: 13px; color: var(--muted); background: var(--bg-soft);
}
.demo-creds b { color: var(--ink-2); }
.demo-creds code { background: #fff; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); }

/* ====================== APP SHELL ====================== */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-txt);
  padding: 22px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; }
.sidebar .brand .logo { width: 34px; height: 34px; }
.sidebar .brand .brand-logo { width: 34px; height: 34px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.sidebar .brand .brand-img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: #fff; }
.sidebar .brand b { font-family: var(--font-display); color: #fff; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-footer { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.06); font-size: 10.5px; line-height: 1.6; color: #56688a; text-align: center; }
.side-footer b { color: #8b9bb5; font-weight: 600; }
.app-footer { grid-column: 1 / -1; background: var(--sidebar); color: #fff; text-align: center; padding: 14px 20px; font-size: 12.5px; letter-spacing: .02em; }
.app-footer b { font-weight: 700; }
.cap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.cap-card { background: var(--bg, #f8fafc); border: 1px solid var(--line); border-radius: 13px; padding: 15px 17px; }
.cap-card .cap-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.cap-card .cap-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.cap-card .cap-val { font-size: 13px; color: var(--ink); font-weight: 700; white-space: nowrap; }
.cap-bar { height: 10px; background: #e9eef4; border-radius: 999px; overflow: hidden; }
.cap-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #10b981, #0ea5e9); transition: width .5s ease; }
.cap-bar.warn > span { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.cap-pct { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.use-bar { height: 7px; width: 100%; max-width: 130px; background: #e9eef4; border-radius: 999px; overflow: hidden; display: inline-block; vertical-align: middle; }
.use-bar > span { display: block; height: 100%; background: #10b981; border-radius: 999px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 10px;
  color: var(--sidebar-txt); font-size: 14.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a svg { width: 19px; height: 19px; stroke-width: 1.8; flex-shrink: 0; }
.nav a:hover { background: var(--sidebar-2); color: #fff; }
.nav a.active { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(16,185,129,.25); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #5a6b85; padding: 14px 13px 6px; }

.sidebar .user-box {
  border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; margin-top: 8px;
  display: flex; align-items: center; gap: 11px;
}
.avatar {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-family: var(--font-display); font-size: 15px;
}
.user-box .meta { min-width: 0; flex: 1; }
.user-box .meta b { color: #fff; font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-box .meta span { font-size: 12px; color: #6f7f99; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.icon-btn { background: none; border: none; color: #6f7f99; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--sidebar-2); color: #fff; }
.icon-btn svg { width: 18px; height: 18px; }

/* ====================== MAIN ====================== */
.main { padding: 30px 38px 60px; min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.topbar .title h1 { font-size: 27px; }
.topbar .title p { color: var(--muted); margin-top: 4px; font-size: 15px; }
.hamburger { display: none; }

/* Cards resumen */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.cards.no-total { grid-template-columns: repeat(3, 1fr); }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat .ico { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.stat .ico svg { width: 21px; height: 21px; stroke-width: 1.9; }
.stat .ico.green { background: var(--accent-soft); color: var(--accent-2); }
.stat .ico.amber { background: var(--amber-soft); color: var(--amber); }
.stat .ico.red   { background: var(--red-soft); color: var(--red); }
.stat .ico.blue  { background: var(--blue-soft); color: var(--blue); }
.stat .label { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.stat .value { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin-top: 2px; letter-spacing: -.03em; }

/* Paneles */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line-soft); }
.panel-head h3 { font-size: 17px; }
.panel-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.panel-body { padding: 22px; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-2.charts-single { grid-template-columns: 1fr; }
.seg { display: inline-flex; background: var(--slate-soft); border-radius: 10px; padding: 4px; gap: 4px; }
.seg-btn { border: none; background: transparent; padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(13,21,38,.14); }
.overdue-bar { display:flex; align-items:center; gap:10px; background:var(--red-soft); color:var(--red); border:1px solid #f5c2c2; border-radius:12px; padding:12px 16px; margin:16px 22px 0; font-size:13.5px; font-weight:600; }
.overdue-bar svg { flex:0 0 auto; }
.notif-wrap { position: relative; }
.notif-btn { position: relative; background: var(--slate-soft); border: none; width: 42px; height: 42px; border-radius: 11px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.notif-btn:hover { background: #e4e8ee; }
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.notif-panel { position: absolute; right: 0; top: 50px; width: 340px; max-height: 420px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(13,21,38,.16); z-index: 60; }
.notif-head { padding: 14px 16px; font-weight: 700; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notif-item:last-child { border-bottom: none; }
.notif-item .ni-name { font-weight: 600; font-size: 13.5px; }
.notif-item .ni-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.nav a.locked { opacity: .5; }
.nav a.locked .lock-ic { margin-left: 6px; font-size: 12px; }
.nav-sep { margin: 14px 16px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.btn.locked { opacity: .55; }

.chart-wrap { height: 300px; position: relative; }

/* Select de filtro */
.mini-select { padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 9px; background: var(--bg-soft); font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.mini-select:focus { outline: none; border-color: var(--accent); }

/* Tablas */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
tbody td { padding: 14px; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-soft); }
td .person { display: flex; align-items: center; gap: 11px; }
td .person .avatar { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }
td .sub { color: var(--muted); font-size: 12.5px; }

/* Badges de estado */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.badge.paid     { background: var(--accent-soft); color: var(--accent-2); }
.badge.pending  { background: var(--amber-soft); color: #b45309; }
.badge.vencido  { background: var(--red-soft); color: #b91c1c; }
.badge.active   { background: var(--accent-soft); color: var(--accent-2); }
.badge.inactive { background: var(--slate-soft); color: var(--muted); }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Empty state */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; opacity: .4; margin-bottom: 12px; }

/* ====================== MODAL ====================== */
.modal-bg {
  position: fixed; inset: 0; background: rgba(13,21,38,.5); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg); animation: pop .18s ease;
  display: flex; flex-direction: column; overflow: hidden;
  max-height: 90vh; max-height: calc(100dvh - 40px);
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { padding: 22px 24px 0; flex: 0 0 auto; }
.modal-head h3 { font-size: 19px; }
.modal-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.modal-body { padding: 20px 24px; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; }
.modal-foot { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex: 0 0 auto; flex-wrap: wrap; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 80;
  background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  transform: translateY(80px); opacity: 0; transition: .25s; display: flex; align-items: center; gap: 9px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.err { background: var(--red); }
.toast svg { width: 18px; height: 18px; }

.skeleton { background: linear-gradient(90deg,#eef1f5,#f7f9fb,#eef1f5); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 1100px) { .cards, .cards.no-total { grid-template-columns: repeat(2,1fr); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { padding: 26px 24px 28px; gap: 14px; justify-content: flex-start; }
  .auth-art .brand-mark { position: static; top: auto; left: auto; }
  .auth-mid { display: block; }
  .auth-preview, .auth-features { display: none; }
  .auth-hero { max-width: none; }
  .hero-eyebrow { margin-bottom: 10px; }
  .auth-hero h1 { font-size: 25px; }
  .auth-hero p { font-size: 14px; margin-top: 9px; }
  .auth-form-side { padding: 30px 24px 44px; align-items: flex-start; }
  .shell { grid-template-columns: 1fr; }
  .app-footer { display: none; }
  .side-footer { display: block; }
  .cap-grid { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; width: 260px; height: 100vh;
    transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 18px; }
  .hamburger { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px; box-shadow: var(--shadow-sm); }
  .hamburger svg { width: 20px; height: 20px; }
  .sb-backdrop { position: fixed; inset: 0; background: rgba(13,21,38,.4); z-index: 55; display: none; }
  .sb-backdrop.show { display: block; }
}
@media (max-width: 560px) {
  .cards, .cards.no-total { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 14px; }
  .stat .ico { width: 36px; height: 36px; margin-bottom: 10px; border-radius: 10px; }
  .stat .ico svg { width: 18px; height: 18px; }
  .stat .value { font-size: 23px; }
  .stat .label { font-size: 12.5px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .form-row { grid-template-columns: 1fr; }
}

/* En móvil, las tablas marcadas se muestran como tarjetas en 2 columnas (aprovechan el ancho) */
@media (max-width: 640px) {
  table.responsive-cards { width: 100%; }
  table.responsive-cards thead { display: none; }
  table.responsive-cards tbody { display: block; }
  table.responsive-cards tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
    padding: 14px 4px; border-bottom: 1px solid var(--line);
  }
  table.responsive-cards tr:last-child { border-bottom: none; }
  table.responsive-cards td { display: block; padding: 2px 0; border: none; text-align: left; }
  table.responsive-cards td:first-child { grid-column: 1 / -1; }   /* nombre: ancho completo arriba */
  table.responsive-cards td:last-child  { grid-column: 1 / -1; }   /* acciones: ancho completo abajo */
  table.responsive-cards td::before {
    content: attr(data-label);
    display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 600; margin-bottom: 2px;
  }
  table.responsive-cards td:not([data-label])::before,
  table.responsive-cards td[data-label='']::before { display: none; }
  table.responsive-cards td .row-actions { justify-content: flex-start; gap: 8px; }
  table.responsive-cards td .row-actions .btn { flex: 1; }
  /* iOS hace zoom al enfocar inputs con fuente < 16px; lo evitamos (excepto la contraseña) */
  input:not(.pw-elegant), select, textarea { font-size: 16px !important; }
}
