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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ============================================================
   Login
   ============================================================ */
.login-box {
  max-width: 360px;
  margin: 20vh auto;
  padding: 2rem;
  text-align: center;
}

.login-box h1 { margin-bottom: 0.5rem; font-size: 1.6rem; letter-spacing: 0.1em; }
.login-box p.subtitle { color: #888; margin-bottom: 1.5rem; font-size: 0.85rem; }

.login-box input {
  width: 100%;
  padding: 0.7rem;
  margin-bottom: 0.8rem;
  background: #16213e;
  border: 1px solid #533483;
  color: #e0e0e0;
  border-radius: 4px;
  font-size: 0.95rem;
}

.login-box input:focus { outline: none; border-color: #e94560; }
.message { margin-top: 1rem; color: #888; font-size: 0.9rem; }

/* ============================================================
   Buttons
   ============================================================ */
button, .btn-primary, .btn-secondary, .btn-danger {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary { background: #e94560; color: #fff; font-weight: 600; }
.btn-primary:hover { background: #d63851; }
.btn-secondary { background: #533483; color: #e0e0e0; }
.btn-secondary:hover { background: #6a45a0; }
.btn-danger { background: #611; color: #fcc; }
.btn-danger:hover { background: #822; }
.btn-full { width: 100%; margin-top: 0.5rem; }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn-icon { background: none; color: #888; padding: 0.3rem; font-size: 1rem; }
.btn-icon:hover { color: #e0e0e0; }

/* ============================================================
   Layout: Sidebar + Content
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: #16213e;
  border-right: 1px solid #0f3460;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 1.2rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-bottom: 1px solid #0f3460;
  color: #e94560;
}

.sidebar-nav { flex: 1; padding: 0.5rem 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  color: #a0a0b0;
  text-decoration: none;
  font-size: 0.85rem;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-nav a:hover { background: #1a1a2e; color: #e0e0e0; }
.sidebar-nav a.active { background: #1a1a2e; color: #e94560; border-left-color: #e94560; }
.sidebar-nav a .nav-icon { font-size: 1rem; width: 1.2rem; text-align: center; }

.sidebar-bottom {
  padding: 1rem;
  border-top: 1px solid #0f3460;
}

.sidebar-bottom button {
  width: 100%;
  background: transparent;
  color: #888;
  border: 1px solid #333;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.sidebar-bottom button:hover { color: #e0e0e0; border-color: #555; }

/* Content area */
.content {
  margin-left: 220px;
  flex: 1;
  padding: 1.5rem 2rem;
  min-height: 100vh;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.content-header h1 { font-size: 1.4rem; }
.content-actions { display: flex; gap: 0.5rem; align-items: center; }

/* Hamburger (mobile) */
.hamburger {
  display: none;
  position: fixed;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 200;
  background: #16213e;
  border: 1px solid #0f3460;
  color: #e0e0e0;
  font-size: 1.4rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}

/* ============================================================
   Cards & Sections
   ============================================================ */
.card {
  background: #0f3460;
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.card h2 { font-size: 1rem; margin-bottom: 0.8rem; color: #e0e0e0; }
.card h3 { font-size: 0.9rem; margin-bottom: 0.5rem; color: #a0a0b0; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #0f3460;
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.stat-card:hover { transform: translateY(-2px); background: #133a6b; }
.stat-card .stat-number { font-size: 2rem; font-weight: 700; color: #e94560; }
.stat-card .stat-label { font-size: 0.8rem; color: #a0a0b0; margin-top: 0.3rem; }

/* Quick links */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-links a {
  padding: 0.5rem 1rem;
  background: #533483;
  color: #e0e0e0;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.quick-links a:hover { background: #6a45a0; }

/* ============================================================
   Forms
   ============================================================ */
.form-group {
  margin-bottom: 0.8rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: #a0a0b0;
  margin-bottom: 0.3rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  background: #16213e;
  border: 1px solid #533483;
  color: #e0e0e0;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #e94560;
}

.form-group small { color: #666; font-size: 0.75rem; }
.form-row { display: flex; gap: 0.8rem; }
.form-row .form-group { flex: 1; }

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #333;
  border-radius: 26px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #e0e0e0;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider { background: #e94560; }
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); }

/* Big toggle */
.big-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.big-toggle .toggle { width: 56px; height: 30px; }
.big-toggle .toggle-slider::before { height: 24px; width: 24px; }
.big-toggle .toggle input:checked + .toggle-slider::before { transform: translateX(26px); }
.big-toggle-label { font-size: 1rem; font-weight: 600; }

/* Upload zone */
.upload-zone {
  border: 2px dashed #533483;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  color: #666;
  transition: border-color 0.2s, color 0.2s;
  cursor: pointer;
}

.upload-zone.dragover { border-color: #e94560; color: #e0e0e0; }
.upload-zone input[type="file"] { display: none; }

.upload-preview {
  margin-top: 0.8rem;
}

.upload-preview img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 4px;
  border: 1px solid #333;
}

.progress-bar {
  height: 3px;
  background: #333;
  border-radius: 2px;
  margin: 4px 0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #e94560;
  border-radius: 2px;
  transition: width 0.2s;
  width: 0%;
}

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  background: #16213e;
  color: #a0a0b0;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #0f3460;
}

tbody tr { transition: background 0.1s; }
tbody tr:nth-child(even) { background: rgba(15, 52, 96, 0.3); }
tbody tr:hover { background: rgba(83, 52, 131, 0.2); }
tbody tr.past-date { opacity: 0.5; }

td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(15, 52, 96, 0.5);
  vertical-align: middle;
}

td .actions { display: flex; gap: 0.3rem; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-show { background: #533483; color: #d0b0ff; }
.badge-festival { background: #0f3460; color: #60a0ff; }
.badge-album { background: #1a4060; color: #80c0ff; }
.badge-ep { background: #304060; color: #90b0d0; }
.badge-single { background: #403060; color: #c0a0e0; }
.badge-split { background: #503040; color: #e0a0c0; }
.badge-clothing { background: #404030; color: #d0d090; }
.badge-accessory { background: #304040; color: #90d0d0; }
.badge-vinyl { background: #403040; color: #d090d0; }
.badge-cd { background: #304050; color: #90b0e0; }
.badge-other { background: #333; color: #aaa; }
.badge-sold-out { background: #611; color: #faa; }
.badge-available { background: #163016; color: #8f8; }
.badge-active { background: #163016; color: #8f8; }
.badge-inactive { background: #333; color: #888; }

/* ============================================================
   Draggable Lists
   ============================================================ */
.drag-list { list-style: none; }

.drag-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 4px;
  margin-bottom: 4px;
  transition: background 0.1s, opacity 0.15s;
}

.drag-item:hover { background: #1a2a4e; }
.drag-item.dragging { opacity: 0.4; }
.drag-item.drag-over { border-color: #e94560; }

.drag-handle {
  cursor: grab;
  color: #555;
  font-size: 1.1rem;
  padding: 0 4px;
  user-select: none;
}

.drag-handle:active { cursor: grabbing; }

.drag-item-content { flex: 1; min-width: 0; }
.drag-item-content .title { font-size: 0.9rem; font-weight: 500; }
.drag-item-content .subtitle { font-size: 0.75rem; color: #888; margin-top: 2px; }
.drag-item-actions { display: flex; gap: 0.3rem; }

.drag-item .thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  background: #0f3460;
}

/* ============================================================
   Modals
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 1.5rem;
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 { font-size: 1rem; }

.modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
}

.modal-close:hover { color: #e0e0e0; }

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1.2rem;
  gap: 0.5rem;
}

.modal-actions .right { margin-left: auto; display: flex; gap: 0.5rem; }

/* ============================================================
   Toast Notifications
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.7rem 1.2rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #fff;
  pointer-events: auto;
  animation: toast-in 0.3s ease;
  max-width: 360px;
}

.toast-success { background: #1a6030; border-left: 3px solid #4caf50; }
.toast-error { background: #601a1a; border-left: 3px solid #f44336; }
.toast-info { background: #0f3460; border-left: 3px solid #2196f3; }

.toast.fade-out { animation: toast-out 0.3s ease forwards; }

@keyframes toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ============================================================
   Build page
   ============================================================ */
.build-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
}

.status-dot.ready { background: #4caf50; }
.status-dot.building { background: #ff9800; animation: pulse 1s infinite; }
.status-dot.error { background: #f44336; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .hamburger { display: block; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open { transform: translateX(0); }

  .content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 3.5rem;
  }

  .form-row { flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal { width: 95vw; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .content-header { flex-direction: column; align-items: flex-start; }
}
