:root {
  --bg-1: #f4f7fb;
  --bg-2: #e8eff8;
  --ink-900: #132033;
  --ink-700: #334155;
  --ink-500: #64748b;
  --line: #d9e3ef;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-tint: #edf6ff;
  --brand: #0b7285;
  --brand-strong: #0a5a69;
  --brand-soft: #dbf4f8;
  --success: #0f766e;
  --danger: #b42318;
  --radius-xl: 22px;
  --radius-lg: 14px;
  --radius-md: 11px;
  --shadow-card: 0 20px 45px rgba(10, 31, 56, 0.12);
  --shadow-soft: 0 8px 25px rgba(10, 31, 56, 0.1);
}


* {
  box-sizing: border-box;
}

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


body {
  font-family: 'Manrope', sans-serif;
  color: var(--ink-900);
  line-height: 1.48;
  background:
    radial-gradient(1100px 700px at -10% -15%, #d8ecff 0%, transparent 56%),
    radial-gradient(900px 540px at 112% -18%, #d9f0ea 0%, transparent 58%),
    linear-gradient(165deg, var(--bg-1), var(--bg-2));
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  color: #0f172a;
}


h1,
h2,
h3 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.018em;
}

h1 {
  font-size: clamp(1.85rem, 2.8vw, 2.35rem);
}

h2 {
  font-size: clamp(1.35rem, 2.1vw, 1.75rem);
}

h3 {
  font-size: clamp(1.12rem, 1.7vw, 1.32rem);
  margin-bottom: 12px;
}

p {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px 24px calc(24px + env(safe-area-inset-bottom));
  position: relative;
  overflow: hidden;
}

.ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent 95%, rgba(19, 32, 51, 0.045) 95%),
    linear-gradient(90deg, transparent 95%, rgba(19, 32, 51, 0.045) 95%);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.9) 26%, transparent 88%);
}

#view-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
}

.hidden {
  display: none !important;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  animation: rise-in 320ms ease-out;
}


.auth-card,
.home-card {
  padding: 24px;
}

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

.auth-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface-tint);
  border: 1px solid #cde2fb;
  color: #145087;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


.auth-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.title {
  margin-top: 2px;
}

.subtitle {
  margin-top: 8px;
  color: var(--ink-700);
  max-width: 48ch;
}

.auth-legal-links {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 0.84rem;
  line-height: 1.45;
}

.auth-switch {
  color: var(--ink-600);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}

.auth-switch a:hover,
.auth-switch a:focus-visible {
  text-decoration: underline;
}

.auth-legal-links a {
  color: var(--brand-strong);
  font-weight: 600;
  text-decoration: none;
}

.auth-legal-links a:hover,
.auth-legal-links a:focus-visible {
  text-decoration: underline;
}



.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

.form-label {
  color: var(--ink-700);
}

.form-control,
textarea,
input:not([type='checkbox']):not([type='radio']) {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--line) !important;
  background: #fff !important;
  color: var(--ink-900) !important;
  min-height: 44px;
}

.form-control:focus,
textarea:focus,
input:not([type='checkbox']):not([type='radio']):focus,
button:focus-visible {
  border-color: #66a3de !important;
  box-shadow: 0 0 0 0.2rem rgba(28, 113, 216, 0.15) !important;
  outline: 0;
}

textarea {
  min-height: 98px;
  resize: vertical;
}

.remember-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink-700);
  font-weight: 500;
}

.remember-row .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.remember-row span {
  cursor: pointer;
}

.btn {
  border-radius: var(--radius-md);
  min-height: 44px;
  font-weight: 700;
  transition: all 180ms ease;
}

.btn-success {
  background: linear-gradient(180deg, #1495ad, var(--brand));
  border-color: var(--brand);
}

.btn-success:hover,
.btn-success:focus-visible {
  background: linear-gradient(180deg, #10849a, var(--brand-strong));
  border-color: var(--brand-strong);
}

.btn-danger {
  background-color: var(--danger);
  border-color: var(--danger);
}

.btn-outline-secondary {
  color: #23435f;
  border-color: #b8cadf;
  background: #fff;
}


.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  color: #0f172a;
  border-color: #8ea7c4;
  background: #f5f9fe;
}

button.ghost {
  color: #204567 !important;
  border-color: #b7cbe0 !important;
  background: #ffffff !important;
}



button.ghost:hover,
button.ghost:focus-visible {
  background: #eef5fd !important;
  border-color: #8ea7c4 !important;
}

.topbar {
  margin-bottom: 12px;
}

.topbar-row {
  border-radius: var(--radius-lg);
  padding: 4px;
}

.topbar-title-wrap {
  min-width: 200px;
}

.topbar-title-wrap p {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 0.87rem;
}


.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.route-panel[data-route='event_scanner'] .actions-row {
  margin-top: 12px;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.drawer-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: min(360px, 90vw);
  background: linear-gradient(175deg, #ffffff, #f7fbff);
  border-right: 1px solid #d4e1ef;
  box-shadow: 0 25px 45px rgba(10, 31, 56, 0.25);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


.drawer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  background: rgba(10, 31, 56, 0.42);
}


.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  color: #fff;
  font-weight: 800;
}

.drawer-head h3 {
  margin: 8px 0 4px;
}

.drawer-head p {
  color: var(--ink-500);
}

.drawer-label {
  margin-top: 6px;
  color: var(--ink-500);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  font-weight: 700;
}

.drawer-org-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.org-switch-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line) !important;
  background: #f8fbff !important;
  color: #10253f !important;
  border-radius: var(--radius-md);
  min-height: 44px;
}

.org-switch-btn.active {
  background: var(--brand-soft) !important;
  border-color: #84cad3 !important;
  color: #10434f !important;
}



.drawer-footer {
  margin-top: auto;
}

.route-panel {
  position: relative;
}

.events-overview {
  margin-top: 10px;
}

.overview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #f7fbff, #eef6ff);
  padding: 14px;
  display: grid;
  gap: 6px;
}

.overview-card.compact {
  background: linear-gradient(160deg, #eef9fc, #e2f4f8);
}

.overview-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
  color: #2b5c87;
}

.overview-card strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
}

.overview-card span {
  color: var(--ink-700);
  font-size: 0.9rem;
}




.ticket-card,
.list-block,
.stat-card,
.event-list li,
.org-list li,
.scanner-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}


.ticket-card {
  padding: 14px;
  border-style: dashed;
  margin: 10px 0;
}

.active-org-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  margin-bottom: 10px;
  border-radius: 999px;
  border: 1px solid #9ed6dc;
  background: var(--brand-soft);
  color: #0f5965;
  font-size: 0.82rem;
  font-weight: 800;
}


.my-ticket-qr {
  min-height: 220px;
  margin: 12px 0;
  display: grid;
  place-items: center;
}

.my-ticket-qr img,
.my-ticket-qr canvas {
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid #d8e5f2;
  padding: 10px;
}


.events-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stats-grid {
  margin-top: 8px;
}

.stat-card {
  padding: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.stat-card p {
  color: var(--ink-500);
  font-size: 0.87rem;
  margin-bottom: 4px;
}

.stat-card strong {
  font-size: 1.42rem;
}

.events-tabs {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.events-tab {
  border-color: #bfd0e4 !important;
  background: #f5f9fe !important;
  color: #193653 !important;
}


.events-tab.active {
  border-color: #0f7f93 !important;
  background: linear-gradient(180deg, #1495ad, #0f7f93) !important;
  color: #fff !important;
}


.events-panel {
  margin-top: 12px;
}

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.event-list li {
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.event-list p {
  margin-top: 4px;
  color: var(--ink-500);
}

.event-status {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #0f5965;
  font-weight: 800;
}


.events-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.events-actions button,
.actions-row button,
.bottom-nav .nav-btn,
.drawer-panel button {
  min-height: 44px;
}

.action-stack {
  margin-top: 8px;
}

.fullscreen-panel {
  min-height: 58vh;
}

.fullscreen-panel .stack.row {
  margin-left: 0;
  margin-right: 0;
}

.fullscreen-panel .stack.row > [class*='col-'] {
  padding-left: 0;
  padding-right: 0;
}

.scanner-box {
  background: #0f2238;
  padding: 8px;
  margin-bottom: 10px;
}

.scanner-diagnostics p {
  margin: 4px 0;
  font-size: 0.92rem;
}

.list-block {
  padding: 12px;
  margin: 10px 0;
}

.bottom-nav {
  margin-top: 12px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  position: sticky;
  bottom: 8px;
  z-index: 15;
}

.nav-btn {
  border-color: #bfd0e4 !important;
  background: #f6faff !important;
  color: #193653 !important;
}


.nav-btn.active {
  border-color: #0f7f93 !important;
  background: linear-gradient(180deg, #1495ad, #0f7f93) !important;
  color: #ffffff !important;
}


.events-create-btn {
  position: static;
  display: block;
  width: fit-content;
  margin: 14px auto 0;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.message {
  min-height: 1.2rem;
  margin-top: 12px;
  color: var(--success);
  font-size: 0.94rem;
}

.message.error {
  color: var(--danger);
}

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



.view-loading {
  min-height: 560px;
}

.skeleton-home {
  display: grid;
  gap: 12px;
}

.skeleton-block {
  position: relative;
  overflow: hidden;
}

.skeleton-top {
  height: 92px;
}

.skeleton-main {
  min-height: 430px;
  display: grid;
  gap: 14px;
}

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

.skeleton-grid span,
.skeleton-list span,
.skeleton-item span {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, #e8f0f9 25%, #f5f9ff 50%, #e8f0f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}

.skeleton-grid span {
  height: 76px;
}

.skeleton-list {
  display: grid;
  gap: 10px;
}

.skeleton-list span {
  height: 64px;
}

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

.skeleton-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.skeleton-item span:first-child {
  height: 14px;
  width: 52%;
}

.skeleton-item span:last-child {
  height: 11px;
  width: 82%;
}


@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes rise-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 860px) {
  .auth-card,
  .home-card {
    border-radius: 16px;
    padding: 20px;
  }

  .topbar-title-wrap {
    min-width: 0;
  }

  .events-actions button {
    flex: 1 1 125px;
  }

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

@media (max-width: 680px) {
  .app-shell {
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
  }

  .title {
    font-size: 1.55rem;
  }

  h3 {
    font-size: 1.08rem;
  }

  .auth-card,
  .home-card {
    padding: 16px;
    border-radius: 14px;
  }

  .topbar-row {
    align-items: stretch;
  }

  .topbar-title-wrap {
    width: 100%;
    order: 3;
  }

  .actions-row {
    width: 100%;
  }

  .actions-row button {
    flex: 1 1 48%;
  }

  .event-list li,
  .org-list li {
    flex-direction: column;
  }

  .events-actions {
    width: 100%;
  }

  .events-actions button {
    flex: 1 1 140px;
  }

  .bottom-nav {
    grid-template-columns: 1fr;
    bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .auth-head {
    flex-wrap: wrap;
  }

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