/* ==========================================================================
   PASSA app — marketplace, dashboards, auth and admin
   Layered on top of style.css + pages.css (same design system).
   ========================================================================== */

main {
  display: block;
}

.app-container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.hero--app {
  padding-bottom: clamp(34px, 6vh, 60px);
}

.hero--app .cta {
  margin-top: 24px;
}

.hero-note {
  margin: 18px 0 0;
  font-size: 0.82rem;
  color: var(--faint);
}

/* ---- Flash messages ----------------------------------------------------- */

.flash-wrap {
  margin-top: 12px;
}
.flash {
  padding: 12px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-size: 0.86rem;
  margin-bottom: 8px;
}
.flash--success {
  border-color: rgba(192, 224, 72, 0.4);
  background: rgba(192, 224, 72, 0.08);
}
.flash--error {
  border-color: rgba(255, 120, 120, 0.4);
  background: rgba(255, 80, 80, 0.08);
}
.flash--warning {
  border-color: rgba(255, 190, 80, 0.4);
  background: rgba(255, 170, 40, 0.08);
}

/* ---- Header account/menu ------------------------------------------------ */

.account--user {
  cursor: pointer;
  list-style: none;
}
.account--user::-webkit-details-marker {
  display: none;
}
.user-dropdown {
  position: relative;
}
.user-dropdown__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 80;
  width: 230px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #0b1d3a, #071426);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}
.user-dropdown__name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
}
.user-dropdown__panel nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
}
.user-dropdown__panel nav a {
  padding: 8px 8px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
}
.user-dropdown__panel nav a:hover {
  background: rgba(192, 224, 72, 0.08);
  color: var(--lime);
}
.user-dropdown__logout {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px !important;
  color: #ff9b9b !important;
}

.mobile-menu {
  display: none;
  position: relative;
}
.mobile-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 80;
  width: min(280px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #0b1d3a, #071426);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-menu__panel a {
  padding: 10px 8px;
  border-radius: 6px;
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mobile-menu__panel a:hover {
  background: rgba(192, 224, 72, 0.08);
  color: var(--lime);
}

/* ---- Dashboard shell ---------------------------------------------------- */

.dashboard-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
  padding-block: clamp(22px, 3.5vw, 38px) 60px;
}
.sidebar {
  position: sticky;
  top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(7, 20, 38, 0.78);
}
.sidebar h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--faint);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-nav a {
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
}
.sidebar-nav a:hover,
.sidebar-nav a.is-active {
  background: rgba(192, 224, 72, 0.09);
  color: var(--lime);
}
.sidebar__foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--faint);
}

.dashboard-content {
  min-width: 0;
}
.dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.dashboard-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  line-height: 1.04;
  text-transform: uppercase;
}
.dashboard-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---- Stats -------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(11, 29, 58, 0.86), rgba(7, 20, 38, 0.86));
}
.stat-card__label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.stat-card__value {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 800;
  color: var(--white);
}
.stat-card__value--lime {
  color: var(--lime);
}
.stat-card__hint {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--faint);
}

/* ---- Tables ------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 20, 38, 0.7);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 640px;
}
.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.data-table th {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.data-table td a {
  color: var(--lime);
  text-decoration: none;
}
.data-table td a:hover {
  text-decoration: underline;
}
.data-table .num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.table-actions form {
  display: inline;
}
.table-actions .btn,
.table-actions button {
  min-width: 0;
  padding: 7px 10px;
  font-size: 0.62rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-badge.ok {
  background: rgba(192, 224, 72, 0.14);
  color: var(--lime);
}
.status-badge.warn {
  background: rgba(255, 190, 80, 0.14);
  color: #ffce6b;
}
.status-badge.bad {
  background: rgba(255, 100, 100, 0.14);
  color: #ff9b9b;
}
.status-badge.neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

/* ---- Filters / admin toolbars ------------------------------------------ */

.filter-form {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 20, 38, 0.65);
}
.filter-form .btn {
  min-height: 44px;
}
.filter-form--admin {
  grid-template-columns: 1.4fr repeat(2, minmax(0, 1fr));
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---- Event covers ------------------------------------------------------- */

.cover-1 { --g1: #c0e048; --g2: #0f5132; }
.cover-2 { --g1: #ff8a3d; --g2: #5a1d6e; }
.cover-3 { --g1: #7fb3ff; --g2: #1d2b5e; }
.cover-4 { --g1: #ff4d5e; --g2: #4a1017; }
.cover-5 { --g1: #9d6bff; --g2: #2a0f55; }
.cover-6 { --g1: #ff5fd2; --g2: #4a1152; }
.cover-7 { --g1: #ffcc33; --g2: #6b2b00; }
.cover-8 { --g1: #ff9d2e; --g2: #123d2a; }
.cover-9 { --g1: #c0e048; --g2: #0a3d62; }
.cover-10 { --g1: #6fe3ff; --g2: #153a5b; }
.cover-11 { --g1: #66e0a3; --g2: #0b3d2e; }
.cover-12 { --g1: #ff7a90; --g2: #3d1030; }

/* ---- Event detail / listings ------------------------------------------- */

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.listing-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.listing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
}
.listing-row__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.listing-row__main strong {
  font-family: var(--font-display);
  font-size: 0.86rem;
  text-transform: uppercase;
}
.listing-row__main span {
  color: var(--muted);
  font-size: 0.76rem;
}
.listing-row__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.listing-row__price strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--lime);
}
.seller-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--faint);
}

/* ---- Ticket stub -------------------------------------------------------- */

.ticket-stub {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(192, 224, 72, 0.32);
  border-radius: 14px;
  background:
    radial-gradient(130% 130% at 100% 0%, rgba(192, 224, 72, 0.16), transparent 52%),
    linear-gradient(135deg, #0b1d3a, #06101f);
}
.ticket-stub::before,
.ticket-stub::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy);
  border: 1px solid rgba(192, 224, 72, 0.32);
  transform: translateY(-50%);
}
.ticket-stub::before { left: -12px; }
.ticket-stub::after { right: -12px; }
.ticket-stub__event {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
}
.ticket-stub__meta {
  color: var(--muted);
  font-size: 0.8rem;
}
.ticket-stub__code {
  margin: 18px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--lime);
  word-break: break-all;
}
.ticket-stub__note {
  margin: 10px 0 0;
  font-size: 0.72rem;
  color: var(--faint);
}
.ticket-stub__type {
  position: absolute;
  top: 16px;
  right: 16px;
}

/* ---- Order timeline ----------------------------------------------------- */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}
.timeline-step {
  position: relative;
  padding: 0 0 18px 28px;
  color: var(--faint);
  font-size: 0.82rem;
}
.timeline-step::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--line);
}
.timeline-step::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.timeline-step:last-child::after { display: none; }
.timeline-step strong {
  display: block;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
}
.timeline-step.done::before { background: var(--lime); border-color: var(--lime); }
.timeline-step.done strong { color: var(--white); }
.timeline-step.current::before { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 12px rgba(192, 224, 72, 0.6); }
.timeline-step.current strong { color: var(--lime); }

/* ---- Order summary / cards --------------------------------------------- */

.summary-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 20, 38, 0.8);
}
.summary-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.84rem;
  color: var(--muted);
}
.summary-row:last-child { border-bottom: 0; }
.summary-row.total {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
}
.summary-row.total span:last-child { color: var(--lime); }

.two-col--app {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 20px;
  align-items: start;
}

/* ---- Notifications / KYC ------------------------------------------------ */

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.notification-item {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
}
.notification-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.76rem;
  text-transform: uppercase;
}
.notification-item span {
  color: var(--muted);
  font-size: 0.76rem;
}
.notification-item.is-unread {
  border-color: rgba(192, 224, 72, 0.28);
}

.kyc-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 20, 38, 0.75);
  margin-bottom: 16px;
}
.kyc-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
}
.kyc-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

/* ---- Admin integration note -------------------------------------------- */

.integration-note {
  padding: 14px 16px;
  border: 1px dashed rgba(255, 190, 80, 0.4);
  border-radius: 9px;
  background: rgba(255, 170, 40, 0.06);
  color: rgba(255, 230, 180, 0.85);
  font-size: 0.82rem;
  line-height: 1.55;
  margin-bottom: 18px;
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .mobile-menu { display: block; }
  .dashboard-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; }
  .sidebar-nav a { white-space: nowrap; }
  .two-col--app { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .filter-form,
  .filter-form--admin { grid-template-columns: 1fr; }
  .listing-row { flex-direction: column; align-items: flex-start; }
  .listing-row__price { align-items: flex-start; }
  .user-dropdown__panel { right: -50px; }
}

.text-small { font-size: 0.78rem; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.mt-28 { margin-top: 28px; }
.mb-16 { margin-bottom: 16px; }
.m-0 { margin: 0; }
.section-title-inline {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
}
.dashboard-head--tight { margin-bottom: 10px; }
.ticket-code-inline { font-size: 1rem; margin: 0; }
.demo-accounts { margin: 8px 0 0; }


/* ---- App / PWA tab bar -------------------------------------------------- */

.app-tabbar { display: none; }

@media (max-width: 900px) {
  .app-tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(3, 11, 28, 0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .app-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    color: var(--faint);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .app-tabbar a.is-active { color: var(--lime); }
  .app-tabbar svg { display: block; }
  .site-footer { padding-bottom: 96px; }
  .inner { padding-bottom: 100px; }
  .topbar { padding-top: max(16px, env(safe-area-inset-top)); }
}

@media (max-width: 768px) {
  .field input,
  .field select,
  .field textarea,
  .filters input,
  .filters select,
  .notify-form__row input {
    font-size: 16px;
  }
}

.qr-box {
  width: min(230px, 100%);
  margin: 14px auto;
  padding: 12px;
  background: #ffffff;
  border-radius: 10px;
}
.qr-box svg {
  display: block;
  width: 100%;
  height: auto;
}
.rejection-code {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 120, 120, .5);
  border-radius: 9px;
  background: rgba(255, 80, 80, .08);
  text-align: center;
}
.rejection-code span {
  display: block;
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #ff9b9b;
}
.rejection-code strong {
  display: block;
  margin: 4px 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: .12em;
  color: #ff9b9b;
}
.rejection-code small {
  color: var(--muted);
  font-size: .7rem;
}
.scan-video {
  width: 100%;
  max-height: 260px;
  margin: 10px 0;
  border-radius: 10px;
  background: #02060f;
  object-fit: cover;
}
