:root {
  --ink: #07080a; --bg: #0c0e11; --card: #13161a; --card2: #191c21; --line: #262a31; --mute: #8a909b; --text: #eef0f3;
  --accent: #e4ff2b; --accent2: #00e0c0; --ok: #3ddc84;
  --display: 'Big Shoulders Display', sans-serif; --body: 'Inter Tight', system-ui, sans-serif; --mono: 'JetBrains Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 900; font-size: 20px; letter-spacing: .1em; }
.brand-num { background: var(--accent); color: var(--ink); padding: 2px 8px 0; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; font-weight: 700; font-size: 14px; border-radius: 6px; transition: .2s; white-space: nowrap; }
.btn.red { background: var(--accent); color: var(--ink); }
.btn.red:hover:not(:disabled) { background: #efff70; }
.btn.ghost { box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--card2); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(50% 50% at 50% 30%, rgba(228,255,43,.15), transparent 70%), var(--ink); }
.login-box { width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 32px; display: grid; gap: 16px; }
.login-box h1 { font-family: var(--display); font-size: 40px; text-transform: uppercase; line-height: 1; margin-top: 10px; }
.login-box p { color: var(--mute); }
.msg { color: #ff5a4f !important; font-size: 13px; min-height: 1.3em; }

/* layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--ink); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 8px; }
#tabs { display: grid; gap: 2px; }
#tabs button { text-align: left; padding: 10px 12px; border-radius: 6px; color: var(--mute); font-weight: 500; display: flex; gap: 10px; align-items: center; }
#tabs button:hover { background: var(--card); color: var(--text); }
#tabs button.active { background: var(--card2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
#tabs .ico { width: 20px; text-align: center; }
#tabs .badge { margin-left: auto; background: var(--accent); color: var(--ink); font-size: 11px; padding: 0 7px; border-radius: 10px; font-family: var(--mono); }
.side-foot { margin-top: auto; display: grid; gap: 4px; }
.link { text-align: left; padding: 8px 12px; color: var(--mute); font-size: 13px; cursor: pointer; border-radius: 6px; }
.link:hover { color: var(--text); background: var(--card); }

.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 34px; background: rgba(12,14,17,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top h1 { font-family: var(--display); font-size: 34px; text-transform: uppercase; line-height: 1; }
.top p { color: var(--mute); font-size: 14px; margin-top: 4px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.status { font-family: var(--mono); font-size: 12px; color: var(--ok); }
.status.dirty { color: var(--accent2); }
.panel { padding: 30px 34px 80px; max-width: 980px; display: grid; gap: 22px; }

/* fields */
.group { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 22px; display: grid; gap: 16px; }
.group > h2 { font-size: 13px; font-family: var(--mono); color: var(--mute); letter-spacing: .1em; text-transform: uppercase; }
.f { display: grid; gap: 6px; }
.f > span { font-size: 13px; font-weight: 600; }
.f > small { color: var(--mute); font-size: 12px; }
.f input[type=text], .f input[type=url], .f input[type=number], .f input[type=email], .f textarea, .f select {
  width: 100%; background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; font: inherit; resize: vertical;
}
.f input:focus, .f textarea:focus, .f select:focus { outline: none; border-color: var(--accent); }
.f.check { grid-template-columns: auto 1fr; align-items: center; }
.f.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.media { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.media .thumb { width: 96px; height: 64px; border-radius: 6px; background: var(--ink) center/cover; border: 1px solid var(--line); display: grid; place-items: center; color: var(--mute); font-size: 11px; flex: none; }
.media input[type=text] { flex: 1; min-width: 180px; }
.upload { position: relative; overflow: hidden; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* list items */
.list { display: grid; gap: 12px; }
.item { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.item-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; user-select: none; }
.item-head .num { font-family: var(--mono); font-size: 11px; color: var(--mute); width: 24px; }
.item-head .ttl { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-head .ttl small { color: var(--mute); font-weight: 400; margin-left: 8px; }
.item-head .tools { display: flex; gap: 2px; }
.item-head .tools button { width: 30px; height: 30px; border-radius: 5px; color: var(--mute); }
.item-head .tools button:hover { background: var(--card); color: var(--text); }
.item-head .tools button.del:hover { color: #ff5a4f; }
.item-head .chev { transition: transform .2s; color: var(--mute); }
.item.open .chev { transform: rotate(90deg); }
.item-body { display: none; padding: 4px 16px 18px; gap: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
.item.open .item-body { display: grid; }
.add { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; color: var(--mute); font-weight: 600; }
.add:hover { border-color: var(--accent); color: var(--text); }

/* leads */
.leads { display: grid; gap: 12px; }
.lead { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; gap: 8px; }
.lead.novo { border-color: var(--accent); }
.lead-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.lead-top strong { font-size: 17px; }
.lead-meta { color: var(--mute); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }
.lead-meta a { color: var(--accent2); }
.lead p { white-space: pre-wrap; color: #c7cbd2; }
.lead-act { display: flex; gap: 8px; align-items: center; }
.lead-act select { background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 13px; }
.empty { color: var(--mute); text-align: center; padding: 40px; border: 1px dashed var(--line); border-radius: 10px; }
.tip { background: rgba(0,224,192,.06); border: 1px solid rgba(0,224,192,.25); color: #a8e6dc; border-radius: 8px; padding: 12px 14px; font-size: 13px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 30px); background: var(--text); color: var(--ink); padding: 12px 20px; border-radius: 8px; font-weight: 600; opacity: 0; transition: .3s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #ff3b30; color: #fff; }

@media (max-width: 800px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 14px; gap: 14px; min-width: 0; }
  .top-actions { flex-wrap: wrap; }
  .item-head .tools button { width: 26px; }
  #tabs { grid-auto-flow: column; overflow-x: auto; grid-auto-columns: max-content; }
  .side-foot { grid-auto-flow: column; overflow-x: auto; margin: 0; }
  .top, .panel { padding-inline: 16px; }
  .top-actions { width: 100%; }
  .top-actions .btn.red { flex: 1; }
}
