/**
 * mobile.css — Camada mobile-first do ERP Traine
 * Estratégia: regras base para ≤ 767px; expansão progressiva via min-width.
 * Mantém nomenclatura e arquitetura existente — apenas estende.
 */

/* ═══════════════════════════════════════════════════════════
   1. Utilitários globais
   ═══════════════════════════════════════════════════════════ */
img, svg, video, iframe, embed {
    max-width: 100%;
    height: auto;
}

/* Scroll horizontal controlado em contêineres de tabela */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

/* Garante que formulários não causem zoom no iOS (fonte ≥ 16px nos inputs) */
input, select, textarea, .form-control, .form-select {
    font-size: max(16px, 1rem) !important;
}

/* Área de toque mínima — todos botões e links de ação */
button,
.btn,
a.btn,
[role="button"],
.menu-item,
.sidebar-logout,
.menu-group-title {
    min-height: 44px;
    min-width: 44px;
}

/* ═══════════════════════════════════════════════════════════
   2. Tipografia fluida
   ═══════════════════════════════════════════════════════════ */
body {
    font-size: clamp(14px, 2.5vw, 16px);
}

h1, .h1 { font-size: clamp(1.4rem, 4vw, 2rem); }
h2, .h2 { font-size: clamp(1.2rem, 3.5vw, 1.75rem); }
h3, .h3 { font-size: clamp(1.1rem, 3vw, 1.5rem); }
h4, .h4 { font-size: clamp(1rem, 2.5vw, 1.25rem); }

/* ═══════════════════════════════════════════════════════════
   3. Imagens e mídia
   ═══════════════════════════════════════════════════════════ */
.card img,
.modal img,
.table img {
    max-width: 100%;
    height: auto;
}

/* ═══════════════════════════════════════════════════════════
   4. Formulários mobile
   ═══════════════════════════════════════════════════════════ */

/* Labels acima dos inputs no mobile */
@media (max-width: 767.98px) {
    .form-label {
        display: block;
        margin-bottom: 4px;
        font-weight: 500;
    }

    /* Inputs e selects: altura e padding confortáveis */
    .form-control,
    .form-select {
        padding: 10px 12px;
        min-height: 48px;
        border-radius: 6px;
    }

    /* Colunas de formulário: empilhar em 1 coluna */
    .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Botão de salvar/enviar fixo no rodapé */
    .btn-submit-sticky {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        z-index: 100;
        padding: 14px;
        font-size: 16px;
    }

    /* Botões de ação em formulários: largura total */
    .form-actions .btn,
    .card-footer .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    .form-actions .btn:last-child,
    .card-footer .btn:last-child {
        margin-bottom: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   5. Tabelas → cards no mobile
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    /* Tabelas marcadas com .table-mobile-cards viram cards */
    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody tr {
        display: block;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 12px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }

    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
        padding: 6px 0;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        font-size: 14px;
        word-break: break-word;
    }

    .table-mobile-cards tbody td:last-child {
        border-bottom: none;
        padding-top: 10px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #475569;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 40%;
    }

    /* Botões de ação dentro dos cards */
    .table-mobile-cards tbody td:last-child .btn {
        flex: 1;
        min-width: calc(50% - 3px);
        text-align: center;
        font-size: 13px;
        padding: 8px 6px;
    }

    /* Tabelas sem .table-mobile-cards: scroll horizontal com sombra indicadora */
    .table-responsive-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        position: relative;
    }

    .table-responsive-mobile::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 32px;
        background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
        pointer-events: none;
        border-radius: 0 8px 8px 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   6. Modais → bottom-sheet no mobile
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
    }

    .modal.fade .modal-dialog {
        transform: translateY(100%) !important;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1) !important;
    }

    .modal.show .modal-dialog {
        transform: translateY(0) !important;
    }

    .modal-content {
        border-radius: 20px 20px 0 0 !important;
        border: none !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Handle de arraste no topo do bottom-sheet */
    .modal-content::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        background: #cbd5e1;
        border-radius: 2px;
        margin: 12px auto 0;
    }

    .modal-header {
        padding: 12px 20px;
        border-bottom-color: #f1f5f9;
    }

    .modal-body {
        padding: 16px 20px;
        overflow-y: auto;
    }

    .modal-footer {
        padding: 12px 20px;
        flex-direction: column;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0 !important;
    }

    /* Modais que NÃO devem virar bottom-sheet: adicione .modal-centered */
    .modal-centered .modal-dialog {
        position: relative !important;
        bottom: auto !important;
        margin: 1rem auto !important;
        max-width: 500px !important;
        max-height: none !important;
    }
    .modal-centered .modal-content {
        border-radius: 12px !important;
        max-height: none;
    }
    .modal-centered .modal-content::before {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   7. Cards e KPIs no mobile
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    /* Cards de KPI: largura total */
    .card-stat {
        margin-bottom: 12px;
    }

    /* Grid de cards: 1 coluna no mobile */
    .kpi-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* Cards Bootstrap: padding reduzido */
    .card {
        border-radius: 10px;
    }

    .card-body {
        padding: 14px;
    }

    /* Títulos de página */
    .admin-page-title {
        font-size: 1.2rem !important;
    }

    /* Page header com ações: empilhar */
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .page-header .btn,
    .page-header .btn-group {
        width: 100%;
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════════════
   8. Alertas e notificações
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    /* Dropdown de notificações: largura da tela */
    .notifications-dropdown {
        position: fixed !important;
        top: 60px !important;
        left: 8px !important;
        right: 8px !important;
        min-width: auto !important;
        max-width: none !important;
        z-index: 1050 !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   9. Badges e tags
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .badge {
        font-size: 11px;
        padding: 4px 7px;
    }
}

/* ═══════════════════════════════════════════════════════════
   10. Paginação
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .pagination .page-link {
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px;
        font-size: 14px;
    }
}

/* ═══════════════════════════════════════════════════════════
   11. Header responsivo (tablet 768px–991px)
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 991.98px) {
    .header-sophia .user-name {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
    }
}

/* ═══════════════════════════════════════════════════════════
   12. Kanban mobile (CRM & Documentos)
   Não usar [class*="kanban"] — quebra ícone bi-kanban na dashboard.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .kanban-board,
    .kanban-container,
    .kanban-columns,
    .crm-kanban-board {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-bottom: 12px;
        scroll-snap-type: x mandatory;
    }

    .kanban-column,
    .crm-kanban-column {
        flex: 0 0 85vw;
        max-width: 320px;
        min-width: 0;
        scroll-snap-align: start;
    }

    /* Dashboard: garante ícone centralizado (proteção extra) */
    .dashboard-block .block-icon,
    .dashboard-block .block-icon i {
        display: block !important;
        flex: none !important;
        overflow: visible !important;
        width: auto !important;
        max-width: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   13. Filtros e busca mobile
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    /* Barra de filtros: empilhar */
    .filter-bar,
    .search-bar {
        flex-direction: column !important;
        gap: 8px;
    }

    .filter-bar .form-control,
    .filter-bar .form-select,
    .filter-bar .btn,
    .search-bar .form-control,
    .search-bar .input-group {
        width: 100% !important;
        max-width: none !important;
    }

    /* Grupos de input: R$ / % e valor na mesma linha */
    .input-group {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        width: 100%;
    }

    .input-group > .input-group-text {
        display: flex;
        align-items: center;
        flex: 0 0 auto !important;
        width: auto !important;
        white-space: nowrap;
    }

    .input-group > .form-control,
    .input-group > .form-select {
        flex: 1 1 0% !important;
        width: 1% !important;
        min-width: 0;
    }

    /* Exibição: evita quebra entre "R$" e o número */
    .table td.text-end,
    .table th.text-end,
    .table tfoot td.text-end,
    .table tfoot th.text-end,
    .account-transfers-amount,
    .currency-nowrap {
        white-space: nowrap !important;
        word-break: keep-all;
    }

    .table-mobile-cards tbody td.text-end {
        flex-wrap: nowrap;
        word-break: keep-all;
        white-space: nowrap;
    }
}

/* ═══════════════════════════════════════════════════════════
   14. Select2, Flatpickr, etc. (plugins comuns)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .select2-container {
        width: 100% !important;
    }

    .select2-selection--single {
        min-height: 44px !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   14b. Ações em tabelas (Alunos, Empresas, etc.)
   ═══════════════════════════════════════════════════════════ */
.table-actions-cell {
    white-space: nowrap;
    vertical-align: middle !important;
}
.table-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}
.table-actions .btn-action-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px;
    height: 32px;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    line-height: 0 !important;
    flex-shrink: 0;
    box-sizing: border-box;
}
.table-actions .btn-action-icon .bi {
    display: block;
    line-height: 1;
    font-size: 0.95rem;
    margin: 0;
    pointer-events: none;
}
.table-actions .table-action-form {
    display: inline-flex !important;
    margin: 0;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Tabelas de listagem — células alinhadas ao centro vertical */
.table-list-aligned > tbody > tr > td,
.table-list-aligned > tbody > tr > th {
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════
   14c. Financeiro — contas a pagar / receber
   ═══════════════════════════════════════════════════════════ */
#payables-table thead th.sticky-actions-col,
#payables-table tbody td.sticky-actions-col,
#receivables-table thead th.sticky-actions-col,
#receivables-table tbody td.sticky-actions-col {
    position: sticky;
    right: 0;
    z-index: 10;
    box-shadow: -2px 0 5px rgba(0,0,0, 0.08);
    background-color: #fff;
    border-left: 1px solid #dee2e6;
}
#payables-table thead th.sticky-actions-col,
#receivables-table thead th.sticky-actions-col {
    background-color: #f8f9fa;
    z-index: 11;
}
#payables-table tbody tr.table-success td.sticky-actions-col {
    background-color: #d1e7dd;
}
#payables-table tbody tr.table-danger td.sticky-actions-col {
    background-color: #f8d7da;
}
#payables-table tbody tr:hover td.sticky-actions-col,
#receivables-table tbody tr:hover td.sticky-actions-col {
    background-color: #f8f9fa;
}
#payables-table tbody tr.table-success:hover td.sticky-actions-col {
    background-color: #d1e7dd;
}
#payables-table tbody tr.table-danger:hover td.sticky-actions-col {
    background-color: #f8d7da;
}

@media (max-width: 767.98px) {
    .finance-quick-filters {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    .finance-quick-filters > .btn {
        flex: 1 1 calc(33.333% - 6px);
        min-width: 0;
        border-radius: 0.375rem !important;
    }

    .finance-filter-form > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .finance-filter-form .d-flex.align-items-end {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
    }
    .finance-filter-form .d-flex.align-items-end .btn,
    .finance-filter-form .d-flex.align-items-end a.btn {
        width: 100%;
    }

    #bulk-actions-menu .card-body > .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }
    #bulk-actions-menu .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 6px;
    }
    #bulk-actions-menu .btn-group > .btn {
        width: 100%;
        margin: 0 !important;
        border-radius: 0.375rem !important;
    }
    #bulk-actions-menu > .col-12 .btn-secondary,
    #bulk-actions-menu .card-body .btn-secondary {
        width: 100%;
    }

    .sticky-bulk-actions {
        position: relative !important;
        top: auto !important;
    }

    #payables-table,
    #receivables-table {
        font-size: 0.82rem;
    }
    #payables-table .table-actions,
    #receivables-table .table-actions {
        gap: 4px;
    }
}

/* Botões com ícone + texto alinhados */
.btn-with-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem;
    line-height: 1.2;
}
.btn-with-icon .bi {
    display: block;
    line-height: 1;
    flex-shrink: 0;
    pointer-events: none;
}

.active-interns-export-btn .active-interns-export-short {
    display: none;
}
.active-interns-export-btn .active-interns-export-long {
    display: inline;
}

/* ═══════════════════════════════════════════════════════════
   14h. Estagiários ativos
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .active-interns-filter-actions {
        width: 100%;
    }

    .active-interns-filter-actions .active-interns-filter-btn,
    .active-interns-filter-actions .btn-with-icon {
        flex: 1 1 auto;
        min-height: 44px;
    }

    .active-interns-export-btn .active-interns-export-short {
        display: inline;
    }
    .active-interns-export-btn .active-interns-export-long {
        display: none;
    }

    .active-interns-table-header .active-interns-export-btn {
        width: 100%;
    }

    .active-interns-stats-row > [class*="col-"] {
        margin-bottom: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════
   14g. Carteira por consultor
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .portfolio-kpi-row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .portfolio-kpi-row .btn {
        min-height: 100px;
        padding: 12px !important;
    }

    .portfolio-kpi-row h2 {
        font-size: 1.35rem;
    }

    .portfolio-kpi-row h5 {
        font-size: 0.95rem;
    }

    .portfolio-kpi-row small {
        font-size: 0.75rem;
    }
}

/* Tabelas de relatório no mobile: todas as colunas + scroll horizontal */
@media (max-width: 767.98px) {
    .report-table-scroll-wrap,
    .portfolio-companies-table-wrap,
    .active-interns-table-wrap,
    .talent-bank-table-wrap,
    .external-registrations-table-wrap,
    .flow-encaminhamento-table-wrap,
    .flow-aprovacao-monitor-table-wrap,
    .flow-aprovacao-logs-table-wrap,
    .candidates-registrations-table-wrap,
    .institutions-registrations-table-wrap,
    .partnership-contracts-table-wrap,
    .tce-contracts-table-wrap,
    .addendums-list-table-wrap,
    .doc-templates-table-wrap,
    .academy-students-table-wrap,
    .users-list-table-wrap,
    .company-users-list-table-wrap,
    .ie-users-list-table-wrap,
    .roles-list-table-wrap {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: auto;
        overscroll-behavior-y: auto;
        scrollbar-width: thin;
    }

    .report-table-scroll-wrap::after {
        content: "Deslize horizontalmente para ver todas as colunas";
        display: block;
        font-size: 0.75rem;
        color: #64748b;
        text-align: center;
        padding: 8px 4px 0;
    }

    .portfolio-companies-table,
    .active-interns-table,
    .talent-bank-table,
    .external-registrations-table,
    .flow-encaminhamento-table,
    .flow-aprovacao-monitor-table,
    .flow-aprovacao-logs-table,
    .candidates-registrations-table,
    .institutions-registrations-table,
    .partnership-contracts-table,
    .tce-contracts-table,
    .addendums-list-table,
    .doc-templates-table,
    .academy-students-table,
    .users-list-table,
    .company-users-list-table,
    .ie-users-list-table,
    .roles-list-table {
        width: max-content;
        min-width: 100%;
        margin-bottom: 0;
        font-size: 0.82rem;
        table-layout: auto !important;
    }

    .portfolio-companies-table {
        min-width: 920px;
    }

    .active-interns-table {
        min-width: 1080px;
    }

    .talent-bank-table {
        min-width: 1180px;
    }

    .talent-bank-table--vacancy {
        min-width: 1380px;
    }

    .external-registrations-table {
        min-width: 1100px;
    }

    .flow-encaminhamento-table {
        min-width: 1280px;
    }

    .flow-aprovacao-monitor-table {
        min-width: 1320px;
    }

    .flow-aprovacao-logs-table {
        min-width: 880px;
    }

    .candidates-registrations-table {
        min-width: 1020px;
    }

    .institutions-registrations-table {
        min-width: 980px;
    }

    .partnership-contracts-table {
        min-width: 1100px;
    }

    .addendums-list-table {
        min-width: 1000px;
    }

    .doc-templates-table {
        min-width: 1080px;
    }

    .academy-students-table {
        min-width: 1180px;
    }

    .users-list-table {
        min-width: 1020px;
    }

    .company-users-list-table {
        min-width: 920px;
    }

    .ie-users-list-table {
        min-width: 1100px;
    }

    .roles-list-table {
        min-width: 980px;
    }

    .tce-contracts-table {
        min-width: 1400px;
    }

    .candidates-registrations-table .table-actions-cell,
    .institutions-registrations-table .table-actions-cell {
        min-width: 88px;
    }

    .partnership-contracts-table .table-actions-cell {
        min-width: 200px;
    }

    .addendums-list-table .table-actions-cell {
        min-width: 160px;
    }

    .doc-templates-table .table-actions-cell {
        min-width: 180px;
    }

    .tce-contracts-table .table-actions-cell {
        min-width: 240px;
    }

    .academy-students-table .table-actions-cell {
        min-width: 96px;
    }

    .users-list-table .table-actions-cell,
    .company-users-list-table .table-actions-cell,
    .ie-users-list-table .table-actions-cell,
    .roles-list-table .table-actions-cell {
        min-width: 88px;
    }

    .users-list-table .table-actions,
    .company-users-list-table .table-actions,
    .ie-users-list-table .table-actions,
    .roles-list-table .table-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .academy-students-table .table-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .partnership-contracts-table .table-actions,
    .addendums-list-table .table-actions,
    .doc-templates-table .table-actions,
    .tce-contracts-table .table-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .flow-aprovacao-monitor-table thead th[style],
    .flow-aprovacao-monitor-table col[style] {
        width: auto !important;
    }

    .flow-aprovacao-monitor-table th,
    .flow-aprovacao-monitor-table td {
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        vertical-align: middle !important;
    }

    .flow-aprovacao-monitor-table .flow-msg-cell {
        min-width: 140px;
    }

    .talent-bank-table .table-actions-cell {
        min-width: 200px;
    }

    .external-registrations-table .table-actions-cell {
        min-width: 72px;
    }

    .flow-encaminhamento-table .table-actions-cell,
    .flow-encaminhamento-table .fenc-col-acoes {
        min-width: 240px;
    }

    .flow-encaminhamento-table .fenc-col-acoes .table-actions {
        flex-wrap: nowrap;
        justify-content: center;
    }

    .flow-encaminhamento-table .table-actions .btn-action-icon:not(.fenc-acao-encaminhar) {
        width: 28px;
        height: 28px;
        min-width: 28px !important;
        min-height: 28px !important;
    }

    .flow-encaminhamento-table .table-actions .btn-action-icon:not(.fenc-acao-encaminhar) .bi {
        font-size: 0.85rem;
    }

    .flow-encaminhamento-table .table-actions .btn-action-icon.fenc-acao-encaminhar {
        width: 44px;
        height: 44px;
        min-width: 44px !important;
        min-height: 44px !important;
    }

    .flow-encaminhamento-table .table-actions .btn-action-icon.fenc-acao-encaminhar .bi {
        font-size: 1.35rem;
    }

    .talent-bank-table thead th[style] {
        width: auto !important;
    }

    .report-table-scroll-wrap thead th,
    .report-table-scroll-wrap tbody td,
    .portfolio-companies-table thead th,
    .portfolio-companies-table tbody td,
    .active-interns-table thead th,
    .active-interns-table tbody td,
    .talent-bank-table thead th,
    .talent-bank-table tbody td,
    .external-registrations-table thead th,
    .external-registrations-table tbody td,
    .flow-encaminhamento-table thead th,
    .flow-encaminhamento-table tbody td,
    .flow-aprovacao-logs-table thead th,
    .flow-aprovacao-logs-table tbody td,
    .candidates-registrations-table thead th,
    .candidates-registrations-table tbody td,
    .institutions-registrations-table thead th,
    .institutions-registrations-table tbody td,
    .partnership-contracts-table thead th,
    .partnership-contracts-table tbody td,
    .addendums-list-table thead th,
    .addendums-list-table tbody td,
    .doc-templates-table thead th,
    .doc-templates-table tbody td,
    .academy-students-table thead th,
    .academy-students-table tbody td,
    .users-list-table thead th,
    .users-list-table tbody td,
    .company-users-list-table thead th,
    .company-users-list-table tbody td,
    .ie-users-list-table thead th,
    .ie-users-list-table tbody td,
    .roles-list-table thead th,
    .roles-list-table tbody td,
    .tce-contracts-table thead th,
    .tce-contracts-table tbody td {
        white-space: nowrap;
        vertical-align: middle !important;
    }

    .partnership-contracts-table td:nth-child(2) small {
        display: block;
        white-space: nowrap;
    }

    .flow-encaminhamento-table .fenc-col-nome {
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .mobile-horizontal-row-list,
    .card:has(.report-table-scroll-wrap),
    .card:has(.portfolio-companies-table-wrap),
    .card:has(.active-interns-table-wrap),
    .card:has(.talent-bank-table-wrap),
    .card:has(.external-registrations-table-wrap),
    .card:has(.flow-encaminhamento-table-wrap),
    .card:has(.flow-aprovacao-monitor-table-wrap),
    .card:has(.flow-aprovacao-logs-table-wrap),
    .card:has(.candidates-registrations-table-wrap),
    .card:has(.institutions-registrations-table-wrap),
    .card:has(.partnership-contracts-table-wrap),
    .card:has(.addendums-list-table-wrap),
    .card:has(.doc-templates-table-wrap),
    .card:has(.tce-contracts-table-wrap),
    .card:has(.academy-students-table-wrap),
    .card:has(.users-list-table-wrap),
    .card:has(.company-users-list-table-wrap),
    .card:has(.ie-users-list-table-wrap),
    .card:has(.roles-list-table-wrap),
    .fenc-candidates-card {
        overflow: visible !important;
        overflow-x: visible !important;
    }

    .main-content .report-table-scroll-wrap,
    .main-content .portfolio-companies-table-wrap,
    .main-content .active-interns-table-wrap,
    .main-content .talent-bank-table-wrap,
    .main-content .external-registrations-table-wrap,
    .main-content .flow-encaminhamento-table-wrap,
    .main-content .flow-aprovacao-monitor-table-wrap,
    .main-content .flow-aprovacao-logs-table-wrap,
    .main-content .candidates-registrations-table-wrap,
    .main-content .institutions-registrations-table-wrap,
    .main-content .partnership-contracts-table-wrap,
    .main-content .addendums-list-table-wrap,
    .main-content .doc-templates-table-wrap,
    .main-content .tce-contracts-table-wrap,
    .main-content .academy-students-table-wrap,
    .main-content .users-list-table-wrap,
    .main-content .company-users-list-table-wrap,
    .main-content .ie-users-list-table-wrap,
    .main-content .roles-list-table-wrap {
        overflow-x: auto !important;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }
}

/* ═══════════════════════════════════════════════════════════
   14i. Cadastros — Candidatos e Instituições de Ensino
   ═══════════════════════════════════════════════════════════ */
.registrations-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.registrations-page-actions .btn-with-icon {
    white-space: nowrap !important;
    flex-shrink: 0;
    min-width: max-content !important;
}

.registrations-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.registrations-filter-actions .flow-filter-btn {
    flex: 1 1 auto;
    min-width: 7rem;
}

@media (min-width: 768px) {
    .registrations-filter-actions .flow-filter-btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 7.5rem;
    }

    /* Academy — Alunos (desktop) */
    .academy-students-filter-form .registrations-page-actions {
        justify-content: flex-end;
    }

    .academy-students-filter-form .registrations-filter-actions .flow-filter-btn,
    .academy-students-filter-form .registrations-page-actions .btn-with-icon {
        min-height: 38px;
        align-items: center;
    }

    .academy-students-bulk-actions .btn-with-icon {
        min-height: 31px;
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
    }

    .students-table.academy-students-table {
        width: 100%;
        table-layout: fixed;
    }

    .academy-students-table.students-table thead th,
    .academy-students-table.students-table tbody td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
    }

    .academy-students-table .table-actions-cell {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
        overflow: visible;
        white-space: nowrap;
    }

    .academy-students-table .table-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .academy-students-table tbody td:nth-child(5) {
        overflow: visible;
        text-overflow: clip;
    }

    .users-list-table-wrap {
        overflow-x: auto;
    }

    .users-list-table {
        width: 100%;
        table-layout: fixed;
    }

    .users-list-table thead th,
    .users-list-table tbody td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
    }

    .users-list-table .table-actions-cell {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
        overflow: visible;
    }

    .users-list-table .table-actions,
    .company-users-list-table .table-actions,
    .ie-users-list-table .table-actions,
    .roles-list-table .table-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .company-users-list-table-wrap,
    .ie-users-list-table-wrap,
    .roles-list-table-wrap {
        overflow-x: auto;
    }

    .company-users-list-table,
    .ie-users-list-table,
    .roles-list-table {
        width: 100%;
        table-layout: fixed;
    }

    .company-users-list-table thead th,
    .company-users-list-table tbody td,
    .ie-users-list-table thead th,
    .ie-users-list-table tbody td,
    .roles-list-table thead th,
    .roles-list-table tbody td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
    }

    .company-users-list-table .table-actions-cell,
    .ie-users-list-table .table-actions-cell,
    .roles-list-table .table-actions-cell {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
        overflow: visible;
    }

    /* Configurações — listas: ID compacto (cabe "ID" + dígitos); 2ª coluna com mais espaço */
    .users-list-table th:nth-child(1),
    .users-list-table td:nth-child(1),
    .company-users-list-table th:nth-child(1),
    .company-users-list-table td:nth-child(1),
    .ie-users-list-table th:nth-child(1),
    .ie-users-list-table td:nth-child(1),
    .roles-list-table th:nth-child(1),
    .roles-list-table td:nth-child(1) {
        width: 5rem;
        min-width: 5rem;
        max-width: 6rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
    }

    .users-list-table th:nth-child(2),
    .users-list-table td:nth-child(2) {
        width: 22%;
        min-width: 10rem;
    }

    .company-users-list-table th:nth-child(2),
    .company-users-list-table td:nth-child(2) {
        width: 30%;
        min-width: 11rem;
    }

    .ie-users-list-table th:nth-child(2),
    .ie-users-list-table td:nth-child(2) {
        width: 40%;
        min-width: 12rem;
    }

    .roles-list-table th:nth-child(2),
    .roles-list-table td:nth-child(2) {
        width: 26%;
        min-width: 10rem;
    }

    .partnership-contracts-table .table-actions-cell {
        width: 200px;
        min-width: 200px;
        max-width: 200px;
    }

    .addendums-list-table .table-actions-cell {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }

    .doc-templates-table-wrap {
        overflow-x: visible;
    }

    .doc-templates-table {
        width: 100% !important;
        max-width: 100%;
        table-layout: fixed;
    }

    .doc-templates-table thead th:not(.table-actions-cell),
    .doc-templates-table tbody td:not(.table-actions-cell):not(.doc-templates-tags-cell) {
        white-space: normal;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .doc-templates-table th:nth-child(1),
    .doc-templates-table td:nth-child(1) {
        width: 40%;
    }

    .doc-templates-table th:nth-child(2),
    .doc-templates-table td:nth-child(2) {
        width: 14%;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }

    .doc-templates-table th:nth-child(3),
    .doc-templates-table td:nth-child(3) {
        width: 9%;
        text-align: center;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }

    .doc-templates-table th:nth-child(4),
    .doc-templates-table td.doc-templates-tags-cell {
        width: 12%;
    }

    .doc-templates-table th:nth-child(4) {
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }

    .doc-templates-tags-cell small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .doc-templates-table th:nth-child(5),
    .doc-templates-table td:nth-child(5) {
        width: 11%;
        min-width: 7.5rem;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }

    .doc-templates-table .table-actions-cell {
        width: 180px;
        min-width: 180px;
        max-width: none;
    }

    /* TCE — colunas redimensionáveis (como painel de vagas) */
    .tce-contracts-table-wrap {
        overflow-x: auto;
    }

    .tce-contracts-table.table-columns-resizable {
        width: 100%;
        table-layout: fixed;
    }

    .tce-contracts-table.table-columns-resizable thead th {
        position: relative;
    }

    .tce-contracts-table.table-columns-resizable th,
    .tce-contracts-table.table-columns-resizable td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
    }

    .tce-contracts-table.table-columns-resizable th:nth-child(6),
    .tce-contracts-table.table-columns-resizable td:nth-child(6),
    .tce-contracts-table.table-columns-resizable th:nth-child(7),
    .tce-contracts-table.table-columns-resizable td:nth-child(7),
    .tce-contracts-table.table-columns-resizable th:nth-child(8),
    .tce-contracts-table.table-columns-resizable td:nth-child(8) {
        text-align: center;
    }

    .tce-contracts-table.table-columns-resizable .table-actions-cell {
        overflow: visible;
    }

    .tce-contracts-table.table-columns-resizable .column-resize-handle {
        position: absolute;
        top: 0;
        right: -3px;
        width: 8px;
        height: 100%;
        cursor: col-resize;
        z-index: 3;
        user-select: none;
    }

    .tce-contracts-table.table-columns-resizable .column-resize-handle::after {
        content: '';
        position: absolute;
        top: 20%;
        bottom: 20%;
        left: 50%;
        width: 2px;
        transform: translateX(-50%);
        background: rgba(33, 37, 41, 0.28);
        border-radius: 2px;
        transition: background-color 0.15s ease, opacity 0.15s ease;
        opacity: 0.55;
    }

    .tce-contracts-table.table-columns-resizable thead th:hover .column-resize-handle::after,
    .tce-contracts-table.table-columns-resizable .column-resize-handle:hover::after {
        background: rgba(255, 193, 7, 0.95);
        opacity: 1;
    }

    .tce-contracts-table.table-columns-resizable thead th.is-resizing-header {
        background-color: rgba(255, 193, 7, 0.22);
    }

    .tce-contracts-table.table-columns-resizable.is-resizing {
        user-select: none;
        cursor: col-resize;
    }
}

/* Feedback visual ao redimensionar colunas (compartilhado entre telas) */
.column-resize-guide {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ffc107;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    pointer-events: none;
}

.column-resize-tooltip {
    position: fixed;
    transform: translate(-50%, -110%);
    background: rgba(33, 37, 41, 0.94);
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10000;
    pointer-events: none;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .registrations-page-actions {
        width: 100%;
        justify-content: stretch;
    }

    .registrations-page-actions .btn-with-icon {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        min-height: 44px;
        justify-content: center !important;
    }

    .registrations-filter-actions {
        width: 100%;
    }

    .registrations-filter-actions .flow-filter-btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-height: 44px;
        justify-content: center !important;
    }
}

@media (max-width: 399.98px) {
    .registrations-page-actions .btn-with-icon {
        flex: 1 1 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   14e0. Flow de Aprovação — botões Filtrar / Hoje
   ═══════════════════════════════════════════════════════════ */
.flow-filter-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-width: max-content !important;
}

@media (max-width: 767.98px) {
    .flow-aprovacao-monitor-filter {
        width: 100%;
        justify-content: flex-end;
    }

    .flow-aprovacao-monitor-filter .flow-filter-btn,
    .flow-aprovacao-logs-filter-actions .flow-filter-btn {
        min-height: 44px;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .flow-aprovacao-logs-filter-actions {
        width: 100%;
    }

    .flow-aprovacao-logs-filter-actions .flow-filter-btn {
        flex: 1 1 auto;
    }
}

/* ═══════════════════════════════════════════════════════════
   14e1. Flow encaminhamento — link público (Copiar / Abrir)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .fenc-link-toolbar {
        width: 100%;
    }

    .fenc-link-toolbar .btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }
}

@media (max-width: 399.98px) {
    .fenc-link-toolbar .btn {
        flex: 1 1 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   14e2. Cadastro externo — cabeçalho e filtros
   ═══════════════════════════════════════════════════════════ */
.external-reg-page-header {
    row-gap: 0.75rem;
}

.external-reg-page-heading {
    flex: 1 1 280px;
    min-width: 0;
}

.external-reg-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
    flex: 1 1 auto;
}

.external-reg-page-actions .btn-with-icon {
    white-space: nowrap;
    flex-shrink: 0;
}

.external-reg-page-actions .external-reg-actions-data .btn-with-icon {
    min-height: calc(1.5em + 0.75rem + 2px);
}

@media (min-width: 768px) {
    .external-reg-page-actions {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
}

@media (max-width: 767.98px) {
    .external-reg-page-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .external-reg-page-actions .external-reg-action-config,
    .external-reg-page-actions .external-reg-action-public {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .external-reg-page-actions .external-reg-actions-data {
        display: flex;
        width: 100%;
    }

    .external-reg-page-actions .external-reg-actions-data .btn {
        flex: 1 1 50%;
        justify-content: center;
        min-height: 44px;
    }

    .external-reg-filters-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .external-reg-filters-actions .btn {
        width: 100%;
        min-height: 44px;
    }
}

@media (min-width: 1200px) {
    .external-reg-filters-actions .btn {
        min-width: 120px;
    }
}

/* ═══════════════════════════════════════════════════════════
   14f. Relatórios — atalhos Hoje / Esta semana / Gerenciais
   ═══════════════════════════════════════════════════════════ */
.managerial-export-btn .managerial-export-short {
    display: none;
}
.managerial-export-btn .managerial-export-long {
    display: inline;
}

@media (max-width: 767.98px) {
    .reports-period-actions,
    .managerial-period-actions {
        flex-direction: column;
        align-items: stretch !important;
    }

    .reports-period-filter-btn,
    .managerial-period-filter-btn {
        width: 100%;
        min-height: 44px;
    }

    .reports-period-quick.finance-quick-filters,
    .managerial-period-quick.finance-quick-filters {
        width: 100%;
    }

    .reports-period-quick.finance-quick-filters > .btn,
    .managerial-period-quick.finance-quick-filters > .btn {
        flex: 1 1 33.333%;
        min-width: 0;
        font-size: 0.8rem;
        padding-left: 6px;
        padding-right: 6px;
    }

    .managerial-export-btn .managerial-export-short {
        display: inline;
    }
    .managerial-export-btn .managerial-export-long {
        display: none;
    }

    .managerial-report-header .managerial-report-title {
        font-size: 1rem;
        line-height: 1.35;
    }

    .managerial-report-header .managerial-report-title small {
        font-size: 0.8rem;
    }

    #form-managerial-report .finance-filter-form > [class*="col-"],
    #form-managerial-report > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .card-header .managerial-export-btn {
        width: 100%;
        min-height: 40px;
    }
}

/* ═══════════════════════════════════════════════════════════
   14e. Transferências entre contas
   ═══════════════════════════════════════════════════════════ */
.account-transfers-btn-new .account-transfers-btn-long {
    display: inline;
}
.account-transfers-btn-new .account-transfers-btn-short {
    display: none;
}

@media (max-width: 767.98px) {
    .account-transfers-btn-new .account-transfers-btn-long {
        display: none;
    }
    .account-transfers-btn-new .account-transfers-btn-short {
        display: inline;
    }

    .account-transfers-btn-filter-long {
        display: none;
    }

    .account-transfers-table-wrap {
        overflow-x: visible;
    }

    .account-transfers-table thead {
        display: none;
    }

    .account-transfers-table tbody tr {
        display: block;
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        background: #fff;
    }

    .account-transfers-table tbody td {
        display: block;
        width: 100% !important;
        border: none;
        padding: 6px 0;
        text-align: left !important;
    }

    .account-transfers-table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        color: #6c757d;
        margin-bottom: 2px;
    }

    .account-transfers-table tbody td.account-transfers-amount {
        font-size: 1.1rem;
        font-weight: 600;
        color: #0d6efd;
        padding-top: 8px;
        margin-top: 4px;
        border-top: 1px solid #eee;
    }

    .account-transfers-card .card-body {
        padding: 14px;
    }

    .account-transfers-form-actions .btn {
        width: 100%;
        min-height: 44px;
    }
}

/* ═══════════════════════════════════════════════════════════
   14d. Parâmetros — configurações financeiras (multa/juros)
   ═══════════════════════════════════════════════════════════ */
.financial-settings-row-hidden {
    display: none !important;
}

@media (max-width: 767.98px) {
    .financial-settings-table-wrap {
        overflow-x: visible;
    }

    .financial-settings-table thead {
        display: none;
    }

    .financial-settings-table tbody tr {
        display: block;
        margin-bottom: 14px;
        padding: 14px;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .financial-settings-table tbody tr:hover {
        background: #fff;
    }

    .financial-settings-table tbody td {
        display: block;
        width: 100% !important;
        border: none;
        padding: 8px 0;
        text-align: left !important;
    }

    .financial-settings-table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        color: #6c757d;
        margin-bottom: 6px;
    }

    .financial-settings-table tbody td:first-child::before {
        display: none;
    }

    .financial-settings-table tbody td:first-child {
        padding-top: 0;
        padding-bottom: 10px;
        border-bottom: 1px solid #eee;
        margin-bottom: 4px;
    }

    .financial-settings-service-name {
        font-size: 1.05rem;
    }

    .financial-settings-input-group .form-control {
        min-height: 44px;
        font-size: 16px;
    }

    .financial-settings-input-group .input-group-text {
        min-height: 44px;
    }

    .financial-settings-hint {
        display: block;
        margin-top: 4px;
        font-size: 0.78rem;
        line-height: 1.3;
    }

    .financial-settings-save-wrap {
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin-left: -14px;
        margin-right: -14px;
        margin-bottom: -14px !important;
        padding: 12px 14px;
        background: linear-gradient(to top, #fff 85%, rgba(255, 255, 255, 0.9));
        border-top: 1px solid #dee2e6;
    }

    .financial-settings-save-btn {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
    }

    .financial-settings-card .card-body {
        padding-bottom: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   15. Correções de overflow geral
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    /* Evita scroll horizontal na página (listas com linha rolável são exceção) */
    .container,
    .container-fluid {
        overflow-x: hidden;
    }

    .row:not(:has(.portfolio-companies-table)):not(:has(.active-interns-table)):not(:has(.talent-bank-table)):not(:has(.external-registrations-table)):not(:has(.flow-encaminhamento-table)):not(:has(.flow-aprovacao-monitor-table)):not(:has(.flow-aprovacao-logs-table)):not(:has(.candidates-registrations-table)):not(:has(.institutions-registrations-table)):not(:has(.partnership-contracts-table)):not(:has(.addendums-list-table)):not(:has(.doc-templates-table)):not(:has(.tce-contracts-table)):not(:has(.academy-students-table)):not(:has(.users-list-table)):not(:has(.company-users-list-table)):not(:has(.ie-users-list-table)):not(:has(.roles-list-table)) {
        overflow-x: hidden;
    }

    /* Padding lateral consistente */
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Botões pequenos com texto: garantir área de toque (exceto ícone só na tabela) */
    .btn-sm:not(.btn-action-icon) {
        min-height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }

    .table-actions .btn-action-icon {
        width: 36px;
        height: 36px;
        min-width: 36px !important;
        min-height: 36px !important;
    }

    /* Inputs em grupos de botões */
    .btn-group .btn {
        min-height: 40px;
    }
}

/* ═══════════════════════════════════════════════════════════
   15b. Login e páginas públicas
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .login-page-wrapper .login-card {
        padding: 28px 20px !important;
        border-radius: 14px !important;
        max-width: 100%;
        width: 100%;
    }

    .login-page-wrapper .login-form-group {
        margin-bottom: 16px;
    }

    .login-page-wrapper .login-form-label {
        margin-bottom: 6px;
        font-size: 13px;
    }

    /* Campos de credenciais: altura compacta, borda legível, toque confortável */
    .login-page-wrapper .login-form-input {
        padding: 10px 12px;
        padding-right: 12px;
        line-height: 1.35;
        border-width: 1px;
        border-color: #d1d5db;
        border-radius: 8px;
        min-height: 0;
        height: auto;
        -webkit-appearance: none;
        appearance: none;
        box-shadow: none;
    }

    .login-page-wrapper .password-input-wrapper .login-form-input {
        padding-right: 44px;
    }

    .login-page-wrapper .password-toggle {
        min-height: 0 !important;
        min-width: 0 !important;
        width: 40px;
        height: 40px;
        right: 2px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-page-wrapper .login-btn {
        padding: 12px 16px;
        margin-top: 4px;
        min-height: 44px;
    }
}

@media (max-width: 575.98px) {
    .login-page-wrapper .login-card {
        padding: 24px 18px !important;
        border-radius: 12px !important;
        margin: 0;
    }

    .login-page-wrapper .row.align-items-center {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .login-page-wrapper {
        align-items: flex-start !important;
        padding-top: 32px;
    }

    /* Formulários de cadastro externo / assinatura */
    .card.shadow, .card.shadow-sm {
        border-radius: 10px;
    }
}

/* ═══════════════════════════════════════════════════════════
   16. Expandir de volta para Desktop (≥ 1200px)
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 1200px) {
    /* Formulários voltam a 2 colunas onde aplicável */
    .form-two-col .row > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Filtros em linha */
    .filter-bar,
    .search-bar {
        flex-direction: row !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   17. Acessibilidade — focus visible para navegação por teclado
   ═══════════════════════════════════════════════════════════ */
:focus-visible {
    outline: 2px solid var(--cor-financeiro, #00B86B);
    outline-offset: 2px;
    border-radius: 3px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* ═══════════════════════════════════════════════════════════
   18. Safe-area inset (notch / barra de navegação iOS/Android)
   ═══════════════════════════════════════════════════════════ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .modal-footer,
    .btn-submit-sticky,
    .sidebar-footer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .header-sophia {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
}
