:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --primary: #334155;
    --accent: #64748b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    padding: 2rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center; /* Garante centralização global */
}

/* Container unificado: chassi segue a largura da tabela */
.container { 
    width: fit-content; 
    min-width: 650px;
    max-width: 100%;
}

header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.brand-group { display: flex; align-items: center; gap: 0.75rem; }
.logo-icon { font-size: 1.4rem; }

.tabs-container {
    width: 100%;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: flex-start;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

table {
    width: auto; 
    border-collapse: collapse;
    table-layout: auto; 
    font-size: 0.875rem;
}

th {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.75rem; 
    letter-spacing: 0.1em;
    border-bottom: 2px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
}

th:hover { color: white; background: rgba(255, 255, 255, 0.05); }

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}

tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Alinhamentos Específicos */
.col-cliente { text-align: left; }
.col-vivo { text-align: center; }
.col-expander { text-align: center; width: 60px; }
.col-detalhe { text-align: center; }
.col-saldo { text-align: right; }
.col-status { text-align: center; }

.status-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
}

.activity-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.activity-dot.active { background: var(--success); box-shadow: 0 0 8px var(--success); }
.activity-dot.inactive { background: var(--warning); box-shadow: 0 0 8px var(--warning); }

.tab-btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 0.5rem 1.25rem; cursor: pointer; border-radius: 4px; font-weight: 600; margin-right: 0.5rem; }
.tab-btn.active { background: var(--primary); color: white; border-color: var(--accent); }

.icon-btn { background: var(--bg-main); border: 1px solid var(--border); color: white; padding: 0.5rem; cursor: pointer; border-radius: 4px; }

.dropdown-menu.show { display: block !important; }

.detail-col { display: none; }
.table-expanded .detail-col { display: table-cell !important; }
.table-row-expanded .detail-col { display: table-cell !important; }

@media (max-width: 768px) {
    body { padding: 1rem; }
    .container { min-width: 100%; }
}
