:root {
  --bg: #0f0f0f;
  --panel: #171717;
  --line: #2a2a2a;
  --ink: #f5f5f5;
  --muted: #9a9a9a;
  --accent: #dad902;
  --suivie: #c0d800;
  --danger: #ff6b6b;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

/* Author CSS `display:` would otherwise override the HTML `hidden` attribute */
[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(800px 400px at 15% 0%, rgba(218, 217, 2, 0.16), transparent 55%),
    radial-gradient(700px 360px at 90% 10%, rgba(192, 216, 0, 0.12), transparent 50%),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.6rem 1.4rem 1.35rem;
  display: grid;
  gap: 0.75rem;
}
.login-brand {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 700; color: #111;
  background: linear-gradient(135deg, var(--accent), #f3f08a);
}
.login-card h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.85rem;
}
.login-sub, .login-hint { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.login-card label { display: grid; gap: 0.35rem; font-size: 0.88rem; font-weight: 600; }
.login-card input {
  border: 1px solid var(--line);
  background: #101010;
  color: var(--ink);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font: inherit;
}
.btn-primary {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  font: inherit;
  font-weight: 700;
  background: var(--accent);
  color: #141400;
  cursor: pointer;
}
.login-error { color: var(--danger); margin: 0; font-size: 0.88rem; }
.login-status { color: var(--suivie); margin: 0; font-size: 0.88rem; }

.shell {
  height: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
}

.shell-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 30;
}
.shell-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.shell-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 700; color: #111;
  background: var(--accent);
}
.shell-brand strong { display: block; font-size: 0.95rem; }
.shell-brand small { color: var(--muted); }

.shell-nav {
  flex: 1;
  overflow: auto;
  padding: 0.75rem 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.nav-label {
  margin: 0.7rem 0.55rem 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.nav-btn {
  border: 0;
  background: transparent;
  color: #d4d4d4;
  text-align: left;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.62rem 0.75rem;
  border-radius: 12px;
  cursor: pointer;
}
.nav-btn:hover { background: #222; color: #fff; }
.nav-btn.is-active { background: var(--accent); color: #141400; }
.nav-btn[data-app="suivie"].is-active { background: var(--suivie); }

.shell-footer {
  border-top: 1px solid var(--line);
  padding: 0.85rem;
  display: grid;
  gap: 0.55rem;
}
.shell-user { font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
.btn-logout {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.shell-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}
.shell-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #121212;
}
.shell-top h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.shell-pill {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(218, 217, 2, 0.18);
  color: var(--accent);
}
.shell-pill.is-suivie {
  background: rgba(192, 216, 0, 0.16);
  color: var(--suivie);
}
.btn-menu {
  display: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  width: 36px; height: 36px;
  cursor: pointer;
}

.shell-frames {
  position: relative;
  min-height: 0;
  height: 100%;
  background: #fff;
}
.app-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.app-frame.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.shell-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 20;
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .shell-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }
  .shell.sidebar-open .shell-sidebar { transform: translateX(0); }
  .shell.sidebar-open .shell-overlay { display: block; }
  .btn-menu { display: inline-grid; place-items: center; }
}
