:root {
  --bg: #0f1412;
  --bg-elev: #171e1b;
  --line: #2a3530;
  --text: #e8efe9;
  --muted: #8fa399;
  --accent: #3dba8a;
  --accent-dim: #2a7a5c;
  --danger: #e07060;
  --warn: #d4a84b;
  --ok: #3dba8a;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, #1a3a2e 0%, transparent 55%),
    linear-gradient(180deg, #0f1412 0%, #121916 100%);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; gap: 0.85rem; align-items: center; }
.brand-mark {
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  background: var(--accent);
  color: #062218;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.top-actions { display: flex; gap: 0.5rem; }

.btn {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--accent-dim); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #062218; border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn.danger { background: transparent; color: var(--danger); border-color: #6a3a34; }
.btn.ghost { background: transparent; }

.layout {
  padding: 1.25rem 1.5rem 5rem;
  display: grid;
  gap: 1.25rem;
}

.progress {
  display: grid;
  gap: 0.85rem;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.stat {
  min-width: 7.5rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-elev);
  border-left: 3px solid var(--line);
}
.stat .label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat .value {
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 500;
}
.stat.pending { border-color: var(--warn); }
.stat.approved { border-color: var(--ok); }
.stat.rejected { border-color: var(--danger); }

.venue-progress {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}
.venue-chip {
  padding: 0.65rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.venue-chip strong {
  display: block;
  font-family: var(--sans);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.venue-chip span { color: var(--muted); }

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.queue-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.75rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.filters label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filters select {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.45rem 0.55rem;
  font: inherit;
  min-width: 8rem;
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#selectedCount {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.8rem;
  margin-right: 0.35rem;
}

.table-wrap {
  border: 1px solid var(--line);
  overflow: auto;
  max-height: calc(100vh - 22rem);
  background: var(--bg-elev);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}
th, td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  position: sticky;
  top: 0;
  background: #1c2521;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  z-index: 1;
}
tbody tr:hover { background: rgba(61, 186, 138, 0.05); }
tbody tr.selected { background: rgba(61, 186, 138, 0.1); }
.col-check { width: 2.5rem; }
.col-id { width: 4rem; font-family: var(--mono); }
.col-img { width: 2.75rem; text-align: center; }
.col-desc { width: 2.75rem; text-align: center; }
.img-btn, .desc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--accent);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}
.img-btn:hover, .img-btn:focus,
.desc-btn:hover, .desc-btn:focus {
  border-color: var(--accent);
  background: rgba(61, 186, 138, 0.12);
  outline: none;
}
.img-preview {
  position: fixed;
  z-index: 40;
  width: 280px;
  max-height: 280px;
  padding: 0.4rem;
  background: #0c1210;
  border: 1px solid var(--accent-dim);
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  pointer-events: none;
}
.img-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 264px;
  object-fit: contain;
  background: #151c19;
}
.desc-preview {
  position: fixed;
  z-index: 40;
  width: min(360px, calc(100vw - 24px));
  max-height: 280px;
  padding: 0.75rem 0.85rem;
  background: #0c1210;
  border: 1px solid var(--accent-dim);
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow: auto;
  pointer-events: none;
}
.mono { font-family: var(--mono); font-size: 0.8rem; }
.title-cell { font-weight: 500; max-width: 28rem; }
.title-cell a { color: var(--text); text-decoration: none; }
.title-cell a:hover { color: var(--accent); }
.hall-cell {
  max-width: 14rem;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 2rem !important; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  max-width: 24rem;
  padding: 0.85rem 1rem;
  background: #1f2b26;
  border: 1px solid var(--accent-dim);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  z-index: 20;
}
.toast.error { border-color: #6a3a34; }

@media (max-width: 720px) {
  .top { flex-direction: column; align-items: flex-start; }
  .queue-bar { flex-direction: column; align-items: stretch; }
}
