/* ===========================
   VARIABLES Y CONFIGURACIÓN BASE
   =========================== */

:root {
    /* Paleta de colores moderna */
    --bs-primary: #114DA6;
    --bs-primary-hover: #0f4391;
    --bs-primary-active: #093473;
    --bs-primary-rgb: 17, 77, 166;

    /* Colores secundarios modernos */
    --color-accent: #00B4D8;
    --color-light: #f8f9fa;
    --color-dark: #0f1419;
    --color-border: #e5e7eb;
    --color-shadow: rgba(17, 77, 166, 0.1);

    /* Transiciones */
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Sombras modernas */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);

    /* Blur y efectos */
    --backdrop-blur: blur(10px);
}

/* ===========================
   RESET Y TIPOGRAFÍA
   =========================== */

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    overflow-x: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

a {
    transition: var(--transition-base);
}

button {
    transition: var(--transition-base);
}

/* ===========================
   CONTENEDOR Y LAYOUT
   =========================== */

.container {
    max-width: 100% !important;
}

main {
    flex: 1;
}

#container-footer {
    margin-top: auto;
}

.width-95 {
    width: 95%;
}

.full-width {
    width: 100%;
}

.custom-width {
    width: 100%;
    max-width: 800px;
}

/* ===========================
   COLORES Y FONDOS
   =========================== */

.bg-dintel {
    background: linear-gradient(135deg, #114DA6 0%, #0f4391 100%) !important;
}

.bg-primary {
    background: #114DA6 !important;
}

.text-primary {
    color: #114DA6 !important;
}

/* ===========================
   BOTONES - DISEÑO MODERNO
   =========================== */

.btn {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
    z-index: 0;
}

.btn:hover::before {
    left: 100%;
}

.btn > * {
    position: relative;
    z-index: 1;
}

/* Botón Primary */
.btn-primary {
    background: linear-gradient(135deg, #114DA6 0%, #0f4391 100%);
    border-color: #114DA6;
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f4391 0%, #093473 100%);
    border-color: #0f4391;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-primary:active {
    background: linear-gradient(135deg, #093473 0%, #072e5f 100%);
    border-color: #093473;
    transform: translateY(0);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(17, 77, 166, 0.25), var(--shadow-md);
}

/* Botón Outline Primary */
.btn-outline-primary {
    border-color: #114DA6;
    color: #114DA6;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: #114DA6;
    border-color: #114DA6;
    color: #fff;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-outline-primary:active {
    background-color: #0f4391;
    border-color: #0f4391;
}

.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(17, 77, 166, 0.25);
}

/* Botón Secundario */
.btn-secundary {
    background: linear-gradient(135deg, #E8EFFA 0%, #D0E0FA 100%);
    border: 2px solid #114DA6;
    color: #114DA6;
}

.btn-secundary:hover {
    background: linear-gradient(135deg, #D0E0FA 0%, #B8D0FA 100%);
    box-shadow: 0 0 8px rgba(17, 77, 166, 0.3);
    transform: translateY(-2px);
}

/* Botón Terciario */
.btn-terciary {
    background-color: #ffffff;
    border: 2px solid #114DA6;
    color: #114DA6;
    box-shadow: var(--shadow-sm);
}

.btn-terciary:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #E8EFFA 100%);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ===========================
   BOTONES PEQUEÑOS
   =========================== */

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary.btn-sm {
    background: linear-gradient(135deg, #114DA6 0%, #0f4391 100%);
    border: none;
}

.btn-primary.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 77, 166, 0.3);
}

.btn-outline-secondary.btn-sm {
    border: 2px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary.btn-sm:hover {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border-color: #6c757d;
    color: #fff;
    transform: translateY(-2px);
}

.btn-outline-primary.btn-sm {
    border: 2px solid #114DA6;
    color: #114DA6;
}

.btn-outline-primary.btn-sm:hover {
    background: #114DA6;
    border-color: #114DA6;
    color: #fff;
    transform: translateY(-2px);
}

/* ===========================
   FORMULARIOS - DISEÑO MODERNO
   =========================== */

/* Campos requeridos - Fondo blanco y borde azul oscuro para todos los campos obligatorios */
.form-group-required .form-control,
.form-group-required .form-select,
.form-group-required textarea,
.form-group-required input,
input.form-control[required]:not([readonly]),
select.form-select[required]:not([readonly]),
textarea.form-control[required]:not([readonly]),
input[required]:not([readonly]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
select[required]:not([readonly]),
textarea[required]:not([readonly]),
    /* Refuerzo para asegurar que se aplique incluso con clases de Bootstrap */
.form-control[required],
.form-select[required],
.form-control.required,
.form-select.required,
input.required,
select.required,
textarea.required {
    background-color: #fff !important;
    border: 2px solid #114DA6 !important;
    border-radius: 0.5rem;
    transition: var(--transition-base);
}

.form-group-required .form-control:focus,
.form-group-required .form-select:focus,
.form-group-required textarea:focus,
.form-group-required input[type="text"]:focus,
.form-group-required input[type="date"]:focus,
.form-group-required input[type="file"]:focus,
.form-group-required input[type="email"]:focus,
.form-group-required input[type="number"]:focus,
.form-group-required input[type="tel"]:focus,
.form-group-required input[type="url"]:focus,
.form-group-required input:not([type]):focus,
input.form-control[required]:not([readonly]):focus,
select.form-select[required]:not([readonly]):focus,
textarea.form-control[required]:not([readonly]):focus,
input[required]:not([readonly]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus,
select[required]:not([readonly]):focus,
textarea[required]:not([readonly]):focus {
    box-shadow: 0 0 0 0.25rem rgba(17, 77, 166, 0.25), var(--shadow-md);
    outline: 0;
}

/* Label para campos obligatorios */
.form-group-required .form-label,
label.required {
    font-weight: bolder !important;
}

/* Excluir asterisco automático en labels específicos */
.form-label.no-asterisk .asterisco-obligatorio {
    display: none !important;
}

/* Campos opcionales - Fondo aliceblue y borde estándar (DESPUÉS de obligatorios para mayor prioridad) */
.form-control:not([required]):not(.required):not([readonly]),
.form-select:not([required]):not(.required):not([readonly]),
input[type="text"]:not([required]):not(.required):not([readonly]),
input[type="date"]:not([required]):not(.required):not([readonly]),
input[type="time"]:not([required]):not(.required):not([readonly]),
input[type="email"]:not([required]):not(.required):not([readonly]),
textarea:not([required]):not(.required):not([readonly]) {
    background-color: aliceblue !important;
    border: 2px solid #e5e7eb !important;
}

/* Campos readonly */
input.form-control[readonly],
textarea.form-control[readonly],
select.form-select[readonly] {
    background: linear-gradient(135deg, #e9ecef 0%, #f1f3f5 100%);
    border: 2px solid #6c757d;
    color: #495057;
    cursor: not-allowed;
    opacity: 0.8;
    border-radius: 0.5rem;
}

input.form-control[readonly]:focus,
textarea.form-control[readonly]:focus,
select.form-select[readonly]:focus {
    background: linear-gradient(135deg, #e9ecef 0%, #f1f3f5 100%);
    border-color: #6c757d;
    color: #495057;
    box-shadow: none;
    outline: 0;
}

/* Campos opcionales - Refuerzo de estilo */
.form-control:not([required]):not(.required):not([readonly]),
.form-select:not([required]):not(.required):not([readonly]) {
    background-color: aliceblue !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 0.5rem;
    transition: var(--transition-base);
}

.form-control:not([required]):not([readonly]):focus {
    border-color: #114DA6;
    box-shadow: 0 0 0 0.25rem rgba(17, 77, 166, 0.15), var(--shadow-sm);
}

/* Labels mejorados */
.form-label {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form group spacing */
.form-group {
    margin-bottom: 0;
}

.form-control-sm,
.form-select-sm {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.form-control-sm:focus,
.form-select-sm:focus {
    border-color: #114DA6;
    box-shadow: 0 0 0 0.2rem rgba(17, 77, 166, 0.15);
}

/* Badges en labels */
.form-label .field-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    border-radius: 0.375rem;
    white-space: nowrap;
}

.form-label .field-badge.badge-obligatorio {
    display: none;
}

.form-label .field-badge.badge-readonly {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

/* Error feedback */
.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback {
    display: block;
}

.form-control.is-invalid {
    border-color: #dc3545;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* ===========================
   TABS MODERNAS Y VISUALES
   =========================== */

.nav-tabs {
    border-bottom: 2px solid #e5e7eb;
    gap: 8px;
    padding: 0 16px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.8) 100%);
    backdrop-filter: var(--backdrop-blur);
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-weight: 500;
    color: #6b7280;
    transition: var(--transition-base);
    position: relative;
    border-radius: 0.375rem 0.375rem 0 0;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.nav-tabs .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #114DA6, #00B4D8);
    border-radius: 3px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tabs .nav-link:hover {
    color: #1f2937;
    background: linear-gradient(135deg, rgba(17, 77, 166, 0.05) 0%, rgba(0, 180, 216, 0.05) 100%);
}

.nav-tabs .nav-link.active {
    color: #114DA6;
    background: transparent;
    border-bottom-color: #114DA6;
    font-weight: 600;
}

.nav-tabs .nav-link.active::after {
    transform: scaleX(1);
}

.nav-tabs .nav-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(17, 77, 166, 0.25);
    outline: 0;
}

/* Tab content con animación */
.tab-content {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content > .tab-pane {
    display: none;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content > .active {
    display: block;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 576px) {
    .nav-tabs {
        padding: 0 8px;
        overflow-x: auto;
    }

    .nav-tabs .nav-link {
        padding: 10px 14px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

/* ===========================
   CARDS MEJORADAS
   =========================== */

.card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: var(--transition-slow);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: #114DA6;
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(135deg, #114DA6 0%, #0f4391 100%);
    border: none;
    border-bottom: 2px solid #093473;
    color: #fff;
    padding: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-login {
    padding: 6px;
    margin: 12px 0px 12px 1px;
}

/* Card de búsqueda mejorada */
.card-search {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card-search:hover {
    border-color: #114DA6;
    box-shadow: 0 4px 12px rgba(17, 77, 166, 0.1);
}

.card-search .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #f3f4f6 100%);
    border: none;
    padding: 1rem;
    border-bottom: 2px solid #e5e7eb;
    color: #1f2937;
}

.card-search .card-body {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* ===========================
   ACCORDION MODERNO
   =========================== */

.accordion {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 2px solid #e5e7eb;
}

.accordion-button {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: none;
    font-weight: 500;
    transition: var(--transition-base);
    position: relative;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(17, 77, 166, 0.08) 0%, rgba(0, 180, 216, 0.08) 100%);
    color: #114DA6;
    box-shadow: inset 0 2px 4px rgba(17, 77, 166, 0.08);
    font-weight: 600;
}

.accordion-button:hover {
    background: linear-gradient(135deg, rgba(17, 77, 166, 0.1) 0%, rgba(0, 180, 216, 0.1) 100%);
    color: #114DA6;
}

.accordion-button::after {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(213deg) brightness(104%) contrast(97%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(-180deg);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(17, 77, 166, 0.25);
    border-color: #114DA6;
}

.accordion-body {
    padding: 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 2px solid #e5e7eb;
    color: #495057;
}

.accordion-item {
    border: none;
    border-bottom: 2px solid #e5e7eb;
    transition: var(--transition-base);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-item:hover {
    border-color: #114DA6;
}

/* ===========================
   ALERTAS MODERNAS
   =========================== */

.alert {
    border: 2px solid;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    animation: slideInDown 0.3s ease;
}

.alert-sm {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0 !important;
    border: 2px solid #d1e7f5;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #e7f1ff 0%, #d1e7f5 100%);
}

.alert i {
    margin-right: 0.75rem;
    font-size: 1.1em;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   NAVBAR Y HEADER
   =========================== */

.navbar-brand {
    padding: 0px;
    transition: var(--transition-base);
}

.navbar-brand > img {
    height: 100%;
    width: auto;
    transition: var(--transition-base);
}

.navbar-brand:hover > img {
    filter: drop-shadow(0 4px 8px rgba(17, 77, 166, 0.2));
}

.navbar-text {
    position: absolute;
    width: 100%;
    left: 0;
    text-align: center;
    margin: auto;
    padding-top: 10px;
}

.header-logo {
    width: 120px !important;
    height: auto;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.header-menu-icon {
    font-size: 1.6rem;
    transition: var(--transition-base);
}

.header-menu-icon:hover {
    transform: rotate(90deg);
    color: #114DA6;
}

/* ===========================
   FOOTER
   =========================== */

.mf-footer {
    width: 100%;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
    color: #e5e7eb;
    border-top: 2px solid #114DA6;
}

.container-footer {
    width: 100%;
}

.footer-logo {
    max-height: 70px;
    transition: var(--transition-base);
    filter: brightness(1.2);
}

.footer-logo:hover {
    filter: brightness(1.4) drop-shadow(0 4px 8px rgba(17, 77, 166, 0.3));
}

.footer-logo-small {
    max-height: 50px;
}

/* ===========================
   UTILIDADES Y CLASES ESPECIALES
   =========================== */

.menuSuperior {
    border-left: 2px solid #114DA6;
    padding-left: 1rem;
}

.menuTab {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition-base);
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #114DA6, #00B4D8);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 100%;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: linear-gradient(135deg, #114DA6 0%, #0f4391 100%);
    color: #fff;
}

/* ===========================
   CURSOR Y ESTADOS
   =========================== */

.cursor-none {
    cursor: default;
}

.hidden,
.hide {
    display: none;
}

/* ===========================
   WIZARD Y STEPPER
   =========================== */

/* Barra de progreso del wizard */
.wizard-progress-track {
    height: 2px;
}

/* Botones de paso del wizard - círculos perfectos */
.wizard-step-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    font-size: 0.875rem;
    line-height: 36px;
    text-align: center;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

.wizard-stepper .nav-pills .nav-link {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    font-size: 0.875rem;
    line-height: 32px;
    text-align: center;
    background-color: #fff;
    border: 2px solid var(--color-border);
    color: #6c757d;
    font-weight: bold;
    transition: var(--transition-base);
    z-index: 2;
    pointer-events: auto;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

.wizard-stepper .nav-pills .nav-link.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(17, 77, 166, 0.25);
    transform: scale(1.1);
}

.wizard-stepper .nav-pills .nav-link.completed {
    background-color: #198754;
    border-color: #198754;
    color: #fff;
}

/* Paso con errores */
.wizard-step-error,
.wizard-stepper .nav-pills .nav-link.wizard-step-error {
    border-color: #dc3545;
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.wizard-stepper .nav-pills .nav-link.completed.wizard-step-error {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* Responsive para wizard en móviles */
@media (max-width: 576px) {
    .wizard-step-btn,
    .wizard-stepper .nav-pills .nav-link {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        font-size: 0.75rem;
        line-height: 28px;
    }
}

/* Selector Segmentado (Objeto Incautado) */
.segmented-control .btn {
    border-width: 2px;
    border-radius: 8px;
    margin: 0 4px;
    flex: 1;
    min-width: 80px;
    padding: 0.4rem 0.5rem !important;
}

.segmented-control .btn .bi {
    font-size: 1rem;
}

.segmented-control .btn .small {
    font-size: 0.7rem;
    line-height: 1.2;
}

.segmented-control .btn-check:checked + .btn {
    background-color: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
    box-shadow: var(--shadow-md);
}

.segmented-control .btn:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Ajustes Responsive */
@media (max-width: 768px) {
    .wizard-stepper .nav-item .small {
        display: none !important;
    }

    .segmented-control {
        flex-direction: column;
    }

    .segmented-control .btn {
        margin: 5px 0;
    }
}

/* ===========================
   BOTONES RELACIONADO CON (CUSTOM)
   =========================== */

.custom-btn-group .btn-check + .btn {
    border: 2px solid var(--bs-primary);
    color: var(--bs-primary);
    background-color: transparent;
    font-weight: 600;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-btn-group .btn-check:checked + .btn {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.custom-btn-group .btn-check + .btn:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    transform: translateY(-1px);
}

.custom-btn-group .btn-check:checked + .btn:hover {
    background-color: var(--bs-primary-hover);
    transform: translateY(-1px);
}

/* ===========================
   ANCHO Y DIMENSIONES
   =========================== */

.w100p {
    width: 100%;
}

.w150px {
    width: 150px;
}

.w200 {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    flex-shrink: 0 !important;
}

.w40px {
    width: 40px;
}

/* Anchos específicos para campos pequeños */
.field-xs {
    max-width: 80px;
}

.field-sm {
    max-width: 120px;
}

.field-md {
    max-width: 180px;
}

.field-nif {
    max-width: 130px;
    min-width: 110px;
}

/* Input group con campo NIF */
.input-group .field-nif {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.field-cp {
    max-width: 100px;
}

.field-date {
    max-width: 180px;
}

.field-time {
    max-width: 130px;
}

/* Columnas flexibles para formularios */
.col-field-xs {
    flex: 0 0 auto;
    width: auto;
    max-width: 120px;
}

.col-field-sm {
    flex: 0 0 auto;
    width: auto;
    max-width: 160px;
}

.col-field-nif {
    flex: 0 0 auto;
    width: auto;
    max-width: 180px;
}

/* En móviles los campos pequeños se expanden un poco más */
@media (max-width: 768px) {
    .field-xs,
    .field-sm,
    .field-nif,
    .field-cp {
        max-width: 100%;
    }

    .col-field-xs,
    .col-field-sm,
    .col-field-nif {
        max-width: 50%;
        flex: 0 0 50%;
    }
}

.min-h-60 {
    min-height: 60px !important;
}

.rounded-bottom {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.custom-padding {
    padding: 17px;
    margin: 0px -10px 0px -10px;
}

/* ===========================
   LOGGING Y DEBUG
   =========================== */

.log-fondo {
    font-family: 'Courier New', Courier, monospace;
    background: linear-gradient(135deg, #1e1e1e 0%, #252535 100%);
    color: #e0e0e0;
    padding: 20px;
    border-radius: 0.75rem;
    border: 2px solid #3a3a4a;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.log-info {
    color: #61afef;
    font-weight: 500;
}

.log-debug {
    color: #c678dd;
    font-weight: 500;
}

.log-error {
    color: #e06c75;
    font-weight: 600;
}

.log-warn {
    color: #e5c07b;
    font-weight: 500;
}

pre {
    background: linear-gradient(135deg, #1e1e1e 0%, #252535 100%);
    color: #e0e0e0;
    padding: 20px;
    border-radius: 0.75rem;
    overflow: auto;
    white-space: pre-wrap;
    border: 2px solid #3a3a4a;
    box-shadow: var(--shadow-lg);
}

/* ===========================
   IMÁGENES Y MEDIA
   =========================== */

.index-image {
    object-fit: cover;
    max-height: 350px;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xl);
    transition: var(--transition-slow);
}

.index-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-2xl);
}

/* ===========================
   PANEL UNIFICADO BÚSQUEDA + LISTADO
   =========================== */

.search-list-panel {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header del Panel - Botón Toggle */
.panel-header-top {
    background: linear-gradient(135deg, #f8f9fa 0%, #f3f4f6 100%);
    border-bottom: 2px solid #e5e7eb;
    padding: 0;
}

.btn-toggle-search {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #f3f4f6 100%);
    border: none;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-toggle-search:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #114DA6;
}

.btn-toggle-search i:first-child {
    color: #114DA6;
    font-size: 1.2em;
}

.toggle-text {
    flex: 1;
}

.toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #6b7280;
}

.btn-toggle-search[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* Panel de búsqueda colapsable */
.search-panel-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-panel-content.show {
    max-height: 500px;
}

.search-panel-body {
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 2px solid #e5e7eb;
}

.search-panel-body .form-group {
    margin-bottom: 0;
}

.search-panel-body .form-label {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Separador */
.panel-separator {
    height: 0;
    border: none;
}

/* Header de Resultados */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 0.875rem 1.5rem;
    background: white;
    border-bottom: 2px solid #e5e7eb;
    flex-wrap: wrap;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: fit-content;
}

.results-count {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    background: linear-gradient(135deg, #f8f9fa 0%, #f3f4f6 100%);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.results-count i {
    color: #114DA6;
    font-size: 1em;
    font-weight: 600;
}

.pagination-top {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.pagination-top .pagination {
    margin-bottom: 0;
}

/* Wrapper de tabla */
.table-wrapper {
    overflow-x: auto;
    padding: 0;
}

.table-wrapper .table {
    margin-bottom: 0;
}

/* Ajustes específicos del listado de denuncias para mantener columnas estables */
.search-list-panel .table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.search-list-panel .table-wrapper .table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.search-list-panel .table-wrapper .table thead th,
.search-list-panel .table-wrapper .table tbody td {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    vertical-align: top;
    padding: 0.65rem 0.5rem;
    font-size: 0.8rem;
}

.search-list-panel .table-wrapper .table thead th {
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.3;
}

.search-list-panel .table-wrapper .table thead th > a {
    display: inline;
    white-space: normal;
}

.search-list-panel .table-wrapper .table th:nth-child(1),
.search-list-panel .table-wrapper .table td:nth-child(1) {
    min-width: 96px;
}

.search-list-panel .table-wrapper .table th:nth-child(2),
.search-list-panel .table-wrapper .table td:nth-child(2) {
    min-width: 110px;
}

.search-list-panel .table-wrapper .table th:nth-child(3),
.search-list-panel .table-wrapper .table td:nth-child(3) {
    min-width: 90px;
}

.search-list-panel .table-wrapper .table th:nth-child(4),
.search-list-panel .table-wrapper .table td:nth-child(4) {
    min-width: 168px;
}

.search-list-panel .table-wrapper .table th:nth-child(5),
.search-list-panel .table-wrapper .table td:nth-child(5),
.search-list-panel .table-wrapper .table th:nth-child(6),
.search-list-panel .table-wrapper .table td:nth-child(6) {
    min-width: 96px;
}

.search-list-panel .table-wrapper .table th:nth-child(7),
.search-list-panel .table-wrapper .table td:nth-child(7) {
    min-width: 150px;
}

.search-list-panel .table-wrapper .table th:nth-child(8),
.search-list-panel .table-wrapper .table td:nth-child(8) {
    min-width: 138px;
}

.search-list-panel .table-wrapper .table th:nth-child(9),
.search-list-panel .table-wrapper .table td:nth-child(9) {
    min-width: 150px;
}

.search-list-panel .table-wrapper .table th:nth-child(10),
.search-list-panel .table-wrapper .table td:nth-child(10) {
    min-width: 210px;
}

.search-list-panel .table-wrapper .table th:nth-child(11),
.search-list-panel .table-wrapper .table td:nth-child(11) {
    width: 10%;
}

.alta-resumen {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.alta-resumen-usuario {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.alta-resumen-fecha {
    align-self: flex-start;
    white-space: nowrap;
}

/* Footer de Resultados */
.results-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.875rem 1.5rem;
    background: white;
    border-top: 2px solid #e5e7eb;
}

.results-footer .pagination {
    margin-bottom: 0;
}

/* ===========================
   ESTADOS DE DENUNCIA
   =========================== */

.estado-cell {
    min-width: 0;
}

.estado-wrapper {
    display: flex;
    min-width: 0;
    align-items: flex-start;
}

.estado-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    min-width: 0;
}

.estado-chip {
    display: inline-flex;
    align-items: center;
    border: 2px solid #dc3545;
    border-radius: 0.5rem;
    overflow: hidden;
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f1 100%);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 100%;
}

.split-button-group:hover {
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.25);
    border-color: #c82333;
}

.split-button {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: #dc3545;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    gap: 0.4rem;
    width: auto;
    max-width: 100%;
    padding: 0.38rem 0.6rem;
    border-radius: 999px;
    font-size: 0.71rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0.01em;
    text-align: center;
    border: 1px solid transparent;
    white-space: nowrap;
    min-width: 0;
}

.estado-chip i {
    font-size: 0.9em;
}

/* Parte izquierda - Texto (deshabilitado) */
.split-button-text {
    cursor: not-allowed;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.estado-chip-rechazado {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    border-color: #fda4af;
    color: #b42318;
}

.estado-chip-aceptado {
    background: linear-gradient(135deg, #ecfdf3 0%, #dcfce7 100%);
    border-color: #86efac;
    color: #166534;
}

.estado-chip-pendiente {
    background: linear-gradient(135deg, #fff8e1 0%, #fef3c7 100%);
    border-color: #fcd34d;
    color: #92400e;
}

.estado-chip-neutro {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #d1d5db;
    color: #374151;
}

.estado-link-action {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b42318;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    transition: color 0.2s ease;
}

.split-button-action:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #c82333;
}

.split-button-action:active {
    background: rgba(220, 53, 69, 0.15);
    color: #bd2130;
}

.split-button-action:focus {
    outline: 2px solid rgba(220, 53, 69, 0.5);
    outline-offset: -2px;
}

/* Evita solapes del botón compuesto en la columna Estado del listado */
.search-list-panel .table-wrapper .table td:nth-child(9) {
    overflow: hidden;
}

.search-list-panel .table-wrapper .table td:nth-child(9) .split-button-group {
    display: flex;
    width: 100%;
    min-width: 0;
}

.search-list-panel .table-wrapper .table td:nth-child(9) .split-button-text {
    justify-content: center;
}

.search-list-panel .table-wrapper .table td:nth-child(9) .split-button-action {
    flex: 0 0 auto;
}

/* Responsive para split button */
@media (max-width: 768px) {
    .split-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .split-button-action {
        padding: 0.4rem 0.6rem;
    }
}

.estado-link-action:hover,
.estado-link-action:focus {
    color: #912018;
    text-decoration-thickness: 2px;
}

.table-responsive {
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #114DA6 0%, #0f4391 100%);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.table thead th {
    border: none;
    padding: 1rem;
    vertical-align: middle;
    white-space: nowrap;
    text-align: left;
}

.table thead th i {
    margin-right: 0.5rem;
    font-size: 0.9em;
    opacity: 0.9;
}

.table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-color: #e5e7eb;
}

.table tbody tr:hover {
    background-color: rgba(17, 77, 166, 0.05);
    box-shadow: inset 0 0 0 2px rgba(17, 77, 166, 0.1);
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border: none;
}

.table-success.highlight-row {
    background-color: rgba(25, 135, 84, 0.1) !important;
    border-left: 4px solid #198754;
}

.table-success.highlight-row:hover {
    background-color: rgba(25, 135, 84, 0.15) !important;
}

.table-primary.sticky-top {
    position: sticky;
    z-index: 10;
}

/* Responsive adjustments tabla */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 0.5rem;
    }

    .table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }

    .table tbody td {
        padding: 0.625rem 0.5rem;
    }

    .badge {
        padding: 0.35rem 0.5rem;
        font-size: 0.65rem;
    }
}

/* ===========================
   BADGES Y ESTADOS
   =========================== */

.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0.375rem;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #114DA6 0%, #0f4391 100%) !important;
    box-shadow: 0 2px 4px rgba(17, 77, 166, 0.2);
}

.badge.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.badge.bg-success {
    background: linear-gradient(135deg, #198754 0%, #157347 100%) !important;
    box-shadow: 0 2px 4px rgba(25, 135, 84, 0.2);
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%) !important;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.badge.bg-light {
    background: #f8f9fa !important;
    color: #495057;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

/* ===========================
   TABLA LINKS
   =========================== */

th > a {
    color: #000;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-base);
}

th > a:hover {
    color: #114DA6;
}

/* ===========================
   SEPARADORES
   =========================== */

hr {
    opacity: 0.3;
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #114DA6, transparent);
    margin: 2rem 0;
}

/* ===========================
   GRADIENTES ESPECIALES
   =========================== */

.gradient-custom-2 {
    background: linear-gradient(90deg, rgb(255, 255, 255) 0%, rgb(100, 100, 100) 35%, rgb(55, 55, 55) 100%);
}

@media (min-width: 769px) {
    .gradient-custom-2 {
        border-top-right-radius: 0.3rem;
        border-bottom-right-radius: 0.3rem;
    }
}

.bg-image-vertical {
    position: relative;
    overflow: hidden;
    background-repeat: no-repeat;
    background-position: right center;
    background-size: auto 100%;
}

/* ===========================
   BOTONES RADIO (BTN-CHECK)
   =========================== */

.btn-check:checked + .btn-outline-primary {
    background: linear-gradient(135deg, #114DA6 0%, #0f4391 100%) !important;
    border-color: #114DA6 !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(17, 77, 166, 0.4);
}

.btn-check:focus + .btn-outline-primary {
    box-shadow: 0 0 0 0.25rem rgba(17, 77, 166, 0.25);
    border-color: #114DA6;
}

.btn-check:checked + .btn-outline-primary:hover {
    background: linear-gradient(135deg, #0f4391 0%, #093473 100%) !important;
    border-color: #0f4391 !important;
    box-shadow: 0 0 16px rgba(17, 77, 166, 0.5);
}

.btn-check + .btn {
    transition: var(--transition-base);
}

.btn-check:not(:checked) + .btn-outline-primary:hover {
    background: rgba(17, 77, 166, 0.1);
    border-color: #114DA6;
    color: #114DA6 !important;
}

.btn-check:disabled + .btn-outline-primary {
    opacity: 0.5;
    cursor: not-allowed;
}

fieldset .btn-group {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0;
}

.btn-group .btn-check + .btn-outline-primary {
    border-radius: 0;
}

.btn-group .btn-check:first-child + .btn-outline-primary {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn-check:last-child + .btn-outline-primary {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* ===========================
   EDITOR SQL
   =========================== */

.sql-textarea {
    font-family: "Courier New", Courier, monospace;
    min-height: 180px;
    background: linear-gradient(135deg, #1e1e1e 0%, #252535 100%);
    color: #e0e0e0;
    border: 2px solid #3a3a4a;
    border-radius: 0.75rem;
}

.results-container {
    max-height: 480px;
    overflow: auto;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
}

fieldset .btn-group .btn {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

/* ===========================
   ESTADOS DE CARGA
   =========================== */

.loading {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ===========================
   LABEL ERROR
   =========================== */

.labelError {
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
    font-weight: 500;
    animation: slideInDown 0.3s ease;
}

/* ===========================
   PROGRESS BAR
   =========================== */

.progress-container {
    width: 100%;
    height: 20px;
    background: linear-gradient(135deg, #f3f3f3 0%, #e5e7eb 100%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #114DA6 0%, #00B4D8 100%);
    animation: progress 2s infinite;
    box-shadow: 0 0 8px rgba(17, 77, 166, 0.3);
}

@keyframes progress {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
    }
}

/* ===========================
   ESTILOS ADMIN EDITOR TABS
   =========================== */

.card-header-tabs .nav-link:not(.active) {
    color: rgba(255, 255, 255, 0.8) !important;
    background-color: transparent !important;
    font-weight: 500;
}

.card-header-tabs .nav-link:not(.active):hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.card-header-tabs .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, #114DA6 0%, #0f4391 100%) !important;
    border-bottom: 3px solid #00B4D8 !important;
    font-weight: 600;
}

/* ===========================
   REENVIAR
   =========================== */

.reenviar {
    padding-right: 25px !important;
    background-repeat: no-repeat !important;
    background-position: right !important;
    transition: var(--transition-base);
}

.reenviar:hover {
    background-color: #f0f0f0 !important;
    transform: translateX(2px);
}

/* ===========================
   RESPONSIVE GENERAL
   =========================== */

@media (min-width: 1025px) {
    .h-custom-2 {
        height: 100%;
    }
}

@media (max-width: 768px) {
    body {
        zoom: 90%;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }

    /* Panel unificado responsive */
    .results-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .pagination-top {
        width: 100%;
        margin-left: 0;
    }

    .results-footer {
        padding: 0.75rem 1rem;
        justify-content: flex-start;
    }

    .btn-toggle-search {
        padding: 0.75rem 1rem;
    }

    .search-panel-body {
        padding: 1rem;
    }
}

@media (max-height: 768px) {
    .index-image {
        max-height: 250px;
    }

    main {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

@media (max-height: 600px) {
    .index-image {
        max-height: 200px;
    }

    .fs-3 {
        font-size: 1.25rem !important;
    }
}

/* Responsive para panel en pantallas muy pequeñas */
@media (max-width: 576px) {
    .search-list-panel {
        border-radius: 0.5rem;
        margin: 0 -8px;
    }

    .btn-toggle-search {
        font-size: 0.9rem;
        gap: 8px;
        padding: 0.75rem 1rem;
    }

    .btn-toggle-search i:first-child {
        font-size: 1rem;
    }

    .search-panel-body {
        padding: 1rem;
    }

    .results-header {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .results-count {
        font-size: 0.85rem;
    }

    .results-footer {
        padding: 0.75rem 1rem;
    }

    .table-wrapper {
        font-size: 0.85rem;
    }

    .table thead th {
        padding: 0.5rem;
    }

    .table tbody td {
        padding: 0.5rem;
    }
}

/* ===========================
   LISTADO DENUNCIAS REFINADO
   =========================== */

.denuncias-page {
    max-width: 1700px;
    margin: 0 auto;
    padding-left: clamp(1rem, 2vw, 2rem);
    padding-right: clamp(1rem, 2vw, 2rem);
}

.denuncias-page .search-list-panel {
    border: 1px solid #d9e2ef;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08), 0 6px 16px rgba(15, 23, 42, 0.04);
}

.denuncias-page .panel-header-top {
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
    border-bottom: 1px solid #dee7f1;
}

.denuncias-page .btn-toggle-search {
    padding: 1.1rem 1.4rem;
    background: transparent;
    font-size: 1rem;
}

.denuncias-page .btn-toggle-search:hover {
    background: rgba(17, 77, 166, 0.04);
}

.denuncias-page .search-panel-body {
    padding: 1.45rem 1.4rem 1.3rem;
    background: #fbfdff;
    border-bottom: 1px solid #e4ebf3;
}

.denuncias-page .results-header {
    padding: 1rem 1.35rem;
    background: transparent;
    border-bottom: 1px solid #e4ebf3;
}

.denuncias-page .results-count {
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: #f4f7fb;
    border: 1px solid #dee7f1;
    box-shadow: none;
    color: #334155;
    font-weight: 600;
}

.denuncias-page .results-count i {
    color: #2a5db0;
}

.denuncias-page .results-footer {
    padding: 1rem 1.35rem;
    background: transparent;
    border-top: 1px solid #e4ebf3;
}

.denuncias-page .table-wrapper {
    padding: 0 0.6rem 1rem;
    background: transparent;
}

.denuncias-page .search-list-panel .table-wrapper .denuncias-table {
    width: max(100%, 1180px);
    min-width: 0;
    margin-top: 0.85rem;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.denuncias-page .denuncias-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.9rem 0.85rem;
    background: #edf4fb;
    color: #1f3658;
    border: 0;
    border-bottom: 1px solid #d9e4f0;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.02em;
    white-space: normal !important;
    line-height: 1.3;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.denuncias-page .denuncias-table thead th:first-child {
    border-top-left-radius: 1rem;
}

.denuncias-page .denuncias-table thead th:last-child {
    border-top-right-radius: 1rem;
}

.denuncias-page .denuncias-table thead th > a {
    display: inline;
    color: inherit;
    white-space: normal;
}

.denuncias-page .denuncias-table thead th > a:hover {
    color: #114DA6;
}

.denuncias-page .denuncias-table tbody td {
    padding: 0.9rem 0.78rem;
    border: 0;
    border-bottom: 1px solid #e8eef6;
    background: #fff;
    color: #243142;
    vertical-align: top;
}

.denuncias-page .denuncias-table tbody tr:nth-child(even) td {
    background: #fbfcfe;
}

.denuncias-page .denuncias-table tbody tr:hover td {
    background: #f7faff;
    box-shadow: none;
}

.denuncias-page .denuncias-table tbody tr.highlight-row td {
    background: #eef8f2 !important;
}

.denuncias-page .denuncias-table tbody tr.highlight-row td:first-child {
    box-shadow: inset 4px 0 0 #198754;
}

.denuncias-page .denuncias-table th:nth-child(1),
.denuncias-page .denuncias-table td:nth-child(1) {
    width: 8%;
}

.denuncias-page .denuncias-table th:nth-child(2),
.denuncias-page .denuncias-table td:nth-child(2) {
    width: 10%;
}

.denuncias-page .denuncias-table th:nth-child(3),
.denuncias-page .denuncias-table td:nth-child(3) {
    width: 8.5%;
}

.denuncias-page .denuncias-table th:nth-child(4),
.denuncias-page .denuncias-table td:nth-child(4) {
    width: 20.5%;
}

.denuncias-page .denuncias-table th:nth-child(5),
.denuncias-page .denuncias-table td:nth-child(5),
.denuncias-page .denuncias-table th:nth-child(6),
.denuncias-page .denuncias-table td:nth-child(6) {
    width: 8%;
}

.denuncias-page .denuncias-table th:nth-child(7),
.denuncias-page .denuncias-table td:nth-child(7) {
    width: 12%;
}

.denuncias-page .denuncias-table th:nth-child(8),
.denuncias-page .denuncias-table td:nth-child(8) {
    width: 20%;
}

.denuncias-page .denuncias-table th:nth-child(9),
.denuncias-page .denuncias-table td:nth-child(9) {
    width: 5%;
}

.denuncias-page .doc-badge {
    min-width: 4rem;
    padding: 0.46rem 0.72rem;
    border-radius: 0.68rem;
    background: #1653a4 !important;
    box-shadow: none !important;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.denuncias-page .ref-organismo,
.denuncias-page .id-value {
    display: inline-block;
    font-size: 0.77rem;
    line-height: 1.35;
    letter-spacing: 0.01em;
    font-weight: 600;
}

.denuncias-page .ref-organismo {
    color: #617287;
}

.denuncias-page .id-value {
    color: #344054;
}

.denuncias-page .infractor-nombre {
    display: block;
    color: #1b2940;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.denuncias-page .fecha-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 0.32rem 0.56rem;
    border: 1px solid #dce5ef;
    border-radius: 0.6rem;
    background: #f9fbfd;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.2;
}

.denuncias-page .alta-resumen {
    gap: 0.25rem;
}

.denuncias-page .alta-resumen-usuario {
    color: #64748b !important;
    font-size: 0.76rem;
    font-weight: 600;
}

.denuncias-page .alta-resumen-fecha {
    display: inline-block;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.denuncias-page .estado-stack {
    gap: 0.28rem;
}

.denuncias-page .estado-stack-rechazado {
    align-items: stretch;
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.denuncias-page .estado-chip {
    padding: 0.34rem 0.64rem;
    border-radius: 999px;
    font-size: 0.71rem;
    box-shadow: none;
}

.denuncias-page .estado-chip-aceptado {
    background: #edf9f1;
    border-color: #b9e3c3;
    color: #1f7a41;
}

.denuncias-page .estado-chip-pendiente {
    background: #fff8e8;
    border-color: #f2d28b;
    color: #9a6700;
}

.denuncias-page .estado-chip-rechazado {
    background: #fff2f4;
    border-color: #f4bec8;
    color: #b42318;
}

.denuncias-page .estado-rechazo-info {
    display: grid;
    gap: 0.42rem;
    width: 100%;
    padding: 0.58rem 0.68rem;
    border: 1px solid #f3d8de;
    border-radius: 0.8rem;
    background: #fff8f9;
    min-width: 0;
}

.denuncias-page .estado-rechazo-item {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.denuncias-page .estado-rechazo-label {
    color: #a61b3c;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.denuncias-page .estado-rechazo-text {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #5c6879;
    font-size: 0.77rem;
    line-height: 1.42;
    white-space: normal;
    min-width: 0;
}

.denuncias-page .estado-rechazo-text-extended {
    -webkit-line-clamp: 2;
    color: #506173;
}

.denuncias-page .cell-accion-header,
.denuncias-page .cell-accion {
    width: 52px;
    min-width: 52px;
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
    text-align: center;
    vertical-align: middle;
}

.denuncias-page .accion-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 1px solid #d9e2ef;
    border-radius: 0.62rem;
    background: #fff;
    color: #1653a4;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.denuncias-page .accion-icon-button:hover,
.denuncias-page .accion-icon-button:focus {
    background: #f4f8fd;
    border-color: #b9cbe0;
    color: #114DA6;
    box-shadow: 0 0 0 0.18rem rgba(17, 77, 166, 0.08);
}

.denuncias-page .estado-link-action {
    color: #a61b3c;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
}

.denuncias-page .estado-link-action:hover,
.denuncias-page .estado-link-action:focus {
    color: #8c1732;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

@media (max-width: 1400px) {
    .denuncias-page {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .denuncias-page .table-wrapper {
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .denuncias-page .search-list-panel .table-wrapper .denuncias-table {
        width: max(100%, 1120px);
    }
}

@media (max-width: 768px) {
    .denuncias-page {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .denuncias-page .search-list-panel {
        border-radius: 1rem;
    }

    .denuncias-page .btn-toggle-search,
    .denuncias-page .search-panel-body,
    .denuncias-page .results-header,
    .denuncias-page .results-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .denuncias-page .table-wrapper {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0.75rem;
    }

    .denuncias-page .denuncias-table {
        margin-top: 0;
    }
}
