:root {
  color-scheme: light;
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.98 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --icon: var(--foreground);
  --icon-muted: var(--muted-foreground);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
}

:root[data-tenant-theme="purple"],
.app-shell[data-tenant-theme="purple"] {
  --background: oklch(0.99 0.02 300);
  --card: oklch(0.995 0.02 300);
  --muted: oklch(0.965 0.04 300);
  --primary: oklch(0.55 0.2 300);
  --primary-foreground: oklch(0.98 0 0);
  --accent: oklch(0.94 0.09 300);
  --accent-foreground: oklch(0.28 0.05 300);
  --ring: oklch(0.62 0.16 300);
  --icon: var(--primary);
  --icon-muted: var(--ring);
  --sidebar: oklch(0.985 0.02 300);
}

:root[data-tenant-theme="forest"],
.app-shell[data-tenant-theme="forest"] {
  --background: oklch(0.99 0.02 145);
  --card: oklch(0.995 0.02 145);
  --muted: oklch(0.965 0.04 145);
  --primary: oklch(0.52 0.16 145);
  --primary-foreground: oklch(0.98 0 0);
  --accent: oklch(0.92 0.08 145);
  --accent-foreground: oklch(0.25 0.04 145);
  --ring: oklch(0.6 0.13 145);
  --icon: var(--primary);
  --icon-muted: var(--ring);
  --sidebar: oklch(0.985 0.02 145);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, "Segoe UI", sans-serif;
}

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

button {
  font: inherit;
}

svg {
  display: block;
}

.app-shell {
  min-height: 100vh;
  background: var(--background);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 18rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 40%, transparent);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid color-mix(in oklab, var(--primary) 60%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 10%, transparent);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.brand-mark svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
}

.brand-copy {
  min-width: 0;
  line-height: 1.1;
}

.brand-copy strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-copy span {
  display: block;
  margin-top: 0.125rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.sidebar-toggle {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--icon-muted);
}

.sidebar-toggle svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

.sidebar-body {
  flex: 1;
  overflow: auto;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.nav {
  display: grid;
  gap: 1.5rem;
}

.nav-group {
  display: grid;
  gap: 0.5rem;
}

.nav-label {
  padding: 0 0.75rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-item:hover {
  background: var(--accent);
  color: var(--foreground);
}

.nav-item.active {
  background: var(--accent);
  color: var(--foreground);
}

.nav-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  color: var(--icon-muted);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: var(--icon);
}

.nav-icon svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

.main-column {
  padding-left: 18rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.5rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 80%, transparent);
  backdrop-filter: blur(10px);
}

.breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.breadcrumbs strong {
  color: var(--foreground);
  font-weight: 500;
}

.crumb-separator {
  color: var(--muted-foreground);
}

.user-menu {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--foreground);
}

.avatar {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: color-mix(in oklab, var(--muted) 70%, white);
  color: var(--muted-foreground);
  font-size: 0.625rem;
  font-weight: 700;
}

.user-name {
  max-width: 11rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.875rem;
}

.menu-icon {
  color: var(--icon-muted);
}

.menu-icon svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

.content {
  padding: 1.5rem;
}

.hero-grid,
.detail-grid {
  display: grid;
  gap: 1rem;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.75fr);
}

.detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.panel {
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 1rem;
  background: color-mix(in oklab, var(--background) 70%, var(--card));
}

.panel-header {
  padding: 1.25rem 1.25rem 0;
}

.panel-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.panel-body {
  padding: 1.25rem;
}

.hero-panel {
  background:
    radial-gradient(circle at top right, color-mix(in oklab, var(--primary) 14%, transparent), transparent 34%),
    color-mix(in oklab, var(--background) 70%, var(--card));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: color-mix(in oklab, var(--primary) 10%, transparent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: currentColor;
}

.headline {
  margin: 1rem 0 0.75rem;
  max-width: 14ch;
  font-size: clamp(2.25rem, 5vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.copy {
  margin: 0;
  max-width: 46rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
  line-height: 1.8;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  background: color-mix(in oklab, var(--background) 65%, var(--muted));
  font-size: 0.8125rem;
  font-weight: 500;
}

.metric-stack,
.info-list {
  display: grid;
  gap: 0.75rem;
}

.metric-card,
.info-item {
  border: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  border-radius: 0.75rem;
  background: color-mix(in oklab, var(--background) 80%, var(--card));
  padding: 1rem;
}

.metric-label {
  color: var(--muted-foreground);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 0.625rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.info-item strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
}

.info-item span {
  display: block;
  margin-top: 0.375rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.6;
}

.notice {
  border: 1px dashed color-mix(in oklab, var(--primary) 35%, transparent);
  border-radius: 0.75rem;
  background: color-mix(in oklab, var(--primary) 6%, transparent);
  padding: 1rem;
  color: color-mix(in oklab, var(--foreground) 72%, var(--primary));
  font-size: 0.875rem;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .hero-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .main-column {
    padding-left: 0;
  }

  .content {
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 0.75rem;
  }

  .user-name {
    display: none;
  }

  .headline {
    max-width: none;
    font-size: clamp(2rem, 11vw, 3rem);
  }
}
