/* ============================================
   App Shell Layout
   Overrides and extends styles.css
   Added: 2026-05-26
   ============================================ */

/* ── Fixed Header ───────────────────────── */
body > header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions .engine-badge {
  font-size: 0.72rem;
  padding: 2px 10px;
  white-space: nowrap;
}

.header-actions .ghost {
  min-height: 30px;
  font-size: 0.78rem;
}

/* ── Login Panel (centered in viewport) ── */
body > #loginPanel {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  min-height: 0;
  background:
    radial-gradient(circle at top right, var(--accent-soft), transparent 32%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
}

/* ── Main Shell (pushes below header) ──── */
main.shell {
  width: 100%;
  max-width: 100%;
  margin: 48px 0 0 0;
  padding: 0;
}

/* ── App Layout Grid (sidebar + workspace) ── */
.app-shell {
  min-height: calc(100vh - 48px);
}

/* ── Sidebar (sticky below header) ─────── */
#sidebar {
  top: 48px;
  min-height: calc(100vh - 48px);
}

/* ── Workspace (fills remaining) ───────── */
.workspace {
  min-height: calc(100vh - 48px);
  padding: 16px;
}

/* ── Footer ────────────────────────────── */
body > footer {
  display: none;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

body.authenticated > footer {
  display: block;
}

/* ── Floating Action Button (FAB) ──────────── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
.fab:active {
  transform: scale(0.96);
}

/* ── Toast container (above everything) ── */
.toast-container {
  z-index: 500;
}

/* ── Modal overlay ─────────────────────── */
.modal-overlay {
  z-index: 400;
}
