:root {
  color-scheme: dark;
  --bg: #05060c;
  --panel: rgba(10, 11, 19, 0.94);
  --panel-soft: rgba(20, 22, 34, 0.82);
  --line: rgba(155, 165, 202, 0.22);
  --line-strong: rgba(155, 165, 202, 0.38);
  --text: #f7f8fc;
  --muted: #a8afc1;
  --blue: #2f63ff;
  --violet: #8667ff;
  --orange: #ff7440;
  --gold: #f4bd45;
  --green: #48d39b;
  --red: #ff647c;
  --gradient: linear-gradient(115deg, var(--blue), var(--violet) 38%, var(--orange) 72%, var(--gold));
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 20% 18%, rgba(47, 99, 255, 0.15), transparent 30%),
    radial-gradient(circle at 80% 18%, rgba(255, 116, 64, 0.13), transparent 30%),
    radial-gradient(circle at 18% 90%, rgba(244, 189, 69, 0.09), transparent 34%),
    linear-gradient(145deg, #030409, var(--bg) 55%, #080811);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000, transparent 82%);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.access-shell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 18px;
}

.access-card {
  width: min(100%, 560px);
  padding: clamp(26px, 5vw, 52px);
  border: 1px solid transparent;
  border-radius: 22px;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    var(--gradient) border-box;
  box-shadow: 0 36px 120px rgba(0, 0, 0, 0.68), 0 0 54px rgba(65, 88, 255, 0.12);
  backdrop-filter: blur(20px) saturate(1.08);
}

.access-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.access-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.04em;
  background:
    linear-gradient(#0b0d16, #0b0d16) padding-box,
    var(--gradient) border-box;
  box-shadow: 0 0 28px rgba(72, 96, 255, 0.22);
}

.access-brand-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.access-brand-sub {
  margin: 3px 0 0;
  color: var(--orange);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.access-eyebrow {
  margin: 0 0 10px;
  color: #aebcff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.access-title {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.25rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  background: linear-gradient(100deg, #fff 10%, #c4ceff 45%, #ffb27f 78%, #ffe29e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.access-copy {
  margin: 18px 0 28px;
  color: var(--muted);
  line-height: 1.65;
}

.access-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
}

.access-tab {
  min-height: 43px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.access-tab[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(145deg, rgba(67, 91, 255, 0.26), rgba(255, 116, 64, 0.12));
  box-shadow: inset 0 0 0 1px rgba(126, 139, 255, 0.3);
}

.access-pane[hidden] {
  display: none;
}

.access-pane p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.field-label {
  display: block;
  margin-bottom: 9px;
  color: #dfe3f0;
  font-size: 0.84rem;
  font-weight: 750;
}

.field-input,
.field-select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field-input:focus,
.field-select:focus {
  border-color: rgba(93, 116, 255, 0.72);
  background: rgba(79, 99, 183, 0.09);
  box-shadow: 0 0 0 4px rgba(65, 91, 255, 0.1), 0 0 28px rgba(255, 116, 64, 0.06);
}

.field-input::placeholder {
  color: #747b8d;
}

.access-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 16px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  background: var(--gradient);
  box-shadow: 0 14px 34px rgba(73, 72, 185, 0.28);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.access-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 18px 42px rgba(73, 72, 185, 0.36);
}

.access-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.access-button-secondary {
  color: #e7e9f2;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
}

.access-message {
  min-height: 22px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.access-message[data-tone="error"] {
  color: #ff93a4;
}

.access-message[data-tone="success"] {
  color: #70e5b6;
}

.access-footnote {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: #858c9e;
  font-size: 0.78rem;
  line-height: 1.55;
}

.access-footnote::before {
  content: "◆";
  color: var(--gold);
  font-size: 0.65rem;
  margin-top: 3px;
}

.dashboard-shell {
  position: relative;
  z-index: 1;
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 11, 19, 0.86);
  backdrop-filter: blur(18px);
}

.dashboard-header .access-brand {
  margin: 0;
}

.dashboard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: #e8eaf2;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  font-weight: 700;
}

.small-button:hover {
  border-color: rgba(117, 133, 255, 0.55);
  background: rgba(75, 95, 177, 0.13);
}

.small-button-danger {
  border-color: rgba(255, 100, 124, 0.32);
  color: #ff9dad;
}

.dashboard-intro {
  margin-bottom: 24px;
}

.dashboard-intro h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.05em;
}

.dashboard-intro p {
  margin: 9px 0 0;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(520px, 1.5fr);
  gap: 18px;
  align-items: start;
}

.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(18, 20, 31, 0.92), rgba(8, 9, 15, 0.95));
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.dashboard-card-head {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.dashboard-card-head h2 {
  margin: 0;
  font-size: 1rem;
}

.dashboard-card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.dashboard-card-body {
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .field-full {
  grid-column: 1 / -1;
}

.generated-code {
  display: none;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(72, 211, 155, 0.3);
  border-radius: 13px;
  background: rgba(72, 211, 155, 0.07);
}

.generated-code.show {
  display: block;
}

.generated-code code {
  display: block;
  margin: 10px 0;
  overflow-wrap: anywhere;
  color: #9df2cb;
  font: 750 0.95rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

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

.data-table th {
  color: #8f97aa;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table td {
  color: #d9dce7;
}

.status-pill {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
}

.status-pill.ok {
  color: #7ce6ba;
  border-color: rgba(72, 211, 155, 0.25);
  background: rgba(72, 211, 155, 0.07);
}

.status-pill.denied,
.status-pill.revoked {
  color: #ff9cad;
  border-color: rgba(255, 100, 124, 0.28);
  background: rgba(255, 100, 124, 0.07);
}

.empty-row {
  padding: 24px !important;
  color: var(--muted) !important;
  text-align: center !important;
}

.dashboard-stack {
  display: grid;
  gap: 18px;
}

.dashboard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-toolbar .field-input {
  width: min(100%, 330px);
  min-height: 40px;
}

@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .access-card {
    padding: 26px 20px;
  }

  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .form-grid .field-full {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
