/* ProtectTickets - Estilos customizados */

:root {
    --prioridade-baixa: #6c757d;
    --prioridade-media: #0d6efd;
    --prioridade-alta: #fd7e14;
    --prioridade-urgente: #dc3545;
    /* Branding (sobrescrito via header com valores do banco) */
    --pt-primary: #0d6efd;
    --pt-primary-2: #0a58ca;
    --pt-primary-3: #083a87;
    --pt-info-glow: #0dcaf0;
    --pt-surface: #ffffff;
    --pt-surface-soft: #f8fbff;
    --pt-border-soft: rgba(15, 23, 42, 0.08);
    --pt-radius-lg: 16px;
    --pt-radius-md: 12px;
    --pt-shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
    --pt-shadow-strong: 0 18px 45px rgba(15, 23, 42, 0.14);
}

body {
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    background:
        radial-gradient(circle at 0% 0%, rgba(var(--pt-primary-rgb, 13, 110, 253), 0.10), transparent 36%),
        radial-gradient(circle at 100% 10%, rgba(var(--pt-info-glow-rgb, 13, 202, 240), 0.09), transparent 30%),
        var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: background-color 0.2s ease, color 0.15s ease;
    overflow-x: hidden;
}

:focus-visible {
    outline: 3px solid rgba(var(--pt-primary-rgb, 13, 110, 253), 0.35);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

a,
button,
.card,
.btn,
.table-hover tbody tr {
    transition: all 0.18s ease;
}

.pt-main {
    min-height: calc(100vh - 4rem);
}

/* Topbar já exibe o título da página; remove títulos duplicados dentro do conteúdo */
#main-content > h1 {
    display: none;
}

.pt-page-shell {
    padding-top: clamp(1rem, 2.2vw, 1.5rem) !important;
    padding-left: clamp(1rem, 2.2vw, 1.75rem) !important;
    padding-right: clamp(1rem, 2.2vw, 1.75rem) !important;
    padding-bottom: 1.75rem !important;
}

/* Conteúdo centralizado em telas muito largas (apenas área logada) */
.pt-app-shell .pt-content-shell > main.pt-page-shell {
    max-width: 1680px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.pt-auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 0% 0%, rgba(var(--pt-primary-rgb, 13, 110, 253), 0.12), transparent 34%),
        radial-gradient(circle at 100% 12%, rgba(var(--pt-info-glow-rgb, 13, 202, 240), 0.10), transparent 28%),
        #f3f6fb;
}

.pt-auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
}

.pt-auth-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.25rem;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.18), transparent 34%),
        linear-gradient(135deg, var(--pt-primary) 0%, var(--pt-primary-2) 55%, var(--pt-primary-3) 100%);
    color: #fff;
}

.pt-auth-hero-content {
    width: min(460px, 90%);
    text-align: center;
}

.pt-auth-logo {
    margin-bottom: 1.15rem;
    text-align: center;
}

.pt-auth-logo-img {
    width: min(220px, 76%);
    height: auto;
    display: block;
    margin-inline: auto;
    filter: brightness(0) invert(1);
    opacity: 0.98;
}

.pt-auth-hero-title {
    font-size: clamp(1.7rem, 2.8vw, 2.3rem);
    margin-bottom: 0.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.pt-auth-hero-text {
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 46ch;
    margin: 0 auto;
    line-height: 1.5;
}

.pt-auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.2rem;
}

.pt-auth-form-wrap {
    width: min(390px, 94%);
}

.pt-auth-form-title {
    font-size: 2.05rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.pt-auth-form-subtitle {
    color: #6b7280;
    margin-bottom: 1.35rem;
}

.pt-auth-input-group {
    position: relative;
}

.pt-auth-input-group i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.85rem;
    pointer-events: none;
}

.pt-auth-input {
    height: 48px;
    border-radius: 12px;
    border: 1px solid #d8e1ee;
    padding-left: 2.25rem;
    padding-right: 2.35rem;
    font-size: 0.94rem;
    background: #fff;
}

.pt-auth-input:focus {
    border-color: var(--pt-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--pt-primary-rgb, 13, 110, 253), 0.16);
}

.pt-auth-forgot {
    color: color-mix(in srgb, var(--pt-primary) 92%, #000);
    font-size: 0.82rem;
    text-decoration: none;
}

.pt-auth-password-toggle {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #5f6b79;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pt-auth-password-toggle:hover {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.08);
    color: color-mix(in srgb, var(--pt-primary) 92%, #000);
}

.pt-auth-forgot:hover {
    text-decoration: underline;
}

.pt-auth-footnote {
    margin-top: 1rem;
    font-size: 0.78rem;
    color: #64748b;
    text-align: left;
}

@media (max-width: 991.98px) {
    .pt-auth-split {
        grid-template-columns: 1fr;
    }
    .pt-auth-hero {
        min-height: 220px;
        padding: 1.4rem;
    }
    .pt-auth-hero-content {
        width: min(560px, 92%);
        text-align: center;
    }
    .pt-auth-hero-text {
        margin-inline: auto;
    }
    .pt-auth-form-side {
        padding-top: 1.4rem;
    }
    .pt-auth-form-wrap {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .pt-auth-form-title {
        font-size: 1.8rem;
    }
}

[data-bs-theme="dark"] .pt-auth-page {
    background:
        radial-gradient(circle at 0% 0%, rgba(var(--pt-primary-rgb, 13, 110, 253), 0.20), transparent 32%),
        radial-gradient(circle at 100% 12%, rgba(var(--pt-info-glow-rgb, 13, 202, 240), 0.16), transparent 26%),
        #0b1220;
}

[data-bs-theme="dark"] .pt-auth-hero {
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.1), transparent 34%),
        linear-gradient(135deg, #12366f 0%, #0f2f62 55%, #0b2348 100%);
}

[data-bs-theme="dark"] .pt-auth-form-title {
    color: #e7eef9;
}

[data-bs-theme="dark"] .pt-auth-form-subtitle,
[data-bs-theme="dark"] .pt-auth-footnote {
    color: #94a3b8;
}

[data-bs-theme="dark"] .pt-auth-input-group i {
    color: #9aa9bf;
}

[data-bs-theme="dark"] .pt-auth-input {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(148, 163, 184, 0.35);
    color: #e7eef9;
}

[data-bs-theme="dark"] .pt-auth-input::placeholder {
    color: #8da0bb;
}

[data-bs-theme="dark"] .pt-auth-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.2);
}

[data-bs-theme="dark"] .pt-auth-password-toggle {
    color: #a8b7cb;
}

[data-bs-theme="dark"] .pt-auth-password-toggle:hover {
    background: rgba(96, 165, 250, 0.12);
    color: #e6efff;
}

[data-bs-theme="dark"] .pt-auth-forgot {
    color: #93c5fd;
}

[data-bs-theme="dark"] .pt-auth-forgot:hover {
    color: #dbeafe;
}

.pt-auth-card {
    border: 1px solid var(--bs-border-color-translucent);
}

.pt-navbar.navbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(120deg, var(--pt-primary) 0%, var(--pt-primary-2) 55%, var(--pt-primary-3) 100%);
    backdrop-filter: saturate(1.15);
}

.pt-app-shell {
    display: flex;
    min-height: 100vh;
}

.pt-sidebar {
    width: 220px;
    flex-shrink: 0;
    padding: 1rem 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at 15% 5%, rgba(255, 255, 255, 0.2), transparent 35%),
        linear-gradient(180deg, #0b3f97 0%, #083171 100%);
    color: #fff;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.1), 8px 0 24px rgba(2, 8, 20, 0.16);
    scrollbar-width: none; /* Firefox */
    transition: width 0.2s ease, padding 0.2s ease;
}

.pt-sidebar-top {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pt-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none; /* Chromium/Safari */
}

.pt-content-shell {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

.pt-topbar {
    height: 64px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--pt-border-soft);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1010;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.pt-topbar-title {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.pt-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.pt-topbar-title-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.pt-topbar-subtitle {
    font-size: 0.8125rem;
    text-transform: none;
    letter-spacing: 0.01em;
    color: #64748b;
    font-weight: 600;
    line-height: 1.25;
}

.pt-topbar-title-icon {
    width: 1.95rem;
    height: 1.95rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.12);
    color: var(--pt-primary);
}

.pt-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pt-topbar .btn-outline-secondary {
    border-color: rgba(100, 116, 139, 0.35);
    background: rgba(255, 255, 255, 0.72);
    color: #334155;
}

.pt-topbar .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.32);
    color: color-mix(in srgb, var(--pt-primary) 92%, #000);
}

.pt-topbar-badge {
    font-size: 0.62rem;
    min-width: 1.05rem;
}

.pt-notif-menu {
    width: min(380px, 92vw);
    max-height: 72vh;
    overflow-y: auto;
}

.pt-notif-item {
    white-space: normal;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.pt-notif-item:last-child {
    border-bottom: 0;
}

.pt-notif-item.is-unread {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.06);
}

.pt-notif-title {
    font-weight: 700;
    font-size: 0.83rem;
    color: #0f172a;
}

.pt-notif-msg {
    font-size: 0.78rem;
    color: #475569;
    margin-top: 0.12rem;
}

.pt-notif-time {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}

.pt-notif-list-unread {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.06);
}

.pt-toast-container {
    z-index: 1095;
}

.pt-toast {
    min-width: 300px;
    max-width: 380px;
    border-radius: 12px;
    color: #fff;
}

.pt-toast .toast-body {
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.35;
}

.pt-toast-icon {
    font-size: 1rem;
    opacity: 0.98;
    line-height: 1.2;
}

.pt-toast-progress {
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.35);
    transform-origin: left center;
    transform: scaleX(1);
    animation: ptToastProgress var(--pt-toast-delay, 4500ms) linear forwards;
    animation-play-state: paused;
}

.pt-toast.pt-toast-running .pt-toast-progress {
    animation-play-state: running;
}

.pt-toast:hover .pt-toast-progress {
    animation-play-state: paused;
}

@keyframes ptToastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.pt-toast-success {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
}

.pt-toast-danger {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

.pt-toast-warning {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
}

.pt-toast-info {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

@media (max-width: 575.98px) {
    .pt-toast-container {
        left: 0.75rem;
        right: 0.75rem;
        top: 0.75rem;
        padding: 0 !important;
    }

    .pt-toast {
        min-width: 0;
        width: 100%;
        max-width: none;
    }
}

.pt-sidebar-toggle {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pt-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.85rem;
    flex: 1 1 auto;
    min-height: 0;
}

.pt-side-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    border-radius: 12px;
    padding: 0.56rem 0.72rem;
    font-size: 0.9rem;
    line-height: 1.25;
    border: 1px solid transparent;
    transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pt-side-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    transform: none;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.pt-side-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 500;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.pt-side-link i {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.pt-side-link:hover i,
.pt-side-link.active i {
    opacity: 1;
    transform: none;
}

.pt-side-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.82);
    outline-offset: 2px;
}

.pt-side-link-logout {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.pt-side-link-logout:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}

.pt-side-group-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1rem 0 0.3rem;
    color: rgba(255, 255, 255, 0.62);
    font-weight: 700;
    padding: 0 0.6rem;
}

.pt-sidebar-bottom {
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 0;
}

.pt-sidebar-prefooter {
    margin-top: auto;
    padding-top: 0.55rem;
}

.pt-side-link-sub {
    padding-left: 1.95rem;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.88);
}

.pt-app-shell.is-sidebar-collapsed .pt-sidebar {
    width: 68px;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

.pt-app-shell.is-sidebar-collapsed .pt-brand-text,
.pt-app-shell.is-sidebar-collapsed .pt-side-group-title,
.pt-app-shell.is-sidebar-collapsed .pt-side-link-sub {
    display: none;
}

.pt-app-shell.is-sidebar-collapsed .pt-sidebar-logo-img {
    width: 42px;
}

.pt-app-shell.is-sidebar-collapsed .pt-sidebar-brand {
    padding: 0.35rem;
    align-items: center;
    width: 100%;
}

.pt-app-shell.is-sidebar-collapsed .pt-sidebar-top > .d-flex {
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem;
}

.pt-app-shell.is-sidebar-collapsed .pt-sidebar-top {
    width: 100%;
}

.pt-app-shell.is-sidebar-collapsed .pt-sidebar-nav {
    gap: 0.45rem;
}

.pt-app-shell.is-sidebar-collapsed .pt-side-link {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    min-height: 38px;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

.pt-app-shell.is-sidebar-collapsed .pt-side-link i {
    margin: 0 !important;
    font-size: 1rem;
}

.pt-app-shell.is-sidebar-collapsed .pt-sidebar-bottom {
    display: block;
    padding-top: 0.55rem;
}

.pt-app-shell.is-sidebar-collapsed .pt-sidebar-prefooter {
    padding-top: 0.45rem;
}

.pt-app-shell.is-sidebar-collapsed .pt-side-link-logout {
    justify-content: center;
}

.pt-app-shell.is-sidebar-collapsed .pt-sidebar-toggle i {
    transform: rotate(180deg);
}

.pt-theme-option {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pt-theme-option:has(.form-check-input:checked) {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.15rem rgba(var(--bs-primary-rgb), 0.25);
}

[data-bs-theme="dark"] .pt-theme-option:has(.form-check-input:checked) {
    box-shadow: 0 0 0 0.15rem rgba(var(--pt-primary-rgb, 13, 110, 253), 0.35);
}

/* Preferencias (mobile): alvos maiores para toque e melhor legibilidade */
.pt-pref-scope-option {
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    padding: 0.6rem 0.75rem 0.6rem 2rem;
    position: relative;
}

.pt-pref-scope-option .form-check-input {
    margin-left: -1.45rem;
}

@media (max-width: 767.98px) {
    .pt-preferencias-form .card-body {
        padding: 0.9rem;
    }

    .pt-pref-scope-option {
        margin-bottom: 0.55rem !important;
    }

    .pt-pref-kanban-options .form-check-inline {
        width: 100%;
        margin-right: 0;
    }

    .pt-pref-kanban-options .form-check-label {
        font-size: 0.95rem;
    }
}

.card {
    border-radius: var(--pt-radius-md);
}

.btn {
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: var(--pt-radius-md);
    min-height: 40px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    line-height: 1.15;
}

.pt-btn-lg {
    height: 48px;
    padding: 0.6rem 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.pt-btn-pill {
    border-radius: var(--pt-radius-md) !important;
}

.btn:focus,
.btn:focus-visible {
    box-shadow: 0 0 0 0.22rem rgba(var(--pt-primary-rgb, 13, 110, 253), 0.18);
}

.btn i,
.btn .bi {
    line-height: 1;
}

.pt-icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px !important;
    line-height: 1;
}

.pt-icon-btn.btn-outline-secondary {
    border-color: rgba(15, 23, 42, 0.14);
}

.pt-icon-btn:hover,
.pt-icon-btn:focus {
    transform: translateY(-1px);
}

.pt-icon-btn.btn-outline-secondary:hover,
.pt-icon-btn.btn-outline-secondary:focus {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.06);
    border-color: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.30);
}

.pt-icon-btn.btn-outline-danger:hover,
.pt-icon-btn.btn-outline-danger:focus {
    background: rgba(220, 53, 69, 0.08);
}

.pt-icon-link {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px !important;
    color: var(--bs-body-color);
    text-decoration: none;
}

.pt-icon-link:hover,
.pt-icon-link:focus {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.06);
    color: color-mix(in srgb, var(--pt-primary) 92%, #000);
    text-decoration: none;
}

.btn-primary {
    border-color: var(--pt-primary-2);
    background: linear-gradient(135deg, var(--pt-primary), var(--pt-primary-2));
    box-shadow: 0 10px 20px color-mix(in srgb, var(--pt-primary) 24%, transparent);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--pt-primary-3);
    background: linear-gradient(135deg, color-mix(in srgb, var(--pt-primary) 92%, #000), var(--pt-primary-3));
    box-shadow: 0 14px 30px color-mix(in srgb, var(--pt-primary) 32%, transparent);
    transform: translateY(-1px);
}

.btn-sm {
    border-radius: 10px;
    min-height: 34px;
    padding: 0.35rem 0.75rem;
}

.btn-outline-secondary {
    border-color: rgba(15, 23, 42, 0.16);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.06);
    border-color: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.28);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: rgba(220, 53, 69, 0.08);
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background: rgba(25, 135, 84, 0.08);
}

.btn-link {
    font-weight: 600;
    text-decoration: none;
}

.btn-link:hover,
.btn-link:focus {
    text-decoration: none;
}

/* Padronização de botões dentro de modais e ações em containers */
.modal .modal-header {
    gap: 0.5rem;
}

.modal .modal-footer {
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: #d8e2f0;
}

.form-control:focus,
.form-select:focus {
    border-color: #8ab4f8;
    box-shadow: 0 0 0 0.2rem rgba(var(--pt-primary-rgb, 13, 110, 253), 0.15);
}

.table-danger {
    background-color: rgba(220, 53, 69, 0.1);
}

.table {
    --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom-color: rgba(100, 116, 139, 0.18);
}

.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 700;
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.05);
    transform: translateY(-1px);
}

.alert {
    border: none;
    border-radius: var(--pt-radius-md);
}

.badge {
    border-radius: 999px;
    padding: 0.45em 0.7em;
    font-weight: 700;
}

.badge-urgente { background-color: var(--prioridade-urgente); }
.badge-alta { background-color: var(--prioridade-alta); }
.badge-media { background-color: var(--prioridade-media); }
.badge-baixa { background-color: var(--prioridade-baixa); }

/* Prioridade: botão do dropdown custom (cor vinda do cadastro) */
.ticket-prioridade-field {
    font-weight: 600;
    border-width: 2px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ticket-prioridade-field:focus {
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--pt-prioridade-cor, var(--pt-primary)) 35%, transparent);
}

.pt-prioridade-widget {
    position: relative;
}

.pt-prioridade-chevron {
    flex-shrink: 0;
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
    opacity: 0.85;
}

.pt-prioridade-widget.is-open .pt-prioridade-chevron {
    transform: rotate(180deg);
}

.pt-prioridade-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1080;
    border-radius: 0.375rem;
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
    overflow-y: auto;
    max-height: min(280px, 55vh);
}

.pt-prioridade-option {
    padding: 0.65rem 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

[data-bs-theme="dark"] .pt-prioridade-option {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.pt-prioridade-option:last-child {
    border-bottom: none;
}

.pt-prioridade-option:hover,
.pt-prioridade-option:focus {
    filter: brightness(1.05);
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

[data-bs-theme="dark"] .pt-prioridade-option:hover,
[data-bs-theme="dark"] .pt-prioridade-option:focus {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.pt-prioridade-option.is-selected {
    box-shadow: inset 3px 0 0 currentColor;
}

/* Combobox com busca dentro do painel (pt-select-search.js) */
.pt-combobox {
    position: relative;
    width: 100%;
}

.pt-combobox-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.pt-combobox-trigger {
    text-align: left;
    cursor: pointer;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.pt-combobox-trigger.form-select {
    background-image: none;
    padding-right: 0.75rem;
}

.pt-combobox-trigger:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.pt-combobox-chevron {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.pt-combobox.is-open .pt-combobox-chevron {
    transform: rotate(180deg);
}

.pt-combobox-panel {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    max-height: min(320px, 70vh);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius, 0.375rem);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
}

[data-bs-theme="dark"] .pt-combobox-panel {
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.45);
}

.pt-combobox-panel[hidden] {
    display: none !important;
}

.pt-combobox-panel:not([hidden]) {
    display: flex !important;
}

.pt-combobox-search-bar {
    flex-shrink: 0;
    padding: 0.4rem 0.5rem;
    border-bottom: 2px solid var(--bs-primary);
    background: var(--bs-body-bg);
}

.pt-combobox-search-input {
    width: 100%;
}

.pt-combobox-list {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    padding: 0.25rem 0;
}

.pt-combobox-option {
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    font-size: 0.9375rem;
    line-height: 1.35;
}

.pt-combobox-option:hover:not(.disabled),
.pt-combobox-option:focus {
    outline: none;
    background-color: var(--bs-secondary-bg);
}

.pt-combobox-option.is-selected {
    box-shadow: inset 3px 0 0 var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.08);
}

.pt-combobox-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 767.98px) {
    .pt-table-mobile-cards thead {
        display: none;
    }

    .pt-table-mobile-cards,
    .pt-table-mobile-cards tbody,
    .pt-table-mobile-cards tr,
    .pt-table-mobile-cards td {
        display: block;
        width: 100%;
    }

    .pt-table-mobile-cards tr {
        background: var(--bs-body-bg);
        border: 1px solid var(--pt-border-soft);
        border-radius: 12px;
        margin-bottom: 0.75rem;
        padding: 0.15rem 0;
        box-shadow: 0 6px 20px rgba(2, 6, 23, 0.05);
    }

    .pt-table-mobile-cards td {
        border: 0;
        border-bottom: 1px dashed rgba(148, 163, 184, 0.28);
        padding: 0.52rem 0.8rem;
        text-align: left !important;
    }

    .pt-table-mobile-cards td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: rgba(100, 116, 139, 0.95);
        margin-bottom: 0.2rem;
        font-weight: 700;
    }

    .pt-table-mobile-cards td:last-child {
        border-bottom: 0;
    }

    .pt-table-mobile-cards td[colspan]::before {
        display: none;
    }

    .pt-table-mobile-cards td[colspan] {
        text-align: center !important;
    }

    .pt-table-mobile-cards td[data-label="Ações"] .btn {
        margin-top: 0.25rem;
        margin-right: 0;
        min-height: 34px;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .pt-table-mobile-cards td[data-label="Ações"] {
        padding-top: 0.6rem;
    }

    .pt-table-mobile-cards td[data-label="Ações"] .d-inline {
        display: inline-flex !important;
        vertical-align: middle;
    }

    .pt-table-mobile-cards td[data-label="Ações"] > .btn,
    .pt-table-mobile-cards td[data-label="Ações"] > form,
    .pt-table-mobile-cards td[data-label="Ações"] > .d-inline {
        margin-right: 0.35rem;
        margin-bottom: 0.25rem;
    }

    .pt-table-mobile-cards td[data-label="Ações"] > :last-child {
        margin-right: 0;
    }

    .pt-table-mobile-cards td[data-label="Ações"] {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    .pt-table-mobile-cards td[data-label="Ações"] > .btn,
    .pt-table-mobile-cards td[data-label="Ações"] > form,
    .pt-table-mobile-cards td[data-label="Ações"] > .d-inline,
    .pt-table-mobile-cards td[data-label="Ações"] .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0;
    }

    .pt-table-mobile-cards td[data-label="Ações"] form {
        display: block;
    }
}

.filtro-grupo .pt-combobox,
.filtro-grupo .pt-combobox-trigger {
    width: 100%;
    max-width: 100%;
}

.navbar-brand {
    font-weight: 600;
}

.pt-mobile-navbar-wrap {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.pt-mobile-brand {
    margin-right: 0.35rem;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
    max-width: none;
    overflow: visible;
    height: 24px;
}

.pt-mobile-brand-logo {
    width: auto !important;
    height: 24px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    object-position: left center;
    filter: grayscale(1) brightness(0) invert(1) contrast(1.35);
    flex-shrink: 0;
    display: block;
}

.pt-navbar.d-lg-none .navbar-brand img.pt-mobile-brand-logo {
    width: auto !important;
    height: 24px !important;
}

@media (max-width: 380px) {
    .pt-mobile-brand {
        height: 20px;
    }
    .pt-mobile-brand-logo {
        height: 20px !important;
    }
    .pt-navbar.d-lg-none .navbar-brand img.pt-mobile-brand-logo {
        height: 20px !important;
    }
}

.pt-navbar.d-lg-none {
    min-height: 56px;
}

.pt-navbar.d-lg-none .container-fluid {
    min-height: 56px;
    align-items: center;
}

.pt-navbar.d-lg-none .navbar-toggler {
    padding: 0.3rem 0.55rem;
}

.pt-mobile-menu {
    margin-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding-top: 0.6rem;
}

.pt-mobile-menu-links .nav-link {
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    font-weight: 600;
}

.pt-mobile-menu-links .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
}

.pt-mobile-menu-account {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.pt-mobile-pagebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--pt-border-soft);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1005;
}

.pt-mobile-pagebar-main {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.pt-mobile-pagebar-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.12);
    color: var(--pt-primary);
    flex-shrink: 0;
}

.pt-mobile-pagebar-titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.pt-mobile-pagebar-title {
    font-weight: 700;
    font-size: 0.98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pt-mobile-pagebar-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pt-mobile-pagebar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.pt-mobile-pagebar-actions .btn-group .btn {
    padding-inline: 0.45rem;
}

.pt-filter-active-dot {
    display: inline-block;
    width: 0.42rem;
    height: 0.42rem;
    margin-left: 0.25rem;
    border-radius: 999px;
    background: var(--pt-primary);
    vertical-align: middle;
}

.pt-btn-loading {
    pointer-events: none;
}

.pt-btn-loading .pt-btn-spinner {
    vertical-align: -0.125em;
}

.pt-sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.15rem 0.2rem;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.pt-sidebar-logo-img {
    width: 124px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1) contrast(1.12);
}

.pt-sidebar .navbar-brand {
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.pt-sidebar .pt-brand-text {
    opacity: 0.95;
    display: block;
    width: 100%;
    text-align: center;
}

.pt-page-hero {
    background: linear-gradient(135deg, rgba(var(--pt-primary-rgb, 13, 110, 253), 0.11), rgba(var(--pt-info-glow-rgb, 13, 202, 240), 0.10));
    border: 1px solid rgba(var(--pt-primary-rgb, 13, 110, 253), 0.12);
    border-radius: var(--pt-radius-lg);
    padding: 1rem 1.15rem;
    backdrop-filter: blur(4px);
}

.pt-modern-card {
    border: 1px solid var(--pt-border-soft);
    border-radius: var(--pt-radius-lg);
    background: linear-gradient(180deg, var(--pt-surface), var(--pt-surface-soft));
    box-shadow: var(--pt-shadow-soft);
}

.pt-modern-card:hover {
    box-shadow: var(--pt-shadow-strong);
    transform: translateY(-1px);
}

.pt-modern-card .card-body {
    padding: 1.25rem;
}

.pt-subpanel {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color) !important;
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    .stat-card { flex-direction: column; text-align: center; }
    .dashboard-title { font-size: 1.4rem; }
    .navbar-collapse { max-height: 70vh; overflow-y: auto; }
    .dashboard-quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .pt-page-shell {
        padding-top: 0.85rem !important;
    }
}
@media (max-width: 576px) {
    .card-body { padding: 0.75rem; }
    .table { font-size: 0.8rem; }
    .atrasado-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* Cabeçalho de página (contexto + CTA) */
.pt-page-header {
    gap: 1rem;
}

.pt-page-header .pt-page-header-lead {
    font-size: 0.9375rem;
    color: var(--bs-secondary-color);
    line-height: 1.45;
    max-width: 52ch;
    margin-bottom: 0;
}

/* Dashboard moderna */
.dashboard-modern {
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-title {
    font-weight: 700;
    font-size: 1.75rem;
    color: #1a1d21;
}

.dashboard-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.dashboard-quick-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(var(--pt-primary-rgb, 13, 110, 253), 0.20);
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.06);
    color: var(--pt-primary-2);
    padding: 0.62rem 0.8rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
}

.dashboard-quick-link:hover {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.12);
    color: var(--pt-primary-3);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}
.stat-card-primary .stat-card-icon { background: linear-gradient(135deg, var(--pt-primary), var(--pt-primary-2)); }
.stat-card-danger .stat-card-icon { background: linear-gradient(135deg, #dc3545, #bb2d3b); }
.stat-card-success .stat-card-icon { background: linear-gradient(135deg, #198754, #157347); }
.stat-card-info .stat-card-icon { background: linear-gradient(135deg, var(--pt-info-glow), color-mix(in srgb, var(--pt-info-glow) 78%, #000)); }
.stat-card-warning .stat-card-icon { background: linear-gradient(135deg, #ffc107, #d39e00); }

.stat-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.stat-card-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0.02em;
}
.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1d21;
}
.stat-card-danger .stat-card-value { color: #dc3545; }
.stat-card-success .stat-card-value { color: #198754; }

.dashboard-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    border: none;
}
.dashboard-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
}
.dashboard-card-header h5 {
    font-weight: 600;
    color: #1a1d21;
}
.dashboard-card-body {
    padding: 1.5rem;
}
.dashboard-card-danger {
    border-left: 4px solid #dc3545;
}
.dashboard-card-danger .dashboard-card-header {
    background: rgba(220, 53, 69, 0.06);
}
.dashboard-card-warning {
    border-left: 4px solid #ffc107;
}
.dashboard-card-warning .dashboard-card-header {
    background: rgba(255, 193, 7, 0.1);
}

.chart-container {
    position: relative;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}
.empty-state i {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.atrasados-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.atrasado-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s, border-color 0.2s;
}
.atrasado-item:hover {
    background: rgba(220, 53, 69, 0.06);
    border-color: rgba(220, 53, 69, 0.3);
}
.atrasado-item-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.atrasado-id {
    font-weight: 600;
    color: var(--pt-primary);
    flex-shrink: 0;
}
.atrasado-titulo {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.atrasado-prazo {
    font-size: 0.875rem;
    color: #dc3545;
    font-weight: 500;
    flex-shrink: 0;
}

.setor-ranking {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.setor-ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid #e5eaf2;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
}

.setor-ranking-main {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.setor-ranking-pos {
    font-weight: 800;
    color: #64748b;
}

.setor-ranking-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Barra de tickets: ordenação + Filtro + ações */
.tickets-toolbar {
    background: var(--pt-surface);
    border: 1px solid var(--pt-border-soft);
    border-radius: var(--pt-radius-md);
    padding: 0.75rem 1rem;
    box-shadow: var(--pt-shadow-soft);
    margin-bottom: 1rem !important;
    align-items: center;
}

.tickets-toolbar-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.85rem;
    padding: 0.25rem 0.65rem 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.035);
    border: 1px solid rgba(15, 23, 42, 0.07);
}

.tickets-toolbar-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.tickets-toolbar-count-num {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--bs-body-color);
}

.tickets-toolbar-count-label {
    font-weight: 500;
}

.tickets-toolbar-ordenar .form-select {
    max-width: 12rem;
    min-width: 9.5rem;
    border-radius: 999px;
    background: var(--pt-surface);
    border-color: rgba(15, 23, 42, 0.1);
    font-size: 0.8125rem;
    padding-top: 0.32rem;
    padding-bottom: 0.32rem;
}

.tickets-toolbar .pt-toolbar-toggle,
.filtros-card .pt-toolbar-toggle {
    border-radius: var(--pt-radius-md) !important;
    height: 38px;
    padding: 0.4rem 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: transparent;
    color: var(--bs-body-color);
    box-shadow: none;
    transform: none;
}

.tickets-toolbar .pt-toolbar-toggle i,
.filtros-card .pt-toolbar-toggle i {
    font-size: 1rem;
    line-height: 1;
}

.tickets-toolbar .pt-toolbar-toggle:hover,
.tickets-toolbar .pt-toolbar-toggle:focus,
.filtros-card .pt-toolbar-toggle:hover,
.filtros-card .pt-toolbar-toggle:focus {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.06);
    border-color: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.28);
}

.tickets-toolbar .pt-toolbar-toggle.is-active,
.tickets-toolbar .pt-toolbar-toggle.is-active:hover,
.tickets-toolbar .pt-toolbar-toggle.is-active:focus,
.filtros-card .pt-toolbar-toggle.is-active,
.filtros-card .pt-toolbar-toggle.is-active:hover,
.filtros-card .pt-toolbar-toggle.is-active:focus {
    border-color: transparent;
    background: linear-gradient(135deg, var(--pt-primary), var(--pt-primary-2));
    color: #fff;
    box-shadow: 0 12px 26px rgba(var(--pt-primary-rgb, 13, 110, 253), 0.28);
    transform: translateY(-1px);
}

.tickets-toolbar .btn-filtro-toggle[aria-expanded="true"],
.tickets-toolbar .btn-filtro-toggle[aria-expanded="true"]:hover,
.tickets-toolbar .btn-filtro-toggle[aria-expanded="true"]:focus {
    border-color: transparent;
    background: linear-gradient(135deg, var(--pt-primary), var(--pt-primary-2));
    color: #fff;
    box-shadow: 0 12px 26px rgba(var(--pt-primary-rgb, 13, 110, 253), 0.28);
    transform: translateY(-1px);
}

.tickets-toolbar .pt-toolbar-toggle.is-active i,
.filtros-card .pt-toolbar-toggle.is-active i {
    color: inherit;
}

.tickets-toolbar .pt-toolbar-action,
.filtros-card .pt-toolbar-action {
    border-radius: var(--pt-radius-md) !important;
    height: 38px;
    padding: 0.4rem 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.tickets-toolbar .pt-toolbar-action.btn-outline-success,
.filtros-card .pt-toolbar-action.btn-outline-success {
    border-color: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.22);
    color: var(--pt-primary);
}

.tickets-toolbar .pt-toolbar-action.btn-primary,
.filtros-card .pt-toolbar-action.btn-primary {
    box-shadow: 0 12px 26px rgba(var(--pt-primary-rgb, 13, 110, 253), 0.22);
}

.tickets-toolbar .pt-toolbar-action.btn-primary:hover,
.tickets-toolbar .pt-toolbar-action.btn-primary:focus,
.filtros-card .pt-toolbar-action.btn-primary:hover,
.filtros-card .pt-toolbar-action.btn-primary:focus {
    box-shadow: 0 14px 30px rgba(var(--pt-primary-rgb, 13, 110, 253), 0.28);
}

.tickets-toolbar .pt-toolbar-action.btn-outline-success:hover,
.tickets-toolbar .pt-toolbar-action.btn-outline-success:focus,
.filtros-card .pt-toolbar-action.btn-outline-success:hover,
.filtros-card .pt-toolbar-action.btn-outline-success:focus {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.08);
    border-color: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.32);
    color: var(--pt-primary);
}

.tickets-toolbar .pt-toolbar-action.btn-outline-danger:hover,
.tickets-toolbar .pt-toolbar-action.btn-outline-danger:focus,
.filtros-card .pt-toolbar-action.btn-outline-danger:hover,
.filtros-card .pt-toolbar-action.btn-outline-danger:focus {
    background: rgba(220, 53, 69, 0.08);
}

.tickets-toolbar .btn-filtro-toggle .filtros-toggle-chevron {
    display: inline-block;
    transition: transform 0.25s ease;
    vertical-align: middle;
}

/* Kanban: usa largura do content-shell e altura da janela (dvh) */
.tickets-kanban-viewport {
    --pt-kanban-chrome: 200px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 0 0.35rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: clamp(280px, calc(100vh - var(--pt-kanban-chrome)), 1100px);
    max-height: calc(100vh - var(--pt-kanban-chrome));
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

@supports (height: 100dvh) {
    .tickets-kanban-viewport {
        min-height: clamp(280px, calc(100dvh - var(--pt-kanban-chrome)), 1100px);
        max-height: calc(100dvh - var(--pt-kanban-chrome));
    }
}

@media (max-width: 991.98px) {
    .tickets-kanban-viewport {
        --pt-kanban-chrome: 230px;
    }
}

@media (max-width: 575.98px) {
    .tickets-kanban-viewport {
        --pt-kanban-chrome: 250px;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }
}

.tickets-kanban-viewport::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tickets-kanban-viewport::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
}

.tickets-kanban-wrap {
    --kanban-cols: 5;
    display: grid;
    grid-template-columns: repeat(var(--kanban-cols), minmax(0, 1fr));
    gap: clamp(0.55rem, 1.2vw, 1rem);
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    align-items: stretch;
    align-content: stretch;
    padding: 0.08rem 0;
}

/* Ecrãs médios: evita colunas demasiado estreitas; permite várias linhas */
@media (max-width: 1199.98px) {
    .tickets-kanban-wrap {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 228px), 1fr));
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
        align-content: start;
    }
}

/* Telemóvel: colunas empilhadas, altura confortável por bloco */
@media (max-width: 575.98px) {
    .tickets-kanban-wrap {
        grid-template-columns: 1fr;
        overflow: visible;
        flex: none;
    }
}

.tickets-kanban-board-empty {
    width: 100%;
    flex-shrink: 0;
    border: 1px dashed #c5d3e6;
    border-radius: 12px;
    padding: 1.35rem 1rem;
    color: #64748b;
    text-align: center;
    background: rgba(255, 255, 255, 0.65);
}

.tickets-kanban-col {
    min-width: 0;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    min-height: 160px;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    position: relative;
}

@media (max-width: 575.98px) {
    .tickets-kanban-col {
        height: auto;
        max-height: min(380px, 52vh);
    }
}

@supports (height: 100dvh) {
    @media (max-width: 575.98px) {
        .tickets-kanban-col {
            max-height: min(380px, 52dvh);
        }
    }
}

.tickets-kanban-col::before {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    top: 0;
    height: 3px;
    border-radius: 999px;
    background: #94a3b8;
    opacity: 0.85;
}

.tickets-kanban-col[data-status-slug="aberto"]::before { background: #0ea5e9; }
.tickets-kanban-col[data-status-slug="encaminhado"]::before { background: #f59e0b; }
.tickets-kanban-col[data-status-slug="aguardando cliente"]::before { background: #a855f7; }
.tickets-kanban-col[data-status-slug="agendado"]::before { background: #0891b2; }
.tickets-kanban-col[data-status-slug="finalizado"]::before { background: #22c55e; }
.tickets-kanban-col[data-status-slug="cancelado"]::before { background: #ef4444; }

.tickets-kanban-col[data-status-slug="em análise"]::before,
.tickets-kanban-col[data-status-slug="em analise"]::before { background: #6366f1; }

.tickets-kanban-col[data-status-slug="em tratamento"]::before { background: #14b8a6; }

.tickets-kanban-col[data-status-slug="sem status"]::before { background: #94a3b8; }

.tickets-kanban-col.is-drop-target {
    border-color: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.55);
    box-shadow: inset 0 0 0 2px rgba(var(--pt-primary-rgb, 13, 110, 253), 0.18), 0 0 0 3px rgba(var(--pt-primary-rgb, 13, 110, 253), 0.12);
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.04);
}

.tickets-kanban-col-header {
    flex-shrink: 0;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.tickets-kanban-col-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
    color: #1e293b;
    line-height: 1.25;
    min-width: 0;
}

.tickets-kanban-col-count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.28em 0.55em;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06) !important;
    color: #475569 !important;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.tickets-kanban-list {
    padding: 0.72rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

.tickets-kanban-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid #dce6f3;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 0.72rem 0.74rem;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: grab;
    border-left-width: 3px;
    border-left-color: transparent;
}

.tickets-kanban-card.is-atrasado {
    border-left-color: #dc3545;
    background: linear-gradient(180deg, #fffbfb 0%, #fff5f5 100%);
}

.tickets-kanban-card-top-left {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    min-width: 0;
}

.tickets-kanban-card-grip {
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    margin-left: -0.2rem;
    flex-shrink: 0;
    pointer-events: none;
}

.tickets-kanban-card-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
    max-width: 58%;
}

.tickets-kanban-badge-atraso {
    font-size: 0.65rem;
    font-weight: 700;
}

.tickets-kanban-card.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.tickets-kanban-card.is-saving {
    pointer-events: none;
    opacity: 0.7;
}

.tickets-kanban-card:hover {
    border-color: #9ec2ff;
    box-shadow: 0 10px 22px rgba(var(--pt-primary-rgb, 13, 110, 253), 0.14);
    transform: translateY(-1px);
}

.tickets-kanban-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.tickets-kanban-id {
    font-weight: 700;
    color: var(--pt-primary);
    font-size: 0.8rem;
    letter-spacing: 0.01em;
}

.tickets-kanban-title {
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tickets-kanban-meta {
    display: grid;
    gap: 0.3rem;
    font-size: 0.77rem;
    color: #64748b;
}

.tickets-kanban-meta span {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tickets-kanban-prazo-atrasado {
    color: #dc3545 !important;
    font-weight: 600;
}

.tickets-kanban-empty {
    font-size: 0.82rem;
    color: #94a3b8;
    padding: 0.55rem 0.45rem;
    text-align: center;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    border-radius: 10px;
    margin-top: 0.15rem;
}

.tickets-kanban-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1060;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #fff;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.tickets-kanban-toast.success { background: #16a34a; }
.tickets-kanban-toast.error { background: #dc2626; }
.tickets-kanban-toast.show { opacity: 1; transform: translateY(0); }

.pt-kanban-sync-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    min-width: 0;
}

.tickets-toolbar .pt-btn-icon-only {
    width: 38px;
    min-width: 38px;
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
}

.pt-kanban-refresh.is-loading i {
    display: inline-block;
    animation: pt-kanban-spin 0.75s linear infinite;
}

@keyframes pt-kanban-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pt-kanban-refresh.is-loading i {
        animation: none;
    }
}

[data-bs-theme="dark"] .tickets-kanban-col {
    background: rgba(15, 23, 42, 0.68);
    border-color: var(--bs-border-color);
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.35);
}

[data-bs-theme="dark"] .tickets-kanban-board-empty {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.45);
    color: #9db1ce;
}

[data-bs-theme="dark"] .tickets-kanban-col-header {
    border-bottom-color: var(--bs-border-color);
    background: rgba(15, 23, 42, 0.94);
}

[data-bs-theme="dark"] .tickets-kanban-col-title {
    color: #e8f0ff;
}

[data-bs-theme="dark"] .tickets-kanban-col-count {
    background: rgba(148, 163, 184, 0.12) !important;
    color: #cbd5e1 !important;
    border-color: rgba(148, 163, 184, 0.25);
}

[data-bs-theme="dark"] .tickets-kanban-viewport {
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

[data-bs-theme="dark"] .tickets-kanban-viewport::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
}

[data-bs-theme="dark"] .tickets-kanban-card {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.78) 0%, rgba(8, 13, 28, 0.9) 100%);
    border-color: rgba(148, 163, 184, 0.3);
}

[data-bs-theme="dark"] .tickets-kanban-card.is-atrasado {
    background: linear-gradient(180deg, rgba(60, 20, 25, 0.55) 0%, rgba(40, 12, 16, 0.72) 100%);
    border-color: rgba(248, 113, 113, 0.45);
    border-left-color: #f87171;
}

[data-bs-theme="dark"] .tickets-kanban-card-grip {
    color: #64748b;
}

[data-bs-theme="dark"] .tickets-kanban-card:hover {
    border-color: rgba(96, 165, 250, 0.6);
}

[data-bs-theme="dark"] .tickets-kanban-empty {
    border-color: rgba(148, 163, 184, 0.28);
    color: #94a3b8;
}

[data-bs-theme="dark"] .tickets-kanban-col.is-drop-target {
    background: rgba(59, 130, 246, 0.12);
}

.tickets-toolbar .btn-filtro-toggle[aria-expanded="true"] .filtros-toggle-chevron {
    transform: rotate(180deg);
}

.filtros-collapse-wrap:not(.show) {
    margin-bottom: 0 !important;
}

/* Filtros de tickets — painel em seções */
.filtros-card {
    border: 1px solid var(--pt-border-soft, rgba(0, 0, 0, 0.06));
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    overflow: visible;
}

.filtros-section--top {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: linear-gradient(
        145deg,
        rgba(var(--pt-primary-rgb, 13, 110, 253), 0.07) 0%,
        rgba(var(--pt-primary-rgb, 13, 110, 253), 0.02) 55%,
        transparent 100%
    );
    border: 1px solid rgba(var(--pt-primary-rgb, 13, 110, 253), 0.14);
}

.filtros-section--criterios {
    padding: 1rem 1.15rem 1.1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.025);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.filtros-section-head {
    margin-bottom: 0.85rem;
}

.filtros-section-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    width: 100%;
}

.filtros-section-title-icon {
    font-size: 0.95rem;
    opacity: 0.85;
    color: var(--pt-primary);
}

/* Primeira linha: escopo + busca */
.filtros-linha-top {
    display: grid;
    grid-template-columns: minmax(240px, auto) minmax(0, 1fr);
    gap: 1rem 1.5rem;
    align-items: end;
}

.filtro-escopo .pt-toolbar-toggle {
    height: 36px;
    padding: 0.35rem 0.8rem;
}

/* Grid de critérios: fluxo responsivo sem “tudo numa coluna” em tablets */
.filtros-linha-criterios {
    display: grid;
    gap: 0.85rem 1rem;
    align-items: start;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}

.filtro-grupo--periodo,
.filtro-grupo--resumo {
    min-width: 0;
}

/* Período e Resumo operação lado a lado */
.filtro-grupo--periodo {
    grid-column: span 2;
}

.filtro-grupo--resumo {
    grid-column: span 2;
}

.filtro-grupo--periodo .filtro-periodo-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.65rem 1rem;
    align-items: stretch;
}

@media (max-width: 991.98px) {
    .filtro-grupo--periodo,
    .filtro-grupo--resumo {
        grid-column: 1 / -1;
    }
}

.filtro-periodo-campo {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.filtro-periodo-micro {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

/* Datas: sem ícone à esquerda (evita duplicar com o picker nativo) */
.filtro-input--date {
    padding-left: 0.65rem;
    min-height: 42px;
}

.filtros-checks-card {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.04);
    border: 1px solid rgba(var(--pt-primary-rgb, 13, 110, 253), 0.1);
}

@media (min-width: 576px) {
    .filtros-checks-stack.filtros-checks-card {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.65rem 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .filtros-linha-top {
        grid-template-columns: 1fr;
    }
}

.filtros-checks-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filtros-checks-stack .form-check-label {
    line-height: 1.35;
}

/* Barra de ações: hint + botões */
.filtros-acoes-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1rem;
    padding-top: 1.15rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.filtros-acoes-hint {
    flex: 1 1 12rem;
    max-width: 26rem;
    line-height: 1.4;
}

.filtros-acoes-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem 0.85rem;
}

.filtros-acoes-bar .filtro-btn,
.filtros-acoes-bar .filtro-btn-export {
    min-height: 42px;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filtros-acoes-bar .filtro-btn-export,
.filtros-card .filtros-acoes-bar a.btn.filtro-btn-export {
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    border: none !important;
    color: #fff !important;
    background: linear-gradient(145deg, #2dd4bf 0%, #14b8a6 35%, #0d9488 100%) !important;
    box-shadow:
        0 4px 18px rgba(13, 148, 136, 0.45),
        0 1px 0 rgba(255, 255, 255, 0.2) inset;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.filtros-acoes-bar .filtro-btn-export:hover,
.filtros-card .filtros-acoes-bar a.btn.filtro-btn-export:hover {
    color: #fff !important;
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow:
        0 8px 26px rgba(13, 148, 136, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.filtros-acoes-bar .filtro-btn-export:focus-visible,
.filtros-card .filtros-acoes-bar a.btn.filtro-btn-export:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(13, 148, 136, 0.45),
        0 4px 18px rgba(13, 148, 136, 0.45);
}

@media (max-width: 575.98px) {
    .filtros-acoes-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filtros-acoes-btns {
        justify-content: stretch;
    }

    .filtros-acoes-btns .filtro-btn,
    .filtros-acoes-btns .filtro-btn-export {
        flex: 1 1 auto;
    }
}

.filtros-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
}

.filtros-header-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    user-select: none;
    transition: background-color 0.2s;
}

.filtros-header-toggle:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
}

.filtros-chevron {
    font-size: 1rem;
    color: #64748b;
    transition: transform 0.25s ease;
}

.filtros-header-toggle[aria-expanded="true"] .filtros-chevron {
    transform: rotate(180deg);
}

.filtros-body {
    padding: 1.25rem 1.5rem;
    background: #fff;
}

.filtros-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.filtros-linha {
    display: grid;
    gap: 1rem 1.25rem;
    align-items: end;
}

.filtros-linha-1 {
    grid-template-columns: minmax(0, 1fr);
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filtro-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0.02em;
}

.filtro-input {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.55rem 0.75rem;
    min-height: 42px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filtros-card .form-select.filtro-input {
    min-height: 42px;
}

.filtro-input:focus {
    border-color: var(--pt-primary);
    box-shadow: 0 0 0 3px rgba(var(--pt-primary-rgb, 13, 110, 253), 0.15);
    outline: none;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}

.input-icon-wrapper .filtro-input {
    padding-left: 2.25rem;
}

.filtro-checkbox {
    padding-top: 0.5rem;
}

.filtro-checkbox .form-check-label {
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
}

.filtro-checkbox .form-check-input:checked {
    background-color: var(--pt-primary);
}

.filtro-btn {
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--pt-primary) 0%, var(--pt-primary-2) 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(var(--pt-primary-rgb, 13, 110, 253), 0.30);
    transition: transform 0.15s, box-shadow 0.15s;
}

.filtro-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--pt-primary-rgb, 13, 110, 253), 0.35);
}

@media (max-width: 576px) {
    .filtros-body {
        padding: 1rem;
    }
}

/* ——— Modo escuro (Bootstrap data-bs-theme=dark + componentes custom) ——— */
[data-bs-theme="dark"] .dashboard-title,
[data-bs-theme="dark"] .stat-card-value,
[data-bs-theme="dark"] .dashboard-card-header h5 {
    color: var(--bs-emphasis-color);
}

[data-bs-theme="dark"] .stat-card {
    background: var(--bs-secondary-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .stat-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .stat-card-label {
    color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .dashboard-card {
    background: var(--bs-secondary-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .dashboard-card-header {
    background: rgba(255, 255, 255, 0.04);
    border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .dashboard-card-danger .dashboard-card-header {
    background: rgba(220, 53, 69, 0.12);
}

[data-bs-theme="dark"] .dashboard-card-warning .dashboard-card-header {
    background: rgba(255, 193, 7, 0.1);
}

[data-bs-theme="dark"] .dashboard-quick-link {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.18);
    border-color: rgba(var(--pt-info-glow-rgb, 13, 202, 240), 0.28);
    color: #c7dbff;
}

[data-bs-theme="dark"] .dashboard-quick-link:hover {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.26);
    color: #e2ecff;
}

[data-bs-theme="dark"] .atrasado-item {
    border-color: var(--bs-border-color);
    background: var(--bs-body-bg);
}

[data-bs-theme="dark"] .atrasado-item:hover {
    background: rgba(220, 53, 69, 0.1);
}

[data-bs-theme="dark"] .setor-ranking-item {
    border-color: var(--bs-border-color);
    background: rgba(255, 255, 255, 0.02);
}

[data-bs-theme="dark"] .setor-ranking-pos {
    color: #9fb0c6;
}

[data-bs-theme="dark"] .filtros-card {
    border-color: var(--bs-border-color);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .pt-page-hero {
    background: linear-gradient(135deg, rgba(var(--pt-primary-rgb, 13, 110, 253), 0.20), rgba(var(--pt-info-glow-rgb, 13, 202, 240), 0.14));
    border-color: rgba(var(--pt-info-glow-rgb, 13, 202, 240), 0.25);
}

[data-bs-theme="dark"] .pt-modern-card {
    border-color: var(--bs-border-color);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.75));
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
}

[data-bs-theme="dark"] .pt-modern-card:hover {
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .pt-navbar.navbar {
    background: linear-gradient(120deg, color-mix(in srgb, var(--pt-primary) 55%, #000) 0%, color-mix(in srgb, var(--pt-primary-2) 55%, #000) 52%, color-mix(in srgb, var(--pt-primary-3) 55%, #000) 100%);
}

[data-bs-theme="dark"] .pt-sidebar {
    background: linear-gradient(180deg, #0f274c 0%, #0b1f3d 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.15);
}

[data-bs-theme="dark"] .pt-topbar {
    background: rgba(2, 6, 23, 0.62);
    border-bottom-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .pt-topbar .btn-outline-secondary {
    background: rgba(15, 23, 42, 0.62);
    border-color: rgba(148, 163, 184, 0.35);
    color: #d7e2f1;
}

[data-bs-theme="dark"] .pt-topbar .btn-outline-secondary:hover {
    background: rgba(30, 41, 59, 0.78);
    border-color: rgba(96, 165, 250, 0.45);
    color: #e8f0ff;
}

[data-bs-theme="dark"] .pt-topbar-subtitle {
    color: #94a3b8;
}

[data-bs-theme="dark"] .pt-mobile-pagebar {
    background: rgba(2, 6, 23, 0.72);
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] .pt-mobile-pagebar-subtitle {
    color: #94a3b8;
}

[data-bs-theme="dark"] .pt-mobile-pagebar .btn-outline-secondary {
    background: rgba(15, 23, 42, 0.62);
    border-color: rgba(148, 163, 184, 0.35);
    color: #d7e2f1;
}

[data-bs-theme="dark"] .tickets-toolbar {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

[data-bs-theme="dark"] .tickets-toolbar-meta {
    background: rgba(2, 6, 23, 0.45);
    border-color: rgba(148, 163, 184, 0.18);
}

[data-bs-theme="dark"] .tickets-toolbar-ordenar .form-select {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .pt-topbar-title-icon {
    background: rgba(96, 165, 250, 0.18);
    color: #cbe0ff;
}

[data-bs-theme="dark"] .pt-side-link:hover {
    background: rgba(148, 163, 184, 0.12);
}

[data-bs-theme="dark"] .table thead th {
    color: #94a3b8;
}

[data-bs-theme="dark"] body {
    background:
        radial-gradient(circle at 0% 0%, rgba(var(--pt-primary-rgb, 13, 110, 253), 0.20), transparent 35%),
        radial-gradient(circle at 100% 0%, rgba(var(--pt-info-glow-rgb, 13, 202, 240), 0.12), transparent 30%),
        #0b1220;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    border-color: rgba(148, 163, 184, 0.35);
    background-color: rgba(15, 23, 42, 0.78);
}

[data-bs-theme="dark"] .btn-outline-secondary {
    border-color: rgba(148, 163, 184, 0.45);
    color: #cbd5e1;
}

[data-bs-theme="dark"] .filtros-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .filtros-header-toggle:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
}

[data-bs-theme="dark"] .filtros-body {
    background: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .filtros-section--top {
    background: linear-gradient(
        145deg,
        rgba(var(--pt-primary-rgb, 13, 110, 253), 0.16) 0%,
        rgba(15, 23, 42, 0.35) 100%
    );
    border-color: rgba(148, 163, 184, 0.22);
}

[data-bs-theme="dark"] .filtros-section--criterios {
    background: rgba(2, 6, 23, 0.35);
    border-color: rgba(148, 163, 184, 0.14);
}

[data-bs-theme="dark"] .filtros-section-title {
    color: #94a3b8;
    border-bottom-color: rgba(148, 163, 184, 0.16);
}

[data-bs-theme="dark"] .filtros-checks-card {
    background: rgba(var(--pt-primary-rgb, 13, 110, 253), 0.1);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] .filtro-periodo-micro {
    color: #94a3b8;
}

[data-bs-theme="dark"] .filtros-acoes-bar {
    border-top-color: rgba(148, 163, 184, 0.18);
}

[data-bs-theme="dark"] .filtros-acoes-hint {
    color: var(--bs-secondary-color) !important;
}

[data-bs-theme="dark"] .filtros-acoes-bar .filtro-btn-export,
[data-bs-theme="dark"] .filtros-card .filtros-acoes-bar a.btn.filtro-btn-export {
    background: linear-gradient(145deg, #2dd4bf 0%, #0f766e 50%, #115e59 100%) !important;
    box-shadow:
        0 4px 22px rgba(45, 212, 191, 0.35),
        0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

[data-bs-theme="dark"] .filtros-acoes-bar .filtro-btn-export:hover,
[data-bs-theme="dark"] .filtros-card .filtros-acoes-bar a.btn.filtro-btn-export:hover {
    box-shadow:
        0 8px 28px rgba(45, 212, 191, 0.42),
        0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

[data-bs-theme="dark"] .filtro-label {
    color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .filtro-input {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .filtro-checkbox .form-check-label {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
}

[data-bs-theme="dark"] .card {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .card-header.bg-transparent {
    border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .text-muted {
    color: var(--bs-secondary-color) !important;
}

[data-bs-theme="dark"] .empty-state {
    color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .ticket-prioridade-field:focus {
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--pt-prioridade-cor, var(--pt-primary)) 45%, transparent);
}

/* Modal de comentário responsivo */
.pt-modal-comentario-dialog {
    margin: 1rem auto;
}

.pt-modal-comentario-dialog .modal-content {
    min-height: 0;
}

.pt-modal-comentario-body {
    min-height: 0;
    max-height: 60vh;
    overflow: auto;
}

.pt-comentario-textarea {
    min-height: 14rem;
}

@media (min-width: 992px) {
    .pt-modal-comentario-dialog {
        height: 88vh;
        max-height: 88vh;
    }

    .pt-modal-comentario-dialog .modal-content {
        height: 100%;
        max-height: 88vh;
    }

    .pt-modal-comentario-body {
        max-height: none;
    }
}

@media (max-width: 991.98px) {
    .pt-modal-comentario-dialog {
        margin: 0.5rem;
    }

    .pt-modal-comentario-body {
        max-height: calc(100vh - 12.5rem);
    }

    .pt-comentario-textarea {
        min-height: 10rem;
    }
}

/*
 * Modal de pré-visualização (PDF / texto / imagem).
 * O fundo claro (bg-body-secondary + body-bg no iframe) aparecia como faixa cinza sobre o PDF
 * porque o viewer do Chrome nem sempre preenche todo o iframe — usamos flex + altura do diálogo
 * e cor próxima ao viewer (#323639) na área do iframe.
 */
.pt-modal-preview-dialog {
    margin: 1.75rem auto;
}

/* Altura definida: o iframe PDF precisa de ancestral com altura real (flex 1 1 auto). */
@media (min-width: 992px) {
    .pt-modal-preview-dialog {
        height: 92vh;
        max-height: 92vh;
    }
}

@media (max-width: 991.98px) {
    .modal-fullscreen-lg-down.pt-modal-preview-dialog {
        height: 100%;
        max-height: none;
        margin: 0;
    }
}

.pt-modal-preview-dialog .modal-content {
    min-height: 0;
}

@media (min-width: 992px) {
    .pt-modal-preview-dialog .modal-content {
        max-height: 92vh;
        height: 100%;
    }
}

@media (max-width: 991.98px) {
    .modal-fullscreen-lg-down.pt-modal-preview-dialog .modal-content {
        max-height: none;
        height: 100%;
    }
}

.pt-modal-preview-body {
    min-height: 0;
    flex: 1 1 auto;
    background-color: #323639;
}

#modalPreviewAnexo .ticket-preview-frame,
#modalPreviewAnexoLocal .ticket-preview-frame {
    min-height: 12rem;
    height: auto;
    flex: 1 1 auto;
    width: 100%;
    align-self: stretch;
    /* Mesma família de cinza do visualizador PDF do Chrome (evita “mancha” clara) */
    background-color: #323639;
}

/*
 * Chrome: o visualizador de PDF dentro de iframe pode ficar em branco se um ancestral
 * usar transform, filter ou backdrop-filter (comum em modais Bootstrap).
 */
#modalPreviewAnexo .modal-dialog.pt-modal-preview-dialog,
#modalPreviewAnexo .modal-dialog.pt-modal-preview-dialog .modal-content,
#modalPreviewAnexoLocal .modal-dialog.pt-modal-preview-dialog,
#modalPreviewAnexoLocal .modal-dialog.pt-modal-preview-dialog .modal-content {
    transform: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#modalPreviewAnexo.fade .modal-dialog.pt-modal-preview-dialog {
    transform: none !important;
}

#modalPreviewAnexo .pt-modal-preview-body,
#modalPreviewAnexoLocal .pt-modal-preview-body {
    isolation: isolate;
}
