/**
 * Estilos Personalizados - DBX Engenharia
 * UI Premium com Glassmorphism e Cores Customizadas
 */

:root {
    --primary-color: #2D2E47;
    --secondary-color: #BE0107;
    --primary-light: rgba(45, 46, 71, 0.08);
    --secondary-light: rgba(190, 1, 7, 0.08);
    --glass-bg: rgba(248, 250, 252, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Custom Global Background Overrides (Layout menos branco e com mais contraste) */
html, body {
    background-color: #e2e8f0 !important; /* Tons de cinza claro-azulados */
}

/* Sobrescrever classes de fundo branco do Tailwind para tons claros porém não brancos puros */
.bg-white {
    background-color: rgba(248, 250, 252, 0.96) !important; /* slate-50 com alta opacidade */
}
.bg-white\/70 {
    background-color: rgba(248, 250, 252, 0.75) !important; /* slate-50 translúcido */
}
.bg-white\/50 {
    background-color: rgba(248, 250, 252, 0.55) !important; /* slate-50 mais translúcido */
}

/* Sidebar & Header Glassmorphism Premium */
aside#sidebar {
    background-color: rgba(241, 245, 249, 0.92) !important; /* slate-100 */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

header {
    background-color: rgba(241, 245, 249, 0.92) !important; /* slate-100 */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Font Smoothing */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Sidebar Responsive Utilities */
@media (min-width: 768px) {
    .sidebar-collapsed {
        width: 4.5rem !important;
    }
    .sidebar-collapsed .logo-text {
        display: none !important;
    }
    .sidebar-collapsed .logo-icon {
        display: flex !important;
        justify-content: center;
        width: 100%;
    }
    .sidebar-collapsed nav a {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
    .sidebar-collapsed nav a i {
        margin-right: 0 !important;
        font-size: 1.2rem;
    }
    .sidebar-collapsed nav a, 
    .sidebar-collapsed .p-4 a {
        position: relative;
    }
    .sidebar-collapsed nav a::after,
    .sidebar-collapsed .p-4 a::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 105%;
        top: 50%;
        transform: translateY(-50%) scale(0.9);
        opacity: 0;
        pointer-events: none;
        background-color: #2D2E47;
        color: #ffffff;
        font-size: 11px;
        font-weight: 600;
        padding: 6px 12px;
        border-radius: 8px;
        white-space: nowrap;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
    }
    .sidebar-collapsed nav a:hover::after,
    .sidebar-collapsed .p-4 a:hover::after {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    .sidebar-collapsed nav a::before,
    .sidebar-collapsed .p-4 a::before {
        content: '';
        position: absolute;
        left: 98%;
        top: 50%;
        transform: translateY(-50%) scale(0.9);
        opacity: 0;
        pointer-events: none;
        border-width: 5px;
        border-style: solid;
        border-color: transparent #2D2E47 transparent transparent;
        transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
    }
    .sidebar-collapsed nav a:hover::before,
    .sidebar-collapsed .p-4 a:hover::before {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* Custom Notyf Styling Overrides */
.notyf__toast {
    border-radius: 1rem !important;
    padding: 12px 18px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02) !important;
    backdrop-filter: blur(8px);
}

/* Botões Hover/Opacity das Linhas de Tabelas (Regra WebCis) */
.table-action-btn {
    opacity: 0.4;
    transition: all 0.2s ease-in-out;
}
tr:hover .table-action-btn {
    opacity: 1;
}

/* DataTables Personalizado */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #cbd5e1 !important;
    border-radius: 0.75rem !important;
    padding: 6px 12px !important;
    outline: none !important;
    background-color: rgba(255, 255, 255, 0.5) !important;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(45, 46, 71, 0.1) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    border-radius: 0.5rem !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
    border: none !important;
    border-radius: 0.5rem !important;
}
table.dataTable {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    width: 100% !important;
}
table.dataTable thead th {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 12px 16px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
table.dataTable tbody td {
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 14px 16px !important;
    font-size: 0.875rem;
}

/* Padronização de campos de formulário (Borda 2px, cor mais escura e Altura consistente) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    border: 2px solid #cbd5e1 !important;
}

input[type="date"] {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    min-height: 38px;
}

/* Forçar altura idêntica e alinhamento perfeito nos cabeçalhos e logo do sistema */
header, 
aside#sidebar .flex.items-center.justify-between {
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    box-sizing: border-box !important;
}

.logo-text img {
    max-height: 36px !important;
    width: auto !important;
}

/* Película de fundo dos modais e do lightbox cobrindo toda a tela (inclusive topbar) */
#lightbox,
.wc-modal-backdrop {
    z-index: 99999 !important;
}
