:root {
  --sb-w: 280px;
  --sb-c: 85px;
  --nb-h: 65px;
  --green-dark: #0a3613; /* Deep green from reference */
  --green-primary: #4caf50; /* Bright green for active items */
  --green-light: #81c784;
  --bg-app: #f4f7f6;
  --text-white: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --danger: #d32f2f;
  --trans: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  overflow: hidden;
}

/* APP CONTAINER */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sb-w);
  min-width: var(--sb-w);
  height: 100%;
  background: var(--green-dark);
  display: flex;
  flex-direction: column;
  transition: all var(--trans);
  z-index: 1200;
  box-shadow: 5px 0 15px rgba(0,0,0,0.1);
  overflow: hidden;
  position: relative;
}

.mobile-close-btn {
  display: none;
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  cursor: pointer;
  z-index: 1300;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  transition: all 0.2s;
}

.mobile-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.app-container.collapsed .sidebar {
  width: var(--sb-c);
  min-width: var(--sb-c);
}

/* Sidebar Header (Logo Area) */
.sidebar-header {
  height: 80px; /* Reducido de 120px a 90px */
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  border-bottom: 1px solid #f1f5f9;
  overflow: hidden;
}

.sidebar-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--trans);
}

.app-container.collapsed .sidebar-logo {
  opacity: 0;
  width: 0;
}

.app-container.collapsed .sidebar-header {
  display: none; /* Oculta el encabezado blanco al contraer */
}

/* Sidebar Profile Card */
.sidebar-profile-container {
  padding: 5px 10px 15px; /* Reducido el padding superior para subir la imagen */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all var(--trans);
}

.app-container.collapsed .sidebar-profile-container {
  display: none; /* Oculta todo el bloque de perfil al contraer */
}

.profile-card {
  background: white;
  border: 3px solid #8cc63f;
  border-radius: 12px;
  padding: 5px;
  width: 110px;
  height: 110px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  transition: all var(--trans);
}

.profile-img-sidebar {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.user-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: white;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.2;
}

.role-badge {
  background: #a5d6a7;
  color: #2e7d32;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  scrollbar-width: none;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.mini-profile-nav {
  display: none; /* Por defecto oculto en vista expandida */
  justify-content: center;
  padding: 15px 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 5px;
}

.mini-pfp-img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 2px solid var(--green-light);
  object-fit: cover;
}

.app-container.collapsed .mini-profile-nav {
  display: flex; /* Solo se muestra al contraer el sidebar */
}

.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-section-title {
  padding: 0 15px 10px;
  font-size: 0.8rem;
  color: white;
  font-weight: 400;
}

.app-container.collapsed .sidebar-section-title { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  gap: 12px;
  border-radius: 6px;
  margin: 2px 10px;
}

.nav-item i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
  background: #4caf50;
  color: white;
}

.app-container.collapsed .nav-item {
  padding: 12px 0;
  justify-content: center;
  margin: 5px 0;
  border-radius: 0;
}

.app-container.collapsed .nav-item span { display: none; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 0;
  margin-top: auto;
}

.logout-sidebar-btn {
  display: flex;
  align-items: center;
  padding: 15px 15px;
  gap: 12px;
  width: 100%;
  background: #c62828;
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-sidebar-btn:hover {
  background: #b71c1c;
}

.app-container.collapsed .logout-sidebar-btn span { display: none; }
.app-container.collapsed .logout-sidebar-btn { padding: 15px 0; justify-content: center; }

/* CONTENT AREA */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* TOP NAVBAR */
.top-navbar {
  height: var(--nb-h);
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  z-index: 1100;
  flex-shrink: 0;
}

.navbar-left, .navbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.navbar-brand-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand-logo-small {
  height: 25px;
  width: auto;
}

.navbar-brand-text {
  font-weight: 900;
  font-size: 1.4rem;
  color: #1b5e20; /* Deep eco green */
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
}

/* Removed navbar-brand-text::before logo image */

.menu-toggle-btn-top {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.navbar-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* MAIN CONTENT */
.dashboard-main {
  flex: 1;
  overflow-y: auto;
  padding: 30px 40px; /* Aumentado de 15px para dar más aire */
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  width: 100%; /* Asegura que ocupe todo el ancho */
}

/* DASHBOARD CONTENT */
.dashboard-main-header {
  background: white;
  padding: 30px 40px; /* Más amplio */
  border-radius: 24px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.03);
  margin-bottom: 25px;
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 25px;
  width: 100%;
}

.admin-card {
  background: white;
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.03);
  border: 1px solid #f1f5f9;
  margin-bottom: 25px;
}

.admin-card h3 {
  margin-top: 0;
  color: var(--green-dark);
  font-weight: 800;
}

.input-custom {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.input-custom:focus {
  outline: none;
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.btn-primary {
  background: var(--green-primary);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

/* MOBILE */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 280px !important;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 15px 0 30px rgba(0,0,0,0.2);
  }
  
  .sidebar.open { 
    left: 0; 
  }

  .mobile-close-btn {
    display: flex;
    position: absolute;
    right: 8px;
    top: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
  }

  .mobile-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: rotate(90deg);
  }

  .mobile-close-btn i {
    width: 24px;
    height: 24px;
  }

  .sidebar-header {
    height: 100px;
  }

  .dashboard-main {
    padding: 15px;
  }

  .top-navbar {
    padding: 0 15px;
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    z-index: 1150;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
  }
  
  .sidebar-overlay.active { 
    display: block;
    opacity: 1;
  }

  /* Grid Adjustments for mobile */
  .grid-1-mobile {
    grid-template-columns: 1fr !important;
  }

  .grid-2-mobile {
    grid-template-columns: 1fr !important;
  }

  .grid-3-mobile {
    grid-template-columns: 1fr !important;
  }

  /* Responsive Tables as Cards */
  @media (max-width: 900px) {
    table, thead, tbody, th, td, tr { 
        display: block; 
    }
    
    thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr { 
        margin-bottom: 20px; 
        border: 1px solid #e2e8f0 !important;
        border-radius: 20px;
        background: white;
        padding: 15px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    }
    
    td { 
        border: none;
        position: relative;
        padding-left: 50% !important; 
        text-align: right !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        min-height: 40px;
        border-bottom: 1px solid #f1f5f9;
    }

    td:last-child {
        border-bottom: none;
    }
    
    td:before { 
        position: absolute;
        top: 10px;
        left: 10px;
        width: 45%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: 800;
        font-size: 0.7rem;
        color: #94a3b8;
        text-transform: uppercase;
        content: attr(data-label);
    }

    /* Especial para la celda de acciones */
    td:last-child {
        display: flex;
        justify-content: flex-end;
        padding-left: 15px !important;
    }
    td:last-child:before {
        display: none;
    }
  }

/* Mejoras para el Panel de Créditos (Admin) */
.credit-grid-container {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); 
    gap: 25px;
}

@media (max-width: 600px) {
    .credit-grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .v-tab-btn {
        padding: 10px 15px !important;
        font-size: 0.8rem !important;
    }

    .hide-mobile {
        display: none !important;
    }

    .show-mobile-inline {
        display: inline !important;
    }
}

.show-mobile-inline {
    display: none;
}

  .mobile-text-center {
    text-align: center !important;
  }

  .mobile-w-100 {
    width: 100% !important;
  }

  .mobile-gap-10 {
    gap: 10px !important;
  }

  .mobile-p-15 {
    padding: 15px !important;
  }

  .mobile-m-0 {
    margin: 0 !important;
  }

  .flex-column-mobile {
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
  }

  .flex-column-mobile > * {
    width: 100% !important;
  }

  header.dashboard-main-header {
    flex-direction: column !important;
    text-align: center;
    gap: 20px;
    padding: 20px !important;
  }

  header.dashboard-main-header > div {
    flex-direction: column;
    width: 100%;
  }

  .balance-hero {
    flex-direction: column !important;
    text-align: center;
    padding: 25px !important;
    gap: 20px;
  }

  .balance-hero h2 {
    font-size: 2.5rem !important;
  }

  .admin-card {
    padding: 15px !important;
  }

  .jobank-table {
    min-width: 800px;
  }

  @media (max-width: 900px) {
    .jobank-table {
      min-width: 0 !important;
    }
  }
}

/* ERROR MESSAGE STYLES */
.error-msg {
    background: #fff1f2;
    color: #e11d48;
    padding: 15px 20px;
    border-radius: 16px;
    margin-bottom: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid #fda4af;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.auth-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #8cc63f;
    z-index: 9999;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.auth-header {
    background: transparent;
    padding: 20px 20px 10px; /* Reducido de 140px a 40px */
    text-align: center;
    display: flex;
    justify-content: center;
    box-shadow: none;
}

.logo-container-custom {
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px; /* Añadido un poco de aire interno */
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 380px; /* Vuelto a 380px para alinear los costados */
    height: 120px; /* Altura fija reducida */
    overflow: hidden;
}

.logo-container-custom img {
    max-width: 110%; /* La imagen es más pequeña dentro del contenedor */
    height: auto;
    display: block;
}

.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.auth-card {
    background: white;
    width: 100%;
    max-width: 380px; /* Vuelto a 380px */
    border-radius: 30px;
    padding: 35px 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.auth-title-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #2e7d32;
    margin-bottom: 30px;
    justify-content: center;
}

.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 12px;
}

.input-custom {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    font-size: 1rem;
    text-align: center;
}

.pin-dots-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 15px 0 25px;
}

.pin-dot-custom {
    width: 18px;
    height: 18px;
    background: #cbd5e1;
    border-radius: 50%;
    transition: all 0.2s;
}

.pin-dot-custom.filled {
    background: #2e7d32;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.keypad-btn {
    aspect-ratio: 1.2;
    border: none;
    background: #3d8e3c;
    border-radius: 15px;
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keypad-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.keypad-btn.delete { 
    background: #f4511e; 
}

.keypad-btn.enter { 
    background: #00695c; 
}

.footer-text {
    text-align: center;
    color: #2e7d32;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 25px;
    margin-bottom: 15px;
}

.btn-create-account {
    width: 100%;
    padding: 15px;
    background: #2e7d32;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-create-account:hover {
    background: #1b5e20;
}

/* ==========================================================================
   ESTILOS REFINADOS DEL FOOTER (JOBANK 2.0) - VERSIÓN COMPACTA
   ========================================================================== */
.app-footer {
    padding: 25px 15px; /* Reducido de 60px a 25px */
    background: white;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
    width: 100%;
    flex-shrink: 0;
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; /* Reducido de 35px a 15px */
}

.footer-brand {
    text-align: center;
}

.footer-logo-text {
    margin: 0;
    font-weight: 950;
    color: #1e293b;
    letter-spacing: -1px;
    font-size: 1.1rem; /* Reducido de 1.8rem a 1.1rem */
    text-transform: uppercase;
}

.footer-logo-text span {
    color: #16a34a;
}

.footer-slogan {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 0.75rem; /* Más discreto */
    font-weight: 600;
    letter-spacing: 0.5px;
}

.footer-links {
    display: flex;
    gap: 20px; /* Reducido */
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.7rem; /* Reducido de 0.85rem a 0.7rem */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #16a34a;
}

.footer-divider {
    height: 1px;
    width: 40px; /* Más corto */
    background: #e2e8f0;
    margin: 5px 0;
}

.footer-copy {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.65rem; /* Muy pequeño y elegante */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .app-footer {
        padding: 20px 10px;
    }
    .footer-links {
        gap: 10px;
        flex-direction: row; /* Mantener horizontal si es posible */
    }
    .footer-logo-text {
        font-size: 1rem;
    }
}


