/* custom-theme.css */

/* --- Fontes Modernas --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --primary-glow: 255, 0, 128;
    /* Magenta Neon */
    --secondary-glow: 0, 255, 255;
    /* Cyan Neon */
}

body {
    font-family: var(--font-body);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
}

/* --- Fundo Estático (Gradiente do canto direito para esquerdo) --- */
/* NOTA: Fundo animado original documentado no CHANGELOG v1.9.12 para reversão */
.bg-animated {
    background:
        radial-gradient(ellipse at 85% 30%, rgba(0, 180, 216, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 70%, rgba(5, 117, 230, 0.10) 0%, transparent 55%),
        radial-gradient(circle at 90% 50%, rgb(0, 20, 40) 0%, rgb(0, 0, 0) 75%);
    width: 100%;
}

/* --- Scrollbar Global (Tema Azul) --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(5, 117, 230, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(5, 117, 230, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(5, 117, 230, 0.5);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(5, 117, 230, 0.3) rgba(0, 0, 0, 0.2);
}

/* --- Glassmorphism Card --- */
.glass-card {
    background: rgba(30, 30, 30, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    position: relative;
    z-index: 10;
}

/* --- Sidebar: Flush Edge Layout (V2) --- */
#sidebar {
    background: linear-gradient(180deg, rgba(15, 15, 25, 0.95) 0%, rgba(10, 10, 20, 0.98) 100%) !important;
    border-right: 1px solid rgb(55, 65, 81) !important; /* border-gray-700: igual ao topbar border-b */
    border-radius: 0 !important;
    border-top: none !important;
    border-left: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    /* Transição combinada: transform (slide mobile) + width/opacity (collapse desktop) */
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
                width 0.3s ease,
                min-width 0.3s ease,
                opacity 0.3s ease !important;
}

/* Mobile: usa svh (small viewport height) para não ultrapassar a barra de nav do sistema */
@media (max-width: 767px) {
    #sidebar {
        bottom: auto !important; /* remove o bottom:0 do inset-y-0 no mobile */
        height: 100svh !important; /* small viewport height = área visível sem barra de nav */
    }
}

/* Sidebar colapsado via hamburger no desktop */
#sidebar.sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* Menu title separators */
#sidebar .menu-title {
    letter-spacing: 0.1em;
    position: relative;
    padding-left: 24px;
}

#sidebar .menu-title::before {
    content: '';
    position: absolute;
    left: 24px;
    bottom: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #0575e6, transparent);
    border-radius: 1px;
}

/* Active menu item */
#sidebar li>a.active,
#sidebar li>a[href*="home"] {
    background: linear-gradient(90deg, rgba(5, 117, 230, 0.15), transparent) !important;
    border-left: 3px solid #0575e6;
    color: white !important;
}

#sidebar li>a.active i,
#sidebar li>a[href*="home"] i {
    color: #0575e6 !important;
}

/* Hover glow on menu items */
#sidebar li>a:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    border-left: 3px solid rgba(5, 117, 230, 0.4);
}

/* Submenu styling */
#sidebar .submenu {
    border-left: 2px solid rgba(5, 117, 230, 0.15);
    margin-left: 32px;
    position: relative !important;
    z-index: 1;
    width: auto;
}

#sidebar .submenu li a {
    transition: all 0.2s ease;
}

#sidebar .submenu li a:hover {
    color: #60a5fa !important;
    padding-left: 44px;
}

/* Sidebar logo area — mesma cor do topbar (bg-gray-900) */
#sidebar>div:first-child>div:first-child {
    background: rgb(17, 24, 39) !important; /* = bg-gray-900, igual ao topbar */
}

/* Logout button enhancement */
#sidebar .border-t a[href*="logout"] {
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- Input Moderno --- */
.input-group-modern {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-modern {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1rem 1rem 3rem;
    /* Espaço para ícone */
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-modern:focus {
    border-color: rgba(var(--secondary-glow), 0.8);
    box-shadow: 0 0 15px rgba(var(--secondary-glow), 0.3);
    background: rgba(0, 0, 0, 0.5);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.input-modern:focus+.input-icon {
    color: rgba(var(--secondary-glow), 1);
}

/* --- Botão Neon --- */
.btn-neon {
    background: linear-gradient(135deg, #00f260 0%, #0575e6 100%);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-display);
    text-transform: uppercase;
}

.btn-neon:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(5, 117, 230, 0.4);
}

.btn-neon:active {
    transform: translateY(0);
}

/* --- Utilitários de Texto --- */
.text-gradient {
    background: linear-gradient(to right, #00f260, #0575e6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.text-white-dim {
    color: rgba(255, 255, 255, 0.7);
}

/* --- Checkbox Personalizado --- */
.custom-checkbox-modern {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.custom-checkbox-modern input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s;
}

.custom-checkbox-modern input:checked+.checkmark {
    background: #0575e6;
    border-color: #0575e6;
}

.custom-checkbox-modern input:checked+.checkmark::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

/* ========================================================
   DataTables - Estilos Customizados para Clientes Vencendo
   ======================================================== */

/* --- Wrapper geral --- */
.glass-table-wrapper .dataTables_wrapper {
    color: #d1d5db;
}

/* --- Select "Mostrar X registros" --- */
.glass-table-wrapper .dataTables_length select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e5e7eb;
    padding: 6px 28px 6px 12px;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    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='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 6px center;
    background-repeat: no-repeat;
    background-size: 18px;
}

.glass-table-wrapper .dataTables_length select:focus {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.glass-table-wrapper .dataTables_length label {
    font-size: 0.85rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Campo de Busca */
.glass-table-wrapper .dataTables_filter {
    margin-left: auto;
    margin-bottom: 0 !important;
}

.glass-table-wrapper .dataTables_filter label {
    font-size: 0.85rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.glass-table-wrapper .dataTables_filter input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e5e7eb;
    padding: 8px 14px 8px 32px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
    min-width: 180px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 14px;
}

.glass-table-wrapper .dataTables_filter input:focus {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
    background-color: rgba(255, 255, 255, 0.12);
}

.glass-table-wrapper .dataTables_filter input::placeholder {
    color: #6b7280;
}

/* --- Radio Buttons (Scope Filter) --- */
.glass-table-wrapper .scope-filter {
    margin-bottom: 12px;
}

.glass-table-wrapper .scope-filter label {
    font-size: 0.85rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.glass-table-wrapper .scope-filter label:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

.glass-table-wrapper .scope-filter input[type="radio"] {
    accent-color: #ef4444;
    margin-right: 4px;
}

/* --- Cabeçalho da Tabela --- */
.glass-table-wrapper table.dataTable thead th {
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

/* --- Linhas da Tabela --- */
.glass-table-wrapper table.dataTable tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.glass-table-wrapper table.dataTable tbody tr:hover {
    background: rgba(239, 68, 68, 0.06) !important;
}

.glass-table-wrapper table.dataTable tbody td {
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #d1d5db;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.glass-table-wrapper table.dataTable tbody tr:last-child td {
    border-bottom: none;
}

/* --- Botões de Ação da Tabela --- */
.glass-table-wrapper table.dataTable .btn,
.glass-table-wrapper table.dataTable a[class*="btn"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    transition: all 0.2s;
    cursor: pointer;
    margin: 0 2px;
    padding: 0;
    text-decoration: none;
}

.glass-table-wrapper table.dataTable .btn:hover,
.glass-table-wrapper table.dataTable a[class*="btn"]:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Botão renovar (verde) */
.glass-table-wrapper .renovar_cliente {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

.glass-table-wrapper .renovar_cliente:hover {
    background: rgba(16, 185, 129, 0.3) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #a7f3d0 !important;
}

/* Botão WhatsApp */
.glass-table-wrapper .whatsapp_aviso {
    background: rgba(37, 211, 102, 0.15) !important;
    border-color: rgba(37, 211, 102, 0.3) !important;
    color: #25d366 !important;
}

.glass-table-wrapper .whatsapp_aviso:hover {
    background: rgba(37, 211, 102, 0.3) !important;
    border-color: rgba(37, 211, 102, 0.5) !important;
    color: #4ade80 !important;
}

/* --- Info "Mostrando de X até Y" --- */
.glass-table-wrapper .dataTables_info {
    font-size: 0.8rem;
    color: #6b7280;
    padding-top: 12px;
}

/* --- Paginação --- */
.glass-table-wrapper .dataTables_paginate {
    padding-top: 12px;
}

.glass-table-wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    margin: 0 3px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af !important;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
}

.glass-table-wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

.glass-table-wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: transparent !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.glass-table-wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* --- Processing indicator --- */
.glass-table-wrapper .dataTables_processing {
    background: rgba(15, 15, 20, 0.9) !important;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 0.9rem;
}

/* --- Responsivo: collapse children --- */
.glass-table-wrapper table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control::before {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    border-radius: 6px;
}

/* --- Custom scrollbar para overflow horizontal --- */
.glass-table-wrapper {
    overflow-x: auto;
}

.glass-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.glass-table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}

.glass-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(239, 68, 68, 0.3);
    border-radius: 3px;
}

.glass-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 68, 68, 0.5);
}

/* =========================================
   Mobile — Toolbar centralizado
   ========================================= */
@media (max-width: 768px) {
    .vencendo-toolbar {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        gap: 10px !important;
    }

    .vencendo-toolbar .dataTables_length {
        order: 1;
    }

    .vencendo-toolbar .scope-filter {
        order: 2;
    }

    .vencendo-toolbar .dataTables_filter {
        order: 3;
        margin-left: 0 !important;
        width: 100%;
    }

    .vencendo-toolbar .dataTables_filter label {
        justify-content: center;
    }

    .vencendo-toolbar .dataTables_filter input {
        width: 100%;
        min-width: unset;
    }

    .vencendo-toolbar .dataTables_length label {
        justify-content: center;
    }
}

/* =========================================
   Alertify — Tema Dark Glassmorphism
   ========================================= */

/* Dialog container */
.alertify .ajs-dialog {
    background: rgba(20, 20, 30, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.1) !important;
    color: #e5e7eb !important;
    overflow: hidden;
}

/* Header */
.alertify .ajs-header {
    background: rgba(255, 255, 255, 0.04) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: white !important;
    font-weight: 700 !important;
    padding: 16px 20px !important;
    border-radius: 16px 16px 0 0 !important;
}

/* Body */
.alertify .ajs-body {
    color: #d1d5db !important;
}

.alertify .ajs-body .ajs-content {
    color: #d1d5db !important;
    padding: 20px !important;
}

/* Textarea dentro do dialog */
.alertify .ajs-body textarea,
.alertify .ajs-body .form-control {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    color: #e5e7eb !important;
    padding: 12px !important;
    font-size: 0.9rem !important;
}

.alertify .ajs-body textarea:focus,
.alertify .ajs-body .form-control:focus {
    border-color: rgba(5, 117, 230, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(5, 117, 230, 0.15) !important;
    outline: none !important;
}

/* Select/input dentro do dialog */
.alertify .ajs-body select.form-control {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    color: #e5e7eb !important;
    padding: 8px 12px !important;
    appearance: none;
    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='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
}

/* Texto dentro do dialog */
.alertify .ajs-body p,
.alertify .ajs-body strong,
.alertify .ajs-body label {
    color: #d1d5db !important;
}

.alertify .ajs-body strong {
    color: white !important;
}

.alertify .ajs-body hr {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Footer */
.alertify .ajs-footer {
    background: rgba(255, 255, 255, 0.03) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 12px 20px !important;
    border-radius: 0 0 16px 16px !important;
}

/* Botões */
.alertify .ajs-footer .ajs-buttons .ajs-button {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    color: #d1d5db !important;
    padding: 8px 18px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

.alertify .ajs-footer .ajs-buttons .ajs-button:hover {
    background: rgba(5, 117, 230, 0.2) !important;
    border-color: rgba(5, 117, 230, 0.4) !important;
    color: white !important;
}

/* Botão OK/Primary */
.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok {
    background: linear-gradient(135deg, #0575e6, #00b4d8) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(5, 117, 230, 0.3) !important;
}

.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok:hover {
    box-shadow: 0 4px 12px rgba(5, 117, 230, 0.5) !important;
    transform: translateY(-1px);
}

/* Botão Cancel */
.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-cancel {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-cancel:hover {
    background: rgba(239, 68, 68, 0.3) !important;
}

/* Dimmer/overlay */
.alertify .ajs-dimmer {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px);
}

/* Close/resize buttons */
.alertify .ajs-close,
.alertify .ajs-maximize,
.alertify .ajs-reset {
    color: #9ca3af !important;
}

.alertify .ajs-close:hover {
    color: white !important;
}

/* =========================================
   Modal Recado — Estilos de conteúdo
   ========================================= */
#modal-recado-conteudo {
    font-size: 0.9rem;
    line-height: 1.7;
}

#modal-recado-conteudo p {
    margin-bottom: 0.75em;
}

#modal-recado-conteudo a {
    color: #60a5fa;
    text-decoration: underline;
}

#modal-recado-conteudo a:hover {
    color: #93c5fd;
}

#modal-recado-conteudo img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

/* --- Select / Dropdown Dark Theme (global v2) --- */
select option {
    background: #1e293b !important;
    color: #e5e7eb !important;
}

select option:hover,
select option:checked {
    background: #3b82f6 !important;
    color: #fff !important;
}

/* ============================== */
/* Glass DataTable Theme (v2)     */
/* ============================== */

/* Table base */
.glass-datatable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
}

.glass-datatable thead th {
    background: rgba(255, 255, 255, 0.03) !important;
    color: #9ca3af !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-top: none !important;
    white-space: nowrap !important;
}

.glass-datatable tbody tr {
    background: transparent !important;
    transition: all 0.15s ease !important;
}

.glass-datatable tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

.glass-datatable tbody td {
    color: #e5e7eb !important;
    font-size: 0.85rem !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-top: none !important;
    vertical-align: middle !important;
}

/* Stripe alternation */
.glass-datatable tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015) !important;
}

/* Pagination Buttons (Global override for .glass-table-wrapper context) */
.glass-table-wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    margin: 0 2px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: transparent !important;
    color: #9ca3af !important;
    font-size: 0.8rem !important;
    transition: all 0.15s !important;
    cursor: pointer !important;
}

.glass-table-wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(96, 165, 250, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
}

.glass-table-wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
    color: #fff !important;
    border-color: transparent !important;
    font-weight: 600 !important;
}

.glass-table-wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.3 !important;
    cursor: default !important;
}

/* Processing indicator */
.dataTables_processing {
    background: rgba(15, 23, 42, 0.95) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(96, 165, 250, 0.2) !important;
    border-radius: 12px !important;
    padding: 16px 24px !important;
    font-size: 0.85rem !important;
    z-index: 50 !important;
}

/* Force dtr-control (Plus/Minus icon) visibility — supports both inline and column modes */
table.dataTable td.dtr-control,
table.dataTable th.dtr-control {
    position: relative;
    padding-left: 30px !important;
    cursor: pointer;
}

table.dataTable td.dtr-control:before,
table.dataTable th.dtr-control:before {
    top: 50%;
    left: 5px;
    height: 14px;
    width: 14px;
    margin-top: -7px;
    display: block;
    position: absolute;
    color: white;
    border: 2px solid white;
    border-radius: 14px;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
    box-sizing: content-box;
    text-align: center;
    text-indent: 0 !important;
    font-family: 'Courier New', Courier, monospace;
    line-height: 14px;
    content: '+';
    background-color: #3b82f6;
}

table.dataTable tr.dtr-expanded td.dtr-control:before,
table.dataTable tr.parent td.dtr-control:before,
table.dataTable tr.dtr-expanded th.dtr-control:before,
table.dataTable tr.parent th.dtr-control:before {
    content: '-';
    background-color: #d33333;
    box-shadow: 0 0 6px rgba(211, 51, 51, 0.4);
}

/* Hide control column header text */
table.dataTable thead th.dtr-control {
    font-size: 0;
}

/* =========================================
   Bootstrap text-colors restaurados (Tailwind CDN sobrescreve)
   Afeta: indicadores de status em tabelas v2
   (gerador_evolution, gerador_kinbox, revendedores, etc.)
   ========================================= */
.text-success,
i.text-success,
span.text-success {
    color: #28a745 !important;
}

.text-danger,
i.text-danger,
span.text-danger {
    color: #dc3545 !important;
}

.text-warning,
i.text-warning,
span.text-warning {
    color: #ffc107 !important;
}

.text-info,
i.text-info,
span.text-info {
    color: #17a2b8 !important;
}

.text-muted,
i.text-muted,
span.text-muted {
    color: #6c757d !important;
}

/* Bolinha de status — fa-circle com tamanho menor e alinhamento vertical */
i.fa-circle {
    font-size: 0.6rem;
    vertical-align: middle;
    margin-right: 5px;
}

/* =========================================
   Tooltip customizado para botões v2
   ========================================= */
.btn2-tooltip {
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 7px;
    pointer-events: none;
    white-space: normal;
    word-break: break-word;
    max-width: min(320px, 90vw);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: tooltipFadeIn 0.12s ease;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Alertify — Largura mínima e alinhamento
   ========================================= */
.alertify .ajs-dialog {
    min-width: 420px !important;
    max-width: 600px !important;
    width: auto !important;
}

@media (max-width: 500px) {
    .alertify .ajs-dialog {
        min-width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
    }
}

/* Garante que os elementos dentro do content não transbordem */
.alertify .ajs-body .ajs-content>div,
.alertify .ajs-body .ajs-content form {
    width: 100% !important;
    box-sizing: border-box !important;
}

.alertify .ajs-body .ajs-content input[type="text"],
.alertify .ajs-body .ajs-content input[type="number"],
.alertify .ajs-body .ajs-content select,
.alertify .ajs-body .ajs-content textarea {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* =========================================
   Action Toolbar — Botões de Ações Rápidas (v2)
   Clientes : .action-toolbar > div.action   > buttons
   Revendedores: .action-toolbar > div.action > div.actions > buttons
   Desktop: 40×40px, gap: 10px
   Mobile : 44×44px, gap: 12px
   ========================================= */

/* Wrapper externo */
.action-toolbar {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Container intermediário (JS injeta div.action) — vira flex */
.action-toolbar .action {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Container PHP dos revendedores (div.actions text-center) — também flex */
.action-toolbar .actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
}

/* Zera margens Bootstrap em TODOS os descendentes
   (PHP injeta mr-2, ml-1 etc. que conflitam com gap) */
.action-toolbar .action>*,
.action-toolbar .action>*>*,
.action-toolbar .actions>*,
.action-toolbar .actions>*>* {
    margin: 0 !important;
}

/* ── Reset total + tamanho fixo em TODOS os botões ── */
.action-toolbar .action>a,
.action-toolbar .action>button,
.action-toolbar .action .btn,
.action-toolbar .actions>a,
.action-toolbar .actions>button,
.action-toolbar .actions .btn {
    /* Tamanho */
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;

    /* Layout interno */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* Visual */
    border-radius: 10px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.07) !important;
    color: #cbd5e1 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background 0.15s, border-color 0.15s, transform 0.12s, color 0.15s !important;
    box-shadow: none !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

/* ── Hover — desktop ── */
.action-toolbar .action>a:hover,
.action-toolbar .action>button:hover,
.action-toolbar .action .btn:hover,
.action-toolbar .actions>a:hover,
.action-toolbar .actions>button:hover,
.action-toolbar .actions .btn:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}

/* ══════════════════════════════════════════
   VARIANTES DE COR — Clientes
══════════════════════════════════════════ */

/* Renovar — verde */
.action-toolbar .renovar_cliente {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

.action-toolbar .renovar_cliente:hover {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #a7f3d0 !important;
}

/* Excluir cliente — vermelho */
.action-toolbar .excluir_cliente {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

.action-toolbar .excluir_cliente:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #fecaca !important;
}

/* Banir / Desbanir — laranja */
.action-toolbar .banirDesbanir_cliente {
    background: rgba(249, 115, 22, 0.12) !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
    color: #fdba74 !important;
}

.action-toolbar .banirDesbanir_cliente:hover {
    background: rgba(249, 115, 22, 0.25) !important;
    border-color: rgba(249, 115, 22, 0.5) !important;
}

/* Bloquear/Desbloquear cliente — amarelo */
.action-toolbar .blockDesblock_cliente {
    background: rgba(250, 204, 21, 0.10) !important;
    border-color: rgba(250, 204, 21, 0.3) !important;
    color: #fde68a !important;
}

.action-toolbar .blockDesblock_cliente:hover {
    background: rgba(250, 204, 21, 0.22) !important;
    border-color: rgba(250, 204, 21, 0.5) !important;
}

/* Link de Pagamento — azul */
.action-toolbar .gerar_link_pagamento {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
}

.action-toolbar .gerar_link_pagamento:hover {
    background: rgba(59, 130, 246, 0.25) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

/* ══════════════════════════════════════════
   VARIANTES DE COR — Revendedores
══════════════════════════════════════════ */

/* Créditos — verde esmeralda */
.action-toolbar .credito_revendedor {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

.action-toolbar .credito_revendedor:hover {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #a7f3d0 !important;
}

/* Detalhes — azul */
.action-toolbar .detalhes_revendedor {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
}

.action-toolbar .detalhes_revendedor:hover {
    background: rgba(59, 130, 246, 0.25) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

/* Bloquear/Desbloquear revendedor — amarelo */
.action-toolbar .blockDesblock_revendedor {
    background: rgba(250, 204, 21, 0.10) !important;
    border-color: rgba(250, 204, 21, 0.3) !important;
    color: #fde68a !important;
}

.action-toolbar .blockDesblock_revendedor:hover {
    background: rgba(250, 204, 21, 0.22) !important;
    border-color: rgba(250, 204, 21, 0.5) !important;
}

/* Excluir revendedor — vermelho */
.action-toolbar .excluir_revendedor {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

.action-toolbar .excluir_revendedor:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #fecaca !important;
}

/* Restaurar revendedor — teal/ciano */
.action-toolbar .restaurar_revendedor {
    background: rgba(20, 184, 166, 0.12) !important;
    border-color: rgba(20, 184, 166, 0.3) !important;
    color: #5eead4 !important;
}

.action-toolbar .restaurar_revendedor:hover {
    background: rgba(20, 184, 166, 0.25) !important;
    border-color: rgba(20, 184, 166, 0.5) !important;
}

/* ══════════════════════════════════════════
   RESPONSIVO — Mobile (≤768px)
   Botões maiores para toque com dedos
══════════════════════════════════════════ */
@media (max-width: 768px) {

    .action-toolbar .action,
    .action-toolbar .actions {
        gap: 12px !important;
    }

    .action-toolbar .action>a,
    .action-toolbar .action>button,
    .action-toolbar .action .btn,
    .action-toolbar .actions>a,
    .action-toolbar .actions>button,
    .action-toolbar .actions .btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 12px !important;
        font-size: 15px !important;
    }
}