/* =====================================================
   SISTEMA JURÍDICO - CSS UNIFICADO
   Consolidação de todos os estilos do sistema jurídico
   ===================================================== */

/* =====================================================
   VARIÁVEIS CSS GLOBAIS
   ===================================================== */
:root {
    /* Cores Primárias - Sistema Jurídico */
    --juridico-primary: var(--theme-brand-primary, #800020);
    --juridico-secondary: var(--theme-brand-primary-hover, #7c2d12);
    --juridico-tertiary: var(--theme-brand-secondary, #470717);
    --juridico-accent: var(--theme-brand-accent, #f472b6);
    --juridico-success: var(--theme-success, #10b981);
    --juridico-warning: var(--theme-warning, #f59e0b);
    --juridico-danger: var(--theme-danger, #ef4444);
    --juridico-info: var(--theme-info, #06b6d4);

    /* Cores base para tokens compartilhados */
    --primary-600: var(--theme-brand-primary, #800020);
    --primary-700: var(--theme-brand-primary-hover, #7c2d12);
    --success-500: var(--theme-success, #10b981);
    --success-600: var(--theme-success, #059669);
    --error-600: var(--theme-danger, #dc2626);

    /* Cores de texto */
    --text-primary: var(--theme-text-primary, #1f2937);
    --text-secondary: var(--theme-text-secondary, #6b7280);
    --text-tertiary: var(--theme-text-tertiary, #9ca3af);
    --text-inverse: var(--theme-text-inverse, #ffffff);

    /* Cores de borda */
    --border-primary: var(--theme-border-primary, #e5e7eb);
    --border-color: var(--theme-border-primary, #e5e7eb);
    
    /* Cores específicas dos módulos */
    --card-clientes: #8b5cf6;
    --card-processos: #059669;
    --card-prazos: #dc2626;
    --card-notificacoes: #7c2d12;
    --financeiro-primary: #059669;
    --agenda-primary: #800020;
    --processo-primary: #800020;
    
    /* Header */
    --header-bg-primary: var(--theme-brand-primary, #800020);
    --header-bg-secondary: var(--theme-brand-primary-hover, #7c2d12);
    --header-text: var(--theme-text-inverse, #ffffff);
    --header-text-muted: rgba(255, 255, 255, 0.7);
    --menu-bg: rgba(255, 255, 255, 0.1);
    --menu-bg-hover: rgba(255, 255, 255, 0.15);
    --menu-bg-active: rgba(255, 255, 255, 0.2);
    
    /* Dropdowns */
    --dropdown-bg: #ffffff;
    --dropdown-border: #e5e7eb;
    --dropdown-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    --dropdown-text: #374151;
    --dropdown-text-hover: #1f2937;
    --dropdown-bg-hover: #f9fafb;
    
    /* Shadows */
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Status e Estados */
    --status-ativo: #10b981;
    --status-suspenso: #f59e0b;
    --status-arquivado: #6b7280;
    --status-baixado: #7c2d12;
    --status-pendente: #f59e0b;
    --status-concluido: #10b981;
    --status-cancelado: #ef4444;
    
    /* Prioridades */
    --prioridade-baixa: #10b981;
    --prioridade-media: #f59e0b;
    --prioridade-alta: #ef4444;
    --prioridade-urgente: #dc2626;
    
    /* Tipos de evento */
    --evento-prazo: #ef4444;
    --evento-audiencia: #8b5cf6;
    --evento-reuniao: #7c2d12;
    --evento-tarefa: #10b981;
    --evento-compromisso: #f59e0b;
    
    /* Espaçamentos */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 50%;
    
    /* Transições */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-colors: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;

    /* Tipografia */
    --text-sm: 0.875rem;
    --font-medium: 500;
    --leading-relaxed: 1.625;

    /* Sombras */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Tipografia centralizada nos tokens do tema */
html body :where(*):not(i):not(svg):not(pre):not(code):not(kbd):not(samp):not(.fa):not([class^="fa-"]):not([class*=" fa-"]) {
    font-family: var(--theme-font-family-base, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}

html body :where(h1, h2, h3, h4, h5, h6, .page-title, .section-title, .card-title, .modal-title, .action-text, .stat-item .stat-value) {
    font-family: var(--theme-font-family-heading, "Merriweather", serif);
}

html body :where(pre, code, kbd, samp) {
    font-family: monospace;
}

/* =====================================================
   RESET E BASE
   ===================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--theme-font-family-base, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    margin: 0;
    padding: 0;
    background: var(--theme-bg-body, #f8fafc);
    color: var(--theme-text-primary, #1f2937);
    line-height: 1.6;
}

/* =====================================================
   HEADER JURÍDICO - ESTILOS REMOVIDOS PARA EVITAR CONFLITOS
   Os estilos específicos do header jurídico estão em admin.css
   ===================================================== */

/* =====================================================
   LAYOUT PRINCIPAL
   ===================================================== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header {
    background: linear-gradient(135deg, var(--juridico-primary) 0%, var(--juridico-secondary) 100%);
    color: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-text h1 {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 700;
}

.header-text p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* =====================================================
   CARDS E COMPONENTES
   ===================================================== */
.stat-card, .summary-card {
    background: var(--theme-bg-surface, #ffffff);
    border-radius: var(--radius-xl);
    padding: 1rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--theme-border-primary, #e5e7eb);
    transition: all var(--transition-normal);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

.stat-card::before, .summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--juridico-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-card:hover, .summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.card-clientes::before { background: var(--card-clientes); }
.card-processos::before { background: var(--card-processos); }
.card-prazos::before { background: var(--card-prazos); }
.card-notificacoes::before { background: var(--card-notificacoes); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-icon {
    font-size: 1.5rem;
    opacity: 0.7;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.card-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: auto;
    flex: 1;
}

.stat-card .card-action {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    display: block !important;
}

.stat-card .card-action a {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #7c2d12 0%, #991b1b 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    visibility: visible !important;
    opacity: 1 !important;
}

.stat-card .card-action a:hover {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.stat-card .card-action a i[data-lucide],
.stat-card .card-action a i[data-lucide] svg {
    width: 14px !important;
    height: 14px !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* =====================================================
   DASHBOARD
   ===================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.search-section {
    margin-bottom: 2rem;
    position: relative;
}

.search-container {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid #e5e7eb;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 1rem;
    transition: all var(--transition-normal);
    margin-bottom: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--juridico-secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* =====================================================
   WIDGETS
   ===================================================== */
.widget {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.widget-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.widget-content {
    padding: 1.5rem;
}

/* =====================================================
   TABELAS
   ===================================================== */
.table-container {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 2rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table tbody tr.inactive {
    opacity: 0.6;
    background: #f3f4f6;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fecaca;
    color: #991b1b;
}

.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-editor {
    background: #fce7f3;
    color: #800020;
}

.badge-usuario {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-secretaria {
    background: #dbeafe;
    color: #1e40af;
}

/* =====================================================
   SELECTS
   ===================================================== */
.select-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.select-sm:focus {
    outline: none;
    border-color: var(--juridico-secondary);
    box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.1);
}

/* =====================================================
   UTILITÁRIOS
   ===================================================== */
.current-user {
    color: var(--juridico-primary);
    font-weight: 500;
    font-style: italic;
}

.text-muted {
    color: #6b7280;
    font-style: italic;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

/* =====================================================
   FORMULÁRIOS
   ===================================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--juridico-secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* =====================================================
   STATUS E BADGES
   ===================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-ativo { background: #d1fae5; color: #065f46; }
.status-suspenso { background: #fef3c7; color: #92400e; }
.status-arquivado { background: #f3f4f6; color: #374151; }
.status-baixado { background: #fce7f3; color: #800020; }
.status-pendente { background: #fef3c7; color: #92400e; }
.status-concluido { background: #d1fae5; color: #065f46; }
.status-cancelado { background: #fee2e2; color: #991b1b; }

.prioridade-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.prioridade-baixa { background: #d1fae5; color: #065f46; }
.prioridade-media { background: #fef3c7; color: #92400e; }
.prioridade-alta { background: #fee2e2; color: #991b1b; }
.prioridade-urgente { 
    background: #fecaca; 
    color: #7f1d1d; 
    animation: pulse 2s infinite;
}

/* =====================================================
   ABAS
   ===================================================== */
.tabs-nav {
    display: flex;
    background: white;
    border-radius: var(--radius-xl);
    padding: 0.5rem;
    box-shadow: var(--shadow-card);
    overflow-x: auto;
    gap: 0.25rem;
    margin-bottom: 2rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.tab-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.tab-btn.active {
    background: var(--juridico-primary);
    color: white;
    box-shadow: 0 2px 4px rgba(128, 0, 32, 0.3);
}

.tab-btn .badge {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tabs-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* =====================================================
   ALERTAS E MENSAGENS
   ===================================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: #fce7f3;
    color: #800020;
    border: 1px solid #f9a8d4;
}

/* =====================================================
   MODAIS
   ===================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* =====================================================
   ESTADOS ESPECIAIS
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--juridico-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* =====================================================
   ANIMAÇÕES
   ===================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =====================================================
   RESPONSIVIDADE
   ===================================================== */
@media (max-width: 1024px) {
    .header-search {
        max-width: 300px;
        margin: 0 1rem;
    }
    
    .admin-nav a {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        gap: 0.4rem;
    }
}

@media (max-width: 900px) {
    .admin-nav a span {
        display: none;
    }
    
    .admin-nav .icon {
        font-size: 1.2rem;
    }
    
    .dropdown-arrow {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }
    
    .header-search {
        display: none;
    }
    
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1rem;
    }
    
    .header-text h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .card-value {
        font-size: 2rem;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .action-btn {
        padding: 1rem 0.5rem;
    }
    
    .action-icon {
        font-size: 1.25rem;
    }
    
    .action-text {
        font-size: 0.8rem;
    }
}

/* =====================================================
   AÇÕES RÁPIDAS
   ===================================================== */
.quick-actions {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.quick-actions h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: #374151;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.action-btn:hover {
    background: var(--juridico-secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: var(--juridico-secondary);
}

.action-icon {
    font-size: 1.5rem;
    line-height: 1;
    color: #374151;
}

.action-btn:hover .action-icon {
    color: #ffffff;
}

.action-text {
    font-size: 0.875rem;
    font-weight: 300;
    text-align: center;
    line-height: 1.2;
    font-family: var(--theme-font-family-heading, "Merriweather", serif);
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings: "wdth" 100;
}

/* =====================================================
   COMPONENTES ESPECÍFICOS
   ===================================================== */

/* Overview Financeiro */
.financial-overview {
    margin-bottom: 2rem;
}

.financial-summary {
    display: grid;
    gap: 0.75rem;
}

.financial-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.financial-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.financial-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.overview-item {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.overview-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.overview-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.overview-value.positive {
    color: var(--juridico-success);
}

.overview-value.negative {
    color: var(--juridico-danger);
}

.overview-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Timesheet */
.timesheet-list, .despesas-list, .honorarios-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timesheet-item, .despesa-item, .contrato-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.timesheet-item:hover, .despesa-item:hover, .contrato-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.timesheet-item.faturado {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.timesheet-item.pendente {
    background: #fffbeb;
    border-color: #fed7aa;
}

.timesheet-data, .despesa-data {
    flex-shrink: 0;
    text-align: center;
    min-width: 100px;
}

.data-trabalho, .data-despesa {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.horario, .tipo-despesa {
    font-size: 0.8rem;
    color: #6b7280;
}

.timesheet-info, .despesa-info {
    flex: 1;
}

.atividade-descricao, .despesa-descricao {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.timesheet-meta, .despesa-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.timesheet-valor, .despesa-valor {
    text-align: center;
    flex-shrink: 0;
    min-width: 120px;
}

.valor-total {
    font-weight: 600;
    color: var(--juridico-success);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.faturado-badge {
    color: #065f46;
    background: #d1fae5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.pendente-badge {
    color: #92400e;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Documentos */
.documentos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.documento-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    text-align: center;
}

.documento-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.documento-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.documento-nome {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.documento-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.documento-tipo {
    font-size: 0.75rem;
    color: var(--juridico-secondary);
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 1rem;
}

.documento-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Seções */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.section-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
}

/* Charts placeholder */
.chart-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b7280;
    text-align: center;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

.chart-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.relatorios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.relatorio-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.relatorio-card h4 {
    color: #1f2937;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* =====================================================
   UTILITÁRIOS
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-mono { font-family: 'Courier New', monospace; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =====================================================
   ESTILOS ESPECÍFICOS DOS MÓDULOS
   ===================================================== */

/* =====================================================
   SISTEMA INFO - STATUS E INFORMAÇÕES
   ===================================================== */
.status-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.status-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.status-value {
    font-weight: 500;
}

.status-value.ok { color: #059669; }
.status-value.warning { color: #d97706; }
.status-value.error { color: #dc2626; }

.info-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.section-header h3 {
    margin: 0;
    color: #1f2937;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.module-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.module-item.available {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.module-item.unavailable {
    background: #fef2f2;
    border-color: #fecaca;
}

.module-icon {
    font-size: 1.5rem;
}

.module-name {
    font-weight: 500;
    color: #1f2937;
}

.module-status {
    font-size: 0.875rem;
    font-weight: 500;
}

.module-status.available { color: #059669; }
.module-status.unavailable { color: #dc2626; }

/* =====================================================
   ESTATÍSTICAS DO SISTEMA - CONTADORES EM LISTA
   ===================================================== */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.stat-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--juridico-primary);
    transition: all var(--transition-normal);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.stat-item:hover {
    background: #f9fafb;
    border-color: var(--juridico-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateX(4px);
}

.stat-item .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--juridico-primary);
    line-height: 1;
    font-family: var(--theme-font-family-heading, "Merriweather", serif);
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings: "wdth" 100;
    min-width: 120px;
    text-align: right;
}

.stat-item .stat-label {
    font-size: 1rem;
    color: #1f2937;
    font-weight: 500;
    flex: 1;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
}

@media (max-width: 768px) {
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
        padding: var(--space-4);
    }
    
    .stat-item .stat-value {
        font-size: 1.5rem;
        text-align: left;
        min-width: auto;
    }
    
    .stat-item .stat-label {
        text-align: left;
    }
}

/* =====================================================
   TABELAS DO SISTEMA - LISTA
   ===================================================== */
.tables-status {
    margin-top: var(--space-6);
}

.tables-status h4 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: #1f2937;
    margin-bottom: var(--space-4);
}

.tables-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.table-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--juridico-primary);
    transition: all var(--transition-normal);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.table-item:hover {
    background: #f9fafb;
    border-color: var(--juridico-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateX(4px);
}

.table-item .table-name {
    font-size: 1rem;
    color: #1f2937;
    font-weight: 500;
    flex: 1;
    text-align: left;
    text-transform: capitalize;
}

.table-item .table-status {
    font-size: 0.875rem;
    font-weight: 500;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    min-width: 120px;
    text-align: right;
}

.table-item .table-status.ok {
    color: #059669;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.table-item .table-status.error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

@media (max-width: 768px) {
    .table-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
        padding: var(--space-4);
    }
    
    .table-item .table-status {
        text-align: left;
        min-width: auto;
        width: 100%;
    }
}

/* =====================================================
   PERMISSÕES DE ARQUIVOS - LISTA
   ===================================================== */
.permissions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.permission-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--juridico-primary);
    transition: all var(--transition-normal);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.permission-item:hover {
    background: #f9fafb;
    border-color: var(--juridico-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateX(4px);
}

.permission-item .permission-path {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    font-family: monospace;
    min-width: 200px;
    flex-shrink: 0;
}

.permission-item .permission-description {
    font-size: 1rem;
    color: #1f2937;
    font-weight: 500;
    flex: 1;
    text-align: left;
}

.permission-item .permission-status {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.permission-item .permission-status .status-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.permission-item .permission-status .status-badge.ok {
    color: #059669;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.permission-item .permission-status .status-badge.warning {
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.permission-item .permission-status .status-badge.error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

@media (max-width: 768px) {
    .permission-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
        padding: var(--space-4);
    }
    
    .permission-item .permission-path {
        min-width: auto;
        width: 100%;
    }
    
    .permission-item .permission-description {
        width: 100%;
    }
    
    .permission-item .permission-status {
        width: 100%;
        justify-content: flex-start;
    }
}

/* =====================================================
   CLIENTES - PROCESSOS RELACIONADOS
   ===================================================== */
.processo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.processo-numero {
    font-weight: 600;
    color: #1f2937;
}

.processo-assunto {
    color: #6b7280;
    flex: 1;
    margin: 0 1rem;
}

/* =====================================================
   AGENDA - SWITCHER DE VISUALIZAÇÃO
   ===================================================== */
.view-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.25rem;
    gap: 0.25rem;
}

.view-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-btn.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.eventos-lista {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.evento-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.evento-card.tipo-prazo { border-left-color: #ef4444; }
.evento-card.tipo-audiencia { border-left-color: #8b5cf6; }
.evento-card.tipo-reuniao { border-left-color: #3b82f6; }
.evento-card.tipo-tarefa { border-left-color: #10b981; }
.evento-card.tipo-compromisso { border-left-color: #f59e0b; }

.evento-hora {
    font-weight: 600;
    color: #1f2937;
    min-width: 80px;
}

.evento-info {
    flex: 1;
}

.evento-titulo {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.evento-descricao {
    font-size: 0.875rem;
    color: #6b7280;
}

.evento-acoes {
    display: flex;
    gap: 0.5rem;
}

/* =====================================================
   LOGIN E CADASTRO - ESTILOS ESPECÍFICOS
   ===================================================== */
.login-footer {
    margin-top: var(--space-8);
    text-align: center;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-primary);
}

.login-footer a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: var(--font-medium);
    transition: var(--transition-colors);
}

.login-footer a:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

.login-footer .separator {
    margin: 0 var(--space-3);
    color: var(--text-tertiary);
}

.success-message {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: var(--text-inverse);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.form-help {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    line-height: var(--leading-relaxed);
}

.form-help.error {
    color: var(--error-600);
    font-weight: var(--font-medium);
}

.form-help.success {
    color: var(--success-600);
    font-weight: var(--font-medium);
}

/* =====================================================
   CALCULADORA DE PRAZOS
   ===================================================== */
.calc-result {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-top: var(--space-6);
    box-shadow: var(--shadow-card);
}

.calc-result h4 {
    color: var(--juridico-primary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.result-highlight {
    background: linear-gradient(135deg, var(--juridico-primary), var(--juridico-secondary));
    color: white;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: var(--space-4);
    font-size: 1.25rem;
    font-weight: 600;
}

.dia-semana {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3);
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
}

.detail-item .label {
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-item .value {
    font-weight: 600;
    color: var(--juridico-primary);
}

.calc-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-4);
}

.prazos-comuns {
    display: grid;
    gap: var(--space-4);
}

.prazo-category h4 {
    color: var(--juridico-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid #e2e8f0;
}

.prazo-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: var(--space-3);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: var(--space-2);
}

.prazo-item:hover {
    background: #f8fafc;
    border-color: var(--juridico-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
}

.prazo-item strong {
    color: var(--juridico-primary);
    font-weight: 600;
}

.alert.alert-info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border: 1px solid #93c5fd;
    color: #1e40af;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin: var(--space-4) 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.alert.alert-info i {
    color: #3b82f6;
}

/* =====================================================
   FORMULÁRIOS INLINE
   ===================================================== */
.inline-form {
    display: inline !important;
    margin: 0 var(--space-1);
}

.inline-form:first-child {
    margin-left: 0;
}

.inline-form:last-child {
    margin-right: 0;
}

/* =====================================================
   FILTROS DE BUSCA - HARMONIZAÇÃO
   ===================================================== */
.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: var(--space-4);
    align-items: end;
    margin-bottom: var(--space-6);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.filter-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: var(--space-1);
}

.filter-group input,
.filter-group select {
    padding: var(--space-3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--juridico-primary);
    box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.1);
}

/* Harmonização específica para o campo Status */
.status-group {
    margin-top: var(--space-1);
}

.status-group label {
    margin-bottom: var(--space-2);
}

.filter-actions {
    display: flex;
    gap: var(--space-2);
    align-items: end;
}

/* =====================================================
   UTILITÁRIOS DE VISIBILIDADE
   ===================================================== */
.hidden {
    display: none !important;
}

/* =====================================================
   BARRAS DE PROGRESSO
   ===================================================== */
.progress-bar {
    width: 0% !important;
    transition: width 0.3s ease;
}

/* =====================================================
   AJUSTES DESKTOP COMPACTO (1366x768)
   ===================================================== */
@media (max-width: 1366px) and (min-width: 1025px) and (max-height: 768px) {
    html {
        font-size: 15px;
    }

    .main-container {
        max-width: 1320px;
        padding: 1.25rem 1rem;
    }

    .page-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .header-content {
        gap: 1.25rem;
    }

    .header-text h1 {
        font-size: 1.65rem;
    }

    .header-text p {
        font-size: 0.92rem;
    }

    .dashboard-grid,
    .dashboard-columns,
    .search-section,
    .table-container,
    .quick-actions {
        margin-bottom: 1.5rem;
    }

    .dashboard-grid {
        gap: 1rem;
    }

    .dashboard-columns {
        grid-template-columns: 1fr 320px;
        gap: 1.25rem;
    }

    .stat-card,
    .summary-card {
        min-height: 140px;
        padding: 0.85rem;
    }

    .card-title,
    .card-description,
    .badge,
    .status-badge {
        font-size: 0.8rem;
    }

    .card-value {
        font-size: 1.7rem;
    }

    .card-icon,
    .action-icon,
    .overview-icon,
    .documento-icon {
        font-size: 1.25rem;
    }

    .search-container,
    .widget-content,
    .table-header,
    .quick-actions {
        padding: 1rem;
    }

    .widget-header {
        padding: 1rem 1rem 0 1rem;
    }

    .widget-header h3,
    .quick-actions h3 {
        font-size: 1rem;
    }

    .search-input,
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.86rem;
        padding: 0.6rem 0.75rem;
    }

    .data-table th,
    .data-table td,
    th,
    td {
        padding: 0.75rem;
        font-size: 0.86rem;
    }

    .actions-grid {
        gap: 0.75rem;
    }

    .action-btn {
        gap: 0.5rem;
        padding: 1rem 0.75rem;
    }

    .action-text {
        font-size: 0.8rem;
    }

    .tab-btn {
        padding: 0.6rem 0.85rem;
        font-size: 0.86rem;
    }

    .tab-content {
        padding: 1.5rem;
    }
}
