@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&family=Nunito+Sans:wght@400;600;700&display=swap');

:root {
  --bg-0: #03142f;
  --bg-1: #062858;
  --bg-2: #073d73;
  --glass: rgba(255, 255, 255, 0.075);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.16);
  --text: #edf6ff;
  --muted: #9fb4c7;
  --accent: #10dce8;
  --accent-2: #1277f2;
  --success: #42f5a7;
  --warning: #ffd166;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", "Poppins", "Nunito Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(46, 232, 255, 0.16), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(139, 92, 246, 0.18), transparent 30%),
    linear-gradient(135deg, var(--bg-0), var(--bg-1) 42%, var(--bg-2));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.glass-panel {
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,255,255,.105), rgba(255,255,255,.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  border-radius: var(--radius-xl);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #031018;
  box-shadow: 0 0 40px rgba(46,232,255,.35);
}

.brand-lockup strong { display: block; font-size: 1rem; }
.brand-lockup span { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }

.nav-stack {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}
.nav-item {
  color: var(--muted);
  text-decoration: none;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border .25s var(--ease);
}
.nav-item:hover, .nav-item.active {
  color: var(--text);
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.13);
  transform: translateX(3px);
}
.sidebar-footer {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: .88rem;
}
.status-dot, .pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 0 0 rgba(255,209,102,.6);
  animation: pulse 1.7s infinite;
}
.status-dot.ok { background: var(--success); box-shadow: 0 0 0 0 rgba(66,245,167,.6); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 0 rgba(255,107,107,.6); }

.main-stage { min-width: 0; }
.topbar {
  min-height: 116px;
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.eyebrow {
  color: var(--accent);
  font-weight: 800;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.055em; }
h2 { margin-bottom: 14px; font-size: clamp(1.8rem, 3vw, 3.4rem); line-height: .98; letter-spacing: -.06em; }
h3 { margin-bottom: 10px; font-size: 1.12rem; }
p { color: var(--muted); line-height: 1.65; }

.primary-action, .ghost-action {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 850;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.primary-action {
  color: #041019;
  background: linear-gradient(135deg, var(--accent), #9ef7ff 48%, var(--accent-2));
  box-shadow: 0 14px 36px rgba(46,232,255,.22);
}
.primary-action:hover { transform: translateY(-2px); box-shadow: 0 20px 48px rgba(46,232,255,.28); }
.ghost-action {
  color: var(--text);
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.13);
}
.ghost-action:hover { transform: translateY(-2px); background: rgba(255,255,255,.14); }

.content-section { display: none; padding-top: 24px; }
.active-section { display: block; animation: sectionIn .35s var(--ease); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 24px;
}
.hero-card, .qs-orb-card, .metric-card, .builder-shell, .system-card {
  border-radius: var(--radius-xl);
  padding: 28px;
}
.hero-card p { max-width: 840px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.qs-orb-card { display: grid; align-content: center; justify-items: center; text-align: center; }
.qs-orb {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  position: relative;
  background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.95), rgba(46,232,255,.35) 35%, rgba(139,92,246,.18) 65%, rgba(255,255,255,.05));
  box-shadow: inset 0 0 30px rgba(255,255,255,.22), 0 0 70px rgba(46,232,255,.25);
}
.qs-orb::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,.35);
}
.qs-orb span { position: absolute; top: 48px; color: rgba(255,255,255,.86); font-size: .72rem; letter-spacing: .18em; font-weight: 900; }
.qs-orb strong { font-size: 3rem; color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.35); }

.card-grid, .artifact-grid, .system-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.metric-card { min-height: 160px; }
.metric-label {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  margin-bottom: 12px;
}
.metric-card strong { display: block; font-size: 1.35rem; margin-bottom: 10px; }
.section-heading { margin: 6px 0 18px; max-width: 920px; }

.artifact-card {
  border-radius: var(--radius-xl);
  padding: 24px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  transition: transform .25s var(--ease), border .25s var(--ease), background .25s var(--ease);
}
.artifact-card:hover { transform: translateY(-5px); background: rgba(255,255,255,.105); }
.artifact-pill {
  width: fit-content;
  border: 1px solid rgba(46,232,255,.25);
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: .76rem;
  margin-bottom: 18px;
  background: rgba(46,232,255,.06);
}
.artifact-card footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .86rem; }

.builder-shell { min-height: 520px; }
.builder-header { max-width: 980px; }
.command-bar {
  display: flex;
  gap: 12px;
  margin: 26px 0;
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 8px;
}
.command-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  padding: 0 16px;
  font-size: 1rem;
}
.command-bar input::placeholder { color: rgba(237,246,255,.46); }
.builder-output {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.17);
  padding: 22px;
}
.empty-state { display: flex; align-items: center; gap: 12px; }
.builder-proposal { display: grid; gap: 16px; }
.builder-proposal ul { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.8; }

.system-grid { grid-template-columns: 1.15fr .85fr; }
pre {
  margin: 0;
  overflow: auto;
  max-height: 440px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.28);
  color: #b8fff5;
  border: 1px solid rgba(255,255,255,.1);
}
code {
  background: rgba(255,255,255,.09);
  padding: 2px 6px;
  border-radius: 8px;
  color: #cbfbff;
}
.checklist { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.8; }

.reveal-up { opacity: 0; transform: translateY(18px); animation: revealUp .7s var(--ease) forwards; }
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .14s; }
.delay-3 { animation-delay: .2s; }
.delay-4 { animation-delay: .26s; }

@keyframes revealUp { to { opacity: 1; transform: translateY(0); } }
@keyframes sectionIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(46,232,255,0); } 100% { box-shadow: 0 0 0 0 rgba(46,232,255,0); } }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; padding: 14px; }
  .sidebar { position: relative; height: auto; top: 0; }
  .nav-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-direction: column; align-items: flex-start; }
  .hero-grid, .card-grid, .artifact-grid, .system-grid { grid-template-columns: 1fr; }
  .command-bar { border-radius: 22px; flex-direction: column; }
  .command-bar input { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

/* Sprint 2 — Auth, Tenant & Workspace */
.is-hidden { display: none !important; }
.login-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-card {
  width: min(720px, 100%);
  border-radius: var(--radius-xl);
  padding: clamp(26px, 5vw, 44px);
}
.login-brand { border-bottom: 0; padding-bottom: 20px; margin-bottom: 16px; }
.login-card h1 { margin: 8px 0 14px; }
.login-form { display: grid; gap: 16px; margin-top: 28px; }
.login-form label { display: grid; gap: 8px; color: var(--muted); font-weight: 700; }
.login-form input,
.command-bar input {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(255,255,255,.14);
  color: var(--text);
  background: rgba(255,255,255,.075);
  border-radius: 18px;
  padding: 0 16px;
  outline: none;
  transition: border .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.login-form input:focus,
.command-bar input:focus {
  border-color: rgba(46,232,255,.62);
  background: rgba(255,255,255,.105);
  box-shadow: 0 0 0 4px rgba(46,232,255,.09);
}
.full-width { width: 100%; justify-content: center; }
.inline-message {
  margin-top: 18px;
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.065);
  color: var(--muted);
}
.inline-message.error-message { color: #ffd6d6; border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.09); }
.inline-message.success-message { color: #c7ffe6; border-color: rgba(66,245,167,.35); background: rgba(66,245,167,.09); }
.muted-message strong { color: var(--text); }
.topbar-subtitle { margin: 8px 0 0; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.07);
  border-radius: 999px;
  padding: 8px 12px 8px 8px;
}
.user-chip > span {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041019;
  font-weight: 900;
}
.user-chip strong { display: block; font-size: .9rem; }
.user-chip small { color: var(--muted); display: block; margin-top: 1px; }
.stack-footer { display: grid; gap: 12px; }
.status-line { display: flex; gap: 10px; align-items: center; }
.mini-action { padding: 9px 12px; width: 100%; }
.two-column-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .7fr);
  gap: 18px;
}
.system-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.activity-list { display: grid; gap: 10px; }
.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.activity-item:last-child { border-bottom: 0; }
.activity-item strong { color: var(--text); font-size: .92rem; }
.activity-item span { color: var(--muted); font-size: .82rem; }
.small-empty {
  min-height: 90px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.permission-pill {
  border: 1px solid rgba(46,232,255,.22);
  color: var(--accent);
  background: rgba(46,232,255,.07);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: .82rem;
  font-weight: 800;
}
.metric-card .metric-kicker { color: var(--accent); font-size: .78rem; display: block; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .12em; }
.metric-card strong.metric-number { font-size: 2.1rem; letter-spacing: -.05em; }

@media (max-width: 1050px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .two-column-grid, .system-grid.two-cols { grid-template-columns: 1fr; }
}


/* Sprint 3 — Fluss.work Branding + Users/Roles UX */
.brand-mark.image-mark {
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(16,220,232,.22);
}
.brand-mark.image-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-lockup strong { font-weight: 600; letter-spacing: -.02em; }
body { font-weight: 400; }
h1, h2, h3, .primary-action, .ghost-action, .eyebrow { font-family: "Montserrat", "Poppins", sans-serif; }
h1, h2, h3 { font-weight: 600; }
.brand-wordmark { max-width: 220px; margin-bottom: 22px; padding: 10px 0; }
.brand-wordmark img { width: 100%; height: auto; display: block; filter: drop-shadow(0 12px 42px rgba(16,220,232,.18)); }
.brand-hero { position: relative; overflow: hidden; }
.brand-hero::after {
  content: "";
  position: absolute;
  inset: auto -15% -45% 35%;
  height: 260px;
  background: radial-gradient(circle, rgba(16,220,232,.22), transparent 62%);
  pointer-events: none;
}
.nav-item { display: flex; gap: 10px; align-items: center; }
.nav-item span { color: var(--accent); font-weight: 800; }
.split-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.align-start { align-items: start; }
.admin-form { display: grid; gap: 14px; }
.admin-form label { display: grid; gap: 7px; color: var(--muted); font-size: .86rem; }
.admin-form input, .admin-form select, .command-bar input, .login-form input {
  width: 100%;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.075);
  border-radius: 16px;
  padding: 13px 14px;
  outline: none;
  transition: border .22s var(--ease), box-shadow .22s var(--ease), background .22s var(--ease);
  font-family: "Montserrat", "Poppins", sans-serif;
}
.admin-form input:focus, .admin-form select:focus, .command-bar input:focus, .login-form input:focus {
  border-color: rgba(16,220,232,.6);
  box-shadow: 0 0 0 4px rgba(16,220,232,.12);
  background: rgba(255,255,255,.11);
}
.admin-form select option { color: #061529; background: #f7fbff; }
.compact-form { grid-template-columns: 1fr auto; align-items: end; }
.compact-form .full-width { width: auto; }
.full-width { width: 100%; }
.inline-message { margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); }
.muted-message { color: var(--muted); background: rgba(255,255,255,.06); }
.error-message { color: #ffd6d6; background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.22); }
.success-message { color: #caffdf; background: rgba(66,245,167,.10); border-color: rgba(66,245,167,.22); }
.top-space { margin-top: 16px; }
.top-space-xl { margin-top: 24px; }
.soft-divider { border: 0; border-top: 1px solid rgba(255,255,255,.10); margin: 22px 0; }
.table-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.metric-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 8px 12px; background: rgba(16,220,232,.12); color: var(--accent); border: 1px solid rgba(16,220,232,.22); font-weight: 700; white-space: nowrap; }
.table-wrap { overflow: auto; border-radius: 18px; border: 1px solid rgba(255,255,255,.10); }
.data-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.data-table th, .data-table td { padding: 15px 16px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: middle; }
.data-table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; background: rgba(255,255,255,.05); }
.data-table td { color: var(--text); }
.data-table tr:hover td { background: rgba(255,255,255,.035); }
.user-cell { display: flex; gap: 12px; align-items: center; }
.user-cell > span { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #041019; font-weight: 800; }
.user-cell strong, .data-table td strong { display: block; font-weight: 600; }
.user-cell small, .data-table td small { display: block; color: var(--muted); margin-top: 4px; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; padding: 7px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.status-active { color: #bcffd8; background: rgba(66,245,167,.12); border: 1px solid rgba(66,245,167,.25); }
.status-inactive { color: #ffdfdf; background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.22); }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 999px; color: var(--text); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); font-size: .82rem; }
.area-pill { border-color: rgba(16,220,232,.22); background: rgba(16,220,232,.08); }
.muted-pill { color: var(--muted); }
.mini-action:disabled, .primary-action:disabled, .ghost-action:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.activity-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 24px rgba(16,220,232,.45); }
.activity-item strong { display: block; font-weight: 600; }
.activity-item small { display: block; color: var(--muted); margin-top: 4px; }
@media(max-width: 860px) {
  .split-heading, .table-header, .compact-form { grid-template-columns: 1fr; flex-direction: column; }
  .compact-form .full-width { width: 100%; }
}
