/* Professional Corporate Theme */
:root{
  --primary-blue: #1e40af;     /* Corporate blue */
  --primary-light: #3b82f6;    /* Lighter blue */
  --secondary: #64748b;        /* Slate gray */
  --accent: #059669;           /* Success green */
  --warning: #f59e0b;          /* Amber */
  --danger: #dc2626;           /* Red */
  --bg-light: #f8fafc;        /* Light background */
  --bg-white: #ffffff;         /* Pure white */
  --border: #e2e8f0;          /* Light border */
  --text-primary: #1e293b;     /* Dark text */
  --text-secondary: #64748b;   /* Muted text */
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body{
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Remove sidebar completely */
aside.main-sidebar{ display:none !important; }

/* Utility: Disabled Area */
.disabled-area { pointer-events: none; opacity: .6; }

/* Content wrapper */
.content-wrapper{ 
  transition: margin .2s ease; 
  padding: 24px; 
  margin-left: 0 !important; 
  min-height: 100vh;
}

/* Modern card design */
.card{ 
  background: var(--bg-white); 
  border-radius: 12px; 
  padding: 24px; 
  box-shadow: var(--shadow); 
  margin-bottom: 24px; 
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.card:hover{
  box-shadow: var(--shadow-lg);
}

.card-header{ 
  font-weight: 600; 
  color: var(--text-primary); 
  margin-bottom: 16px;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header i {
  color: var(--primary-blue);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }

/* Page headers with icons */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.page-title i {
  color: var(--primary-blue);
  font-size: 1.5rem;
}

/* Modern buttons */
.btn{ 
  padding: 10px 20px; 
  border-radius: 8px; 
  border: none; 
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary{ 
  background: var(--primary-blue); 
  color: var(--bg-white);
  box-shadow: var(--shadow);
}

.btn-primary:hover{ 
  background: var(--primary-light);
  box-shadow: var(--shadow-lg);
  color: var(--bg-white);
}

.btn-success{ 
  background: var(--accent); 
  color: var(--bg-white);
}

.btn-success:hover{ 
  background: #047857;
  color: var(--bg-white);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
}

.btn-outline-primary:hover {
  background: var(--primary-blue);
  color: var(--bg-white);
}

.btn-light {
  background: var(--bg-light);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

/* Modern tables */
.table{ 
  width: 100%; 
  border-collapse: collapse;
  background: var(--bg-white);
}

.table th, .table td{ 
  padding: 12px 16px; 
  border-bottom: 1px solid var(--border); 
  color: var(--text-primary);
  vertical-align: middle;
}

.table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-light);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.table-striped tbody tr:nth-child(even) {
  background: #f9fafb;
}

.table-hover tbody tr:hover {
  background: #f1f5f9;
}

/* Modern badges */
.badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-soft { background: #f1f5f9; color: var(--text-secondary); }
.badge-success-soft { background: #ecfdf5; color: #065f46; }
.badge-info-soft { background: #eff6ff; color: #1e40af; }
.badge-danger-soft { background: #fef2f2; color: #991b1b; }
.badge-warning-soft { background: #fefce8; color: #a16207; }

/* Form controls */
.form-control { 
  border-radius: 8px; 
  border: 1px solid var(--border); 
  background: var(--bg-white);
  padding: 10px 12px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.form-group label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* Modern alerts */
.alert {
  padding: 16px;
  border-radius: 8px;
  border: none;
  margin-bottom: 24px;
  font-weight: 500;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border-left: 4px solid var(--accent);
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

.alert-warning {
  background: #fefce8;
  color: #a16207;
  border-left: 4px solid var(--warning);
}

/* Statistics cards */
.stat-card{ 
  background: var(--bg-white); 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  box-shadow: var(--shadow); 
  display: flex; 
  align-items: center; 
  gap: 16px;
  padding: 24px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.stat-icon{ 
  width: 48px; 
  height: 48px; 
  border-radius: 12px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 20px;
  flex-shrink: 0;
}

.bg-soft-primary{ background: #eff6ff; color: var(--primary-blue); }
.bg-soft-success{ background: #ecfdf5; color: var(--accent); }
.bg-soft-warning{ background: #fefce8; color: var(--warning); }
.bg-soft-danger{ background: #fef2f2; color: var(--danger); }

.stat-label{ 
  color: var(--text-secondary); 
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 4px;
}

.stat-value{ 
  font-size: 1.875rem; 
  font-weight: 700; 
  color: var(--text-primary);
  line-height: 1;
}

/* Modern navigation */
.topbar{ 
  background: var(--bg-white); 
  backdrop-filter: blur(8px); 
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: 100%;
}

/* Global centered page container for AdminLTE sections */
.content .container-fluid {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* Center standalone pages that use main-content (e.g., client_search) */
.main-layout, .main-content { width: 100%; }
.main-content { max-width: 1200px; margin-left: auto; margin-right: auto; }
/* Navbar container spans full width and adapts */
.topbar .container-fluid { padding-left: 16px; padding-right: 16px; max-width: 100%; display: flex; align-items: center; gap: 12px; }
/* Central tab group adapts to available width */
.topbar .top-tabs { flex: 1 1 auto; display: flex; flex-wrap: nowrap; gap: 8px; overflow: hidden; min-width: 0; }
.topbar .top-tabs .nav-item { flex: 0 0 auto; }
/* Right actions (Administrador / Salir) alignment */
.topbar .navbar-nav.ml-auto { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar .navbar-nav.ml-auto .nav-item { flex: 0 0 auto; }
.topbar .navbar-nav.ml-auto .nav-link { white-space: nowrap; }
/* Base navbar link appearance */
.nav-link{ 
  color: var(--text-secondary) !important; 
  font-weight: 500; 
  padding: 12px 16px !important; 
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Make right actions look like compact buttons */
.topbar .navbar-nav.ml-auto .nav-link{
  background: var(--bg-light);
  border: 1px solid var(--border);
}
.topbar .navbar-nav.ml-auto .nav-link:hover{
  background: #eef2ff;
}

.nav-link:hover{ 
  background: var(--bg-light); 
  color: var(--text-primary) !important;
}

.nav-link.active{ 
  background: var(--primary-blue); 
  color: var(--bg-white) !important; 
  box-shadow: var(--shadow);
}

.nav-link i {
  font-size: 0.875rem;
}

/* Dashboard hero */
.dashboard-hero{ 
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-light)); 
  color: var(--bg-white);
  border: none; 
  border-radius: 16px; 
  box-shadow: var(--shadow-lg);
  padding: 48px 32px;
  text-align: center;
}

.dashboard-hero h1 {
  color: var(--bg-white);
  font-weight: 700;
  margin-bottom: 8px;
}

/* Responsive design */
@media (max-width: 768px) { 
  .content-wrapper { padding: 16px; }
  .stat-card { padding: 16px; }
  .page-title { font-size: 1.5rem; }
  .card { padding: 16px; }
}

/* Section reordering */
.main-content { display: flex; flex-direction: column; }
.section-resultados { order: 1; }
.section-proximos { order: 2; }

/* Table responsive improvements */
.table-responsive {
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
}

/* Input groups */
.input-group {
  border-radius: 8px;
  overflow: hidden;
}

.input-group .form-control {
  border-right: none;
}

.input-group-append .btn {
  border-left: none;
}

/* Mobile enhancements */
@media (max-width: 768px) {
  /* Navbar mobile layout fix: keep Admin/Salir visible without page horizontal scroll */
  .topbar .container-fluid { display: flex; flex-wrap: wrap; align-items: center; }
  /* Keep brand at the start */
  .topbar .brand-pill { order: 1; }
  /* Place right actions next to brand, push to the right */
  .topbar .navbar-nav.ml-auto { order: 2; margin-left: auto; flex: 0 0 auto; }
  /* Move the middle tabs to a second row and make them horizontally scrollable within their own area */
  .topbar .top-tabs {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
    padding-bottom: 4px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .topbar .top-tabs .nav-item { flex: 0 0 auto; }
  .nav-link { padding: 10px 12px !important; font-size: 0.875rem; }
}

@media (max-width: 576px) {
  .nav-link { padding: 8px 10px !important; font-size: 0.8125rem; }
  .brand-pill { padding: 4px 8px; }
  .topbar .navbar-brand { font-size: 1.25rem; }
  /* Stack input groups */
  .input-group { flex-wrap: wrap; }
  .input-group .form-control { flex: 1 0 100%; width: 100%; min-width: 0; }
  .input-group .input-group-append .btn { width: 100%; margin-top: 8px; }
}

/* Ensure images are responsive */
img, .img-fluid { max-width: 100%; height: auto; display: block; }

/* Global page-width and overflow fix */
html, body { max-width: 100%; overflow-x: hidden; }
.content-wrapper { overflow-x: hidden; }
.topbar .container-fluid { box-sizing: border-box; width: 100%; }
.topbar .top-tabs { min-width: 0; }
.topbar .navbar-nav.ml-auto { min-width: 0; }
.content .container-fluid { box-sizing: border-box; }


/* Crediton Modern Vertical Sidebar */
:root {
  --sidebar-width: 240px;
  --sidebar-collapsed: 72px;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e5e7eb;
  --sidebar-text: #334155;
  --sidebar-muted: #94a3b8;
  --active-blue: #3949ab; /* requerido */
}

.crediton-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: width .22s ease;
}

/* Header con marca y toggle */
.crediton-sidebar .sidebar-header{
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 12px; margin-bottom: 8px;
  border-bottom: 1px solid var(--sidebar-border);
}
.crediton-sidebar .brand{ color: var(--text-primary); font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.crediton-sidebar .sidebar-toggle{ background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; cursor: pointer; color: var(--text-secondary); }
.crediton-sidebar .sidebar-toggle:hover{ background: var(--bg-light); }

/* Avatar / logo circular */
.crediton-sidebar .sidebar-profile{ display:flex; align-items:center; justify-content:center; padding: 16px 8px; }
.crediton-sidebar .profile-avatar{ width: 64px; height: 64px; border-radius: 50%; border:1px solid var(--sidebar-border); background:#fff; padding: 4px; }

.crediton-sidebar .sidebar-nav{ flex: 1 1 auto; overflow: hidden; padding: 8px 0; }
.crediton-sidebar .nav-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap: 4px; }
.crediton-sidebar .nav-link{ display:flex; align-items:center; gap: 12px; color: var(--sidebar-text); text-decoration:none; padding: 10px 12px; border-radius: 10px; transition: background .2s ease, color .2s ease, transform .12s ease; white-space: nowrap; }
.crediton-sidebar .nav-link i{ font-size: 1rem; width: 20px; text-align:center; color: var(--sidebar-muted); }
.crediton-sidebar .nav-link:hover{ background: var(--bg-light); transform: translateX(2px); }
.crediton-sidebar .nav-link.active{ background: var(--active-blue); color: #fff; box-shadow: var(--shadow); }
.crediton-sidebar .nav-link.active i{ color:#fff; }
.crediton-sidebar .nav-link .label{ overflow:hidden; text-overflow: ellipsis; }

/* Pie con salir */
.crediton-sidebar .sidebar-bottom{ margin-top:auto; padding-top: 10px; border-top: 1px solid var(--sidebar-border); }

/* Estado colapsado */
body.sidebar-collapsed .crediton-sidebar{ width: var(--sidebar-collapsed); }
body.sidebar-collapsed .crediton-sidebar .sidebar-header{ justify-content: center; }
body.sidebar-collapsed .crediton-sidebar .sidebar-toggle{ transform: rotate(180deg); }
body.sidebar-collapsed .crediton-sidebar .brand-text{ display:none; }
body.sidebar-collapsed .crediton-sidebar .label{ display:none; }
body.sidebar-collapsed .crediton-sidebar .sidebar-profile{ padding: 12px 0; }
body.sidebar-collapsed .crediton-sidebar .profile-avatar{ width: 40px; height: 40px; }

/* Tooltips simples en colapsado */
body.sidebar-collapsed .crediton-sidebar .nav-link{ position: relative; }
body.sidebar-collapsed .crediton-sidebar .nav-link:hover::after{
  content: attr(title);
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: #111827; color:#fff; padding: 6px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 2000;
}

/* Layout general: quitamos la topbar y empujamos contenido */
.topbar{ display:none !important; }
.content-wrapper{ margin-left: var(--sidebar-width); transition: margin-left .22s ease; }
body.sidebar-collapsed .content-wrapper{ margin-left: var(--sidebar-collapsed); }

@media (max-width: 992px){
  .crediton-sidebar{ transform: translateX(-100%); transition: transform .22s ease, width .22s ease; }
  /* Abrir el menú solo cuando el cuerpo tenga .sidebar-open */
  body.sidebar-open .crediton-sidebar{ transform: translateX(0); width: var(--sidebar-width); }
  /* Asegurar que .with-sidebar no lo fuerce abierto en móvil */
  body.with-sidebar .crediton-sidebar{ transform: translateX(-100%); }
  .content-wrapper{ margin-left: 0; }
  body.sidebar-collapsed .content-wrapper{ margin-left: 0; }

  /* Overlay para cerrar */
  .sidebar-overlay{
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    z-index: 1030; opacity: 0; visibility: hidden; transition: opacity .2s ease;
  }
  body.sidebar-open .sidebar-overlay{ opacity: 1; visibility: visible; }
  /* Botón hamburguesa móvil */
  .mobile-hamburger{
    position: fixed; left: 12px; top: 12px; width: 40px; height: 40px;
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    background: var(--bg-white); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
    z-index: 1100;
  }
  .mobile-hamburger span{ display:block; height: 2px; background: currentColor; margin: 0 8px; border-radius: 2px; }
}
@media (min-width: 993px){
  .mobile-hamburger, .sidebar-overlay{ display: none !important; }
}

/* Asegurar que no haya scroll horizontal */
html, body { max-width: 100%; overflow-x: hidden; }


/* Ajuste: hover para expandir, sin toggle JS */
.crediton-sidebar { width: var(--sidebar-collapsed); /* eliminado display:none */ }
.content-wrapper{ margin-left: var(--sidebar-collapsed); }

/* Expandir automáticamente al hover en desktop */
@media (hover: hover) and (pointer: fine){
  body.with-sidebar .crediton-sidebar:hover{ width: var(--sidebar-width); }
  body.with-sidebar .crediton-sidebar:hover ~ .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .wrapper .content-wrapper{ margin-left: var(--sidebar-width); }
}
-sidebar .crediton-sidebar:hover + .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .wrapper .content-wrapper{ margin-left: var(--sidebar-width); }
  .crediton-sidebar:hover .brand-text{ display:inline !important; }
  .crediton-sidebar:hover .label{ display:inline !important; }
  .crediton-sidebar:hover .sidebar-header{ justify-content: space-between; }
}

/* En móvil: sidebar oculto por defecto y se muestra con body.with-sidebar */
@media (max-width: 992px){
  .crediton-sidebar{ transform: translateX(-100%); }
  body.with-sidebar .crediton-sidebar{ transform: translateX(0); width: var(--sidebar-width); }
  .content-wrapper{ margin-left: 0; }
}

/* Imprimir: ocultar sidebar y resetear margen */
@media print{
  .crediton-sidebar{ display:none !important; }
  .content-wrapper{ margin-left: 0 !important; }
}

/* Overrides finales para móvil: abrir solo con .sidebar-open */
@media (max-width: 992px){
  body.with-sidebar .crediton-sidebar{ transform: translateX(-100%) !important; }
  body.sidebar-open .crediton-sidebar{ transform: translateX(0) !important; width: var(--sidebar-width); }
}


.crediton-sidebar .sidebar-nav{ flex: 1 1 auto; overflow: hidden; padding: 8px 0; }
.crediton-sidebar .nav-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap: 4px; }
.crediton-sidebar .nav-link{ display:flex; align-items:center; gap: 12px; color: var(--sidebar-text); text-decoration:none; padding: 10px 12px; border-radius: 10px; transition: background .2s ease, color .2s ease, transform .12s ease; white-space: nowrap; }
.crediton-sidebar .nav-link i{ font-size: 1rem; width: 20px; text-align:center; color: var(--sidebar-muted); }
.crediton-sidebar .nav-link:hover{ background: var(--bg-light); transform: translateX(2px); }
.crediton-sidebar .nav-link.active{ background: var(--active-blue); color: #fff; box-shadow: var(--shadow); }
.crediton-sidebar .nav-link.active i{ color:#fff; }
.crediton-sidebar .nav-link .label{ overflow:hidden; text-overflow: ellipsis; }

/* Pie con salir */
.crediton-sidebar .sidebar-bottom{ margin-top:auto; padding-top: 10px; border-top: 1px solid var(--sidebar-border); }

/* Estado colapsado */
body.sidebar-collapsed .crediton-sidebar{ width: var(--sidebar-collapsed); }
body.sidebar-collapsed .crediton-sidebar .sidebar-header{ justify-content: center; }
body.sidebar-collapsed .crediton-sidebar .sidebar-toggle{ transform: rotate(180deg); }
body.sidebar-collapsed .crediton-sidebar .brand-text{ display:none; }
body.sidebar-collapsed .crediton-sidebar .label{ display:none; }
body.sidebar-collapsed .crediton-sidebar .sidebar-profile{ padding: 12px 0; }
body.sidebar-collapsed .crediton-sidebar .profile-avatar{ width: 40px; height: 40px; }

/* Tooltips simples en colapsado */
body.sidebar-collapsed .crediton-sidebar .nav-link{ position: relative; }
body.sidebar-collapsed .crediton-sidebar .nav-link:hover::after{
  content: attr(title);
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: #111827; color:#fff; padding: 6px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 2000;
}

/* Layout general: quitamos la topbar y empujamos contenido */
.topbar{ display:none !important; }
.content-wrapper{ margin-left: var(--sidebar-width); transition: margin .22s ease; }
body.sidebar-collapsed .content-wrapper{ margin-left: var(--sidebar-collapsed); }

@media (max-width: 992px){
  .crediton-sidebar{ transform: translateX(-100%); transition: transform .22s ease, width .22s ease; }
  body.with-sidebar .crediton-sidebar{ transform: translateX(0); width: var(--sidebar-width); }
  .content-wrapper{ margin-left: 0; }
  body.sidebar-collapsed .content-wrapper{ margin-left: 0; }
}

/* Asegurar que no haya scroll horizontal */
html, body { max-width: 100%; overflow-x: hidden; }

/* Ajuste: hover para expandir, sin toggle JS */
.crediton-sidebar { width: var(--sidebar-collapsed); }
.content-wrapper{ margin-left: var(--sidebar-collapsed); }

/* Expandir automáticamente al hover en desktop */
@media (hover: hover) and (pointer: fine){
  body.with-sidebar .crediton-sidebar:hover{ width: var(--sidebar-width); }
  body.with-sidebar .crediton-sidebar:hover ~ .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .wrapper .content-wrapper{ margin-left: var(--sidebar-width); }
}-sidebar .crediton-sidebar:hover + .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .wrapper .content-wrapper{ margin-left: var(--sidebar-width); }
  .crediton-sidebar:hover .brand-text{ display:inline !important; }
  .crediton-sidebar:hover .label{ display:inline !important; }
  .crediton-sidebar:hover .sidebar-header{ justify-content: space-between; }
}

/* En móvil: sidebar oculto por defecto y se muestra con body.with-sidebar */
@media (max-width: 992px){
  .crediton-sidebar{ transform: translateX(-100%); }
  body.with-sidebar .crediton-sidebar{ transform: translateX(0); width: var(--sidebar-width); }
  .content-wrapper{ margin-left: 0; }
}

/* Imprimir: ocultar sidebar y resetear margen */
@media print{
  .crediton-sidebar{ display:none !important; }
  .content-wrapper{ margin-left: 0 !important; }
}

/* Logo dual en el header del sidebar */
.crediton-sidebar .sidebar-logo{ display:flex; align-items:center; justify-content:center; width:100%; }
.crediton-sidebar .sidebar-logo .logo{ display:block; height:28px; object-fit:contain; }
.crediton-sidebar .sidebar-logo .logo-icon{ height:44px; width:auto; }
.crediton-sidebar .sidebar-logo .logo-full{ display:none; }

/* Removido perfil: asegurar que no afecten estilos */
.crediton-sidebar .sidebar-profile{ display:none; }

/* Responsive: en pantallas pequeñas la barra ocupa ancho completo al abrirse */
@media (max-width: 992px){
  body.with-sidebar .crediton-sidebar{ width: var(--sidebar-width); }
  body.with-sidebar .crediton-sidebar + .content-wrapper,
  body.with-sidebar .crediton-sidebar ~ .content-wrapper{ margin-left: 0; }
}
/* Hover expand (desktop) mantiene comportamiento */
@media (hover:hover) and (pointer:fine){
  body.with-sidebar .crediton-sidebar:hover{ width: var(--sidebar-width); }
}
.crediton-sidebar .sidebar-logo .logo-full{ height:32px; width:auto; margin-left:8px; }

/* Estado por defecto: colapsado (solo icono en header, logo full visible en perfil) */
.crediton-sidebar .logo-icon{ display:inline-block; }
.crediton-sidebar .logo-full{ display:none; }
.crediton-sidebar .sidebar-profile .profile-logo-full{ display:block; }
.crediton-sidebar .sidebar-profile .profile-logo-icon{ display:none; height:36px; width:auto; margin-left:8px; }

/* En hover del sidebar (expandido): mostrar icono y ocultar logo full en ambos lugares */
@media (hover:hover) and (pointer:fine){
  body.with-sidebar .crediton-sidebar:hover .logo-icon{ display:inline-block; }
  body.with-sidebar .crediton-sidebar:hover .logo-full{ display:none; }
  body.with-sidebar .crediton-sidebar:hover .sidebar-profile .profile-logo-full{ display:none; }
  body.with-sidebar .crediton-sidebar:hover .sidebar-profile .profile-logo-icon{ display:inline-block; }
}

/* Alinear al centro superior */
.crediton-sidebar .sidebar-header{ align-items:center; justify-content:center; min-height:64px; padding:12px 0; }
.crediton-sidebar .brand{ display:flex; width:100%; align-items:center; justify-content:center; }


/* Footer global como texto pequeño (no fijo) */
body{ padding-bottom: 0; }
body::after{
  content: "© Jeffry Sevilla. 2025 - v3.0";
  position: static; /* antes fixed */
  display:block; text-align:center; padding:6px 8px;
  font-size:.78rem; color: var(--text-secondary);
  background: transparent; border: none; box-shadow: none;
  margin-top:16px; z-index:auto;
}
@media (max-width: 768px){ body::after{ font-size: .75rem; padding:6px; } }
@media print{ body::after{ display:none !important; } }
.crediton-sidebar .sidebar-logo .logo-full{ height:32px; width:auto; margin-left:8px; }

/* Estado por defecto: colapsado (solo icono en header, logo full visible en perfil) */
.crediton-sidebar .logo-icon{ display:inline-block; }
.crediton-sidebar .logo-full{ display:none; }
.crediton-sidebar .sidebar-profile .profile-logo-full{ display:block; }
.crediton-sidebar .sidebar-profile .profile-logo-icon{ display:none; height:36px; width:auto; margin-left:8px; }

/* En hover del sidebar (expandido): mostrar icono y ocultar logo full en ambos lugares */
@media (hover:hover) and (pointer:fine){
  body.with-sidebar .crediton-sidebar:hover .logo-icon{ display:inline-block; }
  body.with-sidebar .crediton-sidebar:hover .logo-full{ display:none; }
  body.with-sidebar .crediton-sidebar:hover .sidebar-profile .profile-logo-full{ display:none; }
  body.with-sidebar .crediton-sidebar:hover .sidebar-profile .profile-logo-icon{ display:inline-block; }
}

/* Alinear al centro superior */
.crediton-sidebar .sidebar-header{ align-items:center; justify-content:center; min-height:64px; padding:12px 0; }
.crediton-sidebar .brand{ display:flex; width:100%; align-items:center; justify-content:center; }
.crediton-sidebar .version-badge{
  display:inline-block; margin-top:6px; padding:2px 8px; border-radius:10px;
  background: var(--bg-light); color: var(--text-primary); font-weight:700; font-size:.85rem;
  border:1px solid var(--border);
}
@media (max-width: 992px){
  .crediton-sidebar .version-badge{ font-size:.9rem; padding:4px 10px; }
}
.crediton-sidebar .brand{ color: var(--text-primary); font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.crediton-sidebar .sidebar-toggle{ background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; cursor: pointer; color: var(--text-secondary); }
.crediton-sidebar .sidebar-toggle:hover{ background: var(--bg-light); }

/* Avatar / logo circular */
.crediton-sidebar .sidebar-profile{ display:flex; align-items:center; justify-content:center; padding: 16px 8px; }
.crediton-sidebar .profile-avatar{ width: 64px; height: 64px; border-radius: 50%; border:1px solid var(--sidebar-border); background:#fff; padding: 4px; }

/* Navegación */
.crediton-sidebar .sidebar-nav{ flex: 1 1 auto; overflow: hidden; padding: 8px 0; }
.crediton-sidebar .nav-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap: 4px; }
.crediton-sidebar .nav-link{ display:flex; align-items:center; gap: 12px; color: var(--sidebar-text); text-decoration:none; padding: 10px 12px; border-radius: 10px; transition: background .2s ease, color .2s ease, transform .12s ease; white-space: nowrap; }
.crediton-sidebar .nav-link i{ font-size: 1rem; width: 20px; text-align:center; color: var(--sidebar-muted); }
.crediton-sidebar .nav-link:hover{ background: var(--bg-light); transform: translateX(2px); }
.crediton-sidebar .nav-link.active{ background: var(--active-blue); color: #fff; box-shadow: var(--shadow); }
.crediton-sidebar .nav-link.active i{ color:#fff; }
.crediton-sidebar .nav-link .label{ overflow:hidden; text-overflow: ellipsis; }

/* Pie con salir */
.crediton-sidebar .sidebar-bottom{ margin-top:auto; padding-top: 10px; border-top: 1px solid var(--sidebar-border); }

/* Estado colapsado */
body.sidebar-collapsed .crediton-sidebar{ width: var(--sidebar-collapsed); }
body.sidebar-collapsed .crediton-sidebar .sidebar-header{ justify-content: center; }
body.sidebar-collapsed .crediton-sidebar .sidebar-toggle{ transform: rotate(180deg); }
body.sidebar-collapsed .crediton-sidebar .brand-text{ display:none; }
body.sidebar-collapsed .crediton-sidebar .label{ display:none; }
body.sidebar-collapsed .crediton-sidebar .sidebar-profile{ padding: 12px 0; }
body.sidebar-collapsed .crediton-sidebar .profile-avatar{ width: 40px; height: 40px; }

/* Tooltips simples en colapsado */
body.sidebar-collapsed .crediton-sidebar .nav-link{ position: relative; }
body.sidebar-collapsed .crediton-sidebar .nav-link:hover::after{
  content: attr(title);
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: #111827; color:#fff; padding: 6px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 2000;
}

/* Layout general: quitamos la topbar y empujamos contenido */
.topbar{ display:none !important; }
.content-wrapper{ margin-left: var(--sidebar-width); transition: margin .22s ease; }
body.sidebar-collapsed .content-wrapper{ margin-left: var(--sidebar-collapsed); }

@media (max-width: 992px){
  .crediton-sidebar{ transform: translateX(-100%); transition: transform .22s ease, width .22s ease; }
  body.with-sidebar .crediton-sidebar{ transform: translateX(0); }
  .content-wrapper{ margin-left: 0; }
  body.sidebar-collapsed .content-wrapper{ margin-left: 0; }
}

/* Asegurar que no haya scroll horizontal */
html, body { max-width: 100%; overflow-x: hidden; }

/* Ajuste: hover para expandir, sin toggle JS */
.crediton-sidebar { width: var(--sidebar-collapsed); }
.content-wrapper{ margin-left: var(--sidebar-collapsed); }

/* Expandir automáticamente al hover en desktop */
@media (hover: hover) and (pointer: fine){
  body.with-sidebar .crediton-sidebar:hover{ width: var(--sidebar-width); }
  body.with-sidebar .crediton-sidebar:hover ~ .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .wrapper .content-wrapper{ margin-left: var(--sidebar-width); }
}
  body.with-sidebar .crediton-sidebar:hover + .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .wrapper .content-wrapper{ margin-left: var(--sidebar-width); }
  .crediton-sidebar:hover .brand-text{ display:inline !important; }
  .crediton-sidebar:hover .label{ display:inline !important; }
  .crediton-sidebar:hover .sidebar-header{ justify-content: space-between; }
}

/* En móvil: sidebar oculto por defecto y se muestra con body.with-sidebar */
@media (max-width: 992px){
/* Layout general: quitamos la topbar y empujamos contenido */
.topbar{ display:none !important; }
.content-wrapper{ margin-left: var(--sidebar-width); transition: margin .22s ease; }
body.sidebar-collapsed .content-wrapper{ margin-left: var(--sidebar-collapsed); }

@media (max-width: 992px){
  .crediton-sidebar{ transform: translateX(-100%); transition: transform .22s ease, width .22s ease; }
  body.with-sidebar .crediton-sidebar{ transform: translateX(0); }
  .content-wrapper{ margin-left: 0; }
  body.sidebar-collapsed .content-wrapper{ margin-left: 0; }
}

/* Asegurar que no haya scroll horizontal */
html, body { max-width: 100%; overflow-x: hidden; }

/* Ajuste: hover para expandir, sin toggle JS */
.crediton-sidebar { width: var(--sidebar-collapsed); }
.content-wrapper{ margin-left: var(--sidebar-collapsed); }

/* Expandir automáticamente al hover en desktop */
@media (hover: hover) and (pointer: fine){
  body.with-sidebar .crediton-sidebar:hover{ width: var(--sidebar-width); }
  body.with-sidebar .crediton-sidebar:hover ~ .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .content-wrapper,
  body.with-sidebar .crediton-sidebar:hover + .wrapper .content-wrapper{ margin-left: var(--sidebar-width); }
  .crediton-sidebar:hover .brand-text{ display:inline !important; }
  .crediton-sidebar:hover .label{ display:inline !important; }
  .crediton-sidebar:hover .sidebar-header{ justify-content: space-between; }
}

/* En móvil: sidebar oculto por defecto y se muestra con body.with-sidebar */
@media (max-width: 992px){
  .crediton-sidebar{ transform: translateX(-100%); }
  body.with-sidebar .crediton-sidebar{ transform: translateX(0); width: var(--sidebar-width); }
  .content-wrapper{ margin-left: 0; }
}

/* Imprimir: ocultar sidebar y resetear margen */
@media print{
  .crediton-sidebar{ display:none !important; }
  .content-wrapper{ margin-left: 0 !important; }
}

/* Logo dual en el header del sidebar */
.crediton-sidebar .sidebar-logo{ display:flex; align-items:center; justify-content:center; width:100%; }
.crediton-sidebar .sidebar-logo .logo{ display:block; height:28px; object-fit:contain; }
.crediton-sidebar .sidebar-logo .logo-icon{ height:44px; width:auto; }
.crediton-sidebar .sidebar-logo .logo-full{ display:none; }

/* Removido perfil: asegurar que no afecten estilos */
.crediton-sidebar .sidebar-profile{ display:none; }

/* Responsive: en pantallas pequeñas la barra ocupa ancho completo al abrirse */
@media (max-width: 992px){
  body.with-sidebar .crediton-sidebar{ width: var(--sidebar-width); }
  body.with-sidebar .crediton-sidebar + .content-wrapper,
  body.with-sidebar .crediton-sidebar ~ .content-wrapper{ margin-left: 0; }
}
/* Hover expand (desktop) mantiene comportamiento */
@media (hover:hover) and (pointer:fine){
  body.with-sidebar .crediton-sidebar:hover{ width: var(--sidebar-width); }
}
.crediton-sidebar .sidebar-logo .logo-full{ height:32px; width:auto; margin-left:8px; }

/* Estado por defecto: colapsado (solo icono en header, logo full visible en perfil) */
.crediton-sidebar .logo-icon{ display:inline-block; }
.crediton-sidebar .logo-full{ display:none; }
.crediton-sidebar .sidebar-profile .profile-logo-full{ display:block; }
.crediton-sidebar .sidebar-profile .profile-logo-icon{ display:none; height:36px; width:auto; margin-left:8px; }

/* En hover del sidebar (expandido): mostrar icono y ocultar logo full en ambos lugares */
@media (hover:hover) and (pointer:fine){
  body.with-sidebar .crediton-sidebar:hover .logo-icon{ display:inline-block; }
  body.with-sidebar .crediton-sidebar:hover .logo-full{ display:none; }
  body.with-sidebar .crediton-sidebar:hover .sidebar-profile .profile-logo-full{ display:none; }
  body.with-sidebar .crediton-sidebar:hover .sidebar-profile .profile-logo-icon{ display:inline-block; }
}

/* Alinear al centro superior */
.crediton-sidebar .sidebar-header{ align-items:center; justify-content:center; min-height:64px; padding:12px 0; }
.crediton-sidebar .brand{ display:flex; width:100%; align-items:center; justify-content:center; }
.crediton-sidebar .version-badge{
  display:inline-block; margin-top:6px; padding:2px 8px; border-radius:10px;
  background: var(--bg-light); color: var(--text-primary); font-weight:700; font-size:.85rem;
  border:1px solid var(--border);
}
@media (max-width: 992px){
  .crediton-sidebar .version-badge{ font-size:.9rem; padding:4px 10px; }
}
.crediton-sidebar .brand{ color: var(--text-primary); font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.crediton-sidebar .sidebar-toggle{ background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; cursor: pointer; color: var(--text-secondary); }
.crediton-sidebar .sidebar-toggle:hover{ background: var(--bg-light); }

/* Avatar / logo circular */
.crediton-sidebar .sidebar-profile{ display:flex; align-items:center; justify-content:center; padding: 16px 8px; }
.crediton-sidebar .profile-avatar{ width: 64px; height: 64px; border-radius: 50%; border:1px solid var(--sidebar-border); background:#fff; padding: 4px; }

/* Navegación */
.crediton-sidebar .sidebar-nav{ flex: 1 1 auto; overflow: hidden; padding: 8px 0; }
.crediton-sidebar .nav-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap: 4px; }
.crediton-sidebar .nav-link{ display:flex; align-items:center; gap: 12px; color: var(--sidebar-text); text-decoration:none; padding: 10px 12px; border-radius: 10px; transition: background .2s ease, color .2s ease, transform .12s ease; white-space: nowrap; }
.crediton-sidebar .nav-link i{ font-size: 1rem; width: 20px; text-align:center; color: var(--sidebar-muted); }
.crediton-sidebar .nav-link:hover{ background: var(--bg-light); transform: translateX(2px); }
.crediton-sidebar .nav-link.active{ background: var(--active-blue); color: #fff; box-shadow: var(--shadow); }
.crediton-sidebar .nav-link.active i{ color:#fff; }
.crediton-sidebar .nav-link .label{ overflow:hidden; text-overflow: ellipsis; }

/* Pie con salir */
.crediton-sidebar .sidebar-bottom{ margin-top:auto; padding-top: 10px; border-top: 1px solid var(--sidebar-border); }

/* Estado colapsado */
body.sidebar-collapsed .crediton-sidebar{ width: var(--sidebar-collapsed); }
body.sidebar-collapsed .crediton-sidebar .sidebar-header{ justify-content: center; }
body.sidebar-collapsed .crediton-sidebar .sidebar-toggle{ transform: rotate(180deg); }
body.sidebar-collapsed .crediton-sidebar .brand-text{ display:none; }
body.sidebar-collapsed .crediton-sidebar .label{ display:none; }
body.sidebar-collapsed .crediton-sidebar .sidebar-profile{ padding: 12px 0; }
body.sidebar-collapsed .crediton-sidebar .profile-avatar{ width: 40px; height: 40px; }

/* Tooltips simples en colapsado */
body.sidebar-collapsed .crediton-sidebar .nav-link{ position: relative; }
body.sidebar-collapsed .crediton-sidebar .nav-link:hover::after{
  content: attr(title);
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: #111827; color:#fff; padding: 6px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 2000;
}

/* Layout general: quitamos la topbar y empujamos contenido */
.topbar{ display:none !important; }
.content-wrapper{ margin-left: var(--sidebar-width); transition: margin .22s ease; }
body.sidebar-collapsed .content-wrapper{ margin-left: var(--sidebar-collapsed); }

@media (max-width: 992px){
  .crediton-sidebar{ transform: translateX(-100%); transition: transform .22s ease; }
  body.with-sidebar .crediton-sidebar{ transform: translateX(0); }
  .content-wrapper{ margin-left: 0; }
  body.sidebar-collapsed .content-wrapper{ margin-left: 0; }
}

/* Asegurar que no haya scroll horizontal */
html, body { max-width: 100%; overflow-x: hidden; }


/* Ajuste: hover para expandir, sin toggle JS */
.crediton-sidebar { width: var(--sidebar-collapsed); /* eliminado display:none */ }
.content-wrapper{ margin-left: var(--sidebar-collapsed); }

/* Expandir automáticamente al hover en desktop */
@media (hover: hover) and (pointer: fine){
  body.with-sidebar .crediton-sidebar:hover{ width: var(--sidebar-width); }
  body.with-sidebar .crediton-sidebar:hover ~ .content-wrapper,
  body.with