/* 📦 ARQUIVO: static/css/style.css - VERSÃO FINAL OTIMIZADA E CORRIGIDA */
/* ESTILOS LIMPOS E OTIMIZADOS PARA KANBAN */

/* =========================================================================== */
/* 1. VARIÁVEIS E ESTILOS GLOBAIS */
/* =========================================================================== */

:root {
    --primary-color: #335973;
    --secondary-color: #968870;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --text-color-dark: #2c3e50;
    --card-bg-color: #ffffff;
    --sidebar-bg-color: #2c3e50;
    --sidebar-width: 280px;
    --board-bg-color: #f5f7fa; /* Mais claro */
    --modal-overlay: rgba(0,0,0,0.6);
    --modal-bg: #fefefe;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-color: #e9ecef; /* Mais claro */
    --card-light-bg: #fafbfc; /* Novo: fundo mais claro para cards */
}

* {
    box-sizing: border-box;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--board-bg-color); /* Usando a variável atualizada */
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    color: var(--text-color-dark);
    line-height: 1.5;
}

body.login-active {
    overflow: hidden; 
}

.hidden {
    display: none !important;
}

/* =========================================================================== */
/* 2. AUTENTICAÇÃO E LOGIN */
/* =========================================================================== */

#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--board-bg-color);
    z-index: 10000;
}

.login-box-wrapper {
    max-width: 380px;
    width: 90%;
    background: var(--card-bg-color);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.login-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a4a62 100%);
    margin: 0;
    border-radius: 12px 12px 0 0;
}

.login-logo {
    max-width: 260px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.login-form-area {
    padding: 30px 30px 25px;
}

.login-input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 18px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.login-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(51, 89, 115, 0.15);
    outline: none;
}

.login-button {
    width: 100%;
    padding: 14px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 17px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.login-button:hover {
    background-color: #2a4a62;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* =========================================================================== */
/* 3. LAYOUT PRINCIPAL E SIDEBAR */
/* =========================================================================== */

#kanban-app {
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    display: none;
}

#top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 900;
}

.sidebar-toggle-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.7rem;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    z-index: 1001;
}

.sidebar-toggle-button:hover {
    color: var(--secondary-color);
}

.header-logo-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 50px;
    border-radius: 4px;
    opacity: 0.9;
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg-color);
    color: #f4f4f4;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
    padding: 20px 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.4, 1);
}

body.sidebar-open #sidebar {
    transform: translateX(0);
}

body.sidebar-open #main-content-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    cursor: pointer;
}

#sidebar-header {
    text-align: left;
    padding: 0 20px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 10px;
}

#sidebar-logo {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0;
    border-radius: 4px;
}

#sidebar-nav {
    flex-grow: 1;
    padding: 10px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #f4f4f4;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: #3b5066;
    border-left: 4px solid var(--secondary-color);
    padding-left: 16px;
    font-weight: 600;
}

.sidebar-link.active {
    background-color: var(--primary-color);
    border-left: 4px solid var(--secondary-color);
}

.sidebar-link i {
    margin-right: 12px;
    font-size: 16px;
}

#sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

#user-display-sidebar {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 13px;
    color: #a0aec0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.sidebar-logout-button:hover {
    background-color: #b39f83;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.sidebar-logout-button i {
    margin-right: 8px;
}

#main-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-top: 70px;
    min-height: 100vh;
}

/* =========================================================================== */
/* 4. BOTÕES DE CRIAÇÃO OTIMIZADOS */
/* =========================================================================== */

.action-buttons-container {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
    align-items: center;
}

.create-primary-btn {
    background: linear-gradient(135deg, var(--primary-color), #2a4a62);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(51, 89, 115, 0.3);
    position: relative;
    overflow: hidden;
}

.create-primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.create-primary-btn:hover::before {
    left: 100%;
}

.create-primary-btn:hover {
    background: linear-gradient(135deg, #2a4a62, var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(51, 89, 115, 0.4);
}

.create-primary-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(51, 89, 115, 0.4);
}

.create-primary-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.create-primary-btn:hover i {
    transform: scale(1.1);
}

.create-secondary-btn {
    background: linear-gradient(135deg, var(--secondary-color), #b39f83);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(150, 136, 112, 0.3);
}

.create-secondary-btn:hover {
    background: linear-gradient(135deg, #b39f83, var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(150, 136, 112, 0.4);
}

.quick-action-btn {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 89, 115, 0.3);
}

/* =========================================================================== */
/* 5. BOTÕES FLOATING PARA MOBILE */
/* =========================================================================== */

.floating-action-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.floating-main-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #2a4a62);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 6px 20px rgba(51, 89, 115, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1002;
}

.floating-main-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 25px rgba(51, 89, 115, 0.6);
}

.floating-sub-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    transition: all 0.3s ease;
}

.floating-sub-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), #b39f83);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(150, 136, 112, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
}

.floating-sub-buttons.active .floating-sub-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.floating-sub-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(150, 136, 112, 0.6);
}

/* =========================================================================== */
/* 6. PAINEL DE CONTROLE E FILTROS - VERSÃO UNIFICADA */
/* =========================================================================== */

#control-panel {
    background-color: var(--card-bg-color);
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

#pipeline-title {
    font-size: 1.6em;
    color: var(--text-color-dark);
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

#toggle-filters-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    height: fit-content;
    margin-left: 15px;
}

#toggle-filters-button:hover {
    background: #b39f83;
    transform: translateY(-1px);
}

#toggle-filters-button i {
    transition: transform 0.3s ease;
    font-size: 0.9em;
}

#toggle-filters-button.collapsed i {
    transform: rotate(180deg);
}

#filters-main-container {
    transition: all 0.3s ease;
    overflow: hidden;
}

#filters-main-container.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 15px;
}

.product-filters-integrated {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
}

.product-filters-integrated .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.product-filters-integrated .filter-group strong {
    color: var(--text-color-dark);
    font-size: 12px;
    font-weight: 700;
}

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

.filter-group-compact label {
    font-weight: 600;
    color: var(--text-color-dark);
    font-size: 0.8em;
    white-space: nowrap;
}

.filter-group-compact .filter-select,
.filter-group-compact #filter-valor {
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #f8f9fa;
    font-size: 0.85em;
    width: 100%;
    transition: border-color 0.3s;
}

.filter-group-compact .filter-select:focus,
.filter-group-compact #filter-valor:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(51, 89, 115, 0.1);
}

.search-group-compact {
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px 10px;
    background-color: white;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.search-group-compact:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(51, 89, 115, 0.1);
}

.search-group-compact i {
    color: #888;
    margin-right: 8px;
    font-size: 0.9em;
}

.search-group-compact #global-search {
    flex-grow: 1;
    border: none;
    padding: 0;
    font-size: 0.9em;
    outline: none;
}

.action-buttons-compact {
    display: flex;
    gap: 8px;
    align-items: center;
}

#clear-filters-button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8em;
    transition: background-color 0.2s, transform 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#clear-filters-button:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.product-buttons-integrated {
    display: flex;
    gap: 4px;
}

.product-btn-integrated {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: var(--text-color-dark);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8em;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.product-btn-integrated:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.product-btn-integrated.active {
    background: linear-gradient(135deg, var(--primary-color), #2a4a62);
    color: white;
    border-color: var(--primary-color);
}

.product-select-integrated {
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    font-size: 0.8em;
    transition: all 0.3s ease;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 6px center;
    background-repeat: no-repeat;
    background-size: 12px;
    padding-right: 24px;
}

.product-select-integrated:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(51, 89, 115, 0.1);
}

#admin-vendor-filter-container {
    grid-column: 1 / -1;
    padding: 10px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 6px;
    margin-top: 8px;
}

.vendor-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vendor-filter-group label {
    font-weight: 700;
    color: #1565c0;
    font-size: 0.9em;
    white-space: nowrap;
}

.vendor-filter-group .filter-select {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #90caf9;
    border-radius: 4px;
    background: white;
    font-size: 0.85em;
}

/* =========================================================================== */
/* 7. FILTROS DE PRODUTOS - ESTILOS CORRIGIDOS E OTIMIZADOS */
/* =========================================================================== */

.product-filters-integrated {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-filters-integrated .filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.product-filters-integrated .filter-group strong {
    color: var(--text-color-dark);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.product-filter-btn {
    padding: 10px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    color: var(--text-color-dark);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.product-filter-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #2a4a62);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(51, 89, 115, 0.3);
}

.product-buttons-integrated {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.product-select {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background: white;
    font-size: 13px;
    min-width: 180px;
    transition: all 0.3s ease;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 32px;
}

.product-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(51, 89, 115, 0.1);
}

#clear-product-filters {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    height: fit-content;
}

#clear-product-filters:hover {
    background: linear-gradient(135deg, #5a6268, #6c757d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* =========================================================================== */
/* 8. KANBAN BOARD E CARDS - CORREÇÃO DEFINITIVA DAS CORES */
/* =========================================================================== */

.kanban-wrapper {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    display: block !important;
    padding: 15px 0px 20px 0px !important;
    height: calc(100vh - 70px - 140px) !important;
    min-height: 500px !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    cursor: grab !important;
    background-color: var(--board-bg-color);
    position: relative !important;
    width: 100% !important;
    white-space: nowrap !important;
}

.kanban-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    min-width: 100% !important;
    height: 100% !important;
    gap: 20px !important;
    padding: 0 20px 10px 20px !important;
    align-items: flex-start !important;
    white-space: nowrap !important;
}

.kanban-board {
    flex: 0 0 auto !important;
    min-width: 330px !important;
    max-width: 360px !important;
    height: 100% !important;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(10px) !important;
    position: relative;
    display: inline-flex !important;
    flex-direction: column !important;
}

.kanban-board:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1) !important;
    border-color: #c5cad0 !important;
}

.kanban-board-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a4a62 100%) !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    padding: 18px 20px !important;
    border-radius: 16px 16px 0 0 !important;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
}

.kanban-board-header span {
    background: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 0.8em !important;
    font-weight: 700 !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.kanban-items-wrapper {
    min-height: 450px;
    max-height: calc(100% - 50px);
    overflow-y: auto;
    padding: 12px 0;
    background: #ffffff !important; /* FUNDO BRANCO PURO */
    border-radius: 0 0 16px 16px;
    transition: all 0.2s ease;
    flex-grow: 1 !important;
}

/* ✅ CORREÇÃO: ESTILOS CORRETOS PARA OS CARDS - FUNDO BRANCO DEFINITIVO */
.kanban-item {
    cursor: grab !important;
    background: #ffffff !important; /* FUNDO BRANCO */
    border: 1px solid #f0f0f0 !important;
    border-left: 4px solid var(--secondary-color) !important;
    user-select: none;
    padding: 16px !important;
    margin: 0 12px 14px 12px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 13px;
    touch-action: none;
    position: relative;
    overflow: hidden;
    color: var(--text-color-dark) !important; /* FORÇAR COR DO TEXTO */
}

.kanban-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    opacity: 0.8;
}

.kanban-item:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
    border-color: #e0e0e0 !important;
    background: #f8f9fa !important; /* FUNDO CLARO NO HOVER */
    color: var(--text-color-dark) !important; /* GARANTIR COR DO TEXTO */
}

.kanban-item:active {
    cursor: grabbing !important;
}

.lead-card-content {
    position: relative;
    z-index: 2;
    background: transparent !important;
}

.lead-title-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    background: transparent !important;
}

.lead-title {
    font-weight: 700;
    color: var(--text-color-dark) !important; /* FORÇAR COR */
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin: 0;
    background: transparent !important;
}

.interaction-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), #b39f83);
    flex-shrink: 0;
    margin-top: 6px;
    box-shadow: 0 0 6px rgba(150, 136, 112, 0.4);
    animation: pulse-dot 2s infinite alternate;
}

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.2); opacity: 1; }
}

.lead-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent !important;
}

.lead-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    line-height: 1.3;
    padding: 4px 0;
    color: var(--text-color-dark) !important; /* FORÇAR COR */
    background: transparent !important;
}

.lead-meta-item i {
    font-size: 11px;
    color: var(--primary-color);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.8;
}

.fase-color-ball {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin: 0;
    display: inline-block;
    box-shadow: 0 0 4px currentColor;
}

.lead-meta-item.valor-info {
    font-weight: 600;
    color: var(--danger-color);
}

.lead-meta-item.valor-info i {
    color: var(--danger-color);
}

/* ✅ CORREÇÃO: ESTILOS ESPECÍFICOS PARA ELEMENTOS DE PRODUTOS */
.produtos-container {
    margin: 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.produto-badge {
    background: rgba(51, 89, 115, 0.1) !important;
    color: var(--primary-color) !important;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    border: 1px solid rgba(51, 89, 115, 0.2);
}

.mais-produtos {
    background: rgba(150, 136, 112, 0.1) !important;
    color: var(--secondary-color) !important;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.descricao-oportunidade {
    background: rgba(248, 249, 250, 0.8);
    padding: 6px 8px;
    border-radius: 6px;
    margin: 6px 0;
    font-size: 11px;
    line-height: 1.3;
    border-left: 2px solid var(--secondary-color);
}

.categoria-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.categoria-badge.has {
    background: rgba(33, 150, 243, 0.15);
    color: #1976d2;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.categoria-badge.holder {
    background: rgba(156, 39, 176, 0.15);
    color: #7b1fa2;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.categoria-badge.has-holder {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(156, 39, 176, 0.15));
    color: #5e35b1;
    border: 1px solid rgba(101, 87, 185, 0.3);
}

/* =========================================================================== */
/* 9. ESTILOS CRÍTICOS PARA DRAG & DROP - CORREÇÃO COMPLETA */
/* =========================================================================== */

.kanban-item.dragging {
    opacity: 0.9 !important;
    transform: rotate(3deg) scale(1.02) !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15) !important;
    z-index: 10000 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    border-left: 4px solid var(--primary-color) !important;
    background: #ffffff !important; /* ✅ CORREÇÃO: FUNDO BRANCO NO DRAG */
    
    /* FORÇAR COR DO TEXTO NO DRAG */
    color: var(--text-color-dark) !important;
}

.kanban-item.dragging * {
    pointer-events: none !important;
    
    /* FORÇAR COR DO TEXTO EM TODOS OS ELEMENTOS DURANTE DRAG */
    color: var(--text-color-dark) !important;
}

/* GARANTIR ESPECIFICAMENTE QUE OS TEXTOS MANTENHAM A COR */
.kanban-item.dragging .lead-title,
.kanban-item.dragging .lead-meta-item,
.kanban-item.dragging .lead-meta-item i,
.kanban-item.dragging .lead-card-content,
.kanban-item.dragging .lead-meta {
    color: var(--text-color-dark) !important;
}

.kanban-board.drag-over,
.kanban-items-wrapper.drag-over {
    border: 2px dashed var(--primary-color) !important;
    background: rgba(51, 89, 115, 0.03) !important;
    transition: all 0.2s ease !important;
    animation: pulse-gentle 2s infinite alternate !important;
}

@keyframes pulse-gentle {
    0% { 
        border-color: var(--primary-color);
        background: rgba(51, 89, 115, 0.03);
    }
    50% { 
        border-color: #66b3ff;
        background: rgba(51, 89, 115, 0.01);
    }
    100% { 
        border-color: var(--primary-color);
        background: rgba(51, 89, 115, 0.03);
    }
}

/* =========================================================================== */
/* 10. SCROLLBARS CUSTOMIZADAS */
/* =========================================================================== */

.kanban-wrapper::-webkit-scrollbar { 
    height: 10px; 
}

.kanban-wrapper::-webkit-scrollbar-track { 
    background: #e9eef2; 
    border-radius: 6px; 
    margin: 0 10px; 
}

.kanban-wrapper::-webkit-scrollbar-thumb { 
    background: #b8c1c9; 
    border-radius: 6px; 
    border: 2px solid #e9eef2; 
    transition: background 0.3s ease; 
}

.kanban-wrapper::-webkit-scrollbar-thumb:hover { 
    background: #9da9b5; 
}

.kanban-wrapper.auto-scrolling::-webkit-scrollbar-thumb { 
    background: var(--info-color); 
}

.kanban-items-wrapper::-webkit-scrollbar { 
    width: 6px; 
}

.kanban-items-wrapper::-webkit-scrollbar-track { 
    background: #f8f9fa; 
    border-radius: 3px; 
}

.kanban-items-wrapper::-webkit-scrollbar-thumb { 
    background: linear-gradient(135deg, var(--primary-color), #2a4a62);
    border-radius: 3px; 
}

.kanban-items-wrapper::-webkit-scrollbar-thumb:hover { 
    background: linear-gradient(135deg, #2a4a62, var(--primary-color));
}

.kanban-wrapper {
    scrollbar-width: thin;
    scrollbar-color: #b8c1c9 #e9eef2;
}

.kanban-items-wrapper {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f8f9fa;
}

/* =========================================================================== */
/* 11. MODAL DE DETALHES - ESTILOS CORRIGIDOS E UNIFICADOS */
/* =========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--modal-overlay);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: var(--modal-bg);
    margin: 5% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 950px;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

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

.close {
    color: #6c757d;
    float: right;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    position: absolute;
    right: 20px;
    top: 15px;
    z-index: 10;
}

.close:hover, .close:focus {
    color: var(--danger-color);
    transform: scale(1.1);
}

#lead-name {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.4em;
}

.lead-detail-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.lead-detail-section:hover {
    background: #f0f4f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lead-detail-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.2em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lead-detail-section h4 i {
    color: var(--secondary-color);
    font-size: 1.1em;
}

.detail-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.detail-group p {
    margin: 5px 0;
    flex: 1;
    min-width: 200px;
}

.detail-group strong {
    color: var(--text-color-dark);
    font-weight: 600;
}

#interacoes-textarea {
    border-radius: 8px !important;
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    resize: vertical;
    min-height: 100px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

#interacoes-textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(51, 89, 115, 0.1);
    background: #fafbfc;
}

#save-interaction-button {
    background: linear-gradient(135deg, var(--primary-color), #2a4a62);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

#save-interaction-button:hover {
    background: linear-gradient(135deg, #2a4a62, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 89, 115, 0.3);
}

#save-interaction-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#save-message {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    min-height: 20px;
    padding: 5px 0;
    transition: var(--transition);
}

.interacoes-historic-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #fafafa;
    margin-top: 10px;
}

.interacao-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
    transition: var(--transition);
}

.interacao-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.interacao-timestamp {
    font-size: 0.85em;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.interacao-texto {
    font-size: 0.95em;
    color: #333;
    line-height: 1.4;
    white-space: pre-wrap;
    background: white;
    padding: 10px 12px;
    border-left: 3px solid var(--secondary-color);
    border-radius: 0 5px 5px 0;
    margin: 0;
}

.badge {
    font-size: 0.9em;
    padding: 3px 8px;
    border-radius: 4px;
    background-color: var(--secondary-color) !important;
    color: white;
    font-weight: 500;
}

#copy-resumo-ia {
    margin-left: 10px;
    padding: 6px 12px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8em;
    white-space: nowrap;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#copy-resumo-ia:hover {
    background-color: #b39f83;
    transform: translateY(-1px);
}

.socios-list, .processos-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.socios-list li, .processos-list li {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: var(--transition);
}

.socios-list li:hover, .processos-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.whatsapp-link {
    color: #25d366 !important;
    text-decoration: none;
    transition: var(--transition);
}

.whatsapp-link:hover {
    color: #128C7E !important;
    transform: scale(1.1);
}

/* =========================================================================== */
/* 12. CONTROLES DE STATUS NO MODAL - MOVER CARD ENTRE COLUNAS */
/* =========================================================================== */

#lead-status-controls-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    margin: 15px 0;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
}

#modal-status-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 0;
}

.status-current-label {
    font-size: 14px;
    color: var(--text-color-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.status-current-label i {
    color: var(--primary-color);
}

.status-current-value {
    color: var(--primary-color);
    font-weight: 700;
}

.status-changer-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    min-width: 200px;
    transition: all 0.3s ease;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 32px;
}

.status-changer-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(51, 89, 115, 0.1);
    transform: translateY(-1px);
}

.status-changer-select:hover {
    border-color: var(--primary-color);
}

#confirm-status-move {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--success-color), #218838);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

#confirm-status-move:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838, var(--success-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

#confirm-status-move:active:not(:disabled) {
    transform: translateY(0);
}

#confirm-status-move:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

#confirm-status-move.loading {
    background: var(--warning-color);
    color: var(--text-color-dark);
    position: relative;
    overflow: hidden;
}

#confirm-status-move.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.status-control-integrated {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin: 10px 0;
}

.status-control-integrated .status-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.status-control-integrated .status-info i {
    color: var(--primary-color);
    font-size: 16px;
}

.status-control-integrated .status-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-content .modal-header-enhanced {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
    flex-wrap: wrap;
}

.modal-title-section {
    flex: 1;
    min-width: 250px;
}

.modal-title-section h2 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 1.4em;
    line-height: 1.3;
}

.modal-status-display {
    color: var(--secondary-color);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-controls-section {
    flex-shrink: 0;
    min-width: 300px;
}

.modal-content > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

/* =========================================================================== */
/* 13. MENSAGENS TEMPORÁRIAS */
/* =========================================================================== */

.temp-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    max-width: 350px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: opacity 0.3s, transform 0.3s;
    font-size: 15px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(100%);
}

.temp-message.show {
    opacity: 1;
    transform: translateX(0);
}

.temp-message.success { background-color: var(--success-color); }
.temp-message.error { background-color: var(--danger-color); }
.temp-message.info { background-color: var(--info-color); }
.temp-message.warning { background-color: var(--warning-color); color: var(--text-color-dark); }

/* =========================================================================== */
/* 14. CORES DAS FASES - ESTILOS ESSENCIAIS */
/* =========================================================================== */

.fase-azul { color: #007bff; background-color: #007bff; }
.fase-verde { color: #28a745; background-color: #28a745; }
.fase-verde-escuro { color: #1e7e34; background-color: #1e7e34; }
.fase-amarelo { color: #ffc107; background-color: #ffc107; }
.fase-laranja { color: #fd7e14; background-color: #fd7e14; }
.fase-vermelho { color: #dc3545; background-color: #dc3545; }
.fase-cinza { color: #6c757d; background-color: #6c757d; }

/* =========================================================================== */
/* 15. ANIMAÇÕES E ESTADOS ESPECIAIS PARA BOTÕES */
/* =========================================================================== */

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: buttonSpin 0.8s linear infinite;
}

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

.create-primary-btn:disabled,
.create-secondary-btn:disabled,
.quick-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #218838) !important;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800) !important;
    color: var(--text-color-dark) !important;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c82333) !important;
}

/* =========================================================================== */
/* 16. ACESSIBILIDADE */
/* =========================================================================== */

.create-primary-btn:focus-visible,
.create-secondary-btn:focus-visible,
.quick-action-btn:focus-visible,
.floating-main-btn:focus-visible,
.floating-sub-btn:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(51, 89, 115, 0.3);
}

@media (prefers-contrast: high) {
    .create-primary-btn,
    .create-secondary-btn {
        border: 2px solid currentColor;
    }
    
    .quick-action-btn {
        border-width: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .create-primary-btn,
    .create-secondary-btn,
    .quick-action-btn,
    .floating-main-btn,
    .floating-sub-btn {
        transition: opacity 0.3s ease;
    }
    
    .create-primary-btn::before,
    .btn-loading::after {
        display: none;
    }
}

/* =========================================================================== */
/* 17. RESPONSIVIDADE */
/* =========================================================================== */

@media (max-width: 1200px) {
    .filters-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr auto;
    }
    
    .filters-grid .filter-group-compact:nth-child(5) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 992px) {
    #top-header { height: 60px; padding: 0 20px; }
    #main-content-wrapper { padding-top: 60px; }
    
    .filters-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .search-group-compact {
        grid-column: 1 / -1;
    }
    
    .product-filters-integrated {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .product-filters-integrated .filter-group:last-child {
        grid-column: 1 / -1;
        justify-self: end;
    }

    .kanban-board {
        min-width: 280px !important;
        max-width: 320px !important;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 25px 20px;
    }

    .product-filters-container {
        padding: 15px;
    }
    
    .product-filters-container .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .product-filters-container .filter-group strong {
        min-width: auto;
        text-align: center;
    }
    
    .product-filter-btn {
        width: 100%;
        justify-content: center;
    }
    
    .product-select {
        min-width: 100%;
        width: 100%;
    }
    
    #clear-product-filters {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    #top-header { height: 55px; padding: 0 15px; }
    #main-content-wrapper { padding-top: 55px; }
    #control-panel { padding: 15px 15px 10px 15px; }
    #pipeline-title { font-size: 1.4em; margin-bottom: 10px; }
    
    .action-buttons-container {
        margin: 15px 0;
        gap: 10px;
        justify-content: center;
    }
    
    .create-primary-btn {
        padding: 16px 20px;
        font-size: 16px;
        flex: 1;
        min-width: 200px;
        justify-content: center;
        border-radius: 12px;
    }
    
    .create-secondary-btn {
        padding: 14px 18px;
        font-size: 15px;
        flex: 1;
        min-width: 160px;
        justify-content: center;
        border-radius: 10px;
    }
    
    .quick-action-btn {
        padding: 12px 16px;
        font-size: 14px;
        flex: 1;
        min-width: 140px;
        justify-content: center;
        border-radius: 10px;
    }
    
    .kanban-wrapper {
        padding: 10px 5px !important;
        height: auto !important;
        min-height: calc(100vh - 55px - 140px) !important; 
        overflow-x: hidden !important;
        overflow-y: auto !important;
        cursor: default !important;
        white-space: normal !important;
    }

    .kanban-wrapper:active {
        cursor: default !important;
    }

    .kanban-container {
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
        height: auto !important;
        width: 100% !important;
        padding: 0 10px 20px 10px !important;
    }

    .kanban-board {
        min-width: 95% !important;
        width: 98% !important;
        max-width: 98% !important;
        height: auto !important;
        max-height: 85vh !important;
        margin: 0 auto !important;
        overflow-y: hidden;
    }

    .kanban-board.collapsed {
        max-height: 65px;
        overflow: hidden;
    }

    .kanban-board-header {
        position: relative;
        cursor: pointer;
        padding: 15px 20px !important;
        user-select: none;
        font-size: 16px !important;
        min-height: 60px;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .kanban-board-header::after {
        content: '▼';
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
        font-size: 14px;
        transition: transform 0.3s ease;
        color: rgba(255, 255, 255, 0.9);
    }

    .kanban-board.collapsed .kanban-board-header::after {
        transform: translateY(-50%) rotate(-90deg);
    }

    .kanban-items-wrapper {
        overflow-y: auto;
        min-height: 200px;
        max-height: 70vh;
        padding: 12px;
    }

    .kanban-item {
        cursor: default !important; 
        padding: 14px !important;
        margin: 0 10px 12px 10px !important;
        border-radius: 10px !important;
    }
    
    .kanban-item[draggable="true"] {
        -webkit-user-drag: none !important;
        user-select: auto !important;
    }
    
    .kanban-board {
        border-radius: 14px !important;
    }
    
    .kanban-board-header {
        padding: 16px 18px !important;
        border-radius: 14px 14px 0 0 !important;
    }

    .modal-content { 
        margin: 5% auto; 
        padding: 20px 15px; 
        max-height: 95vh; 
        width: 98%;
    }

    .lead-detail-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .detail-group {
        flex-direction: column;
        gap: 10px;
    }

    .detail-group p {
        min-width: auto;
    }

    .interacoes-historic-container {
        max-height: 250px;
    }
    
    .temp-message {
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
        transform: none;
        max-width: none;
        font-size: 14px;
        padding: 12px 18px;
    }

    #lead-status-controls-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 0;
    }
    
    #modal-status-controls {
        justify-content: center;
        gap: 8px;
        flex-direction: column;
    }
    
    .status-changer-select {
        min-width: 100%;
        max-width: 100%;
    }
    
    #confirm-status-move {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }
    
    .status-current-label {
        justify-content: center;
        text-align: center;
    }
    
    .status-control-integrated {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .status-control-integrated .status-actions {
        width: 100%;
        justify-content: center;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .product-filters-integrated {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .action-buttons-compact {
        grid-column: 1 / -1;
        justify-content: center;
    }
    
    #toggle-filters-button {
        font-size: 0.75em;
        padding: 5px 10px;
        margin-left: 0;
    }
    
    .vendor-filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .floating-action-buttons {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-main-btn {
        width: 56px;
        height: 56px;
        font-size: 18px;
    }
    
    .floating-sub-btn {
        width: 46px;
        height: 46px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .status-changer-select {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    #confirm-status-move {
        font-size: 13px;
        padding: 10px 14px;
    }

    .product-filters-container {
        padding: 12px;
    }
    
    .product-filter-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .product-select {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    #pipeline-title {
        font-size: 1.3em;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    #toggle-filters-button {
        align-self: stretch;
        text-align: center;
        justify-content: center;
        width: 100%;
    }
    
    .filter-group-compact label {
        font-size: 0.75em;
    }
    
    .filter-group-compact .filter-select,
    .filter-group-compact #filter-valor {
        padding: 6px 8px;
        font-size: 0.8em;
    }
    
    #top-header {
        height: 55px;
        padding: 0 10px;
    }
    
    .header-logo-center {
        height: 35px;
    }
    
    .sidebar-toggle-button {
        font-size: 1.3rem;
    }
    
    .action-buttons-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .create-primary-btn,
    .create-secondary-btn,
    .quick-action-btn {
        min-width: 100%;
        width: 100%;
    }
    
    .kanban-wrapper {
        height: calc(100vh - 55px - 100px) !important;
    }
    
    .kanban-board-header {
        padding: 14px !important;
        font-size: 15px !important;
    }
    
    .kanban-item {
        padding: 12px !important;
        margin: 0 6px 8px 6px !important;
    }
    
    .lead-title {
        font-size: 13px;
    }
    
    .lead-meta-item {
        font-size: 11px;
    }
    
    .floating-action-buttons {
        bottom: 10px;
        right: 10px;
    }
    
    .floating-main-btn {
        width: 52px;
        height: 52px;
        font-size: 16px;
    }
    
    .floating-sub-btn {
        width: 42px;
        height: 42px;
        font-size: 13px;
    }
}

/* =========================================================================== */
/* 18. ANIMAÇÕES E TRANSITIONS ADICIONAIS */
/* =========================================================================== */

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

.kanban-item {
    animation: slideIn 0.3s ease-out;
}

.kanban-loading {
    opacity: 0.6;
    pointer-events: none;
}

.kanban-success {
    border-color: var(--success-color) !important;
    background: rgba(40, 167, 69, 0.05) !important;
}

.kanban-error {
    border-color: var(--danger-color) !important;
    background: rgba(220, 53, 69, 0.05) !important;
}

/* =========================================================================== */
/* 19. UTILITÁRIOS DE DEBUG (APENAS DESENVOLVIMENTO) */
/* =========================================================================== */

.debug-drag {
    border: 2px solid red !important;
}

.debug-drop {
    border: 2px solid blue !important;
}

.debug-hover {
    border: 2px solid green !important;
}

/* =========================================================================== */
/* 20. ESTILOS ESPECÍFICOS DO SIMULADOR E EDIÇÃO */
/* =========================================================================== */

.simulador-form-area .filter-select {
    height: 45px; 
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: white;
}

.simulador-form-area .filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color-dark);
}

@media (max-width: 768px) {
    .simulador-input-group {
        flex-direction: column;
        gap: 0 !important;
    }
}

.edit-field-btn {
    transition: all 0.3s ease;
}

.edit-field-btn:hover {
    background: var(--primary-color) !important;
    transform: translateY(-1px);
}

.save-field-btn {
    transition: all 0.3s ease;
}

.save-field-btn:hover {
    background: #218838 !important;
    transform: translateY(-1px);
}

.cancel-field-btn {
    transition: all 0.3s ease;
}

.cancel-field-btn:hover {
    background: #5a6268 !important;
    transform: translateY(-1px);
}

.produtos-lista-detalhes {
    margin-top: 10px;
}

.produto-item-detalhe {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--secondary-color);
}

.produto-icone {
    margin-right: 10px;
    font-size: 16px;
}

.produto-nome {
    flex: 1;
    font-weight: 500;
}

.produto-categoria {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.produto-categoria.has {
    background: #e3f2fd;
    color: #1976d2;
}

.produto-categoria.holder {
    background: #f3e5f5;
    color: #7b1fa2;
}

.produto-categoria.outros {
    background: #e8f5e8;
    color: #388e3c;
}

.categoria-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 15px;
    display: inline-block;
}

.categoria-badge.has {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.categoria-badge.holder {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

.categoria-badge.has-holder {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #5e35b1;
    border: 1px solid #d1c4e9;
}

.sem-produtos, .sem-descricao {
    color: #6c757d;
    font-style: italic;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.descricao-detalhes {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    line-height: 1.5;
}

/* =========================================================================== */
/* 21. CORREÇÕES E MELHORIAS ADICIONAIS */
/* =========================================================================== */

/* Melhoria na acessibilidade para leitores de tela */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Correção para elementos com display flex em navegadores antigos */
.kanban-container {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
}

/* Melhoria no contraste para acessibilidade */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #234567;
        --secondary-color: #856c4a;
        --text-color-dark: #000000;
    }
    
    .kanban-item {
        border: 2px solid #dee2e6;
    }
}

/* Suporte para modo escuro */
@media (prefers-color-scheme: dark) {
    .kanban-board {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%) !important;
        color: #e2e8f0;
    }
    
    .kanban-item {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
        color: #e2e8f0;
        border-color: #718096;
    }
}

/* Performance: reduzir animações quando solicitado */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Correção para Firefox */
@-moz-document url-prefix() {
    .kanban-wrapper {
        scrollbar-width: thin;
        scrollbar-color: #b8c1c9 #e9eef2;
    }
    
    .kanban-items-wrapper {
        scrollbar-width: thin;
        scrollbar-color: var(--primary-color) #f8f9fa;
    }
}

/* =========================================================================== */
/* CORREÇÃO DEFINITIVA PARA MODO ESCURO - DESATIVAR PARA KANBAN */
/* =========================================================================== */

/* ✅ FORÇAR SEMPRE MODO CLARO PARA O KANBAN */
.kanban-wrapper,
.kanban-container,
.kanban-board,
.kanban-items-wrapper,
.kanban-item,
.kanban-item * {
    color-scheme: light only !important;
    forced-color-adjust: none !important;
}

/* ✅ CORREÇÃO ESPECÍFICA PARA MODO ESCURO DO NAVEGADOR */
@media (prefers-color-scheme: dark) {
    .kanban-wrapper {
        background-color: var(--board-bg-color) !important;
    }
    
    .kanban-board {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
        color: var(--text-color-dark) !important;
    }
    
    .kanban-items-wrapper {
        background: #ffffff !important;
    }
    
    .kanban-item {
        background: #ffffff !important;
        color: var(--text-color-dark) !important;
        border-color: #f0f0f0 !important;
    }
    
    .kanban-item:hover {
        background: #f8f9fa !important;
    }
    
    .kanban-item.dragging {
        background: #ffffff !important;
    }
    
    /* ✅ GARANTIR QUE TODOS OS TEXTOS FIQUEM ESCUROS */
    .kanban-item .lead-title,
    .kanban-item .lead-meta-item,
    .kanban-item .lead-meta-item i,
    .kanban-item .lead-card-content,
    .kanban-item .lead-meta,
    .kanban-item .produto-badge,
    .kanban-item .mais-produtos {
        color: var(--text-color-dark) !important;
    }
}

/* ✅ CORREÇÃO EXTRA PARA NAVEGADORES MODERNOS */
.kanban-board {
    color-scheme: light !important;
}

.kanban-item {
    color-scheme: light !important;
}

/* ✅ REMOVER COMPLETAMENTE QUALQUER INFLUÊNCIA DO MODO ESCURO */
.kanban-wrapper {
    color-scheme: light only !important;
}

.kanban-container {
    color-scheme: light only !important;
}