/* ============================================
   SISTEMA DE RESUMOS - ESTILOS GERAIS
   Versão: Otimizada e Unificada
   Tema: Dark Mode Profissional
   ============================================ */

:root {
    /* Cores Principais */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    
    /* Background */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    --bg-card: #1e293b;
    
    /* Texto */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Borders */
    --border-color: #334155;
    --border-light: #475569;
    
    /* Estados */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-light: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    
    /* Transições */
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
}

/* ============================================
   LAYOUT PRINCIPAL & SIDEBAR
   ============================================ */

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    /* overflow-x: hidden;  <-- REMOVA ESTA LINHA (Ela impede o sticky de funcionar) */
}

/* Sidebar Desktop (Hover Effect) */
.sidebar {
    width: 260px; /* Largura fixa */
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    
    /* Configuração de Flutuação e Animação */
    position: fixed; 
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    
    /* Esconde a barra (deixa apenas 10px visíveis) */
    transform: translateX(-250px); 
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1); 
}

/* Ao passar o mouse, a sidebar aparece */
.sidebar:hover {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
}

/* Linha colorida indicativa na borda esquerda (Visual para saber que tem menu ali) */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    opacity: 0.8;
    transition: opacity 0.3s;
}
.sidebar:hover::after {
    opacity: 0; /* Some a linha quando o menu abre */
}

/* Header interno da Sidebar */
.sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    white-space: nowrap; /* Evita que o logo quebre linha */
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden; /* Garante que não vaze nada */
}

.sidebar-logo svg {
    width: 32px;
    height: 32px;
    min-width: 32px; /* IMPORTANTE: Impede o logo de espremer ou explodir */
    color: var(--primary-light);
    stroke-width: 2;
}

/* --- NAVEGAÇÃO (AQUI ESTAVA O PROBLEMA DOS ÍCONES GIGANTES) --- */
.sidebar-nav {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;           /* Alinha ícone e texto na horizontal */
    align-items: center;     /* Centraliza verticalmente */
    width: 100%;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;     /* O texto nunca vai para a linha de baixo */
    overflow: hidden;        /* Corta o que sobrar */
}

/* CORREÇÃO DO TAMANHO DOS ÍCONES */
.nav-item svg {
    width: 24px !important;      /* Força o tamanho */
    height: 24px !important;     /* Força o tamanho */
    min-width: 24px !important;  /* Garante que não encolha */
    margin-right: 12px;          /* Espaço entre ícone e texto */
    color: var(--text-muted);
    stroke-width: 2;
    flex-shrink: 0;              /* O ícone nunca vai ser esmagado */
}

.nav-item span {
    font-size: 14px;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.2s;
}

/* Hover e Active dos Itens */
.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item:hover svg {
    color: var(--primary-light);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.nav-item.active svg {
    color: var(--primary);
}

/* Botão Fechar (Só aparece no mobile) */
.sidebar-close-btn {
    display: none !important;
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    z-index: 102;
}

/* Conteúdo Principal */
.main-content {
    flex: 1;
    margin-left: 0; 
    min-height: 100vh;
    width: 100%;
    padding-left: 10px; /* Pequeno espaço na esquerda para a barra recolhida */
    transition: margin-left 0.3s ease;
}

.content-area {
    padding: 32px;
}

/* ============================================
   TOP BAR & HEADER
   ============================================ */

.top-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

/* Ícones de Notificação */
.notification-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}
.notification-icon:hover {
    background: var(--bg-tertiary);
}
.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--error);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Perfil do Usuário na Topbar */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.user-profile:hover {
    background: var(--bg-tertiary);
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}
.user-info {
    display: flex;
    flex-direction: column;
}
.user-name { font-size: 14px; font-weight: 600; }
.user-role { font-size: 12px; color: var(--text-muted); }

/* ============================================
   DROPDOWNS (Unificados)
   ============================================ */

/* Estilo base para todos os dropdowns flutuantes */
.dropdown-wrapper {
    position: absolute;
    top: 65px;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    overflow: hidden;
    display: none; /* JS controla o display */
}

/* Dropdown de Perfil */
.profile-dropdown {
    width: 260px;
    right: 10px;
}

/* Dropdown de Notificações */
.notifications-dropdown {
    width: 340px;
    right: 60px;
}

.dropdown-header {
    padding: 16px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    cursor: pointer;
}
.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding-left: 20px; /* Efeito de deslize */
}
.dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}
.dropdown-item:hover svg {
    color: var(--primary-light);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.dropdown-item-danger {
    color: var(--error);
}
.dropdown-item-danger:hover {
    background: var(--error-light);
    color: var(--error);
}
.dropdown-item-danger svg { color: var(--error); }

/* ============================================
   COMPONENTES DE UI
   ============================================ */

/* ============================================
   GRID DE CARDS (LAYOUT FORÇADO E ROBUSTO)
   ============================================ */

.stats-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
    
    /* Padrão para Desktop: Força exatas 4 colunas iguais */
    grid-template-columns: repeat(4, 1fr);
}

/* Ponto de Quebra 1: Laptops pequenos ou Tablets (Modo Paisagem) */
/* Quando a tela for menor que 1200px, muda para 2 colunas (2 em cima, 2 embaixo) */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Ponto de Quebra 2: Celulares */
/* Quando a tela for menor que 600px, muda para 1 coluna (um embaixo do outro) */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-secondary); /* Fundo base */
    border: 1px solid var(--border-color);
    border-radius: 16px; /* Bordas mais arredondadas */
    padding: 24px;
    position: relative;
    overflow: hidden; /* Importante para efeitos de fundo */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px; /* Garante altura uniforme */
}

/* Efeito de Hover (Levantar e Brilhar) */
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Layout do Cabeçalho (Ícone e Título) */
.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    z-index: 2; /* Fica acima do efeito de fundo */
}

/* Ícones Modernos (Com brilho de fundo) */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* Cores Específicas por Tipo (Ícone e Glow) */

/* Pendentes (Warning) */
.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}
.stat-card:has(.warning)::before { /* Glow no topo do card */
    background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.15), transparent 60%);
}

/* Concluídos (Success) */
.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}
.stat-card:has(.success)::before {
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.15), transparent 60%);
}

/* Erro (Error) */
.stat-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}
.stat-card:has(.error)::before {
    background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.15), transparent 60%);
}

/* Total (Primary) */
.stat-icon.primary {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}
.stat-card:has(.primary)::before {
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 60%);
}

/* Elemento fantasma para o Glow de fundo */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: opacity 0.3s ease;
    opacity: 0.6;
}
.stat-card:hover::before { opacity: 1; }

/* Tipografia */
.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    z-index: 2;
    position: relative;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 12px;
    z-index: 2;
    position: relative;
    font-variant-numeric: tabular-nums; /* Melhora alinhamento dos números */
}

/* Texto de Status (Rodapé do Card) */
.stat-change {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    z-index: 2;
    position: relative;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Linha sutil separadora */
}

.stat-change.positive { color: var(--text-secondary); } /* Texto neutro claro */
.stat-change.negative { color: var(--error); } /* Vermelho para atenção */

/* Tabelas */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}
.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-tertiary); }
th {
    padding: 14px 24px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}
td {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}
tr:hover { background: var(--bg-tertiary); }

/* Botões */
.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

/* Badges e Status */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}
.status-ativo { background: var(--success-light); color: var(--success); }
.status-inativo { background: var(--error-light); color: var(--error); }

/* Alertas */
.alert {
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid var(--success); }
.alert-error { background: var(--error-light); color: var(--error); border: 1px solid var(--error); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid var(--info); }

/* ============================================
   FORMS E INPUTS
   ============================================ */

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}
input[type="text"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--info-light);
}
/* Correção para options em background escuro */
select option { background-color: #ffffff; color: #000000; }

/* ============================================
   PÁGINAS ESPECÍFICAS (Login, Config, Logs)
   ============================================ */

/* ============================================
   PÁGINA: LOGIN (Layout Split-Screen)
   ============================================ */

/* Container Principal */
.split-screen {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden; /* Evita scroll indesejado */
    background-color: var(--bg-primary);
}

/* --- LADO ESQUERDO (Formulário) --- */
.left-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background-color: var(--bg-primary);
    position: relative;
    z-index: 2;
    /* Ajuste Mobile: Removemos min-width fixo para não quebrar telas pequenas */
    width: 100%; 
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Logo e Títulos */
.brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.brand-logo { height: 48px; width: auto; }

.brand-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.welcome-header { margin-bottom: 32px; }

.welcome-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-header p {
    color: var(--text-muted);
    font-size: 16px;
}

/* Inputs e Ícones */
.input-container { position: relative; }

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

.form-input {
    width: 100%;
    /* Definindo altura e espaçamento explicitamente */
    height: 48px; 
    padding-top: 12px;
    padding-bottom: 12px;
    padding-right: 12px;
    
    /* AUMENTADO PARA 55px e com !important para garantir que nada sobrescreva */
    padding-left: 44px !important; 
    
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
}
.toggle-password:hover { color: var(--text-primary); }

/* Botão Login */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Opções Extras */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.forgot-link:hover { text-decoration: underline; }

.register-footer {
    margin-top: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.register-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* --- LADO DIREITO (Imagem Hero) --- */
.right-pane {
    flex: 1.4;
    position: relative;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bg-image {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    background-image: url('https://images.unsplash.com/photo-1497366216548-37526070297c?q=80&w=2069&auto=format&fit=crop');
    background-position: center;
    animation: slowZoom 30s infinite alternate;
}

@keyframes slowZoom {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Degradê suave para mesclar com o lado esquerdo */
    background: linear-gradient(to right, var(--bg-primary) 0%, rgba(15, 23, 42, 0.85) 20%, rgba(15, 23, 42, 0.4) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    padding: 40px;
    color: white;
}

.hero-quote {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 24px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.hero-quote span { color: var(--primary); }

.hero-features {
    display: flex;
    gap: 24px;
    margin-top: 40px;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Spinner no Botão */
.spinner { width: 20px; height: 20px; animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Responsividade Login */
@media (max-width: 900px) {
    .right-pane { display: none; }
    .left-pane { padding: 20px; width: 100%; }
    .hero-features { flex-direction: column; gap: 10px; }
}

/* Configurações */
.config-form .form-group {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}
.config-form .config-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Logs Filter */
.log-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.log-filter-form .form-group { flex: 1 1 150px; margin-bottom: 0; }

/* Activity Feed (Histórico) */
.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}
.activity-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.activity-message { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.activity-meta { font-size: 12px; color: var(--text-muted); }

/* ============================================
   RESPONSIVIDADE (MOBILE)
   ============================================ */

@media (max-width: 768px) {
    
    .btn-novo-processo {
        width: 100%; /* No celular ocupa a largura toda */
    }
    
    /* 1. Sidebar vira menu gaveta padrão */
    .sidebar {
        transform: translateX(-100%); /* Escondido totalmente na esquerda */
        width: 280px; /* Um pouco mais largo para toque */
        box-shadow: none;
    }
    
    /* Quando ativo via JS */
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    /* Mostra o botão de fechar */
    .sidebar-close-btn { display: flex !important; }

    /* Remove a linha colorida de hover do desktop */
    .sidebar::after { display: none; }

    /* 2. Conteúdo Principal */
    .main-content { margin-left: 0; padding-left: 0; }
    
    .top-bar { padding: 12px 16px; }
    .page-title { font-size: 18px; }

    /* 3. Ajuste de Grids e Tabelas */
    .stats-grid { grid-template-columns: 1fr; }
    .table-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    
    /* 4. Login */
    .login-container { grid-template-columns: 1fr; }
    .login-info { display: none; }
}

/* ============================================
   PÁGINA: CONFIGURAÇÕES
   ============================================ */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.config-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s;
}

.config-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1); /* fallback */
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace; /* Para números e versões */
}

/* Indicadores de Status (Bolinhas) */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.dot-green { background-color: var(--success); box-shadow: 0 0 8px var(--success-light); }
.dot-red { background-color: var(--error); }

/* Botão do Menu Mobile (Hambúrguer) */
.mobile-menu-btn {
    display: none; /* Escondido no Desktop */
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    margin-right: 12px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex; /* Aparece no Mobile */
    }
}

/* ============================================
   PÁGINA: LOGS E AUDITORIA
   ============================================ */

/* Cards de Topo (Auditoria) */
.audit-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.audit-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}
.audit-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.ac-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ac-blue { background: var(--info-light); color: var(--info); }
.ac-red { background: var(--error-light); color: var(--error); }
.ac-purple { background: rgba(139, 92, 246, 0.1); color: var(--secondary); }

.ac-info h4 { margin: 0 0 4px 0; font-size: 14px; color: var(--text-muted); font-weight: 500; }
.ac-info span { font-size: 18px; font-weight: 700; color: var(--text-primary); }

/* Barra de Filtros */
.filters-bar {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap; /* Importante para Mobile */
    align-items: flex-end;
}

.filter-group { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
    flex: 1; 
    min-width: 150px; 
}

.filter-group label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

/* Tabela de Logs */
.log-msg { 
    max-width: 300px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    font-family: monospace;
    font-size: 13px;
    color: var(--text-muted);
}

.log-detail-btn { 
    background: none; 
    border: none; 
    cursor: pointer; 
    color: var(--primary); 
    font-size: 12px; 
    font-weight: 600; 
    text-decoration: underline;
}

/* Badges Específicos de Log */
.badge-sm { padding: 2px 8px; font-size: 11px; border-radius: 4px; }
.badge-secondary-light { background: var(--bg-tertiary); color: var(--text-muted); }
.badge-error-light { background: var(--error-light); color: var(--error); }
.badge-success-light { background: var(--success-light); color: var(--success); }
.badge-warning-light { background: var(--warning-light); color: var(--warning); }

/* Responsividade Específica para Logs */
@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        width: 100%;
    }
    .log-table td, .log-table th {
        white-space: nowrap; /* Garante que a tabela não quebre feio, mas exige scroll */
    }
    .table-container {
        overflow-x: auto; /* Permite rolar a tabela horizontalmente no celular */
    }
}

/* ============================================
   PÁGINA: RECURSOS (Gráfico CSS Puro)
   ============================================ */

.chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    overflow-x: auto; /* Permite rolar se tiver muitos dias no mobile */
}

.chart-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.css-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 300px;
    gap: 8px;
    padding-top: 20px;
    border-bottom: 1px solid var(--border-color);
    min-width: 600px; /* Garante que o gráfico não esprema demais */
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
    min-width: 30px;
}

.chart-bar {
    width: 100%;
    background: linear-gradient(180deg, var(--secondary) 0%, rgba(139, 92, 246, 0.5) 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    min-height: 4px; /* Sempre mostra um risquinho */
    position: relative;
}

.chart-bar:hover {
    background: var(--primary-light);
    cursor: pointer;
}

/* Tooltip simples no hover da barra */
.chart-bar:hover::after {
    content: attr(data-value);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    margin-bottom: 6px;
    z-index: 10;
    box-shadow: var(--shadow);
}

.chart-label {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    transform: rotate(-45deg);
    transform-origin: center;
    white-space: nowrap;
}

/* ============================================
   PÁGINA: FORMULÁRIOS (Edição/Criação)
   ============================================ */

.form-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    max-width: 700px; /* Largura ideal para leitura */
    width: 100%;
    margin: 0; /* Alinhado à esquerda */
}

.btn-back-wrapper {
    margin-bottom: 20px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.btn-back:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .form-card {
        padding: 20px; /* Menos espaçamento no celular */
    }
}

/* ============================================
   PÁGINA: USUÁRIOS (Ações e Botões)
   ============================================ */

/* Botão de Novo Item (Estilo Destaque) */
.btn-new-user {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-new-user:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
    color: white; 
}

/* Container de Ações na Tabela */
.actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end; 
    gap: 10px;
}

/* Fix para Formulários dentro de tabelas não quebrarem layout */
.action-form {
    display: contents;
}

/* Botões de Ação (Ícones Quadrados) */
.btn-action-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.btn-action-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* --- Cores Específicas dos Botões de Ação --- */

/* Editar (Azul) */
.btn-action-icon.edit:hover { 
    color: var(--primary); 
    border-color: var(--primary); 
    background: var(--info-light); 
}

/* Excluir (Vermelho) */
.btn-action-icon.delete:hover { 
    color: var(--error); 
    border-color: var(--error); 
    background: var(--error-light); 
}

/* Status: Botão Vermelho (Para Desativar) */
.btn-action-icon.btn-status-red {
    color: var(--error); 
    border-color: rgba(239, 68, 68, 0.5);
}
.btn-action-icon.btn-status-red:hover {
    background: var(--error-light);
    border-color: var(--error);
}

/* Status: Botão Verde (Para Ativar) */
.btn-action-icon.btn-status-green {
    color: var(--success); 
    border-color: rgba(16, 185, 129, 0.5);
}
.btn-action-icon.btn-status-green:hover {
    background: var(--success-light);
    border-color: var(--success);
}

/* ============================================
   DASHBOARD & ESTADOS VAZIOS
   ============================================ */

/* Área de "Nenhum registro encontrado" */
.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-secondary); /* Opcional: destaca a área */
    border-radius: 8px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.3;
    display: block;
    color: var(--text-muted);
}

.empty-state p {
    margin: 4px 0;
}

/* Ajuste específico para a coluna de ações no Dashboard */
.dashboard-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end; /* Alinha à direita como padrão */
}

/* Responsividade para o Dashboard */
@media (max-width: 768px) {
    .dashboard-actions {
        justify-content: flex-start; /* No mobile, alinha à esquerda */
    }
}

/* Ajuste específico para o botão Novo Processo no Dashboard */
.btn-novo-processo {
    width: 200px; /* Largura fixa para ficar bonito no desktop */
    justify-content: center; /* Centraliza o texto/ícone */
    white-space: nowrap; /* Impede que o texto quebre */
}

/* ============================================
   PÁGINA: EDITOR (TinyMCE)
   ============================================ */

.edit-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
}

/* Área de Ações do Editor */
.edit-actions {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end; /* Desktop: Alinha à direita */
}

/* Ajustes Específicos do TinyMCE no Tema Escuro */
.tox-tinymce {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
}

.tox .tox-toolbar,
.tox .tox-statusbar,
.tox .tox-menubar {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.tox .tox-tbtn {
    color: var(--text-primary) !important;
}

.tox .tox-tbtn:hover {
    background-color: var(--bg-hover) !important;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .edit-card {
        padding: 20px; /* Menos padding no celular */
    }
    
    .edit-actions {
        flex-direction: column-reverse; /* Botão Salvar em cima, Cancelar embaixo */
    }
    
    .edit-actions .btn-primary,
    .edit-actions .btn-secondary {
        width: 100%; /* Botões ocupam largura total */
        justify-content: center;
    }
}

/* ============================================
   BARRA DE FERRAMENTAS FIXA (STICKY)
   ============================================ */

.sticky-toolbar {
    position: sticky;
    top: 73px; /* Altura aproximada da Top Bar + um respiro */
    z-index: 89; /* Fica abaixo da Top Bar (que é 90), mas acima do conteúdo */
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

/* Título dentro da barra de ferramentas */
.sticky-toolbar h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.sticky-actions {
    display: flex;
    gap: 12px;
}

/* No mobile, ajustamos para não ocupar muito espaço */
@media (max-width: 768px) {
    .sticky-toolbar {
        top: 65px; /* Ajuste fino para mobile */
        flex-direction: column;
        gap: 12px;
        align-items: stretch; /* Botões esticados */
    }

    .sticky-toolbar h2 {
        text-align: center;
        font-size: 16px;
    }

    .sticky-actions {
        justify-content: space-between;
    }
    
    .sticky-actions .btn-primary, 
    .sticky-actions .btn-secondary {
        flex: 1; /* Botões dividem o espaço igualmente */
        justify-content: center;
    }
}

/* ============================================
   PÁGINA: VISUALIZAR RESUMO
   ============================================ */

.resumo-logo-container {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.resumo-logo {
    max-width: 300px;
    height: auto;
    display: inline-block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.resumo-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    overflow: visible; /* Importante para o Sticky funcionar */
}

/* Cabeçalho Sticky (Travado no topo) */
.resumo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    
    position: sticky; /* Ativa a trava */
    position: -webkit-sticky; /* Para Safari */
    
    /* Ajuste este valor conforme a altura da sua barra azul superior */
    top: 80px; 
    
    z-index: 80;
    background: var(--bg-secondary);
    
    /* Margens para encostar nas bordas */
    margin: -32px -32px 24px -32px; 
    padding: 32px 32px 24px 32px;
    
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.header-info { flex: 1; }

.header-info h2 {
    margin-bottom: 8px;
    font-size: 24px;
    color: var(--text-primary);
}

.resumo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.resumo-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Conteúdo do Texto */
.resumo-content {
    line-height: 1.7;
    color: var(--text-secondary);
    padding-top: 8px; 
}

.resumo-content h1, 
.resumo-content h2, 
.resumo-content h3 {
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

/* Dropdown de Ações */
.btn-group { position: relative; display: inline-flex; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 220px;
    z-index: 100;
    padding: 8px;
    box-shadow: var(--shadow-xl);
}
.btn-group.active .dropdown-menu { display: block; }
.dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
}
.dropdown-menu a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .resumo-header {
        top: 70px; /* Um pouco menos no celular */
        flex-direction: column;
        align-items: stretch;
    }
    .header-actions-top {
        justify-content: space-between;
        margin-top: 16px;
    }
}

/* ============================================
   PÁGINA: NOVO PROCESSO (Upload)
   ============================================ */

.upload-area {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 32px;
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.upload-area:hover {
    border-color: var(--primary);
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 50%;
    color: var(--primary-light);
}

.upload-text h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-text p {
    color: var(--text-muted);
    font-size: 14px;
}

.file-input { display: none; }

/* Pré-visualização do Arquivo Selecionado */
.file-preview {
    display: none;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
}

.file-preview.active {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-icon {
    width: 48px;
    height: 48px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error);
    flex-shrink: 0;
}

.file-info { flex: 1; }

.file-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.file-size {
    font-size: 13px;
    color: var(--text-muted);
}

.remove-file {
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    border-radius: 6px;
}

.remove-file:hover {
    background: var(--bg-hover);
    color: var(--error);
}

/* Loader Específico do Botão de Upload */
.btn-text, .btn-loader-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loader {
    display: inline-block;
    animation: spin 1s linear infinite;
}
.btn-loader svg.spinner {
    width: 20px; height: 20px; stroke-width: 3;
}

/* ============================================
   PÁGINA: NOVO PROCESSO (Ajustes Finais)
   ============================================ */

/* Container para centralizar o conteúdo no Desktop */
.centered-content {
    max-width: 800px; /* Largura máxima confortável para leitura */
    margin: 0 auto;   /* Centraliza horizontalmente */
    width: 100%;
}

/* Área de Botões (Substitui o style inline) */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Ajustes Responsivos (Mobile) */
@media (max-width: 768px) {
    
    /* Reduz o tamanho da área de Drag & Drop no celular */
    .upload-area {
        padding: 30px 20px; /* Menos espaçamento */
    }
    
    .upload-icon {
        width: 60px;
        height: 60px;
        padding: 15px;
        margin-bottom: 16px;
    }
    
    .upload-text h3 {
        font-size: 18px;
    }

    /* Empilha os botões no celular para ficarem grandes e clicáveis */
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
        justify-content: center;
        height: 48px; /* Botão mais alto para o dedo */
    }
}

/* ============================================
   PÁGINA: PROCESSAMENTO (Steps & Logs)
   ============================================ */

.processing-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.processing-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px;
    text-align: center;
}

.processing-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 32px;
    position: relative;
    color: var(--primary-light);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.processing-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.processing-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

/* Informações do Processo */
.process-info {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: left;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.info-row:last-child { border-bottom: none; }

.info-label { color: var(--text-muted); font-size: 14px; }
.info-value { font-weight: 600; color: var(--text-primary); }

/* Steps de Progresso */
.progress-container { margin: 32px 0; }

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px; left: 0; right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.progress-line {
    position: absolute;
    top: 20px; left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 1;
    transition: width 0.5s ease;
    width: 0%;
}

.step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.step-circle {
    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-bottom: 12px;
    transition: var(--transition);
}

.step.active .step-circle {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.step.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.step-circle svg { width: 20px; height: 20px; stroke-width: 2; }

.step-label {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}
.step.active .step-label { color: var(--primary-light); font-weight: 600; }

/* Container de Logs */
.logs-container {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    margin-bottom: 24px;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}
.log-entry:last-child { border-bottom: none; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.log-time { color: var(--text-muted); margin-right: 12px; }
.log-message { color: var(--text-secondary); }
.log-message.success { color: var(--success); }
.log-message.error { color: var(--error); }

/* Grid de Estatísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.stat-box {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--primary-light); }

/* Responsividade */
@media (max-width: 768px) {
    .processing-card { padding: 24px; }
    
    .step-label { display: none; } /* Esconde labels dos steps para caber */
    .step.active .step-label { display: block; } /* Mostra só o ativo */
    
    .stats-grid { grid-template-columns: 1fr; } /* Empilha stats */
    
    .action-buttons {
        flex-direction: column;
        gap: 12px;
    }
    .action-buttons button, .action-buttons a {
        width: 100%;
        display: block;
        text-align: center;
    }
}

/* ============================================
   PÁGINA: MEUS PROCESSOS (Filtros e Busca)
   ============================================ */

/* Barra de Ferramentas (Container das abas e busca) */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

/* Grupo de Abas (Estilo Pílula) */
.filter-tabs {
    display: flex;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto; /* Permite rolar no mobile se não caber */
}

.filter-tab {
    padding: 8px 16px;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--bg-secondary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* Campo de Busca */
.search-form {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 12px 10px 40px; /* Espaço para a lupa */
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px; 
    height: 16px;
    pointer-events: none;
}

/* Paginação Padronizada */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.pagination-item {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}

.pagination-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Responsividade */
@media (max-width: 768px) {
    .toolbar { 
        flex-direction: column-reverse; /* Busca em cima, abas embaixo */
        align-items: stretch; 
    }
    .search-form { max-width: 100%; }
}

/* ============================================
   ESTILOS DE IMPRESSÃO
   ============================================ */
@media print {
    
    /* 1. Ocultar Interface do Sistema (Barra lateral, Topo, Botões) */
    .sidebar, 
    .top-bar, 
    .mobile-menu-btn,
    .sidebar-overlay,
    .header-actions-top,  /* Esconde Botões Voltar/Editar */
    .sticky-actions,      /* Esconde Botões na tela de edição */
    .btn-group,           /* Esconde o menu de opções (três pontinhos) */
    .btn-primary,         /* Esconde qualquer botão primário */
    .btn-secondary,       /* Esconde qualquer botão secundário */
    .dropdown-menu,       /* Garante que menus abertos sumam */
    button {              /* Regra geral para sumir com botões */
        display: none !important;
    }

    /* 2. Resetar o Layout para ocupar a folha A4 */
    body, html {
        background-color: white !important;
        height: auto !important;
        width: 100% !important;
        overflow: visible !important;
    }

    /* Removemos o layout Flexbox do dashboard para o papel */
    .dashboard-wrapper, 
    .main-content, 
    .content-area {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        border: none !important;
    }

    /* 3. Limpar o Card do Resumo (Tira bordas e sombras) */
    .resumo-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }

    /* 4. Destravar o Cabeçalho (Sticky) para o papel */
    .resumo-header {
        position: static !important; /* Deixa de flutuar */
        top: auto !important;
        margin: 0 0 20px 0 !important;
        padding: 0 !important;
        border-bottom: 2px solid #000 !important; /* Linha preta sólida */
        box-shadow: none !important;
        background: transparent !important;
    }

    /* 5. Forçar Texto Preto (Economia de tinta e legibilidade) */
    h1, h2, h3, h4, p, span, div, strong, li {
        color: #000 !important;
        text-shadow: none !important;
    }

    /* 6. Garantir que o Logo apareça centralizado */
    .resumo-logo-container {
        display: block !important;
        text-align: center !important;
        margin-bottom: 20px !important;
        border: none !important;
    }
    
    .resumo-logo {
        max-width: 200px !important; /* Tamanho controlado no papel */
    }
}

/* ============================================
   RODAPÉ DA SIDEBAR (Botão Sair)
   ============================================ */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 24px;
    background: var(--bg-secondary); /* Garante que o texto não sobreponha */
    border-top: 1px solid var(--border-color); /* Separação visual */
}

/* Ajuste para telas muito baixas (evita que o botão Sair tape o menu) */
@media (max-height: 600px) {
    .sidebar-footer {
        position: relative; /* Deixa de ser fixo e flui com a rolagem */
        bottom: auto;
    }
}