/* Soft panels: the sidebar and the page float as two rounded panels on a darker base.
   Radius scale: 14 panels, 12 cards, 10 controls and rows, 6 and below for chips. */
.dashboard-page {
  --panel: #fff;
  --panel-line: #e3e5ea;
  --panel-base: #eceef2;
  --pill-from: #2f62f0;
  --pill-to: #2350d6;
}
html[data-theme="dark"] .dashboard-page {
  --panel: #131316;
  --panel-line: #212126;
  --panel-base: #08080a;
  --pill-from: #2b5df0;
  --pill-to: #2350d6;
}
html[data-theme="dark"] .dashboard-page,
html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup) .workspace-main {
  --surface: #131316;
  --soft: #1d1d22;
  --line: #26262c;
  --menu-hover: #1d1d22;
}
.dashboard-page .app-shell:not(.is-setup) {
  padding: 10px;
  gap: 10px;
  background: var(--panel-base);
}
html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup) {
  background: var(--panel-base);
}

/* Both panels share one surface, edge and radius. */
.dashboard-page .app-shell:not(.is-setup) :is(.sidebar, .workspace-main),
html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup) :is(.sidebar, .workspace-main) {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  box-shadow: 0 1px 2px #1018280a;
}
html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup) :is(.sidebar, .workspace-main) {
  box-shadow: none;
}
.dashboard-page .app-shell:not(.is-setup) .sidebar {
  padding: 14px 10px 10px;
}
.dashboard-page .app-shell:not(.is-setup) .sidebar > .brand {
  margin: 4px 10px 22px;
}
.dashboard-page .app-shell:not(.is-setup) .sidebar-collapse {
  top: 14px;
  right: 10px;
}
.dashboard-page .project-picker-trigger,
html[data-theme="dark"] .dashboard-page .project-picker-trigger {
  min-height: 56px;
  padding: 10px;
  border-radius: 12px;
}
.dashboard-page .project-avatar {
  border-radius: 10px;
}
.dashboard-page .app-shell:not(.is-setup) .sidebar-project-action {
  margin-bottom: 18px;
}
.dashboard-page .app-shell:not(.is-setup) .sidebar-section-label {
  margin-bottom: 8px;
  letter-spacing: 0;
  font-weight: 500;
}
.dashboard-page .app-shell:not(.is-setup) .profile-footer {
  border-top-color: var(--panel-line);
}

/* Nav rows: calm by default, one blue pill marks where you are and slides between pages. */
.dashboard-page .app-shell:not(.is-setup) #main-nav {
  position: relative;
  gap: 2px;
}
.dashboard-page .app-shell:not(.is-setup) .nav-link {
  position: relative;
  z-index: 1;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 500;
  transition: color 0.2s ease, background 0.15s ease;
}
.dashboard-page .app-shell:not(.is-setup) .nav-sublink {
  position: relative;
  z-index: 1;
  transition: color 0.2s ease, background 0.15s ease;
}
.dashboard-page .app-shell:not(.is-setup) .nav-expand {
  z-index: 2;
}
.nav-items {
  display: contents;
}
.nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--pill-from), var(--pill-to));
  /* A hairline top highlight, no glow: the pill sits flat in the sidebar. */
  box-shadow: inset 0 1px 0 #ffffff1f;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
  transition: filter 0.15s ease;
}
/* Hovering the current page just lifts the pill a touch. */
#main-nav:has(.is-pilled:hover) .nav-pill {
  filter: brightness(1.1);
}
#main-nav:has(.nav-pill) :is(.nav-link, .nav-sublink).is-pilled,
html[data-theme="dark"] #main-nav:has(.nav-pill) :is(.nav-link, .nav-sublink).is-pilled {
  background: transparent;
  color: #fff;
}
#main-nav:has(.nav-pill) :is(.nav-link, .nav-sublink).is-pilled :is(svg, .nav-sub-count),
html[data-theme="dark"] #main-nav:has(.nav-pill) .nav-link.is-pilled svg {
  color: #fff;
}
#main-nav:has(.nav-pill) .is-pilled .nav-sub-count {
  background: #ffffff26;
}
#main-nav:has(.nav-pill) .is-pilled .nav-count,
html[data-theme="dark"] #main-nav:has(.nav-pill) .is-pilled .nav-count {
  background: #fff;
  color: var(--pill-to);
}
/* Before the pill lands (first paint, no JS) the active row still reads as active. */
#main-nav:not(:has(.nav-pill)) .nav-link.active:not(.has-sub) {
  background: var(--blue-soft);
}
/* The parent of an open group stays bright while its sub-page carries the pill. */
.dashboard-page .app-shell:not(.is-setup) .nav-link.has-sub.active:not(.is-pilled) {
  color: var(--ink);
}
.dashboard-page .app-shell:not(.is-setup) .nav-link.has-sub.active:not(.is-pilled) svg {
  color: var(--blue);
}
.nav-sub {
  border-left-color: var(--panel-line);
}

/* The phone drawer keeps the panel look but sits flush to the edge. */
@media (max-width: 680px) {
  .dashboard-page .app-shell:not(.is-setup) {
    padding: 0;
    gap: 0;
  }
  .dashboard-page .app-shell:not(.is-setup) .workspace-main,
  html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup) .workspace-main {
    border: 0;
    border-radius: 0;
  }
  .dashboard-page .app-shell:not(.is-setup) .sidebar,
  html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup) .sidebar {
    border-radius: 0 14px 14px 0;
    border-left: 0;
    background: var(--panel);
  }
}

/* The setup reminder is a soft tile, not a bordered box inside the panel. */
.dashboard-page .app-shell:not(.is-setup):not(.sidebar-collapsed) .project-setup-card {
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 4%, var(--panel));
}
html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup):not(.sidebar-collapsed) .project-setup-card {
  background: #1b1b1f;
}
/* A colour dot on the pill turns white: the pill is blue, and so are many inbox colours. */
#main-nav .nav-sublink:is(.is-pilled, .active) .nav-sub-dot {
  background: #fff;
}
