/* ============================================================
   Página da Empresa — mobile-first (webview no Conecta Recife)
   ============================================================ */

body {
  background:
    radial-gradient(1200px 500px at 50% -10%, #10396b 0%, transparent 60%),
    var(--bg);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}
@media (min-width: 560px) {
  body { padding: 28px 0; }
  .app {
    min-height: calc(100dvh - 56px);
    border-radius: 28px;
    overflow: clip;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .08);
  }
}

/* ---------- Cabeçalho ---------- */
.app-header {
  background: linear-gradient(160deg, var(--navy-800) 0%, var(--navy-950) 90%);
  color: #fff;
  padding: 18px 20px 64px;
  position: relative;
}
.app-header::after {
  /* textura sutil de ondas */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 160px at 85% 0%, rgba(57, 135, 229, .28), transparent 70%),
    radial-gradient(300px 140px at 0% 30%, rgba(246, 196, 69, .10), transparent 70%);
  pointer-events: none;
}
.app-header > * { position: relative; }

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.brand-name { font-size: 13px; font-weight: 700; line-height: 1.15; }
.brand-name .sub {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: #9db8dd;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.bell {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background .15s;
}
.bell:hover { background: rgba(255, 255, 255, .16); }
.bell .dot {
  position: absolute;
  top: 8px; right: 9px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 0 2px var(--navy-900);
}

.greeting { font-size: 14px; color: #b9cbe6; margin-bottom: 4px; }
.greeting strong { color: #fff; }
.page-title { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }

/* ---------- Cartão da empresa ---------- */
.company-card {
  margin: -46px 16px 0;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 2;
}
.company-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.company-avatar {
  width: 46px; height: 46px;
  flex: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #fdeeb9, var(--gold-400));
  color: #6b4d00;
  font-weight: 800;
  font-size: 17px;
  display: grid;
  place-items: center;
}
.company-id { min-width: 0; flex: 1; }
.company-name { font-size: 16.5px; font-weight: 800; letter-spacing: -0.015em; }
.company-cnpj { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.company-switch {
  flex: none;
  border: none;
  background: var(--blue-50);
  color: var(--blue-600);
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.company-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* ---------- Faixa-resumo ---------- */
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 16px 0;
}
.summary-item {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 10px 6px 9px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.summary-item:hover { border-color: var(--blue-500); box-shadow: var(--shadow-md); }
.summary-value {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.summary-label { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-top: 1px; }
.dot-status { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-verde    { background: var(--good); }
.dot-amarelo  { background: var(--warn); }
.dot-vermelho { background: var(--crit); }

/* ---------- Banner de alerta ---------- */
.alert-banner {
  margin: 12px 16px 0;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: var(--warn-bg);
  border: 1px solid #f3ddaa;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.alert-banner .ico {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: #fff;
  color: var(--warn-text);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.alert-banner .txt { flex: 1; font-size: 13px; color: var(--warn-text); }
.alert-banner .txt strong { color: #6b4600; }
.alert-banner .link {
  display: inline-block;
  margin-top: 3px;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--blue-600);
  background: none;
  border: none;
  padding: 0;
}

/* ---------- Abas ---------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 16px 16px 0;
  padding: 4px;
  border-radius: 14px;
  background: #e6eaf2;
}
.tab {
  border: none;
  background: transparent;
  border-radius: 11px;
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tab .count {
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--line-strong);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.tab.active {
  background: var(--surface);
  color: var(--navy-800);
  box-shadow: var(--shadow-sm);
}
.tab.active .count { background: var(--blue-600); color: #fff; }

/* ---------- Conteúdo ---------- */
.content { padding: 14px 16px 90px; display: grid; gap: 10px; }
.section-note {
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 2px 2px 0;
}

/* Card de oportunidade (Radar) */
.op-card { padding: 14px; display: grid; gap: 9px; }
.op-card.destaque {
  border: 1.5px solid var(--blue-500);
  background: linear-gradient(180deg, var(--blue-50), var(--surface) 55%);
}
.op-head { display: flex; gap: 10px; align-items: flex-start; }
.op-ico {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
}
.op-ico.licitacao { background: var(--blue-100); color: var(--blue-600); }
.op-ico.curso     { background: #f3ecfd; color: #6d4bc4; }
.op-ico.credito   { background: var(--good-bg); color: var(--good-text); }
.op-ico.vaga      { background: #fdf0cd; color: #7a5800; }
.op-ico.evento        { background: #fdeef3; color: #c2477d; }
.op-ico.regularizacao { background: #e6f4f1; color: #0f766e; }
.op-titles { flex: 1; min-width: 0; }
.op-title { font-size: 14.5px; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }
.op-org { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.op-obj { font-size: 13px; color: var(--ink-2); }
.op-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.op-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}
.op-actions .btn { flex: 1; }

/* Agenda (linha do tempo) */
.timeline { display: grid; gap: 10px; }
.tl-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 13px 14px;
}
.tl-date {
  text-align: center;
  align-self: start;
  padding: 7px 2px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.05;
}
.tl-date small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--blue-600);
}
.tl-item.urgente .tl-date { background: var(--warn-bg); color: var(--warn-text); }
.tl-item.urgente .tl-date small { color: var(--warn-text); }
.tl-body { min-width: 0; display: grid; gap: 5px; }
.tl-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tl-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.tl-detail { font-size: 12.5px; color: var(--ink-2); }
.tl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.tl-actions { display: flex; gap: 6px; }

/* Situação (semáforo) */
.sit-card { padding: 14px; display: grid; gap: 8px; }
.sit-head { display: flex; align-items: center; gap: 11px; }
.sit-light {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}
.sit-light.verde    { background: var(--good); box-shadow: 0 0 0 5px var(--good-bg); }
.sit-light.amarelo  { background: var(--warn); box-shadow: 0 0 0 5px var(--warn-bg); color: #5d3c00; }
.sit-light.vermelho { background: var(--crit); box-shadow: 0 0 0 5px var(--crit-bg); }
.sit-dim { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.sit-resumo { font-size: 14.5px; font-weight: 800; letter-spacing: -0.01em; }
.sit-detail { font-size: 12.5px; color: var(--ink-2); }
.sit-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Gaveta de notificações ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 31, 61, .45);
  backdrop-filter: blur(2px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  z-index: 101;
  right: 0; top: 0; bottom: 0;
  width: min(400px, 92vw);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(105%);
  transition: transform .25s cubic-bezier(.2, .8, .3, 1);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head {
  padding: 18px 18px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-head h3 { font-size: 16px; }
.drawer-close {
  border: none;
  background: var(--bg);
  width: 32px; height: 32px;
  border-radius: 9px;
  color: var(--ink-2);
  display: grid;
  place-items: center;
}
.drawer-body { padding: 14px; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.notif { padding: 13px 14px; display: grid; gap: 7px; }
.notif-head { display: flex; align-items: center; gap: 8px; }
.notif-canal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}
.canal-whatsapp { background: #e7f6e9; color: #1b7d2c; }
.canal-push     { background: var(--blue-100); color: var(--blue-600); }
.canal-email    { background: #eef0f4; color: var(--ink-2); }
.notif-quando { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.notif-texto { font-size: 13px; color: var(--ink-2); }
.drawer-note {
  margin: 0 14px 14px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--blue-50);
  border: 1px dashed #bcd6f3;
  font-size: 11.5px;
  color: var(--blue-700);
}

/* ---------- Programas permanentes (vitrine, fora do Radar) ---------- */
.programas {
  padding: 4px 16px 8px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 16px;
}
.programas-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.programas-head h2 { font-size: 15px; letter-spacing: -0.01em; }
.prog-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.prog-strip::-webkit-scrollbar { height: 5px; }
.prog-strip::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.prog-card {
  flex: 0 0 168px;
  scroll-snap-align: start;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  display: grid;
  gap: 7px;
  align-content: start;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.prog-card:hover {
  border-color: var(--blue-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.prog-emoji {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--blue-50);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.prog-nome {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.prog-nome svg { flex: none; color: var(--blue-600); }
.prog-tagline { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; }
.prog-orgao { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }

/* ---------- Rodapé ---------- */
.proto-foot {
  margin-top: auto;
  padding: 14px 16px 20px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
}
.proto-foot a { font-weight: 700; }
