:root {
  --bg: #07111f;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --text: #eef5ff;
  --muted: #9fb1c7;
  --primary: #4f8cff;
  --primary-2: #26d3a2;
  --danger: #ff6575;
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(79, 140, 255, 0.36), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(38, 211, 162, 0.24), transparent 28%),
    linear-gradient(135deg, #07111f 0%, #0d1930 52%, #050914 100%);
}

.hidden { display: none !important; }
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
}
.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255,255,255,.22);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 480px) 1fr;
  padding: 28px;
  gap: 28px;
}
.login-card,
.hero-panel,
.card,
.panel,
.sidebar {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: 28px;
}
.login-card {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.brand-box, .sidebar-brand, .topbar, .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-box { justify-content: flex-start; margin-bottom: 26px; }
.brand-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-weight: 900;
  font-size: 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
}
.brand-icon.small { width: 42px; height: 42px; font-size: 20px; border-radius: 14px; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-2);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 12px;
  font-weight: 800;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 4vw, 46px); }
h2 { font-size: clamp(28px, 4vw, 52px); line-height: 1.05; margin-bottom: 16px; }
h3 { margin-bottom: 10px; }
.login-subtitle, .hero-panel p, .card p, .sidebar span { color: var(--muted); }
.form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: #d8e6f7; font-weight: 700; }
input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: 14px 15px;
  outline: none;
}
select option { color: #111827; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,140,255,.16); }
button {
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  color: white;
  background: linear-gradient(135deg, var(--primary), #6a5cff);
  font-weight: 900;
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease;
}
button:hover { transform: translateY(-1px); filter: brightness(1.05); }
button:disabled { cursor: not-allowed; opacity: .65; transform: none; }
.secondary { background: var(--panel-strong); border: 1px solid var(--border); }
.message { min-height: 22px; color: var(--danger); font-weight: 700; }
.login-hero { display: grid; place-items: end; }
.hero-panel { width: min(760px, 100%); padding: 42px; margin: auto; }

.app-view { min-height: 100vh; display: grid; grid-template-columns: 290px 1fr; padding: 18px; gap: 18px; }
.sidebar { padding: 20px; display: flex; flex-direction: column; }
.sidebar-brand { justify-content: flex-start; margin-bottom: 28px; }
.sidebar-brand div:last-child { display: grid; gap: 4px; }
.menu { display: grid; gap: 10px; }
.menu-item, .logout { text-align: left; background: transparent; border: 1px solid transparent; }
.menu-item.active, .menu-item:hover { background: var(--panel-strong); border-color: var(--border); }
.logout { margin-top: auto; color: #ffd2d8; border-color: rgba(255,101,117,.22); }
.content { min-width: 0; }
.topbar { min-height: 96px; padding: 8px 6px 20px; }
.section { display: none; }
.active-section { display: block; }
.grid { display: grid; gap: 18px; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .panel { padding: 24px; }
.card-label { color: var(--primary-2); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.output {
  min-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  border-radius: 18px;
  padding: 18px;
  color: #d9e7ff;
  background: rgba(0,0,0,.28);
  border: 1px solid var(--border);
}

@media (max-width: 980px) {
  .login-view, .app-view { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .cards, .filters { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .logout { margin-top: 20px; }
}
