@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Exo+2:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #020604;
  --bg2: #04110a;
  --panel: rgba(6, 28, 16, .72);
  --panel-solid: #071a10;
  --line: rgba(57, 255, 136, .18);
  --line-strong: rgba(57, 255, 136, .45);
  --green: #00e05a;
  --neon: #39ff88;
  --lime: #b6ff3b;
  --deep: #0a7a3a;
  --white: #eafff1;
  --muted: #8fb9a0;
  --red: #ff4d6d;
  --amber: #ffc94d;
  --cyan: #3be8ff;
  --glow: 0 0 12px rgba(57, 255, 136, .45), 0 0 32px rgba(0, 224, 90, .18);
  --radius: 14px;
  --font-title: 'Orbitron', system-ui, sans-serif;
  --font: 'Exo 2', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(0, 224, 90, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(57, 255, 136, .10), transparent 60%),
    linear-gradient(var(--bg), var(--bg2));
  background-attachment: fixed;
  color: var(--white);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(57,255,136,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(57,255,136,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
a { color: var(--neon); }
h1, h2, h3, .title { font-family: var(--font-title); letter-spacing: .06em; margin: 0; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; } .mt16 { margin-top: 16px; } .mt22 { margin-top: 22px; } .mb14 { margin-bottom: 14px; } .mb16 { margin-bottom: 16px; } .my16 { margin: 16px 0; }
.between { justify-content: space-between; } .maxw { max-width: 560px; }

/* ---------- botões e campos ---------- */
button, .btn {
  font: 600 14px var(--font); letter-spacing: .03em; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(57,255,136,.06); color: var(--white);
  padding: 9px 16px; border-radius: 10px; transition: .18s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
button:hover, .btn:hover { border-color: var(--neon); box-shadow: var(--glow); }
button:disabled { opacity: .5; cursor: wait; }
.primary { background: linear-gradient(135deg, var(--green), var(--deep)); color: #001a09; border-color: var(--neon); font-weight: 700; }
.primary:hover { color: #001a09; }
.danger { border-color: rgba(255,77,109,.5); color: #ffd6de; background: rgba(255,77,109,.08); }
.danger:hover { border-color: var(--red); box-shadow: 0 0 14px rgba(255,77,109,.4); }
.ghost { background: transparent; border-color: transparent; }
.ghost:hover { border-color: var(--line); box-shadow: none; }
.icon-btn { padding: 6px 10px; font-size: 13px; }
input, select, textarea {
  width: 100%; font: 400 15px var(--font); color: var(--white);
  background: rgba(0, 0, 0, .45); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(57,255,136,.15); }
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > .field { flex: 1 1 160px; }
.check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--white); }
.check input { width: auto; }

/* ---------- login ---------- */
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); padding: 34px 28px; }
.ring {
  width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 50%; position: relative;
  border: 3px solid var(--neon); box-shadow: var(--glow), inset 0 0 22px rgba(57,255,136,.35);
  animation: pulse 3s ease-in-out infinite;
}
.ring::before { content: ''; position: absolute; inset: 16px; border-radius: 50%; border: 2px solid var(--green); }
.ring::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%,-50%); background: var(--neon); border-radius: 50%; box-shadow: var(--glow); }
.ring.small-ring { width: 40px; height: 40px; margin: 0; border-width: 2px; }
.ring.small-ring::before { inset: 7px; border-width: 1.5px; }
.ring.small-ring::after { width: 8px; height: 8px; }
@keyframes pulse { 50% { box-shadow: 0 0 22px rgba(57,255,136,.7), 0 0 60px rgba(0,224,90,.3), inset 0 0 22px rgba(57,255,136,.45); } }
.brand { text-align: center; margin-bottom: 22px; }
.brand h1 { font-size: 26px; font-weight: 900; color: var(--neon); text-shadow: var(--glow); }

/* ---------- cartões ---------- */
.card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; backdrop-filter: blur(10px);
}
.card::before {
  content: ''; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent); opacity: .7;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- layout do painel ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px;
  background: linear-gradient(180deg, rgba(4,20,11,.95), rgba(2,8,5,.95)); border-right: 1px solid var(--line);
}
.side .logo { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.side .logo b { font-family: var(--font-title); font-weight: 900; color: var(--neon); text-shadow: var(--glow); letter-spacing: .1em; font-size: 16px; }
.side .logo span { display: block; font-size: 11px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 4px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500; border: 1px solid transparent; transition: .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav a:hover { color: var(--white); background: rgba(57,255,136,.05); }
.nav a.active { color: var(--neon); border-color: var(--line-strong); background: rgba(57,255,136,.08); box-shadow: inset 3px 0 0 var(--neon); }
.side .foot { margin-top: 18px; padding: 12px 8px; border-top: 1px solid var(--line); }
.main { padding: 26px 28px 60px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { color: var(--white); }
.topbar h1 em { font-style: normal; color: var(--neon); text-shadow: var(--glow); }
.menu-btn { display: none; }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.stat .value { font-family: var(--font-title); font-size: 24px; font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value.g { color: var(--neon); text-shadow: var(--glow); }
.stat .value.r { color: var(--red); }
.stat .value.a { color: var(--amber); }
.stat .value.c { color: var(--cyan); }

.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--neon); background: rgba(57,255,136,.07); }
.badge.r { color: var(--red); border-color: rgba(255,77,109,.5); background: rgba(255,77,109,.07); }
.badge.a { color: var(--amber); border-color: rgba(255,201,77,.5); background: rgba(255,201,77,.07); }
.badge.c { color: var(--cyan); border-color: rgba(59,232,255,.5); background: rgba(59,232,255,.07); }
.badge.m { color: var(--muted); border-color: var(--line); background: transparent; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.on { background: var(--neon); box-shadow: var(--glow); }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(57,255,136,.08); vertical-align: top; }
th { font: 600 11px var(--font-title); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: rgba(0,0,0,.3); position: sticky; top: 0; }
tr:hover td { background: rgba(57,255,136,.03); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
.v-receita { color: var(--neon); } .v-despesa { color: var(--red); } .v-retirada { color: var(--amber); }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- barras ---------- */
.bars .bar { margin-bottom: 10px; }
.bars .bar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; gap: 8px; }
.bars .track { height: 8px; background: rgba(255,255,255,.05); border-radius: 99px; overflow: hidden; }
.bars .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--deep), var(--neon)); box-shadow: var(--glow); }
.bars .fill.r { background: linear-gradient(90deg, #7a1a2b, var(--red)); box-shadow: none; }
.bars .fill.a { background: linear-gradient(90deg, #7a5a12, var(--amber)); box-shadow: none; }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-rows: 1fr auto; height: calc(100vh - 150px); min-height: 420px; padding: 0; overflow: hidden; }
.chat-log { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: min(78%, 640px); padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg.in { align-self: flex-end; background: linear-gradient(135deg, rgba(0,224,90,.22), rgba(10,122,58,.3)); border: 1px solid var(--line-strong); border-bottom-right-radius: 4px; }
.msg.out { align-self: flex-start; background: rgba(0,0,0,.45); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .meta { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; }
.msg img { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin-bottom: 6px; }
.msg audio { width: 240px; max-width: 100%; margin-top: 6px; }
.msg.typing { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: rgba(0,0,0,.35); align-items: end; }
.chat-form textarea { min-height: 46px; max-height: 160px; }
.chat-form .preview { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.chat-form .preview img { height: 40px; border-radius: 6px; }
.split { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.list-item { display: block; padding: 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; color: var(--white); }
.list-item:hover { background: rgba(57,255,136,.05); }
.list-item.active { border-color: var(--line-strong); background: rgba(57,255,136,.08); }
.list-item small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- galeria e ideias ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { overflow: hidden; padding: 0; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; background: #000; }
.tile .info { padding: 10px 12px; font-size: 13px; }
.tile .info p { margin: 4px 0 8px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.idea p { white-space: pre-wrap; color: #cfeedd; margin: 10px 0; max-height: 220px; overflow: auto; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- WhatsApp ---------- */
.qr-box { display: grid; place-items: center; padding: 18px; }
.qr-box img { width: 280px; max-width: 100%; border-radius: 14px; border: 6px solid #fff; box-shadow: var(--glow); }
.steps { margin: 0; padding-left: 20px; color: #cfeedd; }
.steps li { margin-bottom: 6px; }

/* ---------- modal e aviso ---------- */
dialog {
  border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel-solid); color: var(--white);
  width: min(560px, calc(100vw - 32px)); padding: 22px; box-shadow: 0 0 60px rgba(0,224,90,.25);
}
dialog::backdrop { background: rgba(0, 0, 0, .75); backdrop-filter: blur(3px); }
dialog.img-view { width: auto; max-width: calc(100vw - 32px); padding: 10px; }
dialog.img-view img { max-width: 100%; max-height: 80vh; display: block; border-radius: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 50; max-width: min(380px, calc(100vw - 32px));
  background: var(--panel-solid); border: 1px solid var(--neon); color: var(--white); padding: 12px 16px; border-radius: 12px; box-shadow: var(--glow);
  animation: rise .25s ease-out;
}
.toast.err { border-color: var(--red); box-shadow: 0 0 20px rgba(255,77,109,.35); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.alert { padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,201,77,.45); background: rgba(255,201,77,.07); color: #ffe7ad; margin-bottom: 16px; }
.alert.err { border-color: rgba(255,77,109,.5); background: rgba(255,77,109,.07); color: #ffd6de; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .field { margin: 0; flex: 1 1 140px; }
.mono { font-family: ui-monospace, monospace; font-size: 13px; }

/* ---------- celular ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.8); }
  .menu-btn { display: inline-flex; }
  .main { padding: 16px 16px 50px; }
  .split, .g2, .g3 { grid-template-columns: 1fr; }
  .chat { height: calc(100vh - 130px); }
  .msg { max-width: 88%; }
}
@media (max-width: 480px) { .g4 { grid-template-columns: 1fr 1fr; } .stat .value { font-size: 15px; } .card { padding: 14px; } }
