/* Splitzo — design system (SaaS admin). Sem dependências, sem build. */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --ink: #0f1729;
  --ink-2: #475069;
  --ink-3: #8a92a6;
  --line: #e6e8ef;
  --line-2: #d3d7e3;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-050: #eef0fe;
  --primary-tint: #f2f3ff;
  --success: #12805c;
  --success-bg: #e7f6ef;
  --warning: #b25e09;
  --warning-bg: #fdf2e3;
  --danger: #d1362f;
  --danger-bg: #fce9e8;
  --info-bg: #e9f0fd;
  --info-ink: #1d4fa5;
  --sidebar: #10152a;
  --sidebar-ink: #c4c9de;
  --sidebar-ink-2: #8891b4;
  --sidebar-active: #1e2547;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px -6px rgba(16, 24, 40, .12);
  --shadow-lg: 0 16px 40px -12px rgba(16, 24, 40, .22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }

/* boot */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line-2); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- auth screens ---------------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; place-items: center; padding: 24px; background:
  radial-gradient(1200px 500px at 100% -10%, #eceafe 0, transparent 55%),
  radial-gradient(900px 500px at -10% 110%, #e6f0fe 0, transparent 55%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 30px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 22px; }
.auth-brand .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; color: #fff; font-weight: 700; }
.auth-brand b { font-size: 18px; letter-spacing: -.02em; }
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--ink-2); margin-bottom: 22px; font-size: 13.5px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--ink-2); }

/* ---------------- app shell ---------------- */
.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.sidebar .brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; }
.sidebar .brand b { color: #fff; font-size: 16.5px; letter-spacing: -.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: var(--sidebar-ink); font-weight: 500; font-size: 13.8px; }
.nav a:hover { background: var(--sidebar-active); text-decoration: none; color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; }
.nav a .ico { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 6px; }
.nav .label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--sidebar-ink-2); padding: 6px 11px 4px; }
.sidebar .foot { margin-top: auto; padding: 10px 8px 4px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .who { font-size: 12.5px; color: var(--sidebar-ink-2); }
.sidebar .who b { color: #fff; display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 20; }
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.content { padding: 26px; max-width: 1080px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .desc { color: var(--ink-2); font-size: 13.8px; margin-top: 3px; max-width: 640px; }

/* ---------------- cards ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; }
.card-head .desc { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.card-body { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* stat cards */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat .k { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.stat .v { font-size: 26px; font-weight: 680; letter-spacing: -.02em; margin-top: 6px; }
.stat .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ---------------- forms ---------------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 550; color: var(--ink); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 9px 11px; transition: border-color .12s, box-shadow .12s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); }
input.err, textarea.err { border-color: var(--danger); }
textarea { resize: vertical; min-height: 60px; }
.field .err-msg { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* range slider */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--line-2); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; cursor: pointer; }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 13.8px; font-weight: 550; border: 1px solid transparent; border-radius: var(--radius); padding: 9px 15px; cursor: pointer; transition: background .12s, border-color .12s, opacity .12s; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-600); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b02722; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-bg); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.icon { padding: 7px; width: 34px; height: 34px; }
.btn.block { width: 100%; }
.btn .ico { width: 16px; height: 16px; }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr:hover td { background: var(--surface-2); }
.actions { display: flex; gap: 2px; justify-content: flex-end; }

/* ---------------- badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.badge.active { background: var(--success-bg); color: var(--success); }
.badge.paused { background: var(--warning-bg); color: var(--warning); }
.badge.draft { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.completed { background: var(--info-bg); color: var(--info-ink); }
.badge.admin { background: var(--primary-050); color: var(--primary-600); }
.badge.user { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.pending { background: var(--warning-bg); color: var(--warning); }

/* ---------------- alerts ---------------- */
.alert { display: flex; gap: 11px; padding: 13px 15px; border-radius: var(--radius); font-size: 13.5px; align-items: flex-start; }
.alert .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.info { background: var(--info-bg); color: var(--info-ink); }
.alert.warn { background: var(--warning-bg); color: var(--warning); }
.alert.danger { background: var(--danger-bg); color: var(--danger); }
.alert.success { background: var(--success-bg); color: var(--success); }
.alert b { font-weight: 650; }

/* ---------------- empty state ---------------- */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-2); }
.empty .ico { width: 42px; height: 42px; color: var(--ink-3); margin-bottom: 12px; }
.empty h3 { color: var(--ink); margin-bottom: 5px; }
.empty p { font-size: 13.5px; max-width: 420px; margin: 0 auto 16px; }

/* ---------------- variations editor ---------------- */
.var { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.var-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.var-head input { max-width: 220px; font-weight: 550; }
.var .url-wrap { position: relative; }
.var .url-wrap .status { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; }
.weight-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 13px; color: var(--ink-2); }
.weight-row b { color: var(--ink); }
.total-row { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.total-row.bad { color: var(--danger); }

/* ---------------- copy field ---------------- */
.copy-field { display: flex; align-items: stretch; gap: 0; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.copy-field code { flex: 1; border: 0; border-radius: 0; background: var(--surface-2); display: flex; align-items: center; padding: 9px 12px; font-size: 12.8px; overflow-x: auto; white-space: nowrap; }
.copy-field button { border: 0; border-left: 1px solid var(--line-2); background: var(--surface); padding: 0 13px; cursor: pointer; color: var(--ink-2); }
.copy-field button:hover { background: var(--surface-2); color: var(--primary); }

/* code block */
pre.code { background: #0f1729; color: #e7e9f2; border-radius: var(--radius); padding: 14px 16px; font-family: var(--mono); font-size: 12.6px; overflow-x: auto; position: relative; }
pre.code .cp { position: absolute; right: 8px; top: 8px; background: rgba(255,255,255,.1); border: 0; color: #cbd0e6; border-radius: 6px; padding: 4px 8px; font-size: 11.5px; cursor: pointer; }
pre.code .cp:hover { background: rgba(255,255,255,.2); }

/* steps */
.steps { counter-reset: step; }
.step { display: flex; gap: 14px; padding: 6px 0 18px; position: relative; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.step .n { counter-increment: step; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--primary-050); color: var(--primary-600); display: grid; place-items: center; font-weight: 650; font-size: 14px; z-index: 1; }
.step .n::before { content: counter(step); }
.step .body { padding-top: 4px; }
.step .body h3 { margin-bottom: 4px; }
.step .body p { color: var(--ink-2); font-size: 13.6px; margin-bottom: 8px; }

/* funnel bars */
.funnel { display: flex; flex-direction: column; gap: 4px; }
.funnel .fb { position: relative; height: 30px; border-radius: 6px; background: var(--primary-tint); overflow: hidden; }
.funnel .fb > i { position: absolute; inset: 0; background: var(--primary); opacity: .16; border-radius: 6px; }
.funnel .fb > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 12.5px; }
.prob-bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.prob-bar > i { display: block; height: 100%; background: var(--primary); }

/* ---------------- modal / confirm ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 41, .5); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; padding: 24px; }
.modal h2 { margin-bottom: 8px; }
.modal p { color: var(--ink-2); font-size: 13.8px; margin-bottom: 20px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------- toasts ---------------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px 16px; font-size: 13.5px; min-width: 260px; max-width: 360px; animation: slidein .2s ease; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast b { display: block; margin-bottom: 1px; }
.toast .m { color: var(--ink-2); font-size: 13px; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

/* menu */
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px; z-index: 30; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: 13.5px; color: var(--ink); padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .sep { height: 1px; background: var(--line); margin: 5px 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-050); color: var(--primary-600); display: grid; place-items: center; font-weight: 650; font-size: 14px; cursor: pointer; }

/* misc */
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.spacer { flex: 1; }
.tag-lang { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.tag-lang button { border: 0; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; padding: 5px 10px; cursor: pointer; }
.tag-lang button.on { background: var(--primary); color: #fff; }
.chart { width: 100%; height: 260px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; transition: left .2s; z-index: 40; width: 244px; }
  .sidebar.open { left: 0; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .content { padding: 18px; }
}
.menu-btn { display: none; }
@media (max-width: 820px) { .menu-btn { display: inline-flex; } }

/* ---------------- plans / billing ---------------- */
.usage { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.usage-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.usage-h b { color: var(--ink); font-size: 14px; }
.meter { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }
.meter i.over { background: var(--danger); }
.plan-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.plan-card.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.plan-name { font-size: 16px; font-weight: 650; }
.plan-price { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 14px; }
.plan-price .per { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.plan-feats { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 0 0 18px; flex: 1; }
.plan-feats li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.plan-feats li .ico.ok { color: var(--success); flex: none; width: 16px; height: 16px; margin-top: 2px; }
.plan-feats li b { color: var(--ink); }
.plan-cta { margin-top: auto; }
.badge.plan-free { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2); }
.badge.plan-pro { background: var(--info-bg); color: var(--info-ink); }
.badge.plan-max { background: var(--primary-050); color: var(--primary-600); }
.badge.plan-agency { background: #efeafd; color: #6d28d9; }
.plan-sel { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
