/* Risk Loss Prevention — estilos complementares ao Tailwind */
:root {
  --navy: #0b1e47;
  --navy-2: #13295c;
  --blue: #003da5;
  --red: #e30613;
  --ok: #10a36b;
  --warn: #f5b400;
  --bad: #e5363d;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6eaf0;
  --bg: #eef1f6;
}
html, body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
body { background: var(--bg); color: var(--ink); -webkit-tap-highlight-color: transparent; }

/* Logo CEVA (vetor) */
.ceva-logo { display: inline-block; aspect-ratio: 257 / 79; background: no-repeat center / contain; }
.ceva-logo--color { background-image: url('../img/ceva-logo.png'); }
.ceva-logo--white { background-image: url('../img/ceva-logo-white.png'); }

/* Sidebar */
.sidebar { background: var(--navy); }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: .45rem; color: #cfd8ea; font-size: .8rem; line-height: 1.25; font-weight: 500; border: 1px solid transparent; transition: background .15s, color .15s; position: relative; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: var(--navy-2); color: #fff; font-weight: 700; border-color: rgba(255,255,255,.14); }
.nav-link.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--red); }
.nav-link > span:not(.nav-badge) { min-width: 0; }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-badge { margin-left: auto; flex: none; font-size: .64rem; font-weight: 700; color: #ff6b73; border: 1px solid #ff6b73; border-radius: 999px; padding: 0 .45rem; line-height: 1.3rem; background: rgba(229,54,61,.12); }

/* Cartões */
.card { background: #fff; border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
/* Cards de indicadores: fundo tingido + borda na cor do indicador */
.kpi-card {
  border-radius: .8rem;
  border: 1.5px solid color-mix(in srgb, var(--k) 45%, transparent);
  border-top: 5px solid var(--k);
  background: linear-gradient(180deg, color-mix(in srgb, var(--k) 16%, #fff) 0%, color-mix(in srgb, var(--k) 6%, #fff) 100%);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--k) 22%, transparent);
  transition: transform .15s, box-shadow .15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px color-mix(in srgb, var(--k) 32%, transparent); }
.card-title { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #1e293b; }
.kpi-label { font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #475569; }

/* Selos de risco */
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.pill.nodot::before { display: none; }
.pill-baixo { color: #0b8a57; background: #e8f8f0; border-color: #a7e3c6; }
.pill-medio { color: #b7791f; background: #fff7e6; border-color: #f7d48b; }
.pill-alto { color: #d42a31; background: #fdecec; border-color: #f5b1b4; }
.pill-andamento { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }
.tag-sev { font-size: .66rem; font-weight: 700; padding: .12rem .5rem; border-radius: .3rem; border: 1px solid; }
.sev-critical { color: #d42a31; background: #fdecec; border-color: #f5b1b4; }
.sev-high { color: #c2410c; background: #fff1e7; border-color: #fbc39c; }
.sev-medium { color: #a16207; background: #fefbe8; border-color: #f4e08a; }
.sev-low { color: #0b8a57; background: #e8f8f0; border-color: #a7e3c6; }
.cls-A { color: #d42a31; background: #fdecec; border: 1px solid #f5b1b4; }
.cls-M { color: #b7791f; background: #fff7e6; border: 1px solid #f7d48b; }
.cls-B { color: #0b8a57; background: #e8f8f0; border: 1px solid #a7e3c6; }

/* Filtros do topo */
.hdr-select { position: relative; border: 1px solid #d7dde7; border-radius: .45rem; padding: .28rem 1.8rem .28rem .7rem; background: #fff; min-width: 150px; cursor: pointer; }
.hdr-select span { display: block; font-size: .56rem; font-weight: 700; letter-spacing: .08em; color: #64748b; text-transform: uppercase; }
.hdr-select select { appearance: none; -webkit-appearance: none; border: 0; outline: 0; background: transparent; font-size: .76rem; font-weight: 600; color: #0f172a; width: 100%; padding: 0; cursor: pointer; }
.hdr-select::after { content: ''; position: absolute; right: .7rem; top: 50%; width: 7px; height: 7px; border-right: 1.6px solid #475569; border-bottom: 1.6px solid #475569; transform: translateY(-70%) rotate(45deg); pointer-events: none; }

.field { width: 100%; border: 1px solid #d7dde7; border-radius: .45rem; padding: .55rem .75rem; font-size: .85rem; background: #fff; outline: none; transition: border .15s, box-shadow .15s; }
.field:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,61,165,.12); }
.lbl { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .08em; color: #475569; text-transform: uppercase; margin-bottom: .35rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font-weight: 600; font-size: .82rem; border-radius: .45rem; padding: .55rem 1rem; transition: background .15s, transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #00308a; }
.btn-ghost { background: #fff; border: 1px solid #d7dde7; color: #0f172a; }
.btn-ghost:hover { background: #f8fafc; }
.btn-danger { background: #fdecec; color: #c81e25; border: 1px solid #f5b1b4; }
.btn-sm { padding: .32rem .65rem; font-size: .74rem; }
.btn-app { background: #e8efff; color: var(--blue); font-weight: 800; font-size: .68rem; letter-spacing: .05em; border-radius: 999px; padding: .45rem .85rem; }
.btn-app:hover { background: #d8e4ff; }

/* Barras */
.bar-track { height: 8px; background: #edf1f6; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }

/* Questionário */
.ans-btn { flex: 1; border: 1.5px solid #d7dde7; border-radius: .5rem; padding: .55rem .3rem; font-weight: 700; font-size: .8rem; color: #475569; background: #fff; transition: all .12s; }
.ans-btn:hover { border-color: #94a3b8; }
.ans-btn.on-S { background: #10a36b; border-color: #10a36b; color: #fff; }
.ans-btn.on-N { background: #e5363d; border-color: #e5363d; color: #fff; }
.ans-btn.on-NA { background: #64748b; border-color: #64748b; color: #fff; }
.q-card.answered-N { border-left: 4px solid #e5363d; }
.q-card.answered-S { border-left: 4px solid #10a36b; }
.q-card.answered-NA { border-left: 4px solid #94a3b8; }

/* Américas — cores vivas */
.vivid-1 { background: linear-gradient(135deg, #00c6ff, #0072ff); }
.vivid-2 { background: linear-gradient(135deg, #ff4e50, #f9163f); }
.vivid-3 { background: linear-gradient(135deg, #00e09e, #00a86b); }
.vivid-4 { background: linear-gradient(135deg, #ffb800, #ff7a00); }
.vivid-5 { background: linear-gradient(135deg, #b44cff, #6a11cb); }
.vivid-6 { background: linear-gradient(135deg, #ff2e93, #d6006b); }
.chip { display: inline-flex; align-items: center; gap: .55rem; padding: .6rem 1.1rem; border-radius: 999px; font-size: 1rem; font-weight: 700; border: 2px solid #d7dde7; background: #fff; color: #1e293b; cursor: pointer; transition: all .12s; user-select: none; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.chip:hover { border-color: #94a3b8; transform: translateY(-1px); }
.chip .w-2.h-2 { width: 10px; height: 10px; }
.chip.on { background: #0b1e47; border-color: #0b1e47; color: #fff; }
.chip .flag { width: 28px; height: 19px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.flag { display: inline-block; width: 22px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.1); vertical-align: middle; }

/* Modal / Toast */
.modal-bg { position: fixed; inset: 0; background: rgba(8,17,40,.55); backdrop-filter: blur(2px); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fade .15s ease; }
.modal { background: #fff; border-radius: .9rem; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; box-shadow: 0 25px 60px rgba(0,0,0,.3); animation: pop .18s ease; }
@keyframes fade { from { opacity: 0 } }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0 } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0 } }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: #0b1e47; color: #fff; padding: .7rem 1.1rem; border-radius: .6rem; font-size: .85rem; font-weight: 500; z-index: 80; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: pop .2s ease; }

.fade-in { animation: fade .25s ease; }
.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-thumb { background: #c7cfdb; border-radius: 8px; }
.tbl th { font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #475569; text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .7rem .75rem; border-bottom: 1px solid #f0f3f7; font-size: .8rem; vertical-align: middle; }
.tbl tr:hover td { background: #fafbfd; }

/* Impressão do relatório */
@media print {
  .no-print, aside, header { display: none !important; }
  main { margin: 0 !important; padding: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Mapa da América do Sul */
.leaflet-container { font-family: 'Inter', system-ui, sans-serif; }
.map-country { display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -50%); cursor: pointer; white-space: nowrap; }
.map-country .nm { font-size: 17px; font-weight: 900; color: #fff; letter-spacing: .02em; text-shadow: 0 0 3px #000, 0 1px 6px rgba(0,0,0,.9), 0 0 12px rgba(0,0,0,.6); text-transform: uppercase; }
.map-country .ct { margin-top: 3px; font-size: 12.5px; font-weight: 900; color: #111; padding: 2px 10px; border-radius: 999px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.map-country:hover .ct { transform: scale(1.08); }
.map-pin { display: flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--c); color: #fff; font-weight: 900; font-size: 13px; border: 3px solid #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent), 0 3px 10px rgba(0,0,0,.5); animation: pinPulse 2.4s ease-in-out infinite; }
@keyframes pinPulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--c) 10%, transparent), 0 3px 10px rgba(0,0,0,.5); } }
.map-legend { background: rgba(255,255,255,.95); padding: 8px 12px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #0f172a; box-shadow: 0 2px 10px rgba(0,0,0,.25); line-height: 1.7; }
.map-tip { font-size: 12.5px; font-weight: 600; }
.map-pop .leaflet-popup-content { margin: 12px 14px; }
.leaflet-control-layers { font-size: 12.5px; font-weight: 700; border-radius: 10px !important; }

/* Dashboard América do Sul — textos maiores e em negrito */
.am-page .card-title { font-size: 15px; font-weight: 800; color: #0f172a; }
.am-page .tbl th { font-size: 12.5px; font-weight: 800; color: #0f172a; }
.am-page .tbl td { font-size: 14.5px; font-weight: 700; color: #0f172a; }
.am-page .pill { font-size: 12px; font-weight: 800; padding: .28rem .7rem; }
.am-page .chip { font-weight: 800; }
.map-country .nm { font-size: 19px !important; }
.map-country .ct { font-size: 14px !important; }
.map-pin { font-size: 14px; }
.map-legend { font-size: 13.5px; font-weight: 800; }
.map-tip { font-size: 14px; font-weight: 700; }
