:root {
  --sidebar-width: 248px;
  --mobile-topbar-height: 56px;
  --bg: #f5f6f8;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-soft: rgba(10, 132, 255, 0.08);
  --ink: #111827;
  --ink-mid: #3f4654;
  --muted: #6b7280;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --accent: #0a84ff;
  --accent-hover: #0070db;
  --ok: #247a4d;
  --warn: #a15c00;
  --danger: #b42318;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 28px rgba(15, 23, 42, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(10, 132, 255, 0.12), transparent 28rem),
    linear-gradient(180deg, #fafbfc 0%, #f4f6f8 100%);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

button,
input,
select,
textarea {
  font: inherit;
}

.nexus-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.nexus-public-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  background: rgba(248, 249, 251, 0.86);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.nexus-public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nexus-brand,
.arke-sidebar-brand,
.arke-mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.nexus-brand-mark,
.arke-sidebar-logo,
.arke-mobile-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 34px rgba(10, 132, 255, 0.24);
  font-weight: 760;
}

.nexus-brand-mark {
  width: 44px;
  height: 44px;
  font-size: 17px;
}

.nexus-brand-copy {
  display: grid;
  gap: 2px;
}

.nexus-brand-copy strong {
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.nexus-brand-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nexus-public-links {
  display: flex;
  gap: 20px;
}

.nexus-public-links a {
  color: var(--ink-mid);
  font-weight: 650;
}

.nexus-public-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nexus-public-main {
  padding: 32px 0 44px;
}

.hero-card,
.card,
.metric-card,
.nexus-panel,
.table-shell,
.auth-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero-card {
  padding: 28px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 22px;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-title {
  margin: 12px 0 14px;
  font-size: clamp(46px, 6vw, 74px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero-copy {
  max-width: 620px;
  color: var(--ink-mid);
  font-size: 20px;
  line-height: 1.5;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-module-list,
.stack {
  display: grid;
  gap: 14px;
}

.hero-module {
  padding: 18px;
  border-radius: 22px;
  background: #f5f7fb;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.hero-module strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-space {
  margin-top: 22px;
}

.card,
.metric-card,
.table-shell,
.auth-card {
  padding: 22px;
}

.metric-card h3,
.card h3,
.table-shell h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
}

.metric-value {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.muted {
  color: var(--muted);
}

.list-table {
  width: 100%;
  border-collapse: collapse;
}

.list-table th,
.list-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.list-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.list-table tr:last-child td {
  border-bottom: 0;
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill.ok { background: rgba(36, 122, 77, 0.12); color: var(--ok); }
.status-pill.warn { background: rgba(161, 92, 0, 0.14); color: var(--warn); }
.status-pill.danger { background: rgba(180, 35, 24, 0.12); color: var(--danger); }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.form-group small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.nexus-input,
.nexus-textarea,
.nexus-select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.nexus-textarea {
  min-height: 140px;
  resize: vertical;
}

.nexus-input:focus,
.nexus-textarea:focus,
.nexus-select:focus {
  border-color: rgba(10, 132, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
}

.nexus-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-mid);
}

.nexus-alert {
  margin-bottom: 18px;
  padding: 15px 18px;
  border-radius: 18px;
  font-weight: 650;
}

.nexus-alert.success { background: rgba(36, 122, 77, 0.12); color: var(--ok); }
.nexus-alert.warning { background: rgba(161, 92, 0, 0.12); color: var(--warn); }
.nexus-alert.danger { background: rgba(180, 35, 24, 0.12); color: var(--danger); }

.nexus-empty {
  padding: 22px;
  border-radius: 22px;
  background: #f7f8fa;
  color: var(--muted);
  text-align: center;
}

.nexus-footer {
  padding: 0 0 34px;
}

.nexus-footer p {
  margin: 0;
  color: var(--muted);
}

.auth-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 24px;
  align-items: start;
}

.auth-card {
  max-width: 620px;
}

.auth-side {
  padding: 28px;
}

.auth-side ul {
  padding-left: 18px;
  color: var(--ink-mid);
}

.arke-app {
  display: flex;
  min-height: 100vh;
}

.arke-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 12px 0 34px rgba(15, 23, 42, 0.08);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.arke-sidebar-logo {
  width: 46px;
  height: 46px;
  font-size: 17px;
}

.arke-sidebar-brand-text h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.arke-sidebar-brand-text span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.arke-sidebar-section {
  display: grid;
  gap: 6px;
}

.arke-sidebar-section::before {
  content: "Workspace";
  padding: 0 12px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.arke-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  color: #4b5563;
  border-radius: 14px;
  font-weight: 650;
  transition: background 150ms ease, color 150ms ease;
}

.arke-nav-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d5dae3;
}

.arke-nav-item:hover,
.arke-nav-item.active {
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink);
}

.arke-nav-item.active::before {
  background: var(--ink);
}

.arke-sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.arke-sidebar-user {
  display: grid;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 18px;
  background: #f5f7fb;
}

.arke-user-name {
  font-size: 14px;
  font-weight: 760;
}

.arke-user-role {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.arke-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.arke-topbar {
  display: none;
}

.arke-content {
  width: min(100%, 1440px);
  padding: 28px;
}

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

.topbar h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.topbar span {
  color: var(--muted);
  font-weight: 650;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.35fr 0.65fr;
}

.org-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.org-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 132, 255, 0.12);
  color: var(--accent);
  font-weight: 760;
}

.split-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.split-header h3 {
  margin: 0;
}

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

.module-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.module-card h4 {
  margin: 0 0 8px;
  font-size: 20px;
}

.stat-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.stat-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0a84ff, #5aa9ff);
}

.mobile-only {
  display: none;
}

@media (max-width: 1100px) {
  .hero-grid,
  .auth-layout,
  .workspace-grid,
  .dashboard-grid,
  .module-cards,
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .arke-sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.nav-open .arke-sidebar {
    transform: translateX(0);
  }

  .arke-mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 55;
    border: 0;
    background: rgba(17, 24, 39, 0.2);
  }

  body.nav-open .arke-mobile-nav-backdrop {
    display: block;
  }

  .arke-main {
    margin-left: 0;
  }

  .arke-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--mobile-topbar-height);
    padding: 12px 18px;
    background: rgba(248, 249, 251, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(20px);
  }

  .arke-mobile-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 12px;
  }

  .arke-mobile-brand-word {
    color: var(--ink);
    font-size: 18px;
    font-weight: 760;
    letter-spacing: -0.03em;
  }

  .arke-topbar-title {
    display: none;
  }

  .arke-mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  .arke-mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 2px 0;
    background: var(--ink);
    border-radius: 999px;
  }
}

@media (max-width: 720px) {
  .nexus-container {
    width: calc(100% - 24px);
  }

  .nexus-public-nav {
    flex-wrap: wrap;
  }

  .nexus-public-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .hero-grid,
  .auth-layout,
  .grid-2,
  .dashboard-grid,
  .workspace-grid,
  .module-cards,
  .grid-4,
  .grid-3,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .card,
  .metric-card,
  .table-shell,
  .auth-card {
    padding: 18px;
  }

  .arke-content {
    padding: 18px 14px 24px;
  }

  .topbar {
    display: block;
  }

  .topbar span {
    display: inline-block;
    margin-top: 10px;
  }

  .mobile-only {
    display: inline-flex;
  }
}
