/* ================================
   GLOBAL THEME (DARK MODE)
================================ */
:root {
  --bg-main: #0d0f12;
  --bg-panel: #15181d;
  --bg-elevated: #1c2027;

  --text-main: #e6e9ee;
  --text-muted: #9aa3af;

  --border-soft: #2a2f38;

  --primary: #4caf50;
  --accent: #2196f3;
  --danger: #e53935;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-soft: 0 6px 20px rgba(0,0,0,0.4);
  --shadow-hard: 0 10px 30px rgba(0,0,0,0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background: radial-gradient(circle at top, #12151b, var(--bg-main));
  color: var(--text-main);
}

/* ================================
   NAVIGATION
================================ */
.main-nav {
  background: linear-gradient(180deg, #12151b, #0b0d11);
  padding: 14px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-hard);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.main-nav button {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.main-nav button:hover {
  background: var(--bg-elevated);
  border-color: var(--primary);
  transform: translateY(-1px);
}
/* ================================
   ADMIN DROPDOWN – FINAL, FINAL FIX
================================ */

.nav-dropdown {
  position: relative;
  display: inline-block;
}

/* Admin-knapp */
.nav-dropdown > button {
  position: relative;
  z-index: 2;
}

/* Dropdown-meny */
.nav-dropdown .dropdown-content {
  position: absolute;
  top: 100%;           /* starter rett under knappen */
  left: 0;
  min-width: 220px;

  display: none;

  background: #15181d;
  border: 1px solid #2a2f38;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);

  z-index: 1;
}

/* 🔥 HOVER PÅ HELE CONTAINEREN */
.nav-dropdown:hover .dropdown-content {
  display: block;
}

/* 🔥 USYNLIG BRO SOM FJERNER HOVER-GAP */
.nav-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

/* Meny-elementer */
.nav-dropdown .dropdown-content a {
  display: block;
  padding: 12px 16px;
  color: #e6e9ee;
  text-decoration: none;
}

.nav-dropdown .dropdown-content a:hover {
  background: #1c2027;
}



/* ================================
   PAGE LAYOUT
================================ */
.page {
  display: none;
  padding: 24px;
  flex: none;          /* 🔥 VIKTIG */
  align-self: flex-start;
}

.page.active {
  display: block;
}


/* ================================
   CARDS / PANELS
================================ */
.card {
  background: linear-gradient(180deg, var(--bg-panel), #12151b);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
}

/* ================================
   TABLES
================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  background: var(--bg-panel);
  border-radius: var(--radius-md);
  overflow: hidden;
}

th {
  background: #101319;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}

tr:hover td {
  background: #141821;
}

/* ================================
   FORMS
================================ */
.register-form {
  max-width: 440px;
  background: var(--bg-panel);
  padding: 22px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard);
}

.field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.field-row {
  display: flex;
  gap: 14px;
}

label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

input,
textarea,
select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: #6b7280;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(76,175,80,0.2);
}

/* ================================
   BUTTONS
================================ */
button,
.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

button:hover,
.primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: var(--shadow-hard);
}

.danger-btn {
  background: linear-gradient(135deg, #e53935, #8e0000);
}

/* ================================
   SEATING
================================ */
#seatingGrid {
  position: relative;
  z-index: 10;
}

.seat {
  padding: 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  user-select: none;
  background: #1a1f26;
  border: 1px solid var(--border-soft);
}

.seat.empty:hover {
  background: #2a303b;
}

.seat.occupied {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

.seat.occupied:hover {
  filter: brightness(1.1);
  outline: 2px solid white;
}

/* ================================
   STATUS COLORS
================================ */
.status-in {
  color: #66bb6a;
  font-weight: 600;
}

.status-out {
  color: #ef5350;
  font-weight: 600;
}

/* ================================
   DASHBOARD CHART 
================================ */

.chart-wrapper {
  width: 320px;
  height: 320px;

  margin: 12px auto 0;
  padding: 12px;

  background: #0f1318;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);

  display: block;
  position: relative;   /* 🔥 stabiliserer flow */
}


#checkinChart {
  width: 100% !important;
  height: 100% !important;
  display: block;
}


/* ================================
   QR FEEDBACK
================================ */
.qr-flash-success {
  animation: qrFlashGreen 2s ease;
}

@keyframes qrFlashGreen {
  0% { background-color: rgba(76, 175, 80, 0.9); }
  100% { background-color: transparent; }
}
