/* CABNA V77 — interfaz unificada para Socio, Administración y Portero. */
/* ============================================================
   CLUB CRM — Design System Premium Sport
   Dark base · Emerald accent · Geometric details
   ============================================================ */

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

:root {
  --em:      #0B3A67;
  --em-d:    #072A4A;
  --em-dd:   #031B32;
  --em-l:    rgba(11,58,103,.12);
  --em-ll:   rgba(11,58,103,.06);
  --bg:      #F0F2F5;
  --bg2:     #FFFFFF;
  --bg3:     #F7F8FA;
  --bg4:     #EEF0F3;
  --bg5:     #E4E6EA;
  --border:  rgba(0,0,0,.07);
  --border2: rgba(0,0,0,.12);
  --tx:      #1A1D23;
  --tx2:     #52576B;
  --tx3:     #8B91A5;
  --red:     #DC2626;
  --red-l:   rgba(220,38,38,.1);
  --amber:   #D97706;
  --amber-l: rgba(217,119,6,.1);
  --blue:    #2563EB;
  --blue-l:  rgba(37,99,235,.1);
  --sidebar: 240px;
  --hdr:     58px;
  --r:       10px;
  --r-sm:    6px;
  --r-lg:    14px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  font-size: 14px;
  color: var(--tx);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  color: var(--tx);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg5); border-radius: 4px; border: 1px solid var(--bg4); }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--hdr);
  background: rgba(10,10,11,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-content { padding: 24px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 36px; height: 36px;
  background: var(--em);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.logo-mark i { font-size: 20px; color: #fff; }

.logo-name {
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--tx);
  letter-spacing: .5px;
  text-transform: uppercase;
}
.logo-sub { font-size: 11px; color: var(--tx3); margin-top: 1px; }

.nav-section { padding: 8px 0; }
.nav-lbl {
  font-size: 10px;
  color: var(--tx3);
  padding: 6px 20px 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13px;
  color: var(--tx2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .15s;
  position: relative;
}
.nav-item:hover { background: var(--bg3); color: var(--tx); }
.nav-item.active {
  background: var(--em-l);
  color: var(--em);
  border-left-color: var(--em);
  font-weight: 500;
}
.nav-item i { font-size: 16px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
}
.nav-badge.green { background: var(--em); color: #000; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.page-title {
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  flex: 1;
  color: var(--tx);
}
.page-title span {
  font-size: 13px;
  color: var(--tx3);
  font-weight: 400;
  margin-left: 8px;
  text-transform: none;
  font-family: 'Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  letter-spacing: 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(11,58,103,.15), transparent);
}

.card-title {
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--tx);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title i { font-size: 16px; color: var(--em); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--em);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s;
}
.stat-card:hover::after { transform: scaleX(1); }

.stat-lbl {
  font-size: 11px;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-val {
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--tx);
  line-height: 1;
}
.stat-sub { font-size: 11px; color: var(--tx3); margin-top: 4px; }
.stat-sub.up   { color: var(--em); }
.stat-sub.down { color: var(--red); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--bg4);
  color: var(--tx);
  text-decoration: none;
  transition: all .15s;
  font-family: 'Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  white-space: nowrap;
}
.btn:hover { background: var(--bg5); border-color: var(--border2); }
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--em);
  color: #000;
  border-color: var(--em);
  font-weight: 600;
}
.btn-primary:hover { background: var(--em-d); border-color: var(--em-d); }

.btn-danger { background: var(--red-l); color: var(--red); border-color: rgba(255,71,87,.3); }
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--tx2); }
.btn-ghost:hover { background: var(--bg4); color: var(--tx); }

.btn-wsp {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
  font-weight: 600;
  width: 100%;
  justify-content: center;
}
.btn-wsp:hover { background: #128C7E; border-color: #128C7E; }

.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg4);
  cursor: pointer;
  color: var(--tx3);
  font-size: 14px;
  transition: all .15s;
  text-decoration: none;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg5); color: var(--tx); border-color: var(--border2); }

/* ============================================================
   PILLS / BADGES
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.pill.green  { background: var(--em-l); color: var(--em); }
.pill.red    { background: var(--red-l); color: var(--red); }
.pill.amber  { background: var(--amber-l); color: var(--amber); }
.pill.blue   { background: var(--blue-l); color: var(--blue); }
.pill.gray   { background: rgba(255,255,255,.06); color: var(--tx3); }
.pill.purple { background: rgba(139,92,246,.12); color: #A78BFA; }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--em-l);
  color: var(--em);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .5px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11px;
  color: var(--tx3);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--tx);
  background: var(--bg3);
  transition: border-color .15s, box-shadow .15s;
  font-family: 'Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
}
.form-control:focus {
  outline: none;
  border-color: var(--em);
  box-shadow: 0 0 0 3px var(--em-l);
}
.form-control option { background: var(--bg3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
  text-align: left;
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 11px;
  color: var(--tx3);
  font-weight: 700;
  padding: 0 10px 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
table.table td {
  padding: 10px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
  color: var(--tx);
}
table.table tbody tr { transition: background .1s; }
table.table tbody tr:hover td { background: var(--bg3); }

/* ============================================================
   SEARCH
   ============================================================ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  margin-bottom: 14px;
  transition: border-color .15s;
}
.search-bar:focus-within { border-color: var(--em); }
.search-bar i { font-size: 15px; color: var(--tx3); }
.search-bar input {
  background: none; border: none; outline: none;
  font-size: 13px; flex: 1; color: var(--tx);
  font-family: 'Segoe UI',system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
}
.search-bar input::placeholder { color: var(--tx3); }

/* ============================================================
   FILTERS
   ============================================================ */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-btn {
  padding: 5px 13px;
  border-radius: 20px;
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--tx3);
  text-decoration: none;
  transition: all .15s;
}
.filter-btn:hover { background: var(--bg4); color: var(--tx); }
.filter-btn.active {
  background: var(--em-l);
  color: var(--em);
  border-color: rgba(11,58,103,.3);
}

/* ============================================================
   FLASH
   ============================================================ */
.flash {
  padding: 11px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash.success { background: var(--em-l); color: var(--em); border: 1px solid rgba(11,58,103,.2); }
.flash.error   { background: var(--red-l); color: var(--red); border: 1px solid rgba(255,71,87,.2); }
.flash.info    { background: var(--blue-l); color: var(--blue); border: 1px solid rgba(61,142,255,.2); }

/* ============================================================
   UPLOAD AREA
   ============================================================ */
.upload-area {
  background: var(--bg3);
  border: 2px dashed var(--border2);
  border-radius: var(--r);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.upload-area:hover { border-color: var(--em); background: var(--em-ll); }
.upload-area i { font-size: 36px; color: var(--tx3); display: block; margin-bottom: 8px; }
.upload-area:hover i { color: var(--em); }

/* ============================================================
   CARNET
   ============================================================ */
.carnet {
  background: linear-gradient(135deg, #031B32 0%, #031B32 50%, #072A4A 100%);
  border-radius: 16px;
  padding: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(11,58,103,.3);
}
.carnet::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23059669' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.carnet::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.12) 0%, transparent 70%);
  top: -60px; right: -40px;
}
.qr-box {
  width: 124px; height: 124px;
  background: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 4px;
}
.qr-box img { display:block; width:112px; height:112px; object-fit:contain; }

/* ============================================================
   RESULT ESTADO
   ============================================================ */
.result-ok {
  background: var(--em-l);
  border: 1px solid rgba(11,58,103,.25);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.result-mal {
  background: var(--red-l);
  border: 1px solid rgba(255,71,87,.25);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.result-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.result-icon.ok  { background: var(--em); }
.result-icon.mal { background: var(--red); }
.result-icon i { font-size: 26px; color: #fff; }
.result-icon.ok i { color: #fff; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.prog-bar-wrap { height: 4px; background: var(--bg5); border-radius: 2px; overflow: hidden; }
.prog-bar-fill { height: 100%; border-radius: 2px; background: var(--em); transition: width .5s; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11,58,103,.08) 0%, transparent 70%);
  top: -200px; right: -200px;
}
.login-wrap::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11,58,103,.06) 0%, transparent 70%);
  bottom: -150px; left: -100px;
}
.login-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  width: 380px;
  position: relative;
  z-index: 1;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--em), transparent);
}

/* ============================================================
   TWO / THREE COL
   ============================================================ */
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }

/* ============================================================
   ACTIVITY CARDS
   ============================================================ */
.act-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: border-color .2s, transform .2s;
}
.act-card:hover { border-color: var(--border2); transform: translateY(-2px); }

/* ============================================================
   AVISO ITEM
   ============================================================ */
.aviso-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.aviso-item:last-child { border-bottom: none; }
.aviso-unread { width: 6px; height: 6px; border-radius: 50%; background: var(--em); flex-shrink: 0; margin-top: 5px; }

/* ============================================================
   GEOMETRIC DECORATIONS
   ============================================================ */
.geo-corner {
  position: absolute;
  bottom: 0; right: 0;
  width: 80px; height: 80px;
  background: conic-gradient(from 45deg, var(--em) 0deg 90deg, transparent 90deg 360deg);
  opacity: .06;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scanline {
  0%   { top: 10%; }
  100% { top: 90%; }
}
@keyframes pulse-em {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11,58,103,.3); }
  50%       { box-shadow: 0 0 0 8px rgba(11,58,103,0); }
}

.fade-in { animation: fadeInUp .4s ease both; }
.fade-in-2 { animation: fadeInUp .4s .08s ease both; }
.fade-in-3 { animation: fadeInUp .4s .16s ease both; }
.fade-in-4 { animation: fadeInUp .4s .24s ease both; }
.fade-in-5 { animation: fadeInUp .4s .32s ease both; }

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
.pwa-banner {
  display: none !important;
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: auto;
  transform: none;
  background: var(--bg2);
  border: 1px solid rgba(11,58,103,.3);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 0 0 1px rgba(11,58,103,.08);
  align-items: center;
  gap: 12px;
  z-index: 9999;
  width: min(360px, calc(100% - 28px));
  max-width: 360px;
  animation: fadeInUp .4s ease both;
}
.pwa-banner.show { display: flex !important; }
@media (max-width: 520px) {
  .pwa-banner {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    max-width: none;
  }
}

/* ============================================================
   LIGHT-SLATE OVERRIDES
   ============================================================ */

/* Sidebar — blanco con borde sutil */
.sidebar {
  background: #FFFFFF;
  border-right: 1px solid rgba(0,0,0,.08);
  box-shadow: 2px 0 12px rgba(0,0,0,.04);
}
.nav-item:hover { background: #F0F7F4; color: var(--tx); }
.nav-item.active { background: rgba(11,58,103,.1); color: var(--em-d); border-left-color: var(--em); }
.nav-lbl { color: #B0B8C8; }
.logo-sub { color: #A0A8B8; }

/* Topbar */
.topbar {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* Cards */
.card { background: #FFFFFF; border-color: rgba(0,0,0,.07); box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.card::before { background: linear-gradient(90deg, transparent, rgba(11,58,103,.1), transparent); }

/* Stat card */
.stat-card { background: #F7F9FC; border-color: rgba(0,0,0,.07); }
.stat-card:hover { border-color: rgba(11,58,103,.3); }

/* Table rows */
table.table tbody tr:hover td { background: #F7FCF9; }

/* Search bar */
.search-bar { background: #F7F8FA; border-color: rgba(0,0,0,.1); }

/* Form control */
.form-control { background: #FFFFFF; border-color: rgba(0,0,0,.15); color: var(--tx); }
.form-control:focus { border-color: var(--em); box-shadow: 0 0 0 3px rgba(11,58,103,.1); }

/* Buttons */
.btn { background: #FFFFFF; border-color: rgba(0,0,0,.12); color: var(--tx); }
.btn:hover { background: #F5F5F5; }
.icon-btn { background: #FFFFFF; border-color: rgba(0,0,0,.1); color: var(--tx2); }
.icon-btn:hover { background: #F5F5F5; color: var(--tx); }

/* Nav badge */
.nav-badge { background: var(--red); }
.nav-badge.green { background: var(--em); color: #fff; }

/* Login card */
.login-wrap { background: linear-gradient(135deg, #EEF2F7 0%, #E8F5EF 100%); }
.login-wrap::before { background: radial-gradient(circle, rgba(11,58,103,.1) 0%, transparent 70%); }
.login-wrap::after  { background: radial-gradient(circle, rgba(11,58,103,.07) 0%, transparent 70%); }
.login-card { background: #FFFFFF; border-color: rgba(0,0,0,.1); box-shadow: 0 8px 40px rgba(0,0,0,.1); }
.login-card::before { background: linear-gradient(90deg, transparent, var(--em), transparent); opacity: .4; }

/* Logo mark */
.logo-mark { background: var(--em); }

/* Geo corner */
.geo-corner { opacity: .05; }

/* Result ok/mal */
.result-ok  { background: rgba(11,58,103,.08); border-color: rgba(11,58,103,.2); }
.result-mal { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.2); }

/* PWA Banner */
.pwa-banner { background: #FFFFFF; box-shadow: 0 8px 32px rgba(0,0,0,.15); }

/* Sidebar footer */
.sidebar-footer { border-top-color: rgba(0,0,0,.07); }

/* Bottom nav mobile */
.bottom-nav { background: rgba(255,255,255,.97); border-top-color: rgba(0,0,0,.08); }
.bn-item { color: #A0A8B8; }
.bn-item.active { color: var(--em); }

/* Socio header card */
.socio-header-card {
  background: linear-gradient(135deg, #031B32 0%, #031B32 60%, #072A4A 100%);
}

/* Upload area */
.upload-area { background: #F7F8FA; border-color: rgba(0,0,0,.12); }
.upload-area:hover { border-color: var(--em); background: rgba(11,58,103,.05); }
.upload-area i { color: #A0A8B8; }
.upload-area:hover i { color: var(--em); }

/* Activity cards */
.act-card { background: #F7F9FC; border-color: rgba(0,0,0,.07); }
.act-card:hover { border-color: rgba(11,58,103,.25); }

/* Filter btn */
.filter-btn { background: #FFFFFF; border-color: rgba(0,0,0,.1); color: var(--tx2); }
.filter-btn:hover { background: #F5F5F5; color: var(--tx); }
.filter-btn.active { background: rgba(11,58,103,.1); color: var(--em-d); border-color: rgba(11,58,103,.25); }

/* Progress bar track */
.prog-bar-wrap { background: #E8EBF0; }

/* Scrollbar */
::-webkit-scrollbar-thumb { background: #C8CEDA; }

/* ============================================================
   SOCIO - CUOTAS Y PAGOS RESPONSIVE FIX
   ============================================================ */
.socio-cuotas-page {
  max-width: 1180px;
  width: 100%;
}

.cuota-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.cuota-status-card.ok {
  border-color: #5DCAA5;
  background: #E1F5EE;
}
.cuota-status-card.pendiente {
  border-color: #F09595;
  background: #FCEBEB;
}
.cuota-status-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,.55);
}
.cuota-status-icon i { font-size: 26px; }
.cuota-status-card.ok .cuota-status-icon i,
.cuota-status-card.ok .cuota-status-title,
.cuota-status-card.ok .cuota-status-sub { color: #085041; }
.cuota-status-card.pendiente .cuota-status-icon i,
.cuota-status-card.pendiente .cuota-status-title,
.cuota-status-card.pendiente .cuota-status-sub { color: #791F1F; }
.cuota-status-info { flex: 1; min-width: 0; }
.cuota-status-title {
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.cuota-status-sub { font-size: 13px; margin-top: 2px; font-weight: 600; }
.cuota-status-btn { flex-shrink: 0; white-space: nowrap; }

.cuotas-card { overflow: visible; }
.cuotas-table { min-width: 720px; }
.cuotas-table .muted-cell { color: var(--tx3); white-space: nowrap; }
.cuotas-mobile-list { display: none; }
.empty-state-sm {
  text-align: center;
  color: var(--tx3);
  padding: 28px 12px;
}
.empty-state-sm i {
  display: block;
  font-size: 34px;
  margin-bottom: 8px;
  color: var(--tx3);
}

@media (max-width: 768px) {
  .socio-cuotas-page { padding: 14px 12px 92px; }
  .cuota-status-card {
    align-items: flex-start;
    padding: 12px;
    gap: 10px;
  }
  .cuota-status-title { font-size: 16px; }
  .cuota-status-sub { font-size: 12px; }
  .cuota-status-btn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
  }
  .cuota-status-card { flex-wrap: wrap; }
  .cuota-status-info { width: calc(100% - 56px); }

  .cuotas-card {
    padding: 14px;
    border-radius: 14px;
  }
  .cuotas-desktop { display: none; }
  .cuotas-mobile-list {
    display: grid;
    gap: 10px;
  }
  .cuota-mini-card {
    background: #F7F9FC;
    border: 1px solid rgba(0,0,0,.07);
    border-radius: 12px;
    padding: 12px;
  }
  .cuota-mini-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }
  .cuota-mini-mes {
    font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--tx);
  }
  .cuota-mini-monto {
    color: var(--em-d);
    font-weight: 800;
    font-size: 16px;
    margin-top: 2px;
  }
  .cuota-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,.07);
  }
  .cuota-mini-grid span {
    display: block;
    font-size: 10px;
    color: var(--tx3);
    text-transform: uppercase;
    font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
    font-weight: 700;
    letter-spacing: .4px;
  }
  .cuota-mini-grid strong {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--tx2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .cuota-mini-grid { grid-template-columns: 1fr 1fr; }
}


/* ============================================================
   SOCIO - LIMPIEZA DE NAVEGACIÓN Y HISTORIAL RESPONSIVE
   ============================================================ */
.quick-access-grid { display: none; }

.socio-historial-page {
  max-width: 1180px;
  width: 100%;
}

.historial-card { overflow: visible; }
.historial-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.historial-total {
  font-size: 13px;
  color: var(--tx3);
  white-space: nowrap;
}
.historial-total strong { color: var(--em-d); }
.historial-table { min-width: 680px; }
.historial-table .muted-cell { color: var(--tx3); white-space: nowrap; }
.historial-mobile-list { display: none; }

@media (max-width: 768px) {
  .topbar {
    min-height: 58px;
    padding: 12px 16px;
  }
  .topbar .btn {
    max-width: 48%;
    white-space: nowrap;
  }
  .socio-historial-page { padding: 14px 12px 92px; }
  .historial-card {
    padding: 14px;
    border-radius: 14px;
  }
  .historial-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .historial-total {
    white-space: normal;
    font-size: 12px;
  }
  .historial-desktop { display: none; }
  .historial-mobile-list {
    display: grid;
    gap: 10px;
  }
  .historial-mini-card {
    background: #F7F9FC;
    border: 1px solid rgba(0,0,0,.07);
    border-radius: 12px;
    padding: 12px;
  }
  .historial-mini-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }
  .historial-mini-mes {
    font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--tx);
  }
  .historial-mini-monto {
    color: var(--em-d);
    font-weight: 800;
    font-size: 16px;
    margin-top: 2px;
  }
  .historial-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,.07);
  }
  .historial-mini-grid span {
    display: block;
    font-size: 10px;
    color: var(--tx3);
    text-transform: uppercase;
    font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
    font-weight: 700;
    letter-spacing: .4px;
  }
  .historial-mini-grid strong {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--tx2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


/* ============================================================
   SOCIO V11 — volver al diseño limpio con navegación inferior
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { display: none !important; }
  .main-content { margin-left: 0 !important; padding-bottom: 78px !important; }
  .topbar { min-height: 56px; padding: 12px 16px; }
  .bottom-nav { display: block !important; }
  .bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 0;
  }
  .bn-item {
    flex: 1;
    min-width: 0;
    padding: 5px 2px 6px;
    font-size: 9px;
    line-height: 1.05;
    text-align: center;
  }
  .bn-item i { font-size: 19px; }
}

/* Evita que quede el banner de instalación fijo si Chrome no habilitó instalar */
.pwa-banner { display: none !important; }
.pwa-banner.show { display: flex !important; }

/* ============================================================
   CABNA — Identidad visual del club
   Azul marino + celeste + blanco, basado en el escudo CABNA
   ============================================================ */
:root {
  --club-navy: #0B3A67;
  --club-navy-dark: #031B32;
  --club-navy-mid: #072A4A;
  --club-sky: #9EC8EA;
  --club-sky-soft: #EAF5FF;
  --club-white: #FFFFFF;
}

body {
  background:
    radial-gradient(circle at 18% 12%, rgba(158,200,234,.18), transparent 28%),
    linear-gradient(180deg, #F3F8FC 0%, #EDF2F7 100%);
}

.topbar {
  background: rgba(255,255,255,.94);
  color: var(--tx);
  box-shadow: 0 2px 14px rgba(3,27,50,.06);
}

.sidebar { background: linear-gradient(180deg, #FFFFFF 0%, #F7FBFF 100%); }

.sidebar-logo {
  background: linear-gradient(135deg, rgba(158,200,234,.25), rgba(255,255,255,.85));
}

.logo-mark {
  background: #FFFFFF !important;
  border: 1px solid rgba(11,58,103,.18);
  box-shadow: 0 6px 18px rgba(11,58,103,.10);
  overflow: hidden;
}

.logo-mark img,
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-mark img { padding: 3px; }

.brand-logo-circle,
.brand-logo-square {
  background: #FFFFFF !important;
  border: 1px solid rgba(11,58,103,.18);
  box-shadow: 0 8px 24px rgba(11,58,103,.12);
  overflow: hidden;
}

.brand-logo-circle { border-radius: 50% !important; }
.brand-logo-square { border-radius: 16px !important; }

.brand-logo-circle img,
.brand-logo-square img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  display: block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--club-navy), var(--club-navy-mid));
  border-color: var(--club-navy);
  color: #fff;
}

.btn-primary:hover { background: linear-gradient(135deg, var(--club-navy-dark), var(--club-navy)); }

.card { box-shadow: 0 8px 24px rgba(3,27,50,.05); }

.card::before { background: linear-gradient(90deg, transparent, rgba(158,200,234,.55), transparent); }

.socio-header-card,
.carnet-card,
.member-card {
  background: linear-gradient(135deg, #031B32 0%, #0B3A67 58%, #9EC8EA 140%) !important;
  border-color: rgba(158,200,234,.35) !important;
}

.nav-item.active,
.bn-item.active { color: var(--club-navy) !important; }

.nav-item.active {
  background: rgba(158,200,234,.22) !important;
  border-left-color: var(--club-navy) !important;
}

.pwa-banner {
  border-color: rgba(11,58,103,.22) !important;
  box-shadow: 0 10px 30px rgba(3,27,50,.12);
}

.pill.green {
  background: rgba(158,200,234,.25) !important;
  color: var(--club-navy) !important;
}

/* ============================================================
   V19 — PWA socio: Pagar visible + foto de socio + CABNA fino
   ============================================================ */
@media (max-width: 768px) {
  .bottom-nav-inner { justify-content: space-around; }
  .bn-item { padding: 5px 1px 6px; font-size: 8.5px; }
  .bn-item i { font-size: 18px; }
}

.socio-foto-perfil {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.9);
  box-shadow: 0 8px 22px rgba(0,0,0,.16);
  flex-shrink: 0;
}

.foto-upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 94px;
  border: 1.5px dashed rgba(11,58,103,.28);
  border-radius: 14px;
  background: var(--club-sky-soft);
  color: var(--club-navy);
  cursor: pointer;
  text-align: center;
  transition: .15s ease;
}
.foto-upload-box:hover {
  border-color: var(--club-navy);
  background: #fff;
}
.foto-upload-box i { font-size: 26px; color: var(--club-navy); }
.foto-upload-box span {
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
}
.foto-upload-box small { font-size: 11px; color: var(--tx3); }
.foto-upload-name { margin-top: 6px; font-size: 12px; color: var(--club-navy); font-weight: 600; }


/* ============================================================
   V20 — Foto de socio aplicada en menú, inicio y carnet
   ============================================================ */
.avatar-img {
  display: inline-block;
  border-radius: 50%;
  object-fit: cover;
  background: var(--em-l);
  border: 1px solid rgba(11,58,103,.16);
  box-shadow: 0 4px 12px rgba(3,27,50,.10);
  flex-shrink: 0;
}
.carnet-avatar-img {
  border: 2px solid rgba(158,200,234,.75) !important;
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}
.socio-hero-avatar-img {
  border: 2px solid rgba(255,255,255,.35) !important;
}

/* ============================================================
   CABNA V22 — PWA instalable por rol + Administración móvil
   ============================================================ */

[hidden] { display: none !important; }

/* Botones de instalación reutilizables */
.pwa-install-link {
  width: 100%;
  justify-content: center;
  min-height: 42px;
  margin-top: 14px;
}

.pwa-topbar-btn {
  width: auto;
  min-width: 40px;
  height: 38px;
  padding: 0 11px;
  gap: 6px;
  color: var(--club-navy);
  background: var(--club-sky-soft);
  border-color: rgba(11,58,103,.14);
}
.pwa-topbar-btn span { font-size: 12px; font-weight: 700; }

/* Banner inteligente de instalación */
.cabna-pwa-banner {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(430px, calc(100vw - 36px));
  padding: 12px;
  color: var(--tx);
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(11,58,103,.18);
  border-radius: 16px;
  box-shadow: 0 18px 55px rgba(3,27,50,.20);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
.cabna-pwa-banner.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.cabna-pwa-icon {
  width: 46px;
  height: 46px;
  padding: 4px;
  flex: 0 0 46px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(11,58,103,.13);
  border-radius: 12px;
}
.cabna-pwa-icon img,
.cabna-pwa-dialog-icon img { width: 100%; height: 100%; object-fit: contain; }
.cabna-pwa-copy { flex: 1; min-width: 0; }
.cabna-pwa-copy strong {
  display: block;
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 16px;
  color: var(--club-navy-dark);
}
.cabna-pwa-copy span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--tx3);
}
.cabna-pwa-dismiss { background: transparent; border-color: transparent; }

/* Modal con pasos manuales para iPhone/Android */
.cabna-pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3,27,50,.55);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.cabna-pwa-modal.show { opacity: 1; visibility: visible; pointer-events: auto; }
.cabna-pwa-dialog {
  position: relative;
  width: min(440px, 100%);
  padding: 28px 24px 22px;
  color: var(--tx);
  background: #fff;
  border: 1px solid rgba(11,58,103,.14);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(3,27,50,.28);
}
.cabna-pwa-close { position: absolute; top: 12px; right: 12px; }
.cabna-pwa-dialog-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 14px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(11,58,103,.14);
  border-radius: 18px;
  box-shadow: 0 9px 24px rgba(11,58,103,.12);
}
.cabna-pwa-dialog h2 {
  margin: 0 0 14px;
  text-align: center;
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 25px;
  color: var(--club-navy-dark);
}
.cabna-pwa-dialog p { margin: 0 0 12px; line-height: 1.55; color: var(--tx2); }
.cabna-pwa-dialog ol { margin: 0 0 14px 22px; color: var(--tx2); }
.cabna-pwa-dialog li { margin: 9px 0; padding-left: 4px; line-height: 1.45; }
.cabna-pwa-note {
  padding: 10px 12px;
  font-size: 12px;
  background: var(--club-sky-soft);
  border: 1px solid rgba(11,58,103,.10);
  border-radius: 10px;
}
.cabna-pwa-ok { width: 100%; justify-content: center; margin-top: 4px; min-height: 44px; }
.pwa-share-symbol { font-size: 19px; color: var(--club-navy); white-space: nowrap; }

/* Administración: base estable en cualquier ancho */
.admin-shell { overflow-x: hidden; }
.admin-shell .main-content { min-width: 0; width: calc(100% - var(--sidebar)); }
.admin-shell .page-content { width: 100%; min-width: 0; }
.admin-shell .topbar { gap: 10px; }
.admin-shell .topbar > * { min-width: 0; }
.admin-shell .sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: none;
  background: rgba(3,27,50,.52);
  backdrop-filter: blur(2px);
}
.admin-shell.sidebar-open { overflow: hidden; }
.admin-shell.sidebar-open .sidebar-backdrop { display: block; }
.nav-item-button {
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.admin-shell .table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.admin-shell .table-responsive > table { margin-bottom: 0; }
.admin-shell .mobile-scroll-hint {
  display: none;
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--tx3);
}

@media (max-width: 768px) {
  /* Corrige la regla del portal socio que ocultaba también el menú admin. */
  .admin-shell .sidebar {
    display: flex !important;
    width: min(310px, 86vw);
    transform: translateX(-105%);
    transition: transform .24s ease;
    box-shadow: 18px 0 48px rgba(3,27,50,.18);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .admin-shell .sidebar.open { transform: translateX(0); }
  .admin-shell .main-content {
    width: 100%;
    margin-left: 0 !important;
    padding-bottom: 0 !important;
  }
  .admin-shell .topbar {
    min-height: 60px;
    height: auto;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    flex-wrap: wrap;
  }
  .admin-shell #sidebar-toggle {
    display: inline-flex !important;
    width: 42px;
    height: 42px;
    color: var(--club-navy);
    background: var(--club-sky-soft);
  }
  .admin-shell .page-title {
    flex: 1 1 170px;
    font-size: 18px;
    line-height: 1.1;
  }
  .admin-shell .page-title span {
    display: block;
    margin: 3px 0 0;
    font-size: 11px;
    white-space: normal;
  }
  .admin-shell .page-content { padding: 12px; }
  .admin-shell .card {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 14px;
  }
  .admin-shell .card-title { margin-bottom: 12px; }
  .admin-shell .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px;
    margin-bottom: 12px;
  }
  .admin-shell .stat-card { padding: 13px; }
  .admin-shell .stat-val { font-size: 24px; overflow-wrap: anywhere; }
  .admin-shell .two-col,
  .admin-shell .three-col,
  .admin-shell .form-row { grid-template-columns: minmax(0, 1fr) !important; }
  .admin-shell .form-group { min-width: 0 !important; }
  .admin-shell .form-control,
  .admin-shell select.form-control,
  .admin-shell input.form-control { width: 100% !important; max-width: 100%; min-height: 44px; }
  .admin-shell .btn { min-height: 42px; }
  .admin-shell .icon-btn { min-width: 42px; min-height: 42px; }
  .admin-shell .page-content > form,
  .admin-shell form.card {
    align-items: stretch !important;
  }
  .admin-shell .page-content > form[style*="display:flex"],
  .admin-shell form.card[style*="display:flex"] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }
  .admin-shell .topbar form {
    width: 100%;
    display: flex !important;
    gap: 8px;
  }
  .admin-shell .topbar form .form-control { min-width: 0; }
  .admin-shell .mobile-scroll-hint { display: flex; align-items: center; gap: 5px; }
  .admin-shell .pwa-topbar-btn span { display: none; }

  /* Tablas administrativas convertidas en tarjetas legibles. */
  .admin-shell table.mobile-card-table,
  .admin-shell table.mobile-card-table tbody,
  .admin-shell table.mobile-card-table tfoot,
  .admin-shell table.mobile-card-table tr,
  .admin-shell table.mobile-card-table td {
    display: block;
    width: 100%;
  }
  .admin-shell table.mobile-card-table { min-width: 0 !important; border: 0; }
  .admin-shell table.mobile-card-table thead { display: none; }
  .admin-shell table.mobile-card-table tbody,
  .admin-shell table.mobile-card-table tfoot {
    display: grid;
    gap: 10px;
  }
  .admin-shell table.mobile-card-table tfoot { margin-top: 10px; }
  .admin-shell table.mobile-card-table tbody tr,
  .admin-shell table.mobile-card-table tfoot tr {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(11,58,103,.10);
    border-radius: 13px;
    box-shadow: 0 5px 16px rgba(3,27,50,.05);
  }
  .admin-shell table.mobile-card-table tbody tr:hover td { background: transparent; }
  .admin-shell table.mobile-card-table td {
    display: grid;
    grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    text-align: left !important;
    white-space: normal !important;
    border-bottom: 1px solid rgba(0,0,0,.055);
    overflow-wrap: anywhere;
  }
  .admin-shell table.mobile-card-table td::before {
    content: attr(data-label);
    font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .45px;
    text-transform: uppercase;
    color: var(--tx3);
  }
  .admin-shell table.mobile-card-table td:last-child { border-bottom: 0; }
  .admin-shell table.mobile-card-table td[colspan] {
    display: block;
    text-align: center !important;
  }
  .admin-shell table.mobile-card-table td[colspan]::before { display: none; }
  .admin-shell table.mobile-card-table td form,
  .admin-shell table.mobile-card-table td .btn { max-width: 100%; }
  .admin-shell table.mobile-card-table td > div[style*="display:flex"] { flex-wrap: wrap; }

  .cabna-pwa-banner {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
  }
  .cabna-pwa-copy span { display: none; }
}

@media (max-width: 430px) {
  .admin-shell .stats-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .admin-shell .topbar { gap: 8px; }
  .admin-shell table.mobile-card-table td {
    grid-template-columns: minmax(82px, 34%) minmax(0, 1fr);
    padding: 9px 10px;
  }
  .cabna-pwa-banner { flex-wrap: wrap; }
  .cabna-pwa-copy { min-width: calc(100% - 103px); }
  .cabna-pwa-banner > .btn { flex: 1; justify-content: center; }
}

@media (max-width: 768px) {
  body[data-pwa-role="socio"] .bottom-nav {
    padding-top: 7px;
  }
  body[data-pwa-role="socio"] .bottom-nav-inner {
    min-height: 54px;
    align-items: center;
  }
  body[data-pwa-role="socio"] .bn-item {
    min-height: 48px;
    justify-content: center;
    padding: 5px 1px 7px;
    font-size: 9px;
  }
  body[data-pwa-role="socio"] .bottom-nav ~ .cabna-pwa-banner {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

/* ============================================================
   CABNA v31 — mejoras generales, administración móvil y PWA
   ============================================================ */

/* Navegación administrativa inferior */
.admin-mobile-nav {
  display: none;
  position: fixed;
  z-index: 390;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 62px;
  padding: 5px 4px max(6px, env(safe-area-inset-bottom));
  background: rgba(3, 27, 50, .97);
  border-top: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 -8px 28px rgba(3,27,50,.22);
  backdrop-filter: blur(18px);
}
.admin-mobile-nav a,
.admin-mobile-nav button {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.64);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.admin-mobile-nav i { font-size: 21px; }
.admin-mobile-nav span {
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .35px;
  text-transform: uppercase;
}
.admin-mobile-nav .active { color: #9EC8EA; }

/* Avisos */
.notice-card {
  display: flex;
  gap: 13px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
.notice-card:last-child { border-bottom: 0; }
.notice-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--bg);
  color: var(--acc-md);
  font-size: 21px;
}
.notice-content { min-width: 0; flex: 1; }
.notice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.notice-head h2 { margin: 0; font-size: 15px; line-height: 1.3; }
.notice-body { margin-top: 7px; color: var(--tx2); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.notice-card time { display: block; margin-top: 8px; color: var(--tx3); font-size: 11px; }

/* Datos bancarios y copiar */
.payment-data-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.copy-mini {
  min-width: 58px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid rgba(11,58,103,.16);
  border-radius: 7px;
  background: #fff;
  color: var(--acc-md);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.copy-mini:active { transform: scale(.97); }
.cuota-receipt-btn { width: 100%; justify-content: center; margin-top: 10px; }

/* Búsqueda, configuración y diagnóstico */
.global-search-form { display: flex; align-items: flex-end; gap: 12px; }
.search-result-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.search-result-item {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: 0; }
.search-result-item > span:nth-child(2) { min-width: 0; }
.search-result-item strong,
.search-result-item small { display: block; overflow: hidden; text-overflow: ellipsis; }
.search-result-item small { margin-top: 3px; color: var(--tx3); font-size: 11px; white-space: normal; }
.result-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--bg); color: var(--acc-md); font-size: 19px; }
.empty-text { color: var(--tx3); font-size: 13px; }
.settings-grid,
.system-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.settings-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.system-grid > .card:first-child { grid-row: span 2; }
.system-copy { color: var(--tx3); font-size: 13px; line-height: 1.55; }
.system-summary { display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 11px; margin-bottom: 14px; }
.system-summary.ok { background: #E1F5EE; color: #085041; }
.system-summary.warn { background: #FFF3D6; color: #854F0B; }
.system-summary > i { font-size: 26px; }
.system-summary strong,
.system-summary span { display: block; }
.system-summary span { margin-top: 2px; font-size: 11px; opacity: .8; }
.check-list { display: grid; gap: 8px; }
.check-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.check-row:last-child { border-bottom: 0; }
.check-row > i { font-size: 18px; }
.check-row > i.ok { color: var(--em); }
.check-row > i.bad { color: var(--red); }
.check-row strong,
.check-row small { display: block; }
.check-row small { margin-top: 2px; color: var(--tx3); font-size: 10px; overflow-wrap: anywhere; }
.install-link-grid,
.install-selector-grid { display: grid; gap: 9px; }
.install-role-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: inherit;
  text-decoration: none;
  background: var(--bg);
}
.install-role-card > i { font-size: 23px; color: var(--acc-md); }
.install-role-card strong,
.install-role-card small { display: block; }
.install-role-card small { margin-top: 2px; color: var(--tx3); font-size: 11px; }
.maintenance-actions { display: grid; gap: 9px; }
.maintenance-actions form,
.maintenance-actions .btn { width: 100%; }
.maintenance-actions .btn { justify-content: center; }

/* Instalación PWA */
.install-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at top right,rgba(158,200,234,.35),transparent 35%),var(--bg); }
.install-page-card { width: min(680px,100%); padding: 28px; border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: 0 22px 65px rgba(3,27,50,.13); }
.install-page-logo { width: 86px; height: 86px; object-fit: contain; display: block; margin: 0 auto 14px; }
.install-page-kicker { text-align: center; color: var(--acc-md); text-transform: uppercase; font: 700 12px 'Barlow Condensed',sans-serif; letter-spacing: 1.2px; }
.install-page h1 { margin: 8px 0; text-align: center; font-family: 'Barlow Condensed',sans-serif; font-size: clamp(29px,7vw,42px); }
.install-page-card > p { text-align: center; color: var(--tx3); line-height: 1.55; }
.install-main-button { width: 100%; justify-content: center; min-height: 50px; margin: 8px 0; }
.install-status { padding: 10px; border-radius: 9px; text-align: center; background: var(--bg); color: var(--tx2); font-size: 12px; }
.install-requirements,
.install-manual { margin-top: 18px; }
.install-step { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.45; }
.install-step:last-child { border-bottom: 0; }
.install-step > strong:first-child { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: var(--acc-md); color: #fff; }

/* Recibos */
.receipt-body { margin: 0; padding: 28px; background: #EEF2F6; color: #111; font-family: Arial,sans-serif; }
.receipt-sheet { width: min(760px,100%); margin: 0 auto; padding: 32px; background: #fff; border: 1px solid #D8DEE5; border-radius: 16px; box-shadow: 0 20px 55px rgba(3,27,50,.12); }
.receipt-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid #0B3A67; }
.receipt-head img { width: 82px; height: 82px; object-fit: contain; }
.receipt-paid { display: inline-flex; padding: 7px 12px; border-radius: 999px; background: #E1F5EE; color: #085041; font-weight: 700; }
.receipt-info { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 24px 0; }
.receipt-detail { padding: 12px; border-radius: 10px; background: #F5F7F9; }
.receipt-detail span,
.receipt-detail strong { display: block; }
.receipt-detail span { color: #667085; font-size: 11px; text-transform: uppercase; }
.receipt-detail strong { margin-top: 4px; }
.receipt-concept { font-size: 21px; font-weight: 700; }
.receipt-total { margin: 20px 0; padding: 18px; text-align: right; background: #031B32; color: #fff; border-radius: 12px; font-size: 28px; font-weight: 800; }
.receipt-note,
.receipt-foot { color: #667085; font-size: 11px; line-height: 1.5; }
.receipt-foot { margin-top: 22px; padding-top: 15px; border-top: 1px solid #D8DEE5; }

/* Mensajes dinámicos */
.cabna-toast-stack { position: fixed; z-index: 1000; top: 16px; right: 16px; display: grid; gap: 8px; width: min(360px,calc(100vw - 32px)); }
.cabna-toast { padding: 12px 14px; border-radius: 10px; background: #031B32; color: #fff; box-shadow: 0 12px 35px rgba(3,27,50,.28); font-size: 13px; }
.cabna-toast.error { background: #791F1F; }
.cabna-toast.success { background: #085041; }
.cabna-update-banner { position: fixed; z-index: 900; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: min(520px,calc(100vw - 24px)); padding: 12px; border-radius: 13px; background: #031B32; color: #fff; box-shadow: 0 16px 45px rgba(3,27,50,.3); }
.cabna-update-banner span { min-width: 0; flex: 1; font-size: 12px; }

@media (max-width: 980px) {
  .search-result-grid { grid-template-columns: minmax(0,1fr); }
  .settings-grid,
  .system-grid { grid-template-columns: minmax(0,1fr); }
  .system-grid > .card:first-child { grid-row: auto; }
  .settings-actions { grid-column: auto; }
}

@media (max-width: 768px) {
  .admin-mobile-nav { display: flex; }
  .admin-shell .main-content { padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important; }
  .admin-shell .page-content { padding: 14px 12px 20px !important; }
  .admin-shell .topbar { position: sticky; top: 0; z-index: 180; min-height: 58px; padding: 9px 12px !important; background: rgba(255,255,255,.94); backdrop-filter: blur(16px); }
  .admin-shell .page-title { min-width: 0; font-size: 20px; line-height: 1.05; }
  .admin-shell .page-title span { display: block; margin: 3px 0 0; font-size: 10px; line-height: 1.2; }
  .admin-shell .sidebar { display: flex !important; position: fixed; z-index: 500; left: 0; top: 0; bottom: 0; width: min(310px,86vw); transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 45px rgba(3,27,50,.25); }
  .admin-shell .sidebar.open { transform: translateX(0); }
  .admin-shell .sidebar-backdrop { display: block; position: fixed; z-index: 490; inset: 0; background: rgba(3,27,50,.56); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .admin-shell .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .admin-shell #sidebar-toggle { display: inline-flex !important; }
  .admin-shell .two-col { grid-template-columns: minmax(0,1fr) !important; }
  .global-search-form { align-items: stretch; flex-direction: column; }
  .global-search-form .btn { width: 100%; justify-content: center; }
  .check-row { grid-template-columns: auto minmax(0,1fr); }
  .check-row > .pill { grid-column: 2; justify-self: start; }
  .notice-head { flex-direction: column; gap: 6px; }
  .receipt-body { padding: 10px; }
  .receipt-sheet { padding: 20px 16px; border-radius: 12px; }
  .receipt-head { align-items: flex-start; }
  .receipt-info { grid-template-columns: minmax(0,1fr); }
  .receipt-total { font-size: 23px; }
  body[data-pwa-role="socio"] .bn-item { font-size: 10.5px; }
}

@media print {
  .no-print { display: none !important; }
  .receipt-body { padding: 0; background: #fff; }
  .receipt-sheet { width: 100%; box-shadow: none; border: 0; border-radius: 0; }
}

/* Ajustes de interacción v31 */
@media (max-width: 768px) {
  .admin-shell.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; display: block; }
}
#cabna-live-toast {
  position: fixed;
  z-index: 1200;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(360px, calc(100vw - 28px));
  padding: 12px 14px;
  color: #fff;
  background: #031B32;
  border-radius: 11px;
  box-shadow: 0 16px 42px rgba(3,27,50,.30);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  font-size: 13px;
}
#cabna-live-toast.show { opacity: 1; transform: translateY(0); }
#cabna-live-toast.success { background: #085041; }
#cabna-live-toast.error { background: #791F1F; }
#cabna-live-toast i { font-size: 19px; }
.cabna-update-banner { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.cabna-update-banner.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.is-loading { cursor: wait !important; opacity: .72; }
.spin { animation: cabna-spin .8s linear infinite; }
@keyframes cabna-spin { to { transform: rotate(360deg); } }

/* CABNA v31.1 — selector general de aplicaciones y recibos */
.install-selector {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 12%,rgba(158,200,234,.38),transparent 31%),
    radial-gradient(circle at 90% 88%,rgba(11,58,103,.12),transparent 34%),
    var(--bg);
}
.install-selector > main {
  width: min(760px,100%);
  padding: 34px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 24px 70px rgba(3,27,50,.14);
}
.install-selector > main > img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 12px;
}
.install-selector h1 {
  margin: 0;
  color: var(--navy);
  font-family: 'Barlow Condensed',sans-serif;
  font-size: clamp(31px,7vw,46px);
}
.install-selector main > p { margin: 8px 0 24px; color: var(--tx3); }
.install-selector-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.install-selector-grid > a {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 14px;
  color: var(--tx);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--bg);
  transition: transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.install-selector-grid > a:hover {
  transform: translateY(-3px);
  border-color: rgba(11,58,103,.28);
  box-shadow: 0 12px 28px rgba(3,27,50,.10);
}
.install-selector-grid i { font-size: 34px; color: var(--acc-md); }
.install-selector-grid strong { font-size: 16px; }
.install-selector-grid span { color: var(--tx3); font-size: 12px; line-height: 1.4; }
.receipt-head > div:nth-child(2) span,
.receipt-info span,
.receipt-concept span,
.receipt-total span { display: block; color: #667085; font-size: 11px; text-transform: uppercase; letter-spacing: .45px; }
.receipt-head > div:nth-child(2) h1 { margin: 3px 0; color: #031B32; font-size: 25px; }
.receipt-head > div:nth-child(2) p { margin: 0; color: #667085; }
.receipt-info strong,
.receipt-concept strong { display: block; margin-top: 4px; }
.receipt-info small { display: block; margin-top: 3px; color: #667085; }
.receipt-concept { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 18px; border: 1px solid #D8DEE5; border-radius: 12px; }
.receipt-concept .receipt-total { min-width: 220px; margin: 0; }
.receipt-detail { width: 100%; margin-top: 18px; border-collapse: collapse; overflow: hidden; }
.receipt-detail td { padding: 11px 12px; border-bottom: 1px solid #E2E7ED; }
.receipt-detail tr:last-child td { border-bottom: 0; }
.receipt-detail td:last-child { text-align: right; font-weight: 700; }
.receipt-note { margin-top: 16px; padding: 12px; border-radius: 9px; background: #FFF8E8; color: #6F4A0B; }
.receipt-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
@media (max-width:700px) {
  .install-selector { padding: 14px; }
  .install-selector > main { padding: 25px 18px; border-radius: 18px; }
  .install-selector-grid { grid-template-columns: minmax(0,1fr); }
  .install-selector-grid > a { min-height: 112px; }
  .receipt-head { flex-wrap: wrap; }
  .receipt-concept { align-items: stretch; flex-direction: column; }
  .receipt-concept .receipt-total { min-width: 0; }
  .receipt-foot { align-items: stretch; flex-direction: column; }
  .receipt-foot .btn { width: 100%; justify-content: center; }
}
@media print {
  .receipt-head > div:nth-child(2) h1 { color: #000; }
}

/* ============================================================
   V51 — Menú "Más" del portal del socio
   ============================================================ */
.mobile-menu-grid {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mobile-menu-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 13px;
  min-width: 0;
  min-height: 78px;
  padding: 15px 16px;
  color: var(--tx);
  text-decoration: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 5px 18px rgba(3, 27, 50, .06);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-card:hover {
  color: var(--tx);
  background: #fff;
  border-color: rgba(11, 58, 103, .22);
  box-shadow: 0 9px 24px rgba(3, 27, 50, .10);
  transform: translateY(-1px);
}

.mobile-menu-card:active {
  transform: scale(.985);
}

.mobile-menu-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 3px;
}

.mobile-menu-card > i:first-child {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  color: var(--em);
  background: var(--em-l);
  font-size: 23px;
  line-height: 1;
}

.mobile-menu-card > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mobile-menu-card strong,
.mobile-menu-card small {
  display: block;
  min-width: 0;
}

.mobile-menu-card strong {
  color: var(--tx);
  font-family: 'Arial Narrow','Segoe UI',system-ui,sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.08;
}

.mobile-menu-card small {
  color: var(--tx2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.mobile-menu-card > i:last-child {
  justify-self: end;
  color: var(--tx3);
  font-size: 20px;
}

.mobile-menu-card[href$="logout.php"] > i:first-child {
  color: var(--red);
  background: var(--red-l);
}

.mobile-menu-card[href$="logout.php"] strong {
  color: var(--red);
}

@media (max-width: 768px) {
  .main-content > .page-content:has(.mobile-menu-grid),
  .main-content > .socio-more-page {
    padding: 18px 14px calc(96px + env(safe-area-inset-bottom));
  }

  .mobile-menu-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }

  .mobile-menu-card {
    min-height: 72px;
    padding: 13px 14px;
    border-radius: 14px;
  }
}

@media (max-width: 380px) {
  .mobile-menu-card {
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    gap: 10px;
    padding-inline: 12px;
  }

  .mobile-menu-card > i:first-child {
    width: 42px;
    height: 42px;
    font-size: 21px;
  }

  .mobile-menu-card strong {
    font-size: 17px;
  }

  .mobile-menu-card small {
    font-size: 12px;
  }
}


/* ================================================================
   CABNA V52 — corrección de las pantallas de instalación PWA
   ================================================================ */
.install-page {
  overflow-x: hidden;
}
.install-page-card {
  position: relative;
  overflow: hidden;
}
.install-page-logo {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  overflow: hidden;
}
.install-page-logo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.install-page .install-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin: 14px 0 8px;
  line-height: 1.35;
}
.install-page .install-status i {
  flex: 0 0 auto;
  font-size: 18px;
}
.install-page .install-open-button {
  width: 100%;
  min-height: 50px;
  justify-content: center;
  margin-top: 2px;
}
.install-page .install-manual h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 5.4vw, 29px);
  line-height: 1.15;
}
.install-page .install-step {
  display: grid;
  grid-template-columns: minmax(112px, 138px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 13px 0;
}
.install-page .install-step > b {
  color: var(--tx1);
  line-height: 1.35;
}
.install-page .install-step > span {
  min-width: 0;
  color: var(--tx2);
  overflow-wrap: anywhere;
}
.install-page .pwa-share-symbol {
  display: inline-block;
  margin: 0 2px;
  font-size: 18px;
  color: var(--acc-md);
  vertical-align: -2px;
}
.install-page .install-requirements {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--tx3);
  font-size: 12px;
  line-height: 1.35;
}
.install-page .install-requirements > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.install-page .install-requirements i {
  flex: 0 0 auto;
  font-size: 17px;
  color: var(--acc-md);
}
.install-page.is-installed .install-main-button,
.install-page.is-installed .install-manual {
  display: none !important;
}
.install-page.is-installed .install-open-button {
  margin-top: 12px;
}

@media (max-width: 560px) {
  .install-page {
    place-items: start center;
    padding: max(18px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
  }
  .install-page-card {
    padding: 24px 18px 22px;
    border-radius: 18px;
  }
  .install-page-logo {
    width: 76px;
    height: 76px;
    margin-bottom: 12px;
  }
  .install-page h1 {
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.08;
  }
  .install-page-card > p {
    margin: 8px 0 12px;
    font-size: 14px;
  }
  .install-page .install-step {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 10px;
    font-size: 12.5px;
  }
  .install-page .install-requirements {
    justify-content: flex-start;
  }
}

@media (max-width: 390px) {
  .install-page .install-step {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .install-page .install-step > b {
    font-size: 13px;
  }
  .install-page .install-requirements {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}


/* CABNA V54 — etiqueta visible de versión */
.app-version {
  margin-top: 18px;
  padding: 8px 12px;
  text-align: center;
  color: var(--tx3, #8b95a7);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.socio-more-page > .app-version {
  margin-top: 14px;
  padding-bottom: 2px;
}
.install-page-card > .app-version,
.install-selector .app-version {
  margin-top: 16px;
  border-top: 1px solid var(--border, rgba(0,0,0,.08));
  padding-top: 14px;
}


/* ============================================================
   CABNA V56 — Enlace secundario de instrucciones de instalación
   ============================================================ */
.login-install-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: 10px auto 0;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--club-navy);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}
.login-install-help:visited {
  color: var(--club-navy);
}
.login-install-help:hover {
  color: var(--club-navy-dark);
  background: var(--club-sky-soft);
  text-decoration: none;
}
.login-install-help:focus-visible {
  color: var(--club-navy-dark);
  background: var(--club-sky-soft);
  outline: 3px solid rgba(11,58,103,.18);
  outline-offset: 2px;
}
.login-install-help i {
  flex: 0 0 auto;
  font-size: 16px;
}
.pwa-standalone .login-install-help {
  display: none !important;
}


/* V58 — Diagnóstico de correo */
.email-health-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
}
.email-health-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
}
.email-health-grid span,
.email-health-grid strong,
.email-health-grid small { display: block; }
.email-health-grid span {
  margin-bottom: 5px;
  color: var(--tx3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.email-health-grid strong {
  color: var(--tx);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.email-health-grid small {
  margin-top: 4px;
  color: var(--tx3);
  font-size: 10px;
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  .email-health-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .email-health-grid { grid-template-columns: minmax(0,1fr); }
}

/* ============================================================
   CABNA V69 — Integración visual final
   ============================================================ */
.context-action-link,
.inline-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: var(--club-navy, #0B3A67);
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.context-action-link:visited,
.inline-action-link:visited { color: var(--club-navy, #0B3A67); }
.context-action-link {
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(11,58,103,.14);
  border-radius: 8px;
  background: var(--club-sky-soft, #EAF5FF);
  font-size: 12px;
  line-height: 1.25;
}
.context-action-link:hover {
  color: var(--club-navy-dark, #031B32);
  border-color: rgba(11,58,103,.28);
  background: #DDEFFF;
}
.inline-action-link {
  padding: 2px 0;
  font-size: 12px;
}
.inline-action-link:hover { color: var(--club-navy-dark, #031B32); text-decoration: underline; }
.context-action-link:focus-visible,
.inline-action-link:focus-visible {
  outline: 3px solid rgba(11,58,103,.18);
  outline-offset: 2px;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.email-queue-table {
  min-width: 1050px;
  table-layout: fixed;
}
.email-queue-table th:nth-child(1) { width: 100px; }
.email-queue-table th:nth-child(2) { width: 205px; }
.email-queue-table th:nth-child(3) { width: 250px; }
.email-queue-table th:nth-child(4) { width: 75px; }
.email-queue-table th:nth-child(5) { width: 245px; }
.email-queue-table th:nth-child(6) { width: 260px; }
.email-queue-table th:nth-child(7) { width: 90px; }
.email-queue-table td,
.email-queue-table th { overflow-wrap: anywhere; }
.email-queue-dates { line-height: 1.55; }
.email-queue-error { color: var(--red, #A61B1B); line-height: 1.4; }
.email-queue-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.socio-file-links { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 3px; }
.socio-pay-badge-link {
  background: var(--amber-l);
  border: 1px solid rgba(255,184,0,.3);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  display: block;
  text-decoration: none;
}
.socio-pay-badge-link:visited { color: inherit; }
.socio-empty-action { display: inline-flex; margin-top: 8px; }
.pwa-standalone .pwa-install-only { display: none !important; }

@media (max-width: 768px) {
  .form-actions > .btn,
  .form-actions > button { min-width: 120px; justify-content: center; }
  .admin-shell table.email-queue-table { min-width: 0 !important; table-layout: auto; }
  .admin-shell table.email-queue-table td { align-items: start; }
  .email-queue-actions .icon-btn { min-width: 42px; min-height: 42px; }
  .context-action-link { width: 100%; justify-content: center; text-align: center; }
}

@media (max-width: 430px) {
  .form-actions { display: grid; grid-template-columns: minmax(0,1fr); }
  .form-actions > .btn,
  .form-actions > button { width: 100%; }
}


/* ============================================================
   CABNA V69 — Accesos unificados, instalación y marca LGP
   ============================================================ */
.cabna-login-wrap {
  min-height: 100svh;
  width: 100%;
  padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 82% 12%, rgba(158,200,234,.24), transparent 30%),
    radial-gradient(circle at 10% 88%, rgba(11,58,103,.07), transparent 28%),
    linear-gradient(135deg, #EEF3F7 0%, #EAF5F1 100%);
  overflow-x: hidden;
}
.cabna-login-card {
  width: min(390px, 100%);
  max-width: 390px;
  padding: 36px 32px 28px;
  border: 1px solid rgba(11,58,103,.13);
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(3,27,50,.13);
}
.cabna-login-brand {
  margin: 0 0 28px;
  text-align: center;
}
.cabna-login-logo {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border-radius: 18px !important;
}
.cabna-login-brand h1 {
  margin: 0;
  color: var(--tx);
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.cabna-login-brand p {
  margin: 8px 0 0;
  color: var(--tx3);
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.cabna-login-form .form-group { margin-bottom: 15px; }
.cabna-login-input { position: relative; }
.cabna-login-input > i {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  color: #8490A7;
  font-size: 17px;
  pointer-events: none;
}
.cabna-login-input .form-control {
  min-height: 48px;
  padding-left: 42px;
}
.cabna-login-submit {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  margin-top: 6px;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .3px;
}
.cabna-login-card .pwa-install-link {
  display: flex;
  min-height: 46px;
  margin-top: 16px;
  text-decoration: none;
}
.cabna-login-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  color: #8B95A7;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .25px;
  text-align: center;
}
.pwa-standalone .cabna-login-card .pwa-install-link,
.pwa-standalone .cabna-login-card .login-install-help {
  display: none !important;
}
@media (max-width: 480px) {
  .cabna-login-wrap { padding-left: 14px; padding-right: 14px; }
  .cabna-login-card { padding: 30px 22px 24px; border-radius: 16px; }
  .cabna-login-brand { margin-bottom: 24px; }
  .cabna-login-logo { width: 66px; height: 66px; }
  .cabna-login-brand h1 { font-size: 26px; }
}


/* V69 — Selector visual y permisos administrativos */
.permission-action-hidden{display:none!important}
.permissions-editor{margin:16px 0;border:1px solid var(--border2);border-radius:12px;overflow:hidden;background:var(--bg2)}
.permissions-editor-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;background:var(--bg3);border-bottom:1px solid var(--border)}
.permissions-editor-head strong{display:block;font-size:14px}.permissions-editor-head small{display:block;color:var(--tx3);margin-top:3px}.permissions-presets{display:flex;gap:6px;flex-wrap:wrap}
.permissions-matrix{display:grid}.permission-row{display:grid;grid-template-columns:minmax(180px,1fr) 86px 105px 90px;align-items:center;gap:8px;padding:11px 14px;border-bottom:1px solid var(--border)}.permission-row:last-child{border-bottom:0}
.permission-module{display:flex;align-items:center;gap:10px;min-width:0}.permission-module>i{width:34px;height:34px;border-radius:9px;background:var(--em-ll);color:var(--em);display:grid;place-items:center;font-size:18px}.permission-module span{min-width:0}.permission-module strong,.permission-module small{display:block}.permission-module small{font-size:10px;color:var(--tx3);margin-top:2px}.permission-row label{display:flex;align-items:center;gap:6px;font-size:12px;cursor:pointer}.permission-row input{accent-color:var(--em);width:16px;height:16px}.permission-na{opacity:.35;cursor:not-allowed!important}
.icon-picker{position:relative}.icon-picker-trigger{width:100%;min-height:48px;display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border:1px solid var(--border2);border-radius:var(--r-sm);background:var(--bg2);color:var(--tx);font:inherit;cursor:pointer}.icon-picker-trigger:hover{border-color:rgba(11,58,103,.35)}.icon-picker-current{display:flex;align-items:center;gap:10px}.icon-picker-current>i{width:34px;height:34px;border-radius:9px;background:var(--em-ll);color:var(--em);display:grid;place-items:center;font-size:20px}.icon-picker-chevron{transform:rotate(90deg);color:var(--tx3)}
.icon-picker-panel{position:absolute;z-index:80;top:calc(100% + 7px);left:0;width:min(620px,calc(100vw - 48px));max-height:480px;overflow:auto;background:var(--bg2);border:1px solid var(--border2);border-radius:12px;box-shadow:0 20px 55px rgba(3,27,50,.18);padding:12px}.icon-picker-toolbar{position:sticky;top:-12px;z-index:2;display:flex;align-items:center;gap:8px;background:var(--bg2);padding:2px 0 10px}.icon-picker-toolbar input{width:100%;height:42px;border:1px solid var(--border2);border-radius:8px;padding:0 12px;font:inherit}.icon-picker-group h4{font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:var(--tx3);margin:10px 0 7px}.icon-picker-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.icon-picker-option{display:flex;align-items:center;gap:8px;min-height:52px;padding:8px;border:1px solid var(--border);border-radius:9px;background:var(--bg3);color:var(--tx);text-align:left;cursor:pointer}.icon-picker-option i{width:32px;height:32px;display:grid;place-items:center;border-radius:8px;background:#fff;color:var(--em);font-size:19px;flex:0 0 auto}.icon-picker-option span{font-size:12px;font-weight:600}.icon-picker-option:hover,.icon-picker-option.selected{border-color:var(--em);background:var(--em-ll)}
@media(max-width:760px){.permissions-editor-head{align-items:flex-start;flex-direction:column}.permission-row{grid-template-columns:1fr repeat(3,auto);padding:10px}.permission-module{grid-column:1/-1}.icon-picker-panel{position:fixed;left:12px;right:12px;top:auto;bottom:calc(12px + env(safe-area-inset-bottom));width:auto;max-height:75vh}.icon-picker-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:430px){.permission-row{grid-template-columns:repeat(3,1fr)}.permission-module{grid-column:1/-1}.permission-row label{justify-content:center}.icon-picker-grid{grid-template-columns:1fr}}

.admin-readonly-badge{margin-left:auto;white-space:nowrap}.admin-accounts-layout{grid-template-columns:minmax(540px,1.15fr) minmax(360px,.85fr)!important}
@media(max-width:1180px){.admin-accounts-layout{grid-template-columns:1fr!important}}

.icon-picker-card{overflow:visible;z-index:20}


/* CABNA V75 — opción de acceso recordado */
.cabna-remember-option{display:flex;align-items:center;gap:11px;margin:2px 0 16px;padding:11px 12px;border:1px solid var(--border);border-radius:10px;background:rgba(255,255,255,.58);cursor:pointer;user-select:none}
.cabna-remember-option:hover{border-color:rgba(11,58,103,.32);background:rgba(255,255,255,.82)}
.cabna-remember-option input{width:18px;height:18px;accent-color:var(--primary);flex:0 0 auto}
.cabna-remember-option span{display:grid;gap:2px;line-height:1.15}
.cabna-remember-option strong{font-size:13px;color:var(--tx)}
.cabna-remember-option small{font-size:11px;color:var(--tx3)}
