@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #080b16;
  --bg2: #0f1225;
  --bg3: #1a1f36;
  --bg4: #252b47;
  --accent: #1D93D2;
  --accent-hover: #1578B0;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f97316;
  --blue: #3b82f6;
  --purple: #a855f7;
  --sidebar-w: 260px;
  --radius: 10px;
}

html, body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Layout */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); background: var(--bg2);
  border-right: 1px solid var(--bg3); display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-header {
  padding: 20px; border-bottom: 1px solid var(--bg3);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo { font-size: 24px; font-weight: 800; color: var(--accent); }
.sidebar-title { font-size: 14px; color: var(--text2); }

.sidebar-nav { flex: 1; padding: 12px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: var(--text2); cursor: pointer; font-size: 14px;
  font-weight: 500; transition: all .15s; border: none; background: none;
  width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: rgba(245,158,11,0.1); color: var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--bg3); font-size: 12px; color: var(--text2);
}

.festival-select {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--bg3);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 13px;
  margin: 12px 0; outline: none; cursor: pointer;
}
.festival-select:focus { border-color: var(--accent); }

/* Main content */
.main { margin-left: var(--sidebar-w); flex: 1; padding: 24px 32px; }

/* Header */
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }
.festival-info { font-size: 13px; color: var(--text2); }

/* Day filters */
.day-filters { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.day-btn {
  padding: 6px 16px; border-radius: 20px; border: 1px solid var(--bg3);
  background: var(--bg2); color: var(--text2); cursor: pointer; font-size: 13px;
  font-family: inherit; transition: all .15s;
}
.day-btn:hover { border-color: var(--accent); color: var(--text); }
.day-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Stats bar */
.stats-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--bg3); border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.stat-card .icon { font-size: 20px; margin-bottom: 4px; }
.stat-card .value { font-size: 28px; font-weight: 700; }
.stat-card .label { font-size: 12px; color: var(--text2); margin-top: 2px; }
.stat-card.accent .value { color: var(--accent); }
.stat-card.green .value { color: var(--green); }
.stat-card.red .value { color: var(--red); }
.stat-card.blue .value { color: var(--blue); }
.stat-card.purple .value { color: var(--purple); }

/* Tab content */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  padding: 10px 12px; text-align: left; font-weight: 600; color: var(--text2);
  border-bottom: 1px solid var(--bg3); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.5px;
}
tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--bg3);
  transition: background .1s;
}
tbody tr:hover td { background: var(--bg2); }

/* Badges */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-green { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-orange { background: rgba(249,115,22,0.12); color: var(--orange); }
.badge-red { background: rgba(239,68,68,0.12); color: var(--red); }
.badge-blue { background: rgba(59,130,246,0.12); color: var(--blue); }
.badge-purple { background: rgba(168,85,247,0.12); color: var(--purple); }

/* Checklist icons */
.check-ok { color: var(--green); font-weight: 700; }
.check-partial { color: var(--orange); font-weight: 700; }
.check-missing { color: var(--red); font-weight: 700; }

/* Bar chart */
.bar-chart { margin: 20px 0; }
.bar-row { display: flex; align-items: center; margin-bottom: 8px; gap: 12px; }
.bar-label { width: 140px; font-size: 13px; text-align: right; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-fill-container { flex: 1; height: 28px; background: var(--bg3); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; display: flex; align-items: center; padding-left: 8px; font-size: 12px; font-weight: 600; color: #fff; min-width: 40px; transition: width .5s ease; }

/* Cards */
.card {
  background: var(--bg2); border: 1px solid var(--bg3); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
.card h3 { margin-bottom: 12px; font-size: 16px; }

/* Big number */
.big-number { font-size: 48px; font-weight: 800; color: var(--accent); text-align: center; padding: 20px 0; }
.big-label { font-size: 14px; color: var(--text2); text-align: center; }

/* Export cards */
.export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.export-card {
  background: var(--bg2); border: 1px solid var(--bg3); border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer; transition: all .2s;
}
.export-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.export-card .icon { font-size: 32px; margin-bottom: 12px; }
.export-card h3 { font-size: 16px; margin-bottom: 4px; }
.export-card p { font-size: 13px; color: var(--text2); }

/* Alerts */
.alert-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; background: var(--bg2); border-radius: var(--radius);
  margin-bottom: 8px; border-left: 3px solid;
}
.alert-item.critical { border-left-color: var(--red); }
.alert-item.warning { border-left-color: var(--orange); }
.alert-item.info { border-left-color: var(--blue); }
.alert-icon { font-size: 18px; flex-shrink: 0; }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; font-size: 14px; }
.alert-desc { font-size: 13px; color: var(--text2); margin-top: 2px; }

/* Search */
.search-bar {
  padding: 10px 16px 10px 40px; width: 300px; border-radius: 8px;
  border: 1px solid var(--bg3); background: var(--bg2); color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.598.854a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center;
}
.search-bar:focus { border-color: var(--accent); }

/* Buttons */
.btn {
  padding: 8px 20px; border-radius: 8px; border: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { color: var(--text); background: var(--bg3); }

/* Modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--bg3); border-radius: 16px;
  padding: 28px; max-width: 560px; width: 90%; max-height: 85vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 16px; font-size: 18px; }
.modal img { width: 100%; border-radius: 8px; margin-bottom: 16px; }

/* Login */
.login-overlay {
  position: fixed; inset: 0; background: var(--bg); z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.login-box { text-align: center; }
.login-box h1 { font-size: 28px; margin-bottom: 4px; }
.login-box .subtitle { color: var(--text2); margin-bottom: 32px; }
.login-box input {
  width: 280px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--bg3);
  background: var(--bg2); color: var(--text); font-size: 16px; font-family: inherit;
  outline: none; display: block; margin: 0 auto 12px;
}
.login-box input:focus { border-color: var(--accent); }
.login-box .btn { width: 280px; padding: 12px; }

/* Utility */
.hidden { display: none !important; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.text-muted { color: var(--text2); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Beheer tab */
.beheer-form .form-row {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.beheer-form .form-group { flex: 1; min-width: 150px; }
.beheer-form label {
  display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px;
}
.beheer-form input[type="text"],
.beheer-form input[type="date"] {
  width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--bg3);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 14px; outline: none;
}
.beheer-form input:focus { border-color: var(--accent); }

.beheer-festival-card {
  padding: 16px; border: 1px solid var(--bg3); border-radius: var(--radius);
  margin-bottom: 12px; background: var(--bg);
}
.beheer-users { margin-top: 8px; }
.beheer-assigned { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.beheer-user-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  background: rgba(29,147,210,0.12); color: var(--accent); border-radius: 16px;
  font-size: 13px; font-weight: 500;
}
.beheer-user-chip button {
  background: none; border: none; color: var(--text2); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0 2px;
}
.beheer-user-chip button:hover { color: var(--red); }
.beheer-add-user { display: flex; gap: 8px; align-items: center; }
.beheer-user-select {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--bg3);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 13px;
  outline: none; flex: 1; max-width: 250px;
}
.beheer-user-select:focus { border-color: var(--accent); }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { width: 220px; }
  .main { margin-left: 220px; padding: 16px; }
  .stats-bar { grid-template-columns: repeat(3, 1fr); }
  .export-grid { grid-template-columns: 1fr; }
}
