:root {
  --navy-900: #050d1a;
  --navy-800: #0a1628;
  --navy-700: #0f1f3d;
  --blue-500: #1e6fff;
  --blue-400: #38bdf8;
  --purple-600: #6c3ff5;
  --purple-400: #9b6dff;
  --brand-gradient: linear-gradient(135deg, #1e6fff 0%, #6c3ff5 100%);
  --text-primary: #f0f4ff;
  --text-secondary: #94a3b8;
  --text-muted: #4a5568;
  --border: rgba(255, 255, 255, .07);
  --border-bright: rgba(108, 63, 245, .3);
  --surface-1: rgba(255, 255, 255, .03);
  --surface-2: rgba(255, 255, 255, .06);
  --red: #ef4444;
  --green: #22c55e;
}

* {
  box-sizing: border-box;
}

.auth-page {
  min-height: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(480px, 1.1fr);
  overflow: auto;
  background:
    radial-gradient(circle at 75% 18%, rgba(30, 111, 255, .14), transparent 30%),
    radial-gradient(circle at 25% 82%, rgba(108, 63, 245, .12), transparent 34%),
    var(--navy-900);
  color: var(--text-primary);
  font: 14px Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.auth-brand-panel {
  position: relative;
  min-height: 100vh;
  padding: clamp(32px, 6vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  background: linear-gradient(155deg, rgba(10, 22, 40, .98), rgba(5, 13, 26, .78));
  overflow: hidden;
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -170px;
  bottom: -110px;
  border: 1px solid rgba(56, 189, 248, .12);
  border-radius: 50%;
  box-shadow:
    0 0 0 48px rgba(30, 111, 255, .025),
    0 0 0 96px rgba(108, 63, 245, .02);
}

.auth-brand,
.auth-brand-copy,
.auth-brand-footnote {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.auth-brand-logo {
  width: clamp(84px, 7vw, 112px);
  height: clamp(84px, 7vw, 112px);
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 34px rgba(30, 111, 255, .28));
}

.auth-brand-name {
  margin: 0;
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -.03em;
  background: var(--brand-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-brand-copy {
  max-width: 460px;
}

.auth-brand-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.auth-brand-copy h2 span {
  display: block;
}

.auth-brand-copy-accent {
  background: var(--brand-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-brand-copy p {
  max-width: 390px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
}

.auth-brand-footnote {
  color: var(--text-muted);
  font-size: 11px;
}

.auth-form-panel {
  min-height: 100vh;
  padding: 40px;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(430px, 100%);
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  background: rgba(15, 31, 61, .72);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px);
}

.auth-eyebrow,
.access-eyebrow {
  margin-bottom: 10px;
  color: var(--blue-400);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.auth-intro {
  margin: 9px 0 26px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.auth-field,
.access-field {
  display: grid;
  gap: 7px;
}

.auth-field + .auth-field {
  margin-top: 16px;
}

.auth-field label,
.access-field label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .035em;
}

.auth-field input,
.access-field input,
.access-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.auth-field input::placeholder,
.access-field input::placeholder {
  color: var(--text-muted);
}

.auth-field input:focus,
.access-field input:focus,
.access-field select:focus {
  border-color: rgba(30, 111, 255, .65);
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 3px rgba(30, 111, 255, .12);
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 22px;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: var(--brand-gradient);
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: transform .15s, filter .15s;
}

.auth-submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.auth-submit:focus-visible {
  outline: 3px solid rgba(56, 189, 248, .32);
  outline-offset: 3px;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: .65;
  transform: none;
}

.auth-error {
  min-height: 20px;
  margin-top: 12px;
  color: #fca5a5;
  font-size: 12px;
  line-height: 1.45;
}

.auth-help {
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions .topbar-back {
  margin-left: 0;
  color: var(--text-secondary);
}

.access-page .admin-nav .nav-item {
  text-decoration: none;
}

.access-main {
  background:
    radial-gradient(circle at 82% 8%, rgba(30, 111, 255, .09), transparent 26%),
    var(--navy-900);
}

.access-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 32px 56px;
}

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

.access-title {
  margin: 0 0 6px;
  display: inline-block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.035em;
  background: var(--brand-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.access-subtitle {
  max-width: 610px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.access-security-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 7px 11px;
  border: 1px solid rgba(34, 197, 94, .24);
  border-radius: 999px;
  background: rgba(34, 197, 94, .09);
  color: #86efac;
  font-size: 10px;
  font-weight: 700;
}

.access-security-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px rgba(34, 197, 94, .55);
}

.access-notice {
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid rgba(239, 68, 68, .25);
  border-radius: 9px;
  background: rgba(239, 68, 68, .09);
  color: #fca5a5;
  font-size: 12px;
}

.access-notice:empty {
  display: none;
}

.access-notice.success {
  border-color: rgba(34, 197, 94, .25);
  background: rgba(34, 197, 94, .09);
  color: #86efac;
}

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

.access-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-1);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .12);
}

.access-card-wide {
  grid-column: 1 / -1;
}

.access-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.access-card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--border-bright);
  background: linear-gradient(135deg, rgba(30, 111, 255, .15), rgba(108, 63, 245, .15));
  color: var(--blue-400);
}

.access-card h2 {
  margin: 1px 0 3px;
  font-size: 15px;
  font-weight: 700;
}

.access-card-copy,
.access-helper {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.access-form {
  display: grid;
  gap: 14px;
}

.access-form .btn {
  min-height: 40px;
  justify-content: center;
}

.access-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.access-users {
  display: grid;
  gap: 8px;
}

.access-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, .022);
}

.access-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(30, 111, 255, .24), rgba(108, 63, 245, .24));
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 800;
}

.access-user-body {
  min-width: 0;
  flex: 1;
}

.access-user-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 700;
}

.access-user-email,
.access-user-workspaces,
.access-empty {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.access-role-badge {
  padding: 2px 7px;
  border: 1px solid rgba(108, 63, 245, .28);
  border-radius: 999px;
  background: rgba(108, 63, 245, .13);
  color: #c4b5fd;
  font-size: 9px;
  font-weight: 700;
}

.access-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
}

@media (max-width: 860px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    min-height: auto;
    padding: 24px clamp(24px, 8vw, 60px);
    gap: 22px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .auth-brand-footnote,
  .auth-brand-panel::after {
    display: none;
  }

  .auth-brand-logo {
    width: 72px;
    height: 72px;
  }

  .auth-brand-name {
    font-size: 30px;
  }

  .auth-brand-copy h2 {
    margin-bottom: 10px;
    font-size: clamp(24px, 6vw, 34px);
  }

  .auth-brand-copy p {
    font-size: 14px;
  }

  .auth-form-panel {
    min-height: auto;
    padding: 48px 24px;
  }

  .access-page .admin-layout {
    flex-direction: column;
  }

  .access-page .admin-nav {
    width: 100%;
    padding: 8px;
    flex-direction: row;
    flex-shrink: 0;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
  }

  .access-page .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .access-page .admin-nav .nav-label {
    display: none;
  }

  .access-page .admin-nav .nav-item {
    width: auto;
    flex-shrink: 0;
  }
}

@media (max-width: 680px) {
  .access-section {
    padding: 24px 18px 44px;
  }

  .access-header {
    display: block;
  }

  .access-security-pill {
    margin-top: 14px;
  }

  .access-grid,
  .access-field-row {
    grid-template-columns: 1fr;
  }

  .access-card-wide {
    grid-column: auto;
  }

  .topbar-actions .topbar-back {
    padding: 5px 8px;
  }
}

@media (max-width: 500px) {
  .auth-brand-panel {
    padding: 20px;
  }

  .auth-brand-logo {
    width: 64px;
    height: 64px;
  }

  .auth-brand-name {
    font-size: 27px;
  }

  .auth-form-panel {
    padding: 28px 16px;
  }

  .auth-card {
    padding: 26px 22px;
    border-radius: 14px;
  }

  .access-page .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .access-page .topbar-sep,
  .access-page .topbar-section {
    display: none;
  }

  .access-page .topbar-actions .topbar-back:first-child {
    display: none;
  }
}
