/* -------------------------------------------------------------
 * TATUI TELECOM - DASHBOARD DE VENDAS
 * Design System e Estilos Customizados (Vanilla CSS)
 * ------------------------------------------------------------- */

/* Variáveis e Temas */
:root {
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Tema Escuro (Padrão) */
    --bg-primary: #0b0f19;
    --bg-secondary: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.55);
    --bg-hover: rgba(51, 65, 85, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.15);
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.15);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.15);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.15);
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    
    --sidebar-width: 260px;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    --glass-border: 1px solid rgba(255, 255, 255, 0.06);
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    /* Tema Claro */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-hover: rgba(241, 245, 249, 0.9);
    --border-color: rgba(15, 23, 42, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-purple: #7c3aed;
    --accent-purple-glow: rgba(124, 58, 237, 0.1);
    --accent-blue: #2563eb;
    --accent-blue-glow: rgba(37, 99, 237, 0.1);
    --accent-cyan: #0891b2;
    --accent-cyan-glow: rgba(8, 145, 178, 0.1);
    --accent-green: #059669;
    --accent-green-glow: rgba(5, 150, 105, 0.1);
    --accent-red: #dc2626;
    --accent-orange: #d97706;
    
    --glass-shadow: 0 8px 32px 0 rgba(148, 163, 184, 0.1);
    --glass-border: 1px solid rgba(15, 23, 42, 0.06);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
}

/* Layout App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar lateral */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition-smooth);
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px 12px;
    border-bottom: var(--glass-border);
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.logo-img {
    max-height: 65px;
    width: 100%;
    object-fit: contain;
}

.logo-icon {
    font-size: 24px;
    color: var(--accent-purple);
    filter: drop-shadow(0 0 8px var(--accent-purple));
}

.logo-text {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    color: var(--text-primary);
}

.brand-sub {
    color: var(--accent-purple);
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
}

.nav-item a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-item:hover a {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.nav-item.active a {
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
}

[data-theme="light"] .nav-item.active a {
    color: #ffffff;
}

.sidebar-footer {
    padding: 20px;
    border-top: var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.data-status-card {
    background-color: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-indicator.online {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.status-indicator.offline {
    background-color: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.theme-toggle-container {
    width: 100%;
}

.theme-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border: var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 10px;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    transition: var(--transition-smooth);
}

.theme-btn:hover {
    background-color: var(--text-secondary);
    color: var(--bg-primary);
}

/* Painel de Conteúdo Principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    min-width: 0; /* Permite encolhimento no flexbox */
}

/* Header superior */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 20px;
    flex-wrap: wrap;
}

.header-title-container {
    min-width: 0;
    flex: 1;
}

#page-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap; /* Evita que os filtros quebrem o layout em telas médias */
}

.search-bar-header {
    background-color: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 0 14px; /* Removido padding vertical, usado height */
    height: 38px; /* Altura idêntica ao btn-icon */
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 220px; /* Alinhado na mesma linha que o seletor de datas */
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
}

.search-and-reset-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-bar-header:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px var(--accent-purple-glow);
}

.search-bar-header i {
    color: var(--text-muted);
}

.search-bar-header input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    width: 100%;
}

.search-bar-header input::placeholder {
    color: var(--text-muted);
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--border-radius-md);
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background-color: var(--bg-card);
    border: var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

.btn-danger:hover {
    background-color: var(--accent-red);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-icon {
    width: 38px; /* Reduzido de 42px para alinhar com o search-bar-header */
    height: 38px; /* Reduzido de 42px para alinhar com o search-bar-header */
    padding: 0;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--accent-purple);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: var(--transition-smooth);
}

.btn-back:hover {
    color: var(--accent-blue);
    transform: translateX(-4px);
}

/* Mobile Toggle Buttons */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-secondary);
    border: var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0;
    font-size: 16px;
}
.mobile-menu-toggle:hover {
    background-color: var(--bg-hover);
    color: var(--accent-purple);
}

.btn-close-sidebar {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0;
    font-size: 14px;
}
.btn-close-sidebar:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 15, 25, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Grid de KPIs */
.kpi-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
}

/* Visão Geral: 8 Cards */
.kpi-grid.overview-kpi-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

/* Detalhes: 6 Cards */
.kpi-grid.detail-kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* Estrelagem: 3 Cards */
.kpi-grid.star-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1600px) {
    .kpi-grid.overview-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1400px) {
    .kpi-grid.detail-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .kpi-grid.overview-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .kpi-grid.star-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .kpi-grid.detail-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .kpi-grid.star-kpi-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .kpi-grid.overview-kpi-grid,
    .kpi-grid.detail-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    position: relative;
    background-color: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.kpi-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kpi-icon-wrapper.faturamento {
    background-color: var(--accent-purple-glow);
    color: var(--accent-purple);
}

.kpi-icon-wrapper.vendas {
    background-color: var(--accent-blue-glow);
    color: var(--accent-blue);
}

.kpi-icon-wrapper.ticket {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.kpi-icon-wrapper.lojas {
    background-color: var(--accent-green-glow);
    color: var(--accent-green);
}

.kpi-icon-wrapper.vendedores {
    background-color: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
}

.kpi-data {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 46px; /* Evita que o valor ou o título fiquem embaixo do círculo de percentual */
}

.kpi-title {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-card.minified {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.kpi-card.minified .kpi-value {
    font-size: 24px;
}

/* Gráficos Grid */
.dashboard-grid-2x1 {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .dashboard-grid-2x1 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.chart-card {
    background-color: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(8px);
}

.chart-header {
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.chart-body {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-body.doughnut-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 300px;
}

/* Layout de Painéis e Tabelas */
.dashboard-grid-1x2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .dashboard-grid-1x2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.panel-card {
    background-color: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(8px);
}

.panel-card.scrollable-panel {
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.panel-body {
    overflow-x: auto;
    width: 100%;
}

.panel-card.scrollable-panel .panel-body {
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
    margin-top: 16px;
    padding-right: 4px;
    width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-primary {
    background-color: var(--accent-purple-glow);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-secondary {
    background-color: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-success {
    background-color: var(--accent-green-glow);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-info {
    background-color: var(--accent-blue-glow);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Tabelas Customizadas */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}

.custom-table th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

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

/* Tabelas interativas */
.clickable-rows tbody tr {
    cursor: pointer;
    transition: var(--transition-smooth);
}

.clickable-rows tbody tr:hover {
    background-color: var(--bg-hover);
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-success {
    color: var(--accent-green) !important;
}

.text-primary {
    color: var(--accent-purple) !important;
}

/* Abas de Conteúdo */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

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

/* Seção de Lojas Grid */
.view-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
}

.view-header-bar h2 {
    font-size: 22px;
    font-weight: 800;
}

.search-filter-box {
    background-color: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 260px;
}

.search-filter-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    width: 100%;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.store-card {
    background-color: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 180px;
    transition: var(--transition-smooth);
}

.store-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
    box-shadow: 0 10px 25px var(--accent-purple-glow);
}

.store-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px; /* Garante que o nome da loja não grude na meta */
}

.store-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 180px;
    line-height: 1.3;
}

.store-card-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.store-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.store-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.store-stat-val {
    font-size: 13px;
    font-weight: 600;
}

.store-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.store-card-revenue {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-purple);
}

/* Detalhes de Visão Avançada */
.detail-container {
    animation: fadeIn 0.4s ease-out;
}

.detail-header {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.detail-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seller-meta {
    display: flex;
    flex-direction: column;
}

.seller-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.hidden {
    display: none !important;
}

/* Importar CSS Componentes */
.import-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease-out;
}

.import-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 24px;
}

@media (max-width: 800px) {
    .import-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.drag-drop-zone {
    background-color: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
}

.drag-drop-zone:hover, .drag-drop-zone.dragover {
    border-color: var(--accent-purple);
    background-color: var(--bg-hover);
}

.import-drop-zones-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.import-drop-zones-wrapper .drag-drop-zone {
    padding: 24px 20px;
}

.drag-drop-zone.selected {
    border-color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.04) !important;
}

.drag-drop-zone.selected .upload-icon-container {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

.upload-icon-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--accent-purple-glow);
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    transition: var(--transition-smooth);
}

.drag-drop-zone:hover .upload-icon-container {
    transform: scale(1.1);
    background-color: var(--accent-purple);
    color: #ffffff;
}

.drag-drop-zone h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.drag-drop-zone p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.file-rules {
    font-size: 11px;
    color: var(--text-muted);
    background-color: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 12px;
    border: var(--glass-border);
}

.import-settings .panel-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    background-color: var(--bg-primary);
    border: var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--border-radius-md);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--accent-purple);
}

.form-help {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

.info-mapping-box {
    margin-top: 16px;
    background-color: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--border-radius-md);
    padding: 16px;
}

.info-mapping-box h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-purple);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-mapping-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-mapping-box li {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.info-mapping-box li i {
    font-size: 10px;
}

.import-status-details {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.status-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 12px;
    color: var(--text-muted);
}

.meta-value {
    font-size: 16px;
    font-weight: 700;
}

.import-actions {
    display: flex;
    justify-content: flex-end;
}

/* Responsividade Mobile */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .btn-close-sidebar {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .top-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-bar-header {
        width: 100%;
        max-width: none; /* Permite esticar em telas mobile */
    }
    
    .search-and-reset-container {
        width: 100%;
    }
    
    .view-header-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    .stars-section-title {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .stars-projection-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
    
    .stars-projection-card .star-projection-highlight-badge {
        align-self: flex-start !important;
    }
}

/* Estilos para Modal de Serviços Realizados */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: var(--transition-smooth);
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-container {
    background-color: var(--bg-secondary);
    border: var(--glass-border);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 950px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px var(--accent-purple-glow);
    animation: modalSlideDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes modalSlideDown {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.modal-close-btn:hover {
    color: var(--accent-red);
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-kpi-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-kpi-item {
    background-color: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
    flex: 1 1 auto;
}

.modal-kpi-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.modal-kpi-val {
    font-size: 20px;
    font-weight: 800;
}

.table-container {
    overflow-x: auto;
    width: 100%;
}

/* Indicadores Móveis clicáveis */
#table-store-movel tbody tr,
#table-seller-movel tbody tr {
    cursor: pointer;
    transition: var(--transition-smooth);
}

#table-store-movel tbody tr:hover,
#table-seller-movel tbody tr:hover {
    background-color: var(--bg-hover);
    border-left: 3px solid var(--accent-blue);
}

#table-store-movel tbody tr td,
#table-seller-movel tbody tr td {
    transition: var(--transition-smooth);
}

#table-store-movel tbody tr:hover td:first-child,
#table-seller-movel tbody tr:hover td:first-child {
    padding-left: 9px;
    color: var(--accent-blue);
}

/* Indicadores Fixos clicáveis */
#table-store-fixo tbody tr,
#table-seller-fixo tbody tr {
    cursor: pointer;
    transition: var(--transition-smooth);
}

#table-store-fixo tbody tr:hover,
#table-seller-fixo tbody tr:hover {
    background-color: var(--bg-hover);
    border-left: 3px solid var(--accent-cyan);
}

#table-store-fixo tbody tr td,
#table-seller-fixo tbody tr td {
    transition: var(--transition-smooth);
}

#table-store-fixo tbody tr:hover td:first-child,
#table-seller-fixo tbody tr:hover td:first-child {
    padding-left: 9px;
    color: var(--accent-cyan);
}

/* Classes extras de Cores para KPIs e Gráficos */
.kpi-icon-wrapper.faturamento-movel {
    background-color: var(--accent-blue-glow);
    color: var(--accent-blue);
}

.kpi-icon-wrapper.faturamento-fixo {
    background-color: var(--accent-cyan-glow);
    color: var(--accent-cyan);
}

.kpi-icon-wrapper.faturamento-aparelhos {
    background-color: var(--accent-purple-glow);
    color: var(--accent-purple);
}

.kpi-icon-wrapper.faturamento-acessorios {
    background-color: var(--accent-green-glow);
    color: var(--accent-green);
}

/* Estilos de Sub-abas nas Telas de Detalhes */
.sub-tabs-container {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    padding-bottom: 8px;
}

.sub-tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sub-tab-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.sub-tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.sub-tab-panel {
    animation: fadeIn 0.3s ease-out;
}

.sub-tab-panel.hidden {
    display: none !important;
}

/* Grid de Status de Carga Duplo */
.import-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .import-status-grid {
        grid-template-columns: 1fr;
    }
}

.status-panel-item {
    background-color: rgba(30, 41, 59, 0.3);
    border: var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 16px;
}

.status-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.status-item-header h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-item-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-item-body p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.status-item-body p strong {
    color: var(--text-primary);
}

/* Indicadores de Aparelhos clicáveis (Roxo) */
#table-store-aparelhos tbody tr,
#table-seller-aparelhos tbody tr {
    cursor: pointer;
    transition: var(--transition-smooth);
}

#table-store-aparelhos tbody tr:hover,
#table-seller-aparelhos tbody tr:hover {
    background-color: var(--bg-hover);
    border-left: 3px solid var(--accent-purple);
}

#table-store-aparelhos tbody tr td,
#table-seller-aparelhos tbody tr td {
    transition: var(--transition-smooth);
}

#table-store-aparelhos tbody tr:hover td:first-child,
#table-seller-aparelhos tbody tr:hover td:first-child {
    padding-left: 9px;
    color: var(--accent-purple);
}

/* Indicadores de Acessórios clicáveis (Verde) */
#table-store-acessorios tbody tr,
#table-seller-acessorios tbody tr {
    cursor: pointer;
    transition: var(--transition-smooth);
}

#table-store-acessorios tbody tr:hover,
#table-seller-acessorios tbody tr:hover {
    background-color: var(--bg-hover);
    border-left: 3px solid var(--accent-green);
}

#table-store-acessorios tbody tr td,
#table-seller-acessorios tbody tr td {
    transition: var(--transition-smooth);
}

#table-store-acessorios tbody tr:hover td:first-child,
#table-seller-acessorios tbody tr:hover td:first-child {
    padding-left: 9px;
    color: var(--accent-green);
}

/* Sub-valor menor sob o valor principal (Faturamento do indicador) */
.kpi-subvalue {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Ajustes de responsividade para telas padrão de notebook e desktop em 100% de zoom */
@media (min-width: 1025px) and (max-width: 1440px) {
    :root {
        --sidebar-width: 220px;
    }
    
    .sidebar-header {
        padding: 12px 10px;
    }
    
    .sidebar-nav {
        padding: 16px 12px;
    }
    
    .nav-item a {
        padding: 10px 12px;
        gap: 10px;
        font-size: 13px;
    }
    
    .sidebar-footer {
        padding: 16px;
        gap: 12px;
    }
    
    .main-content {
        margin-left: 220px;
        padding: 24px;
    }
    
    .top-header {
        margin-bottom: 24px;
    }
    
    #page-title {
        font-size: 20px;
    }
    
    .kpi-grid {
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .kpi-card {
        padding: 14px 16px;
        gap: 12px;
        border-radius: var(--border-radius-md);
    }
    
    .kpi-icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .kpi-title {
        font-size: 11px;
    }
    
    .kpi-value {
        font-size: 17px;
    }
    
    .kpi-card.minified .kpi-value {
        font-size: 18px;
    }
    
    .kpi-subvalue {
        font-size: 10px;
        margin-top: 2px;
    }
    
    .dashboard-grid-2x1,
    .dashboard-grid-1x2 {
        gap: 16px;
        margin-bottom: 16px;
    }
    
    .chart-card,
    .panel-card {
        padding: 16px 20px;
    }
    
    .chart-body {
        height: 250px;
    }
    
    .chart-body.doughnut-container {
        max-height: 250px;
    }
    
    .panel-card.scrollable-panel {
        max-height: 350px;
    }
}

/* Estilo para linhas clicáveis no modal de breakdown por loja */
.clickable-row-modal {
    cursor: pointer;
    transition: var(--transition-smooth);
}

.clickable-row-modal:hover {
    background-color: var(--bg-hover) !important;
}

.clickable-row-modal:hover td:first-child {
    padding-left: 14px;
    color: var(--accent-purple) !important;
}

.clickable-row-modal td:first-child {
    transition: var(--transition-smooth);
}

.table-total-row td {
    font-weight: 700 !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-top: 2px solid var(--glass-border) !important;
}

/* ==========================================================================
   ABA DE GESTÃO DE METAS
   ========================================================================== */

.goals-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    margin-top: 16px;
    align-items: start;
}

@media (max-width: 900px) {
    .goals-layout {
        grid-template-columns: 1fr;
    }
}

.goals-stores-sidebar {
    padding: 20px;
    border-radius: var(--border-radius-lg);
    background-color: var(--bg-card);
    border: var(--glass-border);
}

.goals-store-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
    max-height: 500px;
    overflow-y: auto;
}

.goals-store-item {
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.goals-store-item:hover {
    background-color: var(--bg-hover);
}

.goals-store-item.active {
    background-color: var(--accent-blue-glow);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
    font-weight: 600;
}

.goals-store-item .store-name {
    font-size: 13px;
}

.goals-store-item .goal-status-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.goals-store-detail {
    padding: 24px;
    border-radius: var(--border-radius-lg);
    background-color: var(--bg-card);
    border: var(--glass-border);
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1024px) {
    .goals-store-detail {
        padding: 16px;
    }
}

.store-goals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.store-goals-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.store-goals-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.store-goals-inputs-grid .form-group label {
    font-size: 11px !important;
    margin-bottom: 4px !important;
}

.store-goals-inputs-grid .form-control {
    padding: 8px 12px !important;
    font-size: 12px !important;
    height: auto !important;
}

.store-goals-inputs-grid .input-with-symbol .symbol {
    left: 10px !important;
    font-size: 11px !important;
}

.store-goals-inputs-grid .input-with-symbol input {
    padding-left: 30px !important;
}

.input-with-symbol {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-symbol .symbol {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
}

.input-with-symbol input {
    padding-left: 38px;
    text-align: right;
    font-family: inherit;
    font-weight: 600;
}

.goals-divider {
    height: 1px;
    background-color: var(--glass-border);
    margin: 24px 0;
}

.sellers-goals-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.sellers-goals-header-row h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
}

.sellers-goals-header-row .section-subtitle {
    margin: 0;
    font-size: 11px;
    color: var(--text-muted);
}

.sellers-goals-list-container {
    overflow-x: auto;
    margin-bottom: 16px;
}

.sellers-goals-list-container input.seller-goal-input {
    width: 100%;
    padding: 6px 8px;
    padding-left: 24px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--glass-border);
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.sellers-goals-list-container input.seller-goal-input:focus {
    border-color: var(--accent-blue);
    background-color: rgba(255, 255, 255, 0.05);
    outline: none;
}

.sellers-goals-list-container td {
    padding: 8px 12px !important;
    vertical-align: middle;
}

.goals-status-alert {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--accent-orange);
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
}

/* Progresso de Metas nos Cards de KPIs */
.kpi-goal-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    width: 100%;
}

.kpi-goal-bar-bg {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

/* Adaptar background do progress bar bg para tema claro */
[data-theme="light"] .kpi-goal-bar-bg {
    background-color: rgba(15, 23, 42, 0.08);
}

.kpi-goal-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
}

.kpi-goal-text {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Círculo com o percentual de atingimento da meta, posicionado no canto superior direito do kpi-card */
.kpi-goal-badge-circle {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    border: 2px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

.kpi-goal-badge-circle span {
    color: #ffffff !important;
    font-weight: 800;
}

/* Estilos de Cores Dinâmicas baseadas nas faixas de atingimento */
/* Vermelho: até 50% */
.goal-red .kpi-goal-bar {
    background-color: #ef4444 !important;
}
.goal-red .kpi-goal-badge-circle {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: #ef4444;
}
[data-theme="light"] .goal-red .kpi-goal-badge-circle {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

/* Amarelo: 51% a 79% */
.goal-yellow .kpi-goal-bar {
    background-color: #eab308 !important;
}
.goal-yellow .kpi-goal-badge-circle {
    background-color: rgba(234, 179, 8, 0.15);
    color: #fef08a;
    border-color: #eab308;
}
[data-theme="light"] .goal-yellow .kpi-goal-badge-circle {
    background-color: rgba(234, 179, 8, 0.1);
    color: #854d0e;
}

/* Laranja: 80% a 99% */
.goal-orange .kpi-goal-bar {
    background-color: #f97316 !important;
}
.goal-orange .kpi-goal-badge-circle {
    background-color: rgba(249, 115, 22, 0.15);
    color: #fed7aa;
    border-color: #f97316;
}
[data-theme="light"] .goal-orange .kpi-goal-badge-circle {
    background-color: rgba(249, 115, 22, 0.1);
    color: #c2410c;
}

/* Verde: 100% ou mais */
.goal-green .kpi-goal-bar {
    background-color: #10b981 !important;
}
.goal-green .kpi-goal-badge-circle {
    background-color: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border-color: #10b981;
}
[data-theme="light"] .goal-green .kpi-goal-badge-circle {
    background-color: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

/* Forçar cor preta na fonte do percentual no círculo no tema claro */
[data-theme="light"] .kpi-goal-badge-circle span {
    color: #000000 !important;
}

/* Cores de Tendência nos KPIs com contraste ajustado por tema */
.trend-red {
    color: #ef4444 !important;
}
.trend-yellow {
    color: #eab308 !important;
}
.trend-orange {
    color: #f97316 !important;
}
.trend-green {
    color: #10b981 !important;
}

[data-theme="light"] .trend-red {
    color: #b91c1c !important;
}
[data-theme="light"] .trend-yellow {
    color: #854d0e !important;
}
[data-theme="light"] .trend-orange {
    color: #c2410c !important;
}
[data-theme="light"] .trend-green {
    color: #065f46 !important;
}

/* Filtro de Data no Header */
.date-filter-header {
    background-color: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--glass-shadow);
}

.date-filter-header input[type="date"] {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

/* Ajustes do tema claro para inputs de data */
[data-theme="light"] .date-filter-header input[type="date"] {
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }
    .date-filter-header {
        width: 100%;
        box-sizing: border-box;
        justify-content: space-between;
    }
    .date-filter-header input[type="date"] {
        flex: 1;
        text-align: center;
        min-width: 110px;
    }
}

/* Container de histórico de dados na sidebar */
.archive-select-container {
    margin-bottom: 16px;
    width: 100%;
}

.archive-select-container label {
    font-size: 10px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.archive-select-container select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
    transition: var(--transition-smooth);
}

.archive-select-container select:hover {
    border-color: var(--accent-purple);
    background-color: var(--bg-hover);
}

.archive-select-container select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px var(--accent-purple-glow);
}

[data-theme="light"] .archive-select-container select {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Estilos da Campanha de Estrelas */
.star-card {
    border-left: 4px solid #eab308 !important; /* Destaque dourado na borda esquerda */
    align-items: stretch !important;
}

/* Badge de status no topo-direito do card */
.star-card .badge {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.star-card .badge.badge-no-caminho {
    background-color: rgba(234, 179, 8, 0.15) !important;
    color: #fef08a !important;
    border-color: rgba(234, 179, 8, 0.3) !important;
}

.star-card .badge.badge-atingido {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #a7f3d0 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.star-card .badge.badge-abaixo {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

[data-theme="light"] .star-card .badge.badge-no-caminho {
    background-color: rgba(234, 179, 8, 0.1) !important;
    color: #854d0e !important;
    border-color: rgba(234, 179, 8, 0.2) !important;
}

[data-theme="light"] .star-card .badge.badge-atingido {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #065f46 !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

[data-theme="light"] .star-card .badge.badge-abaixo {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #b91c1c !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

/* Inputs de Metas na aba Estrelagem */
.stars-goal-input {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px dashed var(--border-color) !important;
    border-radius: 0 !important;
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    padding: 0 !important;
    transition: var(--transition-smooth);
}

.stars-goal-input:focus {
    border-bottom-style: solid !important;
    border-bottom-color: var(--accent-purple) !important;
    box-shadow: none !important;
}

/* ==========================================================================
   TELA DE LOGIN E GESTÃO DE USUÁRIOS
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #0f172a, #020617);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

[data-theme="light"] .login-overlay {
    background: radial-gradient(circle at center, #f8fafc, #e2e8f0);
}

.login-box {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    width: 400px;
    padding: 24px 32px;
    text-align: center;
    transition: var(--transition-smooth);
}

[data-theme="light"] .login-box {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px 0 rgba(148, 163, 184, 0.2);
}

.login-logo {
    margin-bottom: 16px;
}

.login-logo img {
    height: 48px;
    object-fit: contain;
}

.login-box h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon > i {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 14px;
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 44px 12px 42px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.password-toggle-btn {
    position: absolute;
    right: 18px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
    transition: var(--transition-smooth);
    z-index: 10;
}

.password-toggle-btn:hover {
    color: var(--text-primary);
}

.login-remember-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 16px;
}

.login-remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.login-remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.login-footer {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 14px;
    text-align: center;
}

.login-footer p {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 4px 0;
    opacity: 0.65;
}

[data-theme="light"] .login-footer {
    border-top-color: rgba(0, 0, 0, 0.05);
}

.input-with-icon input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

.login-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

[data-theme="light"] .login-error {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

.btn-login {
    width: 100%;
    padding: 14px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
}

/* Card de Usuário na Sidebar */
.user-session-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: rgba(30, 41, 59, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    margin-top: 16px;
    gap: 12px;
}

[data-theme="light"] .user-session-card {
    background: rgba(255, 255, 255, 0.4);
}

.user-info-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.user-avatar-icon {
    font-size: 28px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-avatar-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    background-color: #ffffff;
    padding: 2px;
    flex-shrink: 0;
}

.user-text-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-text-info .badge {
    font-size: 9px;
    padding: 2px 6px;
    font-weight: 800;
    text-transform: uppercase;
    align-self: flex-start;
    margin-top: 3px;
    border-radius: 4px;
}

.user-text-info .badge-adm {
    background-color: rgba(168, 85, 247, 0.15) !important;
    color: #c084fc !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
}
[data-theme="light"] .user-text-info .badge-adm {
    background-color: rgba(168, 85, 247, 0.1) !important;
    color: #7e22ce !important;
}

.user-text-info .badge-supervisor {
    background-color: rgba(6, 182, 212, 0.15) !important;
    color: #22d3ee !important;
    border: 1px solid rgba(6, 182, 212, 0.3) !important;
}
[data-theme="light"] .user-text-info .badge-supervisor {
    background-color: rgba(6, 182, 212, 0.1) !important;
    color: #0e7490 !important;
}

.user-text-info .badge-gerente {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}
[data-theme="light"] .user-text-info .badge-gerente {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #047857 !important;
}

.user-text-info .badge-consultor {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}
[data-theme="light"] .user-text-info .badge-consultor {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #1d4ed8 !important;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    width: 100%;
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.35);
}

[data-theme="light"] .btn-logout {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.15);
}

[data-theme="light"] .btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

/* Seleção de Lojas na Edição de Usuário */
.user-store-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: 2px;
}

.user-store-checkbox-label:hover {
    background-color: var(--bg-primary);
}

.user-store-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent-blue);
}

/* Rodapé do Dashboard */
.app-footer {
    margin-top: auto;
    padding: 24px 0 8px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    width: 100%;
}

.app-footer p {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.65;
    margin: 0;
}
