/* ==========================================================================
   BCG DIÁRIO — DESIGN SYSTEM DE ELITE (MODERNO, RETRÁTIL, FOCO FUNCIONAL)
   Paleta: Obsidian / Deep Emerald / Ouro Tático / Neônio de Status
   ========================================================================== */

:root {
  --bg-base: #070d0a;
  --bg-surface: #0c1612;
  --bg-surface-elevated: #111f19;
  --bg-card: rgba(14, 26, 21, 0.85);
  --bg-card-hover: rgba(19, 36, 29, 0.95);

  --ink: #f0f7f3;
  --ink-secondary: #9cb5a8;
  --ink-muted: #647d70;

  --gold: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --gold-gradient: linear-gradient(135deg, #f3d069 0%, #b89127 100%);

  --green-ok: #10b981;
  --green-glow: rgba(16, 185, 129, 0.2);
  --green-border: rgba(16, 185, 129, 0.4);

  --amber-warn: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.2);
  --amber-border: rgba(245, 158, 11, 0.4);

  --red-alert: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.2);

  --blue-tech: #38bdf8;
  --blue-glow: rgba(56, 189, 248, 0.2);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(212, 175, 55, 0.5);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-main: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px -5px var(--gold-glow);
}

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

html {
  background-color: var(--bg-base);
  color-scheme: dark;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(20, 48, 35, 0.4) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(13, 31, 23, 0.5) 0%, transparent 50%);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

/* Background grid sutil */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 90%);
}

main {
  position: relative;
  z-index: 1;
  width: min(1140px, 92vw);
  margin: 0 auto;
  padding: 24px 0 60px;
}

/* ==========================================================================
   HEADER & NAVEGAÇÃO SUPERIOR
   ========================================================================== */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(12, 22, 18, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 36px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gold-gradient);
  color: #120e03;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.95rem;
  box-shadow: 0 0 15px var(--gold-glow);
  letter-spacing: -0.05em;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 40%, #b3c9be 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-meta {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 700;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink-secondary);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.site-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-ok);
  box-shadow: 0 0 8px var(--green-ok);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.site-header-nav {
  display: inline-flex;
  gap: 10px;
}

.header-nav-btn {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-nav-btn--stive {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
}

.header-nav-btn--stive:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.header-nav-btn--login {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--ink);
}

.header-nav-btn--login:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold);
}

/* ==========================================================================
   LANDING PAGE — HERO & CARDS
   ========================================================================== */

.hero-copy {
  text-align: center;
  padding: 40px 10px 50px;
  max-width: 860px;
  margin: 0 auto;
}

.page-kicker {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.hero-copy h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #ffffff 30%, #a4c2b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-secondary);
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto;
}

/* HUB DE AÇÕES PRINCIPAIS (DOIS CARDS MODERNOS) */
.landing-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin: 30px 0 60px;
}

.action-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 34px 28px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
}

.action-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: var(--shadow-glow), var(--shadow-main);
}

.action-card-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 16px;
  align-self: flex-start;
}

.action-card-badge--stive {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.3);
}

.action-card-badge--login {
  background: rgba(56, 189, 248, 0.15);
  color: var(--blue-tech);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.action-card h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: #fff;
}

.action-card-lead {
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 6px;
}

.action-card-desc {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
  flex-grow: 1;
}

.ops-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-align: center;
  width: 100%;
}

.ops-button.btn-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
}

.ops-button.btn-whatsapp:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.45);
}

.ops-button.primary {
  background: var(--gold-gradient);
  color: #120e03;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25);
}

.ops-button.primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(212, 175, 55, 0.4);
}

.action-card-note {
  font-size: 0.78rem;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 12px;
}

.landing-recovery-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.landing-recovery-box strong {
  display: block;
  color: var(--gold);
  margin-bottom: 4px;
}

.landing-recovery-link {
  color: var(--blue-tech);
  text-decoration: none;
  font-weight: 700;
}

.landing-recovery-link:hover {
  text-decoration: underline;
}

/* CARDS DE DESTAQUE — O QUE O SISTEMA FAZ */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-index {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 12px;
}

.feature-card h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.86rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* FAQ ENXUTO E MODERNO */
.landing-faq-section {
  max-width: 800px;
  margin: 0 auto 60px;
}

.faq-header {
  text-align: center;
  margin-bottom: 30px;
}

.faq-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item[open] {
  border-color: rgba(212, 175, 55, 0.35);
  background: var(--bg-surface-elevated);
}

.faq-question {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 400;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  content: "−";
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px 18px;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.faq-answer a {
  color: var(--gold);
  text-decoration: underline;
}

/* FOOTER COMPACTO */
.landing-disclaimer {
  text-align: center;
  font-size: 0.76rem;
  color: var(--ink-muted);
  max-width: 680px;
  margin: 40px auto 10px;
  line-height: 1.5;
}

.app-version {
  text-align: center;
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  margin-top: 10px;
}

/* ==========================================================================
   FICHA OPS — ÁREA PÓS-LOGIN (O CORAÇÃO DO SISTEMA)
   ========================================================================== */

body.ficha-ops {
  background: #08110d;
  color: var(--ink);
}

body.ficha-ops main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.ficha-frame {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

/* SIDEBAR DA FICHA */
.ops-sidebar {
  background: #050b08;
  border-right: 1px solid var(--border-subtle);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.ops-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.ops-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
}

.ops-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--gold-gradient);
  color: #120e03;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 900;
  font-size: 0.85rem;
}

.ops-theme-btn {
  display: none; /* Desnecessário, dark mode nativo limpo */
}

.ops-sidebar small {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  font-weight: 800;
  margin: 20px 8px 8px;
}

.ops-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ops-sidebar .nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.ops-sidebar .nav:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.ops-sidebar .nav.active {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  font-weight: 700;
  border-left: 3px solid var(--gold);
}

.ops-sidebar .nav-count {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-muted);
}

.ops-sidebar .nav.active .nav-count {
  background: rgba(212, 175, 55, 0.25);
  color: var(--gold);
}

.ops-sidebar .nav-button {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--red-alert);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}

.ops-sidebar .nav-button:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ÁREA DE CONTEÚDO PRINCIPAL (WORKSPACE) */
.ops-workspace {
  padding: 32px 40px;
  max-width: 1300px;
  width: 100%;
}

.ops-crumb {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.ops-headline {
  margin-bottom: 28px;
}

.ops-headline h1 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.ops-identity {
  font-size: 1.05rem;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ops-page-intro {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  margin-top: 4px;
}

/* TABS SUPERIORES */
.ops-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 28px;
  overflow-x: auto;
}

.ops-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ops-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.ops-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(212, 175, 55, 0.05);
}

.ops-tab-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   CARDS DE CLASSIFICAÇÃO (ANTIGUIDADE E MERECIMENTO) — DESTAQUE MÁXIMO
   ========================================================================== */

.class-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 16px 0 28px;
}

.competition-status {
  grid-column: 1 / -1;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.92rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
}

.competition-status strong {
  color: var(--blue-tech);
}

.class-lane {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow-main);
  transition: all 0.2s ease;
}

.class-lane:hover {
  border-color: rgba(212, 175, 55, 0.4);
}

.class-lane h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 800;
  margin-bottom: 14px;
}

.classification-position {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
}

.classification-position strong {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.classification-movement {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-ok);
  background: var(--green-glow);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.class-lane p {
  font-size: 0.84rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   SCORE DUAL (RIP ATUAL vs POTENCIAL MÁXIMO PROJETADO)
   ========================================================================== */

.dual-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.score-card-kpi {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-main);
  position: relative;
  overflow: hidden;
}

.score-card-kpi.audit {
  border-color: var(--green-border);
  background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.12) 0%, var(--bg-surface) 65%);
}

.score-card-kpi.projected {
  border-color: var(--amber-border);
  background: radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.12) 0%, var(--bg-surface) 65%);
}

.score-card-kpi .kpi-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.score-card-kpi.audit .kpi-label { color: var(--green-ok); }
.score-card-kpi.projected .kpi-label { color: var(--amber-warn); }

.score-card-kpi .kpi-val {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.score-card-kpi .kpi-sub {
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

/* ==========================================================================
   ABA PROMOÇÕES — O PONTO FORTE (DESTAQUE PARA BI vs BCG/DOE)
   ========================================================================== */

/* Banner de alerta legal crítico */
.promotion-legal-rule-banner {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(26, 46, 36, 0.4) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.promotion-legal-rule-banner .icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.promotion-legal-rule-banner h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 4px;
}

.promotion-legal-rule-banner p {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* Seções por estado administrativo de pontos */
.score-bar {
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 24px;
}

.score-bar h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.promotion-state-kicker {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin-bottom: 12px;
}

.state-complete .promotion-state-kicker { color: var(--green-ok); }
.state-warning .promotion-state-kicker { color: var(--amber-warn); }
.state-partial .promotion-state-kicker { color: var(--blue-tech); }

/* Card individual de situação pontuável */
.promotion-state-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-top: 14px;
  transition: all 0.2s ease;
}

.promotion-state-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.promotion-state-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.promotion-state-card p {
  font-size: 0.86rem;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.promotion-state-card p strong {
  color: var(--ink);
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  color: var(--blue-tech);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  margin-top: 8px;
  transition: all 0.15s ease;
}

.pdf-link:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--blue-tech);
  transform: translateY(-1px);
}

/* ==========================================================================
   TABELA DE ATIVIDADES / HISTÓRICO
   ========================================================================== */

.ops-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.ops-panel h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.ops-filterbar {
  display: flex;
  gap: 12px;
  margin: 20px 0 16px;
}

.ops-filterbar input, .ops-filterbar select {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  color: var(--ink);
  font-size: 0.9rem;
}

.ops-filterbar input {
  flex-grow: 1;
}

.ops-filterbar input:focus, .ops-filterbar select:focus {
  border-color: var(--gold);
  outline: none;
}

.ops-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ops-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.ops-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.ops-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.ops-date {
  color: var(--ink-muted);
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  white-space: nowrap;
}

.ops-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-secondary);
}

.ops-badge-alert {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-warn);
}

/* ==========================================================================
   FORMULÁRIOS — CADASTRO E LOGIN
   ========================================================================== */

.landing-login-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 34px;
  max-width: 520px;
  margin: 30px auto;
  box-shadow: var(--shadow-main);
}

label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  margin: 16px 0 6px;
}

input[type="text"],
input[type="tel"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 12px var(--gold-glow);
}

.password-field {
  position: relative;
  display: flex;
  align-items: stretch;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
}

.password-toggle:hover {
  color: var(--gold);
}

button[type="submit"] {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--gold-gradient);
  color: #120e03;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px var(--gold-glow);
}

button[type="submit"]:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ==========================================================================
   UTILITÁRIOS & RESPONSIVIDADE
   ========================================================================== */

.muted {
  color: var(--ink-secondary);
  font-size: 0.86rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--gold);
  color: #000;
  padding: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

@media (max-width: 768px) {
  .ficha-frame {
    grid-template-columns: 1fr;
  }

  .ops-sidebar {
    padding: 16px;
  }

  .ops-sidebar-head {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .ops-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .ops-sidebar .nav {
    flex: 1 1 calc(50% - 6px);
    font-size: 0.82rem;
    padding: 8px 10px;
  }

  .ops-workspace {
    padding: 20px 16px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .site-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .dual-score-grid, .class-lanes {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   ESTILOS DEDICADOS DA CLASSIFICAÇÃO E PROMOÇÕES (BI vs BCG)
   ========================================================================== */

.classification-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.classification-header-pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 800;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.competition-summary-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.competition-status-item {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 600;
}

.competition-status-concorrendo {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.competition-status-nao-concorrendo {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.status-indicator-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.competition-status-concorrendo .status-indicator-dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.competition-status-nao-concorrendo .status-indicator-dot {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

/* Banner de Destaque da Regra do Boletim Interno (BI) */
.promotion-legal-banner {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(16, 28, 22, 0.85) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-main);
}

.promotion-legal-header-flex {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.promotion-legal-icon {
  font-size: 2rem;
  line-height: 1;
}

.promotion-legal-title {
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 900;
  margin: 0 0 6px;
}

.promotion-legal-text {
  margin: 0;
  color: #d6e4dc;
  font-size: 0.92rem;
  line-height: 1.6;
}

.promotion-summary-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.promotion-summary-metric-card {
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.promotion-summary-metric-card.metric-ok {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.promotion-summary-metric-card.metric-pending {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.promotion-summary-metric-card.metric-reusable {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
  display: block;
}

.metric-ok .metric-label { color: var(--green-ok); }
.metric-pending .metric-label { color: var(--amber-warn); }
.metric-reusable .metric-label { color: var(--blue-tech); }

.metric-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}



/* Rank rain styles */
.rank-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.rank-rain span {
  position: absolute;
  top: -60px;
  color: rgba(212, 175, 55, 0.12);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  user-select: none;
  animation-name: rank-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes rank-fall {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(105vh);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rank-rain span {
    animation-duration: 20s !important;
    opacity: 0.05 !important;
  }
}


/* ==========================================================================
   ENHANCEMENTS: POLISH, EFFECTS & CLEAN LAYOUT
   ========================================================================== */

/* Telemetria do Acervo Discreta */
section.score-bar[aria-labelledby="coverage-title"] {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}
section.score-bar[aria-labelledby="coverage-title"] h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
section.score-bar[aria-labelledby="coverage-title"] p {
  font-size: 0.84rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Nota de Canal e Acesso no Rodapé */
.ops-channel-note {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  background: transparent !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  text-align: center;
}
.ops-channel-note h2 {
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  font-weight: 700;
}
.ops-channel-note p {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

/* Destaque Máximo para Seção de Pontos em Risco (Sem BI) */
section[data-promotion-state="possivel_ponto_bi_nao_localizado"] {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.09) 0%, rgba(12, 22, 18, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 12px 35px -10px rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  position: relative;
}
section[data-promotion-state="possivel_ponto_bi_nao_localizado"] h2 {
  color: var(--amber-warn);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}
section[data-promotion-state="possivel_ponto_bi_nao_localizado"] .promotion-state-card {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 4px solid var(--amber-warn);
}
section[data-promotion-state="possivel_ponto_bi_nao_localizado"] .promotion-state-card h3 {
  color: #ffc107;
  font-size: 1.1rem;
}

/* Destaque para Seção de Pontos Garantidos (Em BI) */
section[data-promotion-state="bi_localizado"] {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(12, 22, 18, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 12px 35px -10px rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
}
section[data-promotion-state="bi_localizado"] h2 {
  color: var(--green-ok);
  font-size: 1.3rem;
  font-weight: 900;
}
section[data-promotion-state="bi_localizado"] .promotion-state-card {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 4px solid var(--green-ok);
}
section[data-promotion-state="bi_localizado"] .promotion-state-card h3 {
  color: var(--green-ok);
}

/* Micro-interações nos cards */
.action-card, .feature-card, .class-lane, .score-card-kpi, .promotion-summary-metric-card {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.action-card:hover, .feature-card:hover, .class-lane:hover, .score-card-kpi:hover, .promotion-summary-metric-card:hover {
  transform: translateY(-2px);
}

/* Botões com sensação tátil */
button:active, .ops-button:active, .header-nav-btn:active {
  transform: scale(0.98);
}


/* ==========================================================================
   HERO LIVE PREVIEW HUD (EXEMPLO REAL DA FICHA)
   ========================================================================== */

.hero-preview-hud {
  max-width: 860px;
  margin: 32px auto 40px;
  background: linear-gradient(180deg, rgba(16, 32, 24, 0.95) 0%, rgba(9, 18, 14, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 30px -5px rgba(212, 175, 55, 0.15);
  position: relative;
  text-align: left;
}

.hero-preview-hud::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.hud-militar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hud-avatar {
  font-size: 2rem;
  width: 46px;
  height: 46px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
}

.hud-militar strong {
  display: block;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.hud-militar small {
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.hud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.hud-status-badge.status-concorrendo {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.hud-status-badge .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-dot 2s infinite ease-in-out;
}

.hud-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.hud-metric {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.hud-metric-alert {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.35);
}

.hud-metric-ok {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
}

.hud-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.hud-metric-alert .hud-label { color: #fbbf24; }
.hud-metric-ok .hud-label { color: #34d399; }

.hud-val {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.hud-val.text-amber { color: #fbbf24; }
.hud-val.text-green { color: #34d399; }

.hud-sub {
  font-size: 0.76rem;
  color: var(--ink-secondary);
  line-height: 1.35;
}


/* ==========================================================================
   CORREÇÃO ACHADA PELO BOT-QA (2026-09-24) — strings sem quebra
   O overflow-x:hidden global mascarava o defeito: documentos chegavam a
   scrollWidth 8010px em viewport 390px enquanto o root media 390px. A causa
   real é conteúdo sem pontos de quebra (URLs, CNJ, matrículas, tcTokens).
   Aqui o texto passa a QUEBRAR em vez de ser cortado.
   ========================================================================== */
body,
.ops-workspace,
.ops-main-column,
.ops-headline,
.ops-crumb,
.ops-identity,
.ops-page-intro,
.ops-panel,
.ops-table td,
.ops-table th,
.detail-panel,
.score-bar,
.cycle-form,
.state-unavailable,
.hero-copy,
.hero-lead,
.action-card,
.faq-answer,
.landing-recovery-box {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

/* Fontes monoespaçadas da evidência (data, CNJ, matrícula) também quebram. */
.ops-date,
.ops-table td,
.ops-table th,
code,
samp,
kbd {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Nunca deixe um filho "escapar" do bloco que o contém. */
.ops-workspace *,
.ops-sidebar * {
  max-width: 100%;
}

/* Imagens e mídias não podem ultrapassar o contêiner. */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* `pre` de conteúdo oficial: rola dentro de si mesmo, não empurra o documento. */
.ops-workspace pre,
.ficha pre {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   RESPONSIVIDADE MOBILE REFINADA (2026-09-24)
   Corrige overflow horizontal comprovado via Playwright (scrollWidth 913px
   em viewport 390px). Causa raiz: o grid .ficha-frame inflava o track por
   causa do min-content do sidebar (white-space:nowrap). A correção força
   min-width:0 nos filhos de grid/flex, o que permite o encolhimento real.
   ========================================================================== */

@media (max-width: 768px) {
  /* --- A) Contenção global ---
     100vw inclui a largura da barra de rolagem, então um documento que rola
     verticalmente estourava 16px na horizontal. 100% respeita o layout viewport. */
  html,
  body {
    max-width: 100% !important;
    overflow-wrap: anywhere;
  }

  main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
  }

  /* --- B) Grid da ficha: track encolhível e filhos com min-width:0 --- */
  .ficha-frame {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .ops-sidebar,
  .ops-workspace,
  .ops-content-grid,
  .ops-main-column,
  .ops-panel,
  .detail-panel,
  .score-bar,
  .cycle-form,
  .state-unavailable {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .ops-sidebar {
    border-right: 0 !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    padding: 14px 14px 12px !important;
  }

  .ops-workspace {
    padding: 16px 12px 28px !important;
  }

  .ops-content-grid {
    display: block !important;
  }

  /* --- C) Sidebar: navegação em grade 2 colunas (evita nowrap inflando) --- */
  .ops-sidebar small {
    margin: 14px 4px 6px !important;
    letter-spacing: 0.08em !important;
  }

  .ops-sidebar nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .ops-sidebar .nav {
    display: flex !important;
    flex: initial !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    font-size: 0.82rem !important;
    gap: 6px !important;
  }

  .ops-sidebar .nav > span:first-child {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .ops-sidebar .nav-count {
    flex: 0 0 auto !important;
  }

  .ops-source-menu {
    min-width: 0 !important;
  }

  .ops-source-menu summary {
    min-width: 0 !important;
    white-space: normal !important;
  }

  /* --- D) Tabs com rolagem horizontal por toque --- */
  .ops-tabs {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    margin-bottom: 18px !important;
  }

  .ops-tabs > * {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  /* --- E) Tabela: rolagem horizontal contida (não empurra o documento) --- */
  .ops-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    border-radius: var(--radius-sm) !important;
  }

  .ops-table {
    width: auto !important;
    min-width: 560px !important;
    font-size: 0.86rem !important;
  }

  .ops-table th,
  .ops-table td {
    padding: 10px !important;
  }

  /* --- F) Filtros e paginação empilhados --- */
  .ops-filterbar {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .ops-filterbar input,
  .ops-filterbar select {
    width: 100% !important;
    min-height: 44px !important;
  }

  .ops-pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px 12px !important;
    text-align: center !important;
  }

  .ops-pagination a,
  .ops-pagination span {
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  /* --- G) Header e CTA full-width --- */
  .site-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .site-header-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .site-header-nav {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .site-status {
    text-align: center !important;
  }

  .header-nav-btn,
  .ops-button {
    width: 100% !important;
    min-height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* --- H) Blocos de classificação e resumo --- */
  .classification-header-flex {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .dual-score-grid,
  .class-lanes,
  .promotion-summary-metrics-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hud-metrics-grid,
  .landing-action-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hero-preview-hud,
  .hero-copy {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .rank-rain {
    display: none !important;
  }
}

/* --- Telas muito pequenas (<= 420px): aperta espaçamento e quebra 1 coluna --- */
@media (max-width: 420px) {
  .ops-sidebar nav {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ops-workspace {
    padding: 14px 10px 26px !important;
  }

  .ops-sidebar {
    padding: 12px 10px !important;
  }

  .page-title h1,
  .ops-headline h1 {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
  }

  .metric-value,
  .kpi-val {
    font-size: 1.7rem !important;
  }

  .ops-table {
    min-width: 520px !important;
  }
}

/* ==========================================================================
   CORREÇÕES DE A11Y ACHADAS PELO BOT-QA (2026-09-24)
   - Tabela/tabs com rolagem horizontal não tinham affordance nem eram
     alcançáveis por teclado. Agora têm sombra de rolagem e foco visível.
   - Paginação estava com 40px, abaixo do alvo de toque de 44px.
   ========================================================================== */

/* Sombra de rolagem: sinaliza que há mais conteúdo à direita. */
.ops-tabs,
.ops-table-wrap {
  background-image:
    linear-gradient(to right, var(--bg-base, #070d0a) 30%, rgba(7, 13, 10, 0)),
    linear-gradient(to left, var(--bg-base, #070d0a) 30%, rgba(7, 13, 10, 0)),
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.45), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.45), transparent);
  background-repeat: no-repeat;
  background-size: 34px 100%, 34px 100%, 12px 100%, 12px 100%;
  background-position: left center, right center, left center, right center;
  background-attachment: local, local, scroll, scroll;
}

/* Foco visível obrigatório para o contêiner rolável alcançado por teclado. */
.ops-tabs:focus-visible,
.ops-table-wrap:focus-visible {
  outline: 3px solid var(--gold, #d4af37);
  outline-offset: 2px;
  border-radius: var(--radius-sm, 8px);
}

/* Alvo de toque mínimo de 44px na paginação (era 40px). */
.ops-pagination a,
.ops-pagination span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* `summary` de detalhes precisa ser um alvo de toque real no mobile. */
@media (max-width: 768px) {
  .ops-source-menu summary,
  .faq-question,
  .detail-panel summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 12px 14px;
  }
}

/* Restricted UX shell v1 — identity, source health and next actions. */
.restricted-identity,
.restricted-source-summary,
.restricted-priority-actions,
.restricted-empty-state {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(17,31,25,.96), rgba(10,20,15,.92));
  box-shadow: 0 14px 40px rgba(0,0,0,.16);
}

.restricted-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.restricted-identity-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #1b1400;
  background: var(--gold-gradient);
  font-size: 1.35rem;
  font-weight: 900;
}
.restricted-eyebrow {
  margin: 0 0 4px;
  color: var(--ink-muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.restricted-identity h2,
.restricted-source-summary h2,
.restricted-priority-actions h2,
.restricted-empty-state h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.12rem;
}
.restricted-cycle,
.restricted-source-note,
.restricted-action small,
.restricted-empty-state p {
  margin: 5px 0 0;
  color: var(--ink-secondary);
  font-size: .82rem;
}
.restricted-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.restricted-status--active { color: var(--green-ok); background: var(--green-glow); }
.restricted-status--pending { color: var(--amber-warn); background: var(--amber-glow); }
.restricted-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.restricted-source-summary,
.restricted-priority-actions { padding: 18px 20px; margin: 18px 0; }
.restricted-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.restricted-total { color: var(--ink-muted); font-size: .78rem; }
.restricted-source-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0; list-style: none; }
.restricted-source { min-width: 0; padding: 11px 10px; border: 1px solid var(--border-subtle); border-radius: 12px; }
.restricted-source-name { display: block; overflow-wrap: anywhere; color: var(--ink-secondary); font-size: .72rem; font-weight: 800; }
.restricted-source strong { display: block; margin-top: 5px; color: var(--ink); font-size: 1.25rem; }
.restricted-source--empty { opacity: .62; }
.restricted-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.restricted-action { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 62px; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 13px; color: var(--ink); text-decoration: none; background: rgba(255,255,255,.03); }
.restricted-action:hover, .restricted-action:focus-visible { border-color: var(--gold); background: rgba(212,175,55,.08); }
.restricted-action--primary { border-color: rgba(212,175,55,.42); }
.restricted-action-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; color: var(--gold); background: var(--gold-glow); font-size: 1.15rem; }
.restricted-action strong, .restricted-action small { display: block; }
.restricted-empty-state { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; margin: 18px 0; border-color: var(--amber-border); }
.restricted-empty-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; color: var(--amber-warn); background: var(--amber-glow); font-size: 1.4rem; }

@media (max-width: 700px) {
  .restricted-identity { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .restricted-status { grid-column: 2; justify-self: start; }
  .restricted-source-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .restricted-identity, .restricted-source-summary, .restricted-priority-actions, .restricted-empty-state { padding: 14px; border-radius: 15px; }
  .restricted-source-grid, .restricted-action-grid { grid-template-columns: minmax(0, 1fr); }
  .restricted-action { min-height: 58px; }
}



/* ==========================================================================
   SCORING ACTS AUDIT & BCG/DOE VERIFICATION (DECRETO 31.804 / EXCEL PRAÇAS)
   ========================================================================== */
.scoring-audit-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 18px;
  margin-bottom: 24px;
}

.scoring-alert-critical {
  border: 1px solid var(--amber-border);
  border-left: 6px solid var(--amber-warn);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(239, 68, 68, 0.06) 100%);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.scoring-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.scoring-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scoring-alert-points {
  font-size: 0.9rem;
  font-weight: 900;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.18);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.scoring-alert-title {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 12px;
}

.scoring-alert-desc {
  color: var(--ink-secondary);
  font-size: 0.94rem;
  line-height: 1.55;
  margin-bottom: 14px;
}

.scoring-legal-quote {
  background: rgba(0, 0, 0, 0.4);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.scoring-legal-quote p {
  margin: 4px 0;
}

.scoring-legal-quote strong {
  color: var(--gold);
}

.scoring-alert-instructions {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.scoring-alert-instructions strong {
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

.scoring-alert-instructions p {
  margin: 0;
}

.scoring-alert-success {
  border: 1px solid var(--green-border);
  border-left: 6px solid var(--green-ok);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.scoring-success-title {
  color: var(--green-ok);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.scoring-alert-neutral {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  background: var(--bg-card);
}

.scoring-section-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  margin-top: 14px;
  margin-bottom: 4px;
}

.scoring-section-subtitle {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-bottom: 18px;
}

.scoring-card {
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.scoring-card-pending {
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.scoring-card-pending:hover {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.12);
}

.scoring-card-guaranteed {
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.scoring-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.scoring-card-category-block {
  flex: 1;
}

.scoring-topic-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber-warn);
  margin-bottom: 4px;
}

.topic-guaranteed {
  color: var(--green-ok);
}

.scoring-ref-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
  margin: 3px 0 6px;
}

.scoring-art-basis {
  display: block;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.scoring-points-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  min-width: 95px;
  text-align: center;
}

.points-pending {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.points-guaranteed {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.points-val {
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.points-lbl {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}

.scoring-status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
}

.status-perda {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.status-garantido {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.scoring-crosscheck-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
}

.crosscheck-item {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: baseline;
}

.crosscheck-label {
  color: var(--ink-muted);
}

.crosscheck-val {
  color: var(--ink);
}

.scoring-evidences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.evidence-doc-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.evidence-bcg {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.03);
}

.evidence-doe {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.03);
}

.evidence-bi-ok {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.03);
}

.evidence-bi-missing {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.05);
}

.evidence-doc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--ink);
}

.evidence-doc-meta {
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.evidence-doc-action {
  margin-top: 6px;
}

.btn-pdf-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
}

.btn-doe {
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%) !important;
  color: #fff !important;
}

.btn-bi {
  background: rgba(16, 185, 129, 0.15) !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  color: #34d399 !important;
}

.bi-missing-desc {
  font-size: 0.84rem;
  color: #f87171;
  line-height: 1.45;
  margin: 0;
}

.scoring-summary-excerpt {
  font-size: 0.85rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  line-height: 1.45;
}

.ops-technical-details {
  margin-top: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.2);
}

.ops-technical-details summary {
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.ops-technical-details summary:hover {
  color: var(--ink);
}

@media (max-width: 600px) {
  .scoring-card-top {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .scoring-points-badge {
    align-self: flex-start;
  }
  .scoring-evidences-grid {
    grid-template-columns: 1fr;
  }
}


/* Hero VER MINHA PROMOÇÃO */
.hero-ver-minha-promocao {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid var(--gold-glow);
  border-left: 6px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 22px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.hero-promo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-promo-info {
  flex: 1;
  min-width: 280px;
}

.hero-promo-kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.hero-promo-title {
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.25;
  margin: 0 0 10px;
}

.hero-promo-desc {
  color: var(--ink-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
}

.hero-promo-status-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.hero-promo-badge {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.btn-hero-ver-promocao {
  font-size: 0.95rem;
  font-weight: 800;
  padding: 12px 22px;
  background: var(--gold-gradient) !important;
  color: #1b1400 !important;
  border: none !important;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: 0 4px 20px var(--gold-glow);
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-hero-ver-promocao:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

/* Copy actions */
.evidence-copy-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn-copy-evidence {
  background: rgba(212, 175, 55, 0.15) !important;
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  color: #f3d069 !important;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.btn-copy-evidence:hover {
  background: rgba(212, 175, 55, 0.28) !important;
  border-color: #f3d069 !important;
}

.btn-copy-link {
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.btn-copy-link:hover {
  background: rgba(56, 189, 248, 0.25) !important;
}

.btn-copied {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
}

.evidence-doc-url {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-muted);
  word-break: break-all;
  margin-top: 4px;
}

.evidence-doc-url a {
  color: var(--blue-tech);
  text-decoration: underline;
}

.evidence-doc-page {
  display: block;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.evidence-doc-page strong {
  color: var(--gold);
}

@media (max-width: 768px) {
  .hero-promo-top {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-promo-status-box {
    align-items: stretch;
  }
  .btn-hero-ver-promocao {
    text-align: center;
  }
}

/* ==========================================================================
   MOBILE / RESPONSIVIDADE — BCG DIÁRIO v11 (2026-09-26)
   Auditoria medida com Chromium headless em 320 / 360 / 390 / 430 px.
   Correções: alvos de toque >= 44px, fontes >= 16px (anti-zoom iOS),
   área segura de entalhe, densidade vertical e formulários de cadastro.
   ========================================================================== */

/* Base: respeita área segura (notch) e evita zoom automático do iOS. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* --------------------------------------------------------------------------
   1. FORMULÁRIOS DE CADASTRO E LOGIN (desktop + mobile)
   -------------------------------------------------------------------------- */

/* Container do formulário de cadastro: antes ficava sem moldura nenhuma. */
form#cadastro-form,
form[action="/cadastro"] {
  max-width: 620px;
  margin: 0 auto;
  padding: 4px 20px 44px;
}

.form-hint {
  display: block;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-muted);
  margin: 6px 0 14px;
}

.form-intro {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

/* Checkbox de consentimento com rótulo clicável e alvo confortável. */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0 0;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.consent-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-secondary);
  margin: 0;
  cursor: pointer;
}

/* Aviso de dados públicos. */
.notice,
.public-data-notice {
  display: block;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-secondary);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 18px 0 0;
}

/* Botão de mostrar/ocultar senha: era apenas um texto de 20px de altura. */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 92px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 44px;
  min-width: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--gold);
  border-color: var(--border-focus);
  background: var(--gold-glow);
}

/* --------------------------------------------------------------------------
   2. MOBILE (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* --- 2.1 Alvos de toque: mínimo 44px (WCAG 2.5.8 / Apple HIG) --- */
  input[type="text"],
  input[type="tel"],
  input[type="password"],
  input[type="email"],
  input[type="date"],
  input[type="number"],
  select,
  textarea {
    min-height: 46px;
    /* 16px evita o zoom automático do Safari iOS ao focar o campo. */
    font-size: 16px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
  }

  select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%239cb5a8'%3E%3Cpath d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 38px;
  }

  button,
  button[type="submit"],
  .ops-button,
  .ops-tab,
  .btn-pdf-view,
  .btn-copy-evidence,
  .btn-copy-link,
  .btn-hero-ver-promocao,
  .pdf-link,
  .ops-page-link,
  .landing-recovery-link,
  .password-toggle,
  .ops-sidebar .nav,
  .ops-source-menu summary,
  .detail-panel summary,
  .ops-technical-details summary {
    min-height: 44px;
  }

  /* Links inline de texto puro ganham área vertical sem virar bloco. */
  a.pdf-link,
  a.landing-recovery-link,
  a.ops-page-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
  }

  /* --- 2.2 Barra de navegação e cabeçalho --- */
  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 14px 12px;
  }

  .ops-logo,
  .brand {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .site-header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .skip-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* --- 2.3 Formulários --- */
  .page-title {
    padding: 20px 14px 8px;
    text-align: left;
  }

  .page-title h1 {
    font-size: clamp(1.28rem, 5.2vw, 1.6rem);
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  form#cadastro-form,
  form[action="/cadastro"] {
    padding: 0 14px 34px;
  }

  .landing-login-box {
    margin: 16px 12px;
    padding: 24px 18px;
    max-width: 100%;
    border-radius: var(--radius-md);
  }

  label {
    font-size: 0.84rem;
    margin: 16px 0 6px;
  }

  .form-hint {
    font-size: 0.76rem;
    margin: 5px 0 12px;
  }

  .notice,
  .public-data-notice {
    font-size: 0.78rem;
    padding: 11px 13px;
  }

  .consent-label {
    font-size: 0.8rem;
  }

  /* CTA principal sempre alcançável com o polegar. */
  button[type="submit"] {
    min-height: 52px;
    font-size: 1.02rem;
    margin-top: 22px;
    position: sticky;
    bottom: 12px;
    z-index: 5;
  }

  /* --- 2.4 Tabelas: rolagem horizontal isolada (nunca estoura a página) --- */
  .ops-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
  }

  .ops-table {
    min-width: 520px;
  }

  /* --- 2.5 Trilhas de evidência e dossiê --- */
  .scoring-evidences-grid {
    grid-template-columns: 1fr;
  }

  .evidence-copy-actions {
    flex-direction: column;
  }

  .evidence-copy-actions .ops-button {
    width: 100%;
  }

  .hero-promo-top {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  .hero-promo-status-box {
    align-items: stretch;
  }

  .btn-hero-ver-promocao {
    justify-content: center;
    text-align: center;
  }

  .hero-promo-title {
    font-size: 1.35rem;
  }

  /* --- 2.6 Densidade vertical --- */
  .ops-workspace {
    padding: 18px 14px 30px;
  }

  .ops-panel,
  .scoring-card,
  .hero-ver-minha-promocao {
    padding: 18px 16px;
  }

  .restricted-identity,
  .restricted-source-summary,
  .restricted-priority-actions,
  .restricted-empty-state {
    padding: 16px 14px;
  }

  .ops-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  /* --- 2.7 Página inicial --- */
  .hero-copy {
    padding: 26px 16px 32px;
  }

  .landing-action-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 22px 0 32px;
    padding: 0 14px;
  }

  .action-card {
    padding: 22px 18px;
  }

  .faq-section {
    padding: 0 14px;
  }
}

/* --------------------------------------------------------------------------
   3. TELAS ESTREITAS (<= 420px)
   -------------------------------------------------------------------------- */
@media (max-width: 420px) {
  .page-title h1 {
    font-size: 1.2rem;
  }

  .landing-login-box {
    margin: 12px 8px;
    padding: 20px 14px;
  }

  form#cadastro-form,
  form[action="/cadastro"] {
    padding: 0 10px 30px;
  }

  .hero-copy h1 {
    font-size: 1.4rem;
  }

  .action-card {
    padding: 18px 15px;
  }

  .password-field input {
    padding-right: 84px;
  }

  .password-toggle {
    min-width: 78px;
    font-size: 0.84rem;
  }

  .scoring-card,
  .ops-panel {
    padding: 16px 13px;
  }
}

/* --------------------------------------------------------------------------
   4. PREFERÊNCIAS DO USUÁRIO
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   5. REFINAMENTO DE ALVOS DE TOQUE E LEGIBILIDADE (v12)
   Defeitos medidos com Chromium headless em 390px:
     - .ops-filterbar #ops-search / #ops-period com font-size 14.4px  -> zoom iOS
     - .evidence-doc-url a com 12.48px e 35px de altura              -> alvo pequeno
     - summary "Histórico" com 26px de altura                        -> alvo pequeno
     - links soltos de login/landing com 16px de altura              -> alvo pequeno
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {

  /* Filtros da ficha: 16px evita o zoom automático do Safari iOS. */
  .ops-filterbar input,
  .ops-filterbar select,
  #ops-search,
  #ops-period {
    font-size: 16px !important;
    min-height: 46px;
  }

  /* Qualquer <summary> de painel retrátil vira alvo de toque real. */
  details > summary,
  summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 11px 12px;
    cursor: pointer;
  }

  /* URL de evidência: legível e tocável (antes 12.48px / 35px). */
  .evidence-doc-url {
    font-size: 0.86rem;
    line-height: 1.5;
  }

  .evidence-doc-url a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 0;
    font-size: 0.84rem;
  }

  /* Links soltos em parágrafo próprio viram alvos de toque confortáveis. */
  p.login-recovery-link > a,
  p.login-no-account > a,
  .login-recovery-link a,
  .login-no-account a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 0;
    font-size: 0.88rem;
  }

  /* Links inline dentro de texto corrido: área vertical extra sem quebrar
     o fluxo do parágrafo. */
  main p > a:only-of-type,
  .hero-copy p > a,
  .faq-answer a {
    padding-top: 8px;
    padding-bottom: 8px;
    display: inline-block;
  }
}

/* --------------------------------------------------------------------------
   6. AJUSTES FINAIS DE ALVO DE TOQUE (v13)
   Medições residuais em 320/360/390/430px:
     - a.ops-page-link "Próxima →"  42px -> 44px
     - a "Voltar ao login"          38px -> 44px
     - input[type=checkbox]#consent 22px -> 24px + área clicável de 44px
     - link inline de landing       39px -> 44px
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Paginação da ficha: o min-height precisa vencer o padding do seletor de tag. */
  a.ops-page-link,
  .ops-pagination a.ops-page-link,
  a.ops-page-link:link,
  a.ops-page-link:visited {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 44px !important;
    padding: 10px 12px;
  }

  /* "Voltar ao login" e demais links de retorno em parágrafo próprio. */
  p.recovery-back-link > a,
  .recovery-back-link a,
  a.recovery-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 0;
  }

  /* Checkbox de consentimento: caixa maior e rótulo inteiro clicável. */
  .consent input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin-top: 0;
  }

  .consent {
    align-items: center;
    min-height: 44px;
    padding: 14px 12px;
  }

  /* Link inline da landing dentro do parágrafo de instrução. */
  main p a[href="/login/recovery"],
  .hero-copy p a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
    vertical-align: middle;
  }
}

/* Aviso de sessão expirada na tela de login (explica o redirecionamento
   em vez de parecer que a ficha "saiu do ar"). */
.login-session-notice {
  display: block;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-secondary);
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-left: 3px solid var(--blue-tech);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 16px;
}

.login-session-notice::before {
  content: "ℹ️ ";
}

@media (max-width: 768px) {
  .login-session-notice {
    font-size: 0.8rem;
    padding: 11px 12px;
    margin-bottom: 14px;
  }
}

/* Legenda das colunas de concorrência: explica que antiguidade e merecimento
   são listas independentes, reduzindo falsos alarmes de "não concorre". */
.competition-legend {
  margin: 10px 2px 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

@media (max-width: 768px) {
  .competition-legend {
    font-size: 0.75rem;
  }
}
