/* ==========================================================================
   ESTILOS DO MÓDULO DE CLIENTES (MODELO DO SISTEMA)
   ========================================================================== */

/* Estilos do Kanban de Vendas / Produção */
.gd-kanban-wrapper {
    display: flex; gap: 1rem; overflow-x: visible; /*min-height: 60vh;*/ padding-bottom: 1rem;
    scroll-snap-type: x mandatory; scroll-padding: 0 1rem; -webkit-overflow-scrolling: touch; width: 100%;
}
.gd-kanban-col {
    flex: 1; min-width: 180px; scroll-snap-align: center;
    background: var(--bg-subtle); border-radius: 16px; border: 1px solid var(--border-color); display: flex; flex-direction: column;
}
@media (min-width: 1200px) {
    .gd-kanban-col { min-width: 210px; }
}
@media (min-width: 1600px) {
    .gd-kanban-col { min-width: 260px; }
}
.gd-kanban-header {
    padding: 15px; border-bottom: 2px solid var(--border-color); display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-surface); border-top-left-radius: 16px; border-top-right-radius: 16px;
}
.gd-kanban-producao-list {
    padding: 10px; flex-grow: 1; overflow-y: auto; min-height: 200px;
    display: flex; flex-direction: column; gap: 10px;
}
.gd-kanban-card {
    background: var(--bg-surface) !important; border: 1px solid var(--border-color); border-radius: 12px !important;
    padding: 15px !important; margin-bottom: 10px !important; cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
}
.gd-kanban-card:hover {
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
    border-color: var(--color-accent);
}
/* Card selecionado via bulk-select */
.gd-kanban-card:has(.bulk-select-row:checked) {
    border-color: var(--color-accent, #017dd3) !important;
    background: rgba(1, 125, 211, 0.04) !important;
    box-shadow: 0 0 0 3px rgba(1, 125, 211, 0.1) !important;
}

/* Efeito de Drag and Drop (SortableJS) */
.gd-sortable-chosen {
    transform: scale(1.01) rotate(0deg) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    z-index: 9999 !important;
    cursor: grabbing !important;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s !important;
}
.gd-sortable-drag {
    opacity: 0.95 !important;
}
.gd-sortable-ghost {
    transform: none !important; box-shadow: none !important; opacity: 0.3 !important;
}

/* Bell shake animation */
@keyframes bell-shake-grow {
    0% { transform: scale(1) rotate(0deg); }
    15% { transform: scale(1.3) rotate(-15deg); }
    30% { transform: scale(1.3) rotate(15deg); }
    45% { transform: scale(1.3) rotate(-15deg); }
    60% { transform: scale(1.3) rotate(15deg); }
    75% { transform: scale(1.3) rotate(-15deg); }
    100% { transform: scale(1) rotate(0deg); }
}
.ds-bell-alert {
    animation: bell-shake-grow 1.5s ease-in-out infinite;
    color: #dc3545 !important; display: inline-block; transform-origin: top center;
}
.nav-link.active .ds-bell-alert {
    color: #fff !important;
}

/* Offcanvas flutuante e responsivo */
@media (min-width: 768px) {
    .ds-offcanvas-floating {
        height: 96vh !important;
        top: 2vh !important;
        bottom: 2vh !important;
        right: 2vh !important;
        border-radius: 16px !important;
        box-shadow: -5px 0 25px rgba(0,0,0,0.15) !important;
        z-index: 1060 !important;
    }
}

/* KPIs em visualização Mobile */
@media (max-width: 991px) {
    .ds-kpi-row-scroller {
        display: flex !important; overflow-x: auto !important; flex-wrap: nowrap !important;
        gap: 0.75rem !important; padding-bottom: 0.5rem; width: 100% !important; max-width: 100% !important;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .ds-kpi-row-scroller::-webkit-scrollbar {
        display: none;
    }
    .ds-kpi-row-scroller > .col {
        flex: 0 0 65vw !important; max-width: 65vw !important;
    }
}

/* Estilo do Card de Grade (produtos.php style) */
.ds-kpi-card {
    padding: 1.2rem; border-radius: 16px; overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.015); position: relative;
    background: #ffffff; border: 1px solid #ebebeb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ds-kpi-card:hover {
    transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    border-color: rgba(1, 125, 211, 0.1);
}
.ds-kpi-card::before {
    content: ""; position: absolute; left: 0; top: 7%; height: 16%; width: 5px;
    border-radius: 0 16px 16px 0; background-color: var(--color-accent, #017dd3);
}

.ds-grid-client-card {
    background: #ffffff !important; border-radius: 1.25rem !important;
    box-shadow: none !important; padding: 1.25rem !important;
}
.ds-grid-client-card-col {
    margin-bottom: 0.25rem !important; padding-top: 0px !important; padding-bottom: 0px !important;
}
.ds-filter-link-icon {
    padding: 0.45rem 0.8rem !important; display: inline-flex !important;
    align-items: center !important; justify-content: center !important;
}

/* Botões de Ação Padronizados para Evitar Bootstrap */
.ds-btn-success-pill {
    background-color: var(--color-success, #10B981) !important; color: #ffffff !important;
    border: none !important; border-radius: 50rem !important; padding: 0.5rem 1.5rem !important;
    font-family: 'Google Sans', sans-serif !important; font-weight: 700 !important;
    font-size: 0.9rem !important; display: inline-flex !important; align-items: center !important;
    justify-content: center !important; gap: 8px !important; transition: all 0.2s ease-in-out !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.12) !important; cursor: pointer !important;
}
.ds-btn-success-pill:hover {
    background-color: #0d9668 !important; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
    transform: translateY(-1px) !important;
}

.ds-btn-light-pill {
    background-color: #f1f5f9 !important; border: 1px solid #e2e8f0 !important;
    color: #475569 !important; border-radius: 50rem !important; padding: 0.5rem 1.5rem !important;
    font-family: 'Google Sans', sans-serif !important; font-weight: 700 !important;
    font-size: 0.9rem !important; display: inline-flex !important; align-items: center !important;
    justify-content: center !important; gap: 8px !important; transition: all 0.2s ease-in-out !important;
    cursor: pointer !important;
}
.ds-btn-light-pill:hover {
    background-color: #e2e8f0 !important; color: #0f172a !important;
}

.ds-btn-outline-light-pill {
    background-color: transparent !important; border: 1px solid rgba(255,255,255,0.4) !important;
    color: #ffffff !important; border-radius: 50rem !important; padding: 0.25rem 1rem !important;
    font-size: 0.875rem !important; transition: all 0.2s ease-in-out !important; cursor: pointer !important;
}
.ds-btn-outline-light-pill:hover {
    background-color: rgba(255,255,255,0.1) !important; border-color: #ffffff !important;
}

.ds-btn-primary-pill-custom {
    background-color: var(--color-accent, #017dd3) !important; color: #ffffff !important;
    border: none !important; border-radius: 50rem !important; padding: 0.5rem 1.5rem !important;
    font-family: 'Google Sans', sans-serif !important; font-weight: 700 !important;
    font-size: 0.9rem !important; display: inline-flex !important; align-items: center !important;
    justify-content: center !important; gap: 8px !important; transition: all 0.2s ease-in-out !important;
    box-shadow: 0 2px 4px rgba(1, 125, 211, 0.12) !important; cursor: pointer !important;
}
.ds-btn-primary-pill-custom:hover {
    background-color: #016cb6 !important; box-shadow: 0 4px 12px rgba(1, 125, 211, 0.2) !important;
}

.ds-btn-primary-mobile-floating {
    z-index: 1040; position: fixed; bottom: 76px; right: 20px;
    width: 44px; height: 44px; font-size: 1.2rem;
    background-color: var(--color-accent, #017dd3) !important; color: #ffffff !important;
    border: none !important; border-radius: 50% !important; display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(1, 125, 211, 0.3) !important; transition: all 0.2s ease-in-out !important;
}
.ds-btn-primary-mobile-floating:hover {
    transform: translateY(-2px); box-shadow: 0 6px 16px rgba(1, 125, 211, 0.4) !important;
}

/* Cores de Texto Utilitárias */
.ds-text-danger { color: var(--color-danger, #ef4444) !important; }
.ds-text-success { color: var(--color-success, #10b981) !important; }
.ds-text-warning { color: var(--color-warning, #f59e0b) !important; }
.ds-text-info { color: var(--color-info, #0ea5e9) !important; }

/* Otimização de Responsividade e Modos Mobile do Kanban */
@media (max-width: 991px) {
    .gd-kanban-wrapper {
        width: 100% !important; max-width: 100vw !important; overflow-x: hidden !important;
        scroll-snap-type: none !important; padding-bottom: 0.5rem !important; min-height: auto !important;
    }
    /* Ocultar colunas do Kanban no mobile por padrão */
    .gd-kanban-col {
        display: none !important;
    }
    /* Exibir apenas a coluna ativa no mobile */
    .gd-kanban-col.active-mobile {
        display: flex !important; flex: 0 0 100% !important;
        min-width: 100% !important; max-width: 100% !important;
        animation: fadeIn 0.25s ease-out;
    }
    .gd-kanban-producao-list {
        gap: 0.75rem !important; padding: 0.75rem !important;
    }
    .gd-kanban-card {
        background: var(--bg-surface) !important; border-radius: 16px !important;
        padding: 16px !important; border: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.02) !important; margin-bottom: 0 !important;
    }
    .gd-stage-tabs-container::-webkit-scrollbar {
        display: none !important;
    }
}
@media (max-width: 576px) {
    .gd-kanban-producao-list {
        max-height: calc(100vh - 320px) !important;
    }
}

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

/* Custom badges */
.ds-badge-primary {
    color: var(--color-accent, #017dd3) !important;
    background-color: rgba(1, 125, 211, 0.1) !important;
}

/* Stage tab and mobile filter buttons */
.gd-btn-stage-tab {
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 50rem;
    padding: 0.5rem 0.9rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    background: var(--bg-subtle);
    color: var(--text-muted);
    cursor: pointer;
}
.gd-stage-tab-badge {
    background: var(--border-color);
    color: var(--text-muted);
    font-size: 0.72rem;
}

.ds-mobile-filter-link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.625rem 1rem !important;
    font-size: 1rem !important;
    border-radius: 0.5rem !important;
    text-decoration: none !important;
    transition: all 0.2s ease-in-out !important;
}

.gd-stage-tabs-container {
    margin-bottom: 1rem;
    padding: 0.25rem 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /*border-bottom: 1px solid rgba(0,0,0,0.06);*/
}


/* ==========================================================================
   ESTILOS ADICIONADOS DO KANBAN DE PRODUÇÃO
   ========================================================================== */
/* Quick Actions Premium Chips */
.quick-action-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.03);
}
.quick-action-chip i {
    font-size: 0.82rem;
}
.quick-action-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    text-decoration: none;
}
.quick-action-chip.chip-icon-only {
    width: 28px;
    padding: 0;
    border-radius: 50%;
}

/* WhatsApp */
.chip-whatsapp {
    color: #1e7e34;
    background-color: rgba(25, 135, 84, 0.08);
    border-color: rgba(25, 135, 84, 0.15);
}
.chip-whatsapp:hover {
    color: #1e7e34;
    background-color: rgba(25, 135, 84, 0.15);
    border-color: rgba(25, 135, 84, 0.3);
}

/* Contract Pending */
.chip-contract-pending {
    color: #d97706;
    background-color: rgba(217, 119, 6, 0.08);
    border-color: rgba(217, 119, 6, 0.15);
}
.chip-contract-pending:hover {
    color: #d97706;
    background-color: rgba(217, 119, 6, 0.15);
    border-color: rgba(217, 119, 6, 0.3);
}

/* Selection Awaiting */
.chip-selection-awaiting {
    color: #64748b;
    background-color: rgba(100, 116, 139, 0.08);
    border-color: rgba(100, 116, 139, 0.15);
}
.chip-selection-awaiting:hover {
    color: #64748b;
    background-color: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.3);
}

/* Selection Selecting */
.chip-selection-selecting {
    color: #0284c7;
    background-color: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.15);
}
.chip-selection-selecting:hover {
    color: #0284c7;
    background-color: rgba(2, 132, 199, 0.15);
    border-color: rgba(2, 132, 199, 0.3);
}

/* Selection Done */
.chip-selection-done {
    color: #16a34a;
    background-color: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.15);
}
.chip-selection-done:hover {
    color: #16a34a;
    background-color: rgba(22, 163, 74, 0.15);
    border-color: rgba(22, 163, 74, 0.3);
}

/* Client Details / Settings */
.chip-client-details {
    color: #475569;
    background-color: rgba(71, 85, 105, 0.08);
    border-color: rgba(71, 85, 105, 0.15);
}
.chip-client-details:hover {
    color: #475569;
    background-color: rgba(71, 85, 105, 0.15);
    border-color: rgba(71, 85, 105, 0.3);
}

/* --- Correções de Layout Específicas para o Kanban --- */
@media (max-width: 991px) {
    main.main-content {
        padding-bottom: 90px !important;
    }
    
    /* Quick Action Chips Mobile Optimization (Largura e Toque) */
    .quick-action-chip {
        height: 32px;
        padding: 0 12px;
        font-size: 0.75rem;
    }
    .quick-action-chip.chip-icon-only {
        width: 32px;
        padding: 0;
    }
}

/* Estilos dos Cards de Lista no Mobile */
.mobile-list-card {
    background: var(--bg-surface) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02) !important;
    padding: 16px !important;
    border: 1px solid var(--border-color) !important;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mobile-list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.04) !important;
}

/* Ajustes da Barra de Ações em Massa no Mobile (flutua acima do menu-bottom de 72px) */
@media (max-width: 991px) {
    #massActionBar {
        bottom: 58px !important;
        z-index: 1070 !important;
    }
}
@media (max-width: 576px) {
    #massActionBar {
        width: 94% !important;
        padding: 10px 16px !important;
        bottom: 82px !important;
        border-radius: 20px !important;
        justify-content: space-between !important;
    }
    #massActionBar form {
        width: 100% !important;
        justify-content: flex-end !important;
    }
    #massActionBar form select {
        max-width: 130px !important;
        font-size: 0.75rem !important;
        padding: 6px 20px 6px 10px !important;
    }
    #massActionBar form button {
        font-size: 0.75rem !important;
        padding: 6px 16px !important;
    }
}

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


/* ==========================================================================
   MENUS PREGUIÇOSOS DA LISTA
   Estilos que antes saíam como style="" repetido dentro de cada linha da
   tabela. O conteúdo destes menus é montado por js/pages/clientes-main.js no
   primeiro clique — por isso as regras miram nos filhos gerados pelo JS.
   ========================================================================== */

/* Dupla classe de proposito: .dropdown-menu do Bootstrap tem a mesma
   especificidade e carrega depois, entao venceria o min-width no empate. */
.dropdown-menu.gd-menu-status {
    font-size: 0.85rem;
    min-width: 170px;
    padding: 0.4rem;
}

.gd-menu-status-item {
    transition: all 0.2s;
}

.gd-menu-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.gd-menu-check {
    font-size: 0.75rem;
}
