/*
 * The sidebar (Kiln/UI/SidebarView.swift): Home, then each product with its overview, its features and how it works
 * today, and at the foot who's signed in, Settings and, for admins, Admin. On a phone it's a menu that drops down from
 * the bar along the top.
 */
.sidebar {
  display: flex; flex-direction: column;
  background: var(--canvas);
  border-right: 1px solid var(--rule);
  min-width: 0;
}

@media (min-width: 900px) {
  .sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; }
}

@media (max-width: 899px) {
  .sidebar {
    position: fixed; z-index: 30; left: 0; right: 0; top: 52px;
    max-height: calc(100vh - 52px); max-height: calc(100dvh - 52px);
    border-right: 0; border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow-raised);
  }
  .sidebar:not(.is-open) { display: none; }
  .sidebar-head { display: none; }
}

.sidebar-head { padding: 18px 18px 10px; }
.sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: 4px 10px 16px; display: flex; flex-direction: column; gap: 14px; }

.sidebar-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-small);
  color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none;
}
.sidebar-link:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); text-decoration: none; }
.sidebar-link[aria-current="page"] { background: var(--card); box-shadow: var(--shadow); font-weight: 600; }
.sidebar-link svg { width: 16px; height: 16px; flex: none; color: var(--ink-soft); }
.sidebar-link--quiet { color: var(--ink-soft); font-size: 13px; font-weight: 500; }

.sidebar-product { display: flex; flex-direction: column; gap: 2px; }
.sidebar-product-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 4px 4px 10px; min-height: 30px; }
.sidebar-product-name { font-size: 12px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); min-width: 0; }
.sidebar-product-head form { margin: 0; }
.sidebar-add {
  display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 7px; background: none; color: var(--ink-soft); cursor: pointer;
}
.sidebar-add:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.sidebar-add svg { width: 14px; height: 14px; }

.sidebar-list { list-style: none; display: flex; flex-direction: column; gap: 1px; }

.sidebar-feature {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-small);
  color: var(--ink); text-decoration: none;
}
.sidebar-feature:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); text-decoration: none; }
.sidebar-feature[aria-current="page"] { background: var(--card); box-shadow: var(--shadow); }
.sidebar-feature-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-feature-title { font-size: 14px; font-weight: 550; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-feature-status { font-size: 12px; color: var(--ink-soft); line-height: 1.35; }
.sidebar-feature-status--you { color: var(--wait-text); }

/* A small disc in the stage's colour (StageGlyph). */
.stage-glyph {
  --tint: var(--accent);
  display: inline-grid; place-items: center; flex: none;
  width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: color-mix(in srgb, var(--tint) 16%, transparent);
  color: var(--tint);
}
.stage-glyph svg { width: 10px; height: 10px; }
.stage-glyph--plan, .stage-glyph--build { --tint: var(--info); }
.stage-glyph--test { --tint: var(--wait); }
.stage-glyph--live { --tint: var(--pass); }

.sidebar-empty { padding: 6px 10px; font-size: 13px; color: var(--ink-soft); }

.sidebar-foot { border-top: 1px solid var(--rule); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-person { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-small); color: var(--ink); text-decoration: none; }
.sidebar-person:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); text-decoration: none; }
.sidebar-person[aria-current="page"] { background: var(--card); box-shadow: var(--shadow); }
.sidebar-person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sidebar-person-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-person-hint { font-size: 12px; color: var(--ink-soft); }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-text); font-size: 12px; font-weight: 700;
}
.sidebar-foot form { margin: 0; }
.sidebar-signout {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; border: 0; border-radius: var(--radius-small); background: none;
  color: var(--ink-soft); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.sidebar-signout:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.sidebar-signout svg { width: 16px; height: 16px; }

/* The phone's menu button. */
.menu-button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.menu-button svg { width: 16px; height: 16px; }
.menu-button[aria-expanded="true"] { background: var(--inset); }
