* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Tabs */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.tab {
    flex: 1;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    position: relative;
    background: #f8f9fa;
}

.tab:hover {
    background: #e9ecef;
}

.tab.active {
    color: #667eea;
    background: white;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.filters {
    background: white;
    padding: 25px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.table-container {
    padding: 30px;
    overflow-x: auto;
}

/* Wrapper para conteúdo de abas simples como Calculadora e Deslocações */
.content-wrapper {
    padding: 40px;
    max-width: 800px;
    margin: 40px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.content-wrapper h2 {
    text-align: center;
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.content-wrapper > p {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    line-height: 1.6;
}

.content-wrapper .filter-group {
    margin-bottom: 20px;
}

.content-wrapper .table-container {
    padding: 0;
}

.content-wrapper #btnCalcularCubagem {
    margin-top: 20px;
}

.resultado {
    margin-top: 30px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Accordion Styles */
.accordion {
    border-top: 1px solid #e9ecef;
}
.accordion-item {
    border-bottom: 1px solid #e9ecef;
}
.accordion-header {
    width: 100%;
    padding: 18px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}
.accordion-header:hover {
    background-color: #f8f9fa;
}
.accordion-header::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
    font-weight: 300;
    color: #667eea;
    transition: transform 0.3s ease;
}
.accordion-header.active::after {
    transform: translateY(-50%) rotate(45deg);
}
.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: white;
    font-size: 0.95rem;
}
.accordion-panel.active {
    max-height: 1000px; /* Adjust if content is larger */
    transition: max-height 0.5s ease-in;
}
.accordion-panel p, 
.accordion-panel ul,
.accordion-panel h4 {
    padding: 10px 20px 0 20px;
    text-align: left;
    margin-bottom: 15px;
}
.accordion-panel ul {
    list-style-position: inside;
    padding-left: 20px;
}
.accordion-panel li {
    margin-bottom: 8px;
}

/* Templates Section Styles */
.templates-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #f1f3f5;
}
.templates-section h2, .templates-section h3 {
    text-align: left;
    padding-left: 20px;
}
.templates-section h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #34495e;
}
pre {
    background: #2d3748; /* Dark gray */
    color: #f7fafc; /* Light gray */
    padding: 20px;
    border-radius: 10px;
    white-space: pre-wrap; /* Ensures text wraps */
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 20px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 18px;
    font-weight: 600;
    text-align: left;
    font-size: 1rem;
    letter-spacing: 0.5px;
    position: relative;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

th:hover {
    background: rgba(255, 255, 255, 0.1);
}

th.sortable::after {
    content: '↕';
    position: absolute;
    right: 10px;
    opacity: 0.5;
}

td {
    padding: 16px 18px;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.bloco-1 { background: rgba(102, 126, 234, 0.1); }
.bloco-2 { background: rgba(52, 211, 153, 0.1); }
.bloco-3 { background: rgba(251, 146, 60, 0.1); }
.bloco-4 { background: rgba(236, 72, 153, 0.1); }

.bloco-header {
    font-weight: 700;
    color: #495057;
    background: #e9ecef !important;
}

.estado-nome {
    font-weight: 500;
    color: #212529;
}

.sigla {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.preco {
    font-weight: 600;
    color: #212529;
    font-size: 1rem;
}

.preco-g { color: #e74c3c; }
.preco-m { color: #f39c12; }
.preco-p { color: #27ae60; }

.caixa-madeira {
    background: #ffeaa7;
    font-weight: 700;
    color: #d63031;
}

.no-results {
    text-align: center;
    padding: 60px;
    color: #6c757d;
    font-size: 1.2rem;
}

.btn-export {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px auto;
    display: block;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Estilos específicos para tabela de eletrodomésticos */
.eletro-table {
    font-size: 0.85rem;
}

.eletro-table th,
.eletro-table td {
    padding: 12px 10px;
}

.categoria-header {
    background: #34495e !important;
    color: white !important;
    text-align: center;
    font-size: 0.9rem;
}

/* Column visibility for filters */
.col-hidden {
    display: none;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 10px;
    }

    .preco {
        font-size: 0.95rem;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        border-bottom: 1px solid #e9ecef;
    }
    
    .content-wrapper {
        padding: 20px;
        margin: 20px;
    }

    .eletro-table {
        font-size: 0.75rem;
    }

    .eletro-table th,
    .eletro-table td {
        padding: 8px 6px;
    }
}