/* ===========================
   TICKETHUB — GLOBAL STYLES
   =========================== */

:root {
    --primary: #45abf6;
    --primary-dark: #0571b8;
    --primary-light: #d7edfd;
    --primary-light-gradient: #e8f5fe;
    --accent: #ff9900;
    --success: #6bc601;
    --danger: #ef4444;
    --warning: #ff9900;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --surface: #ffffff;
    --bg: white; /*#fafcfe ;*/
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(69, 171, 246,0.08);
    --shadow-lg: 0 8px 40px rgba(69, 171, 246,0.15);
    --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===========================  NAVBAR  =========================== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1rem;
  height: var(--nav-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 .5rem;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.nav-brand { display: flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.brand-logo { height: 44px; width: auto; display: block; object-fit: contain; }
.nav-links { display: flex; gap: 0.25rem; flex: 1; }
.nav-link { padding: 0.4rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; color: var(--text-muted); transition: all 0.15s; }
.nav-link:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.staff-link {
    color: var(--primary);
}
    .staff-link:hover {
        background: #e0f2fe;
        color: var(--primary);
    }
.admin-link { color: #7c3aed; }
.nav-auth { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; margin-left: auto; }
.user-info { display: flex; align-items: center; gap: 0.5rem; }
.user-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.82rem;
    width: 100%;
    display: block;
}
.badge-master {
    background: var(--primary-light);
    color: red;
}
.badge-admin {
    background: var(--primary-light);
    color: red;
}
.badge-staff {
    background: var(--primary-light);
}
.badge-user { background: var(--primary-light); color: var(--primary); }
.active-org-badge { padding: 0.3rem 0.75rem; border-radius: 20px; font-size: 0.82rem; font-weight: 600; background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.org-switcher { padding: 0.3rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 0.82rem;  background: var(--bg); cursor: pointer; max-width: 220px; }
.org-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-dark);
    /*border: 1px solid var(--primary-dark);*/
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    margin-bottom: 0.6rem;
}
    .org-badge:hover {
        background: var(--primary-light-gradient);
    }
.nav-mobile-toggle { display: block; background: none; border: none; font-size: 1.4rem; cursor: pointer; padding: 0.25rem 0.5rem; color: var(--text-muted); line-height: 1; flex-shrink: 0; }
.nav-mobile-toggle:hover { color: var(--primary); }

.mobile-menu { display: flex; position: fixed; top: var(--nav-h); left: 0; width: 260px; bottom: 0; background: white; z-index: 99; border-right: 1px solid var(--border); flex-direction: column; padding: 0.75rem; gap: 0.25rem; box-shadow: 4px 0 16px rgba(0,0,0,0.08); overflow-y: auto; }
.mobile-menu a, .mobile-menu button { padding: 0.65rem 1rem; border-radius: var(--radius-sm); font-size: 0.95rem; display: block; background: none; border: none; text-align: left; cursor: pointer; color: var(--text); width: 100%; }
.mobile-menu a:hover, .mobile-menu button:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.menu-divider { height: 1px; background: var(--border); margin: 0.5rem 0; }
.menu-section-label { padding: 0.4rem 1rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.menu-user-org { padding: 0.5rem 1rem; font-size: 0.85rem; color: var(--text-muted); }
.menu-user-row { padding: 0.5rem .5rem; }
.menu-org-switcher { width: 100%; margin: 0.25rem 0 0.5rem; }

/* ===========================  BUTTONS  =========================== */
.btn-primary, .btn-outline, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s; border: none; white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
    .btn-primary:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(69, 171, 246,0.3);
        text-decoration: none;
        color: white;
    }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--border); color: var(--text); text-decoration: none; }
.btn-full { width: 100%; }
.btn-sm-primary { padding: 0.3rem 0.7rem; font-size: 0.8rem; border-radius: 6px; background: var(--primary); color: white; border: none; cursor: pointer; font-weight: 600; }
.btn-sm-primary:hover { background: var(--primary-dark); }
.btn-sm-outline { padding: 0.3rem 0.7rem; font-size: 0.8rem; border-radius: 6px; background: transparent; color: var(--primary); border: 1px solid var(--primary); cursor: pointer; font-weight: 600; }
.btn-sm-danger { padding: 0.3rem 0.7rem; font-size: 0.8rem; border-radius: 6px; background: transparent; color: var(--danger); border: 1px solid var(--danger); cursor: pointer; font-weight: 600; }
.btn-danger { display: inline-flex; align-items: center; justify-content: center; padding: 0.55rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.18s; border: none; background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-redeem { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* ===========================  LAYOUT  =========================== */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.main-content { flex: 1; }
.page-container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.footer { background: white; border-top: 1px solid var(--border); padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-top: auto; }

/* ===========================  HERO  =========================== */
.hero {
    background: var(--primary);
    color: white;
    padding: 1.5rem 1.5rem;
    text-align: center;
}
.hero-content { max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; margin-bottom: 0.75rem; line-height: 1.15; }
.hero p { font-size: 1.15rem; margin-bottom: 1rem; }
.search-bar { display: flex; gap: 0.75rem; background: white; border-radius: var(--radius); padding: 0.5rem; box-shadow: var(--shadow-lg); }
.search-bar input { flex: 1; border: none; outline: none; font-size: 1rem; padding: 0.4rem 0.75rem; color: var(--text); }
.search-bar select { border: none; outline: none; font-size: 0.9rem; color: var(--text-muted); background: transparent; padding: 0.4rem; cursor: pointer; }

/* ===========================  EVENTS GRID  =========================== */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem;  }

.event-card {
  background: white; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; transition: all 0.22s;
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.event-card:hover { transform: translateY(-4px); }
.event-card.sold-out { opacity: 0.75; }
.event-emoji {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 2rem;
    text-align: center;
}
.event-card-body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.event-category-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary-dark);
    /*border: 1px solid var(--primary-dark);*/
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    margin-bottom: 0.6rem;
}
.event-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text); }
.event-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; flex: 1; }
.event-meta { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.meta-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--text-muted);}
.meta-icon { width: 1rem; }
.event-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.tickets-left { font-size: 0.8rem; color: var(--text); font-weight: 600; }
.price { font-size: 1.15rem; font-weight: 800; color: var(--primary); }
.price-free { font-size: 1.15rem; font-weight: 800; color: var(--success); }
.badge-sold-out { background: #fef2f2; color: var(--danger); padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.badge-inactive { background: #f3f4f6; color: var(--text-muted); padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }

/* ===========================  EVENT DETAIL  =========================== */
.event-detail-hero {
    background: var(--primary);
    color: white;
    padding: 1.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-direction: column;
    text-align: center;
}
.event-detail-emoji { font-size: 5rem; flex-shrink: 0; }
.event-detail-info h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 900; margin-bottom: 0.75rem; }
.event-detail-info .event-meta { gap: 0.5rem; margin: 0; }
.event-detail-info .meta-item { font-size: 0.95rem; color: white; }

.event-detail-layout { display: grid; grid-template-columns: 1fr 400px; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .event-detail-layout { grid-template-columns: 1fr; } }

.event-description-panel h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }
.event-description-panel p { color: var(--text-muted); line-height: 1.8; margin-bottom: 1.5rem; }

.capacity-bar-wrap { margin-top: 1rem; }
.capacity-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.capacity-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.capacity-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.fill-ok { background: var(--success); }
.fill-warning { background: var(--warning); }
.fill-danger { background: var(--danger); }

/* Purchase Box */
.purchase-box {
  background: white; border-radius: var(--radius); padding: 1.75rem;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  position: sticky; top: calc(var(--nav-h) + 1rem);
  display: flex; flex-direction: column; gap: 1rem;
}
.sold-out-box { text-align: center; gap: 0.75rem; }
.price-display { text-align: center; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.price-lg { font-size: 2rem; font-weight: 900; color: var(--primary); }
.price-sub { display: block; font-size: 0.85rem; color: var(--text-muted); }
.order-summary { background: var(--bg); border-radius: var(--radius-sm); padding: 0.75rem 1rem; }
.order-line { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 0.2rem 0; }
.order-line.total { font-weight: 700; padding-top: 0.5rem; border-top: 1px solid var(--border); margin-top: 0.25rem; }
.secure-note { text-align: center; font-size: 0.8rem; color: var(--text-muted); }

/* Purchase Success / Ticket Display */
.purchase-success { display: flex; flex-direction: column; gap: 1rem; }
.success-header { text-align: center; }
.ticket-display {
    background: white;
    border-radius: var(--radius);
    border: 2px solid var(--primary);
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(69, 171, 246,0.2);
}
.ticket-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 1.25rem; gap: 1rem; }
.ticket-event-name { font-size: 1rem; font-weight: 800; color: var(--primary); margin-bottom: 0.25rem; }
.ticket-holder { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.ticket-date, .ticket-venue { font-size: 0.8rem; color: var(--text-muted); }
.qr-wrap { flex-shrink: 0; }
.qr-img { width: 100px; height: 100px; display: block; border-radius: 8px; }
.ticket-bottom { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.25rem; background: linear-gradient(135deg, var(--primary), #a855f7); color: white; }
.conf-label { font-size: 0.75rem; opacity: 0.8; }
.conf-code { font-family: monospace; font-size: 1.1rem; font-weight: 800; letter-spacing: 0.1em; flex: 1; }
.ticket-status { font-size: 0.75rem; font-weight: 700; background: rgba(255,255,255,0.2); padding: 0.2rem 0.5rem; border-radius: 20px; }
.ticket-status.valid { color: white; }

/* ===========================  MY TICKETS  =========================== */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; font-weight: 800; }

.lookup-box { max-width: 500px; margin: 3rem auto; background: white; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); text-align: center; }
.lookup-box h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.lookup-box p { color: var(--text-muted); margin-bottom: 1.5rem; }
.lookup-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.lookup-divider { position: relative; margin: 1rem 0; color: var(--text-muted); font-size: 0.85rem; }
.lookup-divider::before, .lookup-divider::after { content: ''; position: absolute; top: 50%; width: 43%; height: 1px; background: var(--border); }
.lookup-divider::before { left: 0; }
.lookup-divider::after { right: 0; }

.ticket-count { color: var(--text-muted); margin-bottom: 1.5rem; }
.tickets-list { display: flex; flex-direction: column; gap: 1rem; }
.ticket-card {
  background: white; border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); display: flex; gap: 1rem;
  padding: 1.25rem; align-items: flex-start;
}
.ticket-card.status-redeemed { opacity: 0.75; border-left: 4px solid var(--success); }
.ticket-card.status-cancelled { opacity: 0.6; border-left: 4px solid var(--danger); }
.ticket-card.ticket-selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.ticket-card-left { display: flex; gap: 1rem; flex: 1; }
.ticket-select-col { flex-shrink: 0; display: flex; align-items: flex-start; padding-top: 0.1rem; cursor: pointer; }
.ticket-checkbox { width: 44px; height: 44px; border: 2.5px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 900; color: white; background: white; transition: all 0.15s; user-select: none; }
.ticket-checkbox:hover { border-color: var(--primary); background: var(--primary-light); }
.ticket-checkbox.checked { background: var(--primary); border-color: var(--primary); }
.ticket-status-icon-sm { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.redeem-sticky-bar { position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 2px solid var(--primary); padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; z-index: 90; box-shadow: 0 -4px 20px rgba(0,0,0,0.12); }
.redeem-sticky-text { font-weight: 600; color: var(--primary-dark); }
.redeem-sticky-btn { font-size: 1rem; padding: 0.7rem 1.5rem; }
.ticket-card-info { flex: 1; }
.ticket-event-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; color: black; }
.ticket-detail-row { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.15rem; }
.conf-row { margin-top: 0.5rem; display: flex; align-items: center; gap: 0.4rem; }
.conf-label { font-size: 0.75rem; color: var(--text-muted); }
.conf-code-sm { font-family: monospace; font-size: 0.9rem; font-weight: 700; background: var(--primary-light); color: var(--primary); padding: 0.1rem 0.4rem; border-radius: 4px; letter-spacing: 0.05em; }
.redeemed-note { margin-top: 0.4rem; font-size: 0.8rem; color: var(--success); font-weight: 600; }

.ticket-card-right { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.qr-mini-wrap { text-align: center; }
.qr-mini { width: 80px; height: 80px; display: block; }
.qr-hint { font-size: 0.7rem; color: var(--text-muted); }
.qr-blocked { font-size: 2.5rem; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; }
.ticket-status-badge { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 20px; letter-spacing: 0.05em; }
.ticket-price-paid { font-size: 0.85rem; font-weight: 700; color: var(--primary); }

/* Status Classes */
.status-valid {
    color: #065f46;
}
.status-redeemed { background: #dbeafe; color: #1e40af; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-expired { background: #f3f4f6; color: #4b5563; }
.status-pill { padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }

/* ===========================  STAFF PORTAL  =========================== */
.staff-portal { max-width: 1200px; margin: 0 auto; padding: 1.5rem; box-sizing: border-box; overflow-x: hidden; }
.staff-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--border); }
.event-selector-bar { background: var(--primary-light); border: 1px solid var(--primary); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.75rem; display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.event-selector-inner { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.event-selector-label { font-weight: 700; font-size: 0.9rem; color: var(--primary-dark); white-space: nowrap; }
.event-selector-select {
    flex: 1;
    border-color: var(--primary);
    font-size: 0.85rem !important;
}
.selected-event-meta { display: flex; gap: 1.25rem; font-size: 0.85rem; color: var(--primary-dark); flex-wrap: wrap; }
.staff-title { display: flex; align-items: center; gap: 1rem; }
.staff-title h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0; }
.staff-title p { font-size: 0.9rem; color: var(--text-muted); }
.stat-chip { background: var(--primary-light); border-radius: var(--radius); padding: 0.75rem 1.25rem; text-align: center; }
.stat-num { font-size: 1.5rem; font-weight: 800; color: var(--primary); display: block; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }

.redemption-area { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 900px) { .redemption-area { grid-template-columns: 1fr; } }

.scan-panel { background: white; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); text-align: center; border: 1px solid var(--border); }
.scan-panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.scan-panel-title > div { display: flex; align-items: center; gap: 0.75rem; }
.scan-icon { font-size: 2rem; display: inline-block; transition: transform 0.3s; }
.scan-icon.scanning { animation: pulse 0.4s ease-in-out; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.scan-panel h2 { font-size: 1.4rem; font-weight: 800; margin: 0; }
.camera-toggle-btn { font-size: 0.85rem; padding: 0.4rem 0.85rem; }
.camera-viewfinder-wrap { position: relative; width: 100%; border-radius: var(--radius-sm); overflow: hidden; background: #000; margin-bottom: 0.5rem; aspect-ratio: 4/3; }
.qr-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-viewfinder-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.qr-frame { width: 60%; aspect-ratio: 1; border: 3px solid white; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,0.45); transition: border-color 0.2s; }
.qr-frame-active { border-color: var(--success); animation: frame-flash 0.3s ease; }
@keyframes frame-flash { 0% { border-color: white; } 50% { border-color: var(--success); box-shadow: 0 0 0 9999px rgba(0,0,0,0.45), 0 0 0 4px var(--success); } 100% { border-color: var(--success); } }
.scan-divider { color: var(--text-muted); font-size: 0.8rem; margin: 0.75rem 0; position: relative; }
.scan-divider::before, .scan-divider::after { content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--border); }
.scan-divider::before { left: 0; } .scan-divider::after { right: 0; }

.scan-input-group { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.scan-input { flex: 1; min-width: 0; border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 1rem; font-size: 1rem; outline: none; font-family: monospace; text-transform: uppercase; transition: border-color 0.15s; }
.scan-input:focus { border-color: var(--primary); }

.redemption-result { border-radius: var(--radius); padding: 1.5rem; text-align: center; }
.result-success { background: #d1fae5; border: 2px solid var(--success); }
.result-failure { background: #fee2e2; border: 2px solid var(--danger); }
.result-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.result-message { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.result-ticket-info { background: white; border-radius: var(--radius-sm); padding: 1rem; text-align: left; margin-bottom: 1rem; }
.rti-row { display: flex; justify-content: space-between; padding: 0.3rem 0; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.rti-row:last-child { border-bottom: none; }
.rti-row span { color: var(--text-muted); }
.result-clear { margin-top: 0.5rem; }

.recent-panel { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.recent-panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.no-recent { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 2rem 0; }
.recent-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.recent-item:last-child { border-bottom: none; }
.recent-icon { font-size: 1.2rem; flex-shrink: 0; }
.recent-detail { flex: 1; }
.recent-name { font-size: 0.85rem; font-weight: 600; }
.recent-event { font-size: 0.75rem; color: var(--text-muted); }
.recent-time { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }

.tickets-table-section { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.table-header h3 { font-size: 1rem; font-weight: 700; }
.table-filters { display: flex; gap: 0.5rem; }
.form-input-sm { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.4rem 0.75rem; font-size: 0.85rem; outline: none; }
.table-wrap { overflow-x: auto; }
.tickets-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.tickets-table th { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 2px solid var(--border); font-weight: 700; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tickets-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.tickets-table tr:last-child td { border-bottom: none; }
.tickets-table tr:hover td { background: var(--bg); }
.tickets-table code { font-family: monospace; background: var(--primary-light); color: var(--primary); padding: 0.1rem 0.4rem; border-radius: 4px; font-weight: 700; }

/* ===========================  ADMIN  =========================== */
.admin-portal { max-width: 1300px; margin: 0 auto; padding: 1.5rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.75rem; font-weight: 800; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: white; border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); display: flex; align-items: center; gap: 1rem; border-left: 4px solid transparent; }
.stat-card.blue { border-left-color: #3b82f6; }
.stat-card.green { border-left-color: var(--success); }
.stat-card.purple { border-left-color: var(--primary); }
.stat-card.orange { border-left-color: var(--warning); }
.stat-card-icon { font-size: 2rem; }
.stat-card-num { font-size: 1.5rem; font-weight: 800; }
.stat-card-label { font-size: 0.8rem; color: var(--text-muted); }

.admin-section { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.admin-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th { padding: 0.6rem 0.75rem; border-bottom: 2px solid var(--border); text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.admin-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row-cancelled td { opacity: 0.5; text-decoration: line-through; }
.table-sub { font-size: 0.75rem; color: var(--text-muted); }

.ticket-count-cell { display: flex; flex-direction: column; gap: 0.25rem; }
.mini-bar { height: 4px; background: var(--border); border-radius: 2px; width: 80px; overflow: hidden; }
.mini-fill { height: 100%; background: var(--primary); border-radius: 2px; }

.role-badge { padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.role-admin { background: #ede9fe; color: #7c3aed; }
.role-staff { background: #e0f2fe; color: #0369a1; }
.role-customer { background: var(--primary-light); color: var(--primary); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(4px); }
.modal { background: white; border-radius: var(--radius); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.2rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text-muted); padding: 0.25rem; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.span-2 { grid-column: span 2; }

/* ===========================  FORMS  =========================== */
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.form-input { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 0.65rem 0.85rem; font-size: 0.95rem; outline: none; width: 100%; transition: border-color 0.15s; font-family: inherit; background: white; }
    .form-input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(69, 171, 246,0.1);
    }
textarea.form-input { resize: vertical; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); }

/* ===========================  AUTH  =========================== */
.auth-page { min-height: calc(100vh - var(--nav-h)); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { background: white; border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 1rem; }
.auth-logo { font-size: 3rem; text-align: center; }
.auth-card h2 { font-size: 1.5rem; font-weight: 800; text-align: center; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-top: -0.5rem; }
.auth-divider { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin: 0.25rem 0; }
.demo-accounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.demo-btn { padding: 0.5rem; font-size: 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; font-weight: 600; transition: all 0.15s; }
.demo-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.auth-switch { text-align: center; font-size: 0.85rem; color: var(--text-muted); }

/* ===========================  MISC  =========================== */
.alert-error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; }
.empty-state { text-align: center; padding: 4rem 2rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.empty-state h3 { font-size: 1.25rem; font-weight: 700; }
.empty-state p { color: var(--text-muted); }
.access-denied { text-align: center; padding: 4rem 2rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.mt-4 { margin-top: 1rem; }

/* ===========================  REPORTS  =========================== */
.report-event-row {
  border: 1px solid var(--border); border-radius: var(--radius); 
  padding: 1.25rem; margin-bottom: 1rem; transition: box-shadow 0.15s;
}
.report-event-row:hover { box-shadow: var(--shadow); }
.report-event-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.report-emoji { font-size: 2rem; flex-shrink: 0; }
.report-event-info { flex: 1; }
.report-event-name { font-size: 1rem; font-weight: 700; }
.report-event-meta { font-size: 0.8rem; color: var(--text-muted); }
.report-event-stats { display: flex; gap: 1.5rem; flex-shrink: 0; }
.report-stat { text-align: center; }
.report-stat-num { display: block; font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.report-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.report-bars { display: flex; flex-direction: column; gap: 0.4rem; }
.report-bar-row { display: flex; align-items: center; gap: 0.75rem; }
.report-bar-label { width: 70px; font-size: 0.78rem; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.report-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.report-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.fill-primary { background: var(--primary); }
.fill-success { background: var(--success); }
.report-bar-pct { width: 36px; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }

/* ===========================  BLAZOR ERROR UI  =========================== */
#blazor-error-ui {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: #fee2e2; border-top: 2px solid var(--danger); padding: 0.75rem 1rem;
}
.blazor-error-content { display: flex; align-items: center; gap: 0.5rem; justify-content: center; font-size: 0.9rem; }
#blazor-error-ui .dismiss { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); cursor: pointer; font-size: 1.1rem; color: var(--danger); text-decoration: none; }
#blazor-error-ui .reload { color: var(--danger); font-weight: 700; }

/* ===========================  PRINT TICKET  =========================== */
.ticket-print-page { min-height: calc(100vh - var(--nav-h)); background: var(--bg); }
.print-ticket-wrap { padding: 2rem; display: flex; justify-content: center; }
.print-ticket {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 8px 40px rgba(69, 171, 246,0.15);
    border: 2px solid var(--primary);
    overflow: hidden;
}
.print-ticket.print-redeemed { border-color: var(--success); }
.print-ticket.print-cancelled { border-color: var(--danger); opacity: 0.8; }
.print-ticket-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; background: linear-gradient(135deg, #1a1a2e, var(--primary)); }
.print-logo { color: white; font-size: 1.2rem; font-weight: 800; }
.print-status { padding: 0.3rem 0.85rem; border-radius: 20px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; }
.pstatus-valid {
    background: rgba(220,255,219,0.2);
    color: #6ee7b7;
    border: 1px solid #6ee7b7;
}
.pstatus-redeemed { background: rgba(59,130,246,0.2); color: #93c5fd; border: 1px solid #93c5fd; }
.pstatus-cancelled { background: rgba(239,68,68,0.2); color: #fca5a5; border: 1px solid #fca5a5; }
.print-event-section { display: flex; gap: 1rem; align-items: center; padding: 1.5rem; }
.print-event-emoji { font-size: 3rem; flex-shrink: 0; }
.print-event-name { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.4rem; }
.print-event-meta { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--text-muted); }
.print-divider { position: relative; display: flex; align-items: center; margin: 0; }
.print-notch { width: 20px; height: 20px; background: var(--bg); border-radius: 50%; flex-shrink: 0; }
.print-notch.left { margin-left: -10px; border: 2px solid var(--primary); border-left: none; }
.print-notch.right { margin-right: -10px; border: 2px solid var(--primary); border-right: none; }
.print-perforation { flex: 1; border-top: 2px dashed var(--border); }
.print-bottom-section { display: flex; gap: 1.5rem; padding: 1.5rem; align-items: flex-start; }
.print-holder-info { flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.print-field-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; margin-bottom: 0.1rem; }
.print-field-value { font-size: 1rem; font-weight: 600; }
.print-conf-code { font-family: monospace; font-size: 1.4rem; font-weight: 900; background: var(--primary-light); color: var(--primary); padding: 0.3rem 0.6rem; border-radius: 6px; letter-spacing: 0.15em; display: inline-block; }
.print-qr-section { flex-shrink: 0; text-align: center; }
.print-qr { width: 140px; height: 140px; display: block; border-radius: 8px; border: 2px solid var(--border); }
.print-qr-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.4rem; }
.print-footer { display: flex; justify-content: space-between; padding: 0.6rem 1.5rem; background: var(--bg); font-size: 0.7rem; color: var(--text-muted); border-top: 1px solid var(--border); }

/* ===========================  REDEEM CONFIRM PAGE  =========================== */
.redeem-confirm-page { min-height: calc(100vh - var(--nav-h)); display: flex; flex-direction: column; background: var(--bg); }
.redeem-confirm-header { padding: 2.5rem 1.5rem; text-align: center; background: var(--primary); color: white; }
.redeem-confirm-header.header-success { background: var(--success); }
.confirm-header-icon { font-size: 3.5rem; margin-bottom: 0.5rem; line-height: 1; }
.redeem-confirm-header h1 { font-size: 2rem; font-weight: 900; margin-bottom: 0.25rem; }
.redeem-confirm-header p { font-size: 1rem; opacity: 0.9; }
.confirm-tickets-list { flex: 1; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; max-width: 640px; margin: 0 auto; width: 100%; }
.confirm-ticket-card { background: white; border: 2px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; display: flex; align-items: flex-start; gap: 1rem; box-shadow: var(--shadow); }
.confirm-ticket-card.confirm-redeemed { border-color: var(--success); background: #f0fdf4; }
.confirm-ticket-card.confirm-failed { border-color: var(--danger); background: #fef2f2; }
.confirm-status-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; margin-top: 0.1rem; }
.confirm-ticket-info { flex: 1; }
.confirm-event-name { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.4rem; }
.confirm-ticket-detail { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.confirm-code { font-family: monospace; font-size: 1.2rem; font-weight: 900; color: var(--primary-dark); margin-top: 0.6rem; letter-spacing: 0.12em; background: var(--primary-light); display: inline-block; padding: 0.2rem 0.5rem; border-radius: 6px; }
.confirm-result-msg { margin-top: 0.5rem; font-size: 0.85rem; font-weight: 600; }
.confirm-ok { color: var(--success); }
.confirm-err { color: var(--danger); }
.confirm-staff-action { padding: 1.5rem; background: white; border-top: 1px solid var(--border); position: sticky; bottom: 0; max-width: 640px; margin: 0 auto; width: 100%; }
.confirm-instruction { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.confirm-staff-btn { display: block; width: 100%; padding: 1.1rem; font-size: 1.15rem; font-weight: 800; background: var(--success); color: white; border: none; border-radius: var(--radius); cursor: pointer; transition: all 0.18s; letter-spacing: 0.02em; }
.confirm-staff-btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(107,198,1,0.35); }
.confirm-staff-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.confirm-done { padding: 1.5rem; max-width: 640px; margin: 0 auto; width: 100%; }

@media print {
  .no-print { display: none !important; }
  .navbar, .footer { display: none !important; }
  .print-ticket { box-shadow: none; border: 2px solid #000; }
  body { background: white; }
}

/* ===========================  PROMO CODES  =========================== */
.promo-discount-badge { background: #fef3c7; color: #92400e; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }
.promo-success-msg { color: var(--success); font-size: 0.82rem; font-weight: 600; margin-top: 0.25rem; display: block; }
.promo-error-msg { color: var(--danger); font-size: 0.82rem; font-weight: 600; margin-top: 0.25rem; display: block; }
.promo-line { color: var(--success) !important; font-size: 0.9rem; }

/* ===========================  LIVE DASHBOARD  =========================== */
.live-dashboard { max-width: 1300px; margin: 0 auto; padding: 1.5rem; }
.live-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.live-header h1 { font-size: 1.75rem; font-weight: 800; margin: 0; }
.live-indicator { display: flex; align-items: center; gap: 0.5rem; background: #d1fae5; color: #065f46; padding: 0.4rem 0.85rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.live-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; animation: livepulse 1.5s ease-in-out infinite; flex-shrink: 0; }
@keyframes livepulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.3); } }

.live-grid { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; }
@media (max-width: 1024px) { .live-grid { grid-template-columns: 1fr; } }

.live-panel { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.live-panel h2 { font-size: 1rem; font-weight: 700; margin: 0 0 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.live-panel h3 { font-size: 0.9rem; font-weight: 700; margin: 0 0 0.75rem; }

.live-event-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 0.75rem; }
.live-event-card:last-child { margin-bottom: 0; }
.live-event-top { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.live-event-emoji { font-size: 1.75rem; flex-shrink: 0; }
.live-event-info { flex: 1; }
.live-event-name { font-size: 0.9rem; font-weight: 700; }
.live-event-date { font-size: 0.75rem; color: var(--text-muted); }
.live-event-status { flex-shrink: 0; }

.live-badge { padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; }
.live-badge-today { background: #fef3c7; color: #92400e; }
.live-badge-sale { background: #d1fae5; color: #065f46; }
.live-badge-sold { background: #fee2e2; color: #991b1b; }
.live-badge-closed { background: #f3f4f6; color: #4b5563; }
.live-badge-waiting { background: #ede9fe; color: #5b21b6; }

.live-event-metrics { display: flex; gap: 1rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.live-metric { text-align: center; }
.live-metric-num { display: block; font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.live-metric-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.live-bars { display: flex; flex-direction: column; gap: 0.3rem; }
.live-bar-row { display: flex; align-items: center; gap: 0.5rem; }
.live-bar-lbl { width: 68px; font-size: 0.72rem; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.live-bar-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.live-bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.live-bar-pct { width: 32px; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }

/* Activity Feed */
.activity-feed { display: flex; flex-direction: column; gap: 0; max-height: 380px; overflow-y: auto; }
.activity-item { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.activity-body { flex: 1; }
.activity-text { font-size: 0.83rem; font-weight: 500; line-height: 1.4; }
.activity-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

/* Waitlist in live dashboard */
.waitlist-event-row { background: var(--bg); border-radius: var(--radius-sm); padding: 0.75rem; margin-bottom: 0.5rem; }

/* ===========================  ALERTS  =========================== */
.alert-success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; }

/* ===========================  TICKET ACTIONS  =========================== */
.ticket-actions { display: flex; gap: 0.4rem; margin-top: 0.6rem; flex-wrap: wrap; }
.transfer-form { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.3rem; }
.cancel-confirm { margin-top: 0.6rem; }

/* ===========================  EMAIL LOG  =========================== */
.email-log-list { display: flex; flex-direction: column; gap: 0.5rem; }
.email-log-item { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.email-log-item-open { border-color: var(--primary); }
.email-log-header { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem 1rem; cursor: pointer; transition: background 0.15s; }
.email-log-header:hover { background: var(--bg); }
.email-log-left { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.email-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-sent { background: var(--success); }
.dot-failed { background: var(--danger); }
.dot-logged { background: var(--warning); }
.email-log-subject { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-log-meta { font-size: 0.75rem; color: var(--text-muted); }
.email-status-badge { padding: 0.2rem 0.55rem; border-radius: 20px; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; }
.badge-sent { background: #d1fae5; color: #065f46; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-logged { background: #fef3c7; color: #92400e; }
.email-preview-wrap { border-top: 1px solid var(--border); }
.email-preview-toolbar { padding: 0.4rem 1rem; background: var(--bg); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.email-iframe { width: 100%; height: 500px; border: none; display: block; }

/* ===========================  RESPONSIVE FIXES  =========================== */
@media (max-width: 640px) {
    .navbar {
        gap: .5rem;
    }
  .nav-links { display: none; }
    .nav-auth .btn-outline, .nav-auth .btn-primary {
        padding: 0.55rem .6rem;
    }
    .hero {
        padding: 2.5rem 1rem;
    }
  .search-bar { flex-direction: column; }
  .event-detail-hero { flex-direction: column; text-align: center; }
  .event-detail-emoji { font-size: 4rem; }
  .ticket-card { flex-direction: column; }
  .ticket-card-right { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; border-top: 1px solid var(--border); padding-top: 0.75rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .print-bottom-section { flex-direction: column; }
  .print-qr-section { align-self: center; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .live-event-metrics { gap: 0.6rem; }
  /* Staff portal mobile fixes */
  .staff-portal { padding: 0.75rem; }
  .staff-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .event-selector-bar { gap: 0.75rem; padding: 0.75rem; }
  .event-selector-inner { flex-wrap: wrap; }
  .event-selector-label { white-space: normal; }
  .scan-panel { padding: 1rem; }
  .scan-input-group { flex-wrap: wrap; }
  .scan-input { width: 100%; }
  .btn-redeem { width: 100%; }
  .recent-panel { padding: 1rem; }
  .tickets-table-section { padding: 1rem; }
    .page-container {
        padding: 1.5rem .5rem;
    }
    .admin-portal,
    .live-dashboard {
        padding: .5rem;
    }
}

/* ===========================  SCROLLBAR STYLING  =========================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===========================  STRIPE PAYMENT  =========================== */
.btn-stripe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--primary);    ;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    width: 100%;
}
    .btn-stripe:hover:not(:disabled) {
        background: var(--primary);
        
        transform: translateY(-1px);
    }
.btn-stripe:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.btn-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stripe-badges { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; margin-top: 0.5rem; }
.stripe-badge { padding: 0.15rem 0.45rem; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; font-size: 0.68rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.03em; }

/* ===========================  PAYMENT WAITING  =========================== */
.payment-waiting { text-align: center; padding: 5rem 2rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.payment-waiting h2 { font-size: 1.5rem; font-weight: 800; }
.payment-waiting p { color: var(--text-muted); }
.payment-wait-sub { font-size: 0.85rem !important; color: #9ca3af !important; }
.payment-spinner {
  width: 52px; height: 52px;
  border: 4px solid var(--primary-light); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin-bottom: 0.5rem;
}

/* ===========================  PAYMENT SUCCESS PAGE  =========================== */
.payment-success-page { display: flex; flex-direction: column; gap: 1.25rem; }
.payment-success-banner {
  background: linear-gradient(135deg, #1a1a2e, #6c3de0);
  color: white; border-radius: var(--radius); padding: 2rem;
  text-align: center;
}
.success-confetti { font-size: 3.5rem; margin-bottom: 0.5rem; display: block; }
.payment-success-banner h1 { font-size: 1.75rem; font-weight: 900; margin-bottom: 0.4rem; }
.payment-success-banner p { opacity: 0.85; margin-bottom: 0.5rem; }
.payment-amount { font-size: 1.15rem; font-weight: 700; }
.card-info { font-size: 0.9rem; opacity: 0.75; }

.success-tickets { display: flex; flex-direction: column; gap: 0.75rem; }

.success-next-steps { background: white; border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--border); box-shadow: var(--shadow); }
.success-next-steps h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.next-step-list { display: flex; flex-direction: column; gap: 1rem; }
.next-step { display: flex; gap: 1rem; align-items: flex-start; }
.next-step-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.next-step strong { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.2rem; }
.next-step p { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

/* ===========================  ADMIN PAYMENTS  =========================== */
.stripe-connected-badge { padding: 0.4rem 0.9rem; border-radius: 20px; font-size: 0.83rem; font-weight: 600; }
.stripe-live { background: #d1fae5; color: #065f46; }
.stripe-demo { background: #fef3c7; color: #92400e; }

.stripe-setup-card { background: white; border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); border: 1px solid #e5e7eb; margin-bottom: 1.5rem; }
.stripe-setup-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.stripe-setup-header h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.25rem; }
.stripe-setup-header p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.stripe-setup-steps { display: flex; flex-direction: column; gap: 1.25rem; }
.setup-step { display: flex; gap: 1rem; align-items: flex-start; }
.step-num { width: 26px; height: 26px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 800; flex-shrink: 0; margin-top: 1px; }
.setup-step strong { display: block; font-size: 0.9rem; margin-bottom: 0.3rem; }
.setup-step p { font-size: 0.83rem; color: var(--text-muted); margin: 0 0 0.3rem; }
.code-block { background: #1a1a2e; color: #a5f3fc; padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-family: monospace; font-size: 0.8rem; display: block; margin: 0.4rem 0; white-space: pre; overflow-x: auto; }
.inline-code { background: var(--primary-light); color: var(--primary); padding: 0.1rem 0.4rem; border-radius: 4px; font-family: monospace; font-size: 0.82rem; }

/* ===========================  TICKET TYPES  =========================== */
.ticket-types-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }
.ticket-type-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; transition: all 0.15s; background: var(--bg); }
.ticket-type-card.tt-selected { border-color: var(--primary); background: var(--primary-light); }
.qty-stepper { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.qty-btn { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--primary); background: transparent; color: var(--primary); cursor: pointer; font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: all 0.15s; padding: 0; line-height: 1; }
.qty-btn:hover:not(:disabled) { background: var(--primary); color: white; }
.qty-btn:disabled { opacity: 0.25; cursor: default; pointer-events: none; }
.qty-val { min-width: 22px; text-align: center; font-weight: 700; font-size: 1rem; }
.tt-header { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.tt-name { font-weight: 700; font-size: 0.95rem; }
.tt-price { font-weight: 700; color: var(--primary); font-size: 1rem; }
.tt-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; }
.ticket-type-label { font-size: 0.8rem; font-weight: 600; color: var(--primary); background: var(--primary-light); padding: 0.1rem 0.5rem; border-radius: 20px; display: inline-block; margin: 0.2rem 0 0.3rem; }
