/* ==========================================================================
   VARIÁVEIS DE COR E ESTILOS GLOBAIS (PALETA MAGALU & LOPAZZI)
   ========================================================================== */
:root {
    /* Cores Magalu / Lopazzi */
    --color-primary: #0086FF;      /* Azul Royal Magalu */
    --color-primary-dark: #002C66; /* Azul Escuro Deep */
    --color-orange: #FF6A00;       /* Laranja de Notificação/Pendência */
    --color-orange-light: #FFF0E6; /* Fundo leve para alertas */
    
    /* Tons Neutros */
    --bg-main: #F4F6F9;
    --bg-card: #FFFFFF;
    --border-color: #E2E8F0;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    
    /* Efeito Vidro (Glassmorphism) */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(0, 44, 102, 0.08);
    --glass-blur: blur(12px);
    
    /* Fontes */
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    --font-title: 'Outfit', sans-serif;
}

body.dark-theme {
    /* Redefinição de variáveis para o Dark Mode */
    --bg-main: #0B0F19;
    --bg-card: #151C2C;
    --border-color: #222C3F;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --text-light: #4A5D78;
    
    --color-primary-dark: #0086FF;
    --color-orange-light: #2A1F1B;
    
    /* Efeito Vidro (Glassmorphism) Dark Mode */
    --glass-bg: rgba(21, 28, 44, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.sidebar, .chats-column, .chat-active-column, .details-column, .ia-toggle-card, .chat-card, .message-bubble, .order-card-detail, .nav-item {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ==========================================================================
   ESTRUTURA CONTAINER PRINCIPAL (LAYOUT 3 COLUNAS)
   ========================================================================== */
.dashboard-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.view-container {
    flex-grow: 1;
    height: 100%;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.25s ease-out;
}

.view-container.hidden-view {
    display: none !important;
    opacity: 0;
}

#chat-view-container {
    display: grid;
    grid-template-columns: 350px 1fr 320px;
    height: 100%;
    width: 100%;
}

/* SIDEBAR ESQUERDA (Controle & Glassmorphism) */
.sidebar {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    height: 100%;
    width: 260px;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 32px;
}

.logo {
    display: flex;
    flex-direction: column;
    font-family: var(--font-title);
    font-weight: 700;
    line-height: 1.1;
}

.logo-accent {
    font-size: 24px;
    color: var(--color-primary-dark);
}

.logo-sub {
    font-size: 16px;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(0, 134, 255, 0.1);
    color: var(--color-primary);
}

.nav-item.warning-tab:hover, .nav-item.warning-tab.active {
    background-color: var(--color-orange-light);
    color: var(--color-orange);
}

/* FOOTER DA SIDEBAR E TOGGLE IA */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ia-toggle-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.ia-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ia-info i {
    color: var(--color-primary);
    font-size: 20px;
}

.ia-info h4 {
    font-family: var(--font-title);
    font-size: 14px;
    font-weight: 600;
}

.ia-info p {
    color: var(--text-muted);
    font-size: 12px;
}

.pulse-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* SWITCH SLIDER */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-light);
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* OPERATOR PROFILE */
.operator-profile {
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
}

.avatar-circle {
    background: var(--color-primary-dark);
    border-radius: 50%;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
}

.operator-info h4 {
    font-family: var(--font-title);
    font-size: 14px;
    font-weight: 600;
}

.operator-info p {
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================================================
   COLUNA 1: FILA DE CHATS (LISTAGEM DE CHATS)
   ========================================================================== */
.chats-column {
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.column-header {
    border-bottom: 1px solid var(--border-color);
    padding: 24px 20px;
}

.column-header h3 {
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 16px;
}

.search-bar {
    position: relative;
    width: 100%;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-bar input {
    background-color: var(--bg-main);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 14px;
    padding: 10px 12px 10px 38px;
    width: 100%;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    border-color: var(--color-primary);
    background-color: var(--bg-card);
    outline: none;
}

.chats-list {
    flex-grow: 1;
    overflow-y: auto;
}

/* CARD DE CHAT NA LISTA */
.chat-card {
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    transition: background-color 0.2s ease;
}

.chat-card:hover {
    background-color: var(--bg-main);
}

.chat-card.active {
    background-color: rgba(0, 134, 255, 0.05);
    border-left: 4px solid var(--color-primary);
}

.chat-avatar {
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-avatar i {
    color: var(--text-light);
    font-size: 20px;
}

.chat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.chat-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.customer-name {
    font-family: var(--font-title);
    font-size: 14px;
    font-weight: 600;
}

.time-stamp {
    color: var(--text-light);
    font-size: 12px;
}

.last-msg {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* BADGES DE CATEGORIA */
.badge {
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.badge-pre-venda {
    background-color: rgba(0, 134, 255, 0.1);
    color: var(--color-primary);
}

.badge-pos-venda {
    background-color: rgba(0, 44, 102, 0.1);
    color: var(--color-primary-dark);
}

.badge-pendencia {
    background-color: var(--color-orange-light);
    color: var(--color-orange);
}

/* SPINNER LOADING */
.loading-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--text-muted);
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.05);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   COLUNA 2: CHAT ATIVO (CONVERSA ATIVA)
   ========================================================================== */
.chat-active-column {
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    height: 80px;
}

.customer-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.customer-avatar-large {
    background: var(--bg-main);
    border-radius: 50%;
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    font-size: 22px;
}

.customer-avatar-large img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.customer-meta h3 {
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 600;
}

.customer-meta p {
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.btn-action-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.btn-action-icon:hover {
    background-color: var(--bg-main);
    color: var(--text-main);
}

/* MENSAGENS CHAT AREA */
.chat-messages-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-chat-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    height: 100%;
    color: var(--text-light);
    text-align: center;
}

.empty-chat-state i {
    font-size: 48px;
}

.empty-chat-state h3 {
    color: var(--text-muted);
    font-family: var(--font-title);
}

.empty-chat-state p {
    max-width: 320px;
    font-size: 14px;
}

/* BALÕES DE MENSAGEM */
.message-bubble {
    border-radius: 16px;
    max-width: 70%;
    padding: 12px 16px;
    position: relative;
    font-size: 14px;
    line-height: 1.5;
}

.message-bubble.client {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-bubble.operator {
    background-color: var(--color-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-bubble.bot {
    background-color: var(--color-primary-dark);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ia-badge {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    position: absolute;
    right: 8px;
    top: -18px;
    color: var(--color-primary-dark);
}

/* BARRA DE INPUT MENSAGEM */
.chat-input-area {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

.chat-input-area form {
    display: flex;
    gap: 12px;
}

.chat-input-area input {
    background-color: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    flex-grow: 1;
    font-size: 14px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.chat-input-area input:focus {
    border-color: var(--color-primary);
    outline: none;
}

.btn-send {
    background-color: var(--color-primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    padding: 12px 24px;
    transition: background-color 0.2s ease;
}

.btn-send:hover {
    background-color: #0070D6;
}

.btn-send:disabled, .chat-input-area input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   COLUNA 3: DETALHES DO PEDIDO (DIREITA)
   ========================================================================== */
.details-column {
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.details-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px 20px;
}

.empty-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-light);
    gap: 12px;
}

.empty-details i {
    font-size: 36px;
}

/* COMPONENTES DE DETALHES (VENDAS) */
.order-card-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    color: var(--color-primary-dark);
    font-family: var(--font-title);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.product-thumbnail {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 60px;
    height: 60px;
    overflow: hidden;
    flex-shrink: 0;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info h5 {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.product-info p {
    color: var(--text-muted);
    font-size: 12px;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.data-label {
    color: var(--text-muted);
}

.data-value {
    font-weight: 600;
}

.data-value.price {
    color: var(--color-primary);
}

/* BOTÕES DE AÇÃO RÁPIDA */
.actions-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-action-premium {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.btn-action-premium:hover {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.btn-action-premium.btn-action-warning:hover {
    background-color: var(--color-orange);
    border-color: var(--color-orange);
    color: white;
}

/* ==========================================================================
   MODAIS E DIALOGS CUSTOMIZADOS (CUSTOM DIALOG MODALS)
   ========================================================================== */
.modal-backdrop {
    background: rgba(0, 44, 102, 0.4);
    backdrop-filter: blur(4px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.custom-modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 420px;
    overflow: hidden;
    animation: modal-show 0.25s ease-out;
}

@keyframes modal-show {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.modal-header h3 {
    color: var(--color-primary-dark);
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 700;
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    justify-content: flex-end;
}

.btn-modal-primary {
    background-color: var(--color-primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    padding: 10px 20px;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.btn-modal-primary:hover {
    background-color: #0070D6;
}

/* ==========================================================================
   TELA DE LOGIN PREMIUM (GLASSMORPHISM & DEGRADÊ DINÂMICO)
   ========================================================================== */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, #0056B3 50%, var(--color-orange) 100%);
    background-size: 400% 400%;
    animation: gradient-anim 15s ease infinite;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

@keyframes gradient-anim {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-theme-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
}

.btn-theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 18px;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-theme-toggle:hover {
    transform: scale(1.1) rotate(180deg);
    background: rgba(255, 255, 255, 0.25);
}

.login-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
    text-align: center;
    transition: all 0.3s ease;
    animation: login-show 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-theme .login-card {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes login-show {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.login-logo {
    font-family: var(--font-title);
    font-weight: 700;
    margin-bottom: 32px;
}

.login-logo .logo-accent {
    font-size: 32px;
    color: white;
    display: block;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-logo .logo-sub {
    font-size: 16px;
    color: #FFC09F;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
    text-align: left;
}

.form-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-family: var(--font-primary);
    font-size: 15px;
    padding: 14px 16px 14px 46px;
    width: 100%;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #00D2FF;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

.form-group input:focus + i {
    color: #00D2FF;
}

.btn-login {
    background: linear-gradient(90deg, var(--color-primary) 0%, #00C6FF 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 700;
    padding: 14px;
    width: 100%;
    box-shadow: 0 10px 20px rgba(0, 134, 255, 0.2);
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 134, 255, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.login-error {
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    color: #FEE2E2;
    font-size: 13px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ajustes e Botões extras na Sidebar para tema */
.theme-switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.theme-btn-sidebar {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

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

/* Logout Button */
.btn-logout {
    background: transparent;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    padding: 4px;
}

.btn-logout:hover {
    color: #DC2626;
    transform: scale(1.1);
}

/* ==========================================================================
   SEÇÕES DA SIDEBAR & SELETOR DE LOJAS
   ========================================================================== */
.sidebar-section-title {
    font-family: var(--font-title);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-light);
    margin: 16px 8px 8px 8px;
}

.store-selector-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.store-item {
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 14px;
    text-align: left;
    transition: all 0.2s ease;
}

.store-item i {
    font-size: 15px;
    width: 18px;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.store-item:hover, .store-item.active {
    background-color: rgba(0, 134, 255, 0.08);
    color: var(--color-primary);
}

.store-item:hover i, .store-item.active i {
    color: var(--color-primary);
}

body.dark-theme .store-item:hover, body.dark-theme .store-item.active {
    background-color: rgba(0, 134, 255, 0.15);
}

/* ==========================================================================
   TELA DEDICADA DE DASHBOARD (MÉTRICAS NEON & GRÁFICO SLICK)
   ========================================================================== */
#dashboard-view-container {
    flex-grow: 1;
    height: 100%;
    overflow-y: auto;
    background-color: var(--bg-main);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.dashboard-view-header {
    margin-bottom: 8px;
}

.dashboard-view-header h2 {
    font-family: var(--font-title);
    font-size: 26px;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 6px;
}

.dashboard-view-header p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Grade de Métricas */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.02), 0 4px 6px -2px rgba(0, 0, 0, 0.01);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.metric-card.card-ia::before { background-color: #10B981; }
.metric-card.card-human::before { background-color: #8B5CF6; }
.metric-card.card-unattended::before { background-color: #EF4444; }
.metric-card.card-rate::before { background-color: #F59E0B; }

.metric-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-card-header i {
    font-size: 16px;
}

.metric-card.card-ia i { color: #10B981; }
.metric-card.card-human i { color: #8B5CF6; }
.metric-card.card-unattended i { color: #EF4444; }
.metric-card.card-rate i { color: #F59E0B; }

.metric-card-body h3 {
    font-family: var(--font-title);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.metric-card-body p {
    color: var(--text-light);
    font-size: 12px;
}

/* Brilho Neon nos Cards */
body.dark-theme .metric-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body.dark-theme .metric-card.card-ia { box-shadow: 0 0 15px rgba(16, 185, 129, 0.05); border-color: rgba(16, 185, 129, 0.2); }
body.dark-theme .metric-card.card-human { box-shadow: 0 0 15px rgba(139, 92, 246, 0.05); border-color: rgba(139, 92, 246, 0.2); }
body.dark-theme .metric-card.card-unattended { box-shadow: 0 0 15px rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.2); }
body.dark-theme .metric-card.card-rate { box-shadow: 0 0 15px rgba(245, 158, 11, 0.05); border-color: rgba(245, 158, 11, 0.2); }

/* Bloco do Gráfico */
.chart-section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.chart-header-row h3 {
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.legend-color.ia-color { background: linear-gradient(180deg, #10B981 0%, #059669 100%); }
.legend-color.human-color { background: linear-gradient(180deg, #8B5CF6 0%, #7C3AED 100%); }

/* Grid de colunas do gráfico */
.chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    padding-top: 20px;
    border-bottom: 2px solid var(--border-color);
    gap: 8px;
}

.chart-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    max-width: 24px;
    height: 100%;
    gap: 2px;
    position: relative;
}

/* Tooltip do valor da coluna */
.chart-bar-container::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: var(--color-primary-dark);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-bar-container:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.chart-bar {
    width: 100%;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-bar.ia-bar {
    background: linear-gradient(180deg, #10B981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.chart-bar.human-bar {
    background: linear-gradient(180deg, #8B5CF6 0%, #7C3AED 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

body.dark-theme .chart-bar.ia-bar {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

body.dark-theme .chart-bar.human-bar {
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.chart-bar-label {
    font-size: 9px;
    color: var(--text-light);
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
}

/* Custom Scrollbar Premium para a Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

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

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
    opacity: 0.8;
}

/* Fallback Firefox */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

