/* ============================================================
   AutoMind · Product
   ============================================================ */

:root {
  --bg:            #141e1f;
  --bg-2:          #1b2829;
  --surface:       rgba(255, 255, 255, 0.035);
  --surface-2:     rgba(255, 255, 255, 0.055);
  --surface-3:     rgba(255, 255, 255, 0.08);
  --border:        rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text:       #F4F1EA;
  --text-mute:  #9395A0;
  --text-dim:   #55565F;

  --accent:        #a6a18a;
  --accent-soft:   #bdb8a3;
  --accent-glow:   rgba(166, 161, 138, 0.35);
  --peach:         #FF8A5C;
  --peach-glow:    rgba(255, 138, 92, 0.30);
  --violet:        #C0B5FF;
  --violet-glow:   rgba(192, 181, 255, 0.30);
  --mint:          #8AE6B4;
  --err:           #FF6B6B;
  --warn:          #FFD66B;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;

  --font:  "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);

  --topbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background: var(--bg);
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--accent); }

/* hidden attribute deve sempre vencer regras de display */
[hidden] { display: none !important; }
input { font: inherit; }
kbd {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--text-mute);
}
.muted { color: var(--text-mute); }
.muted.small, .small { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ============================================================
   Ambient
   ============================================================ */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.grid-veil {
  position: absolute; inset: -2px;
  background-image: radial-gradient(rgba(255,255,255,.10) 1.3px, transparent 1.4px);
  background-size: 30px 30px;
  background-position: -10px -10px;
  mask-image: radial-gradient(120% 90% at 50% 30%, #000 25%, transparent 78%);
  opacity: .55;
}
.grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .06; mix-blend-mode: overlay;
}

/* ============================================================
   Cursor dinâmico (anel + ponto) — igual ao site
   ============================================================ */
.has-custom-cursor, .has-custom-cursor * { cursor: none !important; }
.has-custom-cursor input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]),
.has-custom-cursor textarea,
.has-custom-cursor [contenteditable="true"] { cursor: text !important; }

.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999;
  pointer-events: none; border-radius: 50%; will-change: transform;
}
.cursor-dot {
  width: 7px; height: 7px; background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  transition: opacity .25s, width .2s, height .2s;
}
.cursor-ring {
  width: 32px; height: 32px; border: 1.5px solid var(--accent);
  transition: width .28s var(--ease), height .28s var(--ease),
              background-color .28s, border-color .28s, opacity .25s;
}
.cursor-ring.is-hover { width: 56px; height: 56px; background: rgba(166,161,138,.10); border-color: var(--accent-soft); }
.cursor-ring.is-down { width: 26px; height: 26px; background: rgba(166,161,138,.2); }
.cursor-out .cursor-dot, .cursor-out .cursor-ring,
.over-text .cursor-dot, .over-text .cursor-ring { opacity: 0; }
@media (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* ============================================================
   Buttons & inputs
   ============================================================ */
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
  font-size: 13px;
  border-radius: 999px;
  letter-spacing: -.005em;
  transition: all .25s var(--ease);
  box-shadow: 0 0 0 0 var(--accent-glow), 0 4px 16px rgba(0,0,0,.3);
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 6px var(--accent-glow), 0 8px 20px rgba(0,0,0,.4);
}
.primary-btn:active { transform: translateY(0); }
.primary-btn.full { width: 100%; }
.primary-btn.sm { padding: 8px 14px; font-size: 12.5px; }

.secondary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  transition: all .25s var(--ease);
}
.secondary-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.secondary-btn.full { width: 100%; }

.mini-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-mute);
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.mini-btn:hover { color: var(--text); background: var(--surface-2); }
.mini-btn.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: transparent;
}
.mini-btn.primary:hover { box-shadow: 0 0 0 4px var(--accent-glow); }
.mini-btn.danger {
  color: var(--err);
  border-color: rgba(255,107,107,.22);
}
.mini-btn.danger:not(:disabled):hover {
  background: rgba(255,107,107,.08);
  color: var(--err);
}
.mini-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.ghost-btn {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--text-mute);
  transition: all .25s var(--ease);
}
.ghost-btn:hover { color: var(--text); border-color: var(--border-strong); }
.pulse-dot {
  position: absolute; top: 7px; right: 7px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-out infinite;
}

/* Notifications popover */
.notif-pop {
  position: absolute;
  top: 50px;
  right: 24px;
  width: 360px;
  max-height: 60vh;
  border-radius: var(--r-md);
  z-index: 40;
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: pop .15s var(--ease);
}
/* fundo opaco (sobrepõe o .glass translúcido para garantir leitura) */
.notif-pop.glass {
  background: linear-gradient(160deg, #1f2d2e, #182324);
  border-color: var(--border-strong);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .72);
}
.notif-pop-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}
.notif-list li {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .2s var(--ease);
}
.notif-list li:hover { background: var(--surface-2); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list li .nf-dot {
  width: 6px; height: 6px; border-radius: 50%;
  margin-top: 6px;
  background: var(--text-dim);
}
.notif-list li.unread .nf-dot { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.notif-list li .nf-when {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-mute);
  align-self: center;
}
.notif-list li strong { font-weight: 500; }
.notif-empty {
  padding: 40px 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-mute);
}
.notif-list li.notif-approval {
  background: rgba(192,181,255,.05);
  border-left: 2px solid var(--violet);
}
.nf-preview {
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-mute);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 90px;
  overflow: auto;
}
.nf-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 10px rgba(166, 161, 138,0); }
  100% { box-shadow: 0 0 0 0 rgba(166, 161, 138,0); }
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.link { color: var(--accent); }
.link:hover { text-decoration: underline; }
.link-faint { color: var(--text-mute); font-size: 11px; float: right; font-weight: 400; }
.link-faint:hover { color: var(--text); }

/* ============================================================
   Auth screen
   ============================================================ */
.auth {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  padding: 40px;
  gap: 40px;
  background: radial-gradient(800px 600px at 20% 20%, rgba(166, 161, 138,.05), transparent 60%), var(--bg);
  transition: opacity .6s var(--ease);
}
.auth.fade-out {
  opacity: 0;
  pointer-events: none;
}
.auth-back {
  position: absolute;
  top: 32px; left: 32px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--text-mute);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all .2s var(--ease);
}
.auth-back:hover { color: var(--text); border-color: var(--border-strong); }

.auth-card {
  align-self: center;
  justify-self: end;
  width: 100%;
  max-width: 420px;
  padding: 36px;
  border-radius: var(--r-lg);
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 600;
  margin-bottom: 28px;
}
.auth-brand .mark {
  width: 24px; height: 24px;
  color: var(--accent);
  filter: drop-shadow(0 0 12px var(--accent-glow));
}
.auth-title {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.auth-sub {
  margin-top: 8px;
  color: var(--text-mute);
  font-size: 14px;
}
.auth-form {
  margin-top: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field span {
  font-size: 12px;
  color: var(--text-mute);
  font-family: var(--mono);
}
.field input {
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all .2s var(--ease);
}
.field select {
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.auth-error {
  padding: 10px 14px;
  background: rgba(255,107,107,.08);
  border: 1px solid rgba(255,107,107,.25);
  border-radius: var(--r-sm);
  color: var(--err);
  font-size: 12.5px;
  line-height: 1.4;
}
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.auth-foot {
  margin-top: 24px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}
.auth-aside {
  align-self: center;
  justify-self: start;
  max-width: 420px;
  padding: 0 24px;
}
.auth-aside .kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 14px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.auth-aside h2 {
  font-size: 44px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.04em;
}
.auth-bullets {
  list-style: none;
  margin-top: 28px;
  display: flex; flex-direction: column; gap: 10px;
}
.auth-bullets li {
  padding-left: 22px;
  position: relative;
  color: var(--text-mute);
  font-size: 14px;
}
.auth-bullets li::before {
  content: "✦";
  position: absolute; left: 0;
  color: var(--accent);
}

/* ============================================================
   App shell
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.app.is-on { opacity: 1; }

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: linear-gradient(to bottom, rgba(8,8,10,.85), rgba(8,8,10,.5));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
}
.brand .mark {
  width: 22px; height: 22px;
  color: var(--accent);
  filter: drop-shadow(0 0 12px var(--accent-glow));
}
.brand-name { font-weight: 600; }
.org-sw {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 10px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-mute);
  cursor: default;
  transition: all .2s var(--ease);
}
.org-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 6px rgba(138,230,180,.5);
}

.topnav {
  display: flex; align-items: center; gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
}
.topnav-link {
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--text-mute);
  border-radius: 999px;
  transition: all .25s var(--ease);
}
.topnav-link:hover { color: var(--text); }
.topnav-link.is-active {
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
}

.topactions {
  display: flex; align-items: center; gap: 8px;
  justify-content: flex-end;
}
.search-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-mute);
  font-size: 12.5px;
  min-width: 240px;
  transition: all .2s var(--ease);
}
.search-trigger:hover { background: var(--surface-2); border-color: var(--border-strong); }
.search-trigger span { flex: 1; text-align: left; }
.user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  transition: all .2s var(--ease);
}
.user-pill:hover { background: var(--surface-2); border-color: var(--border-strong); }
.avatar {
  width: 24px; height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--peach));
  color: var(--bg);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}

/* ============================================================
   Side arrows + indicator
   ============================================================ */
.side-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center;
  color: var(--text-mute);
  z-index: 25;
  transition: all .25s var(--ease);
  opacity: .8;
}
.side-arrow:hover {
  opacity: 1; color: var(--text);
  border-color: var(--border-strong); background: var(--surface-2);
}
.side-arrow:active { transform: translateY(-50%) scale(.95); }
.side-arrow--left  { left: 16px; }
.side-arrow--right { right: 16px; }
.side-arrow[disabled] { opacity: .25; cursor: not-allowed; }

.indicator {
  position: fixed;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 8px 14px;
  background: rgba(8,8,10,.7);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.indicator-meta, .indicator-hint {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
}
.idx-current { color: var(--text); }
.idx-divider { opacity: .4; }
.dots {
  display: flex; align-items: center; gap: 8px;
  padding: 0 6px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 20px;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: all .3s var(--ease);
}
.dot:hover { background: var(--text-mute); }
.dot.is-on {
  background: var(--accent);
  width: 20px;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================================
   Viewport + pages
   ============================================================ */
.viewport {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.viewport::-webkit-scrollbar { display: none; }
.page {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: calc(var(--topbar-h) + 24px) 32px 72px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================================
   01 · Dashboard (minimalist)
   ============================================================ */
.page--dashboard {
  padding-top: calc(var(--topbar-h) + 56px);
  gap: 40px;
  align-items: center;
}
.page--dashboard > * {
  width: 100%;
  max-width: 1100px;
}
.dash-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px;
}
.page-title-sm {
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.05;
}
.dash-head .muted {
  margin-top: 4px;
  font-family: var(--mono);
  letter-spacing: .02em;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.kpi {
  padding: 22px 28px 22px 0;
  position: relative;
  transition: all .25s var(--ease);
}
.kpi + .kpi {
  padding-left: 28px;
  border-left: 1px solid var(--border);
}
.kpi-label {
  font-size: 11px;
  color: var(--text-mute);
  font-family: var(--mono);
  letter-spacing: .04em;
}
.kpi-main {
  margin-top: 14px;
  display: flex; align-items: baseline; gap: 12px;
}
.kpi-num {
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1;
}
.kpi-num small {
  font-size: 16px;
  color: var(--text-mute);
  font-weight: 400;
  margin-left: 2px;
}
.kpi-delta {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-mute);
}
.kpi-delta.up   { color: var(--accent); }
.kpi-delta.down { color: var(--err); }

.card--running {
  flex: 1;
  min-height: 0;
}

/* Performance card */
.card--perf {
  flex: 1;
  min-height: 0;
  padding: 24px 28px;
  gap: 20px;
}
.perf-chart {
  position: relative;
  flex: 1;
  min-height: 180px;
}
.perf-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}
.perf-grid line {
  stroke: rgba(255,255,255,0.05);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.perf-peak {
  filter: drop-shadow(0 0 8px var(--accent-glow));
  animation: pulse 1.8s ease-out infinite;
}
.perf-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: .04em;
}

.perf-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.ps {
  padding-right: 18px;
}
.ps + .ps {
  border-left: 1px solid var(--border);
  padding-left: 18px;
}
.ps-l {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-mute);
  letter-spacing: .04em;
}
.ps-v {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1;
}
.ps-v small {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 400;
  margin-left: 2px;
}

.insight {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(192,181,255,.05);
  border: 1px solid rgba(192,181,255,.15);
  border-radius: var(--r-sm);
}
.insight-ic {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(192,181,255,.08);
  color: var(--violet);
  flex-shrink: 0;
}
.insight-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.insight-body strong {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -.005em;
}

.card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 14px;
  min-height: 0;
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
}
.card-title-row { display: flex; align-items: center; gap: 10px; }
.card h3 { font-size: 14px; font-weight: 500; letter-spacing: -.005em; }

.ic {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
}
.ic.small { width: 22px; height: 22px; font-size: 13px; }
.ic--peach  { color: var(--peach);  box-shadow: inset 0 0 0 1px rgba(255,138,92,.2); }
.ic--violet { color: var(--violet); box-shadow: inset 0 0 0 1px rgba(192,181,255,.2); }
.ic--mint   { color: var(--mint);   box-shadow: inset 0 0 0 1px rgba(138,230,180,.2); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--text-mute);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.badge--live { color: var(--accent); border-color: rgba(166, 161, 138,.25); }
.badge--warn { color: var(--warn);   border-color: rgba(255,214,107,.25); }
.badge--err  { color: var(--err);    border-color: rgba(255,107,107,.25); }
.dot-live, .dot-mute, .dot-err, .dot-warn {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
}
.dot-live { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); animation: pulse 1.8s ease-out infinite; }
.dot-mute { background: var(--text-dim); }
.dot-err  { background: var(--err);    box-shadow: 0 0 8px rgba(255,107,107,.4); }
.dot-warn { background: var(--warn); }

.running-list, .schedule, .alerts {
  list-style: none;
  display: flex; flex-direction: column;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.running-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.running-list li:last-child { border: 0; }
.run-head { display: flex; flex-direction: column; gap: 2px; }
.run-head .mono { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.run-bar {
  grid-column: 1;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.run-bar > div {
  height: 100%;
  width: var(--p);
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  box-shadow: 0 0 8px var(--accent-glow);
  border-radius: 4px;
  animation: shimmer 2.4s ease-in-out infinite;
}
@keyframes shimmer { 0%, 100% { opacity: .8; } 50% { opacity: 1; } }
.run-time {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  align-self: center;
}

.schedule li {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px; align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.schedule li:last-child { border: 0; }
.schedule .when {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.schedule strong {
  font-weight: 500; font-size: 13.5px;
  display: block;
}

.alerts li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.alerts li:last-child { margin-bottom: 0; }
.alert--warn { background: rgba(255,214,107,.06); border-color: rgba(255,214,107,.18); }
.alert--err  { background: rgba(255,107,107,.06); border-color: rgba(255,107,107,.18); }
.alert div   { display: flex; flex-direction: column; gap: 2px; }
.alert strong { font-weight: 500; font-size: 13px; }

.bars {
  display: flex; align-items: flex-end;
  gap: 12px;
  flex: 1;
  min-height: 120px;
}
.bars span {
  flex: 1;
  height: var(--h);
  background: linear-gradient(to top, rgba(166, 161, 138,.18), rgba(166, 161, 138,.45));
  border-radius: 4px 4px 0 0;
  transition: all .3s var(--ease);
  cursor: pointer;
}
.bars span:hover {
  background: linear-gradient(to top, var(--accent), var(--accent-soft));
  box-shadow: 0 0 12px var(--accent-glow);
}
.bars-axis {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.bars-axis span {
  flex: 1;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-mute);
  font-family: var(--mono);
}

.seg {
  display: flex;
  padding: 3px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.seg-i {
  padding: 5px 12px;
  font-size: 11.5px;
  color: var(--text-mute);
  border-radius: 999px;
  font-family: var(--mono);
  transition: all .2s var(--ease);
}
.seg-i:hover { color: var(--text); }
.seg-i.is-on { background: var(--text); color: var(--bg); }

/* ============================================================
   Page toolbar (Flows, Runs, Integrations)
   ============================================================ */
.page-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.toolbar-left {
  display: flex; align-items: baseline; gap: 14px;
}
.toolbar-right {
  display: flex; gap: 8px;
  justify-content: flex-end;
}
.toolbar-mid {
  display: flex; gap: 10px; align-items: center;
}
.search-input {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 280px;
  color: var(--text-mute);
  transition: all .2s var(--ease);
}
.search-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input input {
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13px;
  outline: none;
  width: 100%;
  padding: 5px 0;
}

/* ============================================================
   Data table
   ============================================================ */
.table-wrap {
  flex: 1;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead {
  position: sticky; top: 0;
  background: var(--bg-2);
  z-index: 2;
}
.data-table th {
  font-weight: 500;
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-mute);
  border-bottom: 1px solid var(--border);
}
.data-table th.num { text-align: right; }
.data-table th.ck  { width: 38px; }
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background .2s var(--ease);
  cursor: pointer;
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .name {
  display: flex; align-items: center; gap: 10px;
  font-weight: 500;
}
.data-table .name .ic { width: 24px; height: 24px; }
.data-table .mono { font-family: var(--mono); font-size: 12px; color: var(--text-mute); }
.data-table input[type="checkbox"] {
  appearance: none;
  width: 14px; height: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.data-table input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='m3 8 3 3 7-7' stroke='%23000' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.row-actions {
  display: flex; gap: 4px; justify-content: flex-end;
}
.row-actions .ic-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-mute);
  transition: all .2s var(--ease);
}
.row-actions .ic-btn:hover { background: var(--surface-3); color: var(--text); }

/* status pills inside tables */
.spill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
}
.spill.ok      { color: var(--accent); }
.spill.paused  { color: var(--text-mute); }
.spill.err     { color: var(--err); }
.spill.running { color: var(--violet); }
.spill.warn    { color: var(--warn); }

/* Toggle switch in flow rows */
.switch {
  position: relative;
  width: 30px; height: 17px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: all .2s var(--ease);
}
.switch.on {
  background: rgba(166, 161, 138,.18);
  border-color: var(--accent);
}
.switch.on::after {
  left: 15px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================================
   03 · Copiloto (app layout)
   ============================================================ */
.copilot-app {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.cp-sidebar, .cp-tools-side {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto;
}
.cp-section-title {
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 8px;
  padding: 0 4px;
}
.cp-history {
  list-style: none;
  display: flex; flex-direction: column; gap: 2px;
}
.cp-history li {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .2s var(--ease);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.cp-history li:hover { background: var(--surface-2); }
.cp-history li.is-on { background: var(--surface-3); }
.cp-history li strong { font-weight: 500; font-size: 12.5px; }
.cp-history-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cp-history-main strong,
.cp-history-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-history-del {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--text-dim);
  opacity: 0;
}
.cp-history li:hover .cp-history-del,
.cp-history li.is-on .cp-history-del {
  opacity: 1;
}
.cp-history-del:hover {
  color: var(--err);
  background: rgba(255,107,107,.08);
}

.cp-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex; flex-direction: column;
  min-height: 0;
}
.cp-head {
  padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.cp-head h3 { font-size: 14px; font-weight: 500; }
.cp-tools { display: flex; gap: 6px; }

.cp-chat {
  flex: 1;
  padding: 20px;
  display: flex; flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.cp-welcome {
  align-self: center;
  text-align: center;
  margin: auto 0;
  max-width: 360px;
}
.cp-welcome p { margin: 4px 0; }
.cp-empty {
  padding: 12px;
  font-style: italic;
}
.int-empty, .table-empty {
  padding: 28px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}
.cp-history li.is-loading {
  opacity: .5;
  pointer-events: none;
}
.msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
}
.msg--user {
  background: var(--surface-2);
  border: 1px solid var(--border);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg--bot {
  background: rgba(192,181,255,.06);
  border: 1px solid rgba(192,181,255,.15);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-think {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--violet);
  margin-bottom: 6px;
  opacity: .85;
}
.msg strong { font-family: var(--mono); font-size: 12.5px; color: var(--accent); font-weight: 500; }
.chip {
  display: inline-block;
  padding: 1px 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
}
.code-snip {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
.msg-actions { display: flex; gap: 6px; margin-top: 10px; }

.cp-input {
  display: flex; align-items: center; gap: 8px;
  margin: 14px;
  padding: 6px 6px 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all .2s var(--ease);
}
.cp-input:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-glow);
}
.cp-input input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  padding: 8px 0;
}
.cp-attach {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--text-mute);
  border-radius: 999px;
  transition: all .2s var(--ease);
}
.cp-attach:hover { color: var(--text); background: var(--surface); }
.model-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface);
  font-size: 11px;
  color: var(--text-mute);
  font-family: var(--mono);
}
.send-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: grid; place-items: center;
  transition: all .2s var(--ease);
}
.send-btn:hover { box-shadow: 0 0 0 4px var(--accent-glow); }

.skill-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 6px;
}
.skill-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.skill-list li:hover { background: var(--surface-2); }
.skill-list li div { display: flex; flex-direction: column; gap: 1px; }
.skill-list strong { font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--text); }
.skill-list .small { font-size: 11px; }

.ctx-list {
  list-style: none;
  display: flex; flex-direction: column;
}
.ctx-list li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 4px;
  font-size: 12px;
  border-bottom: 1px dashed var(--border);
}
.ctx-list li:last-child { border: 0; }
.ctx-list span { color: var(--text-mute); }
.ctx-list strong { font-weight: 500; font-family: var(--mono); font-size: 11.5px; }

/* ============================================================
   05 · Integrações
   ============================================================ */
.int-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.int-grid-app {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.int-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 8px;
  transition: all .3s var(--ease);
  position: relative;
  overflow: hidden;
}
.int-card:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.int-card header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.int-card h3 { font-size: 15px; font-weight: 500; }
.int-card footer {
  margin-top: auto;
  display: flex; align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
}
.int-card footer .muted {
  flex: 1 1 100%;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.int-card--warn { border-color: rgba(255,214,107,.25); }
.int-card--warn::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(200px 100px at 50% 0, rgba(255,214,107,.06), transparent 70%);
  pointer-events: none;
}
.i-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* ============================================================
   07 · Admin
   ============================================================ */
.admin-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 14px;
}
.admin-users,
.admin-detail {
  min-height: 0;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.admin-users {
  padding: 8px;
}
.admin-user {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: var(--r-sm);
  text-align: left;
}
.admin-user:hover,
.admin-user.is-on {
  background: var(--surface-2);
}
.admin-user-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.admin-user-main strong,
.admin-user-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user-main strong {
  font-size: 13px;
  font-weight: 500;
}
.admin-user-main em {
  color: var(--text-mute);
  font: 11px var(--mono);
}
.admin-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.admin-detail-head h3 {
  font-size: 18px;
  font-weight: 500;
}
.admin-detail-head span {
  color: var(--text-mute);
  font: 11px var(--mono);
}
.admin-actions {
  display: flex;
  gap: 8px;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.admin-stats div {
  padding: 12px;
  border-right: 1px solid var(--border);
}
.admin-stats div:last-child {
  border-right: 0;
}
.admin-stats span {
  display: block;
  color: var(--text-mute);
  font: 10.5px var(--mono);
  text-transform: uppercase;
}
.admin-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 500;
}
.admin-controls {
  display: grid;
  grid-template-columns: minmax(160px, 240px) auto;
  align-items: end;
  gap: 12px;
}
.admin-check,
.admin-api {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12.5px;
}
.admin-api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.admin-api {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.025);
  font-family: var(--mono);
}
.admin-tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.025);
}
.admin-tool-list span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(166, 161, 138,.11);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
}
.admin-plan-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}
.admin-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.admin-plan-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.018);
}
.admin-plan-card h4 {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 500;
}
.admin-plan-card .admin-api-grid {
  grid-template-columns: 1fr;
}

.wa-qr {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.wa-qr img {
  width: min(220px, 100%);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}
.admin-log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-activity {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.admin-activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-activity h4 {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
}
.admin-activity p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
}
.admin-activity p span {
  color: var(--text-mute);
  font-family: var(--mono);
}
.admin-log-list {
  margin-top: 12px;
}
.admin-log-list p {
  justify-content: flex-start;
}
.admin-log-list p span {
  width: 58px;
}
.admin-log-list p strong {
  width: 44px;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 500;
}

/* ============================================================
   06 · Resultados (output viewer)
   ============================================================ */
.results-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 14px;
  align-content: start;
  overflow-y: auto;
  padding-right: 4px;
}
.results-empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  font-size: 14px;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all .25s var(--ease);
}
.result-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.result-card.is-selected {
  border-color: rgba(166, 161, 138,.42);
  background: rgba(166, 161, 138,.045);
}
.result-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.result-check {
  margin-top: 2px;
  flex: 0 0 auto;
}
.result-card-head h3 {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -.005em;
}
.result-meta {
  display: block;
  font-size: 11px;
  color: var(--text-mute);
  font-family: var(--mono);
  margin-top: 4px;
  letter-spacing: .02em;
}
.result-tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-mute);
  white-space: nowrap;
}
.result-tool-pill.is-gmail    { color: var(--peach);  border-color: rgba(255,138,92,.25); }
.result-tool-pill.is-calendar { color: var(--violet); border-color: rgba(192,181,255,.25); }
.result-tool-pill.is-drive    { color: var(--mint);   border-color: rgba(138,230,180,.25); }
.result-tool-pill.is-docs,
.result-tool-pill.is-sheets,
.result-tool-pill.is-slides,
.result-tool-pill.is-keep,
.result-tool-pill.is-meet     { color: var(--accent); border-color: rgba(166, 161, 138,.25); }

.result-card-body {
  display: flex;
  flex-direction: column;
}
.result-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.result-item:last-child { border-bottom: 0; }
.result-item .ic { width: 22px; height: 22px; }
.result-item-main {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.result-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-item-sub {
  font-size: 11.5px;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-item-side {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-mute);
  white-space: nowrap;
  align-self: center;
}

.result-reply {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 0;
}
.result-kv {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.025);
}
.result-kv span {
  display: block;
  color: var(--text-mute);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 5px;
}
.result-kv strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.result-kv--full {
  grid-column: 1 / -1;
}
.result-kv pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font: 12px/1.5 var(--mono);
}
.result-links {
  grid-column: 1 / -1;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 2px 1px 0;
  font-size: 12px;
}

.result-json {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  overflow-x: auto;
  max-height: 220px;
  white-space: pre;
  margin: 0;
}

.result-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.result-summary {
  font-size: 11.5px;
  color: var(--text-mute);
  font-family: var(--mono);
}

.result-card.is-empty .result-card-body {
  color: var(--text-mute);
  font-style: italic;
  font-size: 12.5px;
  padding: 10px 0;
}

.calendar-mode {
  flex: 0 0 auto;
}
.results-grid.is-calendar {
  grid-template-columns: 1fr;
  align-content: stretch;
}
.calendar-board {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.calendar-board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.calendar-board-head h3 {
  font-size: 18px;
  font-weight: 500;
  text-transform: capitalize;
}
.calendar-board-head span {
  display: block;
  margin-top: 2px;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 11px;
}
.calendar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.025);
}
.calendar-weekdays span {
  padding: 9px 10px;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-right: 1px solid var(--border);
}
.calendar-weekdays span:last-child {
  border-right: 0;
}
.calendar-month {
  flex: 1;
  min-height: 820px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(136px, 1fr));
}
.calendar-day {
  min-width: 0;
  min-height: 0;
  padding: 9px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.012);
  display: grid;
  grid-template-rows: 22px minmax(0, 1fr);
  gap: 6px;
  overflow: hidden;
}
.calendar-day:nth-child(7n) {
  border-right: 0;
}
.calendar-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}
.calendar-day.is-muted {
  opacity: .42;
}
.calendar-day.is-today {
  background: rgba(166, 161, 138,.045);
}
.calendar-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
  font-family: var(--mono);
  font-size: 11px;
}
.calendar-day header strong {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(166, 161, 138,.14);
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
}
.calendar-day-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}
.calendar-event {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 5px;
  padding: 5px 6px;
  min-height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(192,181,255,.18);
  border-radius: 7px;
  background: rgba(192,181,255,.055);
  color: var(--text);
  overflow: hidden;
}
.calendar-event:hover {
  border-color: rgba(192,181,255,.34);
  background: rgba(192,181,255,.09);
}
.calendar-event span {
  color: var(--violet);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.35;
}
.calendar-event strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}
.calendar-event em {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.2;
}
.calendar-more {
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 7px;
}

/* ============================================================
   Drawer (slide from right)
   ============================================================ */
.drawer {
  position: fixed; inset: 0;
  z-index: 60;
  pointer-events: none;
}
.drawer:not([hidden]) { pointer-events: auto; }
.drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute;
  top: 0; right: 0;
  width: min(640px, 92vw);
  height: 100vh;
  background: rgba(14, 14, 18, .95);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .4s var(--ease);
}
.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-head {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.drawer-head h3 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.02em;
  margin-top: 6px;
}
.drawer-body {
  padding: 24px 26px;
  flex: 1;
  overflow-y: auto;
}

/* Flow detail inside drawer */
.flow-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.flow-meta .m {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.flow-meta .m span {
  font-size: 11px; color: var(--text-mute); font-family: var(--mono);
}
.flow-meta .m strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 500;
}

.flow-graph {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 24px;
  min-height: 220px;
}
.flow-graph svg { width: 100%; height: 200px; display: block; }
.fg-node-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--text-mute);
}

.section-title {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.flow-runs {
  list-style: none;
}
.flow-runs li {
  display: grid;
  grid-template-columns: 70px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
}
.flow-runs li:last-child { border: 0; }
.flow-runs .mono { font-family: var(--mono); font-size: 11.5px; color: var(--text-mute); }

/* Log viewer inside drawer */
.log-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 20px;
}
.log-meta .m {
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.log-meta .m span { font-size: 10.5px; color: var(--text-mute); font-family: var(--mono); }
.log-meta .m strong { display: block; margin-top: 3px; font-size: 14px; font-weight: 500; }

.log-stream {
  background: #050507;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  max-height: 380px;
  overflow-y: auto;
}
.log-line {
  display: grid;
  grid-template-columns: 80px 60px 1fr;
  gap: 10px;
}
.log-line .ts   { color: var(--text-dim); }
.log-line .lv   { font-weight: 500; }
.log-line.info .lv { color: var(--text-mute); }
.log-line.ok   .lv { color: var(--accent); }
.log-line.warn .lv { color: var(--warn); }
.log-line.err  .lv { color: var(--err); }
.log-line .ms   { color: var(--text); }

/* ============================================================
   Command palette
   ============================================================ */
.cmdk {
  position: fixed; inset: 0;
  z-index: 70;
  display: grid;
  place-items: start center;
  padding-top: 14vh;
}
.cmdk[hidden] { display: none; }
.cmdk-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(3px);
  animation: fade .2s var(--ease);
}
.cmdk-panel {
  position: relative;
  width: min(620px, 92vw);
  border-radius: var(--r-md);
  overflow: hidden;
  animation: pop .2s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop  { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
.cmdk-input {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mute);
}
.cmdk-input input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.cmdk-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px;
}
.cmdk-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  text-align: left;
  color: var(--text);
  transition: background .15s var(--ease);
}
.cmdk-item:hover, .cmdk-item.is-sel {
  background: var(--surface-2);
}
.cmdk-item .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-mute);
}
.cmdk-section {
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 12px 4px;
}

/* ============================================================
   Toasts
   ============================================================ */
.toasts {
  position: fixed;
  bottom: 80px; right: 24px;
  z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 360px;
}
.toast {
  padding: 12px 16px;
  background: rgba(14,14,18,.95);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  animation: slide-in .35s var(--ease);
}
.toast.out { animation: slide-out .25s var(--ease) forwards; }
.toast .toast-ic {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
}
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-out { to { transform: translateX(100%); opacity: 0; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
  .copilot-app { grid-template-columns: 200px 1fr; }
  .cp-tools-side { display: none; }
  .admin-layout { grid-template-columns: 300px 1fr; }
}
@media (max-width: 1024px) {
  .topnav { display: none; }
  .search-trigger { min-width: 0; }
  .search-trigger span { display: none; }
  .search-trigger kbd { display: none; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 12px; padding: 0 16px; }
  .auth { grid-template-columns: 1fr; padding: 24px; }
  .auth-aside { display: none; }
  .auth-card { justify-self: center; }
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .page--dashboard { padding-top: calc(var(--topbar-h) + 32px); gap: 28px; }
  .page-toolbar { grid-template-columns: 1fr; gap: 12px; }
  .toolbar-mid { flex-wrap: wrap; }
  .search-input { min-width: 0; flex: 1; }
  .calendar-month { min-height: 720px; grid-template-rows: repeat(6, minmax(118px, 1fr)); }
  .calendar-event { grid-template-columns: 1fr; }
  .calendar-event em { grid-column: 1; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-users { max-height: 260px; }
  .admin-plan-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .page { padding: calc(var(--topbar-h) + 16px) 16px 70px; }
  .side-arrow { display: none; }
  .copilot-app { grid-template-columns: 1fr; }
  .cp-sidebar { display: none; }
  .kpi-row { grid-template-columns: 1fr; }
  .kpi + .kpi { border-left: 0; border-top: 1px solid var(--border); padding-left: 0; padding-top: 18px; }
  .indicator-hint { display: none; }
  .admin-stats,
  .admin-controls,
  .admin-activity-grid { grid-template-columns: 1fr; }
  .admin-detail-head { flex-direction: column; }
  .calendar-board-head { align-items: flex-start; flex-direction: column; }
  .calendar-weekdays span { padding: 7px 4px; text-align: center; font-size: 9.5px; }
  .calendar-month { grid-template-rows: repeat(6, minmax(96px, 1fr)); min-height: 580px; }
  .calendar-day { padding: 6px; }
  .calendar-event { padding: 5px; min-height: 28px; }
  .calendar-event strong { font-size: 10.5px; }
  .calendar-event span,
  .calendar-event em { display: none; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .viewport { scroll-behavior: auto; }
}

/* ============================================================
   Documentos
   ============================================================ */
.page--docs .docs-body { display: flex; flex-direction: column; gap: 18px; }

.docs-dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; padding: 22px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg);
  color: var(--text-mute); background: var(--surface);
  cursor: pointer; transition: border-color .2s, background .2s, transform .2s;
}
.docs-dropzone:hover { border-color: var(--accent); color: var(--text); }
.docs-dropzone.is-drag { border-color: var(--accent); background: rgba(166, 161, 138, .08); transform: scale(1.01); }
.docs-dropzone svg { color: var(--accent); }
.docs-dropzone strong { color: var(--text); font-size: 14px; }

.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; align-content: start;
}
.doc-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); transition: border-color .2s, transform .2s;
}
.doc-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.doc-ic { font-size: 26px; flex-shrink: 0; width: 40px; text-align: center; }
.doc-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.doc-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; }
.doc-tag {
  font-family: var(--mono); font-size: 10px; padding: 2px 7px; border-radius: 100px;
  border: 1px solid var(--border); color: var(--text-mute);
}
.doc-tag--generated, .doc-tag--gen {
  color: var(--accent); border-color: rgba(166, 161, 138, .3); background: rgba(166, 161, 138, .08);
}
.doc-tag--email { color: var(--peach); }
.doc-tag--whatsapp { color: var(--mint); }
.doc-actions { display: flex; gap: 6px; flex-shrink: 0; }

.docs-locked { display: grid; place-items: center; flex: 1; min-height: 240px; }
.lock-card { text-align: center; max-width: 380px; padding: 32px; border-radius: var(--r-lg); }
.lock-ic { font-size: 30px; }
.lock-card h3 { margin: 12px 0 8px; font-size: 17px; }

/* ---- anexos do copiloto ---- */
.cp-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px 0; }
.cp-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px;
  font-size: 12px; padding: 5px 10px; border-radius: 100px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.cp-chip.is-up { opacity: .65; }
.cp-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-chip-x { font-size: 15px; line-height: 1; color: var(--text-mute); padding: 0 2px; }
.cp-chip-x:hover { color: var(--err); }
.cp-attach:not(:disabled):hover { color: var(--accent); }
.cp-attach:disabled { opacity: .4; cursor: not-allowed; }

.msg-att { display: block; margin-top: 6px; font-size: 11px; opacity: .85; font-family: var(--mono); }
.mini-btn.danger:hover { color: var(--err); border-color: var(--err); }

/* ---- seletor de gatilho (drawer do fluxo) ---- */
.trigger-edit { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.trigger-edit > div { display: flex; flex-direction: column; gap: 10px; }
.trg-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 13px; }
.trg-row span { color: var(--text-mute); }
.trg-row select, .trg-row input {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 13px;
  color: var(--text); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.trg-row select:focus, .trg-row input:focus { outline: none; border-color: var(--accent); }
#trg-save { align-self: flex-start; margin-top: 4px; }

/* ---- Plano e cobrança (modal de billing) ---- */
.plan-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11.5px;
  font-family: var(--mono);
  letter-spacing: .04em;
  color: var(--text-mute);
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.plan-pill:hover { color: var(--text); border-color: var(--border-strong); }
.plan-pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent-glow);
}
.plan-pill--warn { color: var(--err); border-color: rgba(255,107,107,.35); }
.plan-pill--warn .plan-pill-dot { background: var(--err); box-shadow: 0 0 8px rgba(255,107,107,.4); }

.billing {
  position: fixed; inset: 0;
  z-index: 65; /* acima do drawer (60), abaixo do cmdk (70) */
  display: grid; place-items: center;
}
.billing-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,8,10,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.billing-panel {
  position: relative;
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  border-radius: var(--r-md);
}
.billing-head {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
}
.billing-head .kicker {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-mute);
}
.billing-head h3 { font-size: 20px; font-weight: 500; }
.billing-body {
  padding: 22px 26px 26px;
  display: flex; flex-direction: column; gap: 16px;
}
.bil-alert {
  padding: 12px 16px;
  border: 1px solid rgba(255,107,107,.35);
  border-radius: var(--r-sm);
  background: rgba(255,107,107,.07);
  font-size: 13px;
}
.bil-alert--ok { border-color: rgba(166,161,138,.3); background: var(--accent-glow); }
.bil-current {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-2);
}
.bil-current > div { display: flex; flex-direction: column; gap: 2px; }
.bil-current strong { font-size: 16px; font-weight: 500; }
.bil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.bil-card {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: all .25s var(--ease);
}
.bil-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.bil-card h4 { font-size: 14.5px; font-weight: 500; }
.bil-card .mini-btn { margin-top: auto; justify-content: center; text-align: center; }
.bil-card--pop { border-color: rgba(166,161,138,.35); }
.bil-card--current { border-color: var(--border-strong); background: var(--bg-2); }
.bil-pop {
  position: absolute; top: -8px; right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent); color: var(--bg);
  font-size: 10px; font-family: var(--mono); letter-spacing: .05em;
}
.bil-price { font-size: 19px; font-weight: 600; display: flex; align-items: baseline; gap: 4px; }
.bil-foot { border-top: 1px solid var(--border); padding-top: 12px; }

/* ---- /assinar (página pública de assinatura) ---- */
.co {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 80px 24px 48px;
}
.co-card {
  width: min(960px, 100%);
  padding: 36px;
  border-radius: var(--r-lg);
}
.co-title { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.co-sub { color: var(--text-mute); font-size: 13.5px; margin: 8px 0 18px; max-width: 56ch; }
.co-steps { display: flex; gap: 8px; margin-bottom: 18px; }
.co-step {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-mute);
}
.co-step.is-on { color: var(--accent); border-color: rgba(166,161,138,.35); }
.co-plans {
  margin-bottom: 20px;
  grid-template-columns: repeat(4, 1fr); /* 4 planos sempre lado a lado */
}
@media (max-width: 760px) {
  .co-plans { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .co-plans { grid-template-columns: 1fr; }
}
.co-plan { cursor: pointer; text-align: left; font: inherit; color: inherit; }
.co-plan.is-on {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 0 1px var(--accent);
}
.co-plan--sales { text-decoration: none; }
.co-plan--sales .mini-btn { margin-top: auto; justify-content: center; }
.co-logged {
  padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-2);
  font-size: 13px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.co-secure { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 18px; }
.co-mods { font-size: 12px; color: var(--text-mute); }
.co-mods strong { color: var(--accent); font-weight: 600; }

/* ====== Menu do usuário (avatar) + Configurações ====== */
.user-pop { width: 220px; padding: 6px; }
.user-pop-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 0; border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.user-pop-item:hover { background: var(--surface-2); }
.user-pop-item--danger { color: var(--err); }

.set-group { margin-bottom: 22px; }
.set-group .kicker { display: block; margin-bottom: 10px; }
.set-label {
  display: block;
  font-size: 12px; color: var(--text-mute);
  margin: 10px 0 6px;
}
.set-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
}
.set-input:focus { outline: none; border-color: var(--accent-glow); background: var(--surface-2); }
.set-row { display: flex; gap: 10px; align-items: center; }
.set-row--between { justify-content: space-between; }
.set-row .set-input { flex: 1; }
.set-lang {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-mute);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.set-lang:hover { background: var(--surface-2); }
.set-lang.is-active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.set-toggle {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer;
}
.set-toggle input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* ====== Confirmação no padrão da plataforma ====== */
.confirm {
  position: fixed; inset: 0;
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: pop .15s var(--ease);
}
.confirm-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
}
.confirm-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 24px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #1f2d2e, #182324);
  border: 1px solid var(--border-strong);
  box-shadow: 0 32px 80px -28px rgba(0, 0, 0, .8);
}
.confirm-panel h3 {
  font-size: 17px; font-weight: 700; letter-spacing: -.3px;
  margin-bottom: 8px;
}
.confirm-panel p {
  font-size: 13.5px; color: var(--text-mute); line-height: 1.55;
}
.confirm-panel .set-label { margin-top: 14px; }
.confirm-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px;
}
.confirm-danger {
  background: rgba(255, 107, 107, .14) !important;
  border-color: rgba(255, 107, 107, .45) !important;
  color: var(--err) !important;
}
