:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e3e7ee;
  --text: #10151f;
  --muted: #6b7685;
  --accent: #2f5fed;
  --accent-dark: #1e3fb8;
  --accent-soft: rgba(47,95,237,0.10);
  --green: #0f9d58;
  --green-soft: rgba(15,157,88,0.12);
  --amber: #b9770e;
  --amber-soft: rgba(185,119,14,0.14);
  --red: #d64545;
  --red-soft: rgba(214,69,69,0.12);
  --sidebar-bg: #0c1220;
  --sidebar-text: #aab2c5;
  --sidebar-text-active: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3, .heading {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.3px;
}

.mono { font-family: 'JetBrains Mono', monospace; }

a { color: inherit; text-decoration: none; }

/* preview banner */
.preview-banner {
  background: #10151f;
  color: #e7c46b;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 7px 12px;
  letter-spacing: 0.3px;
}
.preview-banner span { color: #7a8399; font-weight: 500; }

/* shell */
.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: calc(100vh - 34px);
}

/* sidebar */
.sidebar {
  background: var(--sidebar-bg);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 18px;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.brand-name { color: #fff; font-weight: 700; font-size: 15px; }
.brand-sub { color: #6b7685; font-size: 11px; margin-top: 1px; }

.nav-group-label {
  color: #4b5468;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 6px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.8; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: #e2e6ee; }
.nav-item.active {
  background: var(--accent);
  color: var(--sidebar-text-active);
}
.nav-item.active svg { opacity: 1; }
.nav-item .step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: #4b5468;
  margin-left: auto;
}
.nav-item.active .step-num { color: rgba(255,255,255,0.65); }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #1c2333; color: #cbd2e0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.user-name { color: #d7dbe6; font-size: 12.5px; font-weight: 600; }
.user-role { color: #5c6579; font-size: 11px; }

/* main */
.main { padding: 28px 34px 60px; max-width: 1180px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 4px; }
.page-title { font-size: 24px; font-weight: 800; margin: 0; }
.page-desc { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 560px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn svg { width: 15px; height: 15px; }

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.card-title { font-size: 13.5px; font-weight: 700; margin: 0 0 14px; display:flex; align-items:center; gap:8px; }
.card-title .card-icon { color: var(--accent); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-12-7-5 { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 900px) {
  .grid-4, .grid-3, .grid-2, .grid-12-7-5 { grid-template-columns: 1fr; }
}

/* stat tile */
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.stat-value { font-family: 'JetBrains Mono', monospace; font-size: 25px; font-weight: 700; letter-spacing: -0.5px; }
.stat-sub { font-size: 11.5px; margin-top: 6px; font-weight: 600; }
.stat-sub.up { color: var(--green); }
.stat-sub.down { color: var(--red); }
.stat-sub.flat { color: var(--muted); }

/* badge */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-gray { background: #eef0f4; color: var(--muted); }

/* table */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; padding: 0 10px 10px; border-bottom: 1px solid var(--border); }
td { padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.row-alert td { background: var(--red-soft); }
.cell-strong { font-weight: 700; }
.cell-muted { color: var(--muted); font-size: 12px; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .kanban { grid-template-columns: 1fr; } }
.kanban-col { background: #eef1f6; border-radius: 12px; padding: 14px; }
.kanban-col-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding: 0 4px; }
.kanban-col-title { font-size: 12.5px; font-weight: 700; }
.kanban-col-count { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); background: #fff; border-radius: 99px; padding: 2px 8px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px; margin-bottom: 10px; }
.kanban-card-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.kanban-card-meta { font-size: 11.5px; color: var(--muted); display:flex; justify-content:space-between; }
.kanban-card-price { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 12.5px; margin-top: 8px; color: var(--accent); }

/* funnel */
.funnel-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.funnel-label { width: 168px; font-size: 12.5px; font-weight: 600; flex-shrink: 0; }
.funnel-bar-wrap { flex: 1; background: #eef0f4; border-radius: 6px; height: 30px; overflow: hidden; }
.funnel-bar { height: 100%; background: linear-gradient(90deg, var(--accent), #6f92f7); display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; }
.funnel-bar span { color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; }
.funnel-pct { width: 46px; text-align: right; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); flex-shrink: 0; }

/* form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 13px; font-family: inherit; background: #fbfcfd; color: var(--text);
}
.field.full { grid-column: 1 / -1; }

/* checklist */
.checklist-item { display: flex; align-items: center; justify-content: space-between; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.checklist-item:last-child { border-bottom: none; }
.checklist-label { font-size: 13px; font-weight: 600; }

/* divider text */
.section-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin: 26px 0 12px; }
.section-label:first-child { margin-top: 0; }

/* breakdown */
.breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row.total { border-top: 2px solid var(--text); border-bottom: none; margin-top: 4px; padding-top: 12px; font-weight: 800; font-size: 15px; }
.breakdown-op { color: var(--muted); font-family: 'JetBrains Mono', monospace; }

/* responsive — mobile: sidebar vira tab-bar horizontal no topo */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    gap: 4px;
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .brand, .nav-group-label, .sidebar-footer { display: none; }
  .nav-item {
    flex-direction: column;
    gap: 3px;
    padding: 7px 10px;
    font-size: 10px;
    white-space: nowrap;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .nav-item svg { width: 17px; height: 17px; }
  .nav-item .step-num { display: none; }

  .main { padding: 18px 16px 40px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
}
