:root {
  --bg: #0d1117;
  --bg-2: #161b22;
  --bg-3: #1c2330;
  --border: #2a3140;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #f5a623;
  --accent-2: #58a6ff;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
#app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; padding: 0 6px; }
.logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #e8890b);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #1a1200; font-size: 16px;
}
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { color: var(--text-dim); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  text-align: left; background: none; border: none; color: var(--text-dim);
  padding: 11px 12px; border-radius: 9px; cursor: pointer; font-size: 14px;
  font-family: inherit; transition: .15s;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--bg-3); color: var(--text); font-weight: 600; }
.sidebar-footer { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--border); padding-top: 14px; }
.btn-ghost {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  padding: 8px; border-radius: 8px; cursor: pointer; font-size: 12px; font-family: inherit;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

/* Main */
.main { flex: 1; padding: 28px 34px; overflow-x: hidden; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; }
.page-sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* Buttons */
.btn {
  background: var(--accent); color: #1a1200; border: none; font-weight: 600;
  padding: 10px 16px; border-radius: 9px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn:hover { filter: brightness(1.08); }
.btn-sec {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--border);
  padding: 9px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn-sec:hover { border-color: var(--text-dim); }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.kpi-label { color: var(--text-dim); font-size: 12px; margin-bottom: 8px; }
.kpi-value { font-size: 26px; font-weight: 700; }
.kpi-value small { font-size: 14px; color: var(--text-dim); font-weight: 400; }

/* Table / cards */
.card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-3); cursor: pointer; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-green { background: rgba(63,185,80,.15); color: var(--green); }
.badge-yellow { background: rgba(210,153,34,.15); color: var(--yellow); }
.badge-red { background: rgba(248,81,73,.15); color: var(--red); }
.badge-blue { background: rgba(88,166,255,.15); color: var(--accent-2); }
.badge-gray { background: rgba(139,148,158,.15); color: var(--text-dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot-green { background: var(--green); } .dot-yellow { background: var(--yellow); } .dot-red { background: var(--red); }

/* Onboarding board */
.board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px; }
.col-count { background: var(--bg-3); border-radius: 20px; padding: 1px 8px; font-size: 11px; }
.mini-card { background: var(--bg-3); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.mini-card:hover { border-color: var(--accent); }
.mini-card .mc-name { font-weight: 600; font-size: 13px; }
.mini-card .mc-sub { color: var(--text-dim); font-size: 11px; margin-top: 3px; }

/* Tasks */
.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: none; }
.task-check { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--text-dim); cursor: pointer; flex-shrink: 0; }
.task-check.done { background: var(--green); border-color: var(--green); position: relative; }
.task-check.done::after { content: "✓"; color: #05210b; font-size: 12px; font-weight: 800; position: absolute; top: -3px; left: 2px; }
.task-title { flex: 1; }
.task-title.done { text-decoration: line-through; color: var(--text-dim); }
.task-meta { display: flex; gap: 8px; align-items: center; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip { background: var(--bg-3); border: 1px solid var(--border); color: var(--text-dim); padding: 6px 12px; border-radius: 20px; cursor: pointer; font-size: 12px; }
.chip.active { background: var(--accent); color: #1a1200; border-color: var(--accent); font-weight: 600; }

/* Empty */
.empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }

/* Modal */
#modal-root:empty { display: none; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px; z-index: 100; overflow-y: auto; }
.modal { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 520px; padding: 24px; }
.modal h3 { margin-bottom: 18px; font-size: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; color: var(--text-dim); font-size: 12px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: 8px; font-size: 14px; font-family: inherit;
}
.field textarea { min-height: 70px; resize: vertical; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.modal-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; align-items: center; }
.modal-actions .right { display: flex; gap: 10px; }
.link-del { color: var(--red); background: none; border: none; cursor: pointer; font-size: 13px; font-family: inherit; }

/* Sidebar client list */
.side-search { margin-bottom: 12px; }
.side-search input { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 8px; font-size: 13px; font-family: inherit; }
.side-clients-label { color: var(--text-dim); font-size: 10px; font-weight: 700; letter-spacing: .6px; margin: 14px 6px 6px; }
.side-clients { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 40px; }
.client-item { display: flex; align-items: center; gap: 8px; text-align: left; background: none; border: none; color: var(--text-dim); padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; font-family: inherit; }
.client-item:hover { background: var(--bg-3); color: var(--text); }
.client-item.active { background: var(--bg-3); color: var(--text); font-weight: 600; }
.ci-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.month-select, .sub-bar select { background: var(--bg-3); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 8px; font-family: inherit; font-size: 13px; cursor: pointer; }
.kpi-sub { color: var(--text-dim); font-size: 11px; margin-top: 4px; }
.skel { color: var(--text-dim); font-size: 12px; opacity: .6; }

/* Client header */
.client-header { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.ch-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ch-name { font-size: 24px; font-weight: 800; }
.ch-sub { color: var(--text-dim); font-size: 13px; margin-top: 5px; }
.ch-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ch-invest { font-size: 20px; font-weight: 700; }
.ch-invest small { font-size: 12px; color: var(--text-dim); font-weight: 400; margin-left: 4px; }

/* Tabs */
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-dim); padding: 11px 16px; cursor: pointer; font-size: 14px; font-family: inherit; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-body { display: flex; flex-direction: column; gap: 16px; }
.sub-bar { display: flex; align-items: center; gap: 10px; }
.sub-bar-label { color: var(--text-dim); font-size: 13px; }

.card.pad { padding: 18px 20px; }
.mini-title { font-size: 13px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 12px; }
.note { color: var(--text-dim); font-size: 12px; line-height: 1.5; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; }
.strat-line { padding: 6px 0; font-size: 14px; border-top: 1px solid var(--border); }
.strat-line:first-of-type { border-top: none; }

/* Progress */
.progress { height: 8px; background: var(--bg); border-radius: 20px; overflow: hidden; margin-bottom: 8px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 20px; transition: width .3s; }
.progress-txt { color: var(--text-dim); font-size: 12px; }

/* Metric grid */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.metric-cell { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; }
.mc-label { color: var(--text-dim); font-size: 11px; margin-bottom: 6px; }
.mc-val { font-size: 18px; font-weight: 700; }
.row-total td { background: var(--bg-3); }
.row-total { font-weight: 700; }
.inline-head { display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 820px) {
  .main { padding: 20px 16px; }
}
