/* ==========================================================================
   ZapMatrix — design system (verde futurista · Apple-like · dark + light)
   ========================================================================== */

:root {
  --bg: #040706;
  --bg-2: #071009;
  --panel: rgba(255, 255, 255, 0.036);
  --panel-2: rgba(255, 255, 255, 0.058);
  --panel-solid: #0b1310;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9f5ee;
  --text-2: #c3d6cb;
  --muted: #7f9c8d;
  --faint: #55705f;
  --green: #00e58a;
  --green-2: #7dffc4;
  --green-deep: #04a567;
  --lime: #b6ff3d;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --red: #fb7185;
  --blue: #60a5fa;
  --glow: rgba(0, 229, 138, 0.22);
  --glow-soft: rgba(0, 229, 138, 0.08);
  --shadow: 0 24px 70px -30px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 10px 30px -18px rgba(0, 0, 0, 0.7);
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --sidebar: 252px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #f3f8f5;
  --bg-2: #eaf4ee;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-2: #ffffff;
  --panel-solid: #ffffff;
  --line: rgba(4, 42, 27, 0.09);
  --line-strong: rgba(4, 42, 27, 0.18);
  --text: #061710;
  --text-2: #254336;
  --muted: #5c7a6b;
  --faint: #8aa295;
  --green: #00a86a;
  --green-2: #05c47c;
  --green-deep: #067a4e;
  --lime: #4f9d00;
  --glow: rgba(0, 168, 106, 0.2);
  --glow-soft: rgba(0, 168, 106, 0.07);
  --shadow: 0 30px 70px -38px rgba(4, 42, 27, 0.35);
  --shadow-sm: 0 14px 34px -22px rgba(4, 42, 27, 0.28);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 82% -10%, rgba(0, 229, 138, 0.13), transparent 62%),
    radial-gradient(700px 520px at -10% 88%, rgba(34, 211, 238, 0.07), transparent 60%),
    radial-gradient(600px 500px at 45% 115%, rgba(125, 255, 196, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 78%);
  pointer-events: none;
  opacity: 0.8;
}
html[data-theme="light"] body::after {
  background-image:
    linear-gradient(to right, rgba(4, 42, 27, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(4, 42, 27, 0.035) 1px, transparent 1px);
}
::selection { background: rgba(0, 229, 138, 0.32); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
svg { width: 16px; height: 16px; flex: 0 0 auto; }
svg.chart { width: 100%; height: 168px; }
.flow-edges { width: 100%; height: 100%; }
.brand-mark svg, .mark svg { width: 21px; height: 21px; }
.empty .ico svg { width: 25px; height: 25px; }
.stat-ic svg { width: 17px; height: 17px; }
.auth-point svg { width: 17px; height: 17px; flex: 0 0 17px; }
.msg-media video, .msg-media img { width: 100%; }

[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(127, 156, 141, 0.28); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------- tipografia */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.035em; line-height: 1.12; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 16px; letter-spacing: -0.02em; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.green { color: var(--green); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0; }
.tiny { font-size: 11.5px; }
.small { font-size: 12.5px; }
.strong { font-weight: 650; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--green);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--green); box-shadow: 0 0 12px var(--green); }
.grad-text {
  background: linear-gradient(100deg, var(--text) 10%, var(--green-2) 55%, var(--green) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ----------------------------------------------------------------- layout */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px 14px 16px;
  background: linear-gradient(180deg, rgba(9, 16, 13, 0.92), rgba(4, 7, 6, 0.94));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
}
html[data-theme="light"] .sidebar { background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(240,248,244,.96)); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #062a1d, #0a3d29 55%, #052018);
  border: 1px solid rgba(0, 229, 138, 0.35);
  box-shadow: 0 0 24px -6px rgba(0, 229, 138, 0.55), inset 0 0 18px rgba(0, 229, 138, 0.12);
}
.brand-mark svg { width: 21px; height: 21px; color: var(--green); filter: drop-shadow(0 0 7px rgba(0,229,138,.6)); }
.brand-name { font-size: 17px; font-weight: 750; letter-spacing: -0.04em; }
.brand-name span { color: var(--green); }
.brand-sub { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding: 16px 12px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; color: var(--muted);
  font-size: 13.5px; font-weight: 550; transition: 0.16s ease; border: 1px solid transparent;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.85; flex: 0 0 18px; }
.nav-item:hover { color: var(--text-2); background: rgba(255, 255, 255, 0.035); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(0, 229, 138, 0.15), rgba(0, 229, 138, 0.03) 70%, transparent);
  border-color: rgba(0, 229, 138, 0.16);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 4px 4px 0; background: var(--green); box-shadow: 0 0 14px var(--green);
}
.nav-item.active svg { color: var(--green); opacity: 1; filter: drop-shadow(0 0 6px rgba(0,229,138,.5)); }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--green); color: #032015; font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center;
}
.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 14px; }
.user-chip:hover { background: rgba(255,255,255,.04); }
.user-chip .avatar { width: 34px; height: 34px; }
.user-chip-name { font-size: 12.5px; font-weight: 650; }
.user-chip-plan { font-size: 10.5px; color: var(--faint); }
.icon-row { display: flex; gap: 2px; margin-left: auto; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: 64px; flex: 0 0 64px;
  display: flex; align-items: center; gap: 14px; padding: 0 clamp(16px, 3vw, 34px);
  background: rgba(4, 7, 6, 0.72); backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
html[data-theme="light"] .topbar { background: rgba(247, 251, 249, 0.78); }
.topbar .crumbs { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.topbar .crumbs b { color: var(--text); font-weight: 600; }
.topbar-spacer { flex: 1; }
.menu-btn { display: none; }
.page { padding: clamp(18px, 3vw, 34px); max-width: 1560px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .grow { flex: 1; min-width: 220px; }
.page-sub { color: var(--muted); margin-top: 7px; font-size: 13.5px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 17px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--text); font-size: 13px; font-weight: 600;
  transition: 0.16s ease; white-space: nowrap; letter-spacing: -0.01em;
}
.btn:hover { background: var(--panel-2); border-color: rgba(255,255,255,.26); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(180deg, #16f09a, #00cf7d); border-color: rgba(0, 229, 138, 0.6);
  color: #022116; box-shadow: 0 10px 34px -14px rgba(0, 229, 138, 0.75), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { background: linear-gradient(180deg, #2bffab, #06dd87); box-shadow: 0 14px 40px -12px rgba(0, 229, 138, 0.9); }
.btn-soft { background: rgba(0, 229, 138, 0.1); border-color: rgba(0, 229, 138, 0.22); color: var(--green); }
.btn-soft:hover { background: rgba(0, 229, 138, 0.16); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel); color: var(--text); }
.btn-danger { background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.25); color: var(--red); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.18); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 12px; }
.btn-icon.btn-sm { width: 30px; height: 30px; border-radius: 9px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- inputs */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: -0.005em; }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.45; }
.input, .textarea, .select {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  color: var(--text); outline: none; transition: 0.15s ease; font-size: 13.5px;
}
html[data-theme="light"] .input, html[data-theme="light"] .textarea, html[data-theme="light"] .select {
  background: #fff; border-color: rgba(4,42,27,.13);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(0, 229, 138, 0.55); box-shadow: 0 0 0 3px rgba(0, 229, 138, 0.11);
  background: rgba(0, 229, 138, 0.03);
}
.textarea { height: auto; min-height: 100px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f9c8d' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
select option { background: var(--panel-solid); color: var(--text); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 0; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }

.switch { position: relative; width: 42px; height: 24px; flex: 0 0 42px; border-radius: 99px; background: rgba(127,156,141,.28); border: 1px solid var(--line); cursor: pointer; transition: .18s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 99px; background: #fff; transition: .18s; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch.on { background: var(--green); border-color: transparent; box-shadow: 0 0 18px -4px var(--green); }
.switch.on::after { left: 21px; background: #032015; }

/* ----------------------------------------------------------------- cards */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
html[data-theme="light"] .card { background: #fff; box-shadow: 0 18px 40px -30px rgba(4,42,27,.3); }
.card-pad { padding: 20px; }
.card-hover { transition: .2s ease; }
.card-hover:hover { transform: translateY(-3px); border-color: rgba(0, 229, 138, 0.3); box-shadow: 0 28px 60px -34px rgba(0, 229, 138, 0.45); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { flex: 1; }
.card-title { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-glow::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -110px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 65%); pointer-events: none;
}
.stat { padding: 19px 20px; }
.stat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.stat-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(0, 229, 138, 0.09); border: 1px solid rgba(0,229,138,.18); color: var(--green); }
.stat-ic svg { width: 17px; height: 17px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 550; }
.stat-value { font-size: 31px; font-weight: 750; letter-spacing: -0.045em; line-height: 1; }
.stat-foot { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.delta { font-size: 11px; font-weight: 700; color: var(--green); background: rgba(0,229,138,.1); padding: 2px 7px; border-radius: 99px; }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px;
  border-radius: 99px; font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap;
}
.badge.green { background: rgba(0,229,138,.1); border-color: rgba(0,229,138,.25); color: var(--green-2); }
.badge.amber { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.25); color: var(--amber); }
.badge.red { background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.25); color: var(--red); }
.badge.blue { background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.25); color: var(--blue); }
.badge.violet { background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.25); color: var(--violet); }
.badge.gray { color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--green); box-shadow: 0 0 8px var(--green); flex: 0 0 7px; }
.dot.amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot.red { background: var(--red); box-shadow: 0 0 8px var(--red); }
.dot.gray { background: var(--faint); box-shadow: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 7px; font-size: 10.5px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); }
.tag i { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(0,229,138,.22), rgba(34,211,238,.14));
  border: 1px solid rgba(0,229,138,.22); color: var(--green-2); font-weight: 700; font-size: 13px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
.avatar.lg { width: 54px; height: 54px; flex-basis: 54px; font-size: 18px; }

/* ---------------------------------------------------------------- tabela */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--faint); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: .13s; }
.table tbody tr:hover { background: rgba(255,255,255,.025); }
.cell-main { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.cell-name { font-weight: 600; font-size: 13px; }
.cell-sub { font-size: 11.5px; color: var(--muted); }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* --------------------------------------------------------------- modais */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(2, 6, 4, 0.66);
  backdrop-filter: blur(10px); display: grid; place-items: center; padding: 18px;
  animation: fade .18s ease;
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: linear-gradient(180deg, #0c1611, #07100c); border: 1px solid var(--line-strong);
  border-radius: 26px; box-shadow: 0 40px 120px -30px rgba(0,0,0,.9);
  animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
html[data-theme="light"] .modal { background: #fff; }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 0; }
.modal-head h2 { font-size: 20px; flex: 1; }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 0 24px 22px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(2,6,4,.6); backdrop-filter: blur(6px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 101; width: min(560px, 100%);
  background: linear-gradient(180deg, #0b1510, #060d09); border-left: 1px solid var(--line);
  box-shadow: -30px 0 90px -30px rgba(0,0,0,.8); overflow-y: auto; animation: slidein .22s ease;
}
html[data-theme="light"] .drawer { background: #fff; }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: inherit; }
.drawer-body { padding: 22px; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98) } }
@keyframes slidein { from { transform: translateX(30px); opacity: .4 } }

/* ---------------------------------------------------------------- toasts */
.toast-wrap { position: fixed; z-index: 200; right: 18px; top: 18px; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px;
  padding: 12px 15px; border-radius: 14px; background: #0e1a14; border: 1px solid rgba(0,229,138,.28);
  box-shadow: 0 20px 50px -18px rgba(0,0,0,.8); font-size: 13px; animation: toastin .22s ease;
}
html[data-theme="light"] .toast { background: #fff; }
.toast.err { border-color: rgba(251,113,133,.4); }
.toast svg { width: 17px; height: 17px; color: var(--green); flex: 0 0 17px; }
.toast.err svg { color: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateY(-8px) } }
.toast.out { animation: toastout .2s forwards; }
@keyframes toastout { to { opacity: 0; transform: translateX(20px) } }

/* ----------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); width: fit-content; }
.tab { height: 32px; padding: 0 13px; border: 0; background: transparent; border-radius: 9px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tab.active { background: var(--panel-2); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segmented button { border: 0; background: transparent; padding: 7px 13px; font-size: 12px; color: var(--muted); }
.segmented button.active { background: var(--green); color: #032015; font-weight: 700; }

/* -------------------------------------------------------------- progresso */
.progress { height: 7px; border-radius: 99px; background: rgba(127,156,141,.16); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-deep), var(--green)); box-shadow: 0 0 14px var(--glow); transition: width .5s ease; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 58px 20px; color: var(--muted); }
.empty .ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--green); }
.empty .ico svg { width: 25px; height: 25px; }
.empty h3 { color: var(--text); }
.empty p { max-width: 360px; font-size: 13px; }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; height: 168px; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 16px; font-size: 11px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; }

/* ------------------------------------------------------------ auth/landing */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.auth-aside {
  position: relative; overflow: hidden; padding: 44px; display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(700px 500px at 20% 0%, rgba(0,229,138,.16), transparent 60%),
    radial-gradient(600px 500px at 100% 100%, rgba(34,211,238,.08), transparent 60%),
    linear-gradient(160deg, #061009, #040706);
}
.auth-aside::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(ellipse at 30% 20%, #000, transparent 70%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-quote { font-size: clamp(26px, 3.4vw, 42px); font-weight: 750; letter-spacing: -0.045em; line-height: 1.08; max-width: 560px; }
.auth-quote em { font-style: normal; color: var(--green); }
.auth-points { display: grid; gap: 12px; margin-top: 26px; }
.auth-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: var(--text-2); }
.auth-point svg { width: 17px; height: 17px; color: var(--green); flex: 0 0 17px; margin-top: 2px; }
.auth-main { display: grid; place-items: center; padding: 32px 22px; }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: 30px; margin-bottom: 6px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; }
.auth-switch { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 18px; }
.auth-switch a { color: var(--green); font-weight: 600; cursor: pointer; }
.auth-err { background: rgba(251,113,133,.1); border: 1px solid rgba(251,113,133,.28); color: #ffc3cc; font-size: 12.5px; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.auth-orbs { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 12s ease-in-out infinite; }
.orb.a { width: 260px; height: 260px; background: rgba(0,229,138,.5); top: -60px; right: -40px; }
.orb.b { width: 200px; height: 200px; background: rgba(34,211,238,.35); bottom: 10%; left: -60px; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-18px) } }

/* ------------------------------------------------------------------ inbox */
.inbox { display: grid; grid-template-columns: 342px 1fr; height: calc(100vh - 64px); min-height: 500px; }
.convos { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: rgba(255,255,255,.012); }
.convos-head { padding: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 11px; }
.convos-list { overflow-y: auto; flex: 1; }
.convo {
  display: flex; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: .12s; position: relative;
}
.convo:hover { background: rgba(255,255,255,.03); }
.convo.active { background: linear-gradient(90deg, rgba(0,229,138,.11), rgba(0,229,138,.02)); }
.convo.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--green); }
.convo-body { flex: 1; min-width: 0; }
.convo-top { display: flex; align-items: center; gap: 7px; }
.convo-name { font-size: 13px; font-weight: 600; flex: 1; }
.convo-time { font-size: 10.5px; color: var(--faint); }
.convo-preview { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.unread-dot { min-width: 18px; height: 18px; border-radius: 99px; background: var(--green); color: #032015; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.chat { display: flex; flex-direction: column; min-height: 0; background: radial-gradient(700px 500px at 70% 0%, rgba(0,229,138,.04), transparent 60%); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 64px; }
.chat-head-main { flex: 1; min-width: 0; }
.chat-head-name { font-size: 14px; font-weight: 650; }
.chat-head-sub { font-size: 11px; color: var(--muted); }
.msgs { flex: 1; overflow-y: auto; padding: 22px 20px 12px; display: flex; flex-direction: column; gap: 7px; }
.msgs-day { align-self: center; font-size: 10.5px; color: var(--faint); background: var(--panel); padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); margin: 8px 0; }
.msg { max-width: min(460px, 78%); padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; position: relative; animation: msgin .16s ease; }
@keyframes msgin { from { opacity: 0; transform: translateY(4px) } }
.msg-in { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg-out { align-self: flex-end; background: linear-gradient(140deg, #00d987, #00bf78); color: #022116; border-bottom-right-radius: 5px; box-shadow: 0 6px 20px -10px rgba(0,229,138,.6); }
.msg-out .msg-time { color: rgba(2,33,22,.6); }
.msg-time { font-size: 9.5px; opacity: .6; margin-top: 3px; text-align: right; }
.msg-status { font-size: 9.5px; margin-left: 5px; }
.msg-media { border-radius: 10px; overflow: hidden; margin-bottom: 5px; max-width: 260px; }
.window-note { margin: 12px 20px 0; padding: 10px 14px; border-radius: 12px; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.22); color: var(--amber); font-size: 12px; display: flex; gap: 9px; align-items: center; }
.window-note svg { width: 16px; height: 16px; flex: 0 0 16px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.composer .textarea { min-height: 44px; max-height: 140px; border-radius: 14px; }
.composer-actions { display: flex; gap: 4px; }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }

/* ----------------------------------------------------------------- kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 18px; align-items: flex-start; }
.kcol { width: 300px; flex: 0 0 300px; background: rgba(255,255,255,.022); border: 1px solid var(--line); border-radius: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kcol.drag-over { border-color: rgba(0,229,138,.5); background: rgba(0,229,138,.05); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.kcol-head .dot { box-shadow: none; }
.kcol-name { font-size: 12.5px; font-weight: 650; flex: 1; }
.kcol-count { font-size: 10.5px; color: var(--muted); background: var(--panel); padding: 2px 7px; border-radius: 99px; }
.kcol-body { padding: 9px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 80px; }
.kcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 13px; padding: 11px; cursor: grab; transition: .15s; }
html[data-theme="light"] .kcard { background: #fff; }
.kcard:hover { border-color: rgba(0,229,138,.3); transform: translateY(-1px); }
.kcard.dragging { opacity: .4; }
.kcard-top { display: flex; align-items: center; gap: 9px; }
.kcard-name { font-size: 12.5px; font-weight: 600; flex: 1; min-width: 0; }
.kcard-meta { font-size: 10.5px; color: var(--faint); margin-top: 7px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------- robô */
.flow-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; height: calc(100vh - 150px); min-height: 520px; }
.flow-canvas {
  position: relative; overflow: auto; border-radius: 22px; border: 1px solid var(--line);
  background-color: rgba(255,255,255,.016);
  background-image: radial-gradient(rgba(127,156,141,.22) 1px, transparent 1px);
  background-size: 22px 22px; box-shadow: var(--shadow-sm);
}
.flow-inner { position: relative; min-width: 700px; min-height: 700px; }
.flow-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flow-edges path.hit { pointer-events: stroke; cursor: pointer; }
.node {
  position: absolute; width: 250px; border-radius: 16px; background: #0b1511;
  border: 1px solid var(--line-strong); box-shadow: 0 16px 36px -22px rgba(0,0,0,.9);
  transition: box-shadow .15s, border-color .15s; user-select: none;
}
html[data-theme="light"] .node { background: #fff; }
.node.selected { border-color: rgba(0,229,138,.65); box-shadow: 0 0 0 3px rgba(0,229,138,.12), 0 20px 50px -24px rgba(0,229,138,.45); }
.node-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line); cursor: grab; border-radius: 16px 16px 0 0; }
.node-head:active { cursor: grabbing; }
.node-badge { font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 6px; border-radius: 6px; background: rgba(0,229,138,.12); color: var(--green); }
.node-badge.img { background: rgba(96,165,250,.12); color: var(--blue); }
.node-badge.vid { background: rgba(167,139,250,.12); color: var(--violet); }
.node-badge.aud { background: rgba(251,191,36,.12); color: var(--amber); }
.node-badge.cta { background: rgba(34,211,238,.12); color: var(--cyan); }
.node-badge.btn { background: rgba(251,113,133,.12); color: var(--red); }
.node-badge.delay { background: rgba(127,156,141,.14); color: var(--muted); }
.node-title { font-size: 11.5px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-body { padding: 10px 12px; font-size: 11.5px; color: var(--text-2); line-height: 1.45; max-height: 76px; overflow: hidden; }
.node-body img { border-radius: 8px; max-height: 60px; width: 100%; object-fit: cover; margin-bottom: 5px; }
.node-foot { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-top: 1px solid var(--line); font-size: 10px; color: var(--faint); }
.node-port {
  position: absolute; right: -8px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; border-radius: 50%;
  background: var(--green); border: 3px solid #06100b; box-shadow: 0 0 12px var(--green); cursor: crosshair; z-index: 3;
}
.node-port:hover { transform: translateY(-50%) scale(1.25); }
.node-add {
  position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 8px;
  background: var(--green); color: #032015; border: 0; font-size: 15px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 14px var(--glow); z-index: 3;
}
.inspector { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); display: flex; flex-direction: column; overflow: hidden; }
.inspector-head { padding: 15px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.inspector-body { padding: 16px 17px; overflow-y: auto; }
.flow-toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.flow-toolbar .btn { height: 34px; font-size: 11.5px; padding: 0 11px; }

/* ------------------------------------------------------------------ listas */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item-title { font-size: 12.5px; font-weight: 600; }
.list-item-sub { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- landing */
.lp { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.lp-nav { display: flex; align-items: center; gap: 22px; padding: 20px 0; }
.lp-nav .links { display: flex; gap: 20px; font-size: 13px; color: var(--muted); margin-left: 14px; }
.lp-nav .links a:hover { color: var(--text); }
.lp-hero { padding: clamp(40px, 8vw, 100px) 0 70px; text-align: center; position: relative; }
.lp-hero h1 { font-size: clamp(40px, 7vw, 76px); letter-spacing: -0.05em; line-height: 0.98; }
.lp-hero p { max-width: 620px; margin: 20px auto 0; color: var(--muted); font-size: clamp(14px, 2vw, 17px); }
.lp-cta { display: flex; gap: 10px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.lp-mock { margin-top: 54px; border-radius: 24px; border: 1px solid var(--line-strong); box-shadow: var(--shadow); overflow: hidden; background: #07100c; }
.lp-mock img { width: 100%; }
.lp-section { padding: 70px 0; }
.lp-section h2 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.045em; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 30px; }
.lp-feat { padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.lp-feat .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(0,229,138,.09); border: 1px solid rgba(0,229,138,.2); color: var(--green); margin-bottom: 14px; }
.lp-feat h3 { margin-bottom: 6px; }
.lp-feat p { color: var(--muted); font-size: 13px; }
.lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 28px; }
.lp-plan { padding: 26px; border-radius: 24px; border: 1px solid var(--line); background: var(--panel); position: relative; }
.lp-plan.featured { border-color: rgba(0,229,138,.45); box-shadow: 0 30px 70px -40px rgba(0,229,138,.5); }
.lp-plan .price { font-size: 36px; font-weight: 750; letter-spacing: -0.05em; margin: 14px 0 4px; }
.lp-plan ul { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 10px; font-size: 13px; color: var(--text-2); }
.lp-plan li { display: flex; gap: 9px; }
.lp-plan li svg { width: 15px; height: 15px; color: var(--green); flex: 0 0 15px; margin-top: 3px; }
.lp-foot { border-top: 1px solid var(--line); padding: 30px 0 50px; color: var(--faint); font-size: 12px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* --------------------------------------------------------------- helpers */
.fade-in { animation: fade .25s ease; }
.pulse-dot { position: relative; }
.pulse-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(0,229,138,.5); animation: ring 2.2s infinite; }
@keyframes ring { 0% { transform: scale(.7); opacity: .9 } 100% { transform: scale(1.7); opacity: 0 } }
.scroll-x { overflow-x: auto; }
.hide-mobile { display: initial; }
.mobile-only { display: none !important; }
.card-stack { display: flex; flex-direction: column; gap: 10px; }

/* --------------------------------------------------------------- responsivo */
@media (max-width: 1280px) {
  .flow-wrap { grid-template-columns: minmax(0, 1fr); height: auto; }
  .flow-canvas { height: 520px; }
  .inspector { max-height: none; }
}
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-wrap { grid-template-columns: minmax(0, 1fr); height: auto; }
  .flow-canvas { height: 520px; }
  .inspector { max-height: none; }
  .inbox { grid-template-columns: 300px 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox { grid-template-columns: 1fr; }
  .inbox .chat { display: none; }
  .inbox.chat-open .convos { display: none; }
  .inbox.chat-open .chat { display: flex; }
  .back-chat { display: inline-flex !important; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-104%); transition: transform .22s ease; box-shadow: 30px 0 80px rgba(0,0,0,.6); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .page { padding: 16px; }
  .g2 { grid-template-columns: 1fr; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-mobile { display: none !important; }
  .mobile-only { display: initial !important; }
  .topbar { padding: 0 14px; }
  .toast-wrap { left: 12px; right: 12px; top: 12px; }
  .toast { max-width: none; }
  .drawer { width: 100%; }
  .modal { border-radius: 22px; }
  .flow-inner { min-width: 1100px; }
}
@media (max-width: 560px) {
  .g3 { grid-template-columns: 1fr; }
  .stat-value { font-size: 27px; }
  .page-head { margin-bottom: 18px; }
  .btn { height: 38px; padding: 0 14px; font-size: 12.5px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .kanban { gap: 10px; }
  .kcol { width: 84vw; flex-basis: 84vw; }
  .msg { max-width: 88%; }
  .convos { border-right: 0; }
}

/* ------------------------------------------------------- pacotes (admin) */
.lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.lp-plan { position: relative; border: 1px solid var(--line); border-radius: 24px; padding: 24px; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); }
.lp-plan.featured { border-color: rgba(0,229,138,.45); box-shadow: 0 34px 80px -50px rgba(0,229,138,.55); }
.lp-plan h3 { font-size: 20px; }
.lp-plan .price { font-size: 34px; font-weight: 750; letter-spacing: -.05em; margin: 14px 0 2px; }
.lp-plan ul { list-style: none; padding: 0; margin: 18px 0 20px; display: grid; gap: 9px; font-size: 12.5px; color: var(--text-2); }
.lp-plan li { display: flex; gap: 8px; align-items: flex-start; }
.lp-plan li svg { width: 14px; height: 14px; color: var(--green); flex: 0 0 14px; margin-top: 3px; }

@media (max-width: 700px) { .stat-mini { grid-template-columns: repeat(2, minmax(0,1fr)) !important; } }
@media (max-width: 430px) { .g4 { grid-template-columns: 1fr; } .stat-value { font-size: 26px; } }
