:root {
  --bg: #000000;
  --panel: #0d0e0c;
  --panel-2: #151712;
  --line: #22251e;
  --text: #f2f4ee;
  --muted: #868b7e;
  --accent: #a3e635;
  --accent-2: #84cc16;
  --accent-soft: #c4f06a;
  --accent-2-soft: #bef264;
  --on-accent: #0a0d05;
  --green: #a3e635;
  --red: #f04438;
  --amber: #fbbf24;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.app { display: flex; min-height: 100vh; padding: 12px; gap: 12px; }

/* Sidebar */
/* Menu em trilho (pílula vertical de vidro) */
.sidebar {
  width: 76px; flex-shrink: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 0;
  border-radius: 40px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04) 55%, rgba(255, 255, 255, .08));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 30px rgba(0, 0, 0, .3);
  position: sticky; top: 12px; height: calc(100vh - 24px);
}
.brand {
  position: relative; width: 46px; height: 46px; display: grid; place-items: center;
  color: #fff; margin-bottom: 28px; border-radius: 50%;
}
.brand svg { width: 40px; height: 40px; }
.brand:hover { color: var(--accent-soft); }
nav, .sidebar-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.sidebar-bottom { margin-top: auto; }
.nav-item {
  position: relative; width: 46px; height: 46px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 15px;
  color: rgba(255, 255, 255, .55);
}
.nav-item .ico { width: 21px; height: 21px; }
.nav-item:hover, .nav-item:focus-visible { color: #fff; background: rgba(255, 255, 255, .08); outline: 0; }
.nav-item.active { color: #fff; background: rgba(255, 255, 255, .12); }
/* barrinha branca na borda do trilho, como na referência */
.nav-item.active::before {
  content: ""; position: absolute; left: -15px; top: 50%; width: 4px; height: 22px; margin-top: -11px;
  border-radius: 0 4px 4px 0; background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .6);
}
/* dica com o nome ao passar o mouse */
.tip {
  position: absolute; left: calc(100% + 16px); top: 50%; transform: translate(-4px, -50%);
  background: #0f1216; color: #fff; border: 1px solid rgba(255, 255, 255, .12);
  padding: 7px 11px; border-radius: 9px; font-size: 12px; font-weight: 600; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; z-index: 70;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
}
.tip small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.nav-item:hover .tip, .nav-item:focus-visible .tip, .brand:hover .tip { opacity: 1; transform: translate(0, -50%); }

.ico { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; }
.ico svg { width: 100%; height: 100%; }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.topbar { display: flex; align-items: center; gap: 12px; }
.search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--muted);
}
.search input { flex: 1; background: none; border: 0; outline: 0; padding: 11px 0; color: var(--text); min-width: 0; }
kbd { font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.profile {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px 6px 6px;
}
.profile select { background: none; border: 0; outline: 0; font-weight: 600; }
.profile select option { background: var(--panel); }
.profile small { display: block; color: var(--muted); font-size: 11px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; border: 2px solid var(--panel);
}
.avatars { display: flex; }
.avatars .avatar { width: 28px; height: 28px; font-size: 10px; margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }
.icon-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 38px; display: inline-grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.menu-btn { display: none; }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.link { background: none; border: 0; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { color: var(--text); }

.grid { display: grid; gap: 12px; }
.stats { grid-template-columns: repeat(4, 1fr); }
.row-2 { grid-template-columns: 2fr 1fr; }

/* Hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--accent) 27%, transparent);
  padding: 34px 40px; min-height: 170px;
  background:
    radial-gradient(circle at 70% 50%, color-mix(in srgb, var(--accent-2) 33%, transparent), transparent 45%),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 27%, transparent), transparent 40%),
    linear-gradient(120deg, #12141c, color-mix(in srgb, var(--accent) 12%, #12141c) 60%, color-mix(in srgb, var(--accent-2) 22%, #12141c));
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(160deg, transparent 40%, color-mix(in srgb, var(--accent-2) 13%, transparent) 55%, transparent 70%);
}
.hero small { color: #c8cbe0; }
.hero h1 { font-size: 32px; line-height: 1.15; margin: 8px 0; max-width: 420px; }
.hero p { margin: 0; color: #c8cbe0; }
.hero .quote { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); max-width: 190px; color: #d8dbef; font-size: 14px; line-height: 1.5; z-index: 1; }
.hero .quote::after { content: ""; display: block; width: 24px; height: 2px; background: #d8dbef; margin-top: 10px; }

.scene { position: absolute; left: 58%; top: 50%; width: 110px; height: 110px; transform: translate(-50%, -50%); perspective: 600px; }
.cube { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; animation: spin 16s linear infinite; will-change: transform; }
.paused .cube { animation-play-state: paused; }
.cube div {
  position: absolute; inset: 0; border: 1px solid color-mix(in srgb, var(--accent-soft) 55%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 27%, transparent), color-mix(in srgb, var(--accent-2) 20%, transparent) 60%, #ffffff18);
  box-shadow: inset 0 0 30px color-mix(in srgb, var(--accent-soft) 20%, transparent);
}
.cube div:nth-child(1) { transform: translateZ(55px); }
.cube div:nth-child(2) { transform: rotateY(180deg) translateZ(55px); }
.cube div:nth-child(3) { transform: rotateY(90deg) translateZ(55px); }
.cube div:nth-child(4) { transform: rotateY(-90deg) translateZ(55px); }
.cube div:nth-child(5) { transform: rotateX(90deg) translateZ(55px); }
.cube div:nth-child(6) { transform: rotateX(-90deg) translateZ(55px); }
@keyframes spin { from { transform: rotateX(-24deg) rotateY(0); } to { transform: rotateX(-24deg) rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .cube { animation: none; transform: rotateX(-24deg) rotateY(35deg); } }

/* Stat */
.stat { display: flex; gap: 14px; align-items: flex-start; }
.stat-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-ico .ico { width: 20px; height: 20px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 22px; font-weight: 700; margin: 4px 0; white-space: nowrap; }
.stat .delta { font-size: 12px; font-weight: 600; }
.stat svg.spark { margin-left: auto; align-self: flex-end; }
.up { color: var(--green); } .down { color: var(--red); }

/* Chart */
.chart { width: 100%; height: 240px; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--c); }
.tooltip { position: fixed; pointer-events: none; background: #1f2230; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12px; z-index: 50; }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; 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-weight: 500; }
.list-item .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.badge { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 7px; white-space: nowrap; border: 1px solid; }
.b-blue { color: var(--accent-soft); background: color-mix(in srgb, var(--accent) 13%, transparent); border-color: color-mix(in srgb, var(--accent) 33%, transparent); }
.b-green { color: #6ee7b7; background: #34d39922; border-color: #34d39955; }
.b-amber { color: #fcd34d; background: #fbbf2422; border-color: #fbbf2455; }
.b-red { color: #fca5a5; background: #f8717122; border-color: #f8717155; }
.b-purple { color: var(--accent-2-soft); background: color-mix(in srgb, var(--accent-2) 13%, transparent); border-color: color-mix(in srgb, var(--accent-2) 33%, transparent); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.proj-name { display: flex; align-items: center; gap: 12px; }
.proj-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--accent-soft); flex-shrink: 0; }
.bar { height: 5px; background: var(--line); border-radius: 9px; overflow: hidden; width: 90px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-soft)); border-radius: 9px; }
.progress { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.amount-in { color: var(--green); font-weight: 600; }
.amount-out { color: var(--red); font-weight: 600; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 4px; }
.page-head h2 { margin: 0; font-size: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.btn { border-radius: 10px; padding: 10px 16px; font-weight: 600; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 8px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 27%, transparent); }
.btn.ghost { background: var(--panel-2); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--muted); font-size: 12px; font-weight: 500; }
.chip.active { color: var(--text); border-color: color-mix(in srgb, var(--accent) 53%, transparent); background: color-mix(in srgb, var(--accent) 13%, transparent); }

/* Skills */
.skills-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.skill { display: flex; flex-direction: column; gap: 12px; position: relative; }
.skill-top { display: flex; align-items: center; gap: 12px; }
.skill h4 { margin: 0; font-size: 16px; }
.skill .use { color: #c8cbe0; line-height: 1.55; margin: 0; flex: 1; }
.skill-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.level { display: flex; gap: 3px; }
.level i { width: 14px; height: 5px; border-radius: 3px; background: var(--line); }
.level i.on { background: var(--accent); }
.card-actions { display: flex; gap: 4px; }
.card-actions button { background: none; border: 0; color: var(--muted); padding: 4px; border-radius: 6px; }
.card-actions button:hover { color: var(--text); background: var(--panel-2); }
.card-actions .ico { width: 16px; height: 16px; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* Members */
.members-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.member { display: flex; align-items: center; gap: 12px; }
.member .avatar { width: 46px; height: 46px; font-size: 15px; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; }
.cal .h { color: var(--muted); padding: 4px 0; }
.cal .d { padding: 7px 0; border-radius: 50%; position: relative; }
.cal .d.other { color: #4b5063; }
.cal .d.today { background: var(--accent); color: #fff; font-weight: 700; box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 53%, transparent); }
.cal .d.has::after { content: ""; position: absolute; bottom: 1px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent-2); }

/* Agenda */
.agenda-grid { grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); }
.big-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.bc-h { color: var(--muted); font-size: 12px; text-align: center; padding: 4px 0; }
.bc-d {
  min-height: 92px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0;
}
.bc-d:hover { border-color: color-mix(in srgb, var(--accent) 53%, transparent); }
.bc-d.other { opacity: .4; }
.bc-d .num { font-size: 12px; font-weight: 600; color: var(--muted); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.bc-d.today { border-color: var(--accent); }
.bc-d.today .num { background: var(--accent); color: #fff; box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 53%, transparent); }
.ev-chip {
  display: block; width: 100%; text-align: left; font-size: 11px; line-height: 1.3; padding: 3px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--c) 18%, transparent); border: 0; border-left: 3px solid var(--c);
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ev-chip.proj { cursor: default; }
.bc-d .more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.date-box {
  width: 46px; height: 50px; border-radius: 10px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 15%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.date-box b { font-size: 17px; line-height: 1; }
.date-box span { font-size: 11px; color: var(--muted); margin-top: 3px; }
.event-item { align-items: flex-start; }
.list.past { opacity: .55; }

/* Paleta */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.swatch {
  aspect-ratio: 1; border-radius: 12px; border: 2px solid transparent; padding: 0; position: relative;
  background: linear-gradient(135deg, var(--s1), var(--s2, var(--s1)));
}
.swatch:hover { transform: scale(1.06); }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 3px var(--panel), 0 0 16px var(--s1); }
.swatch.on::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; text-shadow: 0 1px 3px #0008; }
.swatches.small { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 6px; }
.swatches.small .swatch { border-radius: 50%; }
.bg-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bg-opt { border-radius: 12px; border: 2px solid var(--line); padding: 10px; text-align: left; font-size: 12px; color: #eef0f5; }
.bg-opt.on { border-color: var(--accent); }
.bg-opt i { display: block; height: 26px; border-radius: 6px; margin-bottom: 6px; border: 1px solid #ffffff22; }
.custom-color { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.custom-color input { width: 44px; height: 32px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.section-label { font-size: 12px; color: var(--muted); font-weight: 600; margin: 4px 0 10px; text-transform: uppercase; letter-spacing: .04em; }

/* Financeiro detalhado */
.fin-grid { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.cat-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; }
.cat-row .hbar { grid-column: 1 / -1; height: 7px; background: var(--line); border-radius: 9px; overflow: hidden; }
.cat-row .hbar i { display: block; height: 100%; border-radius: 9px; background: var(--c); }
.cat-row .val { font-weight: 600; font-size: 13px; }
.cat-row .val small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.seg button.on { background: var(--accent); color: #fff; }
.fin-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fin-filters select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; outline: 0; }
.fin-filters select option { background: var(--panel); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }
.totals-row td { font-weight: 700; border-top: 1px solid var(--line); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.mini-stats div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mini-stats small { color: var(--muted); font-size: 11px; display: block; }
.mini-stats b { font-size: 15px; display: block; margin-top: 4px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); width: 100%; max-width: 460px; padding: 20px; max-height: 90vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: 0; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; color: var(--text); cursor: pointer; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Responsive */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row-2, .agenda-grid, .fin-grid { grid-template-columns: 1fr; }
  .scene { left: 72%; }
  .hero .quote { display: none; }
}
@media (max-width: 760px) {
  .app { padding: 8px; }
  .sidebar { position: fixed; left: 8px; top: 8px; bottom: 8px; height: auto; z-index: 60; transform: translateX(-120%); transition: transform .2s; background: var(--panel); }
  .tip { display: none; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax #0008; }
  .menu-btn { display: inline-grid; }
  .search kbd, .profile small { display: none; }
  .stats { grid-template-columns: 1fr; }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 24px; max-width: 220px; }
  .scene { left: auto; right: -10px; transform: translateY(-50%) scale(.7); }
  .field-row { grid-template-columns: 1fr; }
  .bc-d { min-height: 54px; padding: 4px; }
  .ev-chip { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: var(--c); }
}
