/* Reset, type and the app frame (sidebar + content). */

*, *::before, *::after { box-sizing: border-box; }

/* Rules like display:flex would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -0.005em; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }

a { color: var(--azure-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

:focus-visible { outline: 3px solid var(--azure-40); outline-offset: 2px; }

.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); font-size: 13.5px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.icon { flex: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.boot { padding: 48px; text-align: center; color: var(--ink-2); }

/* ---------- frame ---------- */

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 20;
}

.brand { display: flex; align-items: center; height: 68px; padding: 0 22px; flex: none; }
.brand img { width: 148px; height: auto; }

.nav { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  margin: 16px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--r);
  color: var(--ink-2);
  font-weight: 500;
}
.nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--azure-10); color: var(--azure-deep); font-weight: 600; }
/* The brand leaf marks where you are. */
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  background: var(--turquoise);
  border-radius: 0 0 100% 0;
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.who { min-width: 0; flex: 1; line-height: 1.3; }
.who-name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { display: block; font-size: 13px; color: var(--ink-3); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar img { height: 22px; width: auto; }

.view { flex: 1; min-width: 0; outline: 0; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 56px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head p { margin-top: 4px; color: var(--ink-2); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--ink-2);
  font-weight: 500;
}
.back:hover { color: var(--azure-strong); text-decoration: none; }

.scrim { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    left: 0;
    width: min(var(--sidebar), 86vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .shell.nav-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    border: 0;
    background: rgb(60 71 77 / 0.4);
  }
  .topbar { display: flex; }
  .page { padding: 20px 16px 40px; }
  h1 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
