@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    --bg: #0b0d14;
    --surface: #141720;
    --surface2: #1c2030;
    --border: #252840;
    --border-dim: #1e2135;
    --text: #e2e5f1;
    --text-muted: #7e849e;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99,102,241,0.25);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --seat-available: #22c55e;
    --seat-held: #f59e0b;
    --seat-sold: #ef4444;
    --seat-selected: #6366f1;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 0 3px var(--primary-glow);
    --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

header {
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 88px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(11, 13, 20, 0.85);
}

/* Gradient accent line along the header bottom */
header::after {
    content: '';
    position: absolute;
    inset: auto 0 -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent 5%, var(--primary) 50%, transparent 95%);
    opacity: 0.6;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-stack {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.logo-tagline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    opacity: 0.85;
    line-height: 1;
    letter-spacing: 0.03em;
}
.rx-logo-svg {
    height: 16px;
    width: auto;
    fill: currentColor;
    vertical-align: middle;
}
.header-content h1 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.logo-link {
    color: inherit;
    text-decoration: none;
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 40%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-link:hover { opacity: 0.85; }

.subtitle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    opacity: 0.7;
    white-space: nowrap;
    pointer-events: none;
}

.demo-controls { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(99,102,241,0.45);
    filter: brightness(1.08);
}
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(1.1); }
.btn-warning { background: var(--warning); color: #1a1d27; }
.btn-warning:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 6px 12px;
}
.btn-ghost:hover { background: var(--surface2); border-color: var(--border); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 0.75rem; }

/* Settings Panel */
.settings-panel {
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    animation: slideDown 0.2s ease;
}
.settings-panel.hidden { display: none; }
.settings-panel h3 { margin-bottom: 12px; font-size: 1rem; }
.settings-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.toggle-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 220px;
}
.toggle-label span { font-weight: 600; font-size: 0.9rem; }
.toggle-label small { color: var(--text-muted); font-size: 0.75rem; }
.setting-row { display: flex; align-items: center; gap: 8px; }
.setting-row input[type="number"] {
    width: 80px;
    padding: 4px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Main Layout */
main { padding: 20px 32px; max-width: 1400px; margin: 0 auto; }

.event-browser-card {
    margin-bottom: 24px;
    overflow: hidden;
}

.event-browser-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
}

.event-browser-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.event-browser-summary {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.event-filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 16px;
    align-items: end;
}

.filter-date-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.filter-date-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-left: 2px;
}

.event-filters input[type="search"],
.event-filters input[type="date"],
.event-browser-card .event-filters select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    background-color: var(--surface2);
    background-image: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.event-filters input[type="search"]:focus,
.event-filters input[type="date"]:focus,
.event-browser-card .event-filters select:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.event-browser-card .event-filters select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--surface2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237e849e' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.event-filters input[type="date"] {
    cursor: pointer;
    padding-right: 6px;
}

/* Make the calendar icon visible on dark background */
.event-filters input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.75);
    opacity: 0.65;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    transition: opacity 0.15s, background 0.15s;
}

.event-filters input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background: var(--primary-glow);
}

.event-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.event-result {
    background: linear-gradient(180deg, rgba(28,32,48,0.98), rgba(20,23,32,0.98));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    text-align: left;
    color: var(--text);
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.event-result:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.event-result.selected {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.event-result-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
}

.event-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.event-result-date {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.event-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(99,102,241,0.16);
    border: 1px solid rgba(129,140,248,0.28);
    color: #c7d2fe;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.event-result-action {
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: auto;
    align-self: flex-start;
    text-decoration: none;
}

/* Breadcrumb */
.page-breadcrumb {
    margin-bottom: 16px;
}

.breadcrumb-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}

.breadcrumb-link:hover {
    color: var(--primary-hover);
}

/* Event Card (right panel) */
.event-card {
    background: linear-gradient(135deg, var(--surface) 60%, rgba(99,102,241,0.08));
    border-left: 3px solid var(--primary);
    text-align: left;
}
.event-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 4px;
}
.event-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.event-card-venue {
    color: var(--text-muted);
    font-size: 0.82rem;
}
.event-card-date { color: var(--text-muted); font-size: 0.85rem; }

.layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    margin-bottom: 24px;
}

/* Venue Map */
.venue-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.venue-panel h2 { font-size: 1.1rem; margin-bottom: 12px; }

.venue-svg {
    width: 100%;
    height: auto;
}

.stage { fill: #3d3f5c; }
.stage-text { fill: var(--text-muted); font-size: 12px; font-weight: 600; }

.section-rect {
    fill: var(--surface2);
    stroke: var(--border);
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.15s;
}
.section-rect:hover { fill: #2a2e42; stroke: var(--primary); }
.section-label {
    fill: var(--text-muted);
    font-size: 9px;
    pointer-events: none;
    text-anchor: middle;
}
.section-price {
    fill: var(--primary);
    font-size: 8px;
    font-weight: 600;
    pointer-events: none;
    text-anchor: middle;
}

.seat-dot {
    r: 5;
    cursor: pointer;
    transition: all 0.15s;
    stroke: transparent;
    stroke-width: 1.5;
}
.seat-dot.available { fill: var(--seat-available); }
.seat-dot.held { fill: var(--seat-held); }
.seat-dot.sold { fill: var(--seat-sold); cursor: not-allowed; }
.seat-dot.selected { fill: var(--seat-selected); stroke: white; }
.seat-dot:hover:not(.sold) { r: 7; stroke: white; }
.seat-dot.owned { fill: #a78bfa; cursor: pointer; }
.seat-dot.transfer-selected { fill: #ec4899; stroke: white; cursor: pointer; }
.seat-dot.other-seat { fill: #374151; cursor: default; }

.legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot.available { background: var(--seat-available); }
.dot.held { background: var(--seat-held); }
.dot.sold { background: var(--seat-sold); }
.dot.selected { background: var(--seat-selected); }

/* Right Panel */
.right-panel { display: flex; flex-direction: column; gap: 16px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow); }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
/* Generic card-title (used by admin.html) */
.card-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.card input, .card select {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.card input:focus, .card select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}
.card input::placeholder { color: var(--text-muted); }
.card select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237e849e'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    cursor: pointer;
}

.selected-seats { min-height: 40px; }
.empty-state { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

.seat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.8rem;
    margin: 2px 4px 2px 0;
}
.seat-chip .remove {
    cursor: pointer;
    color: var(--danger);
    font-weight: bold;
    margin-left: 2px;
}

.cart-total {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.cart-total.hidden { display: none; }

.purchase-form { display: flex; flex-direction: column; gap: 8px; }
.purchase-form.hidden { display: none; }
.purchase-buttons { display: flex; flex-direction: column; gap: 6px; }

.race-result {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.5;
}
.race-result.hidden { display: none; }
.race-result.error { background: rgba(239,68,68,0.15); border: 1px solid var(--danger); }
.race-result.success { background: rgba(34,197,94,0.15); border: 1px solid var(--success); }
.race-result.warning { background: rgba(245,158,11,0.15); border: 1px solid var(--warning); }

/* Demo section input/layout helpers (index.html) */
.demo-row { margin-bottom: 0.5rem; }
.demo-options-row { margin-bottom: 0.5rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.demo-btn-row { display: flex; gap: 0.5rem; }
.input-narrow { width: 4rem; margin-left: 0.25rem; }

/* Activity Log */
.activity-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.activity-log {
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
}
.log-entry {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(37,40,64,0.6);
}
.log-entry:last-child { border-bottom: none; }
.log-time { color: var(--text-muted); width: 78px; flex-shrink: 0; font-size: 0.75rem; white-space: nowrap; }
.log-source {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    width: 110px;
    flex-shrink: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.log-source.lock { background: var(--primary); color: white; }
.log-source.saga { background: #8b5cf6; color: white; }
.log-source.outbox { background: var(--info); color: white; }
.log-source.purchase { background: var(--warning); color: #1a1d27; }
.log-source.transfer { background: #14b8a6; color: white; }
.log-source.demo { background: var(--text-muted); color: var(--bg); }
.log-source.admin { background: #64748b; color: white; }
.log-source.outboxrelay { background: #0ea5e9; color: white; }
.log-msg { flex: 1; }
.log-msg.error { color: var(--danger); }
.log-msg.warning { color: var(--warning); }
.log-msg.success { color: var(--success); }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.warning { background: var(--warning); color: #1a1d27; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .event-browser-header { align-items: start; flex-direction: column; }
    .event-browser-summary { white-space: normal; }
    .event-filters { grid-template-columns: 1fr; }
    .filter-date-group { flex-direction: row; align-items: center; gap: 8px; }
    .filter-date-label { white-space: nowrap; }
}

/* ---- Auth Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}
.modal-overlay.hidden { display: none; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 24px;
    width: 380px;
    max-width: 90vw;
    box-shadow: var(--shadow), 0 0 0 1px rgba(99,102,241,0.08);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

.modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.modal-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}
.modal-tab.active { background: var(--primary); color: white; }

.modal input {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.modal input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}
.modal input::placeholder { color: var(--text-muted); }

.form-error {
    color: var(--danger);
    font-size: 0.78rem;
    min-height: 18px;
    margin-bottom: 4px;
}

/* ---- User Info / Dropdown (header) ---- */
.user-info {
    display: flex;
    align-items: center;
    margin-left: auto;
}
.user-info.hidden { display: none; }

.user-dropdown { position: relative; }

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
}
.chevron-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
    opacity: 0.6;
}
.user-dropdown[open] .chevron-icon,
.user-dropdown-trigger[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    list-style: none;
    min-width: 200px;
    z-index: 200;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
.user-dropdown-menu.hidden { display: none; }

.user-dropdown-menu li a,
.user-dropdown-menu li button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.user-dropdown-menu li a:hover,
.user-dropdown-menu li button:hover { background: var(--surface2); }
.user-dropdown-menu li + li { border-top: 1px solid var(--border); }
.user-dropdown-menu li.dropdown-divider {
    border-top: 1px solid var(--border);
    margin: 4px 0;
    padding: 0;
    pointer-events: none;
}
.user-dropdown-menu li.dropdown-divider + li { border-top: none; }
.user-dropdown-menu li.dropdown-label {
    padding: 8px 14px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    pointer-events: none;
    border-top: none;
}
.dropdown-danger,
.user-dropdown-menu li .dropdown-danger {
    color: var(--danger) !important;
}
.user-dropdown-menu li .dropdown-danger:hover { background: rgba(239,68,68,0.08) !important; }

.user-dropdown-menu li.toggle-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s;
}
.user-dropdown-menu li.toggle-item label:hover { background: var(--surface2); }
.user-dropdown-menu li.toggle-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* ---- Account Panel (My Tickets) ---- */
.ticket-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.ticket-item:last-child { border-bottom: none; }
.ticket-item.selected { background: rgba(99,102,241,0.12); border-radius: 6px; }
.ticket-item { cursor: pointer; }
.ticket-item:hover { background: rgba(255,255,255,0.04); border-radius: 6px; }
.ticket-info { display: flex; flex-direction: column; gap: 2px; }
.ticket-label { font-weight: 600; font-size: 0.9rem; }
.ticket-detail { color: var(--text-muted); font-size: 0.78rem; }
.ticket-price { font-weight: 600; font-size: 0.85rem; color: var(--primary); white-space: nowrap; }

/* Legend dots for owned/transfer-selected */
.dot.owned-dot { background: #a78bfa; }
.dot.transfer-selected-dot { background: #ec4899; }
.dot.other-seat { background: #374151; }

/* Generic input (used in admin.html and elsewhere) */
.input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}
.input::placeholder { color: var(--text-muted); }

/* Section hint (e.g. my-tickets empty state label) */
.section-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 8px;
}

/* Misc shared */
.btn-full { width: 100%; }
.back-link { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.back-link:hover { color: var(--primary); }
.transfer-summary { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; }

/* ======================================================================
   Admin Page
   ====================================================================== */
.admin-wrap { max-width: 1400px; margin: 0 auto; padding: 1.5rem 2rem; }

/* --- Header bar with inline key --- */
.admin-header-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
}
.admin-page-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.admin-key-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
.admin-key-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.admin-key-field .input {
    width: 200px;
    padding: 6px 12px;
    font-size: 0.82rem;
    margin-bottom: 0;
}
.admin-key-status {
    font-size: 0.78rem;
    white-space: nowrap;
    min-width: 0;
}
.admin-key-status.ok { color: var(--success); }
.admin-key-status.err { color: var(--danger); }

/* --- Grid layout --- */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 760px) { .admin-grid { grid-template-columns: 1fr; } }

/* --- Cards --- */
.admin-card { border-left: 3px solid var(--primary); }
.admin-card + .admin-card { margin-top: 1.25rem; }
.admin-card-sidebar { display: flex; flex-direction: column; gap: 0; }

/* Override generic .card input/select rules inside admin cards */
.admin-card input,
.admin-card select {
    width: auto;
    margin-bottom: 0;
}

/* --- Fields (label + control side by side) --- */
.admin-field {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}
.admin-field-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    width: 120px;
}
.admin-field-control { flex: 1; min-width: 0; }
.admin-field-control select.input { width: 100%; }
.admin-field-input-group { display: flex; align-items: center; gap: 0.4rem; }
.admin-field-input-group .input { width: 90px; }
.admin-field-unit { font-size: 0.78rem; color: var(--text-muted); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237e849e'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; cursor: pointer; }

/* --- Toggles --- */
.admin-toggle { margin-bottom: 0.6rem; }
.admin-toggle label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.85rem; }
.admin-toggle small { display: block; margin-left: 1.6rem; color: var(--text-muted); font-size: 0.72rem; line-height: 1.4; }

/* --- Actions / Status --- */
.admin-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.admin-actions-stack { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-hint { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.75rem; }
.admin-detail-list { list-style: none; margin: 0.25rem 0 0 1.6rem; font-size: 0.78rem; color: var(--text-muted); line-height: 1.6; }
.admin-status { margin-top: 0.5rem; font-size: 0.82rem; min-height: 1.2em; transition: color 0.15s; }
.admin-status.ok { color: var(--success); }
.admin-status.err { color: var(--danger); }

/* Admin page helpers (admin.html) */
.modal-desc { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.25rem; text-align: center; }
.admin-field--mt { margin-top: 10px; }
.admin-actions--mt { margin-top: 10px; }
.admin-section-desc { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 12px; }
.activity-title { margin: 0; font-size: 1rem; }
#admin-activity-section { margin-top: 1.5rem; }
#admin-activity-log { max-height: 400px; }

/* ======================================================================
   Venue Admin Page
   ====================================================================== */
.modal-step-hint { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1rem; text-align: center; }
#admin-event-select { margin-bottom: 12px; }
.btn-mt-sm { margin-top: 8px; }

.venue-admin-main { max-width: 1400px; margin: 0 auto; padding: 1.5rem 2rem; }
.api-key-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    transition: padding 0.2s;
}
.api-key-bar.connected { padding: 8px 16px; }
.api-key-bar-left { display: flex; gap: 0.5rem; align-items: center; }
.api-key-bar input { width: 240px; }
.api-key-bar label { white-space: nowrap; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.admin-section {
    margin-bottom: 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.admin-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.section-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.section-header .btn { margin-left: auto; }
.count-badge { background: rgba(99,102,241,0.15); color: #818cf8; border-radius: 9999px; padding: 1px 8px; font-size: 0.78rem; font-weight: 600; }

/* Venue admin tables */
.venue-admin-main table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.venue-admin-main th,
.venue-admin-main td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.venue-admin-main th { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.venue-admin-main tr:hover td { background: rgba(255,255,255,0.03); }
#tickets-table td:last-child, #tickets-table th:last-child { text-align: center; white-space: nowrap; }
#users-table td:last-child, #users-table th:last-child { text-align: center; white-space: nowrap; }
#users-table td:last-child button + button { margin-left: 4px; }

.status-badge { display: inline-block; padding: 1px 8px; border-radius: 9999px; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.status-badge.active { background: rgba(74,222,128,0.15); color: #4ade80; }
.status-badge.transferred { background: rgba(167,139,250,0.15); color: #a78bfa; }
.status-badge.cancelled { background: rgba(239,68,68,0.15); color: #f87171; }

/* Venue admin action buttons (subtle / ghost variants) */
.btn-warn { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); padding: 3px 10px; border-radius: 6px; cursor: pointer; font-size: 0.82rem; }
.btn-warn:hover { background: rgba(251,191,36,0.25); }
.btn-view-seats { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); padding: 3px 10px; border-radius: 6px; cursor: pointer; font-size: 0.82rem; }
.btn-view-seats:hover { background: rgba(99,102,241,0.3); }
.btn-view-seats.active-view { background: rgba(251,191,36,0.2); color: #fbbf24; border-color: rgba(251,191,36,0.4); }

.expand-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; padding: 2px 6px; }
.expand-btn:hover { color: var(--primary); }
.nested-tickets { background: rgba(255,255,255,0.02); }
.nested-tickets td { font-size: 0.82rem; color: var(--text-muted); padding-left: 1.5rem; }

.status-msg { font-size: 0.85rem; margin-left: 0.5rem; }
.status-msg.ok { color: #4ade80; }
.status-msg.err { color: #f87171; }
.refreshed { font-size: 0.78rem; color: var(--text-muted); margin-left: auto; }

/* Seating chart */
.chart-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; }
@media (max-width: 1000px) { .chart-layout { grid-template-columns: 1fr; } }
.chart-map { background: var(--surface2); border-radius: 10px; padding: 1rem; }
.chart-map svg { width: 100%; height: auto; }
.chart-info-panel { background: var(--surface2); border-radius: 10px; padding: 1.25rem; min-height: 180px; overflow-y: auto; max-height: 500px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 0.78rem; color: var(--text-muted); }
.chart-legend-item { display: flex; align-items: center; gap: 5px; }
.chart-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chart-dot.as-available { background: #22c55e; }
.chart-dot.as-active { background: #a78bfa; }
.chart-dot.as-transferred { background: #22d3ee; }
.chart-dot.as-cancelled { background: #374151; }
.chart-dot.as-highlighted { background: #fbbf24; }
.admin-seat-dot { r: 5; cursor: pointer; stroke: transparent; stroke-width: 1.5; transition: opacity 0.1s; }
.admin-seat-dot.as-available { fill: #22c55e; }
.admin-seat-dot.as-active { fill: #a78bfa; }
.admin-seat-dot.as-transferred { fill: #22d3ee; }
.admin-seat-dot.as-cancelled { fill: #374151; }
.admin-seat-dot.as-highlighted { fill: #fbbf24; stroke: rgba(251,191,36,0.5); stroke-width: 2; }
.admin-seat-dot.as-selected { stroke: white; stroke-width: 2; }
.admin-seat-dot:hover { opacity: 0.75; }
#admin-venue-map .section-rect { cursor: default; }
#admin-venue-map .section-rect:hover { fill: var(--surface2); stroke: var(--border); }

/* Info panel */
.info-panel-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; }
.info-panel-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.83rem; padding: 4px 0; border-bottom: 1px solid var(--border); }
.info-subtitle { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0.75rem 0 0.3rem; }
.info-panel-empty { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

/* Activity log (in info panel) */
.activity-log-list { margin-top: 0.3rem; display: flex; flex-direction: column; gap: 4px; }
.activity-log-item { font-size: 0.75rem; padding: 4px 6px; border-radius: 4px; background: rgba(255,255,255,0.03); border-left: 3px solid var(--border); line-height: 1.4; word-break: break-word; }
.activity-log-item.log-success { border-left-color: #4ade80; }
.activity-log-item.log-warning { border-left-color: #fbbf24; }
.activity-log-item.log-error { border-left-color: #f87171; }
.activity-log-item .log-meta { color: var(--text-muted); font-size: 0.7rem; display: block; margin-bottom: 1px; }
