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

:root {
  --bg: #0f0f0f;
  --bg-alt: #141414;
  --card: #1b1b1b;
  --card-soft: #202020;
  --border: #2c2c2c;
  --accent: #e50914;
  --accent-soft: rgba(229, 9, 20, 0.15);
  --text: #ffffff;
  --muted: #c4c4c4;
  --success: #1ea672;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  background: radial-gradient(1200px 600px at 10% 10%, #1b1b1b 0%, #0f0f0f 55%, #0a0a0a 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: soft-light;
  opacity: 0.4;
  z-index: 0;
}

a {
  color: var(--text);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 250px;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: none;
  flex-direction: column;
  gap: 24px;
}

.sidebar .brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  max-height: 40px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.brand span {
  display: inline-flex;
  align-items: center;
}

.sidebar nav {
  display: grid;
  gap: 14px;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-title {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 6px 2px;
}

.nav-sep {
  height: 1px;
  background: var(--border);
  opacity: 0.6;
}

.sidebar nav a {
  padding: 12px 16px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}

.content {
  flex: 1;
  padding: 18px 16px 84px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 14px;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(15,15,15,0.96), rgba(15,15,15,0.75), rgba(15,15,15,0));
  z-index: 10;
  backdrop-filter: blur(8px);
}

.topbar h1 {
  font-size: 22px;
  margin: 0;
}

h1 {
  font-size: 22px;
  margin: 0 0 6px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  margin: 0 0 6px;
  line-height: 1.25;
}

.section-title {
  margin-top: 16px;
}

h3 {
  font-size: 17px;
  margin: 0 0 4px;
  line-height: 1.25;
}

.badge-counter {
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

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

.popover-header {
  justify-content: space-between;
}

.notification {
  position: relative;
}

.notification-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #1c1c1c;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-popover {
  position: absolute;
  right: 0;
  top: 46px;
  width: min(320px, 90vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: none;
  z-index: 40;
}

.notification-popover.active {
  display: block;
}

.notification-list {
  max-height: 420px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.notification-item {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #1a1a1a;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.notification-item.unread {
  background: rgba(229, 9, 20, 0.12);
  border-color: rgba(229, 9, 20, 0.4);
}

.notification-meta {
  font-size: 12px;
  color: var(--muted);
}

.hero {
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1d1d1d 0%, #151515 100%);
  border: 1px solid var(--border);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  margin-bottom: 14px;
}

.hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.section-gap {
  margin-top: 18px;
}

.card {
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}

.status-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
}

.status-offen .status-bar {
  background: var(--warning);
}

.status-angenommen .status-bar {
  background: var(--success);
}

.status-abgelehnt .status-bar,
.status-storniert .status-bar {
  background: var(--danger);
}

.card[data-status="storniert"] {
  opacity: 0.7;
  filter: grayscale(0.2);
}

.lock-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(229, 9, 20, 0.4);
  background: rgba(229, 9, 20, 0.08);
  color: var(--muted);
  font-size: 13px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #232323;
}

.badge.success {
  color: var(--success);
  border-color: rgba(30, 166, 114, 0.45);
  background: rgba(30, 166, 114, 0.2);
}

.badge.warning {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.2);
}

.badge.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.2);
}

button,
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(229, 9, 20, 0.3);
}

button.secondary,
.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
}

button.ghost,
.btn.ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
}

button.danger,
.btn.danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

form {
  display: grid;
  gap: 12px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #121212;
  color: var(--text);
  font-size: 14px;
  box-sizing: border-box;
}

input[type="date"] {
  font-size: 14px;
  line-height: 1.2;
  height: 44px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.chip.active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chip-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}

.chip-bar .chip {
  scroll-snap-align: start;
  white-space: nowrap;
}

.search-form {
  display: grid;
  gap: 10px;
}

.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: 22px 22px 0 0;
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.modal-header {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-handle {
  width: 46px;
  height: 4px;
  border-radius: 999px;
  background: #3a3a3a;
  margin: 8px auto 0;
}

.modal-body {
  padding: 18px 20px 24px;
  overflow-y: auto;
  max-height: 75vh;
  display: grid;
  gap: 16px;
}

.modal-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #1f1f1f;
  font-size: 13px;
  cursor: pointer;
}

.modal-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.toast-container {
  position: fixed;
  right: 16px;
  top: 18px;
  display: grid;
  gap: 10px;
  z-index: 100;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.db-status-indicator {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 999px;
  z-index: 9999;
  box-shadow: var(--shadow);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 20, 20, 0.85);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 8px 6px calc(12px + env(safe-area-inset-bottom));
  backdrop-filter: blur(10px);
  z-index: 20;
}

.bottom-nav a,
.bottom-nav button {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  background: transparent;
  border: none;
  padding: 10px 6px;
  cursor: pointer;
  position: relative;
}

.bottom-nav a.active,
.bottom-nav button.active {
  color: var(--text);
}

.bottom-nav a.active::after,
.bottom-nav button.active::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.calendar-controls {
  position: relative;
  z-index: 5;
}

.calendar-controls .search-bar {
  flex-wrap: wrap;
}

.calendar-controls .search-bar > * {
  flex: 1 1 140px;
}

.calendar-controls select,
.calendar-controls input,
.calendar-controls button {
  min-height: 46px;
}

.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: flex-end;
  z-index: 45;
}

.bottom-sheet-overlay.active {
  display: flex;
}

.bottom-sheet {
  width: 100%;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(0);
}

.bottom-sheet::before {
  content: '';
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: #3a3a3a;
  margin: 2px auto 12px;
}

.bottom-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.bottom-sheet-list {
  display: grid;
  gap: 10px;
}

.bottom-sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.bottom-sheet-item.active,
.bottom-sheet-item[href*="/profile.php"] {
  border-color: rgba(229, 9, 20, 0.45);
  background: rgba(229, 9, 20, 0.12);
}

.bottom-sheet-item.danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
  margin-top: 8px;
  background: rgba(239, 68, 68, 0.08);
}

.fab {
  position: fixed;
  right: 20px;
  bottom: 90px;
  background: var(--accent);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 16px 30px rgba(229, 9, 20, 0.35);
  z-index: 22;
}

.table-meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.event-page {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.event-hero {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.event-hero-card {
  background: linear-gradient(135deg, #1b1b1b 0%, #0f0f0f 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  display: grid;
  gap: 10px;
}

.event-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-emoji {
  font-size: 24px;
  line-height: 1;
}

.section-card {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.section-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
}

.status-card {
  background: linear-gradient(120deg, rgba(229, 9, 20, 0.08), rgba(0, 0, 0, 0));
}

.status-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.status-step {
  border: 1px dashed rgba(229, 9, 20, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-step.done {
  border-style: solid;
  color: #ffffff;
  background: rgba(30, 166, 114, 0.18);
  border-color: rgba(30, 166, 114, 0.5);
}

.status-step.current {
  border-style: solid;
  color: #ffffff;
  background: rgba(229, 9, 20, 0.25);
  border-color: rgba(229, 9, 20, 0.7);
  box-shadow: 0 0 18px rgba(229, 9, 20, 0.35);
}

.countdown-card {
  text-align: center;
}

.countdown-text {
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.countdown-tile {
  background: rgba(229, 9, 20, 0.12);
  border: 1px solid rgba(229, 9, 20, 0.4);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.countdown-tile strong {
  display: block;
  font-size: 20px;
  color: #fff;
  margin-bottom: 4px;
  animation: beat-pulse 1.2s ease-in-out;
}

.countdown-tile span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

@keyframes beat-pulse {
  0% {
    transform: scale(0.94);
    opacity: 0.75;
  }
  60% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.dj-hero .event-hero-card {
  background: linear-gradient(135deg, #181818 0%, #121212 100%);
}

.dj-card .table-meta span {
  font-size: 13px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px;
}

.calendar-cell {
  min-height: 80px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 7px;
  font-size: 12px;
  background: #161616;
}

.calendar-cell.has-event {
  border-color: rgba(229, 9, 20, 0.35);
}

.calendar-date {
  font-weight: 600;
  margin-bottom: 6px;
}

@media (min-width: 980px) {
  .sidebar {
    display: flex;
  }
  .content {
    padding: 26px 32px 36px;
  }
  .modal {
    border-radius: 24px;
    max-height: 88vh;
  }
  .modal-overlay {
    align-items: center;
  }
  .bottom-nav {
    display: none;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .content {
    padding: 16px 16px 110px;
  }

  .hero,
  .event-hero-card,
  .card,
  .section-card {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 8px 0 12px;
  }

  input,
  select,
  textarea,
  button {
    min-height: 44px;
  }

  form button,
  .btn {
    width: 100%;
  }

  .status-steps {
    display: grid;
    gap: 10px;
  }

  .status-step {
    justify-content: flex-start;
    padding: 10px 12px;
    text-align: left;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .countdown-tile {
    padding: 12px;
  }

  .event-hero-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .bottom-nav {
    padding: 6px 6px calc(10px + env(safe-area-inset-bottom));
  }
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
  min-height: 44px;
}

.back-button:hover {
  background: var(--card);
}
