/* Partilot — correcciones UI (arreglos_partilot.pdf, solo bugs/estilo) */

/* Login */
.group-login input.form-control {
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
}
.group-login .input-group-text {
    font-size: 1.1rem;
    color: #333;
}

/* Textos más legibles */
.text-muted,
small.text-muted,
.form-text,
.label-control + small {
    color: #4a5568 !important;
}
.table td,
.table th {
    color: #1a1a1a;
}
.table thead th {
    color: #212529;
    font-weight: 600;
}

/* Placeholders */
.form-control::placeholder {
    color: #9aa3af !important;
    opacity: 1;
}
.form-control:focus::placeholder {
    color: transparent !important;
}

/* Badges de estado */
.badge {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Campos con icono: menos hueco entre icono y texto */
.content-page .content .group-form .input-group-text {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.content-page .content .group-form .input-group-text img {
    max-width: 22px;
    max-height: 22px;
}
.content-page .content .group-form .form-control {
    min-width: 0;
}

/* Cabecera: contexto de entidad/administración */
.topbar-user-context {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6c757d;
    line-height: 1.25;
    max-width: 300px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1px;
}
.navbar-custom .topbar > .topbar-menu:last-child {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}
.navbar-custom .topbar .nav-user {
    min-height: 48px;
    height: auto !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    align-items: flex-start !important;
}
.navbar-custom .topbar .nav-user .ms-2 {
    padding-top: 1px;
    padding-bottom: 1px;
}
.nav-user .user-name {
    font-weight: 700;
    color: #1a1a1a;
}
.nav-user .user-role {
    font-size: 0.7rem;
    color: #6c757d;
}

/* Sidebar usuario sin desplegable inútil */
.user-box-panel-context {
    font-size: 0.78rem;
    color: #6c757d;
    margin-bottom: 0.35rem;
    line-height: 1.25;
    padding: 0 0.5rem;
}
.menu-logout-link {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.menu-logout-link .menu-link {
    color: #c0392b !important;
}

/* Switches bloqueados para entidad (solo lectura visual) */
.entity-config-locked {
    opacity: 0.55;
    pointer-events: none;
}

/* Avisos PNotify error más visibles */
.ui-pnotify.partilot-notify-error,
.ui-pnotify.partilot-notify-error .alert {
    background-color: #f8d7da !important;
    /* border: 2px solid #dc3545 !important;
     0*/
     border-radius: 50px !important;
    color: #842029 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
}
.ui-pnotify.partilot-notify-error {
    top: 120px !important;
}

.form-control.is-invalid,
.form-control.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.25) !important;
}

/* Botones de acción en tablas */
.table .btn[title] {
    min-width: 2rem;
}

/* Ficha entidad: cabecera icono + nombre sin solapamiento */
.entity-profile-head .photo-preview-3,
.entity-profile-head .photo-preview-2 {
    float: none !important;
    margin-right: 0 !important;
}
.entity-profile-head h4 {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.25;
}
.form-group .row:has(> .col-1 .photo-preview-3),
.form-group .row:has(> .col-1 .photo-preview-2) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}
.form-group .row:has(> .col-1 .photo-preview-3) > .col-1,
.form-group .row:has(> .col-1 .photo-preview-2) > .col-1 {
    flex: 0 0 auto;
    width: auto !important;
    max-width: 100%;
}
.form-group .row:has(> .col-1 .photo-preview-3) > .col-4,
.form-group .row:has(> .col-1 .photo-preview-2) > .col-4 {
    flex: 1 1 12rem;
    min-width: 0;
    width: auto !important;
    max-width: 100%;
}
.form-group .row > .col-1 .photo-preview-3,
.form-group .row > .col-1 .photo-preview-2 {
    float: none !important;
    margin-right: 0 !important;
}
.form-group .row:has(> .col-1 .photo-preview-3) h4,
.form-group .row:has(> .col-1 .photo-preview-2) h4 {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.25;
}
@media (max-width: 575.98px) {
    .form-group .row:has(> .col-1 .photo-preview-3),
    .form-group .row:has(> .col-1 .photo-preview-2) {
        justify-content: center;
        text-align: center;
    }
}
.form-switch {
    padding: 0;
}

/* Switches en tarjetas laterales: label a la izquierda, switch a la derecha */
.form-card .form-check.form-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    clear: both;
    min-height: 2rem;
}
.form-card .form-check.form-switch .form-check-input {
    float: none !important;
    margin-left: 0 !important;
    flex: 0 0 auto;
    order: 2;
}
.form-card .form-check.form-switch .form-check-label {
    float: none !important;
    width: auto !important;
    max-width: calc(100% - 3.25rem);
    margin-right: 0 !important;
    padding-left: 0 !important;
    flex: 1 1 auto;
    order: 1;
    min-width: 0;
    line-height: 1.35;
    text-align: left;
}
.col-md-3 .form-card .form-check.form-switch .form-check-label {
    font-size: 0.84rem;
}

/* Selector entidad activa (gestor multi-entidad) */
.partilot-entity-switcher__menu {
    min-width: 280px;
    max-width: min(420px, calc(100vw - 24px));
    white-space: normal;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}
.partilot-entity-switcher__menu .dropdown-header h6 {
    white-space: normal;
}
.partilot-entity-switcher__menu .dropdown-item.active {
    background-color: #f0f2f8;
}
.partilot-entity-switcher__menu button.dropdown-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    white-space: normal;
}
.partilot-entity-switcher__name {
    display: block;
    width: 100%;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}
@media (max-width: 991.98px) {
    .partilot-entity-switcher {
        display: list-item !important;
    }
}

/* Pestañas horizontales en Ajustes (app.min.css fuerza .nav-item { width: 100% }) */
.config-inline-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid #dee2e6;
}
.config-inline-tabs .nav-item {
    width: auto;
    flex: 0 0 auto;
}
.config-inline-tabs .nav-link {
    white-space: nowrap;
}

/* Overlay bloqueante al generar PDF (partial async_design_pdf en listado, resumen, imprenta) */
#design-pdf-blocking-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#design-pdf-blocking-overlay.is-visible {
    display: flex;
}

#design-pdf-blocking-overlay .design-pdf-blocking-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

#design-pdf-blocking-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #e78307;
}

/*
 * Utilidades de panel (card + footer como listado Sorteos).
 * No usar flex/min-height en .content: rompe el footer absoluto del tema.
 */
.partilot-page-panel--centered > .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.partilot-page-panel__inner {
    width: 100%;
}

.partilot-page-panel__narrow {
    width: 100%;
    max-width: 540px;
}

.partilot-page-panel__section + .partilot-page-panel__section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eef1f6;
}

@media (min-width: 992px) {
    .partilot-page-panel__aside {
        padding-left: 1.5rem;
        border-left: 1px solid #eef1f6;
    }
}

.partilot-page-panel__col-main,
.partilot-page-panel__col-side {
    height: 100%;
}

.partilot-page-panel__col-side {
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .partilot-page-panel__col-side {
        padding-left: 1.5rem;
        border-left: 1px solid #eef1f6;
    }
}

/* Paginación tablas: todos los botones redondeados (pill) */
.content-page .pagination {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.content-page .pagination .page-item .page-link {
    border-radius: 999px !important;
    min-width: 32px;
    height: 32px;
    line-height: 30px;
    padding: 0 10px !important;
    text-align: center;
    border: 1px solid #d9dde8 !important;
    margin: 0 2px;
    color: #525a6d;
    background: #fff;
    box-shadow: none;
}

.content-page .pagination .page-item:first-child .page-link,
.content-page .pagination .page-item:last-child .page-link {
    border-radius: 999px !important;
}

.content-page .pagination .page-item.active .page-link,
.content-page .pagination .page-link.active,
.content-page .pagination .active > .page-link {
    background-color: #1f2430 !important;
    border-color: #1f2430 !important;
    color: #fff !important;
    border-radius: 999px !important;
    height: 32px;
    line-height: 30px;
    font-weight: 600;
}

.content-page .pagination .page-item.disabled .page-link,
.content-page .pagination .page-link.disabled,
.content-page .pagination .disabled > .page-link {
    opacity: 0.55;
    height: 32px;
    line-height: 30px;
    border-radius: 999px !important;
}

.content-page .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 999px !important;
}

.content-page .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.content-page .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    border-radius: 999px !important;
}

/* Botones del panel: esquinas redondeadas (30px, como formularios y asistente diseño) */
.content-page .btn:not(.btn-link):not(.btn-close):not(.page-link):not(.paginate_button) {
    border-radius: 30px !important;
}

/* Herramientas del editor de diseño: grupo continuo (solo esquinas exteriores redondeadas) */
.content-page .format-btn-group button.btn:not(.btn-link):not(.btn-close):not(.page-link):not(.paginate_button),
.content-page .format-btn-group label.btn:not(.btn-link):not(.page-link) {
    border-radius: 0 !important;
}

.content-page .format-btn-group button.btn:not(.btn-link):not(.btn-close):not(.page-link):not(.paginate_button):first-of-type:not(:last-of-type) {
    border-radius: 0.25rem 0 0 0.25rem !important;
}

.content-page .format-btn-group button.btn:not(.btn-link):not(.btn-close):not(.page-link):not(.paginate_button):last-of-type:not(:first-of-type) {
    border-radius: 0 0.25rem 0.25rem 0 !important;
}

.content-page .format-btn-group button.btn:not(.btn-link):not(.btn-close):not(.page-link):not(.paginate_button):only-of-type {
    border-radius: 0.25rem !important;
}

.content-page .btn-group:not(.format-btn-group) > .btn:not(.btn-link):not(.page-link) {
    border-radius: 0 !important;
}

.content-page .btn-group:not(.format-btn-group) > .btn:first-child {
    border-radius: 30px 0 0 30px !important;
}

.content-page .btn-group:not(.format-btn-group) > .btn:last-child,
.content-page .btn-group:not(.format-btn-group) > .dropdown-toggle-split {
    border-radius: 0 30px 30px 0 !important;
}

.content-page .btn-group:not(.format-btn-group) > .btn:only-child,
.content-page .btn-group:not(.format-btn-group) > .dropdown-toggle:only-child {
    border-radius: 30px !important;
}

.content-page .input-group > .btn:last-child,
.content-page .input-group > .btn:not(:first-child):not(:last-child) {
    border-radius: 0 30px 30px 0 !important;
}

.content-page .input-group > .btn:first-child:only-child {
    border-radius: 30px !important;
}
