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

:root {
    --brand-navy: #1B3241;       /* primária / estrutura / títulos */
    --brand-navy-soft: #284553;  /* navy secundário */
    --brand-orange: #F6941F;     /* acento / ação */
    --brand-orange-dark: #DD7F12;/* hover do acento */
    --brand-orange-soft: #FEF4E6;/* fundo suave do acento */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: var(--brand-navy);
    line-height: 1.6;
}

/* LOGIN */
.login-page { background: linear-gradient(135deg, #1B3241 0%, #20384a 55%, #284553 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-brand img { max-width: 230px; height: auto; margin: 0 auto; display: block; }
.login-container { background: white; border-radius: 16px; padding: 3rem; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand h1 { font-size: 2.2rem; color: var(--brand-navy); letter-spacing: -1px; }
.login-brand p { color: #888; font-size: 0.9rem; margin-top: 0.25rem; }
.login-form .form-group { margin-bottom: 1.25rem; }
.login-form label { display: block; margin-bottom: 0.4rem; font-weight: 500; font-size: 0.9rem; color: #555; }
.login-form input { width: 100%; padding: 0.75rem 1rem; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 1rem; transition: border-color 0.2s; }
.login-form input:focus { outline: none; border-color: var(--brand-orange); }
.login-form button { width: 100%; padding: 0.85rem; background: var(--brand-orange); color: white; border: none; border-radius: 8px; font-size: 1.05rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.login-form button:hover { background: var(--brand-orange-dark); }
.login-footer { text-align: center; margin-top: 2rem; color: #aaa; font-size: 0.8rem; }

/* NAV PORTAL */
.portal-nav { background: var(--brand-navy); color: white; padding: 0 2rem; display: flex; align-items: center; height: 60px; gap: 2rem; }
.portal-nav .nav-brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.5px; }
.portal-nav .nav-brand img { height: 34px; width: auto; display: block; }
.portal-nav .nav-links { display: flex; gap: 0.5rem; flex: 1; }
.portal-nav .nav-links a { color: rgba(255,255,255,0.6); text-decoration: none; padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.9rem; transition: all 0.2s; }
.portal-nav .nav-links a:hover, .portal-nav .nav-links a.active { color: white; background: rgba(255,255,255,0.1); }
.portal-nav .nav-user { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
.portal-nav .nav-user span { color: rgba(255,255,255,0.7); }
.portal-nav .nav-logout { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 0.85rem; }
.portal-nav .nav-logout:hover { color: white; }

/* MAIN */
.portal-main { max-width: 1200px; margin: 2rem auto; padding: 0 1.5rem; }

.portal-header { margin-bottom: 2rem; }
.portal-header h1 { font-size: 1.8rem; color: var(--brand-navy); }
.portal-header .subtitle { color: #888; font-size: 1rem; }

/* ALERTS */
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-erro { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-sucesso { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }

/* KPI CARDS */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 2rem; }
.kpi-card { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); display: flex; flex-direction: column; }
.kpi-label { font-size: 0.8rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.5rem; }
.kpi-value { font-size: 1.6rem; font-weight: 700; }
.kpi-faturamento .kpi-value { color: var(--brand-navy); }
.kpi-impostos .kpi-value { color: #f59e0b; }
.kpi-despesas .kpi-value { color: #dc2626; }
.kpi-resultado .kpi-value { color: #10b981; }

/* CHART */
.chart-container { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 2rem; }
.chart-container h2 { font-size: 1.1rem; margin-bottom: 1rem; color: #555; }

/* CARDS E GRID */
.card { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 1.5rem; }
.card h2, .card h3 { margin-bottom: 1rem; color: var(--brand-navy); }
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

.pendentes-count { color: #f59e0b; font-weight: 600; font-size: 1.1rem; margin-bottom: 1rem; }
.all-good { color: #10b981; font-weight: 600; font-size: 1.1rem; margin-bottom: 1rem; }

/* DOCS LIST */
.docs-list { list-style: none; }
.docs-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid #f0f0f0; }
.doc-nome { font-size: 0.9rem; color: #333; }

/* BUTTONS */
.btn { display: inline-block; padding: 0.6rem 1.2rem; border: none; border-radius: 8px; font-size: 0.95rem; cursor: pointer; text-decoration: none; font-weight: 500; transition: all 0.2s; }
.btn-primary { background: var(--brand-orange); color: white; }
.btn-primary:hover { background: var(--brand-orange-dark); }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* TABLE */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
th { font-weight: 600; color: #888; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* BADGES */
.badge { padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.badge-pendente { background: #fef3c7; color: #92400e; }
.badge-processando { background: #dbeafe; color: #1e40af; }
.badge-processado { background: #d1fae5; color: #065f46; }
.badge-erro { background: #fee2e2; color: #991b1b; }
.badge-concluido { background: #d1fae5; color: #065f46; }
.badge-concluido_com_alertas { background: #fef3c7; color: #92400e; }

/* UPLOAD AREA */
.upload-area { border: 2px dashed #d1d5db; border-radius: 12px; padding: 2rem; text-align: center; margin-bottom: 1.5rem; cursor: pointer; transition: all 0.2s; position: relative; }
.upload-area:hover, .upload-area.drag-over { border-color: var(--brand-orange); background: var(--brand-orange-soft); }
.upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-text p { color: #555; }
.upload-hint { color: #999; font-size: 0.85rem; }

/* FORM */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 500; font-size: 0.9rem; color: #555; }
.form-group input, .form-group select { width: 100%; padding: 0.6rem 0.8rem; border: 2px solid #e5e7eb; border-radius: 8px; font-size: 1rem; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--brand-orange); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* STATUS GRID */
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.status-card { background: white; border-radius: 12px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-left: 4px solid #d1d5db; }
.status-pendente { border-left-color: #f59e0b; }
.status-erro { border-left-color: #dc2626; }
.status-ok { border-left-color: #10b981; }
.status-mes { font-size: 1.2rem; font-weight: 700; color: var(--brand-navy); }
.status-info { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; color: #666; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .portal-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .portal-nav { padding: 0 1rem; }
    .portal-nav .nav-links { gap: 0.25rem; }
}
