/* ═══════════════════════════════════════════════════════════════
   shell.css — layout for the app shell only (login, topbar, sidebar).
   Shared tokens & components live in theme.css.
   ═══════════════════════════════════════════════════════════════ */

body { overflow: hidden; }

/* ── Login ───────────────────────────────────────────────── */
#login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 500px at 50% -10%, rgba(59,130,246,.12), transparent), var(--bg);
}
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px 30px; width: 340px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-logo {
  font-weight: 800; font-size: 20px; letter-spacing: .3px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.login-logo .mark {
  width: 30px; height: 30px; border-radius: 8px; font-size: 17px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center;
}
.login-sub { color: var(--text2); font-size: 13px; margin-bottom: 22px; }
.login-err { color: #fca5a5; font-size: 12.5px; min-height: 16px; margin-top: 10px; }

/* ── App frame ───────────────────────────────────────────── */
.app { height: 100vh; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  height: var(--topbar); min-height: var(--topbar);
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar .logo { font-weight: 700; letter-spacing: .4px; display: flex; align-items: center; gap: 9px; }
.topbar .logo .mark {
  width: 22px; height: 22px; border-radius: 6px; font-size: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center;
}
.topbar .crumb { color: var(--text2); font-size: 13px; }
.topbar .crumb b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.topbar .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface2);
  border: 1px solid var(--border); display: grid; place-items: center; font-weight: 600; font-size: 12px;
}
.badge-admin {
  font-size: 10px; background: rgba(59,130,246,.16); color: #93c5fd;
  border: 1px solid rgba(59,130,246,.4); padding: 2px 7px; border-radius: 20px;
  font-weight: 600; letter-spacing: .4px;
}

.body { flex: 1; display: flex; min-height: 0; }

/* Sidebar */
.sidebar {
  width: var(--sidebar); min-width: var(--sidebar); background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 12px 10px;
}
.nav-section {
  font-size: 10px; letter-spacing: 1px; color: var(--text2);
  text-transform: uppercase; padding: 10px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px;
  color: var(--text2); font-weight: 500; font-size: 13.5px; border: 1px solid transparent; user-select: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--surface2); color: var(--text); border-color: var(--border); }
.nav-item.active .ico { color: var(--accent); }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; color: var(--text2); }
.nav-spacer { flex: 1; }
.nav-foot { font-size: 11px; color: var(--text2); padding: 10px; border-top: 1px solid var(--border); line-height: 1.5; }

/* Workspace */
.workspace { flex: 1; min-width: 0; min-height: 0; overflow: hidden; display: flex; }
.view { flex: 1; min-width: 0; height: 100%; overflow: auto; padding: 26px 30px; }
.view--flush { padding: 0; }
.view iframe { width: 100%; height: 100%; border: none; display: block; }

h1.page-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--text2); font-size: 13px; margin-bottom: 22px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .n { font-size: 28px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--text2); }

.sec-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text2); margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}

/* hide admin-only nav for non-admins */
body:not(.is-admin) .admin-only { display: none; }

/* ── Dashboard project cards ───────────────────────────────── */
.dash-proj-card { transition: opacity .15s, filter .15s; }
.dash-proj-card:hover { opacity: .85; }
.dash-proj-card--active { filter: brightness(1.12); outline: 2px solid var(--border); outline-offset: 2px; }

.dash-expand-panel { padding: 16px 20px; }

.dash-proj-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 500;
  transition: background .12s;
}
.dash-proj-row:hover { background: var(--surface2); }
.dash-proj-row .muted { font-size: 12px; font-weight: 400; }
