/* Shared shell: Terra palette + left sidebar that switches between the apps in this portal. */
:root {
  --navy: #2c2e3d; --slate: #363f56; --teal: #00bcd4; --teal-dark: #1590a5; --blue: #004e77;
  --orange: #f7942a; --purple: #593679; --bg: #f4f6f9; --card: #ffffff; --line: #eaecf0;
  --text: #222222; --muted: #5f727f; --neg: #c2410c; --good: #12877a; --bad: #c2410c; --radius: 14px;
  --shadow: 0 1px 2px rgba(44, 46, 61, .06), 0 6px 20px rgba(44, 46, 61, .06);
  --sidebar-w: 236px;
}
.layout { display: flex; min-height: 100vh; }
.layout > .main { flex: 1; min-width: 0; }

.sidebar { width: var(--sidebar-w); flex: none; background: var(--navy); color: #fff; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px 16px; position: sticky; top: 0; height: 100vh; border-right: 3px solid var(--teal); font-family: 'Poppins', system-ui, -apple-system, sans-serif; z-index: 60; }
.sidebar .sb-brand { display: flex; align-items: center; padding: 0 8px 14px; border-bottom: 1px solid rgba(255,255,255,.12); text-decoration: none; }
.sidebar .sb-brand img { height: 28px; display: block; }
.sidebar .sb-brand b { color: #fff; letter-spacing: 3px; }
.sidebar .sb-title { font-size: 11px; opacity: .55; text-transform: uppercase; letter-spacing: .08em; padding: 14px 8px 4px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,.82); text-decoration: none; font-weight: 500; font-size: 14px; line-height: 1.2; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: var(--teal); color: #fff; }
.sidebar nav a svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav a small { display: block; font-weight: 400; font-size: 11px; opacity: .7; margin-top: 2px; }
.sidebar .sb-user { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.sidebar .sb-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .sb-scope { font-size: 11px; opacity: .65; margin-top: -6px; }
.sidebar .sb-user button { font: inherit; font-size: 12px; font-weight: 500; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 6px 10px; cursor: pointer; align-self: flex-start; }
.sidebar .sb-user button:hover { background: rgba(255,255,255,.1); }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-right: 0; border-bottom: 3px solid var(--teal); }
  .sidebar .sb-brand { padding: 0; border: 0; }
  .sidebar .sb-title, .sidebar nav a small, .sidebar .sb-scope { display: none; }
  .sidebar nav { flex-direction: row; gap: 6px; margin-left: auto; }
  .sidebar nav a { padding: 8px 10px; font-size: 13px; }
  .sidebar .sb-user { margin: 0; padding: 0; border: 0; flex-direction: row; align-items: center; }
  .sidebar .sb-name { max-width: 120px; }
}
@media print { .sidebar { display: none !important; } }
