/* Estilos Globales Premium para CrisXN Wash */
:root {
    --sidebar-bg: #16324F;
    --bg-color: #F5F8FA;
    --card-bg: #FFFFFF;
    --brand-blue: #0284C7;
    --brand-blue-hover: #026ca3;
    --brand-green: #22A06B;
    --brand-green-hover: #1C8559;
    --text-main: #1F2937;
    --text-muted: #6B7280;
}

body {
    font-family: 'Segoe UI', 'Inter', sans-serif;
    background-color: var(--bg-color) !important;
    color: var(--text-main) !important;
}

/* Fix offcanvas en desktop para que siempre esté visible como sidebar */
@media (min-width: 992px) {
    .offcanvas-lg.offcanvas-start {
        transform: none !important;
        visibility: visible !important;
        position: static !important;
        height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        width: 240px !important;
    }
}

/* Forzar color de fondo del sidebar en todas las resoluciones */
#sidebarOffcanvas {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid rgba(255,255,255,0.05);
    color: #ffffff !important;
}

/* Sombras y Tarjetas */
.card {
    background-color: var(--card-bg) !important;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
}

/* Textos Globales */
.text-dark, h1, h2, h3, h4, h5, h6 { color: var(--text-main) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Azul Principal (Botones e Iconos) */
.text-soft-blue { color: var(--brand-blue) !important; }
.bg-soft-blue-subtle { background-color: rgba(2, 132, 199, 0.15) !important; }
.btn-soft-blue { background-color: var(--brand-blue) !important; border-color: var(--brand-blue) !important; color: white !important; }
.btn-soft-blue:hover { background-color: var(--brand-blue-hover) !important; border-color: var(--brand-blue-hover) !important; color: white !important; }

/* Sobrescribir Bootstrap nativo para que todos los elementos primary usen nuestro azul sin romper opacidades */
.btn-primary {
    --bs-btn-bg: var(--brand-blue);
    --bs-btn-border-color: var(--brand-blue);
    --bs-btn-hover-bg: var(--brand-blue-hover);
    --bs-btn-hover-border-color: var(--brand-blue-hover);
    --bs-btn-active-bg: var(--brand-blue-hover);
    --bs-btn-active-border-color: var(--brand-blue-hover);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand-blue);
    --bs-btn-border-color: var(--brand-blue);
    --bs-btn-hover-bg: var(--brand-blue);
    --bs-btn-hover-border-color: var(--brand-blue);
}
.text-primary { color: rgba(2, 132, 199, var(--bs-text-opacity, 1)) !important; }
.bg-primary { background-color: rgba(2, 132, 199, var(--bs-bg-opacity, 1)) !important; }

/* Verde Acciones Completadas (Botones e Iconos) */
.text-custom-success { color: var(--brand-green) !important; }
.bg-custom-success-subtle { background-color: rgba(34, 160, 107, 0.15) !important; }
.btn-custom-success { background-color: var(--brand-green) !important; border-color: var(--brand-green) !important; color: white !important; }
.btn-custom-success:hover { background-color: var(--brand-green-hover) !important; border-color: var(--brand-green-hover) !important; color: white !important; }

/* Evitar barra de desplazamiento horizontal innecesaria en tablas */
.table-responsive .dataTables_wrapper {
    width: 100%;
}
.table-responsive .dataTables_wrapper .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.table-responsive {
    overflow-x: auto;
}
@media (min-width: 768px) {
    .table-responsive {
        overflow-x: visible !important;
    }
}


/* Estilo para las pestanas tipo CMS (Linea corta azul) */
.custom-underline-tabs {
    border-bottom: 1px solid #e2e8f0 !important;
    gap: 1.5rem;
}
.custom-underline-tabs .nav-item {
    margin-bottom: -1px;
}
.custom-underline-tabs .nav-link {
    color: #64748b !important;
    font-weight: 600;
    padding: 0.75rem 0.25rem !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.custom-underline-tabs .nav-link:hover {
    color: var(--brand-blue) !important;
    border-bottom-color: #cbd5e1 !important;
}
.custom-underline-tabs .nav-link.active {
    color: var(--brand-blue) !important;
    border-bottom: 2px solid var(--brand-blue) !important;
    background-color: transparent !important;
}
.custom-underline-tabs .nav-link span.material-symbols-rounded {
    font-size: 1.25rem;
}


/* Formularios Estilo CMS */
.section-separator-card {
    border-left: 4px solid var(--brand-blue);
    padding-left: 15px;
    margin: 25px 0 15px;
    font-weight: 700;
    color: var(--sidebar-bg);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.input-style-modern {
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    font-size: 0.9rem !important;
    padding: 0.75rem 1rem !important;
    color: #1e293b !important;
    transition: all 0.2s ease;
}
.input-style-modern:focus {
    background-color: #fff !important;
    border-color: var(--brand-blue) !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1) !important;
    outline: none !important;
}
.label-style-modern {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 6px !important;
    display: block !important;
}
.input-group-modern {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
}
.input-group-modern .form-control {
    flex: 1 1 auto;
    width: 1%;
    border-radius: 10px !important;
    padding-right: 45px !important;
}
.btn-input-action {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    z-index: 10;
    transition: all 0.2s;
    padding: 0 !important;
    font-size: 1.1rem;
}
.btn-input-action:hover:not(.disabled) { color: var(--brand-blue) !important; transform: translateY(-50%) scale(1.1); }
.btn-input-action.disabled { opacity: 0.3; cursor: default; }

/* === MÓVIL === */
@media (max-width: 767px) {

  /* Quick action cards (Recoger / Entregar) */
  .card.p-5 {
    padding: 1.25rem !important;
  }
  .card.p-5 .rounded-circle {
    width: 48px !important;
    height: 48px !important;
    margin-bottom: 0.75rem !important;
  }
  .card.p-5 .rounded-circle .material-symbols-rounded {
    font-size: 1.25rem !important;
  }
  .card.p-5 h5 {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
  }
  .card.p-5 p {
    font-size: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }
  .card.p-5 .btn {
    width: 100% !important;
    font-size: 0.9rem !important;
    padding: 0.5rem 1rem !important;
  }

  /* Make custom-underline-tabs horizontally scrollable on mobile */
  .custom-underline-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding-bottom: 2px !important;
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    gap: 1rem;
  }
  .modal .custom-underline-tabs {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .custom-underline-tabs::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
  }
  .custom-underline-tabs .nav-link {
    white-space: nowrap !important;
  }
}
