/* ============================================================
   shell.css — the one consistent left rail (paired with shell.js).
   Theme-token styled (flips light/dark). Replaces the per-page navs so
   every dashboard page shares ONE rail. Fixes: pilot-card overlap (the
   footer is short + in normal flow, never a clipped sticky box), and the
   "nav changes per page" confusion (same rail everywhere).
   ============================================================ */

/* The rail occupies the existing 248px grid column on every page
   (.app and .app-shell are both `grid-template-columns: 248px 1fr`),
   so we DON'T re-layout — we only style the rail itself. */
.ti-shell-nav {
  align-self: stretch;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-sizing: border-box;
}
.ti-rail {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 16px 20px;
  box-sizing: border-box;
}

.ti-rail-brand {
  font-family: var(--serif, Georgia, serif);
  font-size: 19px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  padding: 0 8px 6px;
}

.ti-rail-who {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.ti-rail-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.ti-rail-who-name { font-size: 14px; font-weight: 600; color: var(--text); }
.ti-rail-who-role { font-size: 11.5px; color: var(--text-dim); }

.ti-rail-group { display: flex; flex-direction: column; gap: 2px; }
.ti-rail-group + .ti-rail-group { margin-top: 13px; }
/* a quiet section header so the rail reads as clusters, not a flat list */
.ti-rail-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--text-dimmer, var(--text-dim));
  padding: 2px 12px 5px;
}

.ti-rail-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14.5px;
  color: var(--text-dim);
  text-decoration: none;
  transition: background .14s ease, color .14s ease;
}
.ti-rail-item:hover { background: var(--surface-2); color: var(--text); }
.ti-rail-item.is-active {
  background: var(--accent-pale, color-mix(in srgb, var(--accent) 14%, transparent));
  color: var(--accent-deep);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.ti-rail-ico {
  width: 18px; text-align: center; flex-shrink: 0;
  font-size: 14px; opacity: 0.9;
}
.ti-rail-item.is-active .ti-rail-ico { opacity: 1; }

/* "More" disclosure */
.ti-rail-more { margin-top: 6px; }
.ti-rail-more-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dimmer, var(--text-dim));
  border-radius: 9px;
}
.ti-rail-more-toggle:hover { background: var(--surface-2); }
.ti-rail-chev { transition: transform .18s ease; font-size: 12px; }
.ti-rail-more.is-open .ti-rail-chev { transform: rotate(180deg); }
.ti-rail-more-list {
  display: none;
  flex-direction: column; gap: 2px;
  margin-top: 2px;
}
.ti-rail-more.is-open .ti-rail-more-list { display: flex; }

/* short, in-flow footer — never a clipped sticky card */
.ti-rail-foot {
  margin-top: auto;
  padding: 14px 12px 4px;
  font-size: 11.5px; line-height: 1.5;
  color: var(--text-dim);
}
.ti-rail-foot strong {
  display: block;
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .ti-rail-item, .ti-rail-chev, .ti-rail-more-toggle { transition: none; }
}

/* responsive: the existing .app / .app-shell media queries already collapse
   the grid to one column under ~820px; the rail then sits as a top strip. */
@media (max-width: 820px) {
  .ti-shell-nav { border-right: none; border-bottom: 1px solid var(--border); }
  .ti-rail { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .ti-rail-who, .ti-rail-foot, .ti-rail-group-label { display: none; }
  .ti-rail-group + .ti-rail-group { margin-top: 0; }
  .ti-rail-more { margin-top: 0; }
  .ti-rail-more-list { width: 100%; }
}
