/* Modern Design System - ChatGuard */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
    /* Tipografia */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Roboto Mono', monospace;

    /* Cores - Tokens básicos a serem sobrescritos pelo backend se necessário */
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --bg-light: #f3f4f6;
    /* Cinza muito suave para fundo de página */
    --bg-white: #ffffff;

    /* Superfícies */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ===== FIX: Bootstrap Tabs - Garantir visibilidade correta ===== */
.tab-pane {
    display: none !important;
}

.tab-pane.active {
    display: block !important;
}

/* Suporte para .show (Bootstrap 4) */
.tab-pane.active.show {
    display: block !important;
}

/* ===== FIX: Nav Tabs - Cor dos links ===== */
.nav-tabs .nav-link {
    color: #495057 !important;
    /* Cinza escuro para abas inativas */
}

.nav-tabs .nav-link:hover {
    color: #212529;
    border-color: #e9ecef #e9ecef #dee2e6;
}

.nav-tabs .nav-link.active {
    color: #212529;
    /* Preto para aba ativa */
    font-weight: 500;
}

/* DataTables select legível */
.dataTables_length select {
    min-width: 70px;
    padding: 5px 10px;
    font-size: 14px;
}

/* Reset Global de Tipografia */
body {
    font-family: var(--font-primary) !important;
    background-color: var(--bg-white);
    color: #1f2937;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: var(--font-primary) !important;
    font-weight: 600;
    /* color removido - definido dinamicamente em bootstrap_base.html com {{ bg_color }} */
    margin-bottom: 0.75rem;
}

/* Mono apenas onde importa */
code,
kbd,
pre,
samp,
.font-monospace {
    font-family: var(--font-mono) !important;
}

/* Cards Modernos */
.card {
    background-color: var(--bg-white);
    border: none !important;
    border-radius: var(--border-radius-md) !important;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Tabelas Modernas */
.table-responsive {
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.table {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.table thead th {
    background-color: #f9fafb;
    color: #374151;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
    border-top: none;
    padding: 0.75rem 1rem;
}

.table tbody td {
    border-top: 1px solid #f3f4f6;
    padding: 1rem;
    vertical-align: middle;
    color: #4b5563;
}

.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

/* Botões Modernos */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    transition: all 0.2s;
    letter-spacing: 0.01em;
    text-transform: none;
    /* Remove uppercase forçado se houver */
}

.btn-primary {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Inputs Modernos */
.form-control {
    border-radius: var(--border-radius-sm);
    border: 1px solid #d1d5db;
    padding: 0.625rem 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    /* Ajustar cor dinamicamente se der */
    outline: none;
}

/* Sidebar Improvements */
#sidebar {
    box-shadow: var(--shadow-lg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar .nav-link {
    border-radius: var(--border-radius-md);
    margin: 0.2rem 0.8rem;
    font-weight: 500;
}

#sidebar .nav-link i {
    opacity: 0.8;
}

#sidebar .nav-link:hover i,
#sidebar .nav-link.active i {
    opacity: 1;
}

/* Utilitários de Texto */
.text-muted {
    color: #6b7280 !important;
}

/* Navbar Top */
#navbar-top {
    background-color: var(--bg-white) !important;
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1.5rem;
    z-index: 1020;
}


/* Container Spacing */
.container,
.container-fluid {
    padding-bottom: 2rem;
}

/* FIX: Fundo branco para containers de conteúdo */
#content,
#content-wrapper {
    background-color: var(--bg-white) !important;
}

/* FIX: Esconder overlay no desktop */
@media (min-width: 769px) {
    .overlay.active {
        display: none !important;
    }
}