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

body {
    font-family: 'Poppins', sans-serif;
    background: #f2f7fa;
    color: #1f2933;
}

/* Layout principal */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
    width: 260px;
    background: #1e82b8; /* Celeste Bahía Remis */
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 18px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.15);
}

.sidebar-header {
    text-align: center;
    margin-bottom: 25px;
}

.sidebar-header .logo {
    width: 110px;
    height: auto;
    margin-bottom: 8px;
}

.sidebar-header h1 {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Menú */
.menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.menu-link {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #e5e9f0;
    font-size: 0.95rem;
    transition: background 0.15s ease, transform 0.05s ease;
}

.menu-link:hover {
    background: rgba(0,0,0,0.15);   /* sombreado azul/negro suave */
    color: #ffffff;                 /* texto blanco bien visible */
    font-weight: 500;
    transform: translateX(2px);
}

.menu-link.active {
    background: rgba(0,0,0,0.12); /* mismo estilo del hover */
    color: #ffffff;               /* texto blanco para máximo contraste */
    font-weight: 600;
}

.menu-link.externo::after {
    content: "↗";
    font-size: 0.8rem;
    margin-left: 4px;
}

/* Botón cerrar sesión */
.btn-logout {
    margin-top: 18px;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    background: #bd5c5c;   /* rojo suave */
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s ease, transform 0.05s ease;
}

.btn-logout:hover {
    background: #a13f3f;  /* rojo más oscuro pero no agresivo */
    transform: translateY(-1px);
}

/* ---------- CONTENIDO PRINCIPAL ---------- */
.main {
    flex: 1;
    padding: 22px 26px;
}

/* Encabezado de sección */
.section-header {
    margin-bottom: 18px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e82b8  /* Celeste Bahía */
}

.section-subtitle {
    color: #6b7c93;
    margin-top: 4px;
}

/* Secciones */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section-body {
    background: #ffffff;
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    font-size: 0.95rem;
}

/* Cards de inicio */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(15,23,42,0.08);
}

.card h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
     color: #1e82b8
}

.card p {
    font-size: 0.9rem;
    color: #4b5563;
}

/* Notas / aclaraciones */
.nota {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Listas */
.section-body ul {
    margin-top: 8px;
    margin-left: 18px;
    font-size: 0.95rem;
    color: #374151;
}

/* Responsive móvil (ordenado tipo app) */
@media (max-width: 900px) {

  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    flex-direction: column;      /* ✅ antes era row */
    align-items: stretch;
    justify-content: flex-start;
    padding: 14px;
    gap: 12px;
  }

  .sidebar-header {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
  }

  .sidebar-header .logo {
    width: 56px;
    margin-bottom: 0;
  }

  /* si tenés el conectado */
  .usuario-logueado {
    margin-top: 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0,0,0,.12);
    color: #eaf6ff;
    opacity: 1;
    font-weight: 600;
  }

  .menu {
    flex-direction: column;      /* ✅ antes era row */
    flex-wrap: nowrap;           /* ✅ antes wrap */
    gap: 8px;
    margin-top: 0;
    max-width: 100%;             /* ✅ antes 70% */
  }

  .menu-link {
    width: 100%;
    font-size: 15px;
    padding: 12px 12px;
  }

  .btn-logout {
    width: 100%;
    font-size: 15px;
    padding: 12px 12px;
    margin-top: 6px;
    margin-left: 0;
  }

  .main {
    padding: 16px 12px;
  }
}

.form-container {
    background: #ffffff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    max-width: 900px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.btn-guardar {
    background: #1e82b8;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin-top: 8px;
}

.btn-guardar:hover {
    background: #166a94;
}

.msg {
    margin-top: 10px;
    font-weight: 600;
}
/* ============================
   LISTADO DE PERSONAS – CARDS
   ============================ */

.personas-busqueda {
    margin-bottom: 20px;
}

.personas-busqueda input {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.personas-mensaje {
    margin-top: 10px;
    color: #555;
}

.personas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 15px;
}

.persona-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.persona-card-header {
    display: flex;
    gap: 12px;
    align-items: center;
}

.persona-foto {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 0 6px rgba(0,0,0,0.2);
}

.persona-identidad h3 {
    margin: 0;
    font-size: 18px;
}

.persona-alias {
    margin: 2px 0;
    font-size: 13px;
    color: #555;
}

.persona-funcion {
    margin: 0;
    font-size: 13px;
    color: #1e82b8;
    font-weight: 600;
}

.persona-card-body {
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.persona-dato {
    display: flex;
    gap: 6px;
}

.persona-dato .label {
    font-weight: 600;
    color: #555;
}

.persona-vencimientos {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-venc {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.tag-venc-ok {
    background: #e3f7e6;
    color: #228b3a;
}

.tag-venc-vencido {
    background: #fce1e1;
    color: #c0392b;
}

.tag-venc-sin {
    background: #eee;
    color: #555;
}

.persona-observaciones {
    margin-top: 6px;
}

.persona-observaciones .label {
    font-weight: 600;
}

/* Footer de la card */
.persona-card-footer {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-secundario,
.btn-pdf {
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.btn-secundario {
    background: #ecf0f1;
}

.btn-pdf {
    background: #1e82b8;
    color: #fff;
}

.btn-pdf:hover {
    background: #166a94;
}

/* Ajustes en móviles */
@media (max-width: 768px) {
    .personas-grid {
        grid-template-columns: 1fr;
    }
}
.usuario-logueado {
    margin-top: 5px;
    color: #e0f2ff;
    font-size: 14px;
    opacity: 0.9;
}
/* ============================================================
   FORMULARIO EDITAR Y AGREGAR PERSONA – ESTILOS UNIFICADOS
============================================================ */

.form-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: #1e82b8;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    background: white;
}

textarea {
    resize: vertical;
}

.btn-full {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

.form-actions {
    margin-top: 20px;
}
/* ============================================
   FIX PARA EDITAR_PERSONA Y AGREGAR_PERSONA
   ============================================ */

/* Contenedor principal - coloca correctamente el contenido */
.content {
    flex: 1;
    padding: 30px 40px;
    min-height: 100vh;
}

/* Título superior */
.page-header {
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1e82b8;
    margin: 0;
}
/* ====================================
   BOTÓN PRO - PARA .btn.btn-primary
==================================== */

.btn.btn-primary {
    background: linear-gradient(90deg, #1e82b8, #0f5f87);
    border: none;
    padding: 14px 26px;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    color: #fff;
    width: 100%;
    transition: .15s ease-in-out;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.22);
    background: linear-gradient(90deg, #0f6fa3, #0a4c6d);
}
/* ============================================================
   BOTONES PRO (globales para todo el sistema)
============================================================ */

.btn-pro {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
}

/* Botón Editar */
.btn-pro.editar {
    background: linear-gradient(135deg, #1e82b8, #166a94);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 80, 140, 0.25);
}

.btn-pro.editar:hover {
    background: linear-gradient(135deg, #166a94, #0f4f73);
    box-shadow: 0 4px 12px rgba(0, 80, 140, 0.35);
    transform: translateY(-2px);
}

/* Botón PDF */
.btn-pro.pdf {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.25);
}

.btn-pro.pdf:hover {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.35);
    transform: translateY(-2px);
}

.ayuda-memoria {
    margin-top: 10px;
}

.lista-gastos {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lista-gastos li {
    display: flex;
    align-items: center;
    padding: 8px 6px;
    border-bottom: 1px solid #eef2f6;
    font-size: 14px;
}

.lista-gastos .estado {
    width: 28px;
}

.lista-gastos .nombre {
    flex: 1;
}

.lista-gastos .tag {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 8px;
}

.pagado .tag {
    background: #d4edda;
    color: #155724;
}

.pendiente .tag {
    background: #fff3cd;
    color: #856404;
}

.nocargado .tag {
    background: #e9ecef;
    color: #495057;
}
/* ============================================================
   FIX DEFINITIVO MENU MOBILE – Bahía Remis
   (pegalo al final del CSS)
============================================================ */
@media (max-width: 900px){

  /* sidebar arriba, pero bien contrastado */
  .sidebar{
    width: 100% !important;
    min-height: auto !important;
    background: #1e82b8 !important;
    color: #fff !important;
    padding: 12px 12px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.15) !important;
  }

  /* header compacto */
  .sidebar-header{
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-align: left !important;
  }
  .sidebar-header .logo{
    width: 52px !important;
  }

  /* el usuario logueado SIEMPRE visible */
  .usuario-logueado,
  .sidebar .user{
    color: #eaf6ff !important;
    opacity: 1 !important;
    font-weight: 600 !important;
  }

  /* Menú: en móvil NO lo achiquemos ni lo apaguemos */
  .menu{
    max-width: 100% !important;
    margin-top: 10px !important;
    display: flex !important;
    flex-direction: column !important;     /* clave: evita mini-links */
    gap: 8px !important;
  }

  .menu-link{
    display: block !important;
    width: 100% !important;
    padding: 12px 12px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    color: #ffffff !important;            /* clave: nunca gris */
    background: rgba(255,255,255,.10) !important;
    border-radius: 10px !important;
    opacity: 1 !important;
  }

  .menu-link:hover,
  .menu-link.active{
    background: rgba(0,0,0,.18) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
  }

  /* Botones */
  .btn-logout{
    width: 100% !important;
    padding: 12px 12px !important;
    font-size: 15px !important;
    margin-top: 10px !important;
  }
}