/* The Ticket Desk — dark + gold theme (matches Money Masters house style) */
:root {
  --bg:        #0e1013;
  --panel:     #171a20;
  --panel-2:   #1e222a;
  --border:    #2a2f39;
  --text:      #e8eaed;
  --muted:     #9aa2ad;
  --gold:      #f5a623;
  --gold-dim:  #c98a1c;
  --green:     #35c46a;
  --red:       #e5484d;
  --blue:      #4c8dff;
  --radius:    14px;
  --shadow:    0 6px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { margin: 0 0 .4em; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(14,16,19,.9);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-weight: 800; letter-spacing: .3px; font-size: 18px; color: var(--text); display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 36px; width: 36px; border-radius: 8px; object-fit: cover; }
.brand b { color: var(--gold); }
.nav { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: wrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: 9px 15px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--gold-dim); text-decoration: none; }
.btn.gold { background: var(--gold); color: #1a1205; border-color: var(--gold); }
.btn.gold:hover { background: #ffb733; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.danger { color: #ff8085; border-color: #52343a; }
.btn:disabled { opacity: .5; cursor: default; }

/* cards / panels */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.card .body { padding: 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .thumb { aspect-ratio: 16 / 9; position: relative; overflow: hidden; background: var(--panel-2);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 34px; }
.card .thumb .thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card h3 { font-size: 16px; }
.price { font-size: 20px; font-weight: 800; color: var(--gold); }
.meta { color: var(--muted); font-size: 13px; }

/* hero */
.hero { padding: 46px 0 30px; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); }
.hero p { color: var(--muted); font-size: 17px; max-width: 640px; }
.hero .cta { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* event tiles (home) + event page */
.event-tile { cursor: pointer; transition: transform .15s, border-color .15s; }
.event-tile:hover { border-color: var(--gold-dim); transform: translateY(-2px); }
.event-tile .body { align-items: center; text-align: center; }
.tile-cta { margin-top: auto; padding-top: 8px; }
.event-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; }
.event-hero-img { width: 180px; height: 101px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel-2) center/cover; flex: none; }
.event-hero h1 { font-size: clamp(22px, 3.5vw, 32px); margin: 0 0 4px; }
/* Viagogo-style event layout: sticky map left, ticket list right */
.event-layout { display: flex; gap: 20px; align-items: flex-start; }
.event-map-col { flex: 1.6; min-width: 0; position: sticky; top: 74px; }
.event-stock-col { flex: 1; min-width: 300px; }
@media (max-width: 880px) {
  .event-layout { flex-direction: column-reverse; }
  .event-map-col { position: static; width: 100%; }
  .event-stock-col { min-width: 0; }
}
.stock-list { display: flex; flex-direction: column; gap: 8px; }
.stock-item { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); cursor: pointer; transition: border-color .12s; }
.stock-item:hover { border-color: var(--gold-dim); }
.stock-item.selected { border-color: var(--gold); background: rgba(245, 166, 35, .06); }
.si-sec { font-weight: 700; }
.si-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; white-space: nowrap; }
.si-btns { display: flex; gap: 6px; }
/* collapsible seat-map panel */
.seatmap-panel { padding: 12px 14px; margin-bottom: 8px; }
.seatmap-panel summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.seatmap-panel summary::-webkit-details-marker { display: none; }
.seatmap-panel summary::before { content: '▸'; color: var(--gold); transition: transform .15s; display: inline-block; }
.seatmap-panel[open] summary::before { transform: rotate(90deg); }
.seatmap-panel summary .count { color: var(--muted); font-weight: 400; font-size: 13px; }
.seatmap-panel img.seatmap { margin-top: 12px; }
@media (max-width: 540px) { .event-hero-img { width: 116px; height: 66px; } }

/* storefront filter bar */
.filterbar { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.filterbar #fSearch { flex: 2; min-width: 200px; }
.filterbar select { flex: 1; min-width: 130px; width: auto; }
.section-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.section-head h3 { margin: 0; font-size: 15px; }
.section-head .count { color: var(--muted); font-size: 13px; }

/* listing detail gallery + seat map */
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; }
.thumbs img.active { border-color: var(--gold); }
.seatmap { width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #fff; margin-top: 4px; }
/* staff uploader */
.uploader { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.uploader .up-thumb { position: relative; width: 72px; height: 56px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2) center/cover; }
.uploader .up-thumb .rm { position: absolute; top: -7px; right: -7px; background: var(--red); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 12px; line-height: 18px; text-align: center; cursor: pointer; border: none; }
.filelabel { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px dashed var(--border); border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 13px; }
.filelabel:hover { border-color: var(--gold-dim); color: var(--text); }
.filelabel input { display: none; }
.uploader .up-thumb .adj { position: absolute; bottom: 3px; right: 3px; background: rgba(0,0,0,.7); color: var(--gold);
  border: none; border-radius: 6px; font-size: 10px; padding: 2px 5px; cursor: pointer; }
.uploader .up-thumb { width: 92px; height: 60px; }
/* crop editor */
.cropframe { position: relative; overflow: hidden; border: 2px solid var(--gold); border-radius: 10px;
  background: #1e222a; margin: 8px auto; touch-action: none; cursor: grab; max-width: 100%; }
.cropframe:active { cursor: grabbing; }
.cropframe img { position: absolute; top: 0; left: 0; transform-origin: 0 0; user-select: none; pointer-events: none; }

/* messaging */
.nav-badge { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; padding: 0 5px;
  border-radius: 8px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; text-align: center; vertical-align: middle; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 48vh; overflow-y: auto; padding: 12px; }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4; word-wrap: break-word; }
.bubble.them { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); }
.bubble.me { align-self: flex-end; background: var(--gold); color: #1a1205; }
.bubble .when { display: block; font-size: 10px; opacity: .7; margin-top: 3px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 20px; flex-wrap: wrap; }
.tab { padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tab.active { color: var(--text); border-bottom-color: var(--gold); }

/* pills / badges */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--border); color: var(--muted); }
.pill.new { color: #ffd27a; border-color: #4a3c1c; background: #241d0d; }
.pill.assigned,.pill.sourcing { color: var(--blue); border-color: #23385f; background: #10192b; }
.pill.quoted { color: #c79bff; border-color: #3a2b57; background: #180f28; }
.pill.won,.pill.paid,.pill.fulfilled { color: var(--green); border-color: #1f4d33; background: #0d1f16; }
.pill.lost,.pill.cancelled { color: #ff8085; border-color: #52343a; background: #1f1113; }
.pill.public { color: var(--green); border-color: #1f4d33; }
.pill.private { color: #ffd27a; border-color: #4a3c1c; }
.pill.pending { color: #ffd27a; border-color: #4a3c1c; }
.pill.verified { color: var(--green); border-color: #1f4d33; background: #0d1f16; }

/* forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
input, select, textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: 10px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-dim); }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.check { display: flex; align-items: center; gap: 9px; margin-top: 14px; }
.check input { width: auto; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow: auto; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  width: 100%; max-width: 480px; padding: 24px; box-shadow: var(--shadow); }
.modal.wide { max-width: 720px; }
.modal h2 { font-size: 20px; }
.modal .x { float: right; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; }

/* table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: var(--panel-2); }
.table-wrap { overflow-x: auto; }

/* misc */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--gold-dim); color: var(--text);
  padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; max-width: 90vw; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat .n { font-size: 24px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat.warn { border-color: var(--gold-dim); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.err { color: #ff8085; font-size: 13px; margin-top: 8px; min-height: 16px; }
.notes { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.note { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.note .who { color: var(--muted); font-size: 12px; margin-bottom: 3px; }

/* crop editor sits on a second layer above the edit modal (modalRoot2 stack) */
#modalRoot2 .overlay { z-index: 60; }
