/*
 * Malls Shibata — Componentes globais
 * Sobrescreve o tema Sneat/Bootstrap 5.2 usando os tokens de tokens.css.
 * Observação: alguns seletores do tema usam !important (ex.: .btn-primary:hover,
 * .bg-label-*). Somente nesses pontos o !important foi repetido para vencer o tema.
 */

/* ---------------------------------------------------------------- Base */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--malls-font-family);
    font-size: var(--malls-font-size-md);
    color: var(--malls-text);
    background-color: var(--malls-bg);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--malls-text);
    font-family: var(--malls-font-family);
    letter-spacing: -0.01em;
}

a {
    color: var(--malls-blue-600);
}

a:hover {
    color: var(--malls-navy-800);
}

.text-muted {
    color: var(--malls-text-secondary) !important;
}

.text-primary {
    color: var(--malls-navy-800) !important;
}

.bg-primary {
    background-color: var(--malls-navy-800) !important;
}

::selection {
    background: var(--malls-blue-100);
    color: var(--malls-navy-900);
}

/* Foco visível e consistente */
:focus-visible {
    outline: 2px solid var(--malls-focus-color);
    outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.page-link:focus,
.nav-link:focus-visible {
    box-shadow: var(--malls-focus-ring);
    outline: none;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
}

/* ---------------------------------------------------------------- Botões */
.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: var(--malls-radius-sm);
    min-height: var(--malls-control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--malls-space-2);
    font-size: var(--malls-font-size-md);
    transition: background-color var(--malls-transition-fast), border-color var(--malls-transition-fast),
        color var(--malls-transition-fast), box-shadow var(--malls-transition-fast);
}

.btn-sm {
    min-height: 32px;
    font-size: var(--malls-font-size-sm);
}

.btn-lg {
    min-height: 48px;
}

.btn-icon {
    min-height: auto;
}

.btn-primary {
    color: #fff;
    background-color: var(--malls-blue-600);
    border-color: var(--malls-blue-600);
    box-shadow: none;
}

.btn-primary:hover {
    color: #fff !important;
    background-color: var(--malls-navy-800) !important;
    border-color: var(--malls-navy-800) !important;
    box-shadow: var(--malls-shadow-sm) !important;
}

.btn-check:focus + .btn-primary,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary.show.dropdown-toggle {
    color: #fff !important;
    background-color: var(--malls-navy-800) !important;
    border-color: var(--malls-navy-800) !important;
}

.btn-primary.disabled,
.btn-primary:disabled {
    background-color: var(--malls-blue-600);
    border-color: var(--malls-blue-600);
    opacity: 0.55;
}

/* Ação principal institucional (ex.: "Novo contrato") */
.btn-brand {
    /* Variáveis do Bootstrap: valem também nas regras de estado mais específicas
       (ex.: ":not(.btn-check) + .btn:hover", quando o botão vem depois de outro) */
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--malls-red-600);
    --bs-btn-border-color: var(--malls-red-600);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #c2101f;
    --bs-btn-hover-border-color: #c2101f;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #c2101f;
    --bs-btn-active-border-color: #c2101f;
    color: #fff;
    background-color: var(--malls-red-600);
    border-color: var(--malls-red-600);
}

.btn-brand:hover,
.btn-brand:focus,
.btn-brand:active,
.btn-brand.show {
    color: #fff;
    background-color: #c2101f;
    border-color: #c2101f;
}

.btn-navy {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--malls-navy-800);
    --bs-btn-border-color: var(--malls-navy-800);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--malls-navy-900);
    --bs-btn-hover-border-color: var(--malls-navy-900);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--malls-navy-900);
    --bs-btn-active-border-color: var(--malls-navy-900);
    color: #fff;
    background-color: var(--malls-navy-800);
    border-color: var(--malls-navy-800);
}

.btn-navy:hover,
.btn-navy:focus,
.btn-navy:active {
    color: #fff;
    background-color: var(--malls-navy-900);
    border-color: var(--malls-navy-900);
}

.btn-outline-primary {
    color: var(--malls-navy-800);
    border-color: var(--malls-border-strong);
    background: var(--malls-surface);
}

.btn-outline-primary:hover {
    color: var(--malls-navy-800) !important;
    background-color: var(--malls-blue-50) !important;
    border-color: var(--malls-blue-600) !important;
}

.btn-outline-secondary,
.btn-light {
    color: var(--malls-text);
    background: var(--malls-surface);
    border-color: var(--malls-border-strong);
}

.btn-outline-secondary:hover,
.btn-light:hover {
    color: var(--malls-navy-800) !important;
    background: var(--malls-surface-muted) !important;
    border-color: var(--malls-border-strong) !important;
}

.btn-label-primary {
    color: var(--malls-navy-800);
    background: var(--malls-blue-100);
}

.btn-label-primary:hover {
    color: #fff !important;
    background: var(--malls-navy-800) !important;
    border-color: var(--malls-navy-800) !important;
}

.btn-danger {
    background-color: var(--malls-danger);
    border-color: var(--malls-danger);
}

.btn-outline-danger {
    color: var(--malls-danger-text);
    border-color: #f1b3b6;
}

.btn-outline-danger:hover {
    color: #fff !important;
    background-color: var(--malls-danger) !important;
    border-color: var(--malls-danger) !important;
}

.btn-ghost {
    color: var(--malls-text-secondary);
    background: transparent;
    border-color: transparent;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
    color: var(--malls-navy-800);
    background: var(--malls-surface-sunken);
}

/* Botão somente ícone com área clicável adequada */
.btn-icon-only {
    width: var(--malls-control-height);
    height: var(--malls-control-height);
    padding: 0;
    border-radius: var(--malls-radius-sm);
}

/* ---------------------------------------------------------------- Formulários */
.form-label,
.col-form-label {
    font-size: var(--malls-font-size-sm);
    font-weight: 600;
    color: var(--malls-text);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 0.375rem;
}

.form-label .required,
.malls-required {
    color: var(--malls-red-600);
    margin-left: 2px;
}

.form-control,
.form-select {
    min-height: var(--malls-control-height);
    font-size: var(--malls-font-size-md);
    color: var(--malls-text);
    background-color: var(--malls-surface);
    border: 1px solid var(--malls-border-strong);
    border-radius: var(--malls-radius-sm);
    transition: border-color var(--malls-transition-fast), box-shadow var(--malls-transition-fast);
}

.form-control-sm,
.form-select-sm {
    min-height: 32px;
    font-size: var(--malls-font-size-sm);
}

textarea.form-control {
    min-height: 80px;
}

.form-control::placeholder {
    color: var(--malls-text-muted);
}

.form-control:hover,
.form-select:hover {
    border-color: #aebbcd;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--malls-blue-600);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    color: var(--malls-text-secondary);
    background-color: var(--malls-surface-muted);
    border-color: var(--malls-border);
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    border-color: var(--malls-border-strong);
}

.form-check-input:checked,
.form-check-input[type=checkbox]:indeterminate {
    background-color: var(--malls-blue-600);
    border-color: var(--malls-blue-600);
}

.input-group-text {
    color: var(--malls-text-secondary);
    background: var(--malls-surface-muted);
    border-color: var(--malls-border-strong);
}

.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
    border-color: var(--malls-blue-600);
}

.invalid-feedback,
.fv-plugins-message-container .fv-help-block {
    font-size: var(--malls-font-size-sm);
    color: var(--malls-danger-text);
    margin-top: 0.3rem;
}

.is-invalid,
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--malls-danger) !important;
}

/* ---------------------------------------------------------------- Cards */
.card {
    --bs-card-border-width: 1px;
    --bs-card-border-color: var(--malls-border);
    --bs-card-border-radius: var(--malls-radius-lg);
    --bs-card-inner-border-radius: calc(var(--malls-radius-lg) - 1px);
    --bs-card-box-shadow: var(--malls-shadow-sm);
    --bs-card-spacer-y: 1.25rem;
    --bs-card-spacer-x: 1.25rem;
    --bs-card-cap-padding-y: 1rem;
    --bs-card-cap-padding-x: 1.25rem;
    background-color: var(--malls-surface);
    border: 1px solid var(--malls-border);
    box-shadow: var(--malls-shadow-sm);
}

.card-title,
.card-header .card-title {
    font-size: var(--malls-font-size-lg);
    font-weight: 700;
    color: var(--malls-text);
}

.card-header {
    border-bottom: 0;
}

/* ---------------------------------------------------------------- Badges */
.badge {
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    border-radius: var(--malls-radius-pill);
    padding: 0.35em 0.75em;
    text-transform: none;
}

.bg-label-primary {
    background-color: var(--malls-blue-100) !important;
    color: var(--malls-navy-800) !important;
}

.bg-label-success {
    background-color: var(--malls-success-bg) !important;
    color: var(--malls-success-text) !important;
}

.bg-label-warning {
    background-color: var(--malls-warning-bg) !important;
    color: var(--malls-warning-text) !important;
}

.bg-label-danger {
    background-color: var(--malls-danger-bg) !important;
    color: var(--malls-danger-text) !important;
}

.bg-label-info {
    background-color: var(--malls-info-bg) !important;
    color: var(--malls-info-text) !important;
}

.bg-label-secondary {
    background-color: var(--malls-neutral-bg) !important;
    color: var(--malls-neutral-text) !important;
}

/* Indicador de status: ponto + texto (não depende só de cor) */
.malls-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--malls-radius-pill);
    font-size: var(--malls-font-size-xs);
    font-weight: 700;
    background: var(--malls-neutral-bg);
    color: var(--malls-neutral-text);
    white-space: nowrap;
}

.malls-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.malls-status--success { background: var(--malls-success-bg); color: var(--malls-success-text); }
.malls-status--warning { background: var(--malls-warning-bg); color: var(--malls-warning-text); }
.malls-status--danger { background: var(--malls-danger-bg); color: var(--malls-danger-text); }
.malls-status--info { background: var(--malls-info-bg); color: var(--malls-info-text); }

/* ---------------------------------------------------------------- Alertas */
.alert {
    border-radius: var(--malls-radius-md);
    border: 1px solid transparent;
    font-size: var(--malls-font-size-md);
}

.alert-primary,
.alert-info {
    background: var(--malls-info-bg);
    color: var(--malls-info-text);
    border-color: #c4dcf7;
}

.alert-success {
    background: var(--malls-success-bg);
    color: var(--malls-success-text);
    border-color: #bfe8d5;
}

.alert-warning {
    background: var(--malls-warning-bg);
    color: var(--malls-warning-text);
    border-color: #f8dca4;
}

.alert-danger {
    background: var(--malls-danger-bg);
    color: var(--malls-danger-text);
    border-color: #f6c3c5;
}

/* ---------------------------------------------------------------- Dropdowns e tooltips */
.dropdown-menu {
    --bs-dropdown-border-radius: var(--malls-radius-md);
    --bs-dropdown-border-color: var(--malls-border);
    --bs-dropdown-box-shadow: var(--malls-shadow-md);
    --bs-dropdown-link-hover-bg: var(--malls-blue-50);
    --bs-dropdown-link-active-bg: var(--malls-blue-100);
    --bs-dropdown-link-active-color: var(--malls-navy-800);
    border: 1px solid var(--malls-border);
    box-shadow: var(--malls-shadow-md);
    padding: 0.375rem;
    font-size: var(--malls-font-size-md);
}

.dropdown-item {
    border-radius: var(--malls-radius-sm);
    padding: 0.5rem 0.75rem;
    color: var(--malls-text);
    gap: 0.5rem;
    min-height: 36px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--malls-navy-800);
    background: var(--malls-blue-50);
}

.dropdown-item i,
.dropdown-item .bx {
    font-size: 1.1rem;
    color: var(--malls-text-secondary);
}

.tooltip {
    --bs-tooltip-bg: var(--malls-navy-950);
    --bs-tooltip-font-size: var(--malls-font-size-sm);
    --bs-tooltip-border-radius: var(--malls-radius-sm);
}

/* ---------------------------------------------------------------- Navegação interna (pills/tabs) */
.nav-pills .nav-link {
    color: var(--malls-text);
    border-radius: var(--malls-radius-sm);
    font-weight: 600;
    min-height: 40px;
}

.nav-pills .nav-link:hover {
    color: var(--malls-navy-800);
    background: var(--malls-blue-50);
}

.nav-pills .nav-link.active,
.nav-pills .nav-link.active:hover,
.nav-pills .nav-link.active:focus {
    background-color: var(--malls-blue-600);
    color: #fff;
}

.nav-pills .nav-link.active i {
    color: #fff !important;
}

.nav-tabs .nav-link {
    color: var(--malls-text-secondary);
    font-weight: 600;
}

.nav-tabs .nav-link.active {
    color: var(--malls-navy-800);
    border-bottom-color: var(--malls-navy-800);
}

/* ---------------------------------------------------------------- Modais */
.modal {
    --bs-modal-border-radius: var(--malls-radius-lg);
    --bs-modal-inner-border-radius: calc(var(--malls-radius-lg) - 1px);
    --bs-modal-box-shadow: var(--malls-shadow-lg);
    --bs-modal-header-padding: 1.125rem 1.5rem;
    --bs-modal-padding: 1.5rem;
    --bs-modal-footer-gap: 0.5rem;
}

.modal-backdrop {
    --bs-backdrop-bg: var(--malls-navy-950);
    --bs-backdrop-opacity: 0.45;
}

.modal-content {
    border: 1px solid var(--malls-border);
    box-shadow: var(--malls-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--malls-border);
    align-items: center;
}

.modal-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--malls-text);
}

.modal-footer {
    border-top: 1px solid var(--malls-border);
    background: var(--malls-surface-muted);
    border-bottom-left-radius: var(--bs-modal-inner-border-radius);
    border-bottom-right-radius: var(--bs-modal-inner-border-radius);
}

.modal-footer:empty {
    display: none;
}

/* Conteúdo rolável sem esconder o rodapé de ações */
.modal-dialog-scrollable .modal-body {
    overscroll-behavior: contain;
}

@media (max-width: 575.98px) {
    .modal-fullscreen-sm-down .modal-content {
        border-radius: 0;
    }
}

.btn-close {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: var(--malls-radius-sm);
    background-size: 0.75rem;
    opacity: 0.6;
}

.btn-close:hover {
    opacity: 1;
    background-color: var(--malls-surface-sunken);
}

/* Visualizador de PDF (js/malls/pdf-viewer.js) */
.malls-pdf-modal .modal-dialog {
    max-width: min(1140px, calc(100vw - 2rem));
}

.malls-pdf-modal .modal-content {
    overflow: hidden;
}

.malls-pdf-modal__header {
    gap: 0.75rem;
    padding: 0.875rem 1rem 0.875rem 1.25rem;
}

.malls-pdf-modal__icon,
.malls-pdf-modal__notice-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--malls-radius-md);
    background: var(--malls-red-50);
    color: var(--malls-red-600);
    font-size: 1.35rem;
}

.malls-pdf-modal__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.malls-pdf-modal__title {
    margin: 0;
    line-height: 1.3;
}

.malls-pdf-modal__filename {
    margin: 0.125rem 0 0;
    overflow: hidden;
    font-size: var(--malls-font-size-sm);
    color: var(--malls-text-secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.malls-pdf-modal__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.malls-pdf-modal__action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.malls-pdf-modal__action.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.malls-pdf-modal__actions .btn-close {
    margin: 0 0 0 0.25rem;
}

.malls-pdf-modal__body {
    position: relative;
    height: min(82vh, 920px);
    height: min(82dvh, 920px);
    padding: 0;
    background: var(--malls-surface-sunken);
}

.malls-pdf-modal__frame {
    display: none;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--malls-surface-sunken);
}

.malls-pdf-modal__state {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    overflow-y: auto;
    text-align: center;
    background: var(--malls-bg);
}

.malls-pdf-modal[data-status="loading"] .malls-pdf-modal__state--loading,
.malls-pdf-modal[data-status="error"] .malls-pdf-modal__state--notice,
.malls-pdf-modal[data-status="fallback"] .malls-pdf-modal__state--notice {
    display: flex;
}

.malls-pdf-modal[data-status="ready"] .malls-pdf-modal__frame {
    display: block;
}

/* Imagens e vídeos (data-pdf-type="image" | "video"): exibidos no lugar do iframe */
.malls-pdf-modal__media {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--malls-navy-950);
}

.malls-pdf-modal[data-status="ready"]:not([data-type="pdf"]) .malls-pdf-modal__frame {
    display: none;
}

.malls-pdf-modal[data-status="ready"]:not([data-type="pdf"]) .malls-pdf-modal__media {
    display: flex;
}

/* O vídeo precisa existir (oculto) enquanto carrega os metadados */
.malls-pdf-modal[data-type="video"][data-status="loading"] .malls-pdf-modal__media {
    display: flex;
    position: absolute;
    inset: 0;
    visibility: hidden;
}

.malls-pdf-modal__picture {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--malls-radius-sm);
}

.malls-pdf-modal:not([data-type="pdf"]) .malls-pdf-modal__icon {
    background: var(--malls-blue-50);
    color: var(--malls-navy-800);
}

.malls-pdf-modal__state--notice > * {
    max-width: 460px;
}

.malls-pdf-modal__image {
    width: min(240px, 60vw);
    height: auto;
    margin-bottom: 1.25rem;
}

.malls-pdf-modal__notice-icon {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
    border-radius: var(--malls-radius-lg);
    font-size: 2rem;
}

.malls-pdf-modal__notice-title {
    margin: 0 0 0.5rem;
    font-size: var(--malls-font-size-xl);
    font-weight: 800;
    color: var(--malls-navy-900);
}

.malls-pdf-modal__state .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

@media (max-width: 767.98px) {
    /* O tema recua ".modal-dialog:not(.modal-fullscreen)" no celular; aqui é tela cheia. */
    .modal.malls-pdf-modal .modal-dialog {
        max-width: none;
        padding: 0 !important;
    }

    .malls-pdf-modal__body {
        height: auto;
        flex: 1 1 auto;
    }

    /* Ícones sem texto para caber no cabeçalho */
    .malls-pdf-modal__action span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .malls-pdf-modal__action {
        width: 2.25rem;
        height: 2.25rem;
        justify-content: center;
        padding: 0;
    }

    .malls-pdf-modal__icon {
        display: none;
    }
}

/* Etapas (bs-stepper) */
.bs-stepper .bs-stepper-header {
    border-bottom: 1px solid var(--malls-border);
    padding: 0.5rem 0 1rem;
    gap: 0.25rem;
}

.bs-stepper .step-trigger {
    padding: 0.5rem 0.75rem;
    border-radius: var(--malls-radius-md);
    gap: 0.6rem;
}

.bs-stepper .step-trigger:hover {
    background: var(--malls-blue-50);
}

.bs-stepper .bs-stepper-circle {
    width: 38px;
    height: 38px;
    background: var(--malls-surface-sunken);
    color: var(--malls-text-secondary);
    border-radius: var(--malls-radius-md);
    font-size: 1.15rem;
}

/* O tema usa !important na cor do passo ativo */
.bs-stepper .step.active .bs-stepper-circle {
    background-color: var(--malls-navy-800) !important;
    color: #fff;
    box-shadow: 0 0 0 4px var(--malls-blue-100);
}

.bs-stepper .step.crossed .bs-stepper-circle {
    background: var(--malls-success-bg);
    color: var(--malls-success-text);
}

.bs-stepper .bs-stepper-title {
    font-weight: 700;
    color: var(--malls-text);
}

.bs-stepper .bs-stepper-subtitle {
    color: var(--malls-text-secondary);
}

.bs-stepper .step.active .bs-stepper-title {
    color: var(--malls-navy-800);
}

.bs-stepper .line {
    background: var(--malls-border);
}

/* ---------------------------------------------------------------- Offcanvas */
.offcanvas {
    --bs-offcanvas-bg: var(--malls-surface);
    --bs-offcanvas-border-color: var(--malls-border);
}

/* ---------------------------------------------------------------- Tabelas */
.table {
    --bs-table-color: var(--malls-text);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: var(--malls-blue-50);
    --bs-table-border-color: var(--malls-border);
    font-size: var(--malls-font-size-sm);
    color: var(--malls-text);
}

.table > :not(caption) > * > * {
    padding: 0.7rem 0.75rem;
    border-bottom-color: var(--malls-border);
    vertical-align: middle;
}

.table thead th,
.table > thead > tr > th,
table.dataTable thead th {
    background: var(--malls-surface-muted);
    color: var(--malls-text-secondary);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--malls-border) !important;
    white-space: nowrap;
}

.table tfoot th,
.table tfoot td,
table.dataTable tfoot th {
    background: var(--malls-surface-muted);
    color: var(--malls-text);
    font-weight: 700;
    border-top: 1px solid var(--malls-border-strong);
}

.table tbody tr {
    transition: background-color var(--malls-transition-fast);
}

.table tbody tr:hover > * {
    background-color: var(--malls-blue-50);
}

.table-bordered > :not(caption) > * > * {
    border-color: var(--malls-border);
}

/* Tabelas listadas sem listras rosadas/cinza herdadas */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: transparent;
    color: inherit;
}

/* ---------------------------------------------------------------- DataTables 2 */
div.dt-container {
    font-size: var(--malls-font-size-sm);
    color: var(--malls-text);
}

div.dt-container .dt-layout-row {
    margin: 0.75rem 0;
    gap: 0.75rem;
}

div.dt-container .dt-search input,
div.dt-container .dt-input {
    min-height: 36px;
    border: 1px solid var(--malls-border-strong);
    border-radius: var(--malls-radius-sm);
    padding: 0.35rem 0.75rem;
    background-color: var(--malls-surface);
    color: var(--malls-text);
    font-size: var(--malls-font-size-sm);
}

div.dt-container .dt-search input {
    min-width: min(280px, 100%);
    padding-left: 2.1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.7rem center;
}

div.dt-container .dt-search input:focus,
div.dt-container .dt-input:focus {
    outline: none;
    border-color: var(--malls-blue-600);
    box-shadow: var(--malls-focus-ring);
}

div.dt-container .dt-search label,
div.dt-container .dt-length label {
    color: var(--malls-text-secondary);
    font-weight: 500;
}

div.dt-container .dt-info {
    color: var(--malls-text-secondary);
    padding-top: 0;
}

div.dt-container .dt-paging .dt-paging-button {
    min-width: 34px;
    height: 34px;
    padding: 0 0.6rem;
    margin: 0 2px;
    border-radius: var(--malls-radius-sm);
    border: 1px solid var(--malls-border) !important;
    background: var(--malls-surface) !important;
    color: var(--malls-text) !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

div.dt-container .dt-paging .dt-paging-button:hover:not(.disabled) {
    border-color: var(--malls-blue-600) !important;
    color: var(--malls-navy-800) !important;
    background: var(--malls-blue-50) !important;
}

div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover {
    background: var(--malls-blue-600) !important;
    border-color: var(--malls-blue-600) !important;
    color: #fff !important;
}

div.dt-container .dt-paging .dt-paging-button.disabled {
    opacity: 0.45;
}

table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
}

table.dataTable > tbody > tr > td {
    border-bottom: 1px solid var(--malls-border);
}

table.dataTable.table-striped > tbody > tr:nth-of-type(odd) > *,
table.dataTable.stripe > tbody > tr:nth-child(odd) > *,
table.dataTable.display > tbody > tr:nth-child(odd) > * {
    box-shadow: none;
}

table.dataTable > tbody > tr:hover > * {
    box-shadow: inset 0 0 0 9999px var(--malls-blue-50) !important;
}

table.dataTable > tbody > tr.selected > *,
table.dataTable > tbody > tr.bg-light > * {
    box-shadow: inset 0 0 0 9999px var(--malls-blue-100) !important;
    color: var(--malls-text) !important;
}

table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order:before,
table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:after {
    opacity: 0.25;
}

table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order:before,
table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:after {
    opacity: 0.85;
    color: var(--malls-blue-600);
}

table.dataTable td.dt-empty {
    padding: 2.5rem 1rem !important;
    color: var(--malls-text-secondary);
    font-weight: 500;
    text-align: center;
}

table.dataTable td.dt-empty::before {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 0.6rem;
    border-radius: 50%;
    background: var(--malls-surface-sunken) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3C/svg%3E") center no-repeat;
}

/* Rolagem horizontal controlada e cabeçalho fixo nas áreas de rolagem do DataTables */
div.dt-scroll-body {
    border-bottom: 0 !important;
}

div.dt-scroll-head {
    border-radius: var(--malls-radius-md) var(--malls-radius-md) 0 0;
}

.table-responsive,
div.dt-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--malls-border-strong) transparent;
}

/* Ações que aparecem ao passar o mouse continuam acessíveis via teclado */
tr:focus-within .dt-action-hover-section {
    display: block;
}

/* ---------------------------------------------------------------- Select2 */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: var(--malls-control-height);
    border: 1px solid var(--malls-border-strong);
    border-radius: var(--malls-radius-sm);
    background-color: var(--malls-surface);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(var(--malls-control-height) - 2px);
    color: var(--malls-text);
    padding-left: 0.875rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(var(--malls-control-height) - 2px);
}

.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open .select2-selection {
    border-color: var(--malls-blue-600) !important;
    box-shadow: var(--malls-focus-ring);
}

.select2-dropdown {
    border: 1px solid var(--malls-border);
    border-radius: var(--malls-radius-md);
    box-shadow: var(--malls-shadow-md);
    overflow: hidden;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--malls-blue-600) !important;
    color: #fff !important;
}

.select2-container--default .select2-results__option[aria-selected=true],
.select2-container--default .select2-results__option--selected {
    background-color: var(--malls-blue-100);
    color: var(--malls-navy-800);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--malls-blue-100) !important;
    color: var(--malls-navy-800) !important;
    border: 0;
    border-radius: var(--malls-radius-pill);
    font-weight: 600;
}

.select2-search--dropdown .select2-search__field {
    border-radius: var(--malls-radius-sm);
    border-color: var(--malls-border-strong);
}

/* ---------------------------------------------------------------- SweetAlert2 (toasts e confirmações) */
.swal2-popup {
    font-family: var(--malls-font-family);
    border-radius: var(--malls-radius-lg) !important;
    color: var(--malls-text);
}

.swal2-popup.swal2-toast {
    border: 1px solid var(--malls-border);
    box-shadow: var(--malls-shadow-md) !important;
    border-radius: var(--malls-radius-md) !important;
    padding: 0.75rem 1rem !important;
}

.swal2-popup.swal2-toast .swal2-title {
    font-size: var(--malls-font-size-md);
    font-weight: 600;
    color: var(--malls-text);
}

.swal2-timer-progress-bar {
    background: linear-gradient(90deg, var(--malls-navy-800), var(--malls-red-600));
}

.swal2-title {
    color: var(--malls-text);
    font-size: 1.25rem;
}

.swal2-html-container {
    color: var(--malls-text-secondary);
}

.swal2-styled.swal2-confirm {
    background-color: var(--malls-blue-600) !important;
    border-radius: var(--malls-radius-sm) !important;
}

.swal2-styled.swal2-cancel {
    border-radius: var(--malls-radius-sm) !important;
}

/* Bootbox (alertas de erro de rede do request.js) */
.bootbox .modal-body {
    font-size: var(--malls-font-size-lg);
}

/* ---------------------------------------------------------------- Paginação Bootstrap */
.pagination {
    --bs-pagination-border-radius: var(--malls-radius-sm);
    gap: 4px;
}

.page-link {
    border-radius: var(--malls-radius-sm) !important;
    border-color: var(--malls-border);
    color: var(--malls-text);
    min-width: 34px;
    text-align: center;
}

.page-item.active .page-link,
.page-item.active .page-link:hover,
.page-item.active .page-link:focus {
    background-color: var(--malls-blue-600);
    border-color: var(--malls-blue-600);
}

/* ---------------------------------------------------------------- Estado vazio */
.malls-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    color: var(--malls-text-secondary);
}

.malls-empty__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--malls-surface-sunken);
    color: var(--malls-text-secondary);
    font-size: 1.5rem;
}

.malls-empty__title {
    font-weight: 700;
    color: var(--malls-text);
    margin: 0;
}

/* ---------------------------------------------------------------- Skeleton */
.malls-skeleton {
    display: block;
    border-radius: var(--malls-radius-sm);
    background: linear-gradient(90deg, #e9eef5 0%, #f4f7fb 45%, #e9eef5 90%);
    background-size: 200% 100%;
    animation: malls-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes malls-skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ---------------------------------------------------------------- Spinner legado (jquery.spinner) com identidade Malls */
.jquery-spinner-wrap {
    position: fixed;
    background: rgba(255, 255, 255, 0.72);
    z-index: 1090;
}

.jquery-spinner-wrap .jquery-spinner-circle {
    position: relative;
}

.jquery-spinner-wrap .jquery-spinner-circle .jquery-spinner-bar {
    position: relative;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    animation: none;
    background: var(--malls-logo-symbol) center / 44px 44px no-repeat;
    filter: drop-shadow(0 6px 14px rgba(15, 42, 76, 0.18));
}

.jquery-spinner-wrap .jquery-spinner-circle .jquery-spinner-bar::before,
.jquery-spinner-wrap .jquery-spinner-circle .jquery-spinner-bar::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
}

.jquery-spinner-wrap .jquery-spinner-circle .jquery-spinner-bar::before {
    inset: -8px;
    border-top-color: var(--malls-navy-800);
    border-left-color: var(--malls-navy-800);
    animation: malls-spin 1.1s linear infinite;
}

.jquery-spinner-wrap .jquery-spinner-circle .jquery-spinner-bar::after {
    inset: -2px;
    border-bottom-color: var(--malls-red-600);
    animation: malls-spin 0.85s linear infinite reverse;
}

@keyframes malls-spin {
    to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------- Chamado: detalhe (Portal do Lojista e Admin) */
/* Número do chamado */
.malls-ticket-id {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: var(--malls-radius-sm);
    background: var(--malls-blue-50);
    color: var(--malls-navy-800);
    font-size: var(--malls-font-size-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.malls-ticket-card {
    padding: 1.25rem 1.5rem;
}

.malls-ticket-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--malls-border);
}

.malls-ticket-card__heading {
    min-width: 0;
}

.malls-ticket-card__title {
    margin: 0.5rem 0 0.25rem;
    font-size: var(--malls-font-size-xl);
    font-weight: 800;
    color: var(--malls-navy-900);
    overflow-wrap: anywhere;
}

.malls-ticket-card__title:focus {
    outline: none;
}

.malls-ticket-card__meta {
    margin: 0;
    font-size: var(--malls-font-size-sm);
    color: var(--malls-text-secondary);
}

.malls-ticket-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.malls-ticket-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--malls-border);
}

.malls-ticket-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.malls-ticket-info__label {
    font-size: var(--malls-font-size-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--malls-text-secondary);
}

.malls-ticket-info__value {
    font-weight: 600;
    color: var(--malls-text);
}

.malls-ticket-section {
    padding: 1rem 0;
}

.malls-ticket-section + .malls-ticket-section {
    border-top: 1px solid var(--malls-border);
}

.malls-ticket-section:last-child {
    padding-bottom: 0;
}

.malls-ticket-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.malls-ticket-section__title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
    font-size: var(--malls-font-size-md);
    font-weight: 700;
    color: var(--malls-navy-900);
}

.malls-ticket-section__head .malls-ticket-section__title {
    margin: 0;
}

.malls-ticket-section__title .bx {
    font-size: 1.2rem;
    color: var(--malls-navy-800);
}

.malls-ticket-description {
    margin: 0;
    color: var(--malls-text);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.malls-ticket-muted {
    font-size: var(--malls-font-size-sm);
    color: var(--malls-text-secondary);
}

.malls-ticket-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.malls-ticket-files:empty {
    display: none;
}

.malls-ticket-file {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--malls-border);
    border-radius: var(--malls-radius-pill);
    background: var(--malls-surface);
    font-size: var(--malls-font-size-sm);
    font-weight: 600;
    color: var(--malls-navy-800);
    text-decoration: none;
}

a.malls-ticket-file:hover,
a.malls-ticket-file:focus-visible {
    border-color: var(--malls-navy-800);
    background: var(--malls-blue-50);
    color: var(--malls-navy-900);
}

.malls-ticket-file .bx {
    flex: 0 0 auto;
    font-size: 1.1rem;
}

.malls-ticket-file__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.malls-ticket-file--pending {
    border-style: dashed;
    color: var(--malls-text-secondary);
}

.malls-ticket-file__state {
    flex: 0 0 auto;
    font-weight: 500;
    color: var(--malls-text-secondary);
}

/* Anexos em grade: miniatura das imagens e ícone para vídeo/PDF (clique abre o visualizador) */
.malls-ticket-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.malls-ticket-thumb {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    color: var(--malls-text);
    text-decoration: none;
}

.malls-ticket-thumb__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--malls-border);
    border-radius: var(--malls-radius-md);
    background: var(--malls-surface-sunken);
    transition: border-color var(--malls-transition-fast), box-shadow var(--malls-transition-fast);
}

.malls-ticket-thumb__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--malls-transition), opacity var(--malls-transition);
}

/* Carregando a miniatura: brilho do skeleton */
.malls-ticket-thumb__media.is-loading {
    background: linear-gradient(90deg, #e9eef5 0%, #f4f7fb 45%, #e9eef5 90%);
    background-size: 200% 100%;
    animation: malls-skeleton-shimmer 1.4s ease-in-out infinite;
}

.malls-ticket-thumb__media.is-loading img {
    opacity: 0;
}

.malls-ticket-thumb__media--icon {
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
    color: var(--malls-navy-800);
    font-size: 2.25rem;
    text-align: center;
}

.malls-ticket-thumb__media--icon > .bx {
    font-size: 2.25rem;
}

.malls-ticket-thumb__media--icon.is-broken > .bx {
    font-size: 1.75rem;
}

.malls-ticket-thumb__media--icon.is-broken {
    color: var(--malls-text-muted);
}

.malls-ticket-thumb__hint {
    font-size: var(--malls-font-size-xs);
    font-weight: 500;
    line-height: 1.25;
    color: var(--malls-text-secondary);
}

.malls-ticket-thumb__name {
    overflow: hidden;
    font-size: var(--malls-font-size-xs);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Lupa sobre a miniatura (indica que o clique amplia) */
.malls-ticket-thumb__zoom {
    position: absolute;
    right: 0.4rem;
    bottom: 0.4rem;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(6, 27, 54, 0.75);
    color: #fff;
    font-size: 1rem;
    opacity: 0;
    transition: opacity var(--malls-transition-fast);
}

a.malls-ticket-thumb:hover .malls-ticket-thumb__media,
a.malls-ticket-thumb:focus-visible .malls-ticket-thumb__media {
    border-color: var(--malls-navy-800);
    box-shadow: var(--malls-shadow-sm);
}

a.malls-ticket-thumb:hover .malls-ticket-thumb__zoom,
a.malls-ticket-thumb:focus-visible .malls-ticket-thumb__zoom {
    opacity: 1;
}

a.malls-ticket-thumb:hover img {
    transform: scale(1.04);
}

/* Telas de toque não têm "passar o mouse": a lupa fica sempre visível */
@media (hover: none) {
    .malls-ticket-thumb__zoom {
        opacity: 1;
    }
}

a.malls-ticket-thumb:focus-visible {
    outline: none;
}

a.malls-ticket-thumb:focus-visible .malls-ticket-thumb__media {
    box-shadow: var(--malls-focus-ring);
}

.malls-ticket-thumb.malls-ticket-file--pending .malls-ticket-thumb__media {
    border-style: dashed;
}

@media (prefers-reduced-motion: reduce) {
    .malls-ticket-thumb__media.is-loading {
        animation: none;
    }

    a.malls-ticket-thumb:hover img {
        transform: none;
    }
}

.malls-ticket-add {
    margin-top: 0.75rem;
}

.malls-ticket-add__panel {
    margin-top: 0.75rem;
}

.malls-ticket-add__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Linha do tempo (histórico do chamado) */
.malls-timeline {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.malls-timeline__item {
    position: relative;
    display: flex;
    gap: 0.85rem;
    padding-bottom: 1rem;
}

.malls-timeline__item:last-child {
    padding-bottom: 0;
}

/* Linha entre os ícones */
.malls-timeline__item:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 36px;
    bottom: 0;
    left: 17px;
    width: 2px;
    background: var(--malls-border);
}

.malls-timeline__icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--malls-neutral-bg);
    color: var(--malls-neutral-text);
    font-size: 1.1rem;
}

.malls-timeline__item--info .malls-timeline__icon { background: var(--malls-info-bg); color: var(--malls-info-text); }
.malls-timeline__item--warning .malls-timeline__icon { background: var(--malls-warning-bg); color: var(--malls-warning-text); }
.malls-timeline__item--success .malls-timeline__icon { background: var(--malls-success-bg); color: var(--malls-success-text); }
.malls-timeline__item--danger .malls-timeline__icon { background: var(--malls-danger-bg); color: var(--malls-danger-text); }

.malls-timeline__content {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 0.4rem;
}

.malls-timeline__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
}

.malls-timeline__status {
    font-weight: 700;
    color: var(--malls-text);
}

.malls-timeline__date,
.malls-timeline__author {
    font-size: var(--malls-font-size-sm);
    color: var(--malls-text-secondary);
}

.malls-timeline__text {
    margin: 0.2rem 0 0;
    color: var(--malls-text);
    overflow-wrap: anywhere;
}

.malls-timeline__author {
    margin: 0.1rem 0 0;
}

@media (max-width: 991.98px) {
    .malls-ticket-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .malls-ticket-card {
        padding: 1rem;
    }
}

/* Detalhe do chamado no Admin (admin/chamado/detail-modal): modal largo na altura da tela,
   detalhes à esquerda (rolagem própria) e conversa à direita; no celular, abas Conversa/Detalhes */
.malls-ticket-modal__dialog {
    max-width: min(1400px, calc(100vw - 2rem));
}

@media (min-width: 992px) {
    .malls-ticket-modal__dialog {
        height: calc(100% - 2rem);
        min-height: 0;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .malls-ticket-modal__dialog .modal-content {
        height: 100%;
    }
}

.malls-ticket-modal__header {
    align-items: flex-start;
    gap: 0.75rem 1rem;
    padding: 1rem 1.25rem;
}

.malls-ticket-modal__header .btn-close {
    flex: 0 0 auto;
    margin: 0;
}

.malls-ticket-modal__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.malls-ticket-modal .malls-ticket-modal__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
    font-size: var(--malls-font-size-lg);
}

.malls-ticket-modal__title-text {
    min-width: 0;
    font-weight: 800;
    color: var(--malls-navy-900);
    overflow-wrap: anywhere;
}

.malls-ticket-modal__badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: var(--malls-font-size-sm);
}

.malls-ticket-modal__meta {
    margin: 0.3rem 0 0;
    font-size: var(--malls-font-size-sm);
    color: var(--malls-text-secondary);
}

.malls-ticket-modal__meta strong {
    color: var(--malls-text);
}

.malls-ticket-modal__actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.malls-ticket-modal__actions:empty {
    display: none;
}

.malls-ticket-modal__actions .btn .bx {
    font-size: 1.05rem;
    vertical-align: -2px;
}

.malls-ticket-modal__actions .dropdown-item .bx {
    margin-right: 0.35rem;
}

.malls-ticket-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.malls-ticket-modal__body:has(> .malls-loader) {
    position: relative;
    min-height: 320px;
}

/* Solucionar, cancelar ou reabrir: formulário entre o cabeçalho e o conteúdo */
.malls-ticket-action {
    display: grid;
    gap: 0.4rem;
    padding: 0.85rem 1.25rem 1rem;
    border-bottom: 1px solid var(--malls-border);
    border-left: 4px solid var(--malls-navy-800);
    background: var(--malls-surface-sunken);
}

.malls-ticket-action[hidden] {
    display: none;
}

.malls-ticket-action--solucionar { border-left-color: var(--malls-success); }
.malls-ticket-action--cancelar { border-left-color: var(--malls-danger); }

.malls-ticket-action__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--malls-navy-900);
}

.malls-ticket-action .form-label {
    margin: 0;
    font-size: var(--malls-font-size-sm);
    font-weight: 600;
}

.malls-ticket-action textarea {
    resize: vertical;
    min-height: 76px;
}

.malls-ticket-action__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.malls-ticket-action__foot .form-check {
    margin: 0;
}

.malls-ticket-action__buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

/* Abas Conversa/Detalhes: só no celular */
.malls-ticket-modal__views {
    display: none;
}

.malls-ticket-workspace {
    display: grid;
    grid-template-columns: minmax(340px, 2fr) minmax(0, 3fr);
    height: 100%;
    min-height: 0;
}

.malls-ticket-workspace__details {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem 1.25rem 1.25rem;
    border-right: 1px solid var(--malls-border);
}

.malls-ticket-workspace__chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 1rem 1.25rem 0.75rem;
    background: var(--malls-surface);
}

.malls-ticket-workspace__chat .malls-chat {
    flex: 1 1 auto;
    min-height: 0;
}

.malls-ticket-workspace__chat .malls-chat__body {
    flex: 1 1 0;
    height: auto;
    min-height: 180px;
}

/* Dados do chamado em duas colunas */
.malls-ticket-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin: 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--malls-border);
}

.malls-ticket-fact {
    min-width: 0;
}

.malls-ticket-fact--wide {
    grid-column: 1 / -1;
}

.malls-ticket-fact dt {
    margin-bottom: 0.1rem;
    font-size: var(--malls-font-size-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--malls-text-secondary);
}

.malls-ticket-fact dd {
    margin: 0;
    font-weight: 600;
    color: var(--malls-text);
    overflow-wrap: anywhere;
}

.malls-ticket-fact dd small {
    display: block;
    font-weight: 500;
    color: var(--malls-text-secondary);
}

/* Solução ou motivo do cancelamento em destaque */
.malls-ticket-closure {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--malls-radius-md);
    background: var(--malls-success-bg);
    color: var(--malls-success-text);
}

.malls-ticket-closure--cancelado {
    background: var(--malls-danger-bg);
    color: var(--malls-danger-text);
}

.malls-ticket-closure > .bx {
    flex: 0 0 auto;
    font-size: 1.5rem;
}

.malls-ticket-closure p {
    margin: 0.25rem 0 0;
    color: var(--malls-text);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.malls-ticket-count {
    padding: 0 0.45rem;
    border-radius: var(--malls-radius-pill);
    background: var(--malls-neutral-bg);
    color: var(--malls-neutral-text);
    font-size: var(--malls-font-size-xs);
    font-weight: 700;
}

.malls-ticket-gallery--compact {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 0.5rem;
}

.malls-timeline--compact .malls-timeline__item {
    gap: 0.65rem;
    padding-bottom: 0.75rem;
}

.malls-timeline--compact .malls-timeline__icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    font-size: 1rem;
}

.malls-timeline--compact .malls-timeline__item:not(:last-child)::before {
    top: 30px;
    left: 14px;
}

.malls-timeline--compact .malls-timeline__content {
    padding-top: 0.2rem;
}

#chamadoTable .malls-ticket-row {
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .malls-ticket-modal__header {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }

    .malls-ticket-modal__heading {
        flex-basis: calc(100% - 3rem);
    }

    .malls-ticket-modal__header .btn-close {
        position: absolute;
        top: 0.85rem;
        right: 1rem;
    }

    .malls-ticket-modal__actions {
        justify-content: flex-start;
        width: 100%;
    }

    .malls-ticket-action {
        padding: 0.75rem 1rem;
    }

    .malls-ticket-modal__views {
        display: flex;
        border-bottom: 1px solid var(--malls-border);
    }

    .malls-ticket-modal__view {
        flex: 1 1 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.6rem;
        border: 0;
        border-bottom: 2px solid transparent;
        background: none;
        color: var(--malls-text-secondary);
        font-weight: 600;
    }

    .malls-ticket-modal__view.is-active {
        border-bottom-color: var(--malls-navy-800);
        color: var(--malls-navy-900);
    }

    .malls-ticket-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .malls-ticket-workspace__details {
        padding: 1rem;
        border-right: 0;
    }

    .malls-ticket-workspace__chat {
        padding: 0.75rem 1rem 0.5rem;
    }

    /* A aba já se chama "Conversa": fica só o estado da conexão */
    .malls-ticket-workspace__chat .malls-chat__header {
        justify-content: flex-end;
        margin-bottom: 0.5rem;
    }

    .malls-ticket-workspace__chat .malls-chat__header .malls-ticket-section__title {
        display: none;
    }

    .malls-ticket-workspace[data-view="chat"] .malls-ticket-workspace__details,
    .malls-ticket-workspace[data-view="detalhes"] .malls-ticket-workspace__chat {
        display: none;
    }
}

/* Detalhe do chamado no Portal do Lojista: mesmo layout do modal do Admin, num cartão na altura da tela
   (o detalhe é rolado até o topo ao abrir; sobra o "Voltar para a lista" acima) */
.malls-ticket-card--split {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 4.5rem);
    height: calc(100dvh - 4.5rem);
    min-height: 520px;
    padding: 0;
    overflow: hidden;
}

.malls-ticket-split__header {
    flex: 0 0 auto;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--malls-border);
}

.malls-ticket-split__titlebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
}

.malls-ticket-split__title {
    min-width: 0;
    margin: 0;
    font-size: var(--malls-font-size-lg);
    font-weight: 800;
    color: var(--malls-navy-900);
    overflow-wrap: anywhere;
}

.malls-ticket-split__title:focus {
    outline: none;
}

.malls-ticket-split__header .malls-ticket-card__meta {
    margin-top: 0.3rem;
}

.malls-ticket-split__header .malls-ticket-card__meta strong {
    color: var(--malls-text);
}

.malls-ticket-card--split .malls-ticket-workspace {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

@media (max-width: 991.98px) {
    .malls-ticket-split__header {
        padding: 0.75rem 1rem;
    }
}

/* ---------------------------------------------------------------- Chat do chamado (js/malls/chamado-chat.js) */
.malls-chat {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.malls-chat__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.malls-chat__header .malls-ticket-section__title {
    margin: 0;
}

.malls-chat__status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--malls-font-size-xs);
    font-weight: 600;
    color: var(--malls-text-secondary);
}

.malls-chat__status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--malls-border-strong);
}

.malls-chat__status:empty::before {
    display: none;
}

.malls-chat__status.is-live { color: var(--malls-success-text); }
.malls-chat__status.is-live::before { background: var(--malls-success); box-shadow: 0 0 0 3px var(--malls-success-bg); }
.malls-chat__status.is-offline { color: var(--malls-warning-text); }
.malls-chat__status.is-offline::before { background: var(--malls-warning); }
.malls-chat__status.is-connecting::before { background: var(--malls-info); }

.malls-chat__body {
    height: 360px;
    min-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    border: 1px solid var(--malls-border);
    border-radius: var(--malls-radius-md);
    background: var(--malls-surface-muted);
}

.malls-chat__body:focus-visible {
    outline: none;
    box-shadow: var(--malls-focus-ring);
}

.malls-chat__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100%;
}

.malls-chat__empty {
    margin: auto;
    max-width: 320px;
    padding: 1rem;
    text-align: center;
    color: var(--malls-text-secondary);
    font-size: var(--malls-font-size-sm);
}

.malls-chat__empty .bx {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 2rem;
    color: var(--malls-navy-700);
}

.malls-chat__empty.is-error .bx {
    color: var(--malls-danger);
}

.malls-chat__empty p {
    margin: 0 0 0.5rem;
}

/* Mensagem: avatar com as iniciais + balão (nome, conteúdo, data e hora) */
.malls-chat__msg {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
}

.malls-chat__msg.is-mine {
    flex-direction: row-reverse;
}

.malls-chat__avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--malls-surface-sunken);
    box-shadow: var(--malls-shadow-sm);
    color: var(--malls-navy-900);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.malls-chat__msg.is-mine .malls-chat__avatar {
    background: var(--malls-navy-700);
    color: #fff;
}

.malls-chat__bubble {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-width: min(72%, 620px);
    min-width: 0;
    padding: 0.6rem 0.9rem 0.45rem;
    border: 1px solid var(--malls-border);
    border-radius: 12px;
    background: var(--malls-surface);
    box-shadow: var(--malls-shadow-sm);
    color: var(--malls-text);
}

.malls-chat__msg.is-mine .malls-chat__bubble {
    border-color: var(--malls-navy-700);
    background: var(--malls-navy-700);
    color: #fff;
}

.malls-chat__msg.is-pending .malls-chat__bubble {
    opacity: 0.75;
}

.malls-chat__msg.is-failed .malls-chat__bubble {
    border-color: var(--malls-danger);
    background: var(--malls-danger-bg);
    color: var(--malls-danger-text);
}

.malls-chat__author {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--malls-navy-900);
    overflow-wrap: anywhere;
}

.malls-chat__msg.is-mine .malls-chat__author {
    color: #fff;
}

.malls-chat__msg.is-failed .malls-chat__author {
    color: var(--malls-danger-text);
}

.malls-chat__text {
    margin: 0;
    font-size: var(--malls-font-size-md);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.malls-chat__meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem 0.4rem;
    font-size: 0.6875rem;
    color: var(--malls-text-muted);
}

.malls-chat__msg.is-mine .malls-chat__meta {
    color: rgba(255, 255, 255, 0.75);
}

.malls-chat__msg.is-failed .malls-chat__meta {
    justify-content: flex-start;
    color: var(--malls-danger-text);
    font-size: var(--malls-font-size-xs);
}

.malls-chat__read .bx {
    font-size: 0.95rem;
    vertical-align: -3px;
}

.malls-chat__read.is-read {
    color: var(--malls-sky-400);
}

.malls-chat__link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

/* Arquivos na conversa */
.malls-chat__image {
    display: block;
    width: 220px;
    max-width: 100%;
    border-radius: var(--malls-radius-md);
    overflow: hidden;
}

.malls-chat__image-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    max-height: 260px;
    background: var(--malls-surface-sunken);
}

.malls-chat__image-media img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
}

.malls-chat__image-media.is-loading {
    background: linear-gradient(90deg, #e9eef5 0%, #f4f7fb 45%, #e9eef5 90%);
    background-size: 200% 100%;
    animation: malls-skeleton-shimmer 1.4s ease-in-out infinite;
}

.malls-chat__image-media.is-loading img {
    opacity: 0;
}

.malls-chat__image-media.is-broken {
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    color: var(--malls-text-secondary);
    font-size: var(--malls-font-size-xs);
    text-align: center;
}

.malls-chat__image-media.is-broken .bx {
    font-size: 1.75rem;
}

.malls-chat__image:focus-visible {
    outline: none;
    box-shadow: var(--malls-focus-ring);
}

.malls-chat__file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    max-width: 300px;
    padding: 0.45rem 0.6rem;
    border-radius: var(--malls-radius-sm);
    background: var(--malls-surface-sunken);
    color: var(--malls-navy-900);
    text-decoration: none;
}

.malls-chat__msg.is-mine .malls-chat__file {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

a.malls-chat__file:hover,
a.malls-chat__file:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 1px currentColor;
}

.malls-chat__file > .bx {
    flex: 0 0 auto;
    font-size: 1.6rem;
}

.malls-chat__file-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.malls-chat__file-name {
    overflow: hidden;
    font-size: var(--malls-font-size-sm);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.malls-chat__file small,
.malls-chat__chip small {
    font-size: var(--malls-font-size-xs);
    opacity: 0.8;
}

/* "Fulano está digitando..." */
.malls-chat__typing {
    min-height: 1.5rem;
    padding: 0.2rem 0.25rem 0;
    font-size: var(--malls-font-size-xs);
    color: var(--malls-text-secondary);
    opacity: 0;
    transition: opacity var(--malls-transition-fast);
}

.malls-chat__typing.is-visible {
    opacity: 1;
}

.malls-chat__dots {
    display: inline-flex;
    gap: 3px;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.malls-chat__dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    animation: malls-chat-dot 1.2s infinite ease-in-out;
}

.malls-chat__dots i:nth-child(2) { animation-delay: 0.15s; }
.malls-chat__dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes malls-chat-dot {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.malls-chat__jump {
    position: absolute;
    left: 50%;
    bottom: 6.5rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.75rem;
    border: 0;
    border-radius: var(--malls-radius-pill);
    background: var(--malls-navy-800);
    box-shadow: var(--malls-shadow-md);
    color: #fff;
    font-size: var(--malls-font-size-xs);
    font-weight: 600;
    transform: translateX(-50%);
}

.malls-chat__jump[hidden] {
    display: none;
}

/* Campo de mensagem: bloco único com o clipe à esquerda e o botão redondo de enviar à direita */
.malls-chat__composer {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--malls-border);
}

.malls-chat__row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.35rem;
    border: 1px solid var(--malls-border);
    border-radius: 12px;
    background: var(--malls-surface-muted);
    transition: border-color var(--malls-transition-fast), box-shadow var(--malls-transition-fast);
}

.malls-chat__row:focus-within {
    border-color: var(--malls-navy-700);
    box-shadow: 0 0 0 3px rgba(21, 74, 138, 0.12);
}

/* Uma linha ao abrir; cresce com o texto até 160px (chamado-chat.js ajusta a altura) */
.malls-chat textarea.malls-chat__input {
    flex: 1 1 auto;
    height: 40px;
    min-height: 40px;
    max-height: 160px;
    padding: 0.55rem 0.5rem;
    border: 0;
    background: transparent;
    color: var(--malls-text);
    font-size: var(--malls-font-size-md);
    line-height: 1.4;
    resize: none;
    outline: none;
}

.malls-chat textarea.malls-chat__input::placeholder {
    color: var(--malls-text-muted);
}

.malls-chat__attach {
    flex: 0 0 auto;
    width: 56px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--malls-surface);
    box-shadow: var(--malls-shadow-sm);
    color: var(--malls-navy-800);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color var(--malls-transition-fast), box-shadow var(--malls-transition-fast);
}

.malls-chat__attach:hover {
    color: var(--malls-navy-700);
    box-shadow: var(--malls-shadow-md);
}

.malls-chat__attach:focus-within {
    box-shadow: var(--malls-focus-ring);
}

.malls-chat__send {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--malls-navy-700);
    box-shadow: var(--malls-shadow-sm);
    color: #fff;
    font-size: 1.2rem;
    transition: background-color var(--malls-transition-fast), opacity var(--malls-transition-fast);
}

.malls-chat__send:hover:not(:disabled) {
    background: var(--malls-navy-800);
}

.malls-chat__send:focus-visible {
    outline: none;
    box-shadow: var(--malls-focus-ring);
}

.malls-chat__send:disabled {
    opacity: 0.45;
    cursor: default;
}

.malls-chat__counter {
    text-align: right;
    font-size: var(--malls-font-size-xs);
    color: var(--malls-text-muted);
}

.malls-chat__counter:empty {
    display: none;
}

[data-chat-counter].is-limit {
    color: var(--malls-danger-text);
    font-weight: 700;
}

.malls-chat__attachment[hidden] {
    display: none;
}

.malls-chat__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.3rem 0.4rem 0.3rem 0.6rem;
    border: 1px solid var(--malls-border);
    border-radius: var(--malls-radius-pill);
    background: var(--malls-surface);
    color: var(--malls-navy-900);
}

.malls-chat__chip .btn-close {
    flex: 0 0 auto;
    width: 0.6rem;
    height: 0.6rem;
    padding: 0.35rem;
}

/* Chamado que ninguém do malls abriu ainda (lista do Admin) */
.malls-ticket-new {
    display: inline-block;
    margin-right: 0.25rem;
    padding: 0.05rem 0.4rem;
    border-radius: var(--malls-radius-sm);
    background: var(--malls-info-bg);
    color: var(--malls-info-text);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: middle;
}

/* Contador de mensagens não lidas (lista de chamados) */
.malls-chat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.4rem;
    padding: 0.05rem 0.45rem;
    border-radius: var(--malls-radius-pill);
    background: var(--malls-red-500);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.5;
    vertical-align: middle;
    white-space: nowrap;
}

.malls-chat-badge[hidden] {
    display: none;
}

@media (max-width: 575.98px) {
    .malls-chat__body {
        height: 55vh;
        padding: 0.5rem;
    }

    .malls-chat__bubble {
        max-width: calc(100% - 46px);
    }

    .malls-chat__avatar {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
        font-size: 0.6875rem;
    }

    .malls-chat__attach {
        width: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .malls-chat__dots i,
    .malls-chat__image-media.is-loading {
        animation: none;
    }
}

/* ---------------------------------------------------------------- Utilitários */
.malls-num {
    font-variant-numeric: tabular-nums;
}

.malls-positive { color: var(--malls-success-text); }
.malls-negative { color: var(--malls-danger-text); }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .malls-skeleton {
        animation: none;
    }
}

/* O tema fixa ".bx { font-size: 1.15rem }"; nos containers de ícone abaixo o
   tamanho é definido pelo próprio container. */
.malls-kpi__icon .bx,
.malls-login__benefit-icon .bx,
.malls-empty__icon .bx,
.malls-loader__error-icon .bx,
.malls-icon-btn .bx,
.malls-tabbar__btn .bx,
.malls-tab__close .bx,
.malls-login__input .input-group-text .bx,
.malls-search__icon.bx,
.malls-pdf-modal__icon .bx,
.malls-pdf-modal__notice-icon .bx {
    font-size: inherit;
}
