/* ============================================================
   MutualGES - Estilos principales
   RED ENTRE RIOS
   ============================================================ */

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #dbeafe;
  --accent:        #0ea5e9;
  --success:       #16a34a;
  --warning:       #d97706;
  --danger:        #dc2626;
  --sidebar-bg:    #0f1624;
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        10px;
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --shadow-md:     0 4px 24px rgba(0,0,0,.12);
  --font:          'Plus Jakarta Sans', sans-serif;
  --font-display:  'Sora', sans-serif;
  --text:          #1e293b;
  --muted:         #64748b;
  --border:        #e2e8f0;
  --bg:            #f1f5f9;
}

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

body {
  font-family: var(--font);
  font-size: .9rem;
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── LAYOUT ADMIN ───────────────────────────────────────────── */
.admin-body { background: var(--bg); }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.brand-name  { color: #fff; font-weight: 700; font-size: .95rem; font-family: var(--font-display); display: block; }
.brand-sub   { color: rgba(255,255,255,.4); font-size: .72rem; display: block; }
.sidebar-close { background: none; border: none; color: rgba(255,255,255,.5); font-size: 1.1rem; margin-left: auto; cursor: pointer; }

/* Nav */
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section  { margin-bottom: 20px; }
.nav-label    { font-size: .65rem; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.3); padding: 0 10px 8px; display: block; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.65);
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all .2s;
}
.nav-item:hover  { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-item.active { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.nav-item i      { width: 18px; text-align: center; font-size: 1rem; flex-shrink: 0; }

/* Footer sidebar */
.sidebar-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.user-info  { flex: 1; min-width: 0; }
.user-avatar { width: 32px; height: 32px; background: rgba(255,255,255,.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7); flex-shrink: 0; }
.user-name   { color: #fff; font-size: .8rem; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role   { color: rgba(255,255,255,.4); font-size: .7rem; display: block; }
.btn-logout  { color: rgba(255,255,255,.4); font-size: 1.1rem; transition: color .2s; }
.btn-logout:hover { color: #f87171; }

/* Overlay mobile */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }

/* Main */
.main-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  position: sticky; top: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.topbar-left  { display: flex; align-items: center; gap: 16px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-toggle { background: none; border: none; font-size: 1.3rem; color: var(--muted); cursor: pointer; display: none; }
.topbar-date   { font-size: .82rem; color: var(--muted); }

/* Content */
.content-area { padding: 28px 28px; flex: 1; }

/* Page header */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-sub   { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }

/* ── CARDS Y PANELES ─────────────────────────────────────────── */
.card-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.panel-title { font-weight: 700; font-size: .95rem; margin: 0; }
.panel-section-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-blue   { border-color: var(--primary); }
.stat-green  { border-color: var(--success); }
.stat-yellow { border-color: var(--warning); }
.stat-red    { border-color: var(--danger); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-blue   .stat-icon { background: #dbeafe; color: var(--primary); }
.stat-green  .stat-icon { background: #dcfce7; color: var(--success); }
.stat-yellow .stat-icon { background: #fef3c7; color: var(--warning); }
.stat-red    .stat-icon { background: #fee2e2; color: var(--danger); }

.stat-value  { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat-label  { font-size: .82rem; color: var(--muted); font-weight: 500; }
.stat-detail { font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* ── VENCIDAS LIST ──────────────────────────────────────────── */
.vencidas-list { display: flex; flex-direction: column; gap: 10px; }
.vencida-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: #fff8f8;
  border-radius: 8px;
  border: 1px solid #fecaca;
}
.vencida-info { flex: 1; min-width: 0; font-size: .85rem; }
.vencida-monto { font-size: .9rem; flex-shrink: 0; }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge-num { background: var(--primary-light); color: var(--primary); font-weight: 700; padding: 3px 10px; border-radius: 20px; font-size: .8rem; }
.badge-mp  { background: #00b1ea; color: #fff; font-weight: 700; padding: 3px 10px; border-radius: 20px; font-size: .78rem; display: inline-block; }

/* ── SOCIO DETAIL ────────────────────────────────────────────── */
.socio-avatar-big {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 auto 16px;
}
.socio-avatar-sm {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700; flex-shrink: 0;
}
.socio-encontrado {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 14px 18px;
}
.info-list { margin: 0; }
.info-list dt { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-top: 10px; margin-bottom: 2px; }
.info-list dd { font-size: .9rem; font-weight: 500; margin: 0; }

/* ── COMPROBANTE ─────────────────────────────────────────────── */
.comprobante-box {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  max-width: 520px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}
.comp-header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; padding: 24px 28px;
  display: flex; align-items: center; gap: 16px;
}
.comp-logo  { font-size: 2rem; }
.comp-mutual { font-size: 1.1rem; font-weight: 700; }
.comp-titulo { font-size: .8rem; opacity: .8; letter-spacing: 1px; text-transform: uppercase; }
.comp-body  { padding: 20px 28px; }
.comp-row   { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.comp-monto { background: #f0fdf4; border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.comp-monto span:last-child { font-size: 1.3rem; font-weight: 700; color: var(--success); }
.comp-footer { background: #f8f9fa; padding: 12px 28px; font-size: .78rem; color: var(--muted); text-align: center; border-top: 1px solid var(--border); }

/* ── LOGIN ───────────────────────────────────────────────────── */
.login-body { background: var(--bg); }
.login-wrapper {
  min-height: 100vh;
  display: flex;
}
/* Panel izquierdo - info empresa */
.login-left {
  width: 42%;
  background: linear-gradient(145deg, #0f1624, #1a2744, #0e2055);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
}
.login-left-deco {
  position: absolute; width: 600px; height: 600px;
  border-radius: 50%; background: rgba(37,99,235,.15);
  top: -200px; right: -200px; pointer-events: none;
}
.login-left-content { position: relative; z-index: 1; color: #fff; max-width: 360px; }
.login-logo-img { width: 90px; height: 90px; object-fit: contain; border-radius: 16px; background: rgba(255,255,255,.15); padding: 8px; margin-bottom: 20px; }
.login-brand-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.login-brand-wrap .login-logo-img { margin-bottom: 0; flex-shrink: 0; }
.login-brand-wrap .login-logo-icon { margin-bottom: 0; flex-shrink: 0; }
.login-logo  { width: 64px; height: 64px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin-bottom: 20px; }
.login-brand-name { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; margin-bottom: 6px; }
.login-tagline { color: rgba(255,255,255,.6); margin-bottom: 24px; font-size: .88rem; }
.login-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.login-features li { color: rgba(255,255,255,.8); font-size: .85rem; display: flex; align-items: center; gap: 10px; }
.login-features i  { color: #4ade80; }
/* Panel izquierdo: info empresa */
.empresa-block { margin-top: 20px; }
.empresa-block dl { display: flex; flex-direction: column; gap: 6px; }
.empresa-block dt { font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; opacity: .6; margin-bottom: 0; display: flex; align-items: center; gap: 4px; }
.empresa-block dd { font-size: .88rem; font-weight: 600; margin: 0 0 6px 0; opacity: .9; }

/* Panel derecho - formulario */
.login-right {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 48px 40px; background: #fff;
}
.login-form-box { width: 100%; max-width: 420px; }
.login-form-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.login-form-sub   { color: var(--muted); margin-bottom: 28px; }

/* ── LOGIN RESPONSIVE (mobile) ───────────────────────────── */
@media (max-width: 767px) {
  .login-wrapper { flex-direction: column; }

  /* Panel izquierdo: banner compacto en mobile */
  .login-left {
    width: 100%;
    padding: 20px 24px;
    align-items: flex-start;
    min-height: unset;
  }
  .login-left-content {
    display: flex; align-items: center; gap: 14px;
    max-width: 100%;
  }
  .login-brand-wrap { gap: 10px; margin-bottom: 0; }
  .login-logo-img { width: 44px; height: 44px; margin-bottom: 0; flex-shrink: 0; padding: 4px; }
  .login-logo     { width: 48px; height: 48px; font-size: 1.4rem; margin-bottom: 0; flex-shrink: 0; }
  .login-brand-name { font-size: 1.1rem; margin-bottom: 2px; }
  .login-tagline    { margin-bottom: 0; font-size: .78rem; }
  .login-features, .empresa-block { display: none; } /* ocultar en mobile */
  .login-left-deco  { display: none; }

  /* Panel derecho: ocupa el resto */
  .login-right { padding: 28px 20px; align-items: flex-start; }
  .login-form-title { font-size: 1.35rem; }
}

.login-type-tabs { display: flex; gap: 8px; background: var(--bg); border-radius: 10px; padding: 5px; }
.login-type-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: .88rem; font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font);
}
.login-type-btn.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }

.btn-ingresar { background: linear-gradient(135deg, var(--primary), var(--accent)); border: none; font-weight: 600; letter-spacing: .3px; }
.btn-ingresar:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,99,235,.35); }

/* ── PORTAL SOCIO ────────────────────────────────────────────── */
.socio-body { background: #f0f4fa; }
/* ════════════════════════════════════════════════
   PORTAL SOCIO — HEADER (MOBILE FIRST)
   ════════════════════════════════════════════════ */
.socio-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    position: sticky; top: 0; z-index: 200;
    width: 100%; overflow: hidden;
}

/* Barra principal */
.socio-topbar {
    display: flex;
    align-items: center;
    width: 100%;
    height: 56px;
    padding: 0 12px;
    gap: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Brand */
.socio-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
    max-width: 55%;
}
.socio-brand-logo {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    object-fit: contain;
    border-radius: 8px;
    background: #f1f5f9;
    padding: 3px;
    flex-shrink: 0;
    display: block;
}
.socio-brand-nombre {
    font-size: .82rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Links de navegación (ocultos en mobile, visibles en tablet+) */
.socio-links {
    display: none;
    gap: 2px;
    flex: 1;
    justify-content: center;
}
.sl-item {
    display: flex; align-items: center; gap: 5px;
    padding: 7px 10px; border-radius: 8px;
    font-size: .82rem; font-weight: 500;
    color: var(--muted); text-decoration: none;
    transition: all .2s; white-space: nowrap;
}
.sl-item:hover  { background: var(--bg); color: var(--text); }
.sl-item.active { background: #dbeafe; color: var(--primary); font-weight: 600; }

/* Derecha */
.socio-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}
.socio-num {
    font-size: .75rem;
    color: var(--muted);
    white-space: nowrap;
    display: none; /* oculto por defecto, se muestra en tablet+ */
}
.socio-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .85rem;
    text-decoration: none; flex-shrink: 0;
}
.socio-logout {
    width: 32px; height: 32px;
    background: #fee2e2; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #dc2626; font-size: .9rem;
    text-decoration: none; transition: background .2s; flex-shrink: 0;
}
.socio-logout:hover { background: #fecaca; }

/* Nav móvil con íconos — SIEMPRE visible */
.socio-mobile-nav {
    display: flex;
    border-top: 1px solid var(--border);
    background: #fff;
}
.smn-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 8px 4px;
    font-size: .68rem; font-weight: 500;
    color: var(--muted); text-decoration: none;
    transition: color .2s;
}
.smn-item i    { font-size: 1.15rem; }
.smn-item.active { color: var(--primary); }

/* TABLET Y DESKTOP */
@media (min-width: 768px) {
    .socio-topbar    { height: 62px; padding: 0 24px; gap: 16px; }
    .socio-brand     { max-width: 240px; }
    .socio-brand-logo { width: 40px !important; height: 40px !important;
                        min-width: 40px !important; max-width: 40px !important; }
    .socio-brand-nombre { font-size: .95rem; }
    .socio-links     { display: flex; }
    .sl-item         { font-size: .85rem; padding: 8px 14px; }
    .socio-num       { display: inline; }
    .socio-mobile-nav { display: none; } /* en desktop se oculta el bottom nav */
}

@media (min-width: 1024px) {
    .socio-topbar { max-width: 1200px; margin: 0 auto; }
}

/* ── Socio header responsive ────────────────────────── */
@media (max-width: 767px) {
  .socio-nav        { height: auto; min-height: 56px; padding: 8px 12px; gap: 8px; flex-wrap: nowrap; }
  .socio-brand      { max-width: 160px; font-size: .82rem; }
  .socio-brand-logo { height: 32px; width: 32px; min-width: 32px; }
  .socio-brand span { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
  .socio-num        { display: none !important; }
  .btn-instalar span { display: none; } /* solo el icono en mobile */
  .btn-instalar     { padding: 6px 8px; }
  .socio-avatar, .socio-logout { width: 30px; height: 30px; font-size: .8rem; }
}

/* ── Barra de contacto socio ───────────────────────── */
.contacto-bar {
    background:linear-gradient(135deg,#0f1624,#1e3a5f);
    padding:8px 0; border-bottom:1px solid rgba(255,255,255,.08);
}
.cb-inner {
    display:flex; align-items:center;
    justify-content:space-between; flex-wrap:wrap; gap:8px;
}
.cb-dato { display:flex; align-items:center; gap:6px; color:rgba(255,255,255,.75); font-size:.78rem; }
.cb-dato i { color:#60a5fa; }
.cb-acciones { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.cb-btn {
    display:inline-flex; align-items:center; gap:6px;
    padding:5px 14px; border-radius:20px;
    font-size:.78rem; font-weight:700;
    text-decoration:none; transition:all .2s; white-space:nowrap;
}
.cb-wsp { background:#25d366; color:#fff; }
.cb-wsp:hover { background:#1ebe5d; color:#fff; }
.cb-tel { background:rgba(255,255,255,.12); color:rgba(255,255,255,.9); border:1px solid rgba(255,255,255,.2); }
.cb-tel:hover { background:rgba(255,255,255,.2); color:#fff; }
@media (max-width:600px) {
    .cb-dato { display:none; }
    .cb-acciones { width:100%; justify-content:center; }
    .cb-btn { flex:1; justify-content:center; }
}
