:root {
  /* Escala fluida maior (legibilidade mobile + desktop) */
  --fs-base: clamp(17px, 0.55vw + 15.5px, 20px);
  --ui-scale: 1.08;
  --bg: #06121f;
  --bg-2: #0c1f36;
  --bg-card: rgba(12, 36, 58, 0.78);
  --line: rgba(212, 178, 112, 0.18);
  --ink: #f4f1e8;
  --ink-soft: #c2bdb0;
  --ink-faint: #8a8476;
  --teal: #14b8a6;
  --teal-hot: #2dd4bf;
  --cyan: #38bdf8;
  --gold: #d4a843;
  --gold-hot: #f0c14b;
  --purple: #c084fc;
  --red: #ff4d6d;
  --green: #22c55e;
  --wa: #25d366;
  --radius: 16px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --glow-teal: 0 0 40px rgba(20, 184, 166, 0.35);
  --glow-gold: 0 0 36px rgba(212, 168, 67, 0.28);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --a11y-h: 2.6rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  min-height: 100%;
  font-size: calc(var(--fs-base) * var(--ui-scale));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.55;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 8% -5%, rgba(20, 184, 166, 0.22), transparent 55%),
    radial-gradient(ellipse 800px 480px at 100% 0%, rgba(56, 189, 248, 0.16), transparent 50%),
    radial-gradient(ellipse 700px 400px at 50% 100%, rgba(212, 168, 67, 0.1), transparent 55%),
    linear-gradient(180deg, #06121f 0%, #0a1b2e 50%, #071525 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: calc(var(--a11y-h) + var(--safe-top));
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img, svg, video { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; max-width: 100%; }
input, select, textarea, button { touch-action: manipulation; }

/* ===== Barra A+/A− / ajuste de tela ===== */
.a11y-bar {
  position: fixed;
  top: var(--safe-top);
  right: max(0.5rem, var(--safe-right));
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.4rem;
  background: rgba(6, 18, 31, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.a11y-btn {
  min-width: 2.2rem;
  min-height: 2.2rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 184, 166, 0.12);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
}
.a11y-btn:hover, .a11y-btn:focus-visible {
  border-color: var(--teal);
  color: var(--teal-hot);
  outline: none;
}
.a11y-btn--mid { font-size: 1.05rem; }
.a11y-btn--fit {
  font-size: 0.72rem;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  min-width: auto;
  padding: 0.35rem 0.7rem;
}
@media (max-width: 420px) {
  .a11y-btn--fit { font-size: 0.65rem; padding: 0.3rem 0.5rem; }
}
a { color: var(--teal-hot); text-decoration: none; }
a:hover { color: var(--gold-hot); }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }

/* Ambient hero wash behind app */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    url("../assets/hero-portal.jpg") center top / cover no-repeat;
  opacity: 0.14;
  filter: saturate(1.35) contrast(1.05);
  pointer-events: none;
}

.app-shell {
  max-width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0.85rem clamp(0.75rem, 3vw, 1.25rem) 3rem;
  position: relative;
  width: 100%;
}

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 0 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(145deg, var(--teal), var(--cyan));
  display: grid; place-items: center; font-weight: 700; color: #041018; font-size: .9rem;
  box-shadow: var(--glow-teal);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(212, 168, 67, 0.45);
}
.brand-mark img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.brand h1 { font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; }
.brand span {
  display: block; font-size: .7rem; color: var(--ink-faint);
  font-family: var(--mono); letter-spacing: .07em; text-transform: uppercase;
}
.user-chip {
  display: flex; align-items: center; gap: .5rem .65rem; flex-wrap: wrap;
  font-size: .88rem; color: var(--ink-soft);
  max-width: 100%;
}
.user-chip__text { min-width: 0; max-width: min(220px, 48vw); }
.chip-email {
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .22rem .6rem; border-radius: 999px; border: 1px solid var(--line);
}
.badge.admin { color: var(--gold-hot); border-color: rgba(240, 193, 75, 0.5); background: rgba(212, 168, 67, 0.12); box-shadow: var(--glow-gold); }
.badge.equipe { color: var(--cyan); border-color: rgba(56, 189, 248, 0.45); background: rgba(56, 189, 248, 0.1); }
.badge.cliente { color: var(--teal-hot); border-color: rgba(45, 212, 191, 0.45); background: rgba(20, 184, 166, 0.12); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.45rem;
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), var(--gold), var(--cyan), transparent);
  opacity: 0.85;
}
.card h2 {
  font-family: var(--serif); font-weight: 400; font-size: 1.55rem; margin-bottom: .35rem;
  color: var(--ink);
}
.card h2 em,
.dash-banner__text h2 em {
  font-style: italic;
  color: var(--teal-hot);
}
.card .lead { color: var(--ink-soft); font-size: .92rem; margin-bottom: 1.2rem; }

/* ========== AUTH — split visual ========== */
.auth-wrap {
  min-height: calc(100dvh - var(--a11y-h) - var(--safe-top));
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 0;
  padding: 0;
  width: 100%;
}
@media (max-width: 960px) {
  .auth-wrap {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .auth-visual {
    min-height: min(32vh, 220px);
    max-height: min(38vh, 260px);
  }
  .auth-visual__content h2 { font-size: clamp(1.35rem, 5.5vw, 1.9rem); }
  .auth-visual__content p { font-size: 0.88rem; margin-bottom: 0.75rem; }
  .auth-modules { gap: 0.4rem; }
  .auth-panel {
    padding: 1rem 0.85rem 2rem;
    align-items: flex-start;
  }
  .auth-card { width: 100%; max-width: 100%; }
}

.auth-visual {
  position: relative;
  overflow: hidden;
  background: #041018;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1rem, 3vw, 2rem);
  min-height: min(100%, 100dvh);
}
.auth-visual__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.4) contrast(1.08) brightness(0.92);
  transform: scale(1.03);
}
.auth-visual__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 18, 31, 0.25) 0%, rgba(6, 18, 31, 0.55) 45%, rgba(6, 18, 31, 0.92) 100%),
    radial-gradient(ellipse at 30% 20%, rgba(20, 184, 166, 0.25), transparent 50%);
  pointer-events: none;
}
.auth-visual__content {
  position: relative;
  z-index: 2;
  max-width: 480px;
}
.auth-visual__content h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: .75rem;
  color: #fff;
}
.auth-visual__content h2 em {
  font-style: italic;
  background: linear-gradient(90deg, var(--teal-hot), var(--gold-hot));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-visual__content p {
  color: rgba(240, 237, 229, 0.82);
  font-size: .98rem;
  margin-bottom: 1.25rem;
  max-width: 42ch;
}
.auth-modules {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .55rem;
}
@media (max-width: 960px) {
  .auth-modules { grid-template-columns: repeat(4, 1fr); }
}
.auth-mod {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(212, 168, 67, 0.25);
  aspect-ratio: 1;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.auth-mod:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--glow-teal);
}
.auth-mod img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.auth-mod span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: .35rem .4rem;
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 1.5rem 1.25rem;
  background:
    radial-gradient(ellipse 400px 280px at 80% 10%, rgba(20, 184, 166, 0.12), transparent),
    radial-gradient(ellipse 360px 240px at 20% 90%, rgba(212, 168, 67, 0.08), transparent),
    linear-gradient(160deg, #0a1b2e 0%, #06121f 100%);
}
.auth-card {
  width: min(440px, 100%);
  border-color: rgba(20, 184, 166, 0.28) !important;
  box-shadow: var(--glow-teal), 0 20px 50px rgba(0, 0, 0, 0.4) !important;
}
.auth-logo-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.15rem;
  gap: .65rem;
}
.auth-logo-row .brand-mark {
  width: 72px; height: 72px; border-radius: 20px;
  box-shadow: var(--glow-teal), var(--glow-gold);
}
.auth-logo-row h1 {
  font-size: 1.25rem;
  font-weight: 600;
}
.auth-logo-row .tag {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal-hot);
}

/* Dashboard banner */
.dash-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  min-height: 150px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}
.dash-banner img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.35) brightness(0.75);
}
.dash-banner__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(6, 18, 31, 0.92) 0%, rgba(6, 18, 31, 0.55) 55%, rgba(6, 18, 31, 0.35) 100%);
}
.dash-banner__text {
  position: relative;
  z-index: 2;
  padding: 1.4rem 1.5rem;
  max-width: 560px;
}
.dash-banner__text h2 {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 400;
  color: #fff;
  margin-bottom: .35rem;
}
.dash-banner__text h2 em {
  font-style: italic;
  color: var(--teal-hot);
}
.dash-banner__text p {
  color: rgba(240, 237, 229, 0.8);
  font-size: .9rem;
}

/* Feature modules strip */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 800px) {
  .feature-strip { grid-template-columns: repeat(2, 1fr); }
}
.feature-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(10, 27, 46, 0.65);
  cursor: default;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(20, 184, 166, 0.5);
  box-shadow: var(--glow-teal);
}
.feature-card__img {
  height: 100px;
  overflow: hidden;
  position: relative;
}
.feature-card__img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.3);
  transition: transform .35s ease;
}
.feature-card:hover .feature-card__img img { transform: scale(1.08); }
.feature-card__body {
  padding: .65rem .75rem .8rem;
}
.feature-card__body strong {
  display: block;
  font-size: .88rem;
  margin-bottom: .15rem;
  color: var(--ink);
}
.feature-card__body span {
  font-size: .75rem;
  color: var(--ink-faint);
  font-family: var(--mono);
  letter-spacing: .03em;
}

/* Card with side art */
.card-with-art {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 560px) {
  .card-with-art { grid-template-columns: 1fr; }
}
.card-art {
  width: 100px;
  height: 100px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(212, 168, 67, 0.3);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.card-art img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.25);
}
.card-art--lg {
  width: 120px; height: 120px;
}

.form-group { margin-bottom: .9rem; }
.form-group label {
  display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: .35rem;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .75rem .9rem; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(6, 18, 31, 0.85); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2), var(--glow-teal);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: none; border-radius: 12px; padding: .78rem 1.15rem; font-weight: 600;
  cursor: pointer; transition: .15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal) 0%, #0d9488 50%, var(--cyan) 160%);
  color: #041018;
  width: 100%;
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.35);
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--glow-teal);
}
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: transparent; color: var(--ink-soft); border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--teal);
  color: var(--teal-hot);
  box-shadow: 0 0 16px rgba(20, 184, 166, 0.2);
}
.btn-sm { padding: .4rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-danger {
  background: rgba(255, 77, 109, 0.12);
  color: var(--red);
  border: 1px solid rgba(255, 77, 109, 0.35);
}

.tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
  margin-bottom: 1.1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.35rem;
  max-width: 100%;
}
.tab {
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 27, 46, 0.5);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.85rem;
  transition: .15s ease;
  white-space: nowrap;
  flex: 0 0 auto;
  min-height: 2.5rem;
}
.tab:hover { border-color: rgba(20, 184, 166, 0.4); color: var(--ink); }
.tab.active {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.25), rgba(56, 189, 248, 0.15));
  color: var(--teal-hot);
  border-color: rgba(20, 184, 166, 0.55);
  box-shadow: 0 0 18px rgba(20, 184, 166, 0.2);
}

.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1rem; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.panel-title {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .75rem;
}

.process-item, .msg-item, .user-item {
  border: 1px solid var(--line); border-radius: 12px; padding: .85rem 1rem; margin-bottom: .55rem;
  background: rgba(6, 18, 31, 0.55);
  transition: border-color .15s, box-shadow .15s;
}
.process-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.12);
}
.process-item .cnj { font-family: var(--mono); color: var(--cyan); font-size: .9rem; font-weight: 600; }
.process-item .meta { font-size: .8rem; color: var(--ink-soft); margin-top: .25rem; }
.process-item .actions { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }

.timeline { margin-top: .8rem; padding-left: 1rem; border-left: 2px solid rgba(20, 184, 166, 0.35); }
.timeline-item { margin-bottom: .8rem; padding-left: .4rem; }
.timeline-item .src {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
  display: inline-block; padding: .12rem .45rem; border-radius: 4px; margin-bottom: .2rem;
}
.src-datajud { background: rgba(56, 189, 248, 0.18); color: var(--cyan); box-shadow: 0 0 10px rgba(56, 189, 248, 0.2); }
.src-djen { background: rgba(192, 132, 252, 0.18); color: var(--purple); box-shadow: 0 0 10px rgba(192, 132, 252, 0.2); }
.timeline-item .when { font-family: var(--mono); font-size: .75rem; color: var(--teal-hot); }
.timeline-item .what { font-size: .88rem; color: var(--ink-soft); margin-top: .1rem; }
.timeline-item .txt {
  margin-top: .4rem; font-size: .82rem; color: var(--ink-soft); white-space: pre-wrap;
  background: rgba(6, 18, 31, 0.7); border-left: 3px solid var(--purple);
  padding: .55rem .7rem; border-radius: 8px;
}

.alert {
  padding: .75rem 1rem; border-radius: 12px; font-size: .88rem; margin-bottom: 1rem;
  border: 1px solid var(--line);
}
.alert-info { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.3); color: var(--ink-soft); }
.alert-warn { background: rgba(212, 168, 67, 0.1); border-color: rgba(212, 168, 67, 0.35); color: var(--gold-hot); }
.alert-error { background: rgba(255, 77, 109, 0.1); border-color: rgba(255, 77, 109, 0.35); color: var(--red); }
.alert-ok { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.35); color: var(--green); }

/* WhatsApp SaaS — status + tenant chips */
.wa-meta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .55rem;
}
.wa-state-badge {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  padding: .28rem .7rem; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(6, 18, 31, 0.65); color: var(--ink-soft); white-space: nowrap;
}
.wa-state--open {
  color: #86efac; border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.14); box-shadow: 0 0 16px rgba(34, 197, 94, 0.22);
}
.wa-state--connecting {
  color: var(--gold-hot); border-color: rgba(240, 193, 75, 0.5);
  background: rgba(212, 168, 67, 0.12); box-shadow: 0 0 14px rgba(212, 168, 67, 0.18);
}
.wa-state--close,
.wa-state--off {
  color: var(--ink-faint); border-color: rgba(138, 132, 118, 0.45);
  background: rgba(6, 18, 31, 0.7);
}
.wa-state--error {
  color: #fda4af; border-color: rgba(255, 77, 109, 0.5);
  background: rgba(255, 77, 109, 0.12);
}
.wa-state--unknown {
  color: var(--cyan); border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.1);
}
.wa-meta-chip {
  display: inline-flex; align-items: baseline; gap: .35rem;
  font-size: .78rem; color: var(--ink-soft);
  padding: .28rem .65rem; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(6, 18, 31, 0.55);
  max-width: 100%;
}
.wa-meta-chip .wa-meta-k {
  font-family: var(--mono); font-size: .62rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-faint);
}
.wa-meta-chip code,
.wa-meta-chip strong {
  font-size: .78rem; color: var(--teal-hot); word-break: break-all;
}
.wa-meta-chip code { font-family: var(--mono); color: var(--cyan); }
.wa-qr-wrap {
  text-align: center; margin: 1rem 0; padding: 1rem;
  border: 1px dashed var(--line); border-radius: 14px;
  background: rgba(6, 18, 31, 0.5);
}
.wa-qr-img {
  max-width: 280px; width: 100%; border-radius: 12px;
  background: #fff; padding: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), var(--glow-teal);
}
.wa-actions .btn:disabled { opacity: .55; cursor: wait; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
@media (max-width: 640px) { .stat-row { grid-template-columns: 1fr; } }
.stat {
  background: linear-gradient(145deg, rgba(12, 36, 58, 0.9), rgba(6, 18, 31, 0.9));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -10px; top: -10px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.25), transparent 70%);
}
.stat .n {
  font-size: 1.65rem; font-weight: 700;
  background: linear-gradient(120deg, var(--teal-hot), var(--gold-hot));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .l {
  font-size: .72rem; color: var(--ink-faint); font-family: var(--mono);
  text-transform: uppercase; letter-spacing: .05em;
}

.qr-box { text-align: center; margin: 1rem 0; }
.qr-box img { max-width: 200px; border-radius: 12px; background: #fff; padding: 8px; box-shadow: var(--glow-teal); }
.secret-code {
  font-family: var(--mono); font-size: .85rem; word-break: break-all;
  background: rgba(6, 18, 31, 0.85); padding: .6rem; border-radius: 8px;
  border: 1px dashed rgba(212, 168, 67, 0.4);
}

.footer-mini {
  margin-top: 2rem; text-align: center; font-size: .75rem; color: var(--ink-faint);
  font-family: var(--mono);
}
.empty { color: var(--ink-faint); font-size: .9rem; padding: 1rem 0; }
.loading { color: var(--ink-soft); font-size: .9rem; padding: 1rem 0; }
.switch-auth { text-align: center; margin-top: 1rem; font-size: .88rem; color: var(--ink-soft); }
.switch-auth button {
  background: none; border: none; color: var(--teal-hot); cursor: pointer; font-weight: 600;
}
.switch-auth button:hover { color: var(--gold-hot); }

.api-hint {
  text-align: center;
  font-size: .72rem;
  color: var(--ink-faint);
  font-family: var(--mono);
  margin-bottom: .75rem;
}
.api-hint code {
  color: var(--cyan);
  font-size: .7rem;
}

/* Google login */
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  width: 100%;
  padding: .85rem 1.2rem;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #1f1f1f;
  font-weight: 600;
  font-size: .96rem;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.btn-google:hover {
  box-shadow: 0 4px 18px rgba(66, 133, 244, 0.35);
  transform: translateY(-1px);
}
.btn-google:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}
.google-hint {
  text-align: center;
  font-size: .75rem;
  color: var(--ink-faint);
  margin: .65rem 0 0.4rem;
  line-height: 1.4;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.15rem 0 1rem;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.chip-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(20, 184, 166, 0.5);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.25);
}

/* ===== Auto-ajuste mobile / tablet / desktop ===== */
@media (max-width: 900px) {
  .dash-banner { min-height: 120px; }
  .dash-banner__text { padding: 1rem; }
  .feature-strip { grid-template-columns: repeat(2, 1fr); gap: 0.55rem; }
  .feature-card__img { height: 84px; }
  .card { padding: 1.05rem 1rem; }
  .card h2 { font-size: 1.25rem; }
  .btn, .btn-primary, .btn-google {
    min-height: 2.85rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    min-height: 2.85rem;
    font-size: 1rem; /* evita zoom iOS em inputs < 16px */
    padding: 0.7rem 0.85rem;
  }
  .process-item .cnj { font-size: 0.85rem; word-break: break-all; }
  .stat-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .app-shell { padding-left: 0.7rem; padding-right: 0.7rem; }
  .brand h1 { font-size: 0.95rem; }
  .brand span { font-size: 0.62rem; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .user-chip { width: 100%; justify-content: flex-start; }
  .user-chip__text { max-width: calc(100% - 7rem); }
  .feature-strip { grid-template-columns: 1fr 1fr; }
  .card-with-art {
    grid-template-columns: 1fr;
  }
  .card-art, .card-art--lg {
    width: 72px;
    height: 72px;
  }
  .auth-logo-row .brand-mark { width: 64px; height: 64px; }
  .wa-meta-row { flex-direction: column; align-items: stretch; }
  .wa-actions { flex-direction: column; }
  .wa-actions .btn { width: 100%; }
  .a11y-bar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: calc(100vw - 1rem);
  }
}

@media (min-width: 1100px) {
  .app-shell { max-width: 1240px; }
  .grid-2 { grid-template-columns: 1.25fr 0.85fr; gap: 1.15rem; }
}

/* Telas muito largas: evita “vazio” e texto minúsculo */
@media (min-width: 1600px) {
  :root { --fs-base: clamp(16px, 0.2vw + 15px, 19px); }
}

/* Preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Dashboard / cara de sistema ===== */
.sys-hero { margin-bottom: 0.25rem; }
.sys-mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}
.sys-mod {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  background: rgba(6, 18, 31, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sys-mod strong { font-size: 0.88rem; color: var(--ink); }
.sys-mod span { font-size: 0.72rem; font-family: var(--mono); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.sys-mod--on { border-color: rgba(20, 184, 166, 0.45); box-shadow: 0 0 16px rgba(20, 184, 166, 0.12); }
.sys-mod--on span { color: var(--teal-hot); }
.sys-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.sys-shortcuts .btn { width: 100%; }
.sys-source-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.sys-pill {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.sys-pill--on {
  color: var(--teal-hot);
  border-color: rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.12);
}
.stat-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 600px) {
  .sys-shortcuts { grid-template-columns: 1fr; }
}

/* ===== Ficha do processo (modal, estilo Sistema Jurídico) ===== */
.ficha-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(2, 8, 16, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: auto;
}
.ficha-modal.hidden { display: none !important; }
.ficha-modal__panel {
  width: 100%;
  min-height: 100dvh;
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(180deg, #0a1624 0%, #071018 100%);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 1rem 1.1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.ficha-modal__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}
.ficha-cnj {
  font-family: var(--mono);
  font-size: 1.15rem;
  margin: 0;
  cursor: pointer;
  color: var(--teal-hot);
  word-break: break-all;
}
.ficha-cnj:hover { text-decoration: underline; }
.ficha-meta { margin: 0.25rem 0 0; font-size: 0.88rem; }
.ficha-modal__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ficha-body { display: flex; flex-direction: column; gap: 0.9rem; }
.ficha-cliente {
  border: 1px solid rgba(255, 200, 87, 0.35) !important;
  background: linear-gradient(135deg, rgba(255, 200, 87, 0.1), rgba(255, 200, 87, 0.02)) !important;
}
.ficha-cliente .panel-title { color: #ffc857; }
.ficha-cli-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.btn-wa {
  background: linear-gradient(135deg, #1faa55, #128c3e) !important;
  color: #fff !important;
  border: none !important;
}
.btn-wa:hover { filter: brightness(1.08); }
.ficha-phone-big {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.35);
  font-size: 1.05rem;
  font-weight: 600;
}
.ficha-phone-big a {
  color: var(--teal-hot);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.ficha-phone-big a:hover { text-decoration: underline; }
.ficha-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
@media (max-width: 800px) {
  .ficha-grid { grid-template-columns: 1fr; }
  .ficha-modal__panel { border: 0; max-width: 100%; }
}
.ficha-sug {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.ficha-sug button {
  font-size: 0.78rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(6, 18, 31, 0.7);
  color: var(--ink-soft);
  cursor: pointer;
}
.ficha-sug button:hover {
  border-color: var(--teal-hot);
  color: var(--teal-hot);
}
body.ficha-open { overflow: hidden; }

/* Consentimento WA — por cima da ficha */
#modal-wa-consent { z-index: 9500; }
.wa-consent-panel {
  max-width: 560px !important;
  min-height: auto !important;
  margin: 4vh auto !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 200, 87, 0.35) !important;
  max-height: 92dvh;
  overflow: auto;
}
