/* ============================================================
   gcommand · CONSOLE CHROME
   The app shell in the G — Design Language: a persistent left
   sidebar, a top title bar, and a bottom status line. Replaces
   the old base.css/nav.css drawer chrome. Square, hairline,
   monospaced. Sidebar collapses to an off-canvas drawer <900px.
   ============================================================ */

html, body { margin: 0; padding: 0; min-height: 100vh; }

.cz-app {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

/* ---- Sidebar -------------------------------------------------- */
.cz-side {
  display: flex;
  flex-direction: column;
  border-right: var(--bw) solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.cz-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--s-5) var(--s-5) var(--s-4);
  border-bottom: var(--bw) solid var(--border);
}
.cz-brand {
  font: var(--w-black) 1.5rem/0.95 var(--font-display);
  letter-spacing: var(--ls-display);
  text-transform: uppercase;
  text-decoration: none;
  display: block;
}
.cz-brand:hover { text-decoration: none; }
.cz-brand-sub {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
}
.cz-side-close {
  display: none;
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.cz-nav { flex: 1 1 auto; padding: var(--s-4) 0; }

/* nav sections — the markup build_nav_html + shell emit
   (.nav-drawer-section > h3 + a.ph). */
.nav-drawer-section { padding: 0 0 var(--s-4); }
.nav-drawer-section h3 {
  font: var(--w-regular) var(--t-2xs)/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--ls-micro);
  color: var(--text-faint);
  margin: 0;
  padding: var(--s-3) var(--s-5) var(--s-2);
}
.nav-drawer-section a {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: var(--s-3);
  padding: 7px var(--s-5);
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  color: var(--text);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-drawer-section a:hover { background: var(--bg-panel); text-decoration: none; }
.nav-drawer-section a.is-active {
  border-left-color: var(--accent);
  color: var(--text-hot);
  background: var(--bg-panel);
}
.nav-drawer-section a i { font-size: 16px; color: var(--text-muted); }
.nav-drawer-section a.is-active i { color: var(--accent); }

.cz-side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-top: var(--bw) solid var(--border);
}
.cz-theme {
  background: none;
  border: var(--bw) solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  padding: 4px 8px;
  cursor: pointer;
}
.cz-theme:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Main column --------------------------------------------- */
.cz-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.cz-top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-6);
  height: 56px;
  border-bottom: var(--bw) solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 80;
}
.cz-burger {
  display: none;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.cz-top-title {
  font: var(--w-bold) 1.25rem/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--ls-display);
  color: var(--text-hot);
}
.cz-spacer { flex: 1 1 auto; }
.cz-top-link {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--text-muted);
  text-decoration: none;
}
.cz-top-link:hover { color: var(--accent); }

.site-main {
  flex: 1 1 auto;
  padding: var(--s-6) var(--s-7);
  min-width: 0;
}

.cz-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-6);
  border-top: var(--bw) solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--text-muted);
}

.cz-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}

/* ---- Collapse to off-canvas drawer --------------------------- */
@media (max-width: 900px) {
  .cz-app { grid-template-columns: 1fr; }
  .cz-side {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
  }
  .cz-app.is-open .cz-side { transform: translateX(0); }
  .cz-app.is-open .cz-backdrop { display: block; }
  .cz-side-close { display: block; }
  .cz-burger { display: inline-flex; }
}

@media (max-width: 760px) {
  .site-main { padding: var(--s-5) var(--s-5); }
  .cz-top { padding: 0 var(--s-5); }
}

/* Graph/full-dash want to use the whole width — already do via .site-main. */
body.login-page .cz-app { grid-template-columns: 1fr; }
body.login-page .cz-side,
body.login-page .cz-top,
body.login-page .cz-status { display: none; }
