:root {
  --font-main: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --line: rgba(255, 255, 255, 0.62);
  --line-dark: rgba(16, 24, 40, 0.08);
  --text: #172033;
  --muted: #717b8d;
  --primary: #3478f6;
  --violet: #7c5cff;
  --cyan: #4cc9f0;
  --success: #1f9d70;
  --danger: #df4b5f;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-card: 0 22px 60px rgba(32, 57, 102, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  --shadow-button: 0 14px 30px rgba(52, 120, 246, 0.28);
  color: var(--text);
  font-family: var(--font-main);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 14%, rgba(76, 201, 240, 0.42), transparent 34%),
    radial-gradient(circle at 88% 5%, rgba(124, 92, 255, 0.24), transparent 32%),
    linear-gradient(145deg, #f8fbff, #eef6ff 48%, #f8f4ff);
  color: var(--text);
  font-family: var(--font-main);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, 0.26) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.26) 1px, transparent 1px);
  background-size: 56px 56px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.glass {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.app {
  min-height: 100vh;
}

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 24px;
  align-items: stretch;
  padding: 24px;
}

.login-hero,
.login-card,
.panel,
.top,
.sidebar,
.profile-card,
.access-card,
.empty-card {
  border-radius: var(--radius-xl);
}

.login-hero {
  display: grid;
  align-content: center;
  padding: clamp(28px, 6vw, 72px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  box-shadow: var(--shadow-button);
  color: white;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  margin-top: 36px;
  color: var(--text);
  font-size: clamp(38px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.98;
}

h2 {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

p {
  max-width: 620px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.7;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(24px, 4vw, 40px);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  font-size: 14px;
  font-weight: 600;
  transition: 170ms ease;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(52, 120, 246, 0.62);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 4px rgba(52, 120, 246, 0.12);
}

.button {
  min-height: 48px;
  border: 1px solid rgba(52, 120, 246, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #215ecf;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 800;
  transition: 180ms ease;
}

.button:hover {
  background: rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  box-shadow: var(--shadow-button);
  color: white;
}

.button.ghost {
  border-color: transparent;
  background: transparent;
}

.dashboard {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  height: calc(100vh - 48px);
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 22px;
}

.profile-mini {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.profile-mini img,
#profilePhoto {
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.5);
}

.profile-mini img {
  width: 58px;
  height: 58px;
  border-radius: 20px;
}

.profile-mini strong,
.profile-mini span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-mini strong {
  font-size: 14px;
  font-weight: 800;
}

.profile-mini span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-item {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  padding: 11px 14px;
  text-align: left;
  font-size: 14px;
  font-weight: 800;
  transition: 180ms ease;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.52);
  color: #215ecf;
}

.content {
  min-width: 0;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
  padding: 28px;
}

.top h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
}

.notice {
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  color: #215ecf;
  font-size: 13px;
  font-weight: 800;
}

.notice.error {
  color: var(--danger);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 24px;
}

.profile-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  padding: 28px;
}

#profilePhoto {
  width: 160px;
  height: 160px;
  border-radius: 38px;
}

.eyebrow {
  color: #215ecf;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.profile-details div {
  border: 1px solid rgba(16, 24, 40, 0.06);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.48);
  padding: 12px 14px;
}

.profile-details span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profile-details strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid rgba(16, 24, 40, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
}

.chip.success {
  background: rgba(31, 157, 112, 0.12);
  color: var(--success);
}

.chip.danger {
  background: rgba(223, 75, 95, 0.12);
  color: var(--danger);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.access-card,
.empty-card {
  padding: 22px;
}

.access-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-card strong {
  display: block;
  margin-top: 12px;
  font-size: 18px;
  font-weight: 800;
}

.access-card p {
  margin-top: 8px;
  font-size: 13px;
}

.panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.pass-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.span-2 {
  grid-column: 1 / -1;
}

.qr-panel {
  display: grid;
  gap: 18px;
}

.qr-frame {
  display: grid;
  min-height: 350px;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.48);
  padding: 20px;
}

.qr-frame img {
  display: none;
  width: min(300px, 100%);
  border-radius: 18px;
  background: white;
}

.qr-frame img.visible {
  display: block;
}

.qr-frame span {
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.pass-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pass-meta div {
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.42);
  padding: 14px;
}

.pass-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pass-meta strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.code-output {
  margin-top: 14px;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.event-list {
  display: grid;
  gap: 12px;
}

.event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.44);
  padding: 16px;
}

.event-item strong,
.event-item span {
  display: block;
}

.event-item strong {
  font-size: 14px;
  font-weight: 800;
}

.event-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1120px) {
  .login-view,
  .dashboard,
  .pass-layout,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .login-view,
  .dashboard {
    padding: 14px;
  }

  .profile-card,
  .form-grid,
  .pass-meta,
  nav {
    grid-template-columns: 1fr;
  }

  .top,
  .panel-head,
  .event-item {
    align-items: stretch;
    flex-direction: column;
  }

  #profilePhoto {
    width: 120px;
    height: 120px;
  }
}
