:root {
  --ink: #1e293b;
  --ink-muted: #64748b;
  --ink-faint: #94a3b8;
  --page: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-tint: #eef2ff;
  --brand-border: #e0e7ff;
  --success: #059669;
  --success-tint: #ecfdf5;
  --warning: #ea580c;
  --warning-tint: #ffedd5;
  --danger: #ef4444;
  --danger-tint: #fef2f2;
  --sidebar-bg: #ffffff;
  --sidebar-active-bg: #f8fafc;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); }

.vd-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.vd-sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.75rem;
}

.vd-brand {
  padding: 0 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.vd-brand-kicker {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
}
.vd-brand strong { display: block; font-size: 0.95rem; margin-top: 0.25rem; }
.vd-brand--center { text-align: center; border: none; margin-bottom: 1rem; }
.vd-badge-pro {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.vd-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.vd-nav a,
.vd-sidebar-foot a,
.vd-link-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.vd-nav a:hover,
.vd-sidebar-foot a:hover,
.vd-link-btn:hover { background: var(--sidebar-active-bg); color: var(--ink); }
.vd-nav a.is-active,
.vd-sidebar-foot a.is-active {
  background: var(--brand-tint);
  color: var(--brand);
  border-left: 3px solid var(--brand);
}

.vd-sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.vd-logout-form { margin: 0; }

.vd-main { min-width: 0; }
.vd-topbar {
  padding: 1.25rem 1.5rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.vd-topbar h1 { margin: 0 0 1rem; font-size: 1.35rem; }
.vd-content { padding: 1.25rem 1.5rem 2rem; }

.vd-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.vd-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.vd-stat-label { display: block; font-size: 0.75rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.vd-stat-value { display: block; font-size: 1.75rem; margin-top: 0.35rem; }
.vd-stat-value--warn { color: var(--warning); }

.vd-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.vd-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.vd-card h2 { margin: 0 0 0.75rem; font-size: 1rem; }

.vd-kv { list-style: none; margin: 0; padding: 0; }
.vd-kv li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.vd-kv li:last-child { border-bottom: none; }
.vd-kv span { color: var(--ink-muted); }

.vd-funnel { display: flex; flex-direction: column; gap: 0.65rem; }
.vd-funnel-step { position: relative; }
.vd-funnel-bar {
  height: 28px;
  border-radius: 6px;
  min-width: 8%;
}
.vd-funnel-step--1 .vd-funnel-bar { background: #6366f1; }
.vd-funnel-step--2 .vd-funnel-bar { background: #2563eb; }
.vd-funnel-step--3 .vd-funnel-bar { background: #d97706; }
.vd-funnel-step--4 .vd-funnel-bar { background: #059669; }
.vd-funnel-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.vd-table-wrap { overflow-x: auto; }
.vd-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.vd-table th,
.vd-table td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); }
.vd-table th { color: var(--ink-faint); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.vd-table--compact td { padding: 0.4rem 0.35rem; }

.vd-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.vd-period { font-size: 0.85rem; color: var(--ink-muted); }
.vd-seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}
.vd-seg a {
  padding: 0.4rem 0.75rem;
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.85rem;
  border-right: 1px solid var(--border);
}
.vd-seg a:last-child { border-right: none; }
.vd-seg a.is-active { background: var(--brand); color: #fff; }

.vd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
}
.vd-btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.vd-btn--primary:hover { background: var(--brand-hover); }
.vd-btn--secondary { background: var(--card); }
.vd-quick { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }

.vd-form { display: flex; flex-direction: column; gap: 0.75rem; }
.vd-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; }
.vd-form input,
.vd-form select,
.vd-form textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
}
.vd-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.vd-alert--danger { background: var(--danger-tint); color: #b91c1c; border: 1px solid #fecaca; }
.vd-alert--success { background: var(--success-tint); color: var(--success); border: 1px solid #a7f3d0; }
.vd-muted { color: var(--ink-muted); font-size: 0.875rem; }
.vd-id { display: block; font-size: 0.75rem; }
.vd-pagination { display: flex; gap: 1rem; align-items: center; font-size: 0.875rem; }
.vd-pagination a { color: var(--brand); }

.vd-shell--auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.vd-auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.vd-pro-card p { font-size: 0.95rem; line-height: 1.5; }
.vd-hint { font-size: 0.8rem; color: var(--ink-muted); margin-top: 1rem; }

@media (max-width: 960px) {
  .vd-layout { grid-template-columns: 1fr; }
  .vd-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .vd-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vd-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .vd-stat-grid { grid-template-columns: 1fr; }
}
