/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: 'Inter', sans-serif; background: #F5F7FA; color: #1a2332; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: #0058A3; text-decoration: none; }

/* Nav */
#navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(0,40,90,0.97); backdrop-filter: blur(10px); border-bottom: 2px solid #0058A3; box-shadow: 0 2px 20px rgba(0,0,0,0.3); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; font-weight: 600; color: #fff; }
.nav-links { list-style: none; display: flex; gap: 0.5rem; }
.nav-links a { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 0.82rem; font-weight: 500; padding: 6px 12px; border-radius: 6px; transition: all 0.2s; }
.nav-links a:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Hero */
#hero { position: relative; min-height: 100vh; display: flex; align-items: center; background: linear-gradient(135deg, #00245A 0%, #0058A3 50%, #0080D4 100%); padding: 100px 0 60px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 40px), repeating-linear-gradient(-45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 40px); pointer-events: none; }
.hero-badge { display: inline-block; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: rgba(255,255,255,0.9); font-size: 0.8rem; font-weight: 500; padding: 6px 16px; border-radius: 20px; margin-bottom: 1.5rem; letter-spacing: 0.5px; }
#hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; color: #fff; line-height: 1.15; margin-bottom: 1rem; }
.accent { color: #7EC8F4; }
.hero-sub { font-size: 1.05rem; color: rgba(255,255,255,0.85); margin-bottom: 1.5rem; line-height: 1.7; }
.hero-sub strong { color: #fff; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 2.5rem; }
.hero-meta span { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.9); font-size: 0.82rem; font-weight: 500; padding: 6px 14px; border-radius: 20px; }

/* KPI Cards */
.hero-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; max-width: 900px; }
.kpi-card { background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2); border-radius: 12px; padding: 1.5rem 1.2rem; text-align: center; transition: transform 0.2s, background 0.2s; }
.kpi-card:hover { transform: translateY(-3px); background: rgba(255,255,255,0.15); }
.kpi-card.kpi-danger { border-color: #FF6B6B; }
.kpi-card.kpi-warn { border-color: #FFB347; }
.kpi-value { font-size: 2rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 0.4rem; }
.kpi-label { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.9); }
.kpi-sub { font-size: 0.72rem; color: rgba(255,255,255,0.6); margin-top: 4px; }

/* Container & Sections */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.section { padding: 60px 0; }
.section-light { background: #FFFFFF; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-tag { display: inline-block; background: #E8F2FF; color: #0058A3; font-size: 0.78rem; font-weight: 700; padding: 5px 14px; border-radius: 20px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.75rem; }
.section-header h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; color: #1a2332; line-height: 1.3; padding-left: 16px; border-left: 4px solid #0058A3; display: inline-block; text-align: left; }

/* Executive Summary */
.exec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.exec-card { border-radius: 16px; padding: 2rem; border: 1px solid; }
.exec-problem { background: #FFF5F5; border-color: #FECACA; }
.exec-gain { background: #F0FFF4; border-color: #BBF7D0; }
.exec-financial { background: #EEF2FF; border-color: #C7D2FE; }
.exec-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.exec-card h3 { font-size: 1rem; font-weight: 700; color: #1a2332; margin-bottom: 1rem; }
.exec-card ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.exec-card li { font-size: 0.88rem; color: #374151; padding-left: 1.2rem; position: relative; }
.exec-card li::before { content: '\2022'; position: absolute; left: 0; color: #0058A3; font-weight: 700; }
.economy-numbers { display: flex; flex-direction: column; gap: 0.75rem; }
.econ-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.econ-label { font-size: 0.82rem; color: #374151; }
.econ-value { font-size: 0.95rem; font-weight: 700; color: #DC3545; }
.econ-total { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; padding-top: 0.75rem; border-top: 2px solid #818CF8; gap: 1rem; font-size: 1rem; font-weight: 800; color: #1a2332; }
.econ-total span:last-child { color: #00A651; font-size: 1.1rem; }

/* Equipment Tabs */
.tabs-wrapper { background: #fff; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); overflow: hidden; }
.tabs { display: flex; overflow-x: auto; background: #f8fafc; border-bottom: 2px solid #E8ECF1; gap: 2px; padding: 8px 8px 0; scrollbar-width: thin; }
.tabs::-webkit-scrollbar { height: 4px; }
.tabs::-webkit-scrollbar-track { background: transparent; }
.tabs::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
.tab-btn { flex-shrink: 0; padding: 10px 18px; font-size: 0.8rem; font-weight: 600; background: transparent; border: none; border-radius: 8px 8px 0 0; color: #6B7280; cursor: pointer; white-space: nowrap; transition: all 0.2s; font-family: 'Inter', sans-serif; }
.tab-btn:hover { background: #E8F2FF; color: #0058A3; }
.tab-btn.active { background: #0058A3; color: #fff; }
.asset-detail { background: #fff; border-radius: 0 0 16px 16px; padding: 2rem; border: 1px solid #E8ECF1; border-top: none; }
.asset-detail h3 { font-size: 1.2rem; font-weight: 800; color: #0058A3; margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 2px solid #E8ECF1; }
.asset-detail h4 { font-size: 0.95rem; font-weight: 700; color: #1a2332; margin: 1.75rem 0 0.75rem; }
.tab-content { padding: 2rem; }
.tab-pane { display: none; animation: fadeIn 0.3s ease; }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Asset Metrics */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.metric-card { background: #f8fafc; border-radius: 12px; padding: 1.25rem; text-align: center; border: 1px solid #E8ECF1; transition: box-shadow 0.2s; }
.metric-card:hover { box-shadow: 0 4px 12px rgba(0,88,163,0.12); }
.metric-val { font-size: 1.8rem; font-weight: 800; line-height: 1; margin-bottom: 0.3rem; }
.metric-lbl { font-size: 0.78rem; font-weight: 600; color: #6B7280; }
.metric-desc { font-size: 0.7rem; color: #9CA3AF; margin-top: 3px; }
.metric-card.good .metric-val { color: #00A651; }
.metric-card.warn .metric-val { color: #D97706; }
.metric-card.bad .metric-val { color: #DC3545; }

/* Charts */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); gap: 2rem; }
.chart-box { background: #fff; border-radius: 16px; padding: 1.5rem 2rem; box-shadow: 0 4px 20px rgba(0,0,0,0.07); border: 1px solid #E8ECF1; }
.chart-box h3 { font-size: 0.9rem; font-weight: 700; color: #374151; margin-bottom: 1rem; }
.chart-box canvas { max-height: 280px; }
.chart-container { background: #fff; border-radius: 16px; padding: 1.5rem 2rem; margin-bottom: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.07); border: 1px solid #E8ECF1; }
.chart-container canvas { width: 100% !important; max-height: 320px; }
.chart-container h3 { font-size: 0.9rem; font-weight: 700; color: #374151; margin-bottom: 1rem; }

/* Selectors */
.falha-selector, .prev-selector, .acao-selector, .proc-selector { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.falha-selector label, .prev-selector label, .acao-selector label, .proc-selector label { font-size: 0.88rem; font-weight: 600; color: #374151; }
select { padding: 8px 16px; border-radius: 8px; border: 1.5px solid #CBD5E1; font-size: 0.88rem; font-family: 'Inter', sans-serif; color: #1a2332; background: #fff; cursor: pointer; transition: border-color 0.2s; min-width: 320px; }
select:focus { outline: none; border-color: #0058A3; box-shadow: 0 0 0 3px rgba(0,88,163,0.1); }

/* Failure Cards */
.falhas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.falhas-col h3 { font-size: 1rem; font-weight: 700; color: #1a2332; margin-bottom: 1rem; }
.falha-card { background: #fff; border-radius: 12px; padding: 1.25rem; border: 1px solid #E8ECF1; margin-bottom: 1rem; border-left: 4px solid #0058A3; transition: box-shadow 0.2s; }
.falha-card:hover { box-shadow: 0 4px 12px rgba(0,88,163,0.1); }
.falha-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; }
.falha-name { font-size: 0.9rem; font-weight: 700; color: #1a2332; }
.falha-badge { background: #EEF2FF; color: #4338CA; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.falha-badge.red { background: #FEF2F2; color: #DC3545; }
.falha-row { font-size: 0.8rem; color: #6B7280; margin-top: 4px; line-height: 1.5; }
.falha-row strong { color: #374151; }
.failure-card { background: #fff; border-radius: 12px; padding: 1.25rem; border: 1px solid #E8ECF1; margin-bottom: 1rem; border-left: 4px solid #DC3545; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.failure-card h4 { font-size: 0.95rem; color: #1a2332; margin-bottom: 10px; }
.failure-card .field { margin-bottom: 8px; }
.failure-card .field-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: #6B7280; letter-spacing: 0.4px; }
.failure-card .field-value { font-size: 0.88rem; color: #374151; margin-top: 2px; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #E8ECF1; }
table, .data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
thead th, .data-table thead th { background: #0058A3; color: #fff; font-weight: 600; padding: 12px 16px; text-align: left; white-space: nowrap; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.3px; }
tbody tr { border-bottom: 1px solid #f1f5f9; transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: #F9FAFB; }
tbody tr:hover { background: #EBF4FF; }
tbody td { padding: 12px 16px; color: #374151; vertical-align: top; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 24px; }
.plan-table thead th { background: #003D73; color: #fff; padding: 12px 14px; text-align: left; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.3px; }
.plan-table tbody td { padding: 10px 14px; border-bottom: 1px solid #E8ECF1; vertical-align: top; }
.plan-table tbody tr:nth-child(even) { background: #F9FAFB; }
.plan-table tbody tr:hover { background: #EBF4FF; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; color: #fff; background: #0058A3; text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle; }
.badge-tipo { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }
.badge-mec { background: #FEF3C7; color: #92400E; }
.badge-ele { background: #DBEAFE; color: #1D4ED8; }
.badge-lub { background: #D1FAE5; color: #065F46; }
.badge-p1 { background: #DC3545; color: #fff; }
.badge-p2 { background: #E67E22; color: #fff; }
.badge-p3 { background: #0058A3; color: #fff; }
.badge-p4 { background: #6C757D; color: #fff; }

/* Action Plan */
.acao-list { display: flex; flex-direction: column; gap: 1rem; }
.acao-item { background: #fff; border-radius: 12px; padding: 1.25rem 1.5rem; border: 1px solid #E8ECF1; border-left: 5px solid; display: grid; grid-template-columns: auto 1fr auto auto; align-items: start; gap: 1rem; }
.acao-item.critica { border-left-color: #DC3545; }
.acao-item.alta { border-left-color: #D97706; }
.acao-item.media { border-left-color: #0058A3; }
.acao-item.baixa { border-left-color: #00A651; }
.acao-prio { font-size: 0.72rem; font-weight: 800; padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.acao-item.critica .acao-prio { background: #FEF2F2; color: #DC3545; }
.acao-item.alta .acao-prio { background: #FFFBEB; color: #D97706; }
.acao-item.media .acao-prio { background: #EFF6FF; color: #1D4ED8; }
.acao-item.baixa .acao-prio { background: #F0FDF4; color: #00A651; }
.acao-text { font-size: 0.88rem; font-weight: 600; color: #1a2332; line-height: 1.4; }
.acao-base { font-size: 0.78rem; color: #6B7280; margin-top: 4px; }
.acao-prazo { font-size: 0.78rem; font-weight: 700; color: #0058A3; white-space: nowrap; }
.acao-resultado { font-size: 0.75rem; color: #00A651; font-weight: 600; white-space: nowrap; }
.action-list { list-style: none; counter-reset: action; }
.action-list li { counter-increment: action; background: #fff; border-radius: 12px; padding: 16px 20px 16px 56px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); position: relative; font-size: 0.9rem; }
.action-list li::before { content: counter(action); position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; background: #0058A3; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }
.action-list li .badge { margin-left: 8px; }

/* Costs */
.custos-params { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; justify-content: center; }
.param-badge { background: #EEF2FF; border: 1px solid #C7D2FE; color: #3730A3; font-size: 0.78rem; font-weight: 600; padding: 6px 14px; border-radius: 20px; }
.custo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.custo-card { background: #fff; border-radius: 16px; padding: 1.5rem; border: 1px solid #E8ECF1; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.custo-card h4 { font-size: 0.85rem; font-weight: 700; color: #6B7280; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.5px; }
.custo-num { font-size: 1.8rem; font-weight: 800; color: #DC3545; line-height: 1; margin-bottom: 0.5rem; }
.custo-num.green { color: #00A651; }
.custo-label { font-size: 0.8rem; color: #9CA3AF; }
.custo-bar-wrap { margin-top: 1rem; }
.custo-bar { height: 8px; background: #F3F4F6; border-radius: 4px; overflow: hidden; }
.custo-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.custo-bar-fill.red { background: linear-gradient(90deg, #DC3545, #EF4444); }
.custo-bar-fill.green { background: linear-gradient(90deg, #00A651, #22C55E); }
.cost-section { display: flex; gap: 32px; align-items: stretch; flex-wrap: wrap; }
.cost-box { flex: 1; min-width: 260px; background: #fff; border-radius: 16px; padding: 32px 28px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.cost-box.before { border-top: 4px solid #DC3545; }
.cost-box.after { border-top: 4px solid #00A651; }
.cost-box .cost-label { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; color: #6B7280; margin-bottom: 8px; letter-spacing: 0.4px; }
.cost-box .cost-value { font-size: 2.4rem; font-weight: 800; line-height: 1.2; }
.cost-box.before .cost-value { color: #DC3545; }
.cost-box.after .cost-value { color: #00A651; }
.cost-box .cost-detail { font-size: 0.82rem; color: #9CA3AF; margin-top: 6px; }
.cost-arrow { display: flex; align-items: center; font-size: 2rem; color: #00A651; font-weight: 700; }

/* Procedures Accordion */
.proc-list { display: flex; flex-direction: column; gap: 1.25rem; }
.proc-card, .proc-item { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #E8ECF1; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.proc-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; cursor: pointer; user-select: none; background: #f8fafc; transition: background 0.2s; font-size: 0.95rem; font-weight: 700; color: #1a2332; }
.proc-header:hover { background: #EFF6FF; }
.proc-title { font-size: 0.95rem; font-weight: 700; color: #1a2332; }
.proc-meta { display: flex; gap: 0.75rem; align-items: center; }
.proc-badge { font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: #DBEAFE; color: #1D4ED8; }
.proc-chevron { font-size: 1rem; color: #6B7280; transition: transform 0.3s; }
.proc-body { display: none; padding: 1.5rem; border-top: 1px solid #E8ECF1; }
.proc-body.open { display: block; }
.proc-item.open .proc-header .proc-chevron { transform: rotate(180deg); }
.proc-item.open .proc-body { display: block; }
.proc-steps { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.proc-steps li { font-size: 0.85rem; color: #374151; padding: 6px 12px; background: #f8fafc; border-radius: 6px; border-left: 3px solid #0058A3; }
.proc-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.proc-info { background: #F0FDF4; border-radius: 8px; padding: 0.75rem 1rem; }
.proc-info strong { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: #065F46; display: block; margin-bottom: 4px; }
.proc-info span { font-size: 0.82rem; color: #374151; }

/* Footer */
#rodape { background: #00245A; color: rgba(255,255,255,0.8); padding: 3rem 0 2rem; }
.footer-content { display: flex; gap: 3rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 2rem; }
.footer-author { display: flex; align-items: center; gap: 1rem; }
.author-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #0058A3, #0080D4); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 800; color: #fff; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.3); }
.author-info { display: flex; flex-direction: column; gap: 3px; }
.author-info strong { color: #fff; font-size: 1rem; }
.author-info span { font-size: 0.8rem; opacity: 0.7; }
.footer-note { flex: 1; }
.footer-note p { font-size: 0.82rem; margin-bottom: 6px; opacity: 0.7; }
.footer-note strong { color: #fff; opacity: 1; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1.5rem; font-size: 0.78rem; opacity: 0.5; text-align: center; }

/* Action Items (charts.js renderAcoes) */
.action-item { background: #fff; border-radius: 12px; padding: 1.25rem 1.5rem; border: 1px solid #E8ECF1; border-left: 5px solid; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; margin-bottom: 0.75rem; }
.action-item.critica { border-left-color: #DC3545; }
.action-item.alta    { border-left-color: #D97706; }
.action-item.media   { border-left-color: #0058A3; }
.action-item.baixa   { border-left-color: #00A651; }
.action-prio { font-size: 0.72rem; font-weight: 800; padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.action-item.critica .action-prio { background:#FEF2F2; color:#DC3545; }
.action-item.alta    .action-prio { background:#FFFBEB; color:#D97706; }
.action-item.media   .action-prio { background:#EFF6FF; color:#1D4ED8; }
.action-item.baixa   .action-prio { background:#F0FDF4; color:#00A651; }
.action-body { flex: 1; min-width: 0; }
.action-text { font-size: 0.88rem; font-weight: 600; color: #1a2332; line-height: 1.4; }
.action-base { font-size: 0.78rem; color: #6B7280; margin-top: 4px; }
.action-deadline { font-size: 0.78rem; font-weight: 700; color: #0058A3; white-space: nowrap; align-self: center; }

/* Proc card open state (toggle via JS) */
.proc-card.open .proc-body { display: block; }
.proc-card.open .chevron { display: inline-block; transform: rotate(180deg); }
.proc-footer { background: #F0FDF4; border-radius: 8px; padding: 0.75rem 1rem; margin-top: 1rem; font-size: 0.82rem; color: #374151; }

/* Asset detail — layout additions */
.detail-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 1.5rem 0; }
.detail-col h4 { font-size: 0.95rem; font-weight: 700; color: #1a2332; margin-bottom: 0.75rem; }
.chart-small { max-height: 220px; }
.asset-costs { display: flex; flex-direction: column; gap: 0.5rem; }
.cost-line { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 0.4rem 0; border-bottom: 1px solid #F1F5F9; }
.cost-line-total { border-bottom: none; font-weight: 700; font-size: 1rem; padding-top: 0.75rem; border-top: 2px solid #E8ECF1; }
.cost-red { color: #DC3545; font-weight: 700; }

/* KPI grid inside asset detail */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-grid.kpi-small .kpi-card { background: #F8FAFC; border: 1px solid #E8ECF1; border-radius: 10px; padding: 1rem; text-align: center; }
.kpi-grid.kpi-small .kpi-value { font-size: 1.4rem; font-weight: 800; color: #0058A3; }
.kpi-grid.kpi-small .kpi-label { font-size: 0.72rem; color: #6B7280; font-weight: 600; margin-top: 4px; }
.kpi-warning { color: #DC3545 !important; }

/* Table responsive wrapper (inline with section) */
.table-responsive { overflow-x: auto; margin-bottom: 2rem; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* Cost highlight in hero section */
.cost-highlight { background: #FFF5F5; border-radius: 16px; padding: 2rem; border: 1px solid #FECACA; margin-top: 2rem; }
.cost-row { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1rem; }
.cost-item { flex: 1; min-width: 200px; }
.cost-label { font-size: 0.8rem; font-weight: 600; color: #6B7280; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 0.3rem; }
.cost-value { font-size: 1.5rem; font-weight: 800; }
.cost-danger .cost-value { color: #DC3545; }
.cost-total .cost-value { color: #1a2332; }
.cost-saving { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; color: #374151; }
.saving-badge { background: #00A651; color: #fff; font-weight: 800; font-size: 0.85rem; padding: 4px 12px; border-radius: 20px; }

/* Section with alternate bg */
.section-alt { background: #F8FAFC; }
.section h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 800; color: #1a2332; margin-bottom: 0.5rem; padding-left: 16px; border-left: 4px solid #0058A3; }
.section-desc { color: #6B7280; font-size: 0.92rem; margin-bottom: 2rem; }

/* Hero layout override for this page */
.hero { background: linear-gradient(135deg, #00245A 0%, #0058A3 50%, #0080D4 100%); padding: 80px 0 60px; color: #fff; }
.hero .container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; line-height: 1.15; margin-bottom: 0.75rem; }
.hero h1 span { color: #7EC8F4; }
.hero-subtitle { font-size: 1rem; color: rgba(255,255,255,0.8); margin-bottom: 1.5rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; margin-top: 2rem; }
.hero-author { display: flex; align-items: center; gap: 1rem; }
.author-avatar { width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; color: #fff; border: 2px solid rgba(255,255,255,0.4); flex-shrink: 0; }
.author-avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }
.hero-author strong { color: #fff; display: block; }
.hero-author span { color: rgba(255,255,255,0.75); font-size: 0.82rem; }
.hero-info { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: rgba(255,255,255,0.85); }
.hero-info strong { color: #fff; }

/* Gains section */
.gains-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.5rem; }
.gain-card { background: #fff; border-radius: 16px; padding: 2rem 1.5rem; border: 1px solid #E8ECF1; box-shadow: 0 4px 12px rgba(0,0,0,0.05); text-align: center; }
.gain-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.gain-card h4 { font-size: 1rem; font-weight: 700; color: #1a2332; margin-bottom: 1rem; }
.gain-before { font-size: 0.85rem; color: #DC3545; margin-bottom: 0.25rem; }
.gain-after { font-size: 0.9rem; color: #00A651; font-weight: 700; margin-bottom: 0.75rem; }
.gain-card p { font-size: 0.82rem; color: #6B7280; line-height: 1.5; }

/* Footer */
.footer { background: #00245A; color: rgba(255,255,255,0.8); padding: 3rem 0 2rem; }
.footer-content { display: flex; gap: 3rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 2rem; }
.footer-author { display: flex; align-items: center; gap: 1rem; min-width: 250px; }
.footer-author h3 { color: #fff; font-size: 1.1rem; margin-bottom: 3px; }
.footer-author p { font-size: 0.82rem; }
.footer-note { font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-top: 6px; line-height: 1.5; }
.footer-methodology { flex: 1; min-width: 300px; }
.footer-methodology p { font-size: 0.82rem; line-height: 1.6; margin-bottom: 0.5rem; }
.footer-disclaimer { font-size: 0.75rem; opacity: 0.6; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1.5rem; font-size: 0.78rem; opacity: 0.5; text-align: center; }

/* Responsive additions */
@media (max-width: 900px) {
  .detail-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .gains-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .gains-grid { grid-template-columns: 1fr; }
  .cost-row { flex-direction: column; }
  .hero-meta { flex-direction: column; gap: 1rem; }
  .footer-content { flex-direction: column; gap: 1.5rem; }
}

/* Utility */
.no-data { text-align: center; padding: 2rem; color: #9CA3AF; font-size: 0.9rem; font-style: italic; }

/* Responsive */
@media (max-width: 900px) {
  .hero-kpis { grid-template-columns: repeat(2, 1fr); }
  .falhas-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .acao-item { grid-template-columns: 1fr; }
  .proc-info-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero-meta { gap: 0.5rem; }
  .cost-section { flex-direction: column; gap: 16px; }
  .cost-arrow { justify-content: center; transform: rotate(90deg); }
}
@media (max-width: 600px) {
  .container { padding: 0 1rem; }
  .hero-kpis { grid-template-columns: 1fr; }
  .tab-content { padding: 1rem; }
  .tab-btn { padding: 8px 14px; font-size: 0.75rem; }
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
  select { min-width: 100%; }
  .section { padding: 36px 0; }
  #hero { min-height: auto; padding: 80px 0 40px; }
  #hero h1 { font-size: 1.5rem; }
  .data-table, .plan-table { display: block; overflow-x: auto; }
  .action-list li { padding-left: 48px; }
}

/* Print */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  #navbar, .tabs, .tab-btn, .falha-selector, .prev-selector, .acao-selector, .proc-selector, .chart-box, .chart-container { display: none !important; }
  #hero { min-height: auto; padding: 2rem 0; background: #0058A3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .section { padding: 24px 0; page-break-inside: avoid; }
  .tab-pane { display: block !important; }
  .proc-body { display: block !important; }
  .kpi-card, .falha-card, .failure-card, .proc-card, .proc-item, .exec-card, .custo-card, .cost-box { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .footer-bottom { opacity: 1; }
}
