/* --- ESTILOS ESPECÍFICOS DA CALCULADORA PRÓ-LABORE --- */

.nav-tab-active {
    background-color: #4f46e5;
    color: white;
    border-bottom: 4px solid #312e81;
}

.nav-tab-inactive {
    background-color: white;
    color: #4b5563;
    border-bottom: 4px solid transparent;
}

.nav-tab-inactive:hover {
    background-color: #f3f4f6;
    color: #111827;
}

/* Estilos Escopados Pró-Labore */
#app-prolabore {
    --pl-primary-color: #0d47a1;
    --pl-accent-color: #1976d2;
    --pl-success-color: #2e7d32;
    --pl-bg-color: #e3f2fd;
    --pl-card-bg: #ffffff;
    --pl-text-color: #2c3e50;
    --pl-border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--pl-bg-color);
    color: var(--pl-text-color);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 80px);
}

#app-prolabore .container-pl {
    background-color: var(--pl-card-bg);
    width: 100%;
    max-width: 800px;
    padding: 30px;
    border-radius: var(--pl-border-radius);
    box-shadow: 0 4px 15px rgba(13, 71, 161, 0.15);
    border-top: 5px solid var(--pl-accent-color);
}

#app-prolabore h1 {
    text-align: center;
    color: var(--pl-primary-color);
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: bold;
}

#app-prolabore p.subtitle {
    text-align: center;
    color: #546e7a;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

#app-prolabore .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

#app-prolabore .form-group {
    margin-bottom: 0;
}

#app-prolabore label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--pl-primary-color);
    font-size: 0.9rem;
}

#app-prolabore input[type="number"] {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #90caf9;
    border-radius: var(--pl-border-radius);
    box-sizing: border-box;
    background-color: #fbfdff;
    transition: border-color 0.3s, box-shadow 0.3s;
    display: block;
}

#app-prolabore input[type="number"]:focus {
    border-color: var(--pl-accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

#app-prolabore .helper-text {
    font-size: 0.75rem;
    color: #78909c;
    margin-top: 5px;
}

#app-prolabore button.btn-pl {
    width: 100%;
    padding: 15px;
    background-color: var(--pl-accent-color);
    color: white;
    border: none;
    border-radius: var(--pl-border-radius);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

#app-prolabore button.btn-pl:hover {
    background-color: #1565c0;
}

#app-prolabore #resultado-pl {
    margin-top: 30px;
    display: none;
    animation: fadeIn 0.5s ease;
}

#app-prolabore .comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#app-prolabore .result-card {
    border: 1px solid #e1f5fe;
    border-radius: var(--pl-border-radius);
    padding: 20px;
    background-color: #fff;
    position: relative;
}

#app-prolabore .result-card.best-option {
    border: 2px solid var(--pl-success-color);
    background-color: #f1f8e9;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.1);
}

#app-prolabore .best-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background-color: var(--pl-success-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    display: none;
}

#app-prolabore .result-card.best-option .best-badge {
    display: block;
}

#app-prolabore .card-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--pl-primary-color);
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

#app-prolabore .result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.9rem;
    align-items: center;
}

#app-prolabore .result-row:last-of-type {
    border-bottom: none;
}

#app-prolabore .result-label {
    color: #555;
}

#app-prolabore .result-value {
    font-weight: 600;
    color: #333;
}

#app-prolabore .negative-value {
    color: #c62828;
}

#app-prolabore .base-highlight-row {
    background-color: #fff3e0;
    border: 1px solid #ffe0b2;
    padding: 12px 10px;
    margin: 10px 0;
    border-radius: 6px;
}

#app-prolabore .base-highlight-row .result-label {
    color: #ef6c00;
    font-weight: bold;
    font-size: 0.95rem;
    text-transform: uppercase;
}

#app-prolabore .base-highlight-row .result-value {
    color: #e65100;
    font-weight: bold;
    font-size: 1.1rem;
}

#app-prolabore .total-highlight {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 2px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#app-prolabore .total-highlight .result-label {
    font-size: 1rem;
    font-weight: bold;
    color: var(--pl-primary-color);
}

#app-prolabore .total-highlight .result-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--pl-primary-color);
}

#app-prolabore .result-card.best-option .total-highlight .result-value {
    color: var(--pl-success-color);
}

#app-prolabore .error-msg {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: var(--pl-border-radius);
    margin-bottom: 15px;
    display: none;
    text-align: center;
    font-weight: bold;
    border: 1px solid #ffcdd2;
}

#app-prolabore .reference-table-container {
    margin-top: 30px;
    border-top: 2px solid #ecf0f1;
    padding-top: 20px;
}

#app-prolabore .reference-title {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    cursor: pointer;
    text-decoration: underline;
    text-align: center;
}

#app-prolabore .reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 10px;
    display: none;
    margin-left: auto;
    margin-right: auto;
}

#app-prolabore .reference-table th,
#app-prolabore .reference-table td {
    border: 1px solid #e0e0e0;
    padding: 8px;
    text-align: left;
}

#app-prolabore .reference-table th {
    background-color: #f4f6f7;
    color: var(--pl-primary-color);
}

#app-prolabore .reference-table tr:nth-child(even) {
    background-color: #fafafa;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    #app-prolabore .form-grid {
        grid-template-columns: 1fr;
    }

    #app-prolabore .comparison-container {
        grid-template-columns: 1fr;
    }

    #app-prolabore h1 {
        font-size: 1.5rem;
    }
}


/* --- NOVA SEÇÃO ADICIONAIS --- */
.adicionais-wrapper {
    --primary: #4f46e5;
    /* Indigo-600 */
    --primary-dark: #4338ca;
    /* Indigo-700 */
    --danger: #dc2626;
    /* Red-600 */
    --bg: #f9fafb;
    /* Gray-50 */
    --card-bg: #ffffff;
    --border: #e5e7eb;
    /* Gray-200 */
    --text-main: #1f2937;
    /* Gray-800 */
    --text-muted: #6b7280;
    /* Gray-500 */
}

.adicionais-wrapper .grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.adicionais-wrapper .subcard {
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    padding: 1rem;
    background: #fff;
}

.adicionais-wrapper .subcard h3 {
    font-size: 0.96rem;
    margin: 0 0 0.75rem;
    font-weight: 600;
    color: var(--text-main);
}

.adicionais-wrapper .field-row {
    margin-bottom: 0.5rem;
    font-size: 0.86rem;
}

.adicionais-wrapper .small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.adicionais-wrapper input[type="text"],
.adicionais-wrapper input[type="number"],
.adicionais-wrapper select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.adicionais-wrapper input:focus,
.adicionais-wrapper select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.25);
}

.adicionais-wrapper label {
    font-size: 0.875rem;
    color: var(--text-main);
    font-weight: 500;
}

.adicionais-wrapper .linha-valores {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) auto auto;
    gap: 0.5rem;
    align-items: center;
}

.adicionais-wrapper .linha-valores-tempo {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
    gap: 0.5rem;
    align-items: center;
}

.adicionais-wrapper .valor-pill {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: var(--primary);
    white-space: nowrap;
    text-align: center;
    font-weight: 600;
}

.adicionais-wrapper .btn-icon {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 4px;
    color: #6b7280;
}

.adicionais-wrapper .btn-icon:hover {
    color: var(--text-main);
}

.adicionais-wrapper .badge {
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    color: var(--primary);
    background: #eef2ff;
    margin-left: 4px;
    vertical-align: middle;
}

.adicionais-wrapper .totais-linha {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    font-size: 0.875rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.adicionais-wrapper .pill-total {
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: var(--text-main);
    font-weight: 600;
}

/* Modal Scoped */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.modal-body {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 1rem;
}

.modal-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.modal-options label {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    cursor: pointer;
    padding: 0.25rem 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    font-weight: 500;
}

.modal-btn.primary {
    border-color: transparent;
    background: #4f46e5;
    color: #fff;
}

.modal-btn.primary:hover {
    background: #4338ca;
}

.modal-btn:hover:not(.primary) {
    background: #f9fafb;
}

/* --- SEÇÃO 5: VERBAS NÃO TRIBUTÁVEIS (ESCOPADO) --- */
.verbas-nt-wrapper {
    /* Reset básico para garantir isolamento */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111827;
}

.verbas-nt-wrapper .card-nt {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 18px 18px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    width: 100%;
    margin-bottom: 24px;
}

.verbas-nt-wrapper .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 4px;
}

.verbas-nt-wrapper .card-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 16px;
}

.verbas-nt-wrapper .badge-nt {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    background: #eff6ff;
    margin-left: 8px;
    font-weight: 500;
    vertical-align: middle;
}

.verbas-nt-wrapper .grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.verbas-nt-wrapper h3 {
    font-size: 1rem;
    margin: 0 0 8px;
    font-weight: 600;
    color: #111827;
}

.verbas-nt-wrapper .small {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 8px;
}

.verbas-nt-wrapper .dynamic-list {
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 12px;
    background: #f9fafb;
    margin-bottom: 12px;
    min-height: 50px;
}

.verbas-nt-wrapper .row-fixo {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.verbas-nt-wrapper .percent-row {
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;
    background: #ffffff;
}

.verbas-nt-wrapper .percent-row-main {
    display: grid;
    grid-template-columns: 2fr 0.8fr 1.2fr auto auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.verbas-nt-wrapper input[type="text"],
.verbas-nt-wrapper input[type="number"] {
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    width: 100%;
    box-sizing: border-box;
}

.verbas-nt-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.verbas-nt-wrapper .btn-nt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 6px;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.verbas-nt-wrapper .btn-nt:hover {
    background: #1d4ed8;
}

.verbas-nt-wrapper .remove-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.75rem;
    color: #ef4444;
    text-decoration: underline;
}

.verbas-nt-wrapper .btn-icon {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    color: #6b7280;
}

.verbas-nt-wrapper .value-pill {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 9999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
    text-align: center;
    white-space: nowrap;
    font-weight: 600;
}

.verbas-nt-wrapper .base-label {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 4px;
}

.verbas-nt-wrapper .totals {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #d1d5db;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.verbas-nt-wrapper .pill {
    font-size: 0.875rem;
    padding: 4px 12px;
    border-radius: 9999px;
    font-weight: bold;
}

.verbas-nt-wrapper .pill.green {
    background: #dcfce7;
    color: #166534;
}

.verbas-nt-wrapper .pill.red {
    background: #fee2e2;
    color: #991b1b;
}

.verbas-nt-wrapper .pill.neutral {
    background: #f3f4f6;
    color: #374151;
}

.verbas-nt-wrapper .footer-note {
    margin-top: 16px;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

/* Modal específicas para NT se necessário, ou reutilizar as existentes */
#modal-nt-backdrop {
    z-index: 10000;
}

/* Quadro Resumo - Enhanced Styling */
#resumo_total_proventos,
#resumo_total_descontos {
    font-size: 1.125rem !important;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    min-width: 120px;
    text-align: right;
    display: inline-block;
}

#resumo_total_proventos {
    background-color: #d1fae5;
    color: #065f46 !important;
}

#resumo_total_descontos {
    background-color: #fee2e2;
    color: #991b1b !important;
}

#resumo_salario_liquido {
    font-size: 1.5rem !important;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border-radius: 0.5rem;
    min-width: 140px;
    text-align: right;
    display: inline-block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#resumo_fgts_valor {
    font-size: 1.125rem !important;
    padding: 0.5rem 0.75rem;
    background-color: #fef3c7;
    color: #92400e !important;
    border-radius: 0.375rem;
    min-width: 100px;
    text-align: right;
    display: inline-block;
}

.valor-pill {
    min-width: 100px;
    text-align: right;
    padding: 0.375rem 0.75rem;
    display: inline-block;
}

/* Destaques para descontos detalhados (INSS, IRRF, Faltas) */
#resumo_desc_inss,
#resumo_desc_irrf,
#resumo_desc_faltas {
    font-weight: 600 !important;
    padding: 0.25rem 0.5rem;
    background-color: #fef2f2;
    color: #991b1b !important;
    border-radius: 0.25rem;
    min-width: 80px;
    text-align: right;
    display: inline-block;
    border-left: 3px solid #dc2626;
}

/* Destaques para bases informativas */
#resumo_base_inss,
#resumo_base_irrf {
    font-weight: 600 !important;
    padding: 0.25rem 0.5rem;
    background-color: #eff6ff;
    color: #1e40af !important;
    border-radius: 0.25rem;
    min-width: 90px;
    text-align: right;
    display: inline-block;
}

/* Enhanced spacing for main calculator inputs */
#app-clt input[type="number"],
#app-clt select {
    padding: 0.625rem 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
}

/* Enhanced spacing for output values */
.output-currency-bold {
    font-size: 0.95rem !important;
    padding: 0.5rem 0.75rem;
    background-color: #f0fdf4;
    color: #166534 !important;
    border-radius: 0.375rem;
    display: inline-block;
    font-weight: 700 !important;
}

/* Better spacing for HE and other calculation sections */
#app-clt .space-y-4 input[type="number"] {
    padding: 0.625rem 0.75rem !important;
    font-size: 0.875rem !important;
}

/* Enhanced output spans */
#app-clt span[id^="out_"] {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
}

/* Specific fix for Tempo Serviço percentage input */
#tempo-servico-percent {
    font-size: 0.875rem !important;
    padding: 0.625rem 0.75rem !important;
}

/* Vertical layout for Tempo Serviço */
.linha-valores-tempo-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.tempo-servico-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.tempo-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.tempo-servico-field input[type="number"],
.tempo-servico-field select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
}

.tempo-servico-field .valor-pill {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
}

.btn-edit-base {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-edit-base:hover {
    background-color: #e5e7eb;
}

/* Vertical layout for Insalubridade and other adicionais */
.linha-valores-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.adicional-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.adicional-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.adicional-field input[type="number"],
.adicional-field select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
}

.adicional-field .valor-pill {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
}

/* --- ABA HORISTA GRUPO META --- */
#app-horista {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg-page: #f3f4f6;
    --bg-card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;

    --success-bg: #dcfce7;
    --success-text: #166534;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --info-bg: #eff6ff;
    --info-text: #1e40af;
    --warning-bg: #fef9c3;
    --warning-text: #854d0e;
    --neutral-bg: #f9fafb;

    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-page);
    margin: 0;
    padding: 24px;
    color: var(--text-main);
    display: none;
    /* Hidden by default */
}

#app-horista .page {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
}

@media (max-width: 850px) {
    #app-horista .page {
        grid-template-columns: 1fr;
    }
}

#app-horista .span-full {
    grid-column: 1 / -1;
}

/* Header Bar */
#app-horista .header-bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

#app-horista .header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

#app-horista .btn-outline-danger {
    border: 1px solid #ef4444;
    color: #ef4444;
    background: transparent;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

#app-horista .btn-outline-danger:hover {
    background: #fee2e2;
}

#app-horista .card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

#app-horista .section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

#app-horista .section-number {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

#app-horista .section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

#app-horista .section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
    font-weight: 400;
}

#app-horista h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

#app-horista .grid-col-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

#app-horista .grid-col-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

#app-horista .form-group {
    display: flex;
    flex-direction: column;
}

#app-horista .label-sm {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

#app-horista input,
#app-horista select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    height: 42px;
}

#app-horista input:focus,
#app-horista select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#app-horista .stat-box {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--neutral-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 70px;
}

#app-horista .stat-box.success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: transparent;
}

#app-horista .stat-box.danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: transparent;
}

#app-horista .stat-box.info {
    background: var(--info-bg);
    color: var(--info-text);
    border-color: transparent;
}

#app-horista .stat-box.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: transparent;
}

#app-horista .stat-box.primary {
    background: var(--primary);
    color: white;
    border-color: transparent;
    align-items: center;
    text-align: center;
    height: 100%;
}

#app-horista .stat-label {
    font-size: 0.7rem;
    opacity: 0.85;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#app-horista .stat-value {
    font-size: 1.15rem;
    font-weight: 700;
}

#app-horista .stat-value.lg {
    font-size: 1.8rem;
}

#app-horista .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    margin-top: 8px;
}

#app-horista .btn:hover {
    background: var(--primary-dark);
}

#app-horista .btn-add-cat {
    width: 100%;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px dashed #bfdbfe;
    margin-top: 12px;
}

#app-horista .btn-add-cat:hover {
    background: #dbeafe;
    border-color: #1d4ed8;
}

#app-horista .dynamic-list {
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    margin-bottom: 12px;
    min-height: 40px;
}

#app-horista .row-fixo {
    display: grid;
    grid-template-columns: 1.5fr 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

#app-horista .percent-row {
    background: var(--neutral-bg);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
}

#app-horista .percent-row-main {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 1fr auto auto;
    gap: 8px;
    align-items: center;
}

#app-horista .remove-btn {
    background: none;
    border: none;
    color: var(--danger-text);
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
    padding: 0;
}

#app-horista .btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

#app-horista .value-pill {
    background: #e5e7eb;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

#app-horista .totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px dashed var(--border);
    font-weight: 600;
}

#app-horista .pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

#app-horista .pill.green {
    background: var(--success-bg);
    color: var(--success-text);
}

#app-horista .pill.red {
    background: var(--danger-bg);
    color: var(--danger-text);
}

#app-horista .cat-row {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.8fr auto;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 12px;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

@media (max-width: 700px) {
    #app-horista .cat-row {
        grid-template-columns: 1fr;
        gap: 8px;
        border: 1px solid #e5e7eb;
        padding: 12px;
        border-radius: 8px;
    }
}

#app-horista .final-result-bar {
    background: #1e3a8a;
    color: white;
    border-radius: 12px;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

#app-horista .col-full {
    grid-column: 1 / -1;
}

/* Modal Horista */
#h_modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99;
    backdrop-filter: blur(2px);
}

#h_modal-backdrop .modal {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Garantir que hidden sempre oculte o elemento */
.hidden {
    display: none !important;
}