/* =================================================================
   1. VARIÁVEIS GLOBAIS (TEMA ATRON - MODO BLACK - PADRÃO)
   ================================================================= */
:root {
    /* Paleta ATRON */
    --primary-color: #f7b71c;     /* Amarelo/Dourado do Logo */
    --primary-hover: #e0a819;     /* Amarelo mais escuro */
    --secondary-color: #6c757d;   /* Cinza Neutro */
    --secondary-hover: #5a6268;   /* Cinza mais escuro */
    
    --danger-color: #dc3545;
    --danger-hover: #c82333;

    /* Cores do Modo Escuro (Padrão) */
    --text-color: #f8f9fa;        /* Texto (Branco-gelo) */
    --subtle-text: #adb5bd;      /* Texto (Cinza claro) */
    --light-bg: #1a1a1a;          /* Fundo da Página (Quase Preto) */
    --card-bg: #212529;           /* Fundo de Cards/Modais (Cinza Escuro) */
    --table-header-bg: #343a40;   /* Fundo de Cabeçalho de Tabela */
    --table-row-even-bg: #2c3034; /* Fundo de linha par */
    --table-row-hover-bg: #3a3f44; /* Fundo de linha hover */
    --border-color: #444444;      /* Bordas (Cinza Médio) */
    --input-bg: #343a40;          /* Fundo de Inputs */
    
    /* Cores Claras (para referências) */
    --white-color: #ffffff;
    --black-color: #000000;
    --light-gray-bg: #f8f9fa;
    --dark-text-color: #212529; /* Texto escuro para fundos claros */
}

/* =================================================================
   DEFINIÇÕES DO MODO CLARO
   ================================================================= */
body.light-mode {
    --text-color: #212529;        /* Texto (Preto) */
    --subtle-text: #6c757d;      /* Texto (Cinza escuro) */
    --light-bg: #f8f9fa;          /* Fundo da Página (Cinza claro) */
    --card-bg: #ffffff;           /* Fundo de Cards/Modais (Branco) */
    --table-header-bg: #e9ecef;   /* Fundo de Cabeçalho de Tabela */
    --table-row-even-bg: #f9f9f9; /* Fundo de linha par */
    --table-row-hover-bg: #f1f3f5; /* Fundo de linha hover */
    --border-color: #dee2e6;      /* Bordas (Cinza claro) */
    --input-bg: #ffffff;          /* Fundo de Inputs */
}

/* =================================================================
   2. LAYOUT PRINCIPAL
   ================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#start-screen {
    text-align: center;
    padding-top: 10rem;
}
#start-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

main.wide-layout,
section#producao-view {
    max-width: 1600px;
    width: 95%;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--card-bg); 
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: background-color 0.2s ease;
}

.hidden {
    display: none;
}

/* =================================================================
   3. CABEÇALHO (HEADER)
   ================================================================= */
.orcamento-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}
.header-info h1 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}
.header-info p {
    color: var(--subtle-text);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.empresa-selector-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =================================================================
   4. SEÇÃO DE INFORMAÇÕES (CLIENTE / ORÇAMENTO)
   ================================================================= */
.info-display {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.info-column {
    flex: 1;
    min-width: 300px;
}
.info-display-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    height: 100%;
    background-color: var(--light-bg); 
    transition: background-color 0.2s ease;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}
.info-display-card p {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.info-display-card p strong {
    margin-right: 0.5rem;
    color: var(--text-color);
}

/* =================================================================
   5. TABELA DE ITENS (ESTILO "EXCEL")
   ================================================================= */
.table-wrapper {
    width: 100%;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    overflow: visible; 
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle;
}

thead th {
    background-color: var(--table-header-bg);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background-color 0.2s ease;
}

/* Larguras das colunas */
.col-item { width: 5%; }
.col-desc { width: 35%; }
.col-comp, .col-alt, .col-qtd, .col-unid, .col-descPerc { width: 7%; }
.col-vlr { width: 10%; }
.col-total { width: 10%; }
.col-acao { width: 5%; }

tbody tr:nth-child(even) {
    background-color: var(--table-row-even-bg);
}
tbody tr:hover {
    background-color: var(--table-row-hover-bg);
}

/* =================================================================
   6. EDIÇÃO INLINE NA TABELA
   ================================================================= */
.table-wrapper td {
    padding: 0; 
    position: relative;
}
.inline-input,
.inline-desc {
    width: 100%;
    padding: 0.75rem; 
    border: 1px solid transparent;
    border-radius: 0;
    background-color: transparent;
    font: inherit;
    color: inherit; 
    box-sizing: border-box; 
    height: 100%;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.inline-input:focus,
.inline-desc:focus {
    border-color: var(--primary-color);
    background-color: var(--white-color); 
    color: var(--dark-text-color); 
    outline: none;
    box-shadow: 0 0 5px rgba(247, 183, 28, 0.5); 
    position: relative;
    z-index: 11; 
}

/* Alinhamentos */
.inline-input[data-field="comp"],
.inline-input[data-field="alt"],
.inline-input[data-field="qtd"],
.inline-input[data-field="vlr"],
.inline-input[data-field="descPerc"] {
    text-align: right;
}
.inline-input[data-field="unid"] {
    text-align: center;
}

.inline-autocomplete-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
}
.inline-autocomplete-wrapper .inline-desc {
    flex-grow: 1;
}

.inline-autocomplete-wrapper:focus-within {
    z-index: 101;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 350px; 
    z-index: 100;
    background: var(--card-bg); 
    border: 1px solid var(--primary-color); 
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    max-height: 200px;
    overflow-y: auto;
    transition: background-color 0.2s ease;
}
.autocomplete-list li {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color); 
}
.autocomplete-list li:last-child {
    border-bottom: none;
}
.autocomplete-list li:hover {
    background-color: var(--primary-color); 
    color: var(--black-color); 
}

.actions-cell {
    padding: 0.5rem;
    text-align: center;
}

/* =================================================================
   7. BOTÕES E TOTAIS
   ================================================================= */
.add-item-container {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
}

.totals-section {
    margin-top: 2rem;
    width: 100%;
}

.totals-box {
    width: 100%;
    max-width: 450px;
    margin-left: auto;
    margin-right: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--light-bg); 
    transition: background-color 0.2s ease;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.total-row:last-child {
    border-bottom: none;
}
.total-row label {
    font-weight: 500;
    color: var(--subtle-text);
}
.total-row span {
    font-weight: 600;
}
.total-row input,
.total-row select,
.form-select, .form-select-sm {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.total-row input[type="number"] {
    width: 80px;
    text-align: right;
}

.grand-total {
    background-color: var(--table-header-bg);
    transition: background-color 0.2s ease;
}
.grand-total span {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color); 
}

.print-only { display: none; }
.screen-only { display: inline; }

/* =================================================================
   8. COMPONENTES GENÉRICOS (BOTÕES, FORMULÁRIOS, MODAIS)
   ================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
    background-color: var(--primary-color); 
    color: var(--black-color); 
    font-weight: 600;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    color: var(--black-color);
    box-shadow: 0 2px 5px rgba(247, 183, 28, 0.3);
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white-color);
}
.btn-secondary:hover {
    background-color: var(--secondary-hover);
}
.btn-delete {
    background-color: transparent;
    color: var(--danger-color);
    padding: 0.25rem;
}
.btn-delete:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-hover);
}
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--subtle-text);
    padding: 0.25rem;
}
.btn-icon:hover {
    color: var(--primary-color);
}

/* --- Formulários (Modais) --- */
.form-select, .form-select-sm {
    padding: 0.5rem;
}
.form-select {
    width: 100%;
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"] {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg); 
    color: var(--text-color); 
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.form-group input:focus {
    border-color: var(--primary-color);
    background-color: var(--card-bg);
}

.form-grid {
    display: grid;
    gap: 1rem;
}
.form-grid-multi-col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.grid-col-span-1 { grid-column: span 1; }
.grid-col-span-2 { grid-column: span 2; }
.grid-col-span-3 { grid-column: span 3; }
.grid-col-span-4 { grid-column: span 4; }

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Modais (Dinâmicos) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-container {
    background: var(--card-bg); 
    color: var(--text-color); 
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 60rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    border-top: 4px solid var(--primary-color); 
    transform: translateY(-20px);
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.modal-overlay.active .modal-container {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.close-modal {
    font-size: 2rem;
    font-weight: 300;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--subtle-text);
    line-height: 1;
}
.modal-actions {
    margin-top: 1.5rem;
    text-align: right;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.modal-actions div { 
    display: flex;
    gap: 0.5rem;
}
.modal-actions .btn-primary {
    background-color: var(--primary-color);
    color: var(--black-color);
}
.modal-actions .btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white-color);
}
.modal-actions-init {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* --- Seção de Kits (Modal) --- */
.kit-pronto-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem; 
}
.kit-pronto-section legend {
    font-weight: 600;
    padding: 0 0.5rem;
    margin-left: 1rem;
    color: var(--primary-color); 
}
.kit-pronto-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.kit-pronto-controls .form-select {
    flex: 1;
}
hr.separator {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

/* --- Autocomplete do MODAL (Dinâmico) --- */
#modal-step-2 .form-group[style*="grid-column: 1 / -1"] {
    position: relative; 
}
#modal-step-2 #autocomplete-list {
    position: absolute;
    top: 100%; 
    left: 0;
    right: 0; 
    z-index: 1001; 
    background: var(--card-bg); 
    border: 1px solid var(--primary-color); 
    border-top: none; 
    border-radius: 0 0 5px 5px;
    max-height: 180px; 
    overflow-y: auto; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); 
    margin-top: -1px; 
}
#modal-step-2 #autocomplete-list li {
    padding: 0.6rem 0.8rem; 
    cursor: pointer;
    border-bottom: 1px solid var(--border-color); 
    color: var(--text-color);
}
#modal-step-2 #autocomplete-list li:last-child {
    border-bottom: none;
}
#modal-step-2 #autocomplete-list li:hover {
    background-color: var(--primary-color); 
    color: var(--black-color); 
}

/* =================================================================
   9. MELHORIAS (CAMPOS DESABILITADOS)
   ================================================================= */
.form-group input:disabled,
.inline-input:disabled {
    background-color: var(--table-header-bg) !important; 
    cursor: not-allowed;
    opacity: 0.5;
}

.checkbox-container input[type="checkbox"]:disabled + label {
    color: var(--subtle-text);
    cursor: not-allowed;
    opacity: 0.5;
}

/* =================================================================
   10. ESTILOS DA VIEW DE PRODUÇÃO
   ================================================================= */
#producao-view {
    border: 1px solid var(--border-color);
}
.producao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #000000; 
    color: #fff;
    border-bottom: 5px solid var(--primary-color); /* Linha Amarela */
}
.producao-logo span { 
    font-size: 2rem;
    font-weight: bold;
    border: 2px solid var(--white-color); 
    padding: 0.5rem 1rem;
    color: var(--white-color);
}
.producao-logo img {
    height: 50px;
    width: auto;
}
.producao-title {
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    flex-grow: 1; 
}
.producao-logo,
.producao-header-spacer {
    flex-basis: 150px; 
    flex-shrink: 0;
    display: flex;
    justify-content: flex-start; /* Alinha logo à esquerda */
}
.producao-header-spacer { 
    visibility: hidden; 
    flex-basis: 150px; /* Garante que o espaço seja reservado */
} 
.orcamento-header .theme-switch-wrapper { 
    flex-basis: auto; 
    justify-content: center;
}
.producao-header .theme-switch-wrapper {
    flex-basis: 150px;
    justify-content: center;
}

.producao-info-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr; 
    gap: 0;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.producao-info-pedido,
.producao-info-vendedor,
.producao-info-referencia {
    padding: 0 1.5rem; 
}
.producao-info-vendedor {
     border-left: 1px solid var(--border-color);
     border-right: 1px solid var(--border-color);
}

.producao-info-pedido table,
.producao-info-vendedor table {
    width: 100%;
}
.producao-info-pedido td,
.producao-info-vendedor td {
    padding: 0.2rem 0; 
    border: none; 
}
.producao-info-pedido td:first-child, 
.producao-info-vendedor td:first-child {
    width: 80px; 
}

.producao-info-referencia p {
    font-size: 0.9rem;
    color: var(--subtle-text);
    margin-bottom: 0.3rem;
}

.producao-table-wrapper {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}
#producao-table {
    width: 100%;
    border-collapse: collapse; 
}
#producao-table th,
#producao-table td {
    border: 1px solid var(--border-color); 
    padding: 0.5rem;
    text-align: center; 
    vertical-align: middle;
}
#producao-table thead th {
    background-color: var(--black-color); 
    color: var(--white-color);
    font-weight: bold;
    font-size: 0.85rem;
    padding: 0.6rem 0.4rem;
    border-color: var(--border-color);
}
#producao-table thead tr:last-child th { 
     font-size: 0.75rem;
     font-weight: normal;
}

/* Larguras das colunas */
#producao-table .col-item { width: 5%; }
#producao-table .col-desc-prod { width: 25%; text-align: left; padding-left: 5px;}
#producao-table .col-comp-prod,
#producao-table .col-alt-prod,
#producao-table .col-num-laminas,
#producao-table .col-comp-lamina { width: 8%; }
#producao-table .col-prod-un { width: 8%; }
#producao-table .col-tipo-fechada,
#producao-table .col-tipo-transv { width: 8%; }

#producao-table tbody tr {
    background-color: var(--card-bg); 
    color: var(--text-color); 
}
#producao-table tbody tr:nth-child(even) {
    background-color: var(--table-row-even-bg); 
}
body.light-mode #producao-table tbody tr {
    background-color: var(--white-color);
    color: var(--dark-text-color);
}
body.light-mode #producao-table tbody tr:nth-child(even) {
    background-color: var(--light-gray-bg);
}
body.light-mode #producao-table th,
body.light-mode #producao-table td {
    border: 1px solid #999;
}

#producao-table tbody tr td {
    font-size: 0.9rem;
}
#producao-table tbody tr.empty-row td {
    color: #444; 
    height: 35px; 
}
body.light-mode #producao-table tbody tr.empty-row td {
    color: #ccc;
}


.producao-actions {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between; 
    align-items: center;
}

/* =================================================================
   11. ESTILOS DE IMPRESSÃO (CORRIGIDO)
   ================================================================= */
@media print {
    .no-print, .modal-overlay, #start-screen {
        display: none !important;
    }
    .print-only {
        display: inline !important;
    }
    .screen-only {
        display: none !important; 
    }
    body {
        margin: 1cm; 
        font-family: Arial, sans-serif;
        font-size: 10pt;
        background-color: #fff !important; 
        color: #000 !important; 
        line-height: 1.4;
    }
    main.wide-layout,
    section#producao-view {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background-color: #fff !important; 
        color: #000 !important; 
    }

    /* --- Impressão ORÇAMENTO (#main-content) --- */
    #main-content .orcamento-header { border-bottom: 2px solid #000; }
    #main-content .header-info h1 { color: #000; }
    #main-content .info-display { display: flex; flex-direction: row; }
    #main-content .info-display-card { border: 1px solid #999; padding: 0.5rem; }
    #main-content .table-wrapper { overflow: hidden; }
    #main-content table { width: 100%; border-collapse: collapse; }
    #main-content th,
    #main-content td {
        border: 1px solid #333 !important;
        padding: 0.4rem 0.5rem;
        font-size: 9pt; 
        color: #000 !important;
    }
    #main-content thead th {
        background-color: #eee !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    #main-content .inline-input,
    #main-content .inline-desc {
        border: none; padding: 0.4rem 0.5rem; width: 100%;
        -webkit-appearance: none; appearance: none;
        background-color: transparent !important;
        font-size: 9pt; color: #000 !important; 
    }
    
    /* ***** CORREÇÃO 1: INPUTS DESABILITADOS NA IMPRESSÃO ***** */
    /* Esta regra é mais forte e garante que fiquem visíveis */
    body #main-content .inline-input:disabled,
    body #producao-view .inline-input:disabled {
        opacity: 1 !important;
        color: #000 !important; 
        background-color: transparent !important; 
        -webkit-appearance: none;
        appearance: none;
        cursor: default;
    }
    
    #main-content .inline-autocomplete-wrapper { position: static; }
    #main-content .inline-autocomplete-wrapper .inline-desc { display: block; }
    #main-content .totals-box {
        max-width: 400px; margin-left: auto; border: 1px solid #000;
        background-color: #fff !important; -webkit-print-color-adjust: exact; color-adjust: exact;
    }
    #main-content .total-row { padding: 0.5rem 1rem; border-bottom: 1px solid #999; }
    #main-content .grand-total { background-color: #eee !important; -webkit-print-color-adjust: exact; color-adjust: exact; }
    #main-content .grand-total span { color: #000 !important; }

    /* --- Impressão PRODUÇÃO (#producao-view) --- */
    #producao-view .producao-header {
        background-color: #000 !important; 
        color: #fff !important;
        border-bottom: 5px solid #f7b71c !important; /* Linha amarela */
         -webkit-print-color-adjust: exact;
         color-adjust: exact;
    }
     #producao-view .producao-logo span,
     #producao-view .producao-logo img {
         border-color: #fff !important;
         color: #fff !important;
     }
    #producao-view .producao-info-grid {
         grid-template-columns: 1.5fr 1fr 1fr;
         border-bottom: 1px solid #999;
         padding-bottom: 0.5rem;
         margin-bottom: 1rem;
    }
    #producao-view .producao-info-pedido td,
    #producao-view .producao-info-vendedor td { padding: 0.1rem 0; }
     #producao-view .producao-info-vendedor { border-left: 1px solid #999; border-right: 1px solid #999; }

    #producao-view .producao-table-wrapper { border: 1px solid #000; }
    #producao-view #producao-table th,
    #producao-view #producao-table td {
        border: 1px solid #000 !important;
        font-size: 8pt;
        padding: 0.3rem;
        color: #000 !important;
    }
    #producao-view #producao-table thead th {
        background-color: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
     #producao-view #producao-table tbody tr:nth-child(even) {
        background-color: #f2f2f2 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
     #producao-view #producao-table tbody tr.empty-row td {
         color: #ccc !important;
     }

    /* --- Regras de Quebra de Página --- */
    tr, .info-display-card, .totals-box {
        page-break-inside: avoid; 
    }
    thead {
        display: table-header-group; 
    }
}

/* =================================================================
   12. TEMA (LIGHT/DARK) TOGGLE (NOVO BOTÃO FLUTUANTE)
   ================================================================= */
#global-theme-toggle {
    position: fixed; /* Flutua sobre todo o conteúdo */
    top: 15px;
    right: 20px;
    z-index: 1001; /* Acima dos modais */
    display: flex;
    align-items: center;
    gap: 10px;
}
#global-theme-toggle p {
    font-size: 0.85rem;
    color: var(--subtle-text);
}
/* Esconde o texto em telas menores */
@media (max-width: 768px) {
    #global-theme-toggle p {
        display: none;
    }
}

#theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Botão circular */
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* Remove padding padrão de botão */
    overflow: hidden; /* Garante que os ícones fiquem dentro */
    position: relative; /* Para posicionar os ícones */
    transition: background-color 0.2s ease;
}
#theme-toggle-btn svg {
    color: var(--primary-color); /* Ícones sempre amarelos */
    position: absolute; /* Coloca os ícones um sobre o outro */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Lógica de troca de ícone */
.moon-icon {
    transform: scale(1);
    opacity: 1;
}
.sun-icon {
    transform: scale(0);
    opacity: 0;
}
body.light-mode .moon-icon {
    transform: scale(0);
    opacity: 0;
}
body.light-mode .sun-icon {
    transform: scale(1);
    opacity: 0;
}


/* =================================================================
   13. CONTROLE DE IMPRESSÃO DA PÁGINA (Remove URL/Data)
   ================================================================= */
@page {
    size: A4;   
    margin: 0;  /* Remove as margens do navegador */
}



.inline-input[type=number]::-webkit-inner-spin-button, 
.inline-input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

/* Para Firefox */
.inline-input[type=number] {
    -moz-appearance: textfield;
}

/* Também podemos aplicar ao modal e totais, se desejar */
.form-group input[type=number]::-webkit-inner-spin-button, 
.form-group input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
.form-group input[type=number] {
    -moz-appearance: textfield;
}
.total-row input[type=number]::-webkit-inner-spin-button, 
.total-row input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
.total-row input[type=number] {
    -moz-appearance: textfield;
}