/*
 * components.css — Componentes reutilizáveis
 * Saci Digital · v2.0
 */

/* ════════ CARD ═══════════════════════════ */
.card {
  background: var(--bgCard);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px 26px;
  border: 1px solid var(--border);
}
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; color: var(--text1); letter-spacing: -.3px; }
.section-sub   { font-size: 12px; color: var(--text3); margin-top: 4px; }
.sec-header    { margin-bottom: 18px; }

/* ════════ KPI CARD ════════════════════════ */
.kpi-card {
  background: var(--bgCard);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 22px;
  border: 1px solid var(--border);
}
.kpi-top   { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.kpi-icon  { font-size: 22px; }
.kpi-delta { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.kpi-delta.up   { background: var(--greenPale); color: var(--green); }
.kpi-delta.down { background: var(--redPale); color: var(--red); }
.kpi-value { font-family: var(--font-display); font-weight: 900; font-size: 24px; line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text1); margin-bottom: 3px; }
.kpi-sub   { font-size: 11px; color: var(--text3); }

/* ════════ PILL / BADGE ════════════════════ */
.pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
}
.status-badge { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.status-ok      { background: var(--greenPale); color: var(--green); }
.status-atencao { background: var(--orangePale); color: var(--orange); }
.status-critico { background: var(--redPale); color: var(--red); }

/* ════════ APS BADGES ══════════════════════ */
.abadge  { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.ab-g    { background: var(--greenPale); color: var(--green); }
.ab-y    { background: var(--orangePale); color: var(--orange); }
.ab-r    { background: var(--redPale); color: var(--red); }
.ab-b    { background: var(--bluePale); color: var(--blue); }

/* ════════ SEMÁFORO ════════════════════════ */
.sema  { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.s-g   { background: #22c55e; }
.s-y   { background: #fbbf24; }
.s-r   { background: #ef4444; }
.asema { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.as-g  { background: #22c55e; }
.as-y  { background: #fbbf24; }
.as-r  { background: #ef4444; }

/* ════════ PROGRESS BAR ════════════════════ */
.progress-wrap  { width: 100%; }
.progress-track { background: var(--bg); border-radius: 99px; height: 7px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 99px; transition: width .6s ease; }
.a-pb   { width: 100%; background: var(--bg); border-radius: 99px; height: 6px; overflow: hidden; }
.a-pb-f { height: 100%; border-radius: 99px; transition: width .5s ease; }
.pb     { width: 100%; background: var(--bg); border-radius: 99px; overflow: hidden; }
.pb-f   { height: 7px; border-radius: 99px; transition: width .6s ease; }

/* ════════ SVG GAUGE ═══════════════════════ */
.gauge-wrap  { position: relative; flex-shrink: 0; }
.gauge-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-num   { font-family: var(--font-display); font-weight: 900; line-height: 1; color: var(--text1); }
.gauge-denom { font-size: 11px; color: var(--text3); margin-top: 2px; }
.gauge-svg   { transform: rotate(-90deg); display: block; }
.gauge-arc   { transition: stroke-dasharray .02s; }

/* ════════ ALERT ═══════════════════════════ */
.alrt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: 12px; border-left: 4px solid;
  margin-bottom: 10px;
}
.alrt-r { background: #fef2f2; border-color: var(--red); }
.alrt-y { background: #fffbeb; border-color: var(--yellow); }
.alrt-b { background: #eff6ff; border-color: var(--blue); }
.alrt-ico { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alrt-ttl { font-size: 13px; font-weight: 700; color: var(--text1); }
.alrt-txt { font-size: 12px; color: var(--text2); line-height: 1.5; margin-top: 2px; }

/* APS alerts */
.a-alrt { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 11px; border-left: 4px solid; margin-bottom: 9px; }
.a-alrt-r { background: #fef2f2; border-color: #ef4444; }
.a-alrt-y { background: #fffbeb; border-color: #fbbf24; }
.a-alrt-b { background: #eff6ff; border-color: var(--blue); }
.a-alrt-ico  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.a-alrt-ttl  { font-size: 12.5px; font-weight: 700; color: var(--text1); }
.a-alrt-txt  { font-size: 11.5px; color: var(--text2); line-height: 1.5; margin-top: 2px; }

/* ════════ TABLES ══════════════════════════ */
.data-table   { width: 100%; border-collapse: collapse; }
.data-table th { font-size: 10px; font-weight: 700; color: var(--text3); letter-spacing: .5px; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table td { font-size: 12.5px; color: var(--text1); padding: 10px 8px; border-bottom: 1px solid var(--bg); }
.aps-table    { width: 100%; border-collapse: collapse; }
.aps-table th { font-size: 10px; font-weight: 700; color: var(--text3); letter-spacing: .5px; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.aps-table td { font-size: 12px; color: var(--text1); padding: 9px 8px; border-bottom: 1px solid var(--bg); }
.aps-table tr:hover td { background: #f7fafd; }

/* ════════ HERO BANNER ═════════════════════ */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 55%, #0d2540 100%); border-radius: var(--radius-xl); padding: 28px 32px; margin-bottom: 22px; position: relative; overflow: hidden; }
.hero-orb     { position: absolute; border-radius: 50%; pointer-events: none; }
.hero-content { position: relative; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
.hero-title   { font-family: var(--font-display); font-weight: 900; font-size: 26px; color: #fff; letter-spacing: -.5px; margin: 4px 0 8px; }
.hero-sub     { font-size: 13.5px; color: rgba(255,255,255,.65); line-height: 1.75; max-width: 500px; margin-bottom: 14px; }
.hero-chips   { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-chip    { padding: 5px 12px; border-radius: 99px; background: rgba(255,255,255,.07); font-size: 12px; border: 1px solid rgba(255,255,255,.1); }
.hero-stats   { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stat    { background: rgba(255,255,255,.07); border-radius: 14px; padding: 14px 18px; border: 1px solid rgba(255,255,255,.1); min-width: 110px; }
.hero-stat-val { font-family: var(--font-display); font-weight: 800; font-size: 19px; line-height: 1; }
.hero-stat-lbl { font-size: 11px; color: rgba(255,255,255,.32); margin-top: 4px; }

/* ════════ DARK SECTION ════════════════════ */
.dark-section { background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 60%, #0e2540 100%); border-radius: var(--radius-xl); padding: 24px 28px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.06); }
.dark-section::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; }
.dark-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: #fff; }
.dark-sub   { font-size: 11.5px; color: rgba(255,255,255,.38); }

.a-dark { background: linear-gradient(135deg, var(--navy), #122944); border-radius: 17px; padding: 20px 24px; position: relative; overflow: hidden; margin-bottom: 16px; }
.a-dark::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px); background-size: 26px 26px; pointer-events: none; }
.a-dark-r { position: relative; }

/* ════════ META / FONTE ROWS ═══════════════ */
.meta-card   { background: var(--bg); border-radius: 12px; padding: 16px 18px; border: 1px solid var(--border); }
.meta-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.meta-name   { font-size: 13px; color: var(--text1); font-weight: 600; flex: 1; line-height: 1.4; padding-right: 8px; }
.meta-value  { font-family: var(--font-display); font-weight: 900; font-size: 20px; line-height: 1; text-align: right; }
.meta-goal   { font-size: 10px; color: var(--text3); margin-top: 2px; }
.meta-tag    { font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; margin-top: 6px; display: inline-block; }

.fonte-row     { margin-bottom: 10px; }
.fonte-header  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.fonte-name    { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.fonte-dot     { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.fonte-right   { display: flex; gap: 8px; align-items: baseline; }
.fonte-val     { font-family: var(--font-display); font-weight: 700; font-size: 12.5px; }
.fonte-pct     { font-size: 11px; color: var(--text3); }

/* ════════ TELESSAÚDE ROW ══════════════════ */
.tele-row    { margin-bottom: 12px; }
.tele-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.tele-name   { font-size: 12.5px; color: var(--text1); font-weight: 500; }
.tele-nums   { display: flex; gap: 10px; align-items: baseline; }
.tele-val    { font-family: var(--font-display); font-weight: 800; font-size: 13px; }
.tele-pct    { font-size: 11px; color: var(--text3); }

/* ════════ MAC CARD ════════════════════════ */
.mac-card      { background: var(--bg); border-radius: 14px; padding: 18px 20px; border: 1px solid var(--border); }
.mac-header    { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.mac-name      { font-size: 13px; font-weight: 600; color: var(--text1); flex: 1; line-height: 1.4; }
.mac-pct       { font-family: var(--font-display); font-weight: 900; font-size: 22px; }
.mac-nums      { display: flex; gap: 18px; margin-bottom: 10px; }
.mac-num-label { font-size: 11px; color: var(--text3); }
.mac-num-val   { font-size: 13px; font-weight: 700; color: var(--text1); }

/* ════════ EVOL CARD ═══════════════════════ */
.evol-card   { background: var(--bg); border-radius: 11px; padding: 12px 16px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.evol-periodo { font-size: 11px; color: var(--text3); margin-bottom: 2px; }
.evol-score  { font-family: var(--font-display); font-weight: 900; font-size: 22px; line-height: 1; }
.evol-delta  { font-family: var(--font-display); font-weight: 800; font-size: 15px; text-align: center; }
.evol-delta span { font-size: 10px; font-weight: 400; color: var(--text3); display: block; }

/* ════════ DIMENSION CARD ══════════════════ */
.dim-card       { border-radius: 14px; overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.dim-stripe     { height: 4px; }
.dim-body       { padding: 18px; }
.dim-header     { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dim-name       { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--text1); }
.dim-score      { font-family: var(--font-display); font-weight: 900; font-size: 26px; line-height: 1; }
.dim-score span { font-size: 12px; color: var(--text3); font-weight: 400; }
.dim-list       { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.dim-list-title { font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; margin-bottom: 6px; }
.dim-list-item  { font-size: 11.5px; color: var(--text2); margin-bottom: 4px; display: flex; gap: 5px; line-height: 1.5; }

/* ════════ QA CARDS (Quick Access) ════════ */
.qa-card { background: var(--bgCard); border-radius: var(--radius-lg); padding: 22px 24px; border: 1px solid var(--border); cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-md); }
.qa-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.qa-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.qa-card-icon   { font-size: 24px; }
.qa-card-stat   { font-family: var(--font-display); font-size: 13px; font-weight: 800; }
.qa-card-title  { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text1); margin-bottom: 6px; }
.qa-card-desc   { font-size: 12px; color: var(--text2); line-height: 1.6; }
.qa-card-link   { margin-top: 12px; font-size: 12px; font-weight: 600; }

/* ════════ TRAIL CARD ══════════════════════ */
.trail-card  { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--bgCard); display: flex; flex-direction: column; transition: box-shadow .2s; }
.trail-card:hover { box-shadow: 0 8px 30px rgba(11,30,54,.12); }
.trail-stripe   { height: 5px; }
.trail-body     { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.trail-badges   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.trail-indicated { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: #FEF3C7; color: #B45309; }
.trail-title    { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text1); line-height: 1.35; margin-bottom: 8px; }
.trail-desc     { font-size: 12.5px; color: var(--text2); line-height: 1.65; flex: 1; margin-bottom: 14px; }
.trail-meta     { display: flex; gap: 16px; font-size: 12px; color: var(--text3); margin-bottom: 14px; }
.trail-btn      { width: 100%; padding: 11px; border-radius: 10px; color: #fff; border: none; font-size: 13px; font-weight: 700; font-family: var(--font-display); letter-spacing: .2px; transition: opacity .18s; }
.trail-btn:hover { opacity: .85; }

/* ════════ FILTER BAR ══════════════════════ */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn { padding: 7px 16px; border-radius: 9px; border: 1px solid rgba(255,255,255,.15); font-size: 12px; font-weight: 600; background: transparent; color: rgba(255,255,255,.5); transition: var(--transition-fast); font-family: var(--font-body); }
.filter-btn:hover  { background: rgba(255,255,255,.1); color: #fff; }
.filter-btn.active { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.3); }

/* ════════ CHART CONTAINER ═════════════════ */
.chart-container { position: relative; }

/* ════════ COMING SOON ═════════════════════ */
.coming-soon   { text-align: center; padding: 60px 40px; }
.coming-icon   { font-size: 56px; margin-bottom: 20px; }
.coming-title  { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--text1); margin-bottom: 12px; }
.coming-desc   { font-size: 14px; color: var(--text2); line-height: 1.8; max-width: 500px; margin: 0 auto 24px; }
.coming-areas  { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.coming-area   { background: var(--bg); border-radius: 12px; padding: 14px 18px; border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; opacity: .5; }

/* ════════ MINI RING ════════════════════════ */
.mini-ring-wrap { position: relative; flex-shrink: 0; }
.mini-ring-num  { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 12px; }

/* ════════ RADAR / SCORE ═══════════════════ */
.radar-section  { display: flex; align-items: center; gap: 16px; }
.radar-dims     { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.radar-dim-row  { display: flex; align-items: center; gap: 12px; }
.score-section  { display: flex; align-items: center; gap: 28px; }
.level-scale    { display: flex; gap: 5px; margin-top: 14px; }
.level-item     { flex: 1; text-align: center; }
.level-bar      { height: 5px; border-radius: 3px; margin-bottom: 4px; }
.level-lbl      { font-size: 10px; }

/* ════════ IED / FC COMP ═══════════════════ */
.ied-bar { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.ied-row { display: flex; align-items: center; gap: 8px; }
.ied-lbl { font-size: 11px; color: var(--text2); min-width: 95px; }
.ied-pb  { flex: 1; background: var(--bg); border-radius: 99px; height: 7px; overflow: hidden; }
.ied-fill { height: 100%; border-radius: 99px; }
.ied-val { font-size: 11px; font-weight: 700; min-width: 36px; text-align: right; }
.fc-comp     { border-radius: 13px; overflow: hidden; border: 1px solid var(--border); }
.fc-comp-hdr { height: 4px; }
.fc-comp-body { padding: 16px 17px; }

/* ════════ RANK ═════════════════════════════ */
.a-rank      { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--bg); }
.a-rank-n    { font-family: var(--font-display); font-weight: 800; font-size: 13px; width: 20px; text-align: center; }
.a-rank-name { flex: 1; font-size: 12.5px; font-weight: 500; }
.a-rank-score { font-family: var(--font-display); font-weight: 800; font-size: 15px; }

/* ════════ EQUIPE / TERRITÓRIO ══════════════ */
.a-eq      { background: var(--bg); border-radius: 11px; padding: 14px 16px; border: 1px solid var(--border); }
.a-eq-hdr  { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 9px; }
.a-eq-name { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text1); }
.a-eq-sub  { font-size: 10.5px; color: var(--text3); }
.a-terr-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--bg); }
.a-terr-row:last-child { border-bottom: none; }
.a-terr-lbl { font-size: 12px; color: var(--text2); }
.a-terr-v   { font-family: var(--font-display); font-weight: 800; font-size: 13px; }

/* ════════ APS INDICADORES ROW ══════════════ */
.a-ind       { display: grid; grid-template-columns: 3fr 75px 65px 36px 90px 42px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--bg); }
.a-ind:last-child { border-bottom: none; }
.a-ind-name  { font-size: 12.5px; font-weight: 600; color: var(--text1); }
.a-ind-sub   { font-size: 10.5px; color: var(--text3); }
.a-ind-val   { font-family: var(--font-display); font-weight: 800; font-size: 14px; text-align: right; }
.a-ind-meta  { font-size: 10.5px; color: var(--text3); text-align: right; }
.a-ind-trend { text-align: center; font-size: 15px; }
.a-ind-ficha { font-size: 11px; color: var(--teal); cursor: pointer; text-decoration: underline; }

/* ════════ APS KPI CARD ═════════════════════ */
.aps-kpi     { background: var(--bgCard); border-radius: 13px; box-shadow: var(--shadow-sm); padding: 16px 18px; border: 1px solid var(--border); }
.aps-kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.aps-kpi-v   { font-family: var(--font-display); font-weight: 900; font-size: 20px; line-height: 1; margin-bottom: 3px; }
.aps-kpi-l   { font-size: 11.5px; font-weight: 600; color: var(--text1); margin-bottom: 2px; }
.aps-kpi-s   { font-size: 10.5px; color: var(--text3); }

/* ════════ LC CARDS ═════════════════════════ */
.a-lc-grid   { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 12px; margin-bottom: 18px; }
.a-lc        { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--bgCard); cursor: pointer; transition: var(--transition); }
.a-lc:hover  { box-shadow: 0 5px 18px rgba(11,30,54,.1); transform: translateY(-2px); }
.a-lc-hdr    { height: 4px; }
.a-lc-body   { padding: 13px 15px; }
.a-lc-ico    { font-size: 21px; margin-bottom: 6px; }
.a-lc-name   { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text1); margin-bottom: 4px; }
.a-lc-stat   { font-size: 11px; color: var(--text2); line-height: 1.5; }
.a-lc-foot   { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.a-lc-detail { background: var(--bgCard); border-radius: 14px; padding: 20px; border: 1px solid var(--border); display: none; margin-bottom: 16px; }
.a-lc-detail.a-show { display: block; }

/* ════════ APS SUBNAV ═══════════════════════ */
.aps-subnav { display: flex; gap: 4px; flex-wrap: wrap; padding: 14px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.aps-nb     { padding: 7px 13px; border-radius: 9px; border: 1px solid var(--border); font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--text2); background: var(--bg); transition: var(--transition-fast); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.aps-nb:hover   { background: var(--border); }
.aps-nb.aps-act { background: var(--navy); color: #fff; border-color: var(--navy); }
.aps-pg         { display: none; animation: fadeIn .25s ease; }
.aps-pg.aps-show { display: block; }

/* ════════ REC CARD ═════════════════════════ */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(195px,1fr)); gap: 12px; position: relative; margin-top: 18px; }
.rec-card { background: rgba(255,255,255,.05); border-radius: 14px; padding: 18px 16px; border: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 8px; }
.rec-card-icon { font-size: 22px; }
.rec-priority  { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 99px; align-self: flex-start; }
.rec-title     { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff; line-height: 1.4; }
.rec-desc      { font-size: 11.5px; color: rgba(255,255,255,.5); line-height: 1.65; }
