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

:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-alt: #101721;
  --panel: #131b26;
  --panel-2: #0f141c;
  --text: #e6edf7;
  --muted: #98a4b7;
  --accent: #3be1b1;
  --accent-2: #5ca0ff;
  --danger: #ff6b6b;
  --warning: #f7b955;
  --success: #34d399;
  --border: #1f2a3a;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at top left, #1a2331 0%, #0b0f14 55%, #070a10 100%);
  color: var(--text);
  min-height: 100vh;
}

.app {
  display: flex;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.auth-screen::before,
.auth-screen::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(0);
  opacity: 0.4;
}

.auth-screen::before {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(92, 160, 255, 0.35), transparent 70%);
  top: -120px;
  left: -80px;
}

.auth-screen::after {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(59, 225, 177, 0.28), transparent 70%);
  bottom: -180px;
  right: -120px;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: rgba(12, 18, 27, 0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: min(420px, 92vw);
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand h1 {
  font-size: 24px;
}

.auth-brand p {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.field input {
  background: #0c121b;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.auth-note {
  text-align: center;
}

.auth-error {
  color: var(--danger);
  font-size: 12px;
  min-height: 16px;
  text-align: center;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: linear-gradient(160deg, rgba(19, 27, 38, 0.98) 0%, rgba(12, 17, 25, 0.98) 100%);
  border-right: 1px solid var(--border);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #071016;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
}

.brand-text span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 15px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: rgba(92, 160, 255, 0.12);
  border-color: rgba(92, 160, 255, 0.4);
}

.sidebar-footer {
  margin-top: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 225, 177, 0.12);
  border: 1px solid rgba(59, 225, 177, 0.35);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(59, 225, 177, 0.8);
}

.main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 20, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 2px;
}

#page-title {
  font-size: 26px;
  font-weight: 600;
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-info-compact {
  display: none;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 20, 28, 0.7);
  border: 1px solid var(--border);
}

.admin-details {
  text-align: right;
}

.admin-name {
  font-weight: 600;
  display: block;
}

.admin-role {
  font-size: 12px;
  color: var(--muted);
}

.admin-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(140deg, #1f2937, #0f172a);
  display: grid;
  place-items: center;
  font-weight: 600;
  border: 1px solid var(--border);
}

.content {
  padding: 28px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.table-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.table-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.search-input {
  background: #0c121b;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  width: min(320px, 100%);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--muted);
  font-weight: 500;
  background: rgba(10, 15, 22, 0.6);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid transparent;
}

.badge.success {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
}

.badge.warning {
  color: var(--warning);
  border-color: rgba(247, 185, 85, 0.4);
  background: rgba(247, 185, 85, 0.1);
}

.badge.danger {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.1);
}

.btn {
  border: 1px solid transparent;
  background: rgba(92, 160, 255, 0.15);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 13px;
}

.btn.primary {
  background: linear-gradient(135deg, rgba(92, 160, 255, 0.4), rgba(59, 225, 177, 0.35));
  border-color: rgba(92, 160, 255, 0.4);
  font-weight: 600;
  padding: 10px 14px;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(92, 160, 255, 0.5);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.secondary {
  background: rgba(148, 163, 184, 0.12);
}

.btn.danger {
  background: rgba(255, 107, 107, 0.18);
}

.btn.success {
  background: rgba(52, 211, 153, 0.18);
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.event-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.event-meta {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.events-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tab-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 18, 27, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
}

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  transition: 0.2s ease;
}

.tab.active {
  color: var(--text);
  background: rgba(92, 160, 255, 0.2);
}

.event-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.link {
  color: var(--accent-2);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

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

.form-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

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

.form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.form-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  background: #0c121b;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

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

.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #1f2a3a;
  border-radius: 999px;
  transition: 0.2s ease;
  border: 1px solid var(--border);
}

.slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 2px;
  background: var(--text);
  border-radius: 50%;
  transition: 0.2s ease;
}

.switch input:checked + .slider {
  background: rgba(59, 225, 177, 0.35);
  border-color: rgba(59, 225, 177, 0.6);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: var(--accent);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 15, 0.72);
}

.modal-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: 520px;
  width: min(92%, 520px);
  z-index: 2;
  animation: pop 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 18, 27, 0.6);
}

.modal-body {
  padding: 16px;
  display: grid;
  gap: 10px;
  font-size: 14px;
}

.modal-form {
  display: grid;
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-alert {
  background: rgba(92, 160, 255, 0.12);
  border: 1px solid rgba(92, 160, 255, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
}

.modal-alert.danger {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.3);
}

.modal-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-form input,
.modal-form textarea {
  background: #0c121b;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

.modal-body > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.modal-body strong {
  color: var(--text);
  font-weight: 600;
}

.modal-list {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  margin-top: -4px;
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

@keyframes pop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .app {
    flex-direction: column;
  }

  .header .admin-info {
    display: none;
  }

  .admin-info-compact {
    display: flex;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
    z-index: 10;
  }

  .nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .nav-item {
    flex: 0 0 auto;
    text-align: center;
    white-space: nowrap;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .header {
    position: static;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 20px 18px 32px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-info {
    width: 100%;
    justify-content: space-between;
  }

  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

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

  .list-item {
    align-items: flex-start;
  }

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

@media (max-width: 520px) {
  .sidebar {
    padding: 14px;
  }

  .brand {
    justify-content: center;
  }

  .brand-text h1 {
    font-size: 18px;
  }

  .nav-item {
    flex: 1 1 100%;
  }
}
