* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f4f7fa;
    color: #334155;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* AppBar Robusta */
.app-bar {
    background-color: #1e3a8a; /* Azul Escuro */
    color: #ffffff;
    height: 65px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
    z-index: 10;
    flex-shrink: 0;
}

.app-bar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-bar-icon {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px;
    border-radius: 8px;
}

.app-bar-brand h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.app-bar-brand p {
    font-size: 11px;
    color: #93c5fd;
}

.btn-nav {
    background-color: #0284c7;
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    font-weight: 600;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-nav:hover { background-color: #0369a1; transform: translateY(-1px); }
.btn-nav:active { transform: translateY(0); }

/* Layout da Área Principal (Sidebar Fixa + Main Flexível) */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 320px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex-shrink: 0;
}

.content-area {
    flex: 1;
    padding: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Cards de Organização */
.card {
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.card h3 {
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 6px;
}

/* Filtro de Processamento - Toggle Switch Redondo Bonito */
.control-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-label {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .toggle-slider { background-color: #2563eb; }
input:checked + .toggle-slider:before { transform: translateX(24px); }

/* Caixa de Arrastar Arquivos (Dropzone) */
.dropzone {
    border: 2px dashed #cbd5e1;
    background-color: #f8fafc;
    border-radius: 6px;
    padding: 24px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.dropzone:hover { border-color: #2563eb; background-color: #eff6ff; }
.dropzone p { font-size: 12px; color: #64748b; }

.file-status {
    font-size: 12px;
    color: #0284c7;
    font-weight: 600;
    word-break: break-all;
    margin-top: 4px;
}

/* Botões */
.btn-primary {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover:not(:disabled) { background-color: #1d4ed8; }
.btn-primary:disabled { background-color: #94a3b8; cursor: not-allowed; }

.btn-secondary {
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.btn-secondary:hover { background-color: #f1f5f9; }

.btn-block { width: 100%; display: block; }

/* Mensagens de Feedback */
.status-message {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}
.status-message.info { background-color: #f1f5f9; color: #475569; }
.status-message.error { background-color: #fee2e2; color: #991b1b; }
.status-message.success { background-color: #dcfce7; color: #166534; }

/* Contêiner da Tabela de Preview Dedicado */
.table-container-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px !important;
}

.table-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.table-header-actions h3 {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    font-size: 16px;
    color: #1e293b;
}

/* Caixa do Filtro de Empregado */
.filter-box {
    background-color: #f8fafc;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-box label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.filter-box select {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: #1e293b;
    outline: none;
    min-width: 24px;
    max-width: 300px;
}
.filter-box select:focus { border-color: #2563eb; }

/* Tabela Estilizada com Cabeçalho FIXO Azul e Texto Branco */
.table-wrapper {
    overflow: auto;
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

th {
    background-color: #1e3a8a; /* REQUISITO: Fundo Azul na Interface */
    color: #ffffff;            /* REQUISITO: Letras Brancas na Interface */
    font-weight: 600;
    padding: 12px 14px;
    position: sticky;          /* Cabeçalho Fixo Virtual */
    top: 0;
    z-index: 2;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    white-space: nowrap;
}

tr:nth-child(even) { background-color: #f8fafc; }
tr:hover { background-color: #f1f5f9; }

.table-empty {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-style: italic;
}

/* Estrutura do Modal de Exportação */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.modal-card {
    background-color: #ffffff;
    width: 100%;
    max-width: 760px;
    border-radius: 10px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background-color: #f8fafc;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-size: 15px; color: #1e293b; font-weight: 600; }

.btn-close-modal {
    background: none; border: none; font-size: 24px; color: #94a3b8; cursor: pointer;
}
.btn-close-modal:hover { color: #475569; }

.modal-body { padding: 24px; }
.modal-body > p { font-size: 13px; color: #64748b; margin-bottom: 20px; line-height: 1.5; }

.export-options-list { display: flex; flex-direction: column; gap: 16px; }

/* Painel de escopo da exportação */
.export-filter-panel {
    border: 1px solid #bfdbfe;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: 0 8px 18px rgba(30, 58, 138, 0.06);
}

.export-filter-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.export-filter-header h4 {
    margin: 0 0 4px;
    font-size: 14px;
    color: #1e3a8a;
}

.export-filter-header p {
    margin: 0;
    font-size: 12px;
    color: #475569;
    line-height: 1.4;
}

.export-scope-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 6px 10px;
    background: #1e3a8a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.export-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.field-label select {
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 10px;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    font-size: 12px;
}

.field-label select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.format-toggle--dept {
    justify-content: flex-start;
    min-height: 38px;
}

@media (max-width: 720px) {
    .export-filter-grid { grid-template-columns: 1fr; }
    .export-filter-header { flex-direction: column; }
    .export-scope-badge { white-space: normal; }
}


.export-option-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background-color: #f8fafc;
}

.option-desc h4 { font-size: 14px; color: #1e293b; margin-bottom: 4px; }
.option-desc p { font-size: 12px; color: #64748b; line-height: 1.4; }

.btn-export-action {
    border: none; padding: 10px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; color: white; cursor: pointer; white-space: nowrap; transition: opacity 0.2s;
}
.btn-export-action:hover { opacity: 0.9; }
.btn-blue { background-color: #2563eb; }
.btn-orange { background-color: #ea580c; }

.hidden { display: none !important; }

.config-help {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    font-size: 12px;
    line-height: 1.45;
}

.badge-regime {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 900px) {
    body { overflow: auto; }
    .app-bar { height: auto; padding: 12px 16px; gap: 12px; align-items: flex-start; }
    .app-bar-brand h2 { font-size: 16px; }
    .main-container { flex-direction: column; overflow: visible; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e2e8f0; padding: 16px; }
    .content-area { padding: 16px; min-height: 70vh; }
    .table-header-actions { flex-direction: column; align-items: stretch; gap: 10px; }
    .filter-box { justify-content: space-between; }
    .export-option-item { flex-direction: column; align-items: stretch; }
    .btn-export-action { width: 100%; }
}

/* V12 - Upload integrado à AppBar e tabela em tela cheia */
.app-bar {
    min-height: 72px;
    height: auto;
    gap: 16px;
}

.app-bar-actions--upload {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.top-control,
.top-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #dbeafe;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.top-toggle span,
.top-upload .file-status {
    color: #dbeafe;
    font-size: 12px;
    font-weight: 700;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-upload.dragover {
    border-color: #93c5fd;
    background: rgba(59, 130, 246, .28);
    box-shadow: 0 0 0 3px rgba(147, 197, 253, .18);
}

.upload-icon { font-size: 16px; }

.btn-nav-light {
    background: #ffffff;
    color: #1e3a8a;
    padding: 8px 12px;
    box-shadow: none;
}
.btn-nav-light:hover { background: #eff6ff; color: #1d4ed8; }
.btn-process { background: #16a34a; }
.btn-process:hover:not(:disabled) { background: #15803d; }
.btn-process:disabled { background: rgba(148, 163, 184, .8); cursor: not-allowed; transform: none; }

.compact-toggle { width: 42px; height: 22px; flex: 0 0 auto; }
.compact-toggle .toggle-slider:before { width: 16px; height: 16px; }
.compact-toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

.main-container--full {
    display: block;
    flex: 1;
    overflow: hidden;
}

.content-area--full {
    height: 100%;
    width: 100%;
    padding: 14px;
}

.status-message--top {
    position: fixed;
    right: 18px;
    top: 82px;
    z-index: 50;
    min-width: 280px;
    max-width: min(520px, calc(100vw - 32px));
    box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
    border: 1px solid rgba(148, 163, 184, .25);
}

.btn-green { background-color: #16a34a; }
.export-option-item--highlight {
    background: linear-gradient(135deg, #ecfdf5, #eff6ff);
    border-color: #86efac;
}

.format-toggle {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    user-select: none;
    cursor: pointer;
}
.format-toggle input { display: none; }
.format-slider {
    width: 48px;
    height: 24px;
    border-radius: 999px;
    background: #2563eb;
    position: relative;
    transition: .2s ease;
}
.format-slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    transition: .2s ease;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .25);
}
.format-toggle input:checked + .format-slider { background: #16a34a; }
.format-toggle input:checked + .format-slider:before { transform: translateX(24px); }

@media (max-width: 1100px) {
    .app-bar { align-items: flex-start; flex-direction: column; padding: 12px 16px; }
    .app-bar-actions--upload { width: 100%; justify-content: flex-start; }
    .top-upload { flex: 1 1 100%; justify-content: space-between; }
    .top-upload .file-status { max-width: 48vw; }
    .status-message--top { top: auto; bottom: 12px; right: 12px; }
}

@media (max-width: 900px) {
    .main-container--full { overflow: visible; }
    .content-area--full { min-height: 72vh; padding: 10px; }
    .top-control, .btn-process, #btnAbrirExportar { flex: 1 1 auto; justify-content: center; }
}

/* V13 - tela inicial orientativa, status separado e badges de cálculo */
.table-empty--rich {
    padding: 24px !important;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    white-space: normal;
}

.empty-start {
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
    color: #334155;
}
.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 28px;
    box-shadow: inset 0 0 0 1px #bfdbfe;
}
.empty-start h2 {
    font-size: 24px;
    color: #0f172a;
    margin-bottom: 8px;
}
.empty-start p {
    max-width: 640px;
    margin: 0 auto 18px;
    color: #475569;
    line-height: 1.55;
    font-style: normal;
}
.empty-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.empty-card {
    text-align: left;
    border: 1px dashed #cbd5e1;
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.empty-card strong {
    display: block;
    color: #1e3a8a;
    margin-bottom: 8px;
    font-size: 14px;
}
.empty-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}
.empty-note {
    display: inline-flex;
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-weight: 700;
    font-size: 12px;
    font-style: normal;
}

.badge-calc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 11px;
    border: 1px solid transparent;
}
.badge-calc--ok { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge-calc--off { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge-calc--warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }

@media (max-width: 760px) {
    .empty-grid { grid-template-columns: 1fr; }
    .empty-note { border-radius: 14px; }
}

/* V15 - AppBar mais sutil, busca global e badges por regime */
.material-icons {
    font-size: 18px;
    line-height: 1;
    vertical-align: middle;
}
.inline-icon {
    font-size: 17px;
    margin-right: 5px;
    color: inherit;
}
.control-icon {
    font-size: 15px;
    color: #bfdbfe;
}
.app-bar {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.16);
}
.app-bar-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.12);
    color: #dbeafe;
    padding: 0;
    border-radius: 12px;
}
.btn-nav {
    min-height: 38px;
    border-radius: 999px;
    padding: 8px 13px;
    background: rgba(255, 255, 255, 0.10);
    color: #eef2ff;
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: none;
    transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease;
}
.btn-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255,255,255,.30);
    color: #ffffff;
    transform: translateY(-1px);
}
.btn-nav-light {
    background: rgba(255,255,255,.94);
    color: #1e3a8a;
    border-color: rgba(255,255,255,.45);
}
.btn-nav-light:hover {
    background: #ffffff;
    color: #1d4ed8;
}
.btn-process {
    background: rgba(22, 163, 74, .90);
    border-color: rgba(187,247,208,.35);
}
.btn-process:hover:not(:disabled) {
    background: rgba(21, 128, 61, .96);
}
#btnAbrirExportar {
    background: rgba(14, 165, 233, .86);
    border-color: rgba(186,230,253,.35);
}
#btnAbrirExportar:hover:not(:disabled) {
    background: rgba(2, 132, 199, .96);
}
.search-shell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    transition: all .2s ease;
}
.search-shell--open {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.28);
}
.btn-icon-search {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    color: #e0f2fe;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.btn-icon-search:hover {
    background: rgba(255,255,255,.22);
    transform: translateY(-1px);
}
.search-input {
    width: min(380px, 36vw);
    height: 32px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 999px;
    padding: 0 12px;
    outline: none;
    background: rgba(255,255,255,.96);
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
}
.search-input::placeholder {
    color: #64748b;
    font-weight: 500;
}
.badge-regime--bh {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}
.badge-regime--he {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fed7aa;
}
.badge-regime--escala {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}
.badge-regime--neutro {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.btn-export-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.empty-icon .material-icons {
    font-size: 30px;
}
@media (max-width: 900px) {
    .search-shell { flex: 1 1 100%; }
    .search-input { width: 100%; flex: 1; }
}

/* V16 - Upload inicial limpo, rodapé fixo e apuração líquida 12x36/24x72 */
body {
    padding-bottom: 38px;
}

.app-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: rgba(255, 255, 255, .94);
    border-top: 1px solid rgba(148, 163, 184, .25);
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    z-index: 80;
    box-shadow: 0 -8px 22px rgba(15, 23, 42, .06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.app-footer .material-icons {
    color: #2563eb;
    font-size: 17px;
}
.app-footer a {
    color: #1d4ed8;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.app-footer a:hover {
    background: #dbeafe;
    color: #1e3a8a;
}

.empty-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px auto 16px;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(37, 99, 235, .22);
    transition: transform .18s ease, box-shadow .18s ease;
}
.empty-upload-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(37, 99, 235, .28);
}
.empty-upload-button .material-icons {
    font-size: 18px;
}

.app-bar-actions--upload .requires-upload.hidden {
    display: none !important;
}

@media (max-width: 760px) {
    body { padding-bottom: 50px; }
    .app-footer { height: 50px; flex-wrap: wrap; padding: 6px 10px; line-height: 1.1; }
    .app-footer a { padding: 4px 8px; }
}

/* V17 - escala com horário padrão discreto */
.scale-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 190px;
}
.scale-name {
    font-weight: 650;
    color: #1e293b;
    line-height: 1.25;
}
.scale-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .01em;
}
.scale-time .material-icons {
    font-size: 12px;
    color: #94a3b8;
}

/* V18 - filtro por empregado/departamento e totais discretos no preview */
.filter-box {
    gap: 10px;
    flex-wrap: wrap;
    max-width: min(760px, 100%);
}
.filter-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #dbeafe;
    color: #1e3a8a;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}
.filter-mode-toggle input { display: none; }
.filter-mode-toggle .material-icons,
.filter-select-label .material-icons {
    font-size: 15px;
    color: #2563eb;
}
.filter-select-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filter-select-label.hidden,
#boxFiltroEmpregado.hidden,
#boxFiltroDepartamento.hidden {
    display: none !important;
}
.employee-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
}
.employee-name {
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}
.employee-dept {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    max-width: 340px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-size: 10.5px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
}
.employee-dept .material-icons {
    font-size: 12px;
    color: #94a3b8;
}
.employee-total-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 520px;
    margin-top: 2px;
}
.employee-total-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
    font-size: 10.2px;
    font-weight: 700;
}
.employee-total-pill .material-icons {
    font-size: 12px;
    color: #2563eb;
}
.employee-total-pill strong {
    color: #0f172a;
}
@media (max-width: 900px) {
    .table-header-actions { align-items: flex-start; flex-direction: column; gap: 10px; }
    .filter-box { width: 100%; }
    .filter-box select { max-width: 100%; width: 100%; }
    .filter-select-label { flex: 1 1 100%; }
}

/* V19 - título, favicon, toggle semântico e totais no cabeçalho da tabela */
.app-title-icon {
    font-size: 19px;
    vertical-align: -4px;
    margin-right: 5px;
    color: #bfdbfe;
}

.table-header-actions h3 {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #0f172a;
    letter-spacing: .02em;
}
.table-header-actions h3 .material-icons {
    font-size: 18px;
    color: #2563eb;
}

.filter-mode-toggle {
    position: relative;
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #64748b;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.filter-mode-toggle .mode-label {
    opacity: .62;
    transition: color .18s ease, opacity .18s ease, transform .18s ease;
}
.filter-mode-toggle .active-mode {
    opacity: 1;
    color: #1d4ed8;
    transform: translateY(-.5px);
}
.filter-mode-toggle.is-department .active-mode {
    color: #7c3aed;
}
.filter-mode-toggle.is-department {
    border-color: #ddd6fe;
    background: #faf5ff;
}
.filter-mode-toggle.is-department .material-icons {
    color: #7c3aed;
}

.totals-header-row.hidden {
    display: none !important;
}
.totals-header-row th {
    top: 43px;
    z-index: 3;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    color: #1e293b;
    padding: 8px 12px;
    border-bottom: 1px solid #bfdbfe;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.filter-total-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 28px;
}
.filter-total-title,
.filter-total-employee,
.filter-total-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}
.filter-total-title {
    color: #1e3a8a;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    padding: 4px 8px;
}
.filter-total-employee {
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 4px 8px;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.filter-total-pills {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}
.filter-total-pill {
    color: #334155;
    background: #ffffff;
    border: 1px solid #dbeafe;
    padding: 4px 8px;
}
.filter-total-pill .material-icons,
.filter-total-title .material-icons,
.filter-total-employee .material-icons {
    font-size: 13px;
    color: #2563eb;
}
.filter-total-pill strong {
    color: #0f172a;
    font-weight: 900;
}

@media (max-width: 900px) {
    .totals-header-row th { top: 40px; }
    .filter-total-bar { align-items: flex-start; }
    .filter-total-employee { max-width: 85vw; }
}

/* V20 — Card de resumo operacional no lugar dos pills do cabeçalho */
.summary-card {
    margin: 14px 0 16px;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 14px 32px rgba(30, 58, 138, 0.08);
}

.summary-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.summary-card-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
}

.summary-card-header h4 .material-icons {
    color: #2563eb;
    font-size: 21px;
}

.summary-card-header p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.summary-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #1e3a8a;
    color: #ffffff;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(30, 58, 138, 0.16);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    padding: 10px 12px;
}

.summary-item .material-icons {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 20px;
}

.summary-item small {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
    margin-bottom: 2px;
}

.summary-item strong {
    display: block;
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.1;
}

.summary-item--highlight {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.summary-item--highlight .material-icons {
    background: #dbeafe;
    color: #1d4ed8;
}

@media (max-width: 720px) {
    .summary-card { padding: 14px; border-radius: 16px; }
    .summary-card-header { flex-direction: column; }
    .summary-badge { align-self: flex-start; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 460px) {
    .summary-grid { grid-template-columns: 1fr; }
}

/* V21 — resumo sob demanda, toggle segmentado realista e ordenação de colunas */
.app-bar-brand h2 {
    font-size: 19px;
    letter-spacing: .2px;
}
.app-bar-brand p {
    color: #bfdbfe;
    letter-spacing: .01em;
}
.app-bar-icon {
    background: rgba(255,255,255,.14);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}

.filter-mode-toggle--segmented {
    position: relative;
    width: 286px;
    min-height: 38px;
    padding: 3px;
    gap: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.9), 0 8px 18px rgba(15,23,42,.06);
    overflow: hidden;
    color: #64748b;
}
.filter-mode-toggle--segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.filter-mode-pill {
    position: relative;
    z-index: 2;
    flex: 1 1 50%;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 900;
    color: #64748b;
    transition: color .22s ease, transform .22s ease;
}
.filter-mode-pill .material-icons {
    font-size: 15px;
    color: currentColor;
}
.filter-mode-knob {
    position: absolute;
    z-index: 1;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 8px 18px rgba(37,99,235,.22);
    transition: transform .25s cubic-bezier(.2,.8,.2,1), background .25s ease;
}
.filter-mode-toggle--segmented .active-mode {
    color: #ffffff;
    opacity: 1;
    transform: none;
}
.filter-mode-toggle--segmented.is-department {
    background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
    border-color: #ddd6fe;
}
.filter-mode-toggle--segmented.is-department .filter-mode-knob {
    transform: translateX(100%);
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    box-shadow: 0 8px 18px rgba(124,58,237,.22);
}
.filter-mode-toggle--segmented.is-department .active-mode {
    color: #ffffff;
}

.summary-card--collapsible {
    padding: 0;
    overflow: hidden;
}
.summary-card--collapsible[open] {
    padding-bottom: 16px;
}
.summary-card-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    user-select: none;
}
.summary-card-summary::-webkit-details-marker { display: none; }
.summary-card-summary::after {
    content: 'expand_more';
    font-family: 'Material Icons';
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 21px;
    transition: transform .2s ease;
    flex: 0 0 auto;
}
.summary-card--collapsible[open] .summary-card-summary::after {
    transform: rotate(180deg);
}
.summary-card-summary h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
}
.summary-card-summary h4 .material-icons {
    color: #2563eb;
    font-size: 21px;
}
.summary-card-summary p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}
.summary-card--collapsible .summary-grid {
    padding: 0 16px;
}

.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background .18s ease;
}
.sortable-th:hover {
    background-color: #1d4ed8;
}
.sortable-th::after {
    content: 'unfold_more';
    font-family: 'Material Icons';
    font-size: 15px;
    margin-left: 6px;
    opacity: .55;
    vertical-align: -3px;
}
.sortable-th.sort-active::after {
    content: 'arrow_upward';
    opacity: 1;
}
.sortable-th.sort-active.sort-desc::after {
    content: 'arrow_downward';
}
.sortable-th.sort-active {
    background-color: #1d4ed8;
    box-shadow: inset 0 -3px 0 #bfdbfe;
}

@media (max-width: 720px) {
    .filter-mode-toggle--segmented { width: 100%; }
    .summary-card-summary { align-items: flex-start; }
}

/* V23 — filtro triplo, seleção múltipla por escala e HR somente revezamento */
.filter-mode-toggle--triple {
    width: 438px;
}
.filter-mode-toggle--triple .filter-mode-pill {
    flex: 1 1 33.333%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}
.filter-mode-toggle--triple .filter-mode-knob {
    width: calc(33.333% - 3px);
}
.filter-mode-toggle--triple.is-employee .filter-mode-knob {
    transform: translateX(0%);
    background: linear-gradient(135deg, #2563eb, #4f46e5);
}
.filter-mode-toggle--triple.is-department .filter-mode-knob {
    transform: translateX(100%);
    background: linear-gradient(135deg, #7c3aed, #9333ea);
}
.filter-mode-toggle--triple.is-scale {
    background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
    border-color: #fed7aa;
}
.filter-mode-toggle--triple.is-scale .filter-mode-knob {
    transform: translateX(200%);
    background: linear-gradient(135deg, #ea580c, #f97316);
    box-shadow: 0 8px 18px rgba(234,88,12,.22);
}
.filter-mode-toggle--triple.is-scale .active-mode,
.filter-mode-toggle--triple.is-department .active-mode,
.filter-mode-toggle--triple.is-employee .active-mode {
    color: #ffffff;
}
#boxFiltroEscala select[multiple] {
    min-width: 340px;
    height: 78px;
    padding: 7px 10px;
}
#boxFiltroEscala select[multiple] option {
    padding: 5px 7px;
    border-radius: 6px;
}
.hr-export-toggles {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.format-toggle--revezamento .format-slider {
    background: #64748b;
}
.format-toggle--revezamento input:checked + .format-slider {
    background: #ea580c;
}

@media (max-width: 900px) {
    .filter-mode-toggle--triple { width: 100%; }
    .filter-mode-pill { font-size: 10.5px; gap: 4px; }
    #boxFiltroEscala select[multiple] { width: 100%; min-width: 0; }
}

/* V24 — filtros múltiplos responsivos, AppBar icon-only e reset/home */
.app-title-home {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0 8px 0 0;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: rgba(255,255,255,.14);
    color: #dbeafe;
    cursor: pointer;
    vertical-align: middle;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.app-title-home:hover {
    background: rgba(255,255,255,.22);
    transform: translateY(-1px) rotate(-2deg);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.24), 0 8px 18px rgba(15,23,42,.18);
}
.app-title-home .app-title-icon { margin: 0; color: inherit; }

.btn-appbar-icon {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    gap: 0;
}
.btn-appbar-icon .btn-label { display: none; }
.btn-appbar-icon .material-icons { font-size: 19px; }
#btnResetFiltros {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.18);
}
#btnResetFiltros:hover:not(:disabled) {
    background: rgba(245,158,11,.25);
    border-color: rgba(253,230,138,.38);
}
.top-upload {
    min-height: 42px;
}
.top-upload .file-status {
    font-size: 12px;
    max-width: 210px;
}

.filter-box {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
}
.filter-mode-toggle--triple {
    flex: 0 0 438px;
    margin-top: 2px;
}
.filter-select-label {
    flex: 1 1 520px;
    min-width: min(520px, 100%);
    align-items: flex-start;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 20px rgba(15,23,42,.04);
}
.filter-select-label select,
#boxFiltroEscala select[multiple],
#boxFiltroEmpregado select[multiple],
#boxFiltroDepartamento select[multiple] {
    width: 100%;
    min-width: 0;
    min-height: 152px;
    height: 152px;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 12.5px;
    line-height: 1.35;
}
.filter-select-label select option {
    padding: 7px 8px;
    border-radius: 7px;
}
.filter-select-label .material-icons {
    margin-top: 10px;
    flex: 0 0 auto;
}
#boxFiltroEmpregado.hidden,
#boxFiltroDepartamento.hidden,
#boxFiltroEscala.hidden,
.filter-select-label.hidden {
    display: none !important;
}

@media (max-width: 1180px) {
    .filter-box {
        flex-wrap: wrap;
    }
    .filter-mode-toggle--triple {
        flex: 1 1 100%;
        width: 100%;
    }
    .filter-select-label {
        flex: 1 1 100%;
        min-width: 0;
    }
}

@media (max-width: 760px) {
    .app-bar {
        gap: 10px;
    }
    .app-bar-brand {
        width: 100%;
    }
    .app-bar-brand h2 {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 15px;
        line-height: 1.15;
    }
    .app-title-home {
        width: 34px;
        height: 34px;
        margin-right: 4px;
        border-radius: 12px;
        flex: 0 0 auto;
    }
    .app-bar-actions--upload {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
    }
    .top-upload {
        flex: 1 0 auto;
        min-width: 210px;
        justify-content: space-between;
    }
    .top-upload .file-status {
        max-width: 140px;
    }
    .btn-appbar-icon,
    .btn-icon-search {
        flex: 0 0 38px;
    }
    .filter-mode-toggle--triple {
        min-width: 0;
    }
    .filter-mode-pill {
        font-size: 0;
        gap: 0;
    }
    .filter-mode-pill .material-icons {
        font-size: 18px;
    }
    .filter-select-label select,
    #boxFiltroEscala select[multiple],
    #boxFiltroEmpregado select[multiple],
    #boxFiltroDepartamento select[multiple] {
        min-height: 180px;
        height: 180px;
        font-size: 12px;
    }
}

/* V25 — refinamentos de filtros, busca flutuante e estatísticas */
.app-bar-actions--upload {
    gap: 10px;
}
.top-toggle--compact {
    padding: 6px 10px !important;
    gap: 6px !important;
    font-size: 11px !important;
    min-height: 34px;
}
.top-toggle--compact .control-icon { font-size: 16px !important; }
.top-toggle--compact .compact-toggle { transform: scale(.86); transform-origin: center; }
.btn-process .material-icons { font-size: 21px; }
.table-header-actions--filters-only {
    justify-content: center;
    align-items: stretch;
    padding: 10px 12px 14px;
}
.table-header-actions--filters-only .filter-box {
    width: min(1380px, 100%);
    margin: 0 auto;
}
.filter-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}
.filter-box.hidden { display: none !important; }
.filter-mode-toggle--triple {
    flex: 0 0 min(460px, 34vw);
}
.filter-select-label {
    position: relative;
    flex: 1 1 760px;
    min-width: 380px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 16px;
    background: rgba(248, 250, 252, .96);
    border: 1px solid rgba(148, 163, 184, .25);
}
.filter-select-label.hidden { display: none !important; }
.filter-select-label > .material-icons {
    color: #2563eb;
    font-size: 18px;
    flex: 0 0 auto;
}
.select-summary-button {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, .45);
    background: #fff;
    border-radius: 13px;
    padding: 8px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    color: #0f172a;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.select-summary-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    font-size: 12px;
}
.select-summary-count {
    font-size: 10px;
    font-weight: 800;
    color: #2563eb;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .08);
    border: 1px solid rgba(37, 99, 235, .16);
    white-space: nowrap;
}
.filter-select-label select[multiple] {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 38px;
    right: 10px;
    width: calc(100% - 48px);
    min-height: 260px;
    max-height: 420px;
    z-index: 80;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, .3);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
    background: #fff;
    padding: 8px;
    overflow: auto;
}
.filter-select-label.open select[multiple] { display: block; }
.filter-select-label.open .select-summary-button .material-icons { transform: rotate(180deg); }
.filter-select-label select option {
    padding: 8px 10px;
    white-space: normal;
    line-height: 1.3;
    border-radius: 8px;
}

.floating-search {
    position: fixed;
    right: 22px;
    bottom: 72px;
    z-index: 110;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 64, 175, .95);
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 999px;
    padding: 8px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.floating-search.hidden { display: none !important; }
.floating-search .btn-icon-search {
    width: 42px;
    height: 42px;
}
.floating-search .search-input {
    width: min(520px, calc(100vw - 120px));
    min-height: 42px;
    border-radius: 999px;
}
.floating-search:not(.search-shell--open) {
    padding: 6px;
}
.floating-search:not(.search-shell--open) .btn-icon-search {
    width: 48px;
    height: 48px;
}

.stats-page {
    padding: 24px 18px 96px;
}
.stats-page.hidden { display: none !important; }
.stats-page-card {
    width: min(1480px, 100%);
    margin: 0 auto;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, .25);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .1);
    padding: 22px;
}
.stats-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.stats-page-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
}
.stats-page-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}
.stats-controls {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    margin-bottom: 16px;
}
.stats-mode {
    border: none;
    background: transparent;
    border-radius: 999px;
    padding: 9px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    color: #475569;
}
.stats-mode.active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .25);
}
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.stats-table-wrapper {
    overflow: auto;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}
.stats-table th {
    position: sticky;
    top: 0;
    background: #1d4ed8;
    color: #fff;
    font-size: 12px;
    padding: 10px;
    text-align: left;
}
.stats-table td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12px;
}
.stats-table tr:nth-child(even) td { background: #f8fafc; }

@media (max-width: 1100px) {
    .filter-box { flex-wrap: wrap; }
    .filter-mode-toggle--triple { flex: 1 1 100%; }
    .filter-select-label { min-width: 100%; }
    .stats-page-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
    .floating-search { right: 12px; bottom: 78px; }
    .filter-select-label select[multiple] { left: 8px; right: 8px; width: calc(100% - 16px); }
    .select-summary-button { grid-template-columns: minmax(0,1fr) auto; }
    .select-summary-count { display: none; }
}

/* V26 - Home limpa, toggle imediato e multiselect amplo */
body:not(.has-data) .table-wrapper,
body:not(.has-data) .summary-card,
body:not(.has-data) .table-header-actions {
    display: none !important;
}
body.has-data .empty-home-state { display: none !important; }
.empty-home-state {
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 5vw, 64px);
    overflow: hidden;
}
.empty-start--clean {
    max-width: 1040px;
    width: 100%;
    padding: clamp(18px, 3vw, 36px);
    border-radius: 28px;
    background: radial-gradient(circle at top, rgba(219,234,254,.86), #ffffff 58%);
    border: 1px solid rgba(191, 219, 254, .9);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .08);
}
.empty-grid--wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.empty-card strong {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #1e3a8a;
}
.empty-card .material-icons,
.empty-note .material-icons {
    font-size: 17px;
    vertical-align: middle;
}
.empty-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}
.table-container-card { overflow: visible; }
.filter-box { width: 100%; }
.filter-select-label {
    flex: 1 1 auto;
    min-width: min(760px, 62vw);
    max-width: none;
    overflow: visible;
}
.filter-select-label select[multiple] {
    left: 10px !important;
    right: auto !important;
    width: min(920px, calc(100vw - 80px)) !important;
    min-width: min(780px, calc(100vw - 80px));
    max-height: min(52vh, 520px);
    overflow-x: hidden;
}
.filter-select-label select option {
    white-space: normal !important;
    overflow-wrap: anywhere;
    line-height: 1.35;
    padding: 10px 12px;
}
.top-toggle--compact {
    font-size: 10px !important;
    padding: 5px 8px !important;
    min-height: 30px;
}
.top-toggle--compact span:not(.material-icons) { max-width: 64px; }
.top-toggle--compact .compact-toggle { transform: scale(.78); }
@media (max-width: 1100px) {
    body { overflow: auto; }
    .empty-grid--wide { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .filter-box { flex-wrap: wrap; }
    .filter-mode-toggle--triple { flex: 1 1 100%; }
    .filter-select-label { min-width: 100%; }
    .filter-select-label select[multiple] { width: calc(100vw - 48px) !important; min-width: 0; }
}
@media (max-width: 640px) {
    .empty-grid--wide { grid-template-columns: 1fr; }
    .empty-start--clean { padding: 18px; }
}

/* V27 — lupa flutuante mais discreta quando não está em uso */
.floating-search:not(:hover):not(:focus-within):not(.search-shell--open) {
    opacity: .42;
    transform: translateY(2px) scale(.94);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .16);
}
.floating-search {
    transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.floating-search:hover,
.floating-search:focus-within,
.floating-search.search-shell--open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* V28 — correção de rolagem vertical da tabela processada
   Mantém AppBar e rodapé fixos, evita rolagem do body e entrega o scroll para a área da tabela. */
html,
body {
    height: 100%;
}

body.has-data {
    overflow: hidden !important;
}

body.has-data .main-container--full {
    height: calc(100vh - 65px - 38px);
    min-height: 0;
    overflow: hidden !important;
}

body.has-data .content-area--full {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

body.has-data .table-container-card {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

body.has-data .table-header-actions,
body.has-data .summary-card {
    flex: 0 0 auto;
}

body.has-data .table-wrapper {
    flex: 1 1 auto;
    min-height: 260px;
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

body.has-data .table-wrapper table {
    min-width: max-content;
}

body.has-data .table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 6;
}

@media (max-width: 1100px) {
    body.has-data {
        overflow: hidden !important;
    }

    body.has-data .main-container--full {
        height: calc(100vh - 65px - 50px);
    }

    body.has-data .table-wrapper {
        min-height: 220px;
    }
}

/* V29 - refinamentos de responsividade, contraste e exportação HR */
.filter-mode-toggle--triple {
    background: rgba(236, 253, 245, .72) !important;
    border-color: rgba(16, 185, 129, .28) !important;
}
.filter-mode-toggle--triple .filter-mode-knob {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 12px 28px rgba(5, 150, 105, .24) !important;
}
.filter-mode-toggle--triple.is-scale {
    border-color: rgba(16, 185, 129, .42) !important;
    box-shadow: 0 10px 28px rgba(16, 185, 129, .10) !important;
}
.filter-mode-toggle--triple.is-scale .filter-mode-knob {
    background: linear-gradient(135deg, #34d399, #059669) !important;
}
.filter-mode-toggle--triple .active-mode,
.filter-mode-toggle--triple .active-mode .material-icons {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(6, 78, 59, .24);
}
.filter-mode-pill:not(.active-mode) {
    color: #334155 !important;
}
.filter-mode-pill:not(.active-mode) .material-icons {
    color: #64748b !important;
}
.filter-select-label {
    align-self: stretch;
    min-width: min(880px, 66vw) !important;
    flex: 1 1 min(920px, 66vw) !important;
    padding: 8px 12px !important;
}
.select-summary-button {
    min-height: 48px !important;
    border-radius: 16px !important;
}
.filter-select-label select[multiple] {
    width: min(1180px, calc(100vw - 96px)) !important;
    min-width: min(980px, calc(100vw - 96px)) !important;
    max-height: min(62vh, 620px) !important;
    padding: 10px !important;
    font-size: 13px;
    scrollbar-gutter: stable;
}
.filter-select-label select option {
    min-height: 36px;
    padding: 10px 14px !important;
    border-radius: 10px !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
}
.hr-export-action-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 240px;
}
.hr-export-notice {
    display: inline-flex;
    align-items: flex-start;
    gap: 7px;
    max-width: 360px;
    padding: 9px 11px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 11.5px;
    line-height: 1.35;
    font-weight: 700;
}
.hr-export-notice.hidden { display: none !important; }
.hr-export-notice .material-icons { font-size: 16px; }
.btn-export-action:disabled {
    opacity: .48;
    cursor: not-allowed;
    filter: grayscale(.15);
    box-shadow: none !important;
}
.btn-process {
    background: linear-gradient(135deg, #0ea5e9, #2563eb) !important;
}

@media (min-width: 1280px) {
    .filter-box {
        display: grid !important;
        grid-template-columns: minmax(420px, 520px) minmax(720px, 1fr);
        align-items: center;
    }
    .filter-mode-toggle--triple,
    .filter-select-label {
        width: 100%;
        min-width: 0 !important;
    }
}
@media (max-width: 1279px) {
    .filter-select-label {
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }
    .filter-select-label select[multiple] {
        width: calc(100vw - 48px) !important;
        min-width: 0 !important;
    }
}

/* V30 - visão essencial da tabela, selectbox responsivo e ajustes mobile */
.table-view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 16px;
    border: 1px solid rgba(191, 219, 254, .95);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
    color: #1e3a8a;
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
}
.table-view-toggle.hidden { display: none !important; }
.table-view-toggle > .material-icons { font-size: 18px; color: #2563eb; }
.table-view-label--compact { color: #059669; }

/* Tabela essencial: mantém somente Matricula | Nome | Data / Dia | Tipo de Escala | Total Intervalo | Horas Trabalhadas | Intrajornada | Ajuda de Custo */
.table-wrapper--compact-view table th:nth-child(5),
.table-wrapper--compact-view table th:nth-child(6),
.table-wrapper--compact-view table th:nth-child(7),
.table-wrapper--compact-view table th:nth-child(8),
.table-wrapper--compact-view table th:nth-child(9),
.table-wrapper--compact-view table th:nth-child(10),
.table-wrapper--compact-view table th:nth-child(11),
.table-wrapper--compact-view table th:nth-child(12),
.table-wrapper--compact-view table th:nth-child(15),
.table-wrapper--compact-view table th:nth-child(16),
.table-wrapper--compact-view table th:nth-child(19),
.table-wrapper--compact-view table th:nth-child(20),
.table-wrapper--compact-view table td:nth-child(5),
.table-wrapper--compact-view table td:nth-child(6),
.table-wrapper--compact-view table td:nth-child(7),
.table-wrapper--compact-view table td:nth-child(8),
.table-wrapper--compact-view table td:nth-child(9),
.table-wrapper--compact-view table td:nth-child(10),
.table-wrapper--compact-view table td:nth-child(11),
.table-wrapper--compact-view table td:nth-child(12),
.table-wrapper--compact-view table td:nth-child(15),
.table-wrapper--compact-view table td:nth-child(16),
.table-wrapper--compact-view table td:nth-child(19),
.table-wrapper--compact-view table td:nth-child(20) {
    display: none !important;
}
.table-wrapper--compact-view table { min-width: 980px !important; }

/* O dropdown fica um pouco menor que a caixa principal e centralizado abaixo dela */
.filter-select-label.open select[multiple] {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: min(calc(100% - 36px), 980px, calc(100vw - 56px)) !important;
    min-width: min(620px, calc(100vw - 56px)) !important;
    max-width: calc(100vw - 56px) !important;
    max-height: min(56vh, 520px) !important;
    overflow-x: hidden !important;
}

.table-wrapper,
.stats-table-wrapper,
.empty-grid,
.empty-start,
.table-container-card {
    touch-action: pan-x pan-y;
}
.table-wrapper,
.stats-table-wrapper {
    overscroll-behavior: contain;
}

@media (min-width: 1280px) {
    .filter-box {
        grid-template-columns: minmax(420px, 500px) minmax(560px, 1fr) minmax(220px, max-content);
        gap: 12px;
    }
    .filter-select-label.open select[multiple] {
        width: min(calc(100% - 30px), 960px) !important;
        min-width: min(620px, calc(100vw - 64px)) !important;
    }
}

@media (max-width: 900px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }
    .app-bar {
        position: sticky;
        top: 0;
        z-index: 20;
        gap: 8px;
    }
    .app-bar-brand h2 { font-size: 15px; }
    .app-bar-brand p { font-size: 10px; }
    .main-container--full {
        padding: 8px;
    }
    body.has-data .main-container--full {
        height: calc(100dvh - 62px - 42px);
    }
    .table-header-actions--filters-only {
        padding: 8px;
        overflow: visible;
    }
    .filter-box {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    .filter-mode-toggle--triple {
        width: 100%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .filter-mode-pill {
        min-width: 110px;
        flex: 1 0 110px;
    }
    .filter-select-label {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }
    .select-summary-button {
        width: 100%;
        min-width: 0;
    }
    .select-summary-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .filter-select-label.open select[multiple] {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        bottom: 70px !important;
        transform: none !important;
        width: calc(100vw - 24px) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 24px) !important;
        max-height: 48dvh !important;
        z-index: 60;
        -webkit-overflow-scrolling: touch;
    }
    .table-view-toggle {
        width: 100%;
        justify-content: space-between;
    }
    .empty-start--clean {
        width: 100%;
        max-height: calc(100dvh - 150px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .empty-grid--wide {
        display: flex;
        grid-template-columns: none !important;
        overflow-x: auto;
        gap: 12px;
        padding: 4px 2px 12px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .empty-card {
        min-width: 260px;
        scroll-snap-align: start;
    }
    body.has-data .table-wrapper {
        min-height: 0;
        height: 100%;
        max-height: none;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    body.has-data .table-wrapper table {
        min-width: 1500px;
    }
    body.has-data .table-wrapper--compact-view table {
        min-width: 900px !important;
    }
    .floating-search {
        right: 10px;
        bottom: 58px;
    }
    .floating-search.search-shell--open {
        left: 10px;
        right: 10px;
        width: auto;
    }
    .floating-search.search-shell--open .search-input {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .filter-mode-pill {
        min-width: 88px;
        font-size: 0;
        justify-content: center;
    }
    .filter-mode-pill .material-icons {
        margin: 0;
        font-size: 20px;
    }
    .table-view-toggle {
        font-size: 10.5px;
        padding: 8px 10px;
    }
    .empty-card { min-width: 230px; }
}
