/* ============================================
   Sistema de Gestão de Ofícios - Design Moderno
   Versão: 2.0
   Data: 03/03/2026
   ============================================ */

/* ========== VARIÁVEIS CSS ========== */
:root {
    /* Cores Principais */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    
    /* Cores Secundárias */
    --secondary-color: #64748b;
    --secondary-dark: #475569;
    --secondary-light: #94a3b8;
    
    /* Cores de Status */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    
    /* Cores de Fundo */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #1e293b;
    
    /* Cores de Texto */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    /* Bordas */
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 6px;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Espaçamentos */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Transições */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* ========== RESET E BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: var(--spacing-lg);
}

/* ========== CONTAINER PRINCIPAL ========== */
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-xl);
}

/* ========== CABEÇALHO ========== */
.page-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

/* ========== BARRA DE AÇÕES ========== */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.search-group {
    display: flex;
    gap: var(--spacing-sm);
    flex: 1;
    min-width: 300px;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background: var(--bg-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.button-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ========== BOTÕES MODERNOS ========== */
.btn-modern {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.btn-modern:hover {
    opacity: 0.9;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1e3a8a);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-white);
}

.btn-success {
    background: var(--success-color);
    color: var(--text-white);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--text-white);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-white);
}

.btn-info {
    background: var(--info-color);
    color: var(--text-white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

/* Tamanhos de botões */
.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Ajustes para botões dentro da tabela */
.table-modern .btn-modern {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
}

.table-modern .btn-modern i {
    font-size: 0.7rem;
}

/* ========== BADGE DE NOTIFICAÇÃO ========== */
.notification-badge {
    position: relative;
    display: inline-flex;
}

.notification-badge .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--danger-color);
    color: var(--text-white);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

/* ========== TABELA MODERNA ========== */
.table-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: visible;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
    width: 100%;
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.table-modern thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
}

.table-modern thead th {
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.table-modern thead th:nth-child(1) { width: 12%; } /* Número */
.table-modern thead th:nth-child(2) { width: 8%; } /* Recebimento */
.table-modern thead th:nth-child(3) { width: 8%; } /* Atendimento */
.table-modern thead th:nth-child(4) { width: 8%; } /* Seção */
.table-modern thead th:nth-child(5) { width: 12%; } /* Responsável */
.table-modern thead th:nth-child(6) { width: 10%; } /* Documento */
.table-modern thead th:nth-child(7) { width: 10%; } /* Observações */
.table-modern thead th:nth-child(8) { width: 16%; } /* Solicitação */
.table-modern thead th:nth-child(9) { width: 16%; } /* Ações */

.table-modern tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.table-modern tbody tr:hover {
    background: var(--bg-secondary);
}

.table-modern tbody tr:last-child {
    border-bottom: none;
}

.table-modern tbody td {
    padding: 0.6rem 0.4rem;
    font-size: 0.85rem;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Estilo para células com ações */
.table-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ========== PAGINAÇÃO MODERNA ========== */
.pagination-modern {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
    flex-wrap: wrap;
}

.pagination-modern .page-item {
    list-style: none;
}

.pagination-modern .page-link {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    background: var(--bg-primary);
}

.pagination-modern .page-link:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

.pagination-modern .page-item.active .page-link {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.pagination-modern .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========== FORMULÁRIOS ========== */
.form-modern {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background: var(--bg-primary);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control::placeholder {
    color: var(--text-light);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ========== CARDS ========== */
.card-modern {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
}

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

.card-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

/* ========== MODAL SWEETALERT CUSTOMIZADO ========== */
.swal2-popup {
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

.swal2-confirm {
    background: var(--primary-color) !important;
    border-radius: var(--border-radius) !important;
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
}

.swal2-cancel {
    background: var(--secondary-color) !important;
    border-radius: var(--border-radius) !important;
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
}

/* ========== BADGES E TAGS ========== */
.badge-status {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
}

/* ========== LOADING SPINNER ========== */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== RESPONSIVO ========== */
@media (max-width: 1024px) {
    .container-fluid {
        padding: var(--spacing-lg);
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-group {
        min-width: 100%;
    }
    
    .button-group {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    body {
        padding: var(--spacing-sm);
    }
    
    .container-fluid {
        padding: var(--spacing-md);
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .table-modern {
        font-size: 0.85rem;
    }
    
    .table-modern thead th,
    .table-modern tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .btn-modern {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .table-actions {
        flex-direction: column;
    }
}

/* ========== UTILITÁRIOS ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-normal { font-weight: 400; }
