/* =========================================================
   Zapflow
   - Tokens via :root e [data-theme="dark"]
   - Sem dependências externas
========================================================= */

:root {
  /* colors */
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-2: #fbfcff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.10);

  --primary: #0f766e;
  --primary-2: #0b5f59;
  --danger: #dc2626;
  --warn: #f59e0b;

  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --shadow-sm: 0 6px 18px rgba(2, 6, 23, 0.08);

  /* spacing */
  --r: 16px;
  --r-sm: 12px;
  --pad: 16px;
  --gap: 12px;

  /* sizes */
  --sidebar-w: 320px;
  --topbar-h: 56px;

  /* typography */
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --fs: 16px;

  /* motion */
  --t-fast: 150ms;
  --t: 200ms;
  --t-slow: 250ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* focus */
  --ring: 0 0 0 3px rgba(15, 118, 110, 0.25);
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --panel: #0f172a;
  --panel-2: #0b1324;
  --text: #e5e7eb;
  --muted: #9aa6b2;
  --border: rgba(226, 232, 240, 0.10);

  --primary: #2dd4bf;
  --primary-2: #22c3af;

  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 10px 22px rgba(0, 0, 0, 0.28);

  --ring: 0 0 0 3px rgba(45, 212, 191, 0.25);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs);
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% 0%, rgba(15, 118, 110, 0.08), transparent 50%),
              radial-gradient(1000px 700px at 100% 30%, rgba(99, 102, 241, 0.06), transparent 55%),
              var(--bg);
}

a { color: inherit; text-decoration: none; }
code { padding: 2px 6px; border-radius: 8px; background: rgba(148, 163, 184, 0.18); }

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  transform: translateY(-160%);
  transition: transform var(--t) var(--ease);
  z-index: 999;
}
.skip-link:focus { transform: translateY(0); outline: none; box-shadow: var(--ring); }

/* helpers */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.02em; }
.h3 { font-size: 16px; margin: 0; letter-spacing: -0.01em; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap { gap: var(--gap); }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.w-full { width: 100%; }
.stack { display: grid; gap: 12px; }
.hide-sm { display: inline; }
.show-sm { display: none; }

/* focus */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 12px;
}

/* cards */
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

/* buttons */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border-color: transparent;
  color: #fff;
}
html[data-theme="dark"] .btn-primary { color: #071a18; }
.btn-primary:hover { filter: brightness(1.02); }

.btn-secondary {
  background: rgba(148, 163, 184, 0.10);
}

.btn-ghost {
  background: transparent;
}
.btn-ghost:hover { background: rgba(148, 163, 184, 0.10); box-shadow: none; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
}

.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn[disabled]:hover { transform: none; box-shadow: none; }

/* inputs */
.field { display: grid; gap: 8px; margin-top: 12px; }
.label { font-weight: 700; font-size: 13px; color: var(--muted); }
.input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.input:focus { outline: none; box-shadow: var(--ring); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }

.input-wrap{
  position: relative;
  display: flex;
  align-items: center;
}
/* input com botão do olho */
.input-wrap .input{
  padding-right: 52px; /* espaço pro olho */
}

.input-wrap .btn-icon{
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

/* ícone dentro do input (base) */
.input-ico{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  line-height: 1;
}

/* esquerda (default) */
.input-ico--left { left: 12px; }

/* direita */
.input-ico--right { right: 12px; left: auto; }

.input-wrap--search .input{
  padding-right: 44px; /* espaço pra lupa */
}
.input-wrap--composer .input{
  padding-left: 44px;  /* espaço pro lápis */
  padding-right: 12px; /* desfaz o padding-right gigante herdado do olho */
}


.input-ico { left: 12px; }

/* quando for na direita */
.input-ico--right {
  left: auto;
  right: 12px;
}

/* input de busca no sidebar: reserva espaço pro ícone à direita */
.input-wrap--search .input {
  padding-right: 44px; /* espaço pra lupa */
}

/* (opcional) se algum dia quisermos ícone à esquerda:
.input-wrap--search .input { padding-left: 44px; }
*/

.error {
  color: var(--danger);
  font-size: 13px;
  min-height: 16px;
}

.link {
  color: var(--primary);
  font-weight: 700;
}
.link:hover { text-decoration: underline; }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-link { padding: 8px; border-radius: 14px; }
.brand-link:hover { background: rgba(148, 163, 184, 0.10); }
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 900;
}
html[data-theme="dark"] .brand-mark { color: #071a18; }
.brand-text { display: grid; line-height: 1.1; }
.brand-text strong { letter-spacing: -0.02em; }

/* auth */
.auth-shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr auto;
}
.auth-topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.auth-main {
  display: grid;
  place-items: center;
  padding: 18px;
}
.auth-card { width: min(520px, 100%); }
.auth-hero { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.logo-slot {
  width: 46px; height: 46px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border);
  font-weight: 900;
}
.or-sep {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0;
}
.or-sep::before, .or-sep::after {
  content: "";
  height: 1px;
  background: var(--border);
}
.auth-footer { padding: 14px 16px; text-align: center; }

/* app shell */
.app-shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}
.app-content { min-width: 0; }
.app-main { padding: 18px; }

/* sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 14px;
}
.sidebar-inner {
  height: calc(100vh - 28px);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 6px;
}
.sidebar-close { display: none; }

.sidebar-nav {
  display: grid;
  gap: 6px;
  padding: 6px 10px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.nav-item:hover { background: rgba(148, 163, 184, 0.10); }
.nav-item.is-active {
  background: rgba(15, 118, 110, 0.12);
  border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
}
.nav-ico { width: 20px; text-align: center; }

.sidebar-card {
  margin: 8px 10px 10px; 
  padding: 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  display: grid;
  gap: 10px;             
  align-content: start; 
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(15, 118, 110, 0.14);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  font-weight: 900;
}
.user-meta { display: grid; line-height: 1.1; }

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--border);
}

/* inbox layout */
.inbox-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  align-items: stretch;
}
.chat-list, .chat-window {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: calc(100vh - 36px);
}
.chat-list-header {
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.chat-list-body {
  padding: 10px;
  overflow: auto;
  max-height: calc(100vh - 36px - 56px);
}
.list { display: grid; gap: 10px; }
.list-item {
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.list-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.list-item.is-active {
  background: rgba(15, 118, 110, 0.12);
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}
.item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.badge {
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(15, 118, 110, 0.14);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
}
.preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-header {
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.chat-title { font-weight: 900; letter-spacing: -0.02em; }
.chat-body {
  padding: 14px;
  overflow: auto;
  max-height: calc(100vh - 36px - 56px - 64px);
}
.empty-state {
  text-align: center;
  padding: 48px 14px;
}
.empty-ico {
  font-size: 34px;
  margin-bottom: 8px;
  opacity: 0.9;
}
.messages { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.msg {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.10);
}
.msg.me {
  margin-left: auto;
  background: rgba(15, 118, 110, 0.14);
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}
.msg .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.chat-composer {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.06);
}

/* dropdown */
.dropdown {
  position: absolute;
  width: min(290px, calc(100vw - 40px));
  margin-top: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 10px;
  transform-origin: top left;
  animation: popIn var(--t-slow) var(--ease) both;
  z-index: 50;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-title { font-size: 12px; font-weight: 900; color: var(--muted); margin: 4px 0 8px; }
.dropdown-section { display: grid; gap: 8px; }
.dropdown-sep { height: 1px; background: var(--border); margin: 10px 0; }
.radio { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.radio input { accent-color: var(--primary); }
.dropdown-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }

/* tabs */
.tabs { display: grid; gap: 14px; }

.tablist {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: rgba(148, 163, 184, 0.06);
}
.tab {
  color: var(--text);            /* <-- ESSA LINHA é a principal */
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.tab:hover { background: rgba(148, 163, 184, 0.10); transform: translateY(-1px); }

.tab[aria-selected="true"] {
  color: var(--text);            /* garante também no selecionado */
  background: rgba(15, 118, 110, 0.12);
  border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
}
.tabpanel { animation: fadeUp var(--t-slow) var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* settings */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metric { padding: 14px; border-radius: var(--r); border: 1px solid var(--border); background: rgba(148, 163, 184, 0.08); }
.metric .val { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; margin-top: 6px; }

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.table th, .table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table th { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase; }
.table tr:hover td { background: rgba(148, 163, 184, 0.06); }
.select {
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  font-weight: 800;
}
.chip .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--primary); }

.chip-remove {
  width: 22px;
  height: 22px;
  margin-left: 2px;   
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: transparent;
  color: var(--muted);
  cursor: pointer;

  display: grid;
  place-items: center;
  line-height: 1;

  transition: transform var(--t) var(--ease),
              background var(--t) var(--ease),
              color var(--t) var(--ease),
              border-color var(--t) var(--ease);
}

.chip-remove:hover {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text);
  transform: translateY(-1px);
}

.chip-remove:active { transform: translateY(0); }

.chip-remove:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.52);
  animation: fadeBg var(--t) var(--ease) both;
}
@keyframes fadeBg { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  margin: 10vh auto 0;
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideIn var(--t-slow) var(--ease) both;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body { padding: 14px; }

.qr-placeholder {
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: var(--r);
  border: 1px dashed color-mix(in srgb, var(--muted) 45%, var(--border));
  background: rgba(148, 163, 184, 0.06);
  margin-bottom: 12px;
}
.qr-box {
  width: 220px;
  height: 220px;
  border-radius: 18px;
  background: repeating-linear-gradient(45deg, rgba(148,163,184,0.35), rgba(148,163,184,0.35) 8px, rgba(148,163,184,0.15) 8px, rgba(148,163,184,0.15) 16px);
  border: 1px solid var(--border);
}

/* toast */
.toast-host {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 10px;
  z-index: 200;
}
.toast {
  width: min(360px, calc(100vw - 28px));
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: toastIn var(--t-slow) var(--ease) both;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.toast .t-ico { font-size: 18px; margin-top: 1px; }
.toast .t-title { font-weight: 900; }
.toast .t-msg { color: var(--muted); font-size: 13px; margin-top: 2px; }
.toast .t-close { margin-left: auto; }

/* skeleton */
.skeleton-item {
  height: 74px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(90deg,
    rgba(148,163,184,0.08),
    rgba(148,163,184,0.18),
    rgba(148,163,184,0.08)
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s var(--ease) infinite;
}
@keyframes shimmer { 0% { background-position: 0% 0; } 100% { background-position: -200% 0; } }

/* responsive */
@media (max-width: 1040px) {
  .inbox-layout { grid-template-columns: 1fr; }
  .chat-list { min-height: auto; }
  .chat-window { min-height: calc(100vh - 36px); }
  .chat-list-body { max-height: none; }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-w), calc(100vw - 64px));
    transform: translateX(-102%);
    transition: transform var(--t-slow) var(--ease);
    z-index: 80;
    background: transparent;
    padding: 12px;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: inline-flex; }
  .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
    z-index: 70;
    animation: fadeBg var(--t) var(--ease) both;
  }
  .show-sm { display: inline-flex; }
  .hide-sm { display: none; }
}

@media (max-width: 720px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* =========================================================
   RESPONSIVO HARDENING PATCH (mobile-proof)
========================================================= */

/* Evita imagens/elementos estourarem */
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

/* ---------- TABS: no mobile, vira scroll horizontal (estilo app) ---------- */
@media (max-width: 720px) {
  .tablist {
    flex-wrap: nowrap;          /* não quebra linha */
    overflow-x: auto;           /* scroll horizontal */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 6px;
  }

  .tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;        /* texto não quebra */
  }

  /* Scrollbar discreto */
  .tablist::-webkit-scrollbar { height: 8px; }
  .tablist::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
  }
}

/* ---------- USERS TABLE: não estoura no mobile ---------- */
@media (max-width: 920px) {
  #usersMount .card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #usersMount .table {
    min-width: 720px; /* força a tabela a ter largura, e o card vira scroll-x */
  }
}

/* ---------- DROPDOWN: vira bottom sheet no mobile (não corta) ---------- */
@media (max-width: 920px) {
  .dropdown {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 12px !important;
    width: auto !important;

    max-height: calc(100svh - 24px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;

    transform-origin: bottom center;
    animation: popInMobile var(--t-slow) var(--ease) both;
    z-index: 90;
  }

  @keyframes popInMobile {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* ---------- MODAL: nunca corta (100svh) e scroll interno ---------- */
.modal {
  /* vira “container flex” pra centralizar/ancorar bonito */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
}

.modal-panel {
  margin: 0; /* o layout flex manda, não o margin antigo */
  max-height: calc(100svh - 48px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- CHAT/INBOX: evita alturas estranhas em telas menores ---------- */
@media (max-width: 1040px) {
  .chat-list, .chat-window {
    min-height: auto;
  }

  .chat-body {
    max-height: none;
  }
}
.onb-steps { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.onb-step {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.06);
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
}
.onb-step.is-active {
  background: rgba(15, 118, 110, 0.12);
  border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
  color: var(--text);
}
.onb-panel { animation: fadeUp var(--t-slow) var(--ease) both; }
/* login: forgot password alinhamento */
#loginForm .row.between{
  justify-content: center;   /* centraliza o link */
  margin-top: -6px;          /* sobe um pouco (ajuste fino) */
  margin-bottom: 10px;       /* dá respiro antes do botão */
}

#loginForm .row.between .link{
  display: inline-block;
  text-align: center;
  font-size: 13px;
}
/* botão do olho: sem borda/caixa */
.input-wrap .btn-icon{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  width: 40px;     /* mantém área clicável */
  height: 40px;
  padding: 0;
}

.input-wrap .btn-icon:hover{
  background: rgba(148, 163, 184, 0.14) !important; /* hover leve, opcional */
  transform: none; /* evita "pular" */
}

.input-wrap .btn-icon:active{
  transform: none;
}
/* --- Fix: botão do olho não pode “pular” no hover --- */
.input-wrap { position: relative; }

/* Ajusta o input pra não ficar por baixo do botão */
.input-wrap .input { padding-right: 48px; }

/* Posiciona e trava dimensões do botão do olho */
.input-wrap .btn.btn-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);

  width: 36px;
  height: 36px;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  border: 1px solid transparent; /* evita shift se hover mexer em borda */
}

/* Hover sem mexer em padding/altura/transform */
.input-wrap .btn.btn-icon:hover {
  transform: translateY(-50%);
}
/* ===========================
   ONBOARDING: Steps com ">"
   =========================== */

.onb-steps{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* coloca ">" entre os steps (menos no último) */
.onb-step{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.onb-step:not(:last-child)::after{
  content: ">";
  margin-left: 8px;
  color: var(--muted);
  font-weight: 900;
  opacity: 0.9;
}

/* ===========================
   INPUT NUMBER: remove spinner (setinhas)
   - evita bug de contraste/hover no dark
   =========================== */

/* Chrome/Edge/Safari */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"]{
  -moz-appearance: textfield;
  appearance: textfield;
}
