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

:root {
  --bg: #0f0f13;
  --surface: #1a1a22;
  --border: #2e2e3e;
  --accent: #7c6af7;
  --accent-dim: #5a4fd4;
  --text: #e8e8f0;
  --muted: #888899;
  --danger: #e05555;
  --success: #4caf7d;
  --radius: 8px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 { font-size: 18px; font-weight: 600; letter-spacing: 0.02em; }
header h1 span { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* Search bar */
.search-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 130px;
  gap: 10px;
  margin-bottom: 20px;
}

input, select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus { border-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-sm        { padding: 5px 10px; font-size: 12px; }

/* Stats bar */
.stats {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
  height: 20px;
}

/* Concert table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; }

thead { background: var(--surface); }
th {
  text-align: left;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(124, 106, 247, 0.06); }

td { padding: 10px 14px; vertical-align: middle; }
td.band { font-weight: 500; }
td.setlist-dot { text-align: center; font-size: 18px; }

.dot-yes  { color: var(--success); }
.dot-no   { color: var(--border); }
.date-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
  color: var(--muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}
.page-info { color: var(--muted); font-size: 13px; }

/* Modal overlay */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}

.modal h2 { font-size: 17px; font-weight: 600; margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: flex-end;
}

/* Detail panel (right side drawer feel) */
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.detail-panel h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.detail-panel .meta { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.filter-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: inherit; font: inherit; text-align: left;
  text-decoration: underline; text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.filter-link:hover { color: var(--accent); text-decoration-style: solid; }
.detail-field { margin-bottom: 14px; }
.detail-field .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 3px; }
.detail-field .value { font-size: 14px; }

.setlist-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.setlist-link { color: var(--accent); text-decoration: none; font-size: 13px; }
.setlist-link:hover { text-decoration: underline; }

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  z-index: 300;
  transition: opacity 0.3s;
  max-width: 340px;
}
.toast.hidden { opacity: 0; pointer-events: none; }
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }

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

@media (max-width: 700px) {
  .search-bar { grid-template-columns: 1fr 1fr; }
}
