
:root {
  --bg0: #07080f;
  --bg1: #0e1020;
  --card: rgba(22, 26, 48, 0.72);
  --card2: rgba(30, 36, 68, 0.85);
  --line: rgba(140, 160, 255, 0.16);
  --text: #eef1ff;
  --muted: #9aa3c7;
  --done: #3dde9a;
  --done-dim: rgba(61, 222, 154, 0.15);
  --attn: #ffb020;
  --attn-dim: rgba(255, 176, 32, 0.14);
  --dead: #ff5d7a;
  --dead-dim: rgba(255, 93, 122, 0.14);
  --accent: #7c6cff;
  --accent2: #00d4ff;
  --xp: #ffd166;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0,0,0,.45);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg0); color: var(--text); font-family: var(--font); }
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124,108,255,.28), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(0,212,255,.18), transparent 50%),
    radial-gradient(700px 400px at 50% 100%, rgba(255,93,122,.12), transparent 45%),
    var(--bg0);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light; z-index: 0;
}
#app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 16px 14px 80px; }

/* Gate */
#gate {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  position: relative; z-index: 1;
}
.gate-card {
  width: min(420px, 100%);
  background: linear-gradient(160deg, rgba(30,36,68,.92), rgba(14,16,32,.92));
  border: 1px solid var(--line); border-radius: 24px; padding: 28px 24px;
  box-shadow: var(--shadow); backdrop-filter: blur(16px);
  animation: floatIn .7s cubic-bezier(.2,.8,.2,1);
}
.gate-card h1 { margin: 0 0 6px; font-size: 1.55rem; letter-spacing: -.02em; }
.gate-card p { margin: 0 0 18px; color: var(--muted); font-size: .95rem; }
.gate-card input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(0,0,0,.35); color: var(--text); font-size: 1.05rem; outline: none;
}
.gate-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,108,255,.25); }
.gate-card button {
  margin-top: 12px; width: 100%; padding: 14px; border: 0; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.gate-card button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.gate-err { color: var(--dead); min-height: 1.2em; margin-top: 10px; font-size: .9rem; }

/* Top bar */
.topbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 44px; height: 44px; border-radius: 14px;
  background: conic-gradient(from 210deg, var(--accent), var(--accent2), var(--done), var(--accent));
  display: grid; place-items: center; font-weight: 800; box-shadow: 0 0 24px rgba(124,108,255,.45);
  animation: spinSlow 12s linear infinite;
}
.brand h1 { margin: 0; font-size: 1.2rem; letter-spacing: -.02em; }
.brand .sub { color: var(--muted); font-size: .82rem; }
.stats {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); font-size: .85rem; backdrop-filter: blur(10px);
}
.pill strong { color: var(--xp); }
.xp-wrap { min-width: 160px; }
.xp-bar {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 4px;
}
.xp-fill {
  height: 100%; width: 0%; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--xp), var(--done));
  box-shadow: 0 0 12px rgba(255,209,102,.5);
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.icon-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 12px; padding: 8px 12px; cursor: pointer;
}

/* Day nav */
.day-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 8px 0 14px;
}
.day-nav .date-title {
  text-align: center; flex: 1;
}
.day-nav .date-title h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.day-nav .date-title span { color: var(--muted); font-size: .85rem; }
.nav-btn {
  width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 1.2rem; cursor: pointer;
}
.nav-btn:disabled { opacity: .35; cursor: default; }

/* Chart */
.chart-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 10px; margin-bottom: 16px; backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.chart-card h3 { margin: 0 0 10px; font-size: .95rem; color: var(--muted); font-weight: 600; }
.chart {
  display: flex; align-items: flex-end; gap: 8px; height: 110px; padding: 0 2px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bar-stack {
  width: 100%; max-width: 36px; height: 90px; display: flex; flex-direction: column-reverse;
  border-radius: 8px 8px 4px 4px; overflow: hidden; background: rgba(255,255,255,.04);
}
.bar-done { background: linear-gradient(180deg, #5effb4, var(--done)); transition: height .5s ease; }
.bar-pend { background: linear-gradient(180deg, #ff8aa0, var(--dead)); transition: height .5s ease; opacity: .85; }
.bar-label { font-size: .65rem; color: var(--muted); white-space: nowrap; }

/* Board */
.board {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px;
}
@media (max-width: 860px) {
  .board { grid-template-columns: 1fr; }
}
.lane {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; min-height: 220px; backdrop-filter: blur(12px);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.lane::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
}
.lane.done::before { background: var(--done); }
.lane.attn::before { background: var(--attn); }
.lane.dead::before { background: var(--dead); }
.lane-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.lane-head h3 { margin: 0; font-size: .98rem; display: flex; align-items: center; gap: 8px; }
.badge-count {
  font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08);
}
.lane.done .badge-count { background: var(--done-dim); color: var(--done); }
.lane.attn .badge-count { background: var(--attn-dim); color: var(--attn); }
.lane.dead .badge-count { background: var(--dead-dim); color: var(--dead); }

.card-item {
  background: var(--card2); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 8px;
  animation: rise .35s ease both;
  transition: transform .15s ease, border-color .15s ease, opacity .2s ease;
}
.card-item:hover { transform: translateY(-1px); border-color: rgba(140,160,255,.35); }
.card-item.done-item { opacity: .55; }
.card-item .row { display: flex; gap: 10px; align-items: flex-start; }
.card-item .txt { flex: 1; font-size: .92rem; line-height: 1.35; }
.card-item .meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .72rem; color: var(--muted); }
.chip {
  padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line);
}
.chip.bot { color: var(--accent2); }
.chip.you { color: var(--done); }
.chip.cd { color: var(--dead); font-weight: 700; }
.chip.cd.warn { color: var(--attn); }
.chip.cd.ok { color: var(--done); }
.check {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid rgba(255,255,255,.25);
  background: transparent; cursor: pointer; flex-shrink: 0; display: grid; place-items: center;
  transition: .15s ease;
}
.check.on {
  background: linear-gradient(135deg, var(--done), #1ecf7a); border-color: transparent; color: #042016;
  animation: pop .35s cubic-bezier(.2,.9,.3,1.4);
}
.add-row { display: flex; gap: 6px; margin-top: 8px; }
.add-row input {
  flex: 1; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25);
  color: var(--text); padding: 8px 10px; font-size: .85rem;
}
.add-row button {
  border: 0; border-radius: 10px; padding: 8px 12px; background: var(--accent); color: #fff;
  font-weight: 600; cursor: pointer; font-size: .85rem;
}

/* Sections below */
.sections { display: grid; gap: 14px; }
.section {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; backdrop-filter: blur(12px);
}
.section h3 { margin: 0 0 10px; font-size: 1rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.inv, .client, .boost, .block, .event, .ad {
  background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.inv .amt { font-weight: 700; font-size: 1.05rem; }
.inv.unpaid { border-color: rgba(255,93,122,.35); }
.inv.paid { border-color: rgba(61,222,154,.35); }
.inv .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.inv button, .section button.tiny {
  border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: .78rem;
}
.vibe { text-transform: uppercase; font-size: .65rem; letter-spacing: .06em; color: var(--accent2); }
.progress-ring-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ring { width: 110px; height: 110px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.2);
  font-size: .8rem;
}
.badge.on {
  background: linear-gradient(135deg, rgba(124,108,255,.25), rgba(0,212,255,.15));
  border-color: rgba(124,108,255,.45); box-shadow: 0 0 16px rgba(124,108,255,.2);
}
.hidden { display: none !important; }

/* Confetti / toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120%);
  background: linear-gradient(135deg, #1b2140, #12162a); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 14px; z-index: 50; transition: transform .35s ease;
  box-shadow: var(--shadow); font-weight: 600;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}

@keyframes floatIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}
