/* =====================================================================
   VENDE.AI — sistema visual
   Cores: tinta (azul-noite) + índigo elétrico → ciano (IA) + verde (vendas).
   Sem dependências externas; fontes do sistema (rápido e sem rastreio).
   ===================================================================== */

:root {
  --ink-950: #070B18;
  --ink-900: #0B1020;
  --ink-800: #131A33;
  --ink-700: #1E2747;
  --ink-500: #4B5578;

  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --border: #E3E7F0;
  --border-strong: #CBD2E1;
  --text: #0F172A;
  --text-2: #3A4459;
  --muted: #667089;

  --primary: #4F46E5;
  --primary-600: #4338CA;
  --primary-50: #EEF0FF;
  --primary-100: #E0E3FF;
  --cyan: #06B6D4;
  --cyan-50: #E6FAFD;
  --violet: #7C3AED;
  --violet-50: #F3EEFF;
  --green: #059669;
  --green-50: #E7F8F1;
  --amber: #D97706;
  --amber-50: #FEF5E6;
  --red: #DC2626;
  --red-50: #FDECEC;

  --brand-gradient: linear-gradient(135deg, #6366F1 0%, #06B6D4 100%);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);
  --focus: 0 0 0 3px rgba(79, 70, 229, .28);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Ícones ----------------------------------------------------------- */
.icon {
  width: 20px; height: 20px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 32px; height: 32px; stroke-width: 1.5; }

/* Logotipo --------------------------------------------------------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo__mark { width: 32px; height: 32px; flex-shrink: 0; }
.logo__word { font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1; }
.logo--light .logo__word { color: #fff; }
.logo--dark .logo__word { color: var(--ink-900); }
.logo__ai {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Botões ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn--primary:hover { background: var(--primary-600); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn--ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn--danger-ghost { background: transparent; border-color: transparent; color: var(--red); }
.btn--danger-ghost:hover { background: var(--red-50); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--lg { height: 46px; font-size: 15px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; color: inherit;
}
.icon-btn:hover { background: rgba(127, 137, 170, .14); }

/* Formulários ------------------------------------------------------ */
.form { display: grid; gap: 18px; }
.form__group { border: 0; padding: 0; margin: 0; display: grid; gap: 16px; }
.form__group legend {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px; padding: 0;
}
.form__row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.field input, .select {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.field input:hover, .select:hover { border-color: #AEB7CB; }
.field input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.field input[readonly] { background: var(--surface-2); color: var(--muted); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667089' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.select--sm { height: 34px; font-size: 13.5px; width: auto; min-width: 150px; }
.field__help { font-size: 12.5px; color: var(--muted); }
.field__help.is-ok { color: var(--green); }
.field__help.is-bad { color: var(--red); }
.field__error { font-size: 12.5px; color: var(--red); font-weight: 500; }

.input-group { position: relative; }
.input-group input { padding-right: 44px; }
.input-group__btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer;
}
.input-group__btn:hover, .input-group__btn.is-active { color: var(--primary); background: var(--primary-50); }

.input-prefix {
  display: flex; align-items: stretch; height: 42px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden;
}
.input-prefix:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.input-prefix__text {
  display: flex; align-items: center; padding: 0 4px 0 12px; color: var(--muted);
  background: var(--surface-2); font-size: 14px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis;
  border-right: 1px solid var(--border);
}
.field .input-prefix input { border: 0; height: 100%; box-shadow: none; padding-left: 8px; min-width: 0; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex-shrink: 0; }

/* Alertas ---------------------------------------------------------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; border: 1px solid;
}
.alert--success { background: var(--green-50); border-color: #B6E6D3; color: #065F46; }
.alert--danger { background: var(--red-50); border-color: #F5C2C2; color: #991B1B; }

.notice {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary-50), var(--cyan-50));
  border: 1px solid var(--primary-100); border-radius: var(--radius);
  color: var(--text-2); font-size: 14px;
}
.notice .icon { color: var(--primary); margin-top: 2px; }
.notice strong { color: var(--text); display: block; margin-bottom: 2px; }

/* Badges ----------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge--soft { background: var(--primary-50); color: var(--primary-600); }
.badge--success { background: var(--green-50); color: var(--green); }
.badge--muted { background: #EEF1F6; color: var(--muted); }

/* ===================================================================
   Telas de acesso (login / cadastro)
   =================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 44%) 1fr; }
.auth__brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 44px 48px;
  background: radial-gradient(1200px 600px at -10% -10%, #1B2350 0%, transparent 60%), var(--ink-900);
  color: #C8CEE3;
}
.auth__glow {
  position: absolute; width: 520px; height: 520px; right: -200px; bottom: -160px;
  background: radial-gradient(circle, rgba(6, 182, 212, .35), rgba(99, 102, 241, .18) 45%, transparent 70%);
  filter: blur(10px); pointer-events: none;
}
.auth__brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
}
.auth__brand > :not(.auth__glow) { position: relative; z-index: 1; }
.auth__pitch { max-width: 440px; }
.auth__pitch h2 { color: #fff; font-size: 32px; line-height: 1.15; letter-spacing: -.025em; font-weight: 750; margin-bottom: 16px; }
.auth__pitch p { font-size: 16px; color: #AEB6D0; margin-bottom: 28px; }
.auth__points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth__points li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; color: #DCE0EE; }
.auth__points .icon {
  width: 22px; height: 22px; padding: 3px; border-radius: 50%;
  background: rgba(6, 182, 212, .16); color: #5EE3F5; stroke-width: 2.4;
}
.auth__foot { font-size: 12.5px; color: #6E7799; }
.auth__main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth__mobile-logo { display: none; margin-bottom: 28px; }

.auth-card { width: 100%; max-width: 420px; }
.auth-card--wide { max-width: 520px; }
.auth-card__title { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card__subtitle { color: var(--muted); margin-bottom: 28px; }
.auth-card__switch { margin-top: 24px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-card__switch a { font-weight: 600; }

.error-page { text-align: center; display: grid; gap: 16px; justify-items: center; }
.error-page__code {
  font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -.04em;
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-page__detail {
  max-width: 100%; overflow: auto; text-align: left; font-size: 12px;
  padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}

/* ===================================================================
   Painel
   =================================================================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; gap: 20px;
  padding: 20px 14px;
  background: linear-gradient(180deg, var(--ink-900), var(--ink-950));
  color: #AEB6D0;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; }
.sidebar__logo:hover { text-decoration: none; }
.sidebar__close { display: none; color: #AEB6D0; }
.sidebar__company {
  display: grid; gap: 6px; justify-items: start;
  padding: 14px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06);
}
.sidebar__company-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6E7799; }
.sidebar__company strong { color: #fff; font-size: 15px; line-height: 1.3; word-break: break-word; }
.sidebar__company .badge--soft { background: rgba(99, 102, 241, .18); color: #B4B8FF; }
.sidebar__nav { display: grid; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 12px; border-radius: 10px;
  color: #AEB6D0; font-weight: 550; font-size: 14.5px;
  transition: background-color .15s, color .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(99, 102, 241, .32), rgba(6, 182, 212, .12));
  box-shadow: inset 2px 0 0 #7C83FF;
}
.nav-link.is-active .icon { color: #9AA0FF; }
.sidebar__bottom { margin-top: auto; padding: 0 8px; }
.sidebar__note { font-size: 12px; line-height: 1.5; color: #6E7799; }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 28px;
  background: rgba(244, 246, 251, .86);
  backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__menu { display: none; }
.topbar__title { font-size: 16px; font-weight: 650; }
.topbar__user { margin-left: auto; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.user-chip {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  height: 42px; padding: 0 10px 0 5px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
}
.user-chip:hover { border-color: var(--border-strong); }
.user-chip__name { font-weight: 600; font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 250px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.dropdown__header { display: grid; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown__header span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.dropdown__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 38px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); font-size: 14px; cursor: pointer; text-align: left;
}
.dropdown__item:hover { background: var(--surface-2); text-decoration: none; }
.dropdown__item--danger { color: var(--red); }
.dropdown__item--danger:hover { background: var(--red-50); }

.avatar {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-gradient); color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.avatar--sm { width: 34px; height: 34px; }

.content { padding: 28px; width: 100%; max-width: 1280px; display: grid; gap: 20px; align-content: start; }
.content > .alert { margin-bottom: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head__eyebrow { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.page-head__title { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.page-head__subtitle { color: var(--muted); margin-top: 4px; }

.segmented { display: inline-flex; padding: 4px; gap: 2px; background: #E8EBF3; border-radius: 10px; }
.segmented__item {
  height: 32px; display: grid; place-items: center; padding: 0 14px; border-radius: 7px;
  color: var(--text-2); font-size: 13.5px; font-weight: 600;
}
.segmented__item:hover { color: var(--text); text-decoration: none; }
.segmented__item.is-active { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }

/* Indicadores ------------------------------------------------------ */
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.kpi {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.kpi__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; }
.kpi__icon--indigo { background: var(--primary-50); color: var(--primary); }
.kpi__icon--cyan { background: var(--cyan-50); color: #0891B2; }
.kpi__icon--violet { background: var(--violet-50); color: var(--violet); }
.kpi__icon--green { background: var(--green-50); color: var(--green); }
.kpi__icon--amber { background: var(--amber-50); color: var(--amber); }
.kpi__icon--slate { background: #EEF1F6; color: var(--muted); }
.kpi__body { min-width: 0; }
.kpi__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi__value { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.25; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.kpi__hint { font-size: 12.5px; color: var(--muted); }

/* Cartões ---------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px;
}
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__head--pad { padding: 20px 20px 0; }
.card__title { font-size: 15.5px; font-weight: 700; }
.card__subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-team { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }

.empty {
  display: grid; justify-items: center; gap: 10px; padding: 36px 16px; text-align: center;
  color: var(--muted); font-size: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.empty .icon { color: #A3ACC2; }

/* Gráfico ---------------------------------------------------------- */
.chart { margin: 0; }
.chart__svg { width: 100%; height: 200px; display: block; }
.chart__bar { fill: var(--primary); opacity: .85; }
.chart__bar:hover { opacity: 1; fill: var(--cyan); }
.chart__axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Ranking ---------------------------------------------------------- */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rank__item { display: flex; gap: 12px; align-items: center; }
.rank__pos {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary-50); color: var(--primary-600); font-weight: 700; font-size: 13px;
}
.rank__body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.rank__line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.rank__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.rank__value { font-weight: 700; font-variant-numeric: tabular-nums; }
.rank__meter { width: 100%; height: 6px; border: 0; border-radius: 99px; background: #EEF1F6; appearance: none; }
.rank__meter::-webkit-meter-bar { background: #EEF1F6; border: 0; border-radius: 99px; height: 6px; }
.rank__meter::-webkit-meter-optimum-value { background: var(--brand-gradient); border-radius: 99px; }
.rank__meter::-moz-meter-bar { background: var(--primary); border-radius: 99px; }

/* Lista de situação ------------------------------------------------ */
.status-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.status-list__item {
  display: flex; align-items: center; gap: 10px; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  font-size: 14px; color: var(--text-2);
}
.status-list__item .icon { color: var(--muted); }
.status-list__item > :last-child { margin-left: auto; }
.status-list__item strong { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }

/* Tabela ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.table td { padding: 14px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-muted .person, .table tr.is-muted td[data-label="Último acesso"] { opacity: .55; }
.table__actions { text-align: right; }
.person { display: flex; align-items: center; gap: 12px; }
.person strong { display: block; font-weight: 600; }
.person__email { display: block; font-size: 13px; color: var(--muted); }
.inline-form { margin: 0; }
.roles-help { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.roles-help dt { font-weight: 600; color: var(--text-2); }
.roles-help dd { margin: 0; }

/* ===================================================================
   Etapa 2 — empresa e catálogo
   =================================================================== */
.stack { display: grid; gap: 20px; align-content: start; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.optional { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 4px; }

.field textarea, .table--form input:not([type="checkbox"]), .filters__search input {
  width: 100%; padding: 10px 12px; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.field textarea:focus, .table--form input:focus, .input-time:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.field textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--red); }
.field input:disabled, .field textarea:disabled, .select:disabled, .table--form input:disabled {
  background: var(--surface-2); color: var(--text-2); cursor: not-allowed; opacity: 1;
}
.field--end { align-content: end; padding-bottom: 10px; }
.field--spaced { margin-top: 16px; }
.form__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-actions--start { justify-content: flex-start; }

.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: #B91C1C; }
.card--danger { border-color: #F5C2C2; }
.card--danger .card__title { color: #991B1B; }
.badge--warning { background: var(--amber-50); color: #B45309; }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--danger { color: var(--red); }
.icon-btn--danger:hover { background: var(--red-50); }
.empty--inset { margin: 0 20px 20px; }

/* Arquivo */
.file-input { font-size: 13.5px; color: var(--text-2); max-width: 100%; }
.file-input::file-selector-button {
  margin-right: 12px; height: 34px; padding: 0 14px; cursor: pointer; font: inherit; font-weight: 600;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2);
}
.file-input::file-selector-button:hover { background: var(--surface-2); }

.logo-field { display: flex; gap: 16px; align-items: flex-start; }
.logo-field__img {
  width: 72px; height: 72px; border-radius: var(--radius); object-fit: contain; flex-shrink: 0;
  border: 1px solid var(--border); background: #fff;
}
.logo-field__img--empty { display: grid; place-items: center; color: #A3ACC2; background: var(--surface-2); }

/* Horário */
.hours { display: grid; gap: 8px; }
.hours__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; }
.hours__day { width: 110px; font-weight: 600; }
.input-time {
  height: 38px; padding: 0 10px; font: inherit; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface);
}
.hours__sep { color: var(--muted); font-size: 13.5px; }
.hours__closed { display: none; color: var(--muted); font-size: 13.5px; }
.hours__row:has([data-hours-toggle]:not(:checked)) :is(.input-time, .hours__sep) { display: none; }
.hours__row:has([data-hours-toggle]:not(:checked)) .hours__closed { display: inline; }

.checks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.check--box {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.check--box:has(input:checked) { border-color: var(--primary-100); background: var(--primary-50); color: var(--text); }

/* Lista em árvore (categorias) */
.tree-name { display: inline-flex; align-items: center; gap: 10px; }
.tree-name .icon { color: var(--primary); }
.tree-name--child { padding-left: 22px; }
.tree-name--child strong { font-weight: 550; }
.tree-name__branch { color: var(--border-strong); }

/* Filtros da lista */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters__search { position: relative; flex: 1 1 260px; }
.filters__search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filters__search input { height: 34px; padding: 0 12px 0 36px; }
.filters__search input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }

.product-cell { display: flex; align-items: center; gap: 12px; color: inherit; }
.product-cell:hover { text-decoration: none; }
.product-cell:hover strong { color: var(--primary); }
.product-cell__img {
  width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border); background: #fff;
}
.product-cell__img--empty { display: grid; place-items: center; color: #A3ACC2; background: var(--surface-2); }
.product-cell strong { display: block; font-weight: 600; }
.product-cell__meta { display: block; font-size: 12.5px; color: var(--muted); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; border-top: 1px solid var(--border); }
.pagination__info { font-size: 13.5px; color: var(--muted); }

/* Formulário de produto */
.product-grid {
  border: 0; padding: 0; margin: 0; min-width: 0;
  display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start;
}
.product-grid__side { position: sticky; top: 84px; }
[data-stock-field] { transition: opacity .15s; }
.form__row:has([data-stock-toggle]:not(:checked)) [data-stock-field] { opacity: .45; pointer-events: none; }

/* Fotos */
.photos { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.photo { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.photo__badge {
  position: absolute; left: 8px; top: 8px; height: 22px; padding: 0 8px; display: inline-flex; align-items: center;
  border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--primary); color: #fff;
}
.photo__actions { display: flex; justify-content: center; gap: 2px; padding: 4px; border-top: 1px solid var(--border); background: var(--surface-2); }
.photo__actions form { margin: 0; }
.upload {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2);
}
.upload__label { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); flex: 1 1 100%; }
.upload__label .icon { color: var(--primary); }
.upload .file-input { flex: 1 1 260px; }

/* Tabela com campos (variações) */
.table--form td { padding: 10px 12px; }
.table--form th { padding: 12px; }
.table--form input:not([type="checkbox"]) { height: 36px; padding: 0 10px; min-width: 90px; }
.table--form input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.table__new { background: var(--surface-2); }
.row-actions { display: inline-flex; align-items: center; gap: 4px; }

/* Lista de situação com link */
a.status-list__item { color: var(--text-2); height: 100%; }
a.status-list__item:hover { border-color: var(--primary-100); background: var(--primary-50); text-decoration: none; }

/* ===================================================================
   Etapa 3 — vendedor IA, atendimentos e leads
   =================================================================== */
.stack--tight { gap: 8px; }
.spaced { margin-top: 12px; }
.segmented--wrap { flex-wrap: wrap; }
code { font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: rgba(15, 23, 42, .06); }

.stats { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 14px; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; word-break: break-word; }

/* Chat */
.chat { padding: 0; display: flex; flex-direction: column; min-height: 520px; overflow: hidden; }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat__head strong { display: block; font-size: 15px; }
.chat__status { font-size: 12.5px; color: var(--muted); }
.chat__link { margin-left: auto; font-size: 13px; font-weight: 600; }
.chat__log {
  flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 18px;
  max-height: 60vh; overflow-y: auto; background: var(--surface-2);
}
.chat--readonly .chat__log { max-height: none; }
.chat__empty { margin: auto; max-width: 420px; text-align: center; color: var(--muted); font-size: 14px; }
.chat__note { padding: 12px 18px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.chat__form { display: flex; gap: 10px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat__form textarea {
  flex: 1; min-height: 42px; max-height: 160px; resize: none; padding: 10px 12px; font: inherit; line-height: 1.45;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.chat__form textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.chat__form .btn { height: 42px; }

.msg { display: flex; }
.msg--customer { justify-content: flex-end; }
.msg--system { justify-content: center; }
.msg__bubble {
  max-width: min(78%, 560px); padding: 10px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.msg--customer .msg__bubble { background: var(--primary); border-color: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg--seller .msg__bubble { border-bottom-left-radius: 4px; }
.msg--system .msg__bubble { background: transparent; border: 1px dashed var(--border-strong); box-shadow: none; font-size: 13px; color: var(--muted); }
.msg__who { display: block; font-size: 11.5px; font-weight: 650; color: var(--muted); margin-bottom: 2px; }
.msg--customer .msg__who { color: rgba(255, 255, 255, .78); }
.msg__text { font-size: 14.5px; white-space: normal; word-break: break-word; }
.msg__tools { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--border); display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.msg__tools li::before { content: "↳ "; }
.msg__tools li.is-error { color: var(--amber); }
.msg--typing .msg__text { color: var(--muted); font-style: italic; }

/* ===================================================================
   Etapa 4 — chat do site, link exclusivo e resposta do atendente
   =================================================================== */
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field input, .copy-field textarea {
  flex: 1; min-width: 0; padding: 9px 12px; font: inherit; font-size: 13.5px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2);
}
.copy-field--code { align-items: flex-start; }
.copy-field textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; resize: none; }
.input-color { width: 100%; height: 42px; padding: 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.reply { display: grid; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface); }
.reply textarea {
  width: 100%; min-height: 72px; resize: vertical; padding: 10px 12px; font: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.reply textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.reply__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ===================================================================
   Responsivo
   =================================================================== */
@media (max-width: 1100px) {
  .grid-team { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .product-grid__side { position: static; }
  .form__row--3 { grid-template-columns: 1fr 1fr; }
  .status-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__mobile-logo { display: block; }

  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar__close { display: inline-grid; }
  .app.is-nav-open .sidebar { transform: none; }
  .app.is-nav-open .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 35; background: rgba(7, 11, 24, .5);
  }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .topbar__menu { display: inline-grid; }
  .content { padding: 20px 16px; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .form__row { grid-template-columns: 1fr; }
  .user-chip__name { display: none; }
  .user-chip { padding-right: 8px; }
  .page-head__title { font-size: 22px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { flex-direction: column; gap: 10px; padding: 14px; }
  .kpi__value { font-size: 22px; }
  .status-list { grid-template-columns: 1fr; }

  /* Tabela vira lista de cartões */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 14px 16px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
  .table td { padding: 0; border: 0; }
  .table td[data-label="Último acesso"]::before { content: "Último acesso: "; color: var(--muted); }
  .table__actions { text-align: left; }
  .form__row--3 { grid-template-columns: 1fr; }
  .table--labeled td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  .table--form td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
  .hours__day { width: 100%; }
  .logo-field { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.msg__status--failed { color: var(--red); font-weight: 700; }
.msg__status--read { color: var(--green); }
.list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* ===================================================================
   Etapa 7 — planos, uso e relatórios
   =================================================================== */
.alert--warning { background: var(--amber-50); border-color: #F7D9A8; color: #92400E; }
.alert a { color: inherit; font-weight: 700; text-decoration: underline; }
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.plan.is-muted { opacity: .65; }
.plan__price { font-size: 22px; font-weight: 750; margin-top: 4px; }
.plan__price span { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan__badges { display: grid; gap: 6px; justify-items: end; }
.usage { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.usage__item { display: grid; gap: 6px; }
.usage__line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.usage__line .is-over { color: var(--red); }

/* ===== Pagamento do plano (Mercado Pago) ===== */
.checkout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.checkout__summary { position: sticky; top: 16px; display: grid; gap: 10px; }
.checkout__label { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.checkout__plan { margin: 0; font-size: 22px; }
.checkout__price { margin: 0; font-size: 28px; font-weight: 800; }
.checkout__price span { font-size: 14px; font-weight: 500; color: var(--muted); }
.checkout__list { margin: 4px 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.checkout__pay { min-height: 380px; }
.checkout__loading { color: var(--muted); }
.checkout__result h3 { margin: 0 0 6px; }
.checkout__qr { display: block; width: 220px; height: 220px; margin: 14px auto; image-rendering: pixelated; border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: #fff; }
.checkout__copy { display: flex; gap: 8px; margin-top: 4px; }
.checkout__copy input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 12px; }
.checkout__wait { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: #EEF2FF; color: #3730A3; font-weight: 600; }
.checkout__spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #C7D2FE; border-top-color: #4F46E5; animation: checkout-spin .8s linear infinite; flex: none; }
@keyframes checkout-spin { to { transform: rotate(360deg); } }
.checkout__ok { padding: 18px; border-radius: 14px; background: #ECFDF5; border: 1px solid #A7F3D0; }
.checkout__fail { padding: 18px; border-radius: 14px; background: #FEF2F2; border: 1px solid #FECACA; }
.plan-buy { display: grid; gap: 10px; }
.plan-buy__item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; }
.plan-buy__item.is-current { border-color: var(--primary); background: #F5F7FF; }
.plan-buy__name { display: block; font-weight: 700; }
.plan-buy__action { display: flex; align-items: center; gap: 12px; flex: none; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } .checkout__summary { position: static; } .plan-buy__item { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .checkout__spinner { animation: none; } }
/* Pix direto: QR Code na hora, sem formulário */
.checkout__pixfast { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-radius: 14px; border: 1px solid #99F6E4; background: linear-gradient(135deg, #F0FDFA, #ECFEFF); }
.checkout__pixfast-title { margin: 0 0 2px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.checkout__pixfast-title::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: #32BCAD; transform: rotate(45deg); }
.checkout__pixfast p { margin: 0; }
.checkout__pixfast .btn { flex: none; }
.checkout__or { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; font-size: 13px; color: var(--muted); }
.checkout__or::before, .checkout__or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 560px) { .checkout__pixfast { flex-direction: column; align-items: stretch; text-align: center; } .checkout__pixfast-title { justify-content: center; } }
