.page-hero {
    display: flex;
    align-items: center;
    background-color: #fff;
    background-image: url('../../../assets/images/grafismo/vtc-page-header-grafismo.png');
    background-repeat: no-repeat;
    background-position: right center;
    border-radius: 8px;
    border-left: 4px solid #204D8B;
    padding: 14px 50px 14px 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    margin-bottom: 1.5rem;
    position: relative;
}

.page-hero-icon {
    flex-shrink: 0;
    margin-right: 16px;
    --fa-primary-color:    var(--primary-color, #01345F);
    --fa-secondary-color:  var(--secondary-color, #f05c29);
    --fa-primary-opacity:  1;
    --fa-secondary-opacity: 0.3;
    color: var(--primary-color, #01345F);
}

.page-hero-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.page-hero-title {
    font-size: .85rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
}

.page-hero-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.4;
}

.page-hero--primary {
    border-left-color: #204D8B;
}
.page-hero--primary .page-hero-icon {
    color: #204D8B;
    --fa-primary-color: #204D8B;
    --fa-secondary-color: #204D8B;
}
.page-hero--primary .page-hero-title,
.page-hero--primary .page-hero-subtitle {
    color: #204D8B;
}

.page-hero--secondary {
    border-left-color: #F0A000;
}
.page-hero--secondary .page-hero-icon {
    color: #1A3660;
    --fa-primary-color: #1A3660;
    --fa-secondary-color: #1A3660;
}
.page-hero--secondary .page-hero-title,
.page-hero--secondary .page-hero-subtitle {
    color: #1A3660;
}

.page-hero--tertiary {
    border-left-color: #7ACDF2;
}
.page-hero--tertiary .page-hero-icon {
    color: #7ACDF2;
    --fa-primary-color: #7ACDF2;
    --fa-secondary-color: #7ACDF2;
}
.page-hero--tertiary .page-hero-title {
    color: #7ACDF2;
}

.page-hero--primary .page-hero-subtitle,
.page-hero--secondary .page-hero-subtitle,
.page-hero--tertiary .page-hero-subtitle {
    color: #757c8c;
}

.stat-card {
    position: relative;
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    overflow: hidden;
    min-height: 140px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    --stat-bg: #6c757d;
    background: var(--stat-bg);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card.active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-4px);
}

.stat-card::before,
.stat-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
    z-index: 0;
}

.stat-card::before {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Ccircle cx='3' cy='3' r='1.5' fill='rgba(255,255,255,0.15)'/%3E%3Ccircle cx='18' cy='18' r='1.5' fill='rgba(255,255,255,0.15)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    animation: none;
}

.stat-card::after {
    bottom: -45px;
    right: 15px;
    width: 90px;
    height: 90px;
    animation: float2 8s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-10px, 15px); }
    66% { transform: translate(10px, -5px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-15px, -20px); }
}

.stat-card-icon {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 48px;
    opacity: 0.15;
    z-index: 1;
}

.stat-card-title {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.stat-card-value {
    font-size: 18px;
    font-weight: 700;
    margin: 8px 0;
    z-index: 1;
}

.stat-card-sub {
    font-size: 12px;
    opacity: 0.85;
    z-index: 1;
}

.stat-card-toggle {
    cursor: pointer;
}

.stat-card-toggle.has-active-filters {
    box-shadow: 0 0 0 3px rgba(240, 101, 34, 0.4);
}

.stat-card--orange  { --stat-bg: #F26522; }
.stat-card--blue    { --stat-bg: #1BB5F7; }
.stat-card--green   { --stat-bg: #34C759; }
.stat-card--red     { --stat-bg: #FF3B30; }
.stat-card--purple  { --stat-bg: #5E5CE6; }
.stat-card--cyan    { --stat-bg: #00C7BE; }
.stat-card--teal    { --stat-bg: #1CB5A3; }
.stat-card--yellow  { --stat-bg: #F0B429; }

.stat-card-clear {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 22px;
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease;
}

.stat-card-clear:hover {
    background: rgba(255, 255, 255, 0.5);
}

.stat-card.active .stat-card-clear {
    display: flex;
}

.grid-header {
    --grid-header-bg: #f8f9fa;
    --grid-header-color: #495057;
    --grid-header-border: #6c757d;
    background-color: var(--grid-header-bg) !important;
    color: var(--grid-header-color) !important;
    border-left: 4px solid var(--grid-header-border);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.grid-header--orange  { --grid-header-bg: #FFF0E6; --grid-header-color: #C24918; --grid-header-border: #F26522; }
.grid-header--blue    { --grid-header-bg: #E6F7FF; --grid-header-color: #0A7BBF; --grid-header-border: #1BB5F7; }
.grid-header--green   { --grid-header-bg: #E6F5ED; --grid-header-color: #237A3C; --grid-header-border: #34C759; }
.grid-header--red     { --grid-header-bg: #FFF0F0; --grid-header-color: #C0392B; --grid-header-border: #FF3B30; }
.grid-header--purple  { --grid-header-bg: #EFEEFF; --grid-header-color: #3C3BB0; --grid-header-border: #5E5CE6; }
.grid-header--cyan    { --grid-header-bg: #E6FFFE; --grid-header-color: #007A75; --grid-header-border: #00C7BE; }
.grid-header--teal    { --grid-header-bg: #E6FBF8; --grid-header-color: #0E8B7A; --grid-header-border: #1CB5A3; }
.grid-header--yellow  { --grid-header-bg: #FFF7E0; --grid-header-color: #8A6D1D; --grid-header-border: #F0B429; }

.btn-portal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    min-height: 34px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.18s ease;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-portal i {
    font-size: 0.92rem;
    flex-shrink: 0;
    --fa-primary-opacity:  1;
    --fa-secondary-opacity: 0.7;
}

.btn-portal:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(1,52,95,0.18);
}

.btn-portal:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.btn-portal:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-portal-sm { font-size: 0.78rem; min-height: 28px; padding: 3px 10px; }
.btn-portal-sm i { font-size: 0.78rem; }

.btn-portal-md { font-size: 0.80rem; min-height: 34px; padding: 6px 14px; }
.btn-portal-md i { font-size: 0.85rem; }

.btn-portal-lg { font-size: 0.95rem; min-height: 42px; padding: 8px 20px; }
.btn-portal-lg i { font-size: 1rem; }

.btn-portal-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.btn-portal-new {
    background-color: var(--primary-color, #01345F);
    border-color: var(--primary-color, #01345F);
    color: #fff;
}
.btn-portal-new:hover {
    background-color: var(--secondary-color, #f05c29);
    border-color: var(--secondary-color, #f05c29);
    color: #fff;
}

.btn-portal-save {
    background-color: #198754;
    border-color: #198754;
    color: #fff;
}
.btn-portal-save:hover { background-color: #146c43; border-color: #146c43; color: #fff; }
.btn-portal-save:focus { box-shadow: 0 0 0 3px rgba(25,135,84,0.22); }

.btn-portal-cancel {
    background-color: transparent;
    border-color: #adb5bd;
    color: #6c757d;
}
.btn-portal-cancel:hover { background-color: #f8f9fa; border-color: #6c757d; color: #495057; }

.btn-portal-delete {
    background-color: transparent;
    border-color: #dc3545;
    color: #dc3545;
}
.btn-portal-delete:hover { background-color: #dc3545; border-color: #dc3545; color: #fff; }
.btn-portal-delete:focus { box-shadow: 0 0 0 3px rgba(220,53,69,0.18); }

.btn-portal-export {
    background-color: #107c10;
    border-color: #107c10;
    color: #fff;
}
.btn-portal-export:hover { background-color: #0a5e0a; border-color: #0a5e0a; color: #fff; }

.btn-portal-filter {
    background-color: transparent;
    border-color: var(--primary-color, #01345F);
    color: var(--primary-color, #01345F);
}
.btn-portal-filter:hover {
    background-color: var(--primary-color, #01345F);
    color: #fff;
}

.btn-portal-refresh {
    background-color: transparent;
    border-color: var(--secondary-color, #f05c29);
    color: var(--secondary-color, #f05c29);
}
.btn-portal-refresh:hover {
    background-color: var(--secondary-color, #f05c29);
    border-color: var(--secondary-color, #f05c29);
    color: #fff;
}
.btn-portal-refresh:focus { box-shadow: 0 0 0 3px rgba(240,92,41,0.22); }

.btn-portal-print {
    background-color: transparent;
    border-color: #6c757d;
    color: #6c757d;
}
.btn-portal-print:hover { background-color: #6c757d; color: #fff; }

.btn-portal-secondary {
    background-color: var(--secondary-color, #f05c29);
    border-color: var(--secondary-color, #f05c29);
    color: #fff;
}
.btn-portal-secondary:hover {
    background-color: #d94f1e;
    border-color: #d94f1e;
    color: #fff;
}
.btn-portal-secondary:focus { box-shadow: 0 0 0 3px rgba(240,92,41,0.22); }

.btn-portal-primary {
    background-color: var(--primary-color, #01345F);
    border-color: var(--primary-color, #01345F);
    color: #fff;
}
.btn-portal-primary:hover {
    background-color: var(--secondary-color, #f05c29);
    border-color: var(--secondary-color, #f05c29);
    color: #fff;
}
.btn-portal-primary:focus { box-shadow: 0 0 0 3px rgba(1,52,95,0.22); }

.btn-outline-portal-primary {
    background-color: transparent;
    border-color: var(--primary-color, #01345F);
    color: var(--primary-color, #01345F);
}
.btn-outline-portal-primary:hover {
    background-color: var(--primary-color, #01345F);
    border-color: var(--primary-color, #01345F);
    color: #fff;
}
.btn-outline-portal-primary:focus { box-shadow: 0 0 0 3px rgba(1,52,95,0.22); }

.btn-outline-portal-secondary {
    background-color: transparent;
    border-color: var(--secondary-color, #f05c29);
    color: var(--secondary-color, #f05c29);
}
.btn-outline-portal-secondary:hover {
    background-color: var(--secondary-color, #f05c29);
    border-color: var(--secondary-color, #f05c29);
    color: #fff;
}
.btn-outline-portal-secondary:focus { box-shadow: 0 0 0 3px rgba(240,92,41,0.22); }

.btn-portal-success {
    background-color: #198754;
    border-color: #198754;
    color: #fff;
}
.btn-portal-success:hover { background-color: #146c43; border-color: #146c43; color: #fff; }
.btn-portal-success:focus { box-shadow: 0 0 0 3px rgba(25,135,84,0.22); }

.btn-outline-portal-success {
    background-color: transparent;
    border-color: #198754;
    color: #198754;
}
.btn-outline-portal-success:hover { background-color: #198754; border-color: #198754; color: #fff; }
.btn-outline-portal-success:focus { box-shadow: 0 0 0 3px rgba(25,135,84,0.22); }

.btn-portal-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}
.btn-portal-danger:hover { background-color: #bb2d3b; border-color: #bb2d3b; color: #fff; }
.btn-portal-danger:focus { box-shadow: 0 0 0 3px rgba(220,53,69,0.18); }

.btn-outline-portal-danger {
    background-color: transparent;
    border-color: #dc3545;
    color: #dc3545;
}
.btn-outline-portal-danger:hover { background-color: #dc3545; border-color: #dc3545; color: #fff; }
.btn-outline-portal-danger:focus { box-shadow: 0 0 0 3px rgba(220,53,69,0.18); }

.modal-portal {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-portal-header {
    padding: 14px 20px;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-color, #01345F);
    color: #fff;
}

.modal-portal-header--primary { background: var(--primary-color, #01345F); }
.modal-portal-header--success { background: #198754; }
.modal-portal-header--warning { background: #fd7e14; }
.modal-portal-header--danger  { background: #dc3545; }
.modal-portal-header--info    { background: #0d6efd; }

.modal-portal-header--clean {
    min-height: 40px;
    padding: 10px 16px;
    background: #f8f9fa;
    color: var(--primary-color, #01345F);
    border-top: 3px solid var(--primary-color, #01345F);
    border-bottom: 1px solid #dee2e6;
}

.modal-portal-header--clean.modal-portal-header--primary { color: var(--primary-color, #01345F); border-top-color: var(--primary-color, #01345F); }
.modal-portal-header--clean.modal-portal-header--success { color: #198754; border-top-color: #198754; }
.modal-portal-header--clean.modal-portal-header--warning { color: #fd7e14; border-top-color: #fd7e14; }
.modal-portal-header--clean.modal-portal-header--danger  { color: #dc3545; border-top-color: #dc3545; }
.modal-portal-header--clean.modal-portal-header--info    { color: #0d6efd; border-top-color: #0d6efd; }

.modal-portal-header--clean.modal-portal-header--orange { color: #F26522; border-top-color: #F26522; }
.modal-portal-header--clean.modal-portal-header--blue   { color: #1BB5F7; border-top-color: #1BB5F7; }
.modal-portal-header--clean.modal-portal-header--teal   { color: #1CB5A3; border-top-color: #1CB5A3; }
.modal-portal-header--clean.modal-portal-header--yellow { color: #F0B429; border-top-color: #F0B429; }
.modal-portal-header--clean.modal-portal-header--purple { color: #5E5CE6; border-top-color: #5E5CE6; }

.modal-portal-header--clean .modal-portal-title {
    color: inherit;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    gap: 8px;
}

.modal-portal-header--clean .modal-portal-title i {
    width: 14px;
    flex-shrink: 0;
    font-size: 0.78rem;
    text-align: center;
}

.modal-portal-header--clean.modal-portal-header--primary .modal-portal-title { --fa-primary-color: var(--primary-color, #01345F); --fa-secondary-color: var(--secondary-color, #f05c29); }
.modal-portal-header--clean.modal-portal-header--success .modal-portal-title { --fa-primary-color: #198754; --fa-secondary-color: #75b798; }
.modal-portal-header--clean.modal-portal-header--warning .modal-portal-title { --fa-primary-color: #fd7e14; --fa-secondary-color: #ffc07a; }
.modal-portal-header--clean.modal-portal-header--danger  .modal-portal-title { --fa-primary-color: #dc3545; --fa-secondary-color: #ea868f; }
.modal-portal-header--clean.modal-portal-header--info    .modal-portal-title { --fa-primary-color: #0d6efd; --fa-secondary-color: #6ea8fe; }

.modal-portal-header--clean.modal-portal-header--orange .modal-portal-title { --fa-primary-color: #F26522; --fa-secondary-color: #FFC07A; }
.modal-portal-header--clean.modal-portal-header--blue   .modal-portal-title { --fa-primary-color: #1BB5F7; --fa-secondary-color: #6EA8FE; }
.modal-portal-header--clean.modal-portal-header--teal   .modal-portal-title { --fa-primary-color: #1CB5A3; --fa-secondary-color: #6EDFF6; }
.modal-portal-header--clean.modal-portal-header--yellow .modal-portal-title { --fa-primary-color: #F0B429; --fa-secondary-color: #FFF0A5; }
.modal-portal-header--clean.modal-portal-header--purple .modal-portal-title { --fa-primary-color: #5E5CE6; --fa-secondary-color: #A98EDA; }

.modal-portal-header--clean .modal-portal-close {
    color: inherit;
}

.modal-portal-header--clean .modal-portal-close:hover {
    background: rgba(0,0,0,0.05);
    color: inherit;
}

.modal-portal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    --fa-primary-color: #fff;
    --fa-secondary-color: rgba(255,255,255,0.6);
    --fa-primary-opacity: 1;
    --fa-secondary-opacity: 0.7;
}

.modal-portal-close {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.modal-portal-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.modal-portal-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

.modal-portal .modal-body {
    padding: 20px 24px;
    background: #fff;
}

.modal-portal-footer {
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.modal.modal-portal-centered.show {
    display: flex !important;
    align-items: center;
}

.modal.modal-portal-centered .modal-dialog {
    margin: 0 auto;
    max-width: 500px;
    width: 100%;
}

@media (max-width: 575.98px) {
    .modal-portal-dialog-centered {
        max-width: 100%;
        padding: 0 0.75rem;
    }

    .modal-portal-header--clean {
        padding: 10px 12px;
    }

    .modal-portal .modal-body {
        padding: 16px;
    }

    .modal-portal-footer {
        padding: 10px 12px;
    }
}

.fpp-group {
    position: relative;
    margin-bottom: 1.1rem;
}

.fpp-label {
    position: absolute;
    top: -6px;
    left: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color, #01345F);
    background: #fff;
    padding: 0 5px;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.fpp-input,
.fpp-select,
.fpp-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ced4da;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #212529;
    background: #fff;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    line-height: 1.5;
}

.fpp-input:focus,
.fpp-select:focus,
.fpp-textarea:focus {
    border-color: var(--primary-color, #01345F);
}

.fpp-input:disabled,
.fpp-select:disabled,
.fpp-textarea:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.fpp-input[type="date"] {
    cursor: pointer;
    min-height: 42px;
}

.fpp-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

.fpp-dropdown {
    position: relative;
}

.fpp-dropdown .dropdown-toggle {
    width: 100%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-image: none;
    padding-right: 36px;
}

.fpp-dropdown .dropdown-toggle::after {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
}

.fpp-dropdown .dropdown-menu {
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    border-radius: 6px;
    border: 1.5px solid #ced4da;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    padding: 4px 0;
    margin-top: 2px;
}

.fpp-dropdown .dropdown-item {
    font-size: 0.85rem;
    padding: 8px 14px;
    color: #212529;
}

.fpp-dropdown .dropdown-item:hover,
.fpp-dropdown .dropdown-item:focus,
.fpp-dropdown .dropdown-item.active {
    background-color: #e9ecef;
    color: #212529;
}

.fpp-input.is-invalid,
.fpp-select.is-invalid,
.fpp-textarea.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.1);
}

.fpp-invalid-feedback {
    font-size: 0.72rem;
    color: #dc3545;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Com ícone à esquerda */
.fpp-group--icon .fpp-input,
.fpp-group--icon .fpp-select {
    padding-left: 38px;
}

.fpp-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #adb5bd;
    pointer-events: none;
    --fa-primary-opacity:  1;
    --fa-secondary-opacity: 0.5;
    transition: color 0.18s;
}

.fpp-group--icon .fpp-input:focus ~ .fpp-icon,
.fpp-group--icon:focus-within .fpp-icon {
    color: var(--primary-color, #01345F);
}

.btn-portal-icon {
    padding: 7px 10px;
    min-width: 34px;
}

.btn-portal-sm.btn-portal-icon {
    padding: 4px 8px;
    min-width: 28px;
}

.btn-portal[disabled],
.btn-portal:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-portal .fa-spin {
    animation: fa-spin 0.8s linear infinite;
}

/* ============================================================================= */
/* Tabs Navigation */
/* ============================================================================= */

.tab-button {
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

/* Cores das abas (inativas com opacidade) */
.tab-button[data-tab="gestao"] {
    border-left-color: #f05c29;
}

.tab-button[data-tab="painel"] {
    border-left-color: #17a2b8;
}

.tab-button[data-tab="alertas"] {
    border-left-color: #dc3545;
}

.tab-button:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.tab-button:hover[data-tab="gestao"] {
    box-shadow: 0 4px 8px rgba(240, 92, 41, 0.15);
}

.tab-button:hover[data-tab="painel"] {
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.15);
}

.tab-button:hover[data-tab="alertas"] {
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.15);
}

.tab-button.active {
    opacity: 1;
}

.tab-button.active[data-tab="gestao"] {
    box-shadow: 0 4px 12px rgba(240, 92, 41, 0.25);
}

.tab-button.active[data-tab="painel"] {
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.25);
}

.tab-button.active[data-tab="alertas"] {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

.tab-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================================================= */
/* KPI Widgets - Painel Operacional */
/* ============================================================================= */

.kpi-widget {
    position: relative;
    border-radius: 8px;
    padding: 20px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    overflow: hidden;
    --kpi-bg: #6c757d;
    background: var(--kpi-bg);
    cursor: pointer;
}

.kpi-widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.kpi-widget::before,
.kpi-widget::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
    z-index: 0;
}

.kpi-widget::before {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Ccircle cx='3' cy='3' r='1.5' fill='rgba(255,255,255,0.15)'/%3E%3Ccircle cx='18' cy='18' r='1.5' fill='rgba(255,255,255,0.15)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    animation: none;
}

.kpi-widget::after {
    bottom: -45px;
    right: 15px;
    width: 90px;
    height: 90px;
    animation: float2 8s ease-in-out infinite;
}

.kpi-widget--primary {
    --kpi-bg: linear-gradient(135deg, #003d7a 0%, #0055b3 100%);
}

.kpi-widget--warning {
    --kpi-bg: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
}

.kpi-widget--success {
    --kpi-bg: linear-gradient(135deg, #00a86b 0%, #2dc488 100%);
}

.kpi-widget--danger {
    --kpi-bg: linear-gradient(135deg, #F0643B 0%, #FB824C 100%);
}

.kpi-widget--info {
    --kpi-bg: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
}

.kpi-widget-icon {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 48px;
    opacity: 0.15;
    z-index: 1;
}

.kpi-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    z-index: 1;
    position: relative;
}

.kpi-widget-title {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
    line-height: 1.4;
    white-space: normal;
}

.kpi-widget-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 12px 0;
    line-height: 1;
    z-index: 1;
    position: relative;
}

.kpi-widget-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 12px;
    opacity: 0.85;
    z-index: 1;
    position: relative;
    line-height: 1.3;
    white-space: normal;
    max-width: 100%;
}

.kpi-widget-footer i {
    font-size: 0.9rem;
}

.kpi-widget.active {
    /* Estilo de borda gerenciado por .kpi-clickable.kpi-active */
}

/* ============================================================================= */
/* Widget Tables - Títulos e Containers */
/* ============================================================================= */

.widget-table-container {
    animation: fadeIn 0.3s ease;
}

.widget-table-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================= */
/* Grid Toolbar - Painel Operacional */
/* ============================================================================= */

.dx-datagrid .dx-datagrid-toolbar {
    padding: 12px 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.grid-toolbar-title {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 0px;
    border-left: 4px solid #495057;
    padding-left: 12px;
}

.grid-toolbar-title.status {
    border-left-color: #003d7a;
    color: #003d7a;
}

.grid-toolbar-title.estado {
    border-left-color: #ff6b35;
    color: #ff6b35;
}

.grid-toolbar-title.agentes {
    border-left-color: #00a86b;
    color: #00a86b;
}

.dx-datagrid .dx-datagrid-toolbar .dx-button {
    margin-left: 8px;
}

.dx-datagrid .dx-datagrid-toolbar .dx-button:hover {
    background-color: #e9ecef;
}

/* ============================================================================= */
/* Fieldset e Legend - Painel Operacional */
/* ============================================================================= */

fieldset {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
    margin: 0;
}

legend {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 8px;
    margin-left: -8px;
    color: #495057;
    width: auto;
}

#table-status fieldset {
    border-color: #003d7a;
}

#table-status legend {
    color: #003d7a;
}

#table-estado fieldset {
    border-color: #ff6b35;
}

#table-estado legend {
    color: #ff6b35;
}

#table-agentes fieldset {
    border-color: #00a86b;
}

#table-agentes legend {
    color: #00a86b;
}

/* ============================================================================= */
/* Responsive - KPI Widgets */
/* ============================================================================= */

@media (max-width: 1200px) {
    .kpi-widget-title {
        font-size: 12px;
    }

    .kpi-widget-footer {
        font-size: 11px;
    }
}

@media (max-width: 992px) {
    .kpi-widget-title {
        font-size: 11px;
    }

    .kpi-widget-footer {
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .kpi-widget-title {
        font-size: 10px;
    }

    .kpi-widget-footer {
        font-size: 9px;
    }

    .kpi-widget {
        padding: 16px;
    }
}

@media (max-width: 576px) {
    .kpi-widget-title {
        font-size: 9px;
    }

    .kpi-widget-footer {
        font-size: 8px;
    }

    .kpi-widget {
        padding: 12px;
    }
}

#tab-alertas .alert-grid-card,
#tab-alertas .alert-grid-card .card-body,
#tab-alertas .row > [class*="col-"] {
    min-width: 0;
}

#tab-alertas .dx-datagrid {
    width: 100%;
}

@media (max-width: 1199.98px) {
    #tab-alertas .alert-grid-card {
        height: auto !important;
    }
}

#tab-alertas .dx-datagrid-toolbar .btn-gestao .dx-button-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

#tab-alertas .dx-datagrid-toolbar .btn-gestao .dx-button-text {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: nowrap;
}

#tab-alertas .dx-datagrid-headers .dx-header-row > td,
#tab-alertas .dx-datagrid-rowsview .dx-data-row > td,
#tab-alertas .dx-datagrid-rowsview .dx-freespace-row > td,
#tab-alertas .dx-datagrid-total-footer > .dx-row > td {
    border-right: 1px solid #dddddd !important;
}

#tab-alertas .dx-datagrid-headers .dx-header-row > td:last-child,
#tab-alertas .dx-datagrid-rowsview .dx-data-row > td:last-child,
#tab-alertas .dx-datagrid-total-footer > .dx-row > td:last-child {
    border-right: 0 !important;
}

#tab-alertas .dx-datagrid-rowsview .dx-data-row > td {
    background-color: #ffffff;
}

#tab-alertas .dx-datagrid-rowsview .dx-row-alt > td {
    background-color: #f5f5f5 !important;
}

#tab-alertas .dx-datagrid-rowsview .dx-data-row:hover > td {
    background-color: #eef4fb !important;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.status-badge--secondary { background-color: #e9ecef; color: #495057; }
.status-badge--info      { background-color: #d6f0f7; color: #0a7bbf; }
.status-badge--warning   { background-color: #fdecd2; color: #b5760a; }
.status-badge--success   { background-color: #d7f2e4; color: #1e7e50; }
.status-badge--danger    { background-color: #fbdcdf; color: #c0392b; }

/* --- KPI clicável (aba Alertas) --- */
.kpi-clickable {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-clickable.kpi-active {
    transform: scale(1.02);
    overflow: visible !important;
}

.kpi-widget--danger.kpi-clickable.kpi-active {
    outline: 3px solid rgba(240, 100, 59, 0.7);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(240, 100, 59, 0.2);
}

.kpi-widget--warning.kpi-clickable.kpi-active {
    outline: 3px solid rgba(255, 107, 53, 0.7);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 107, 53, 0.2);
}

.kpi-widget--success.kpi-clickable.kpi-active {
    outline: 3px solid rgba(0, 168, 107, 0.7);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(0, 168, 107, 0.2);
}

.kpi-widget--info.kpi-clickable.kpi-active {
    outline: 3px solid rgba(37, 99, 235, 0.7);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.2);
}

.kpi-widget--primary.kpi-clickable.kpi-active {
    outline: 3px solid rgba(0, 61, 122, 0.7);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(0, 61, 122, 0.2);
}
