body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f6f8fa;
}

header {
    background-color: #1f4e79;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

header a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
}

main {
    padding: 20px;
}

.modulos ul {
    list-style: none;
    padding: 0;
}

.modulos li {
    margin: 10px 0;
}

.modulos a {
    text-decoration: none;
    color: #1f4e79;
    font-weight: bold;
}

/* Nav-link genérico (solo transición; colores los maneja Bootstrap o el sidebar) */
.nav-link {
  transition: background 0.3s ease, color 0.3s ease;
}

/* Hover para el sidebar (se sobreescribe si está dentro de #sidebar) */
#sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Active SOLO dentro del sidebar — los tabs de Bootstrap mantienen sus propios colores */
#sidebar .nav-link.active {
  background: var(--color-primario, #0d6efd);
  color: #fff !important;
  font-weight: 600;
}

/* Restablecer explícitamente los tabs Bootstrap para que no hereden el sidebar */
.nav-tabs .nav-link {
  border-radius: 0.375rem 0.375rem 0 0;
  padding: 0.5rem 1rem;
  color: #495057;
}
.nav-tabs .nav-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #212529;
}
.nav-tabs .nav-link.active {
  background: #fff !important;
  color: #212529 !important;
  font-weight: 600;
  border-color: #dee2e6 #dee2e6 #fff;
}

@media (max-width: 767px) {
  #sidebar {
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1050;
    transform: translateX(-100%);
    background-color: #212529;
    transition: transform 0.3s ease;
  }

  main {
    margin-left: 0 !important;
  }
}

input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 4px rgba(220, 53, 69, 0.25);
}

/* 🔴 Campos con error */
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 4px rgba(220, 53, 69, 0.25);
}

/* Mensajes de error */
.text-danger.small {
  font-size: 0.85rem;
  margin-top: 3px;
}

/* ✅ Corrige alineación del botón + junto a Select2 */
.input-group .select2-container {
  flex: 1 1 auto !important;
  width: 1% !important; /* Para que se ajuste dentro del grupo */
}

.input-group .select2-selection--single {
  height: 100% !important;
}

.input-group > .btn {
  flex: 0 0 auto !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}


.btn-group .btn {
  border-radius: 0 !important;
}
.btn-group .btn:first-child {
  border-top-left-radius: 0.25rem !important;
  border-bottom-left-radius: 0.25rem !important;
}
.btn-group .btn:last-child {
  border-top-right-radius: 0.25rem !important;
  border-bottom-right-radius: 0.25rem !important;
}
.modal-content {
  border-radius: 1rem;
}
.modal-header.bg-danger {
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
}
.modal-footer.bg-light {
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
}

/* === Select2 ajustado para verse igual que los selects Bootstrap === */

/* Altura y padding */
.select2-container .select2-selection--single {
    height: calc(2.4rem + 2px) !important;  /* igual a form-select */
    padding: 0.47rem 0.75rem !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
}

/* Texto verticalmente centrado */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.6rem !important;
    padding-left: 0 !important;
}

/* Flecha */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    right: 10px !important;
}

/* Hover igual al form-select */
.select2-container--default .select2-selection--single:hover {
    border-color: #86b7fe !important;
}

/* Estado "focus" igual a Bootstrap */
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25) !important;
}

/* --- SOLUCIÓN GLOBAL PARA SELECT2 EN INPUT-GROUP --- */

/* Permitir que el contenedor select2 pueda encoger */
.input-group .select2-container {
    flex: 1 1 auto !important;
    width: 1% !important;
    min-width: 0 !important; /* 💥 clave: evita desbordamientos */
}

/* Asegurar que cualquier select2 tenga width completo */
.select2-container {
    width: 100% !important;
}

/* Ajustar la selección interna */
.input-group .select2-selection--single {
    height: 100% !important;
    min-width: 0 !important;
}




/* ======== Tarjeta de sección ======== */
.section-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.section-title {
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 15px;
}

/* ======== Logos ======== */
.logo-card {
    background: #fafafa;
    border: 1px solid #e3e6e9;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.logo-preview {
    width: 100%;
    max-width: 150px;
    border-radius: 8px;
    margin-top: 10px;
}

.logo-preview.placeholder {
    background: #e9ecef;
    color: #6c757d;
    padding: 30px 0;
    font-size: 14px;
    border: 1px dashed #ced4da;
}

.favicon-preview {
    max-width: 60px;
}

/* ======== Selector de colores ======== */
.color-selector {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.color-swatch.selected {
    border: 2px solid black;
}

.custom-color-btn {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    background: #f8f9fa;
    border: 1px solid #ced4da;
}

/* ======== Preview panel ======== */
.preview-wrapper {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

#previewHeader {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    color: white;
    font-weight: 600;
    background: var(--color-preview-header, #0d6efd);
}

#previewSidebar {
    width: 180px;
    padding: 15px;
    border-radius: 8px;
    background: var(--color-preview-sidebar, #212529);
    color: white;
}

#previewSidebar .menu-item {
    padding: 6px 10px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
}

#previewSidebar .menu-title {
    font-size: 14px;
    opacity: 0.9;
}

/* 🔹 Contenedor full-width para pantallas avanzadas */
#content-wrapper.config-full {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
}






/* ============================================
   CONTENEDOR PRINCIPAL FULL WIDTH
============================================ */
.config-container {
    padding: 10px;
}

.page-header h2 {
    font-size: 1.7rem;
}

/* ============================================
   TABS MODERNOS
============================================ */
.config-tabs .nav-link {
    border-radius: 8px;
    border: 1px solid #dfe3e8;
    background: #fff;
    margin-right: 6px;
    padding: 10px 18px;
    font-weight: 500;
    color: #0d6efd;
}

.config-tabs .nav-link:hover {
    background: #f1f6ff;
    border-color: #bcd4ff;
}

.config-tabs .nav-link.active {
    background: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd;
    font-weight: 600;
}

/* ============================================
   TARJETAS TIPO STRIPE — Sombras suaves
============================================ */
.config-card {
    background: white;
    border-radius: 14px;
    padding: 25px;
    border: 1px solid #e6e9ec;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 20px;
}

/* ============================================
   LOGOS
============================================ */
.logo-box {
    background: #fafbfc;
    border: 1px solid #e3e5e8;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.logo-preview {
    margin-top: 10px;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px dashed #d0d4d8;
}

.logo-preview img {
    width: 100%;
    max-width: 160px;
}

.logo-preview.small-preview img {
    max-width: 60px;
}

/* ============================================
   COLORES
============================================ */
.color-row input[type=color] {
    width: 50px;
    height: 35px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* ============================================
   PREVIEW
============================================ */
.preview-area {
    display: flex;
    gap: 20px;
}

#previewHeader {
    background: #0d6efd;
    color: white;
    padding: 14px;
    text-align: center;
    font-weight: 600;
    border-radius: 8px;
    flex: 1;
}

#previewSidebar {
    background: #343a40;
    color: white;
    padding: 14px;
    width: 200px;
    border-radius: 8px;
}

#previewSidebar .menu-item {
    background: rgba(255,255,255,0.15);
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
}

/* ============================================
   BOTÓN GUARDAR
============================================ */
.save-bar {
    background: white;
    padding: 15px 0;
    border-top: 1px solid #e5e5e5;
}
