:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e2ea;
  --panel: rgba(255, 255, 255, 0.94);
  --page: #f6f8fb;
  --nav: #071320;
  --brand: #0c7c7e;
  --brand-strong: #075f61;
  --gold: #c69a44;
  --blue: #204ce5;
  --ok: #11704d;
  --warn: #a95e00;
  --shadow: 0 24px 70px rgba(9, 19, 32, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.public-gate {
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(7, 19, 32, 0.92), rgba(8, 42, 52, 0.78)),
    radial-gradient(circle at 72% 24%, rgba(32, 76, 229, 0.32), transparent 30%),
    radial-gradient(circle at 20% 76%, rgba(198, 154, 68, 0.2), transparent 32%),
    #071320;
}

.hero-panel {
  position: relative;
  display: grid;
  min-height: calc(100vh - 56px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    rgba(255, 255, 255, 0.04);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.28);
}

.hero-panel::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 0 45%, rgba(255, 255, 255, 0.08) 45.2% 45.7%, transparent 46%),
    linear-gradient(150deg, transparent 0 58%, rgba(12, 124, 126, 0.18) 58.2% 58.8%, transparent 59%);
  content: "";
  pointer-events: none;
}

.public-nav {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(22px, 4vw, 58px);
}

.brand-logo {
  display: block;
  width: min(210px, 42vw);
  height: auto;
}

.public-nav .brand-logo {
  width: min(220px, 50vw);
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

.brand-logo.compact {
  width: 104px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
}

.nav-login,
.primary-login,
.auth-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}

.nav-login {
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 0 18px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 0.78fr);
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  padding: 18px clamp(22px, 5vw, 72px) 58px;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 800px;
  color: #ffffff;
  font-size: clamp(2.55rem, 6vw, 5.7rem);
  line-height: 0.96;
}

.hero-copy p:not(.eyebrow) {
  max-width: 650px;
  margin: 22px 0 0;
  color: #cbd8e6;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}

.primary-login {
  min-width: 230px;
  padding: 0 24px;
  color: #071320;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(255, 255, 255, 0.16);
}

.secure-note {
  color: #d8e4ef;
  font-weight: 700;
}

.intelligence-stage {
  position: relative;
  min-height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(7, 19, 32, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.intelligence-stage::before {
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  content: "";
}

.signal-card {
  position: absolute;
  left: 28px;
  top: 30px;
  z-index: 2;
  width: min(310px, calc(100% - 56px));
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.signal-card span,
.signal-card small {
  display: block;
  color: #cbd8e6;
}

.signal-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.22rem;
}

.orbital-map {
  position: absolute;
  inset: 86px 34px 92px;
}

.orbital-map span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 34px rgba(255, 255, 255, 0.72);
}

.orbital-map span:nth-child(1) { left: 14%; top: 55%; }
.orbital-map span:nth-child(2) { left: 34%; top: 28%; background: var(--gold); }
.orbital-map span:nth-child(3) { right: 18%; top: 38%; background: #5be7d9; }
.orbital-map span:nth-child(4) { right: 32%; bottom: 18%; }
.orbital-map span:nth-child(5) { left: 44%; bottom: 8%; background: #8ca6ff; }

.finance-strip {
  position: absolute;
  right: 30px;
  bottom: 30px;
  left: 30px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 12px;
  height: 110px;
}

.finance-strip i {
  display: block;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(12, 124, 126, 0.46));
}

.finance-strip i:nth-child(1) { height: 42%; }
.finance-strip i:nth-child(2) { height: 66%; }
.finance-strip i:nth-child(3) { height: 50%; }
.finance-strip i:nth-child(4) { height: 82%; }
.finance-strip i:nth-child(5) { height: 62%; }
.finance-strip i:nth-child(6) { height: 92%; background: linear-gradient(180deg, #f1d28a, rgba(198, 154, 68, 0.42)); }

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  color: #f8fbfc;
  background: var(--nav);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand strong,
.brand span,
.tenant-box strong,
.tenant-box span,
.tenant-box small {
  display: block;
}

.brand span,
.tenant-box small {
  color: #bccbd8;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.ghost-action,
.primary-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.nav-item {
  padding: 0 14px;
  color: #edf6f7;
  text-align: left;
  background: transparent;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tenant-box {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.workspace {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

h2 {
  font-size: 2rem;
  line-height: 1.08;
}

h3 {
  font-size: 1.1rem;
}

.page-subtitle {
  max-width: 700px;
  margin: 9px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connection-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid rgba(12, 124, 126, 0.2);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--brand-strong);
  background: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
}

.auth-link {
  border: 1px solid rgba(12, 124, 126, 0.2);
  padding: 0 14px;
  color: var(--brand-strong);
  background: #ffffff;
}

.notice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(12, 124, 126, 0.18);
  border-radius: 8px;
  padding: 14px 16px;
  background: #f7fcfc;
  box-shadow: 0 10px 28px rgba(16, 35, 51, 0.06);
}

.notice-bar strong,
.notice-bar span {
  display: block;
}

.notice-bar span,
.notice-bar small,
.send-note,
.document-meta,
.user-list small,
.folder-row small,
.empty-state span {
  color: var(--muted);
}

.notice-bar small {
  flex: 0 0 auto;
  font-weight: 800;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) minmax(420px, 1.08fr);
  gap: 18px;
}

.panel {
  border: 1px solid rgba(217, 226, 234, 0.9);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ai-panel {
  background:
    linear-gradient(135deg, rgba(12, 124, 126, 0.08), rgba(32, 76, 229, 0.04)),
    #ffffff;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading.compact {
  margin: 24px 0 12px;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

select:focus,
input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(12, 124, 126, 0.16);
}

.folder-card {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  border: 1px solid rgba(12, 124, 126, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: #f5fbfb;
}

.folder-card span,
.folder-card small {
  color: var(--muted);
  font-size: 0.86rem;
}

.folder-card strong {
  overflow-wrap: anywhere;
}

.upload-zone {
  display: grid;
  min-height: 220px;
  place-items: center;
  gap: 8px;
  padding: 28px;
  border: 1.5px dashed #91bdc2;
  border-radius: 8px;
  text-align: center;
  background: #f7fbfc;
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--brand);
  background: #ffffff;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone small {
  color: var(--muted);
}

.upload-icon {
  position: relative;
  width: 64px;
  height: 72px;
  border: 2px solid var(--brand);
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 0 65%, rgba(12, 124, 126, 0.18) 66%),
    linear-gradient(#c7e2e5, #c7e2e5) 14px 24px / 34px 4px no-repeat,
    linear-gradient(#c7e2e5, #c7e2e5) 14px 38px / 24px 4px no-repeat,
    #ffffff;
}

.form-row,
.user-form {
  display: grid;
  gap: 14px;
}

.form-row {
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.primary-action {
  width: 100%;
  margin-top: 16px;
  color: #ffffff;
  background: var(--brand);
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(12, 124, 126, 0.2);
}

.primary-action:hover {
  background: var(--brand-strong);
}

.send-note {
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.ghost-action {
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--brand-strong);
  background: #ffffff;
}

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

.insight-grid article,
.document-row,
.user-row,
.folder-row,
.empty-state {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
}

.insight-grid span {
  color: var(--muted);
  font-size: 0.82rem;
}

.document-list,
.user-list,
#client-folder-map {
  display: grid;
  gap: 10px;
}

.document-title,
.folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.folder-row span {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  color: #ffffff;
  font-size: 0.76rem;
  background: var(--ok);
}

.status-pill.pending {
  background: var(--warn);
}

.user-panel,
.checklist-panel {
  max-width: 980px;
}

.user-form {
  grid-template-columns: 1fr 1fr 220px;
  align-items: end;
  margin-bottom: 18px;
}

.user-form .primary-action {
  margin-top: 0;
}

.checklist {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

@media (max-width: 1100px) {
  .hero-content,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 18px;
  }

  .split-layout,
  .user-form,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .intelligence-stage {
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  .public-gate,
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .hero-panel {
    min-height: calc(100vh - 36px);
  }

  .public-nav,
  .hero-content {
    padding-inline: 18px;
  }

  .public-nav,
  .topbar,
  .top-actions,
  .notice-bar,
  .panel-heading,
  .document-title,
  .folder-row,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.48rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
