:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f3f4f6;
  background: #0a0a0c;
  --background: #0a0a0c;
  --sidebar: #0d0d10;
  --card: #141418;
  --popover: #0f0f12;
  --muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.1);
  --primary: #c8a563;
  --forest: #09251d;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 25% 0%, rgba(200, 165, 99, 0.16), transparent 28rem),
    radial-gradient(circle at 90% 8%, rgba(15, 58, 45, 0.3), transparent 26rem),
    var(--background);
}

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

button {
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(13, 13, 16, 0.92);
  padding: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #d8b86e, #9b7b3d);
  background-size: cover;
  background-position: center;
  color: #09251d;
  box-shadow: 0 16px 42px rgba(200, 165, 99, 0.28);
  font-weight: 900;
  overflow: hidden;
}

.brand strong {
  display: block;
  letter-spacing: -0.02em;
  font-size: 20px;
}

.brand span {
  color: #c8a563;
  font-size: 12px;
  font-weight: 800;
}

.nav-caption,
.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 11px 12px;
}

.nav-button.active,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.06);
}

.nav-icon {
  color: #c8a563;
}

.profile-qr-card {
  border: 1px solid rgba(200, 165, 99, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(200, 165, 99, 0.16), rgba(9, 37, 29, 0.72));
  padding: 16px;
}

.profile-qr-card p {
  margin: 0 0 12px;
  color: #e8c982;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-qr-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.qr-box {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  color: #111;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 0 32px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(18px);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 16px;
  color: var(--muted);
  font-weight: 700;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.04em;
}

h3 {
  margin: 9px 0 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-entry {
  border: 1px solid rgba(200, 165, 99, 0.34);
  background: rgba(200, 165, 99, 0.1);
  color: #f5d38b;
  padding: 10px 13px;
  white-space: nowrap;
}

.api-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.api-pill[data-tone="ok"] {
  color: #e8c982;
  border-color: rgba(200, 165, 99, 0.35);
}

.api-pill[data-tone="error"] {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.token-switch {
  display: grid;
  gap: 4px;
  min-width: 180px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  outline: none;
  font-weight: 400;
}

.field-status {
  display: block;
  margin-top: 8px;
  color: #f5d38b;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

option {
  background: #141418;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(200, 165, 99, 0.72);
}

.view {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 30px;
}

.view.active {
  display: block;
}

.hero-panel,
.organization-group,
.form-panel,
.dashboard,
.scanner-grid,
.empty-state {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(16, 21, 20, 0.86);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
  margin-bottom: 24px;
}

.hero-panel p,
.section-head p,
.organization-head p,
.event-meta,
.ticket-number.muted {
  color: var(--muted);
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 12px;
  width: 100%;
}

.summary-metrics div,
.summary-metrics button,
.metric-row div {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
}

.summary-metrics button {
  color: var(--text);
  cursor: pointer;
  text-align: left;
  min-height: 108px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.summary-metrics button:hover {
  transform: translateY(-2px);
  border-color: rgba(216, 184, 110, 0.5);
  background: rgba(216, 184, 110, 0.08);
}

.summary-metrics strong,
.metric-row strong {
  display: block;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.summary-metrics span,
.metric-row span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.org-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-tabs,
.event-tag-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.profile-tabs button,
.event-register-action,
.directory-action,
.payment-link-button {
  border: 1px solid rgba(216, 184, 110, 0.28);
  border-radius: 14px;
  background: rgba(216, 184, 110, 0.1);
  color: var(--text);
  padding: 12px 16px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  text-decoration: none;
  margin-top: 12px;
}

.profile-tabs button.active,
.event-register-action {
  background: linear-gradient(145deg, #f1d78d, #d0a85b);
  color: #11140f;
}

.profile-tabs button:disabled,
.event-register-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-section {
  display: none;
}

.profile-section.active {
  display: block;
}

.auto-grow-textarea {
  min-height: 44px;
  resize: vertical;
  overflow: hidden;
}

.payment-proof-preview {
  display: block;
  max-width: 240px;
  max-height: 180px;
  border-radius: 12px;
  margin-top: 10px;
  border: 1px solid rgba(216, 184, 110, 0.28);
}

.event-directory-row a {
  color: #f3d68a;
  font-weight: 900;
  text-decoration: none;
}

.event-directory-row {
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) auto auto;
}

.directory-action {
  padding: 8px 10px;
  font-size: 12px;
}

body.public-registration-mode .sidebar,
body.public-registration-mode .topbar-controls,
body.public-registration-mode .nav-caption {
  display: none;
}

body.public-registration-mode .app-shell {
  grid-template-columns: 1fr;
}

body.public-registration-mode .main {
  max-width: 920px;
  margin: 0 auto;
}

.organization-stack {
  display: grid;
  gap: 22px;
}

.organization-group {
  overflow: hidden;
  position: relative;
}

.organization-group::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--org-primary), var(--org-accent));
}

.organization-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--org-primary) 20%, transparent), transparent 42%),
    rgba(255, 255, 255, 0.015);
}

.organization-head > div:nth-child(2) {
  flex: 1;
}

.org-logo {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  font-weight: 900;
}

.org-counter {
  display: grid;
  place-items: center;
  min-width: 112px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
}

.org-counter strong {
  font-size: 32px;
  line-height: 1;
}

.org-counter span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 900;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  padding: 18px;
}

.event-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  padding: 18px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.featured-event-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(360px, 1fr);
  gap: 22px;
  min-height: 0;
  background:
    linear-gradient(135deg, rgba(9, 37, 29, 0.95), rgba(20, 20, 24, 0.88)),
    rgba(255, 255, 255, 0.03);
}

.featured-event-card .event-card-head,
.featured-event-card .event-main-info {
  grid-column: 2;
}

.featured-event-card .event-description,
.featured-event-card .program-pills,
.featured-event-card .status-grid,
.featured-event-card .ticket-number,
.featured-event-card .quick-actions {
  grid-column: 1 / -1;
}

.event-cover {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  max-width: 220px;
  min-height: 0;
  aspect-ratio: 707 / 1000;
  border-radius: 18px;
  background-color: #081f18;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 24px 70px rgba(0, 0, 0, 0.36);
  padding: 0;
}

.featured-event-card h3 {
  font-size: clamp(34px, 4vw, 62px);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.05em;
}

.event-main-info {
  align-self: start;
  display: grid;
  gap: 16px;
}

.featured-event-card .event-meta {
  max-width: 700px;
  font-size: 16px;
  line-height: 1.45;
}

.event-highlight {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  border: 1px solid rgba(200, 165, 99, 0.28);
  border-radius: 16px;
  background: rgba(200, 165, 99, 0.08);
  padding: 14px;
}

.event-highlight strong {
  color: #f5d38b;
}

.event-highlight span,
.event-description p {
  color: #cbd5d1;
}

.event-description {
  display: grid;
  gap: 10px;
}

.event-description p {
  margin-bottom: 0;
  line-height: 1.55;
}

.invite-gift-action {
  width: 100%;
  margin-top: 14px;
  border: 1px solid rgba(245, 211, 139, 0.5);
  background: linear-gradient(135deg, #f5d38b, #22c55e);
  color: #07110b;
  box-shadow: 0 18px 48px rgba(245, 211, 139, 0.22);
  font-size: 16px;
  font-weight: 900;
}

.program-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.program-pills span {
  border: 1px solid rgba(200, 165, 99, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #f5d38b;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 900;
}

.event-card-register-action {
  margin-left: auto;
  min-width: 190px;
  justify-content: center;
  font-size: 16px;
}

.event-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--org-primary) 56%, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.055);
}

.event-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.featured-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.featured-kicker time {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.event-card time {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 18px 0;
}

.status-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  padding: 10px;
}

.status-grid span:first-child {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  font-size: 11px;
  font-weight: 900;
}

.status-badge[data-tone="good"] {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.status-badge[data-tone="warn"] {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.status-badge[data-tone="bad"] {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.status-badge[data-tone="accent"],
.status-badge[data-tone="speaker"] {
  background: rgba(200, 165, 99, 0.16);
  color: #f5d38b;
}

.status-badge[data-tone="partner"] {
  background: rgba(6, 182, 212, 0.14);
  color: #67e8f9;
}

.ticket-number {
  margin-top: auto;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 700;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.event-open-action {
  background: #f5d38b;
  color: #0b0f0c;
}

.light-action {
  background: #fff;
  color: #111;
}

.ghost-action {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

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

.form-panel {
  display: grid;
  gap: 14px;
  max-width: 740px;
  padding: 22px;
}

.legal-notice {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(200, 165, 99, 0.28);
  border-radius: 14px;
  background: rgba(200, 165, 99, 0.08);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.legal-notice strong {
  color: var(--text);
  font-weight: 600;
}

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

.compact-form {
  max-width: none;
  margin-top: 16px;
}

.payment-card,
.ticket-detail-card,
.badge-detail-card {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(200, 165, 99, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  padding: 20px;
}

.payment-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.payment-amount {
  display: grid;
  gap: 6px;
  min-width: 190px;
  border-radius: 18px;
  background: rgba(200, 165, 99, 0.1);
  padding: 16px;
  text-align: right;
}

.payment-amount strong,
.ticket-number-large {
  color: #f5d38b;
  font-size: 28px;
}

.ticket-visual-layout,
.badge-detail-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: center;
}

.participant-badge-card {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(260px, 380px);
  gap: 24px;
  align-items: start;
  border: 1px solid rgba(200, 165, 99, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  padding: 20px;
}

.participant-badge-frame {
  display: grid;
  justify-items: center;
}

.participant-badge-png {
  display: block;
  width: min(100%, 320px);
  height: auto;
  border-radius: 14px;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36);
}

.muted-copy {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.55;
}

.qr-ticket-box {
  display: grid;
  justify-items: center;
  gap: 10px;
  border: 1px solid rgba(200, 165, 99, 0.22);
  border-radius: 18px;
  background: #f7f1e4;
  padding: 18px;
  color: #172019;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.visual-qr {
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  width: 198px;
  height: 198px;
  border: 10px solid #fff;
  background: #fff;
}

.visual-qr span {
  background: #fff;
}

.visual-qr span.is-dark {
  background: #0a0f0c;
}

.real-qr {
  display: block;
  width: 198px;
  height: 198px;
  border: 10px solid #fff;
  border-radius: 10px;
  background: #fff;
}

.qr-box .real-qr {
  width: 132px;
  height: 132px;
  border-width: 8px;
}

.badge-preview {
  min-height: 300px;
  display: grid;
  align-content: center;
  gap: 12px;
  border: 1px solid rgba(200, 165, 99, 0.35);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(9, 37, 29, 0.96), rgba(20, 20, 24, 0.98)),
    radial-gradient(circle at 90% 10%, rgba(200, 165, 99, 0.26), transparent 18rem);
  padding: 30px;
}

.badge-preview h3 {
  margin: 0;
  color: #fff;
  font-size: 34px;
}

.badge-preview p {
  margin: 0;
  color: var(--muted);
}

.badge-preview strong {
  width: fit-content;
  border-radius: 999px;
  background: rgba(200, 165, 99, 0.18);
  color: #f5d38b;
  padding: 8px 12px;
}

.badge-event {
  margin-top: 10px;
  color: var(--text);
  font-weight: 800;
}

.badge-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.badge-template-preview {
  aspect-ratio: 100 / 145;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  overflow: hidden;
  border: 1px solid rgba(200, 165, 99, 0.35);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(9, 37, 29, 0.92), rgba(20, 20, 24, 0.96)),
    radial-gradient(circle at 80% 0%, rgba(200, 165, 99, 0.3), transparent 12rem);
  background-position: center;
  background-size: cover;
  padding: 18px;
  text-align: center;
}

.badge-editor-controls {
  display: grid;
  gap: 14px;
}

.badge-control-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.badge-control-group h4 {
  grid-column: 1 / -1;
  margin: 0;
  color: #f5d38b;
}

.badge-control-group input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
}

.range-stepper {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
}

.number-stepper {
  display: grid;
  grid-template-columns: 30px minmax(58px, 82px) 30px;
  align-items: center;
  gap: 8px;
}

.range-stepper input[type="range"] {
  width: 100%;
}

.number-stepper input[type="number"] {
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border-color: rgba(200, 165, 99, 0.28);
  text-align: center;
  font-weight: 800;
}

.range-step {
  min-width: 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(200, 165, 99, 0.34);
  border-radius: 999px;
  background: rgba(200, 165, 99, 0.1);
  color: #f5d38b;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.range-step:hover:not(:disabled) {
  background: rgba(200, 165, 99, 0.2);
}

.badge-control-group input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.badge-editor-preview {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.badge-editor-preview > div:first-child {
  display: block;
  background: transparent;
  padding: 0;
}

.badge-name-layer,
.badge-company-layer,
.badge-role-layer,
.badge-qr-layer {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
  text-align: center;
  line-height: 1.04;
  text-shadow: none;
}

.badge-name-layer,
.badge-company-layer {
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 2px;
}

.badge-name-layer {
  font-weight: 900;
}

.badge-company-layer,
.badge-role-layer {
  display: block;
  font-style: normal;
  font-weight: 800;
}

.badge-qr-layer {
  width: auto;
  background: #fff;
  padding: 3%;
  border-radius: 6px;
}

.badge-canvas-preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.badge-qr-layer .real-qr {
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
}

.badge-template-preview > div:first-child {
  display: grid;
  gap: 5px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.42);
  padding: 14px;
}

.badge-template-preview strong {
  color: #fff;
  font-size: 18px;
}

.badge-template-preview span,
.badge-template-preview em {
  color: #f5d38b;
  font-size: 12px;
  font-style: normal;
}

.mini-qr .real-qr {
  width: 70px;
  height: 70px;
  border-width: 5px;
  border-radius: 6px;
}

.share-banner-card {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  overflow: hidden;
}

.invite-builder-preview {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(200, 165, 99, 0.32);
  border-radius: 22px;
  background: #061411;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.invite-photo-layer {
  position: absolute;
  z-index: 1;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.16);
  background-repeat: no-repeat;
}

.invite-photo-placeholder {
  border: 2px dashed rgba(245, 211, 139, 0.5);
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.16) 0 25%, rgba(255, 255, 255, 0.28) 0 50%) 50% / 22px 22px;
}

.invite-template-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.invite-fixed-qr {
  position: absolute;
  z-index: 3;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #fff;
  padding: 0.8%;
}

.invite-fixed-qr .real-qr {
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
}

.invite-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.invite-template-editor {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(300px, 420px);
  gap: 18px;
  align-items: start;
  overflow: hidden;
}

.invite-template-editor .invite-builder-preview {
  max-width: 420px;
  width: 100%;
}

.invite-admin-controls {
  display: grid;
  gap: 14px;
}

.invite-template-editor .badge-control-group {
  grid-template-columns: 1fr;
}

.invite-controls input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
}

.share-banner-preview {
  aspect-ratio: 4 / 5;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  overflow: hidden;
  border: 1px solid rgba(200, 165, 99, 0.32);
  border-radius: 22px;
  background:
    linear-gradient(150deg, rgba(9, 37, 29, 0.96), rgba(20, 20, 24, 0.96)),
    radial-gradient(circle at 80% 0%, rgba(200, 165, 99, 0.28), transparent 18rem);
  padding: 32px;
  text-align: center;
}

.share-banner-preview p,
.share-banner-preview span {
  margin: 0;
  color: #f5d38b;
  font-weight: 750;
}

.share-banner-preview h3 {
  margin: 0;
  color: #fff;
  font-size: 42px;
  line-height: 1;
}

.share-banner-preview strong {
  color: var(--text);
  font-size: 18px;
}

.share-banner-qr .real-qr {
  width: 118px;
  height: 118px;
  border-width: 7px;
}

.share-banner-settings {
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
}

.share-banner-settings input[readonly] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-accounts,
.profile-roles-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.032);
  padding: 20px;
}

.role-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.role-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(200, 165, 99, 0.2);
  border-radius: 14px;
  background: rgba(200, 165, 99, 0.08);
  padding: 14px;
}

.role-card strong {
  color: var(--text);
}

.role-card span {
  color: var(--muted);
  font-size: 13px;
}

.account-list {
  display: grid;
  gap: 12px;
}

.account-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(200, 165, 99, 0.2);
  border-radius: 18px;
  background: rgba(9, 37, 29, 0.28);
  padding: 16px;
}

.account-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.account-card h4 {
  margin: 4px 0;
  color: var(--text);
  font-size: 20px;
}

.account-card header span:not(.status-badge) {
  color: var(--muted);
  font-size: 13px;
}

.account-events {
  display: grid;
  gap: 8px;
}

.account-events section {
  display: grid;
  gap: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.account-events strong {
  color: var(--text);
}

.account-events span {
  color: var(--muted);
  font-size: 13px;
}

.payment-amount span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.qr-payload {
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  padding: 14px;
  white-space: pre-wrap;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.required-field {
  position: relative;
}

.required-field::before {
  content: "*";
  position: absolute;
  left: -12px;
  top: 0;
  color: #ef4444;
  font-size: 16px;
  line-height: 1;
}

.consent-link {
  display: inline-block;
  margin: -4px 0 8px;
  color: #88a9ff;
  font-size: 13px;
  text-decoration: none;
}

.radio-group {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.radio-line {
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
}

.checkbox-line {
  grid-template-columns: auto 1fr;
  align-items: center;
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
}

.checkbox-line input {
  width: auto;
}

.dashboard {
  padding: 20px;
  overflow: hidden;
}

.organizer-sections {
  display: grid;
  gap: 16px;
}

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

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

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

.soft-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  padding: 16px;
}

.soft-panel h3 {
  margin-bottom: 14px;
}

.legal-settings-panel {
  display: grid;
  gap: 18px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

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

.settings-form .wide-field,
.settings-form button,
.settings-form .inline-result {
  grid-column: 1 / -1;
}

.settings-form textarea {
  min-height: 120px;
}

.compact-settings-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
}

.compact-settings-form button {
  grid-column: auto;
}

.domain-settings {
  display: grid;
  gap: 12px;
}

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

.domain-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, auto) minmax(180px, auto);
  gap: 12px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 0 4px;
}

.domain-row span {
  color: var(--muted);
}

.domain-row code {
  color: var(--accent);
  white-space: nowrap;
}

.inline-result {
  min-height: 18px;
  color: var(--accent);
  font-size: 13px;
}

.compact-empty {
  padding: 16px;
}

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

.profile-grid > div {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  padding: 16px;
}

.profile-photo-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.profile-photo-preview {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(200, 165, 99, 0.32);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(200, 165, 99, 0.12), rgba(9, 37, 29, 0.54)),
    rgba(255, 255, 255, 0.04);
  background-position: center;
  background-size: cover;
  color: #f5d38b;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.profile-edit-form {
  display: grid;
  gap: 12px;
}

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

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

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

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 0 4px;
}

.payment-row {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, auto) minmax(220px, auto);
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.row-actions button {
  padding: 8px 11px;
  font-size: 12px;
}

.table-row span {
  color: var(--muted);
}

.scanner-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 14px;
  padding: 18px;
}

textarea {
  min-height: 300px;
  resize: vertical;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.result {
  margin-top: 14px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  padding: 14px;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
}

.event-workspace {
  display: grid;
  gap: 18px;
}

.event-workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid rgba(200, 165, 99, 0.22);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(9, 37, 29, 0.84), rgba(20, 20, 24, 0.96));
  padding: 22px;
}

.event-workspace-head h2 {
  margin: 4px 0 8px;
  color: #fff;
  font-size: 34px;
}

.event-workspace-head p {
  margin: 0;
  color: var(--muted);
}

.event-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.event-tabs button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  padding: 10px 12px;
}

.event-tabs button.active {
  border-color: rgba(200, 165, 99, 0.56);
  background: rgba(200, 165, 99, 0.16);
  color: #fff;
}

.event-tabs .chat-tab {
  border-color: rgba(245, 211, 139, 0.6);
  background: linear-gradient(135deg, #f5d38b, #16a34a);
  color: #0b0f0c;
  box-shadow: 0 0 24px rgba(245, 211, 139, 0.24);
}

.event-tabs .chat-tab.active {
  background: linear-gradient(135deg, #fff4c7, #22c55e);
  color: #07110b;
}

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

.event-directory {
  display: grid;
  gap: 8px;
}

.event-directory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.event-directory-row span {
  color: var(--muted);
}

.event-program {
  display: grid;
  gap: 10px;
}

.event-program div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.event-program time {
  color: #f5d38b;
  font-weight: 800;
}

.event-chat-panel {
  display: grid;
  gap: 16px;
  overflow: hidden;
  border: 1px solid rgba(245, 211, 139, 0.55);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(245, 211, 139, 0.18), rgba(34, 197, 94, 0.14)), rgba(255, 255, 255, 0.04);
  box-shadow: 0 24px 80px rgba(245, 211, 139, 0.13);
  padding: 24px;
}

.event-chat-panel h3 {
  margin: 0;
  color: #fff;
  font-size: 32px;
}

.event-chat-panel p {
  color: var(--text);
}

.chat-preview {
  display: grid;
  gap: 10px;
}

.chat-preview p,
.chat-input-preview {
  margin: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.26);
  padding: 12px 14px;
}

.chat-input-preview {
  border: 1px dashed rgba(245, 211, 139, 0.48);
  color: #f5d38b;
  text-align: center;
  font-weight: 800;
}

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

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

  nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-button {
    justify-content: center;
    font-size: 12px;
  }

  .profile-qr-card {
    display: none;
  }

  .ticket-visual-layout,
  .badge-detail-card,
  .participant-badge-card,
  .badge-admin-grid,
  .invite-template-editor,
  .share-banner-card,
  .event-scope-grid {
    grid-template-columns: 1fr;
  }

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

  .qr-ticket-box {
    width: min(100%, 260px);
  }

  .main {
    padding: 0 16px 28px;
  }

  .topbar,
  .hero-panel,
  .section-head {
    display: grid;
  }

  .summary-metrics {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  nav,
  .quick-actions,
  .metric-row,
  .scanner-grid,
  .summary-metrics {
    grid-template-columns: 1fr;
  }

  .topbar-controls {
    display: grid;
    width: 100%;
  }

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

  .profile-grid,
  .payment-row,
  .payment-card {
    grid-template-columns: 1fr;
  }

  .badge-control-group {
    grid-template-columns: 1fr;
  }

  .payment-amount {
    text-align: left;
  }

  .featured-event-card {
    grid-template-columns: 1fr;
  }

  .featured-event-card .event-card-head,
  .featured-event-card .event-main-info,
  .featured-event-card .event-description,
  .featured-event-card .program-pills,
  .featured-event-card .status-grid,
  .featured-event-card .ticket-number,
  .featured-event-card .quick-actions,
  .event-cover {
    grid-column: 1;
  }

  .event-cover {
    grid-row: auto;
  }
}

.image-modal,
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.82);
  padding: 28px;
}

.image-modal.active,
.auth-modal.active {
  display: grid;
}

.image-modal img {
  max-width: min(92vw, 980px);
  max-height: 92vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.7);
}

.modal-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.9);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  padding: 0;
}

.auth-card {
  position: relative;
  width: min(92vw, 520px);
  display: grid;
  gap: 14px;
  border: 1px solid rgba(200, 165, 99, 0.28);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(20, 20, 24, 0.98), rgba(9, 37, 29, 0.96)),
    radial-gradient(circle at 100% 0%, rgba(200, 165, 99, 0.18), transparent 15rem);
  padding: 28px;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.72);
}

.auth-card .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.auth-card h2,
.auth-card p {
  margin: 0;
}

.compact-result {
  min-height: 0;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
}
