:root {
    --bg-color: #121214;
    --sidebar-bg: #18181b;
    --card-bg: #242424; /* Cinza suave para relevo */
    --text-primary: #ECEFF4; /* Branco névoa Nord */
    --text-secondary: #8E9BAE; /* Cinza azulado lavado */
    
    /* Muted & Pro Palette (Nord inspired) */
    --accent-yellow: #EBCB8B; /* Amarelo queimado */
    --accent-green: #A3BE8C;  /* Verde sálvia */
    --accent-blue: #81A1C1;   /* Azul névoa */
    --accent-purple: #B48EAD; /* Roxo desbotado */
    --accent-red: #BF616A;    /* Vermelho Nord */
    
    --border-color: rgba(255, 255, 255, 0.05);
}

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

body {
    font-family: 'PT Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
}

/* ... Sidebar code remains similar ... */

/* Kanban Board Styling */
.kanban-board {
    display: flex;
    gap: 25px;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 5px; /* Reduzido para aproximar a barra do rodapé */
    height: 100%;
}

.kanban-column {
    min-width: 312px;
    width: 312px;
    display: flex;
    flex-direction: column;
    background-color: transparent;
    padding: 0;
    overflow: hidden;
    height: fit-content;
    max-height: calc(100vh - 120px);
    border-top: 4px solid var(--border-color); /* Indicador Superior */
    transition: border-color 0.3s;
}

/* Indicators by Color */
.kanban-column[data-color="yellow"] { border-top-color: var(--accent-yellow); }
.kanban-column[data-color="green"] { border-top-color: var(--accent-green); }
.kanban-column[data-color="blue"] { border-top-color: var(--accent-blue); }
.kanban-column[data-color="red"] { border-top-color: var(--accent-red); }
.kanban-column[data-color="blue-light"] { border-top-color: #88C0D0; }
.kanban-column[data-color="orange"] { border-top-color: #D08770; }
.kanban-column[data-color="red-dark"] { border-top-color: #BF616A; }
.kanban-column[data-color="gold"] { border-top-color: #EBCB8B; }
.kanban-column[data-color="cyan"] { border-top-color: #88C0D0; }



.column-header {
    padding: 20px 0 15px 0;
    position: relative;
    margin-bottom: 5px;
}

.status-info h3 {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    display: flex;
    justify-content: space-between;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.7;
}

.status-info .total-info {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-top: 8px;
}

.cards-container {
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
}

/* Cards (Kommo Style) */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.card:hover {
    background-color: #2c2c2e;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.card-customer-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
}

.card-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.card-kommo-id {
    font-size: 0.7rem;
    color: var(--accent-blue);
    font-weight: 600;
}

.card-title {
    font-size: 0.9rem;
    color: var(--accent-blue);
    font-weight: 400;
    line-height: 1.3;
    margin: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-value {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.card-tracking-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--tracking-color, var(--text-secondary));
}

.tracking-badge-label {
    line-height: 1;
}

.tracking-badge-separator {
    opacity: 0.5;
}

.tracking-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.tracking-badge-dot-filled {
    background: var(--dot-color);
    border: 1px solid transparent;
}

.tracking-badge-dot-hollow {
    background: transparent !important;
    border: 1.5px solid var(--dot-color);
    box-shadow: none !important;
}

/* Modal Overhaul */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: flex-end; /* Slide from right like Kommo but centered for now */
}

.modal.active { display: flex; align-items: center; justify-content: center; }

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

::-webkit-scrollbar-track {
    background: #1c1c1e;
}

::-webkit-scrollbar-thumb {
    background: #3a3a3c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #48484a;
}

.modal-content {
    background: #1c1c1e;
    width: 95%;
    max-width: 840px;
    height: 90vh;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    border-bottom: 1px solid var(--border);
}

#closeModal {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

#closeModal i {
    font-size: 14px;
}


#closeModal:hover {
    color: white;
    border-color: var(--accent-blue);
    transform: rotate(90deg);
}

.timeline-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-dim);
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px dashed var(--border);
}

.timeline-empty i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-blue);
}


.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    gap: 20px;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-center h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

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

/* Toggle Logic (Vertical Stack) */
.toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-right: 5px;
    cursor: pointer;
}

.toggles-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-right: 15px;
}

.toggle-text {
    font-size: 0.65rem;
    font-weight: 800;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #660000; /* Vermelho escuro desabilitado */
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #EBCB8B; /* Dourado Ativo */
}

input:checked + .slider.green {
    background-color: #2ecc71; /* Verde WhatsApp */
}

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

/* Kanban Column Colors Extra */
.kanban-column[data-color="gray"] { border-top: 4px solid #4c566a; }
.kanban-column[data-color="purple"] { border-top: 4px solid #b48ead; }


.modal-title-group h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

#closeModal {
    background: #2c2c2e;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

#closeModal:hover {
    background: #3a3a3c;
    color: var(--text-primary);
}

.modal-tabs {
    padding: 0 30px;
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    background: #1c1c1e;
}

.tab-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 15px 0;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s;
}

.tab-link.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

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

.modal-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.modal-row {
    display: flex;
    padding: 10px 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.modal-row-divider-top {
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px dotted rgba(255, 255, 255, 0.10);
}

.modal-row-divider-bottom {
    margin-bottom: 4px;
    padding-bottom: 14px;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.10);
}

.modal-label {
    width: 180px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.modal-value {
    flex: 1;
    color: var(--text-primary);
}

.modal-value-delivery-status {
    color: #e67e22;
    font-weight: 700;
}

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

.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.modal-footer-actions > button {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 18px;
    margin: 0;
}

.modal-footer .btn-bling-single {
    background-color: #EBCB8B; /* Amarelo premium */
    color: #1E1E2E !important; /* Texto escuro para contraste */
    border: none;
    padding: 0 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    flex: 1;
    margin: 0;
    box-shadow: 0 4px 15px rgba(235, 203, 139, 0.2);
}

.btn-bling-single:hover {
    background-color: #f1d8a5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(235, 203, 139, 0.4);
}

.btn-bling-single i {
    font-size: 1.1rem;
}

.bling-btn {
    background: var(--accent-yellow);
    color: #2E3440; /* Nord Dark */
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.modal-footer .bling-btn:hover {
    background: #D8AD5E;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.modal-footer .bling-btn:active {
    transform: translateY(0);
}

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

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 80px;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    border-right: 1px solid var(--border-color);
}

.logo-box {
    width: 40px;
    height: 40px;
    background-color: var(--accent-yellow);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    border-radius: 8px;
    margin-bottom: 40px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 30px; /* Aumentado para melhor respiro */
    margin-top: 20px;
}

.menu a {
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    font-size: 0.7rem;
    gap: 8px;
    transition: all 0.3s;
    font-weight: 700;
}

.menu a.active {
    color: var(--accent-yellow);
}

.menu a i {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 30px;
    height: 100vh;
    overflow: hidden;
}

#leadsView {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Importante para flexbox */
}

#historyView, #dbView {
    flex: 1;
    overflow-y: auto;
}

.search-bar {
    background-color: #1a1a1c;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 8px;
    width: 350px;
    border: 1px solid var(--border-color);
}

.search-bar i {
    color: var(--text-secondary);
    margin-right: 15px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

/* DB Explorer Styles */
/* DB Explorer Styles */
.db-explorer {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-bottom: 50px;
    overflow-y: auto;
}

.db-section h3 {
    margin-bottom: 15px;
    color: var(--accent-yellow);
    font-size: 1rem;
    text-transform: uppercase;
}

.table-wrapper {
    background: #1a1a1c;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

th {
    background: #242426;
    text-align: left;
    padding: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Logs / Executions List (n8n style) */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #1a1a1c;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.log-item-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: #151517;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.65rem;
    font-weight: 800;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}



.log-item-lean {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: #1c1c1e;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    transition: background 0.2s;
}

.log-item-lean:hover {
    background: #242426;
}

.col-time { width: 80px; font-size: 0.85rem; color: var(--text-secondary); }
.col-order { width: 120px; font-size: 0.85rem; }
.col-client { width: 250px; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-value { width: 100px; font-size: 0.85rem; text-align: right; padding-right: 20px; }
.col-status { width: 100px; }
.col-action { flex: 1; text-align: right; }

.log-status-pill {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
}

.status-succeeded .log-status-pill { border-color: var(--accent-green); color: var(--accent-green); background: rgba(163, 190, 140, 0.1); }
.status-error .log-status-pill { border-color: var(--accent-red); color: var(--accent-red); background: rgba(191, 97, 106, 0.1); }

.btn-inspect {
    background: #2c2c2e;
    border: 1px solid #3a3a3c;
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-inspect:hover {
    background: #3a3a3c;
    border-color: #EBCB8B;
}


.log-customer {
    font-size: 0.85rem;
    color: var(--text-primary);
    width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.log-movement {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.7rem;
}

.status-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}


.status-badge.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.badge-aguardando { border-color: var(--accent-yellow) !important; color: var(--accent-yellow) !important; background: rgba(235, 203, 139, 0.1) !important; }
.badge-pago { border-color: var(--accent-green) !important; color: var(--accent-green) !important; background: rgba(163, 190, 140, 0.1) !important; }
.badge-separacao { border-color: var(--accent-blue) !important; color: var(--accent-blue) !important; background: rgba(129, 161, 193, 0.1) !important; }
.badge-enviado { border-color: var(--accent-purple) !important; color: var(--accent-purple) !important; background: rgba(180, 142, 173, 0.1) !important; }
.badge-v3dias { border-color: #88C0D0 !important; color: #88C0D0 !important; background: rgba(136, 192, 208, 0.1) !important; }
.badge-vhoje { border-color: #D08770 !important; color: #D08770 !important; background: rgba(208, 135, 112, 0.1) !important; }
.badge-vencido { border-color: #BF616A !important; color: #BF616A !important; background: rgba(191, 97, 106, 0.1) !important; }
.badge-ganho { border-color: #EBCB8B !important; color: #EBCB8B !important; background: rgba(235, 203, 139, 0.1) !important; }
.badge-parcial { border-color: #88C0D0 !important; color: #88C0D0 !important; background: rgba(136, 192, 208, 0.1) !important; }



.log-execution-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* JSON Viewer */
.json-viewer {
    background: #0f0f11;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: #A3BE8C; /* Nord Greenish for code */
    white-space: pre-wrap;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.json-label {
    display: block;
    color: var(--accent-blue);
    font-weight: 700;
    margin: 20px 0 10px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

.timeline-entry {
    padding-left: 15px;
    border-left: 2px solid var(--accent-blue);
    position: relative;
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--bg-color);
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
}

.timeline-path {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.path-from { color: var(--text-secondary); }
.path-to { color: var(--accent-green); font-weight: 600; }

.timeline-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: 4px;
}

.json-peek-btn {
    background: rgba(129, 161, 193, 0.1);
    border: 1px solid rgba(129, 161, 193, 0.3);
    color: var(--accent-blue);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.json-peek-btn:hover {
    background: rgba(129, 161, 193, 0.2);
    border-color: var(--accent-blue);
}



/* --- Danger Actions UI --- */
.danger-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.danger-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.3);
}

.content-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding-right: 20px;
}

#deleteOrderBtn {
    margin-right: auto; /* Push it to the far left of the modal footer */
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    height: 44px;
    padding: 0 18px;
}
#deleteOrderBtn:hover {
    background: #e74c3c;
    color: white;
}

/* --- Store Selector (Kommo Style) --- */
.store-selector-container {
    position: relative;
    margin-right: 20px;
}

.store-selector {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
    font-weight: 600;
}

.store-selector:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-yellow);
}

.store-selector i.fa-store {
    color: var(--accent-yellow);
    font-size: 0.9rem;
}

.store-selector i.fa-chevron-down {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.5;
}

.store-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #2E3440;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.store-dropdown.active {
    display: block;
    animation: fadeInDown 0.2s ease;
}

.store-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.store-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-yellow);
}

.store-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-yellow);
    border-left: 3px solid var(--accent-yellow);
}
/* --- 🔒 LOGIN STYLES (V11.0.1) --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1c 0%, #000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.login-card {
    background: #111113;
    border: 1px solid #333;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 100px rgba(46, 204, 113, 0.05);
    text-align: center;
}

.login-header i {
    font-size: 3rem;
    color: #2ecc71;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 30px;
    font-weight: 700;
}

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

.input-group {
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 8px;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    height: 50px;
    background: #1c1c1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0 45px 0 15px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.password-wrapper input:focus {
    border-color: #2ecc71;
    outline: none;
}

.password-wrapper i {
    position: absolute;
    right: 15px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
}

.password-wrapper i:hover {
    color: #fff;
}

.btn-login-action {
    height: 50px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.3);
}

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

.login-error {
    color: #ff5f5f;
    font-size: 0.85rem;
    margin-top: 10px;
    background: rgba(255, 95, 95, 0.1);
    padding: 10px;
    border-radius: 4px;
}

.logout-nav-item {
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logout-nav-item span {
    font-size: 0.9rem;
    font-weight: 600;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- UX Polish: Prevent selection on UI elements --- */
.store-selector,
.store-dropdown,
.sidebar,
.column-header h3,
.header h1,
.logo,
.menu a,
.stats-item {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;     /* IE 10 and older */
    user-select: none;         /* Standard syntax */
}

/* --- Orange Column Variant --- */
.kanban-column[data-color="orange"] { border-top-color: #D08770; }
.badge-recuperacao { border-color: #D08770 !important; color: #D08770 !important; background: rgba(208, 135, 112, 0.1) !important; }

/* Sync Progress Popup */
.sync-progress-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: #1a1a20;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sync-progress-popup.active {
    display: block !important;
}

.sync-progress-popup.minimized {
    transform: translateY(calc(100% - 310px));
}

.sync-progress-header {
    background: #252525;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    font-weight: 600;
    font-size: 0.9rem;
}

.sync-progress-header button {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

.sync-progress-header button:hover {
    color: white;
}

.sync-progress-body {
    padding: 15px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #bbb;
}

.progress-bar-container {
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007aff, #00c6ff);
    width: 0%;
    transition: width 0.4s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 10px;
}

.progress-time {
    font-size: 0.75rem;
    color: #ffcc00;
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #333;
}

/* Custom Confirm Modal */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20000;
}

.custom-confirm-box {
    background: #1e1e1e;
    border: 1px solid #333;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-confirm-overlay.show {
    display: flex;
}

.custom-confirm-overlay.show .custom-confirm-box {
    transform: scale(1);
}

.confirm-icon {
    font-size: 3rem;
    color: #EBCB8B;
    margin-bottom: 20px;
}

.custom-confirm-box h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: white;
}

.custom-confirm-box p {
    color: #aaa;
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
}

.confirm-buttons button {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-secondary {
    background: #333;
    color: white;
}

.btn-secondary:hover {
    background: #444;
}

.btn-primary {
    background: #EBCB8B;
    color: #1a1a1a;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(235, 203, 139, 0.4);
}

/* Progress Bar Color update */
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #EBCB8B, #d4a017);
    width: 0%;
    transition: width 0.4s ease;
}

.search-bar {
    position: relative;
    width: 220px;
    background-color: #1a1a1c;
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #333;
}

.search-bar i {
    color: #888;
    margin-right: 10px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-size: 0.85rem;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(30, 30, 46, 0.9);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toast-in 0.3s ease forwards, toast-out 0.3s ease forwards 2.2s;
    font-weight: 500;
}

.toast.error {
    border-left-color: var(--accent-red);
}

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Progress Modal */
.progress-content {
    max-width: 450px;
    text-align: center;
    padding: 2rem;
    border-radius: 20px;
    background: rgba(26, 26, 32, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.progress-content h2 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 1.5rem;
}

.progress-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.8rem;
    position: relative;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #6200ea, #d500f9);
    box-shadow: 0 0 15px rgba(213, 0, 249, 0.5);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

#progressPercent {
    font-weight: 700;
    color: #fff;
}

#progressAction {
    font-size: 0.85rem;
    color: #6200ea;
    font-style: italic;
    animation: pulseText 1.5s infinite;
}

@keyframes pulseText {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* ==========================================================================
   PREMIUM UI ENHANCEMENTS (V10.1.0 RESTORE)
   ========================================================================== */

/* SYSTEM STATS (SIDEBAR) */
.system-stats {
    margin-top: auto; /* Pushes to bottom */
    padding: 20px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    transition: all 0.3s;
    justify-content: center;
}

.stats-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.stats-item i { font-size: 0.85rem; color: var(--accent-blue); opacity: 0.7; }
.stats-item span { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); font-family: 'Inter', sans-serif; }

/* PIPELINE STATS RIBBON (V9.1.5) */
.pipeline-stats-ribbon {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 10px 25px;
    gap: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.stat-item { display: flex; align-items: baseline; gap: 8px; }
.stat-label { font-size: 0.65rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.stat-divider { width: 1px; height: 15px; background: rgba(255, 255, 255, 0.1); }

/* PREMIUM BUTTONS */
.kommo-btn, .bling-btn, .sync-all-btn, .rescue-btn, .btn-bling-single, .track-btn {
    height: 44px;
    padding: 0 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 145px;
}

.kommo-btn { background: #EBCB8B; color: #1a1a1a; }
.bling-btn { background: #D0A75E; color: #1a1a1a; }
.track-btn { background: #2F5D50; color: #F4F1EA; }
.sync-all-btn { background: #B5823D; color: #fff; }
.rescue-btn { background: linear-gradient(135deg, #BF616A, #a34b52); color: #fff; }
.btn-bling-single { background: var(--accent-blue); color: #fff; }

.kommo-btn:hover, .bling-btn:hover, .sync-all-btn:hover, .rescue-btn:hover, .track-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* VERSION FOOTER */
.version-footer {
    position: fixed;
    bottom: 10px;
    right: 20px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.4;
    pointer-events: none;
    z-index: 999;
}

/* ==========================================================================
   RESPONSIVE OVERRIDES (V10.1.0)
   ========================================================================== */

/* Wide Laptops / Small Desktops (< 1600px) */
@media screen and (max-width: 1600px) {
    .main-content { padding: 20px; }
    .kanban-column { min-width: 280px; width: 280px; }
    .search-bar { width: 300px; }
    .header h1 { font-size: 1.5rem; }
}

/* Laptops / Breaking Point (< 1366px) */
@media screen and (max-width: 1366px) {
    .header { padding: 10px 15px; }
    .actions { gap: 6px; }
    .kommo-btn, .bling-btn, .sync-all-btn, .rescue-btn, .track-btn { 
        height: 38px; 
        padding: 0 14px; 
        font-size: 0.7rem;
        min-width: 0; 
    }
    .header-right button i { display: none; }
    #boletoActions button { height: 38px; padding: 0 14px; font-size: 0.7rem; }
    #whatsappConfigBtn { height: 38px; width: 38px; }
    .kanban-column { min-width: 265px; width: 265px; }
}

/* Structural Stacking (< 1200px) */
@media screen and (max-width: 1200px) {
    .header { flex-direction: column; align-items: stretch; gap: 15px; height: auto; }
    .header-left { flex-direction: column; align-items: flex-start; gap: 10px; }
    .header-center h1 { font-size: 1.2rem; order: -1; }
    .header-right { justify-content: flex-start; gap: 10px; }
    .search-bar { width: 100%; max-width: none; }
}

/* Tablets & Small Screens (< 1024px) */
@media screen and (max-width: 1024px) {
    .sidebar { width: 60px; }
    .logo-box { width: 30px; height: 30px; margin-bottom: 20px; font-size: 1.1rem; }
    .menu a { font-size: 0.6rem; }
    .modal-content { width: 98%; height: 95vh; }
}
/* --- 📊 LOGS / EXECUTIONS STYLES (V11.0.2) --- */
.log-item-header, .log-item-lean {
    display: grid;
    grid-template-columns: 80px 140px 180px 1fr 140px 120px 120px;
    align-items: center;
    padding: 12px 20px;
    gap: 15px;
}

.log-item-header {
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #666;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.log-item-lean {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}

.log-item-lean:hover {
    background: rgba(255,255,255,0.02);
}

.col-time { color: #888; font-family: monospace; font-size: 0.9rem; }
.col-order strong { color: var(--text-primary); font-size: 0.95rem; }
.col-client strong { color: var(--text-primary); }
.col-value { font-weight: 600; color: #fff; }

.col-movement {
    display: flex;
    align-items: center;
}

/* Pagination Premium */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    gap: 20px;
}

.btn-page {
    background: #1c1c1e;
    border: 1px solid #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-page:hover:not(.disabled) {
    background: #EBCB8B;
    border-color: #EBCB8B;
    color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(235, 203, 139, 0.2);
}

.btn-page.disabled {
    opacity: 0.2;
    cursor: not-allowed;
    filter: grayscale(1);
}

.page-info {
    font-size: 0.9rem;
    color: #888;
}

.page-info strong {
    color: #EBCB8B;
    font-size: 1.1rem;
}

.total-logs {
    font-size: 0.75rem;
    opacity: 0.5;
    margin-left: 5px;
}
