/* ==========================================
   NFR Auditoria Financeira - Tema Moderno AI
   Design minimalista inspirado em ferramentas de IA
   ========================================== */

/* Importar Lucide Icons */
@import url('https://unpkg.com/lucide-static@latest/font/lucide.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta Moderna Minimalista */
    --primary: #10a37f;
    --primary-hover: #0d8a6a;
    --secondary: #6e6e80;
    --background: #ffffff;
    --surface: #f9f9f9;
    --surface-hover: #f0f0f0;
    --text-primary: #0d0d0d;
    --text-secondary: #676767;
    --border: #e5e5e5;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --sidebar-width: 260px;
    --header-height: 64px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================
   LAYOUT PRINCIPAL
   ========================================== */

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================
   SIDEBAR MODERNA
   ========================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h1 .logo {
    font-size: 24px;
}

.sidebar-header p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item svg,
.nav-item .icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    flex-shrink: 0;
}

.nav-item.active svg {
    stroke: white;
}

.btn svg,
.btn .icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.sidebar-footer,
.footer-signature {
    padding: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: auto;
}

/* ==========================================
   CONTEÚDO PRINCIPAL
   ========================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* HEADER MODERNO */
.page-header {
    padding: 24px 32px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--background);
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
}

.page-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.page-header-content h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-header-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.page-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ÁREA DE CONTEÚDO */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* ==========================================
   CARDS MODERNOS
   ========================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.card-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-value.positive {
    color: var(--primary);
}

.card-value.negative {
    color: #ef4444;
}

.card-trend {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ==========================================
   BOTÕES MODERNOS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

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

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* ==========================================
   TABELAS MODERNAS
   ========================================== */

.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    width: 240px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--background);
}

th {
    padding: 14px 24px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

tbody tr {
    transition: background 0.2s;
}

tbody tr:hover {
    background: var(--surface-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================
   UPLOAD AREA MODERNA
   ========================================== */

.upload-section {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 24px;
}

.upload-section:hover,
.upload-section.dragover {
    border-color: var(--primary);
    background: rgba(16, 163, 127, 0.02);
}

.upload-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.upload-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-section p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==========================================
   FORMULÁRIOS
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

/* ==========================================
   BADGES E STATUS
   ========================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 163, 127, 0.1);
    color: var(--primary);
}

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

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

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* ==========================================
   ALERTAS
   ========================================== */

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert-success {
    background: rgba(16, 163, 127, 0.1);
    color: var(--primary);
    border: 1px solid rgba(16, 163, 127, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ==========================================
   GRÁFICOS
   ========================================== */

.chart-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.chart-container h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 1000;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        width: 100%;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   ANIMAÇÕES SUAVES
   ========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ==========================================
   SCROLLBAR CUSTOMIZADA
   ========================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* ==========================================
   UTILITÁRIOS
   ========================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
