/* =============================================================================
   SISTEMA INTERNO - CSS Principal
   ============================================================================= */

:root {
    --primary: #7c5cff;
    --primary-light: #a18fff;
    --primary-dark: #5a3dd6;
    --primary-subtle: #f4f1ff;
    
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    --transition: all 0.2s ease;
    --sidebar-width: 260px;
    --header-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; color: var(--gray-900); }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
a { color: var(--primary); text-decoration: none; }

/* Layout */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--gray-200);
}

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-icon { width: 36px; height: 36px; color: var(--primary); display: flex; align-items: center; justify-content: center; overflow: visible; }
.logo-icon .logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.logo-icon svg { width: 100%; height: 100%; }
.logo-text { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--gray-900); }
.logo-text span { color: var(--primary); }

.sidebar-nav { flex: 1; padding: 16px; overflow-y: auto; }
.nav-section { margin-bottom: 24px; }
.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 8px 12px;
}

.nav-module { margin-bottom: 8px; }
.nav-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: var(--gray-600);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}
.nav-module-header:hover { background: var(--gray-100); color: var(--gray-900); }
.module-info { display: flex; align-items: center; gap: 12px; font-size: 0.875rem; font-weight: 500; }
.module-info svg { width: 20px; height: 20px; }
.expand-icon { transition: transform 0.2s ease; }
.nav-module-header.expanded .expand-icon { transform: rotate(180deg); }

.nav-module-items { display: none; padding-left: 16px; margin-top: 4px; }
.nav-module-items.expanded { display: block; }

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--gray-500);
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.nav-subitem:hover { background: var(--gray-100); color: var(--gray-700); }
.nav-subitem.active { background: var(--primary-subtle); color: var(--primary); font-weight: 500; }
.nav-subitem svg { width: 16px; height: 16px; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-title { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 12px; }

.page-content { flex: 1; padding: 32px; }
.page { display: none; }
.page.active { display: block; }

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 24px; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.primary { background: var(--primary-subtle); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-label { font-size: 0.8125rem; color: var(--gray-500); margin-bottom: 4px; }
.stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border-color: var(--gray-200); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-200); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 4px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

/* Table Actions - Layout alinhado horizontalmente */
.table-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap;
}
.table-actions .btn {
    white-space: nowrap;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; color: var(--gray-700); margin-bottom: 8px; font-size: 0.875rem; }
.form-label { display: block; font-weight: 500; color: var(--gray-700); margin-bottom: 8px; font-size: 0.875rem; }
.form-input, .form-select, .form-textarea, .form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus, .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}
.form-input::placeholder, .form-control::placeholder { color: var(--gray-400); }
.form-hint { display: block; font-size: 0.75rem; color: var(--gray-500); margin-top: 4px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }

/* Form dentro de modais - Estilos completos */
.modal .form-group { margin-bottom: 20px; }
.modal .form-group:last-child { margin-bottom: 0; }
.modal .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.modal .form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    transition: var(--transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.modal .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}
.modal select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}
.modal input.form-control[type="text"],
.modal input.form-control[type="email"],
.modal input.form-control[type="number"],
.modal input.form-control[type="password"],
.modal select.form-control {
    height: 42px;
}
.modal textarea.form-control {
    min-height: 100px;
    resize: vertical;
}
.modal .form-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Tables */
.table-container { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; }
.data-table thead { background: var(--gray-50); }
.data-table th {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}
.data-table td { border-bottom: 1px solid var(--gray-100); font-size: 0.875rem; }
.data-table tbody tr:hover { background: var(--gray-50); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}
.badge-primary { background: var(--primary-subtle); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-success-subtle { background: var(--success-light); color: #15803d; font-weight: 500; }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-purple { background: var(--purple-light); color: var(--purple); }

/* Badge com ícone inline */
.badge-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-with-icon svg {
    flex-shrink: 0;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: var(--transition);
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 1.125rem; font-weight: 600; }
.modal-close {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius);
    cursor: pointer;
}
.modal-body { padding: 24px; max-height: 60vh; overflow-y: auto; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 12px; }
.modal-lg { max-width: 800px; }

/* Stepper / Pipeline */
.stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
}
.stepper-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--gray-400);
}
.stepper-step.active { color: var(--primary); font-weight: 500; }
.stepper-step.completed { color: var(--success); }
.stepper-dot {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}
.stepper-step.active .stepper-dot { background: var(--primary); color: white; }
.stepper-step.completed .stepper-dot { background: var(--success); color: white; }
.stepper-line { flex: 1; height: 2px; background: var(--gray-200); min-width: 20px; }
.stepper-step.completed + .stepper-line { background: var(--success); }

/* Case Chain */
.case-chain {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.case-chain-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--gray-600);
}
.case-chain-item.current { background: var(--primary-subtle); color: var(--primary); }
.case-chain-arrow { color: var(--gray-400); }

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 12px 16px;
    background: var(--gray-800);
    color: white;
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 0; }
.pagination-btn {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
}
.pagination-btn:hover:not(:disabled) { background: var(--gray-100); }
.pagination-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}
.empty-state svg { width: 64px; height: 64px; color: var(--gray-300); margin-bottom: 16px; }
.empty-state h3 { color: var(--gray-700); margin-bottom: 8px; }

/* User Menu */
.user-menu {
    position: relative;
}
.user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
}
.user-avatar {
    width: 32px; height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    display: none;
    z-index: 100;
}
.user-dropdown.active { display: block; }
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--gray-700);
    cursor: pointer;
    font-size: 0.875rem;
}
.user-dropdown-item:hover { background: var(--gray-50); }
.user-dropdown-item.danger { color: var(--danger); }

/* Filters → Estilos centralizados em components/filters.css */

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 24px; }
.tab {
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}
.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* File Upload */
.file-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.file-upload:hover { border-color: var(--primary); background: var(--primary-subtle); }
.file-upload.dragover { border-color: var(--primary); background: var(--primary-subtle); }
.file-upload svg { width: 48px; height: 48px; color: var(--gray-400); margin-bottom: 12px; }
.file-upload input { display: none; }

/* Responsivo */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: flex; }
}

/* =============================================================================
   MÓDULO ESCAVADOR - Monitoramento de Processos
   ============================================================================= */

/* Stats Grid 4 colunas */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .stats-grid-4 { grid-template-columns: 1fr; }
}

/* Stats Grid 6 colunas (KPIs unificados) */
.stats-grid-6 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 1400px) {
    .stats-grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .stats-grid-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .stats-grid-6 { grid-template-columns: 1fr; }
}

/* Stat card menor */
.stat-card-sm {
    padding: 12px 16px;
}

.stat-card-sm .stat-icon {
    width: 36px;
    height: 36px;
}

.stat-card-sm .stat-icon svg {
    width: 18px;
    height: 18px;
}

.stat-value-sm {
    font-size: 1.1rem !important;
}

/* Stat card clicável */
.stat-card.clickable {
    cursor: pointer;
    transition: var(--transition);
}

.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Tabs Container */
.tabs-container {
    margin-bottom: 24px;
}

.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab svg {
    width: 16px;
    height: 16px;
}

.tab-badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Status badges específicos Escavador */
.status-badge.status-ativo {
    background: var(--success-light);
    color: #166534;
}

.status-badge.status-pendente {
    background: var(--warning-light);
    color: #92400e;
}

.status-badge.status-pausado {
    background: var(--gray-200);
    color: var(--gray-600);
}

.status-badge.status-erro {
    background: var(--danger-light);
    color: #991b1b;
}

/* Indicador de não lido */
.processo-row.nao-lido {
    background: var(--primary-subtle);
}

.processo-row.nao-lido td:first-child::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.indicador-nao-lido {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
}

.indicador-lido {
    width: 10px;
    height: 10px;
    background: var(--gray-300);
    border-radius: 50%;
    display: inline-block;
}

/* Tribunal tag */
.tribunal-tag {
    display: inline-block;
    background: var(--info-light);
    color: #1e40af;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-right: 4px;
    margin-bottom: 4px;
}

/* Processo número CNJ */
.numero-cnj {
    font-family: monospace;
    font-size: 13px;
    color: var(--gray-700);
}

/* Match texto highlight */
.match-texto {
    font-size: 12px;
    color: var(--gray-500);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-texto b {
    background: #fef08a;
    color: var(--gray-800);
    padding: 0 2px;
}

/* Modal large */
.modal.modal-lg {
    max-width: 700px;
}

/* Detalhes do processo */
.processo-detalhe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.processo-detalhe-item {
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.processo-detalhe-item label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.processo-detalhe-item span {
    font-size: 14px;
    color: var(--gray-800);
}

.processo-detalhe-full {
    grid-column: span 2;
}

/* Form hints */
.form-hint {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Ícone de status no monitoramento */
.status-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-icon svg {
    width: 14px;
    height: 14px;
}

.status-icon.success svg { color: var(--success); }
.status-icon.warning svg { color: var(--warning); }
.status-icon.danger svg { color: var(--danger); }
.status-icon.secondary svg { color: var(--gray-400); }

/* Botões de ação na tabela */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius);
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-icon.btn-icon-danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.btn-icon.btn-icon-success:hover {
    background: var(--success-light);
    color: var(--success);
}

/* Animação de loading no sync */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-icon.syncing svg {
    animation: spin 1s linear infinite;
}

/* ============================================================================
   Form Sections
   ============================================================================ */
.form-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 16px;
}

/* ============================================================================
   Checkbox Label
   ============================================================================ */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Sobrescrever estilos de label em modal para checkbox-label */
.modal .form-group label.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

/* Checkbox inline - para uso dentro de formulários */
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
    padding: 10px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: var(--transition);
}

.checkbox-inline:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.checkbox-inline span {
    user-select: none;
    line-height: 18px;
}

/* ============================================================================
   Autocomplete
   ============================================================================ */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--hover-bg);
}

.autocomplete-item strong {
    color: var(--text-color);
}

.autocomplete-item span {
    color: var(--text-muted);
    font-size: 13px;
}

.autocomplete-empty {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================================================
   Modal Large
   ============================================================================ */
.modal.modal-lg {
    width: 700px;
    max-width: 95vw;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* ============================================================================
   Form Row with Flex Styles
   ============================================================================ */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0 !important; /* Remove margin individual, usa gap do row */
}

/* Form row que ocupa largura total sem wrap */
.form-row-full {
    flex-wrap: nowrap;
}

.form-row-full .form-group {
    min-width: auto;
}

/* ============================================================================
   Searchable Select (Banco)
   ============================================================================ */
.searchable-select {
    position: relative;
}

.searchable-input {
    width: 100%;
    cursor: text;
}

.searchable-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.searchable-dropdown.active {
    display: block;
}

.searchable-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
}

.searchable-option:last-child {
    border-bottom: none;
}

.searchable-option:hover,
.searchable-option.highlighted {
    background: var(--primary-subtle);
}

.searchable-option .codigo {
    font-weight: 600;
    color: var(--primary);
    margin-right: 8px;
}

.searchable-empty {
    padding: 12px;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ============================================================================
   CSV Import Info
   ============================================================================ */
.csv-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.csv-info small {
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.csv-info .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.csv-info .btn svg,
.csv-info .btn .icon-sm {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Button outline */
.btn-outline {
    background: var(--white);
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* ============================================================================
   Responsive Modal
   ============================================================================ */
@media (max-width: 768px) {
    .modal {
        width: 95vw !important;
        max-height: 90vh;
    }
    
    .modal-body {
        max-height: 60vh;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        flex: 1 1 100% !important;
    }
    
    .form-row-full {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .form-row-full .form-group {
        flex: 1 1 45% !important;
        min-width: 100px;
    }
    
    .csv-info {
        flex-direction: column;
        text-align: center;
    }
}

/* =============================================================================
   MODELOS DE RESPOSTA - Estilos Adicionais
   ============================================================================= */

/* Botões de ação em linha */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Botão ícone */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--gray-800);
    border-color: var(--gray-300);
}

.btn-icon-danger:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

.btn-icon-success:hover {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

/* Linha inativa na tabela */
.row-inactive {
    opacity: 0.6;
    background: var(--gray-50);
}

.row-inactive:hover {
    opacity: 0.8;
}

/* Célula de mensagem com texto truncado */
.td-message {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gray-500);
    font-size: 0.875rem;
}
