/**
 * PAINEL SAAS - CSS GLOBAL OTIMIZADO
 * 
 * Este arquivo contém APENAS os estilos essenciais que não estão no Bootstrap.
 * Bootstrap já fornece: grid, utilitários, formulários base, botões base, etc.
 * 
 * Aqui temos APENAS:
 * 1. Variáveis CSS (tema claro/escuro)
 * 2. Sobrescritas de formulários para tema escuro
 * 3. Componentes customizados (card-secao, tabela-admin)
 * 4. Sidebar e header
 */

/* ========== 1. VARIÁVEIS CSS (DESIGN SYSTEM) ========== */
:root {
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --primary-subtle: #EEF2FF;

    --secondary: #764ba2;
    --secondary-subtle: #F3F4F6;

    --success: #10B981;
    --success-subtle: #D1FAE5;
    --success-emphasis: #065F46;

    --warning: #F59E0B;
    --warning-subtle: #FEF3C7;
    --warning-emphasis: #92400E;

    --danger: #EF4444;
    --danger-subtle: #FEE2E2;
    --danger-emphasis: #991B1B;

    --info: #3B82F6;
    --info-subtle: #DBEAFE;
    --info-emphasis: #1E40AF;

    --bg-primary: #F9FAFB;
    --bg-secondary: #FFFFFF;
    --bg-subtle: #F3F4F6;

    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #6B7280;

    --border-color: #E5E7EB;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    --sidebar-bg: #1a1d2e;
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --sidebar-text: #FFFFFF;
    --sidebar-text-muted: rgba(255, 255, 255, 0.7);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] {
    --primary: #818CF8;
    --primary-hover: #6366F1;
    --primary-subtle: rgba(129, 140, 248, 0.15);

    --secondary: #A78BFA;
    --secondary-subtle: rgba(167, 139, 250, 0.15);

    --success: #34D399;
    --success-subtle: rgba(52, 211, 153, 0.1);
    --success-emphasis: #6EE7B7;

    --warning: #FBBF24;
    --warning-subtle: rgba(251, 191, 36, 0.1);
    --warning-emphasis: #FCD34D;

    --danger: #F87171;
    --danger-subtle: rgba(248, 113, 113, 0.1);
    --danger-emphasis: #FCA5A5;

    --info: #60A5FA;
    --info-subtle: rgba(96, 165, 250, 0.1);
    --info-emphasis: #93C5FD;

    --bg-primary: #0B0E17;
    --bg-secondary: #151923;
    --bg-subtle: #1F2937;

    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    --border-color: #374151;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);

    --sidebar-bg: #0B0E17;
    --sidebar-border: #1F2937;
    --sidebar-text: #F9FAFB;
    --sidebar-text-muted: #9CA3AF;
    --sidebar-hover: #1F2937;
    --sidebar-active: #1F2937;
}

/* ========== 1.1 SOBRESCRITAS BOOTSTRAP (AUTO-THEME) ========== */
/* Forçar fundos sutis a seguirem o tema do painel */
.bg-primary-subtle {
    background-color: var(--primary-subtle) !important;
    color: var(--primary) !important;
}

.bg-success-subtle {
    background-color: var(--success-subtle) !important;
    color: var(--success) !important;
}

.bg-danger-subtle {
    background-color: var(--danger-subtle) !important;
    color: var(--danger) !important;
}

.bg-warning-subtle {
    background-color: var(--warning-subtle) !important;
    color: var(--warning) !important;
}

.bg-info-subtle {
    background-color: var(--info-subtle) !important;
    color: var(--info) !important;
}

.bg-light {
    background-color: var(--bg-subtle) !important;
}

.bg-white {
    background-color: var(--bg-secondary) !important;
}

/* Injetar variáveis em elementos específicos do Bootstrap com ALTA PRIORIDADE */
.input-group-text {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

.text-success-emphasis {
    color: var(--success-emphasis) !important;
}

.text-danger-emphasis {
    color: var(--danger-emphasis) !important;
}

.text-warning-emphasis {
    color: var(--warning-emphasis) !important;
}

.text-info-emphasis {
    color: var(--info-emphasis) !important;
}

.card {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

/* Alertas Dinâmicos */
.alert {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.alert-info.bg-info-subtle {
    background-color: var(--info-subtle) !important;
    color: var(--info) !important;
}

.alert-success.bg-success-subtle {
    background-color: var(--success-subtle) !important;
    color: var(--success) !important;
}

.alert-danger.bg-danger-subtle {
    background-color: var(--danger-subtle) !important;
    color: var(--danger) !important;
}

.alert-warning.bg-warning-subtle {
    background-color: var(--warning-subtle) !important;
    color: var(--warning) !important;
}

/* Corrigir bordas de cards aninhados */
.border-primary {
    border-color: var(--primary) !important;
}

.border-success {
    border-color: var(--success) !important;
}

.border-warning {
    border-color: var(--warning) !important;
}

.border-danger {
    border-color: var(--danger) !important;
    border-width: 1px !important;
}

/* ========== 2. BASE ========== */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9375rem; /* 15px - Compacto e Moderno */
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.text-muted,
small.text-muted {
    color: var(--text-secondary) !important;
}

/* ========== 3. FORMULÁRIOS (sobrescritas para tema escuro) ========== */
.form-control,
.form-select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-control:disabled,
.form-select:disabled {
    background: var(--bg-primary);
    color: var(--text-secondary);
    opacity: 0.8;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Utilitários de Cores do Painel */
.bg-subtle {
    background-color: var(--bg-subtle) !important;
}

.bg-primary-subtle {
    background-color: var(--primary-subtle) !important;
}

.text-primary-custom {
    color: var(--text-primary) !important;
}

.text-secondary-custom {
    color: var(--text-secondary) !important;
}

.text-muted-custom {
    color: var(--text-muted) !important;
}

/* Inversão Manual de Contexto (Útil para cards com cor fixa) */
.theme-dark-context {
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: rgba(255, 255, 255, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
}

.theme-light-context {
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
}

/* Sobrescritas Globais para prevenir mistura de temas */
.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--secondary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

.form-label {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    transition: color 0.3s ease;
}

/* ========== 4. BOTÕES (sobrescritas) ========== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-theme-toggle {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
}

.btn-theme-toggle:hover {
    background: var(--primary);
    color: white;
}

/* ========== 5. COMPONENTES CUSTOMIZADOS ========== */
.card-secao {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.card-secao h2, 
.card-secao h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.card-metrica {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, background-color 0.3s ease;
}

.card-metrica:hover {
    transform: translateY(-5px);
}

.perfil-header {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease;
}

.foto-perfil {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
}

/* ========== 6. TABELAS ========== */
.tabela-admin {
    width: 100%;
    border-collapse: collapse;
}

.tabela-admin thead {
    background: var(--bg-primary);
}

.tabela-admin th {
    padding: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.875rem;
    border-bottom: 2px solid var(--border-color);
}

.tabela-admin td {
    padding: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.tabela-admin tbody tr:hover {
    background: var(--bg-primary);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ========== 7. MODAIS ========== */
.modal-content {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.modal-header,
.modal-footer {
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ========== 8. SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 0;
    z-index: 1000;
    transition: width 300ms ease, transform 0.3s, background-color 0.3s ease, border-color 0.3s ease;
}

/* Estado recolhido */
.sidebar.collapsed {
    width: 70px;
}

/* Header da sidebar com toggle */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    gap: 1rem;
    transition: border-color 0.3s ease;
}

.sidebar.collapsed .sidebar-header {
    flex-direction: column;
    padding: 1rem 0.5rem;
}

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
    text-decoration: none !important;
}

.sidebar-logo:hover {
    text-decoration: none !important;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.logo-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Theme aware logos */
[data-theme="dark"] .logo-light {
    display: none;
}

[data-theme="light"] .logo-dark {
    display: none;
}

.logo-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sidebar-text);
    margin: 0;
    white-space: nowrap;
    transition: opacity 200ms ease;
}

.logo-subtitle {
    color: var(--sidebar-text-muted);
    font-size: 0.75rem;
    display: block;
    white-space: nowrap;
    transition: opacity 200ms ease;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .logo-subtitle {
    opacity: 0;
    width: 0;
}

/* Botão toggle */
.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 200ms;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--sidebar-hover);
}

.sidebar-toggle i {
    transition: transform 300ms ease;
    font-size: 1.25rem;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Sidebar com toggle desativado - sempre expandida */
.sidebar[data-toggle-disabled="true"] {
    width: 260px !important;
}

.sidebar[data-toggle-disabled="true"] .sidebar-header {
    justify-content: flex-start;
}

.sidebar[data-toggle-disabled="true"] .logo-text,
.sidebar[data-toggle-disabled="true"] .logo-subtitle {
    opacity: 1 !important;
    width: auto !important;
}

/* Menu */
.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.sidebar-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    color: var(--sidebar-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 1rem 0.5rem 0.25rem;
}

.sidebar-category:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
}

.sidebar-category i.bi-chevron-down {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.sidebar-category.collapsed i.bi-chevron-down {
    transform: rotate(-90deg);
}

.sidebar.collapsed .sidebar-category {
    padding: 0.75rem;
    justify-content: center;
}

.sidebar.collapsed .sidebar-category span,
.sidebar.collapsed .sidebar-category i {
    display: none;
}

/* Submenu/Group items */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
    max-height: 1000px;
    overflow: hidden;
}

.sidebar-category.collapsed+.sidebar-submenu {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    margin: 0 0.5rem;
    border-radius: 8px;
}

.sidebar-menu a:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    border-left-color: var(--primary);
    text-decoration: none;
}

.sidebar-menu a.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-menu a i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 24px;
    flex-shrink: 0;
}

/* Menu recolhido */
.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .sidebar-menu a span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 200ms ease;
}

/* Tooltips quando recolhido */
.sidebar.collapsed .sidebar-menu a {
    position: relative;
}

.sidebar.collapsed .sidebar-menu a::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 1rem);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 200ms ease;
    z-index: 1001;
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar.collapsed .sidebar-menu a:hover::after {
    opacity: 1;
}

/* Seta do tooltip */
.sidebar.collapsed .sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 6px 0;
    border-color: transparent var(--bg-secondary) transparent transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 1001;
}

.sidebar.collapsed .sidebar-menu a:hover::before {
    opacity: 1;
}

/* Main content ajustado */
.main-content {
    margin-left: 260px;
    transition: margin-left 300ms ease;
}

.sidebar.collapsed~.main-content {
    margin-left: 70px;
}

/* ========== 9. HEADER ========== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-search {
    position: relative;
    flex: 1;
    max-width: 500px;
    margin-right: 2rem;
}

.header-search input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.header-search input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.header-search i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 1;
    pointer-events: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    /* Sempre à direita, mesmo sem busca */
}

.btn-notificacoes {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.btn-notificacoes .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* User Dropdown */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.dropdown-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.dropdown-item.active:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.dropdown-header {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

/* ========== 10. DROPDOWN ========== */
.dropdown-menu {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: var(--card-shadow);
}

.dropdown-item {
    color: var(--text-primary);
}

.dropdown-item:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* ========== 11. LAYOUT DO PAINEL ========== */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
}

.content-area {
    padding: 2rem;
}

/* ========== 12. RESPONSIVIDADE ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header-search {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .card-secao {
        padding: 1rem;
    }

    .user-info {
        display: none;
    }
}

/* ============================================
   BUSCA GLOBAL
   ============================================ */

.header-search {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.dropdown-busca {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.busca-loading,
.busca-vazio,
.busca-erro {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.busca-loading i,
.busca-vazio i,
.busca-erro i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.busca-grupo {
    padding: 1rem;
}

.busca-grupo+.busca-grupo {
    border-top: 1px solid var(--border-color);
}

.busca-grupo-titulo {
    padding: 0.5rem 0 0.75rem 0;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.busca-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.busca-item:hover {
    background: var(--bg-secondary);
    border-radius: 8px;
}

.busca-item-icon {
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 50%;
    flex-shrink: 0;
}

.busca-item-info {
    flex: 1;
    min-width: 0;
}

.busca-item-nome {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.busca-item-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   BUSCA GLOBAL - DROPDOWN
   ======================================== */

#resultados-busca {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

#resultados-busca::-webkit-scrollbar {
    width: 8px;
}

#resultados-busca::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

#resultados-busca::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

#resultados-busca::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.busca-loading,
.busca-vazio,
.busca-erro {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.busca-loading i,
.busca-vazio i,
.busca-erro i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.busca-vazio p {
    margin: 0.5rem 0 0 0;
    color: var(--text-secondary);
}

.busca-erro {
    color: var(--danger);
}



/* Responsividade */
@media (max-width: 768px) {
    .busca-container {
        max-width: 100%;
    }

    #resultados-busca {
        max-height: 400px;
    }
}


.busca-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

/* Ocultar ícone de busca quando dropdown estiver visível */
.header-search:has(#resultados-busca[style*="display: block"]) i {
    display: none;
}

/* Garantir que links no dropdown sejam clicáveis */
#resultados-busca a {
    pointer-events: auto;
}


/* ========================================
   NOTIFICAÇÕES - DROPDOWN
   ======================================== */

.dropdown-notificacoes {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 400px;
    max-height: 600px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.notificacoes-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notificacoes-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-marcar-todas {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-marcar-todas:hover {
    background: var(--bg-primary);
}

.notificacoes-lista {
    max-height: 500px;
    overflow-y: auto;
}

.notificacoes-lista::-webkit-scrollbar {
    width: 8px;
}

.notificacoes-lista::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.notificacoes-lista::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.notificacao-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.notificacao-item:hover {
    background: var(--bg-primary);
}

.notificacao-item.lida {
    opacity: 0.6;
}

.notificacao-icone {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notificacao-conteudo {
    flex: 1;
    min-width: 0;
}

.notificacao-titulo {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notificacao-mensagem {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notificacao-tempo {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notificacao-acoes {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.notificacao-acoes button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.notificacao-acoes button:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.notificacoes-loading,
.notificacoes-vazio,
.notificacoes-erro {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.notificacoes-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-ver-todas {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-ver-todas:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
    color: white;
}

.btn-ver-todas i {
    font-size: 1rem;
}

.notificacoes-loading i,
.notificacoes-vazio i,
.notificacoes-erro i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.notificacoes-vazio p {
    margin: 0;
    color: var(--text-secondary);
}

/* Responsividade */
@media (max-width: 768px) {
    .dropdown-notificacoes {
        width: 320px;
        max-height: 500px;
    }
}






/* Responsividade da Sidebar */
@media (max-width: 768px) {
    .sidebar {
        width: 260px !important;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: none;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar.collapsed {
        width: 260px !important;
    }

    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .logo-subtitle,
    .sidebar.collapsed .sidebar-menu a span {
        opacity: 1 !important;
        width: auto !important;
    }

    .sidebar.collapsed .sidebar-menu a {
        justify-content: flex-start !important;
        padding: 0.875rem 1.5rem !important;
    }

    .sidebar.collapsed .sidebar-menu a::after,
    .sidebar.collapsed .sidebar-menu a::before {
        display: none !important;
    }
}


/* ========== BADGES COM CONTRASTE ADEQUADO ========== */
.badge {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-success {
    background-color: var(--success-subtle) !important;
    color: var(--success-emphasis) !important;
    border: 1px solid var(--success-emphasis);
}

.badge-danger {
    background-color: var(--danger-subtle) !important;
    color: var(--danger-emphasis) !important;
    border: 1px solid var(--danger-emphasis);
}

.badge-warning {
    background-color: var(--warning-subtle) !important;
    color: var(--warning-emphasis) !important;
    border: 1px solid var(--warning-emphasis);
}

.badge-info {
    background-color: var(--info-subtle) !important;
    color: var(--info-emphasis) !important;
    border: 1px solid var(--info-emphasis);
}

.badge-secondary {
    background-color: var(--bg-subtle) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color);
}

.badge-secondary {
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #D1D5DB;
}

/* Tema escuro */
[data-theme="dark"] .badge-success {
    background: #064E3B;
    color: #6EE7B7;
    border-color: #065F46;
}

[data-theme="dark"] .badge-danger {
    background: #7F1D1D;
    color: #FCA5A5;
    border-color: #991B1B;
}

[data-theme="dark"] .badge-warning {
    background: #78350F;
    color: #FCD34D;
    border-color: #92400E;
}

[data-theme="dark"] .badge-info {
    background: #1E3A8A;
    color: #93C5FD;
    border-color: #1E40AF;
}

[data-theme="dark"] .badge-secondary {
    background: #374151;
    color: #D1D5DB;
    border-color: #4B5563;
}


/* ========== CLASSES UTILITÁRIAS PARA SUBSTITUIR INLINE ========== */

/* Headers de Página */
.page-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-header-subtitle {
    color: var(--text-secondary);
    margin: 0.5rem 0 0 0;
    font-size: 0.875rem;
}

/* Campos Obrigatórios */
.campo-obrigatorio {
    color: var(--danger);
}

/* Ícones Vazios */
.icone-vazio {
    font-size: 3rem;
    opacity: 0.3;
}

/* Ações em Massa */
.acoes-massa {
    display: none;
}

.acoes-massa.show {
    display: block;
}

/* Larguras Fixas */
.w-40px {
    width: 40px;
}

.w-120px {
    width: 120px;
}

/* Forms Ocultos */
.form-oculto {
    display: none;
}

/* Alertas Customizados */
.alert-custom-info {
    background: var(--info-subtle);
    border: 1px solid var(--info);
    border-radius: 8px;
    padding: 1rem;
    color: var(--info-emphasis);
}

.alert-custom-warning {
    background: var(--warning-subtle);
    border: 1px solid var(--warning);
    border-radius: 8px;
    padding: 1rem;
    color: var(--warning-emphasis);
}

.alert-custom-danger {
    background: var(--danger-subtle);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 1rem;
    color: var(--danger-emphasis);
}

/* Ícones de Alerta */
.alert-icon {
    font-size: 1.25rem;
}

/* Password Toggle Button */
.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Input com Toggle */
.input-with-toggle {
    padding-right: 45px;
}

/* Password Tips */
.password-tips {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 10px;
    margin-top: 8px;
    font-size: 12px;
}

.password-tips-header {
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
}

.password-tips ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.password-tips li {
    color: var(--danger);
    transition: color 0.3s;
}

.password-tips li.valid {
    color: var(--success);
}

/* Password Strength */
.password-strength {
    margin-top: 8px;
    display: none;
}

.password-strength.show {
    display: block;
}

.strength-bars {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.strength-bar {
    height: 4px;
    flex: 1;
    background: var(--border-color);
    border-radius: 2px;
    transition: background-color 0.3s;
}

.strength-bar.active-weak {
    background: #EF4444;
}

.strength-bar.active-medium {
    background: #F59E0B;
}

.strength-bar.active-good {
    background: #3B82F6;
}

.strength-bar.active-strong {
    background: #10B981;
}

.strength-text {
    font-size: 12px;
    color: var(--text-primary);
}

/* Senha Gerada Display */
.senha-gerada-container {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-family: monospace;
    font-size: 1.1rem;
    word-break: break-all;
    border: 2px solid var(--primary);
    position: relative;
    padding-right: 100px;
}

.btn-copiar-senha {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-copiar-senha:hover {
    background: var(--secondary);
}

/* Texto Alinhado */
.text-align-left {
    text-align: left;
}

/* Cards de Métricas - Ícones */
.card-metrica-icone-container {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-metrica-icone-container i {
    font-size: 1.5rem;
    color: white;
}

.card-metrica-icone-primary {
    background: linear-gradient(135deg, #6366F1 0%, #764ba2 100%);
}

.card-metrica-icone-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.card-metrica-icone-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.card-metrica-icone-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.card-metrica-icone-info {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

/* Texto de Métrica */
.metrica-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.metrica-valor {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ========================================
   CLASSES PARA SENHA E VALIDAÇÃO
   ======================================== */

.password-tips {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 10px;
    margin-top: 8px;
    font-size: 12px;
}

.password-tips-header {
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
}

.strength-text {
    font-size: 12px;
    color: var(--text-primary);
}

.senha-gerada-container {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-family: monospace;
    font-size: 1.1rem;
    word-break: break-all;
    border: 2px solid var(--primary);
    position: relative;
    padding-right: 100px;
}

.btn-copiar-senha {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-copiar-senha:hover {
    background: var(--secondary);
}

/* ========================================
   CLASSES PARA ÍCONES E ALERTAS
   ======================================== */

.icone-info-lg {
    font-size: 1.25rem;
    color: var(--info);
}

.icone-vazio-md {
    font-size: 2rem;
    opacity: 0.3;
}

.alert-info-custom {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 1rem;
}

/* ========================================
   CLASSES PARA CARDS DE RELATÓRIOS
   ======================================== */

.relatorio-card-icone {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.relatorio-card-icone.primary {
    background: linear-gradient(135deg, #6366F1 0%, #764ba2 100%);
}

.relatorio-card-icone.success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.relatorio-card-icone.warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.relatorio-card-icone.info {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.relatorio-card-icone i {
    font-size: 1.5rem;
    color: white;
}

.relatorio-card-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.relatorio-card-descricao {
    font-size: 0.875rem;
}

/* ========================================
   CLASSES PARA VALORES DE MÉTRICAS
   ======================================== */

.card-metrica-valor-md {
    font-size: 1.5rem;
}

/* ========================================
   CLASSES PARA NOTIFICAÇÕES
   ======================================== */

.notificacao-icone-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notificacao-icone-container.info {
    background: rgba(59, 130, 246, 0.1);
}

.notificacao-icone-container.success {
    background: rgba(16, 185, 129, 0.1);
}

.notificacao-icone-container.warning {
    background: rgba(245, 158, 11, 0.1);
}

.notificacao-icone-container.danger {
    background: rgba(239, 68, 68, 0.1);
}

.notificacao-icone-container i {
    font-size: 1.25rem;
}

.notificacao-icone-container.info i {
    color: var(--info);
}

.notificacao-icone-container.success i {
    color: var(--success);
}

.notificacao-icone-container.warning i {
    color: var(--warning);
}

.notificacao-icone-container.danger i {
    color: var(--danger);
}

.notificacao-titulo {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notificacao-mensagem {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.notificacao-tempo {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* ========================================
   CLASSES PARA CAMPOS DE SENHA
   ======================================== */

.password-field-container {
    position: relative;
}

.password-field-input {
    padding-right: 45px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: var(--text-primary);
}

.password-requirements-list {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.password-requirement-item {
    color: var(--danger);
    transition: color 0.3s;
}

.password-requirement-item.valid {
    color: var(--success);
}

.password-strength-container {
    margin-top: 8px;
    display: none;
}

.password-strength-bars {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.btn-gerar-senha {
    width: 100%;
}

/* ========================================
   CLASSES PARA MODAIS E ALERTAS
   ======================================== */

.modal-content-left {
    text-align: left;
}

.modal-warning-text {
    color: var(--warning);
    margin-top: 1rem;
}

.modal-info-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.modal-spacing-top {
    margin-top: 1rem;
}

/* ========================================
   CLASSES PARA TABELAS PDF
   ======================================== */

.table-col-70 {
    width: 70%;
}

.table-col-30 {
    width: 30%;
}

.text-align-right {
    text-align: right;
}

/* ========================================
   CLASSES PARA CARDS CLICÁVEIS
   ======================================== */

.card-clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .card-clickable:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ========================================
   CLASSES PARA LARGURAS DE COLUNAS
   ======================================== */

.w-80px {
    width: 80px;
}

.w-100px {
    width: 100px;
}

.w-180px {
    width: 180px;
}

/* ========================================
   CLASSES PARA GRÁFICOS
   ======================================== */

.grafico-height-300 {
    height: 300px;
}

.grafico-height-350 {
    height: 350px;
}

/* ========================================
   CLASSES PARA TEXTO
   ======================================== */

.text-color-primary {
    color: var(--text-primary);
}

.text-color-warning {
    color: var(--warning);
}


/* ========================================
   RESPONSIVIDADE AVANÇADA
   ======================================== */

/* Mobile Small (480px) */
@media (max-width: 480px) {

    /* Textos menores */
    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.1rem !important;
    }

    /* Padding reduzido */
    .card-secao {
        padding: 1rem !important;
    }

    /* Botões full-width */
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Perfil Header Extra Small */
    .perfil-header {
        padding: 1.25rem !important;
    }

    .foto-perfil {
        width: 80px !important;
        height: 80px !important;
    }
}

/* Tablet (992px) */
@media (max-width: 992px) {
    .main-content {
        padding: 1.5rem;
    }

    /* Cards em 2 colunas */
    .row>.col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Correções Críticas Mobile (768px) */
@media (max-width: 768px) {

    /* Tabelas com scroll horizontal */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
        width: 100% !important;
    }

    .tabela-admin {
        min-width: 800px !important;
    }

    /* Cards de métricas em coluna única */
    .row>[class*='col-md-'],
    .row>[class*='col-lg-'] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }

    /* Formulários em coluna única */
    .row .col-md-6,
    .row .col-md-4,
    .row .col-md-3,
    .row .col-md-8,
    .row .col-md-9 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Modais responsivos */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }

    .modal-content {
        max-height: calc(100vh - 1rem) !important;
        overflow-y: auto !important;
    }

    .modal-lgpd {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }

    /* Botões em grupo */
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .d-flex.gap-2 .btn,
    .d-flex.gap-3 .btn {
        width: 100% !important;
    }

    /* Header de página */
    .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .d-flex.justify-content-between .btn {
        width: 100%;
    }

    /* Gráficos */
    .grafico-container {
        overflow-x: auto;
    }

    .grafico-height-300,
    .grafico-height-350 {
        height: 250px !important;
    }

    /* Paginação */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-info {
        text-align: center;
        width: 100%;
        margin-bottom: 1rem;
    }

    /* Filtros */
    .row.g-3>div {
        margin-bottom: 0.5rem;
    }

    /* Ações em linha */
    .d-flex.gap-2.justify-content-end {
        justify-content: flex-start !important;
    }

    /* Cards de relatórios */
    .relatorio-card-icone {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.25rem !important;
    }

    .relatorio-card-titulo {
        font-size: 1rem !important;
    }

    /* Notificações */
    .dropdown-notificacoes {
        position: fixed !important;
        top: 60px !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }

    /* Busca global */
    .busca-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Tabs */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
    }

    /* Alertas */
    .alert {
        font-size: 0.875rem;
    }

    /* Badges */
    .badge {
        font-size: 0.7rem;
    }

    /* Ícones grandes */
    .bi-xl {
        font-size: 2rem !important;
    }

    /* Espaçamentos */
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    .mb-5 {
        margin-bottom: 2rem !important;
    }

    .p-4 {
        padding: 1.5rem !important;
    }

    .p-5 {
        padding: 2rem !important;
    }

    /* Perfil Header Responsivo */
    .perfil-header {
        padding: 1.5rem !important;
    }

    .foto-perfil-container-wrapper {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1.5rem !important;
    }

    .foto-perfil-container-wrapper h1,
    .foto-perfil-container-wrapper p {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        max-width: 100% !important;
    }

    .foto-perfil {
        width: 100px !important;
        height: 100px !important;
    }
}

/* Utilitários de Display Mobile */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }
}

/* Scroll suave em mobile */
@media (max-width: 768px) {
    * {
        -webkit-overflow-scrolling: touch;
    }
}



/* ========================================
   RESPONSIVIDADE FLUIDA (EDGE-TO-EDGE)
   ======================================== */

@media (max-width: 576px) {
    /* Container principal ocupa 100% da largura sem respiros */
    .main-content {
        padding: 0 !important;
    }

    .content-area {
        padding: 0 !important;
    }

    /* Cards encostados na borda da tela */
    .card-secao {
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border-left: none !important;
        border-right: none !important;
        padding: 1.25rem !important; /* Respiro interno mantido */
    }

    /* Headers com respiro para texto não colar na borda */
    .dash-page-header {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin-top: 1rem !important;
    }

    /* Tabelas e outros elementos */
    .table-responsive {
        border-radius: 0 !important;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }
}


/* ========================================
   13. AUTENTICAÇÃO
   ======================================== */

/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 450px;
    margin-top: 80px;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Wrapper (Layout Split) */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

.auth-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
}

.auth-right {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: white;
}

/* Auth Content */
.auth-content {
    width: 100%;
    max-width: 450px;
}

/* Auth Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Auth Header */
.auth-header {
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
}

/* Auth Navbar */
.auth-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    z-index: 1000;
}

.auth-navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.auth-navbar .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: transform 0.2s;
}

.auth-navbar .logo:hover {
    transform: scale(1.05);
}

.auth-navbar .nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-navbar .nav-link:hover {
    color: var(--primary);
}

/* Auth Form */
.auth-form {
    margin-bottom: 1.5rem;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--primary);
}

/* Tipo Usuário Cards */
.tipo-usuario-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tipo-card {
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.tipo-card:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.tipo-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.tipo-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.tipo-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tipo-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Info Redirect */
.info-redirect {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 0.75rem;
    background: var(--bg-subtle);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.info-redirect i {
    color: var(--primary);
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: var(--secondary);
}

/* Forgot Password */
.forgot-password {
    text-align: right;
    margin-top: 1rem;
}

.forgot-password a {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password a:hover {
    color: var(--secondary);
}

/* Botão Google OAuth */
.btn-google {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: #DB4437;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-google:hover {
    background: #C23321;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(219, 68, 55, 0.4);
    color: white;
}

/* Auth Responsivo */
@media (max-width: 768px) {
    .auth-container {
        margin-top: 70px;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .tipo-usuario-cards {
        grid-template-columns: 1fr;
    }

    .auth-wrapper {
        flex-direction: column;
    }

    .auth-right {
        display: none;
    }
}


/* ========================================
   14. PÁGINAS ESPECÍFICAS
   ======================================== */

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grafico-container {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    height: 450px;
    display: flex;
    flex-direction: column;
}

.grafico-container h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.grafico-container > div:last-child {
    flex: 1;
    min-height: 0;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    color: var(--text-secondary);
    font-size: 1rem;
    gap: 0.5rem;
}

.loading-spinner i {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Backups */
.backup-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.backup-card:hover {
    border-color: var(--primary);
    box-shadow: var(--card-shadow);
}

.backup-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Configurações */
.config-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.config-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.config-tab:hover {
    color: var(--primary);
}

.config-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.config-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
}

/* Cookies LGPD */
.cookies-table {
    width: 100%;
    border-collapse: collapse;
}

.cookies-table th,
.cookies-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.cookies-table th {
    background: var(--bg-primary);
    font-weight: 600;
    color: var(--text-secondary);
}

.cookie-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

.cookie-category.essencial {
    background: var(--success-subtle);
    color: var(--success-emphasis);
}

.cookie-category.funcional {
    background: var(--info-subtle);
    color: var(--info-emphasis);
}

.cookie-category.analitico {
    background: var(--warning-subtle);
    color: var(--warning-emphasis);
}

/* Auditoria */
.auditoria-filters {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.auditoria-timeline {
    position: relative;
    padding-left: 2rem;
}

.auditoria-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.auditoria-item {
    position: relative;
    padding-bottom: 2rem;
}

.auditoria-item::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-primary);
}

/* Perfil */
.perfil-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.perfil-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.perfil-tab:hover {
    color: var(--primary);
}

.perfil-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* 2FA */
.qr-code-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin: 2rem 0;
}

.qr-code-container img {
    max-width: 250px;
    height: auto;
}

.backup-codes {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.backup-code {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    text-align: center;
    color: var(--text-primary);
}

/* Instalação */
.instalacao-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.instalacao-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.instalacao-step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}

.instalacao-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.instalacao-step.active .instalacao-step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.instalacao-step.completed .instalacao-step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.instalacao-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

/* Responsivo - Páginas Específicas */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .grafico-container {
        height: 350px;
    }

    .config-tabs,
    .perfil-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .backup-codes-grid {
        grid-template-columns: 1fr;
    }

    .instalacao-steps {
        flex-direction: column;
        gap: 1rem;
    }

    .instalacao-steps::before {
        display: none;
    }
}


/* ========================================
   15. CLASSES UTILITÁRIAS ADICIONAIS
   ======================================== */

/* Headers de Página */
.page-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header-content p {
    color: var(--text-secondary);
    margin: 0.5rem 0 0 0;
    font-size: 0.875rem;
}

/* Ícones Utilitários */
.icone-vazio-lg {
    font-size: 3rem;
    opacity: 0.3;
    display: block;
    text-align: center;
}

.icone-vazio-md {
    font-size: 2rem;
    opacity: 0.3;
}

.icone-info-xl {
    font-size: 1.5rem;
    color: var(--info);
}

.icone-sucesso-lg {
    font-size: 1.25rem;
    color: var(--success);
}

.icone-perigo-lg {
    font-size: 1.25rem;
    color: var(--danger);
}

/* Larguras Fixas Específicas */
.w-30px { width: 30px !important; }
.w-50px { width: 50px !important; }
.w-60px { width: 60px !important; }
.w-70px { width: 70px !important; }
.w-90px { width: 90px !important; }
.w-150px { width: 150px !important; }
.w-200px { width: 200px !important; }

/* Alturas Fixas */
.h-300px { height: 300px; }
.h-350px { height: 350px; }
.h-400px { height: 400px; }
.h-450px { height: 450px; }
.h-500px { height: 500px; }

/* Containers Especiais */
.container-centralizado {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.container-vazio {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.container-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Estados Visuais */
.estado-vazio {
    text-align: center;
    padding: 3rem 2rem;
}

.estado-vazio i {
    font-size: 3rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 1rem;
}

.estado-vazio p {
    color: var(--text-secondary);
    margin: 0;
}

.estado-erro {
    text-align: center;
    padding: 2rem;
    color: var(--danger);
}

.estado-sucesso {
    text-align: center;
    padding: 2rem;
    color: var(--success);
}

/* Texto Utilitário */
.texto-destaque {
    font-weight: 700;
    color: var(--text-primary);
}

.texto-pequeno {
    font-size: 0.875rem;
}

.texto-muito-pequeno {
    font-size: 0.75rem;
}

.texto-grande {
    font-size: 1.25rem;
}

.texto-muito-grande {
    font-size: 1.5rem;
}

/* Espaçamentos Específicos */
.espacamento-vertical-sm {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.espacamento-vertical-md {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.espacamento-vertical-lg {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Bordas Utilitárias */
.borda-esquerda-primaria {
    border-left: 4px solid var(--primary);
}

.borda-esquerda-sucesso {
    border-left: 4px solid var(--success);
}

.borda-esquerda-perigo {
    border-left: 4px solid var(--danger);
}

.borda-esquerda-aviso {
    border-left: 4px solid var(--warning);
}

/* Backgrounds Utilitários */
.bg-primaria-sutil {
    background: var(--primary-subtle);
}

.bg-sucesso-sutil {
    background: var(--success-subtle);
}

.bg-perigo-sutil {
    background: var(--danger-subtle);
}

.bg-aviso-sutil {
    background: var(--warning-subtle);
}

.bg-info-sutil {
    background: var(--info-subtle);
}

/* Sombras Utilitárias */
.sombra-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sombra-md {
    box-shadow: var(--card-shadow);
}

.sombra-lg {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.sem-sombra {
    box-shadow: none !important;
}

/* Bordas Arredondadas */
.arredondado-sm {
    border-radius: 6px;
}

.arredondado-md {
    border-radius: 12px;
}

.arredondado-lg {
    border-radius: 16px;
}

.arredondado-xl {
    border-radius: 20px;
}

.arredondado-completo {
    border-radius: 50%;
}

/* Transições */
.transicao-rapida {
    transition: all 0.15s ease;
}

.transicao-normal {
    transition: all 0.3s ease;
}

.transicao-lenta {
    transition: all 0.5s ease;
}

/* Hover Effects */
.hover-elevacao:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hover-escala:hover {
    transform: scale(1.05);
}

.hover-opacidade:hover {
    opacity: 0.8;
}

/* Cursor */
.cursor-pointer {
    cursor: pointer;
}

.cursor-nao-permitido {
    cursor: not-allowed;
}

/* Overflow */
.overflow-auto {
    overflow: auto;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.overflow-y-auto {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Posicionamento */
.posicao-relativa {
    position: relative;
}

.posicao-absoluta {
    position: absolute;
}

.posicao-fixa {
    position: fixed;
}

.posicao-sticky {
    position: sticky;
    top: 0;
}

/* Z-Index */
.z-index-1 { z-index: 1; }
.z-index-10 { z-index: 10; }
.z-index-100 { z-index: 100; }
.z-index-1000 { z-index: 1000; }

/* Display Utilitários */
.display-flex {
    display: flex;
}

.display-grid {
    display: grid;
}

.display-inline-flex {
    display: inline-flex;
}

.display-none {
    display: none;
}

/* Flex Utilitários */
.flex-coluna {
    flex-direction: column;
}

.flex-linha {
    flex-direction: row;
}

.flex-centro {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-entre {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-inicio {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.flex-fim {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

/* Grid Utilitários */
.grid-2-colunas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.grid-3-colunas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.grid-4-colunas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Alinhamento de Texto */
.texto-esquerda {
    text-align: left;
}

.texto-centro {
    text-align: center;
}

.texto-direita {
    text-align: right;
}

.texto-justificado {
    text-align: justify;
}

/* Quebra de Texto */
.texto-quebra {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.texto-sem-quebra {
    white-space: nowrap;
}

.texto-elipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Opacidade */
.opacidade-0 { opacity: 0; }
.opacidade-25 { opacity: 0.25; }
.opacidade-50 { opacity: 0.5; }
.opacidade-75 { opacity: 0.75; }
.opacidade-100 { opacity: 1; }

/* Visibilidade */
.visivel {
    visibility: visible;
}

.invisivel {
    visibility: hidden;
}

/* Responsivo - Classes Utilitárias */
@media (max-width: 768px) {
    .grid-2-colunas,
    .grid-3-colunas,
    .grid-4-colunas {
        grid-template-columns: 1fr;
    }

    .page-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .flex-entre {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .ocultar-mobile {
        display: none !important;
    }

    .mostrar-mobile {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .ocultar-desktop {
        display: none !important;
    }

    .mostrar-desktop {
        display: block !important;
    }
}


/* ========================================
   16. PÁGINAS DO SITE PÚBLICO
   ======================================== */

/* Breadcrumb */
.breadcrumb-current {
    color: rgba(255, 255, 255, 0.8);
}

/* Imagem Destaque da Página */
.pagina-imagem-destaque {
    margin-bottom: 3rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.pagina-imagem-destaque img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

/* Botão Secundário para Site */
.btn-secondary-site {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary-site:hover {
    background: var(--primary);
    color: white;
}


/* ============================================
   CONFIGURAÇÕES - TABS E CONTAINER
   ============================================ */

.configuracoes-container {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 0;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.configuracoes-tabs {
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 1rem 0;
    border-radius: 16px 16px 0 0;
    margin-bottom: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.configuracoes-tabs .nav-item {
    margin-bottom: -2px;
}

.configuracoes-tabs .nav-link {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border-radius: 0;
}

.configuracoes-tabs .nav-link:hover {
    color: var(--text-primary);
    background: transparent;
}

.configuracoes-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    border-bottom-color: var(--primary);
}

.configuracoes-tabs .nav-link i {
    font-size: 1.125rem;
}

.configuracoes-content {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 0 0 16px 16px;
    transition: background-color 0.3s ease;
}

.configuracoes-content .tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Seções dentro das abas */
.config-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-section h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: color 0.3s ease;
}

.config-section h3 i {
    color: var(--primary);
    font-size: 1.5rem;
}

.config-section p.text-muted {
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Responsividade das tabs */
@media (max-width: 768px) {
    .configuracoes-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .configuracoes-tabs .nav-link {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }
    
    .configuracoes-tabs .nav-link span {
        display: none;
    }
    
    .configuracoes-tabs .nav-link i {
        margin: 0;
    }
    
    .configuracoes-content {
        padding: 1rem;
    }
}


/* ============================================
   DASHBOARD GERENTE - COMPONENTES
   ============================================ */

/* Botões de Ação Rápida */
.btn-acao-rapida {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    text-align: center;
}

.btn-acao-rapida:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-acao-rapida i {
    font-size: 2rem;
    transition: transform 0.3s ease;
}

.btn-acao-rapida:hover i {
    transform: scale(1.1);
}

.btn-acao-rapida span {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Ticket Item */
.ticket-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.ticket-item:last-child {
    margin-bottom: 0;
}

.ticket-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: translateX(5px);
}

.ticket-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ticket-info {
    flex: 1;
    min-width: 0;
}

.ticket-info strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-info small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Badges de Status */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.badge-aberto {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.badge-em_andamento {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.badge-resolvido {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.badge-fechado {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

/* Notificação Item */
.notif-item {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.notif-item:last-child {
    margin-bottom: 0;
}

.notif-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.notif-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notif-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.notif-time {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
}

/* Activity Item */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
    min-width: 0;
}

.activity-text span {
    display: block;
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.activity-text small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Responsividade */
@media (max-width: 768px) {
    .btn-acao-rapida {
        padding: 1.5rem 0.75rem;
    }
    
    .btn-acao-rapida i {
        font-size: 1.5rem;
    }
    
    .ticket-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ticket-info strong {
        white-space: normal;
    }
}
