@media (max-width: 576px) {
    /* Ajuste visual do input-group de busca no mobile */
    .filters-section .input-group {
        flex-direction: column !important;
        align-items: stretch;
        gap: 0.3rem;
    }
    .filters-section .input-group-text {
        border-radius: 0.25rem 0.25rem 0 0;
        border-right: 1px solid #ced4da;
        border-bottom: none;
        width: 100%;
        justify-content: center;
    }
    .filters-section .form-control {
        border-radius: 0 0 0.25rem 0.25rem;
        border-top: none;
        width: 100%;
    }
}
/* Oculta a coluna ID da tabela exceto para uso interno (todas as telas) */
#dataTable th[data-column="ID_MATRICULA"],
#dataTable td[data-label="ID"] {
    display: none !important;
}
@media (min-width: 577px) {
    /* Filtros: botões lado a lado no desktop */
    .filters-section .row.mt-3 .col-12 {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }
    .filters-section .row.mt-3 .col-12 button {
        width: auto;
        margin: 0 !important;
    }
    .filters-section .row.mt-3 .col-12 .btn {
        margin: 0 !important;
    }
}
/* ================================
   Custom Variables - Clean Bootstrap Theme
   ================================ */

@media (max-width: 576px) {
    /* Filtros: botões empilhados e espaçados */
    .filters-section .row.mt-3 .col-12 {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    .filters-section .row.mt-3 .col-12 button {
        width: 100%;
        margin: 0 !important;
    }
}

/* ================================
   Global Styles
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #212529;
    min-height: 100vh;
    font-size: 15px;
}

/* Override Bootstrap primary color */
.bg-primary {
    background-color: #07432c !important;
}

.btn-primary {
    background-color: #07432c;
    border-color: #07432c;
}

.btn-primary:hover {
    background-color: #052819;
    border-color: #052819;
}

/* ================================
   Header Styles - Clean
   ================================ */
.header-main {
    background: white;
    border-bottom: 1px solid #dee2e6;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-main .container-fluid {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.header-main h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #212529;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.header-main .subtitle {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 400;
    display: inline;
}

.update-info {
    background: #f8f9fa;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* ================================
   Legal Notice
   ================================ */
.legal-notice {
    background: white;
    border-bottom: 1px solid #dee2e6;
}

.legal-notice .alert {
    border-left: 3px solid var(--color-primary);
    background: white;
    border-radius: 0;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0;
}

.legal-notice .alert i {
    color: var(--color-primary);
    font-size: 1rem;
}

/* ================================
   Main Content
   ================================ */
.main-content {
    padding: 0;
}

/* ================================
   KPI Cards - Clean Style
   ================================ */
.kpi-section {
    margin-top: 1.5rem;
}

.kpi-card {
    background: white;
    border-radius: 0.375rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-base);
    border: 1px solid #dee2e6;
    height: 100%;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon i {
    font-size: 1.75rem;
    color: white;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #07432c;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.kpi-sublabel {
    font-size: 0.75rem;
    color: #adb5bd;
    font-weight: 400;
}

/* ================================
   Filters Section - Clean Bootstrap
   ================================ */
.filters-section .card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.filters-section .card-header {
    background: #f8f9fa;
    color: #212529;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

.filters-section .card-header h5 {
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
}

.filters-section .form-label {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.filters-section .form-select,
.filters-section .form-control {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.filters-section .form-select:focus,
.filters-section .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(7, 67, 44, 0.25);
}

.filters-section .input-group-text {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-right: none;
    color: #495057;
}

/* ================================
   Results Info
   ================================ */
.results-info .badge {
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* ================================
   Table Styles - Clean
   ================================ */
.table-section .card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

#dataTable {
    margin: 0;
}

#dataTable thead {
    background: #07432c;
    color: white;
}

#dataTable thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.75rem;
    border: none;
    vertical-align: middle;
}

#dataTable thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition-base);
}

#dataTable thead th.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

#dataTable thead th i {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 0.25rem;
}

#dataTable tbody tr {
    transition: var(--transition-base);
}

#dataTable tbody tr:hover {
    background: #f8f9fa !important;
}

#dataTable tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    font-size: 0.875rem;
    border-bottom: 1px solid #dee2e6;
}

#dataTable tbody tr.pcd-highlight {
    background: rgba(25, 135, 84, 0.05);
    border-left: 3px solid #198754;
}

.badge-pcd {
    background: #198754;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-wait-time {
    background: #198754;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.school-name {
    font-weight: 500;
    color: #495057;
    font-size: 0.875rem;
}

/* ================================
   Pagination - Bootstrap Standard
   ================================ */
.pagination {
    gap: 0.25rem;
}

.pagination .page-link {
    border: 1px solid #dee2e6;
    color: #07432c;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 400;
    transition: var(--transition-base);
}

.pagination .page-link:hover {
    background: #e9ecef;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination .page-item.active .page-link {
    background: #07432c;
    border-color: #07432c;
    color: white;
    font-weight: 600;
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 768px) {
    .header-main h1 {
    .filters-section .row.mt-3 .col-12 button {
        width: 100%;
        margin: 0 !important;
    }
    }

@media (min-width: 577px) {
    .filters-section .row.mt-3 .col-12 button {
        width: auto !important;
        width: auto !important;
        flex: 0 0 auto !important;
        min-width: 0 !important;
}
    .header-main h1 .bi {
        margin-right: 0.5rem;
        margin-bottom: 0 !important;
        font-size: 1.3em;
        vertical-align: middle;
    }
    .header-main .subtitle {
        font-size: 0.75rem;
        display: block;
        margin-top: 0.25rem;
        margin-left: 0 !important;
    }
        font-size: 0.75rem;
        display: block;
        margin-top: 0.25rem;
        margin-left: 0 !important;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .kpi-icon {
        width: 50px;
        height: 50px;
    }

    .kpi-icon i {
        font-size: 1.5rem;
    }

    .table-responsive {
        font-size: 0.8rem;
    }

    #dataTable thead th,
    #dataTable tbody td {
        padding: 0.5rem 0.4rem;
    }
}

/* ================================
   Loading State
   ================================ */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* ================================
   Mobile Improvements (Extra Responsive)
   ================================ */
@media (max-width: 576px) {
    .header-main .container-fluid, .legal-notice .container-fluid, .main-content .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }
    i.bi.bi-clipboard-data-fill.me-2 {
    DISPLAY: NONE;
}
    .header-main h1 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    .legal-notice .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    .legal-notice .btn {
        width: 100%;
        margin-left: 0 !important;
    }
    .kpi-section .row > [class^="col-"],
    .filters-section .row > [class^="col-"],
    .filters-section .row > [class*=" col-"],
    .filters-section .row > [class^="col"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .filters-section .row.g-3 {
        gap: 0.5rem 0;
    }
    .filters-section .input-group {
        flex-direction: column;
    }
    .filters-section .input-group-text {
        border-radius: 0.25rem 0.25rem 0 0;
        border-right: 1px solid #ced4da;
        border-bottom: none;
    }
    .filters-section .form-control {
        border-radius: 0 0 0.25rem 0.25rem;
        border-top: none;
    }
    .results-info .badge {
        width: 100%;
        text-align: center;
    }
    .table-section .card-body {
        padding: 0.5rem !important;
    }
    .pagination {
        flex-wrap: wrap;
        gap: 0.15rem;
    }

    /* Modal: altura menor e margem inferior para iframe */
    .modal-dialog {
        margin: 0;
        max-width: 100vw;
        min-width: 100vw;
        height: 90vh;
        display: flex;
        align-items: flex-start;
        margin-bottom: 5vh;
    }
    .modal-content {
        border-radius: 0;
        min-height: 70vh;
        height: 70vh;
        max-height: 70vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    .modal-body {
        flex: 1 1 auto;
        overflow-y: auto;
    }
    .modal-footer {
        position: sticky;
        bottom: 0;
        background: #fff;
        z-index: 10;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
        padding-bottom: 1rem;
    }
    .modal-header, .modal-body, .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .modal-title {
        font-size: 1.1rem;
    }

    /* Tabela responsiva tipo card */
    .table-responsive {
        overflow-x: visible;
    }
    #dataTable, #dataTable thead, #dataTable tbody, #dataTable tr, #dataTable th, #dataTable td {
        display: block;
        width: 100%;
    }
    #dataTable thead {
        display: none;
    }
    #dataTable tbody tr {
        margin-bottom: 1.2rem;
        border-radius: 0.5rem;
        box-shadow: 0 1px 4px rgba(0,0,0,0.07);
        background: #fff;
        border: 1px solid #dee2e6;
        padding: 0.5rem 0.7rem;
    }
    #dataTable tbody td {
        border: none;
        border-bottom: 1px solid #f1f1f1;
        position: relative;
        padding-left: 45%;
        min-height: 36px;
        font-size: 0.97em;
        text-align: left;
    }
    #dataTable tbody td:last-child {
        border-bottom: none;
    }
    #dataTable tbody td:before {
        position: absolute;
        left: 0.7rem;
        top: 0.5rem;
        width: 42%;
        white-space: pre-wrap;
        font-weight: 600;
        color: #07432c;
        font-size: 0.93em;
        content: attr(data-label);
    }
}
}