:root {
  --bg-0: #05070d;
  --bg-1: #0b1b35;
  --bg-2: #123d70;
  --surface: rgba(13, 28, 52, 0.6);
  --border: rgba(160, 200, 255, 0.16);
  --border-strong: rgba(171, 211, 255, 0.34);
  --ink: #f5f7ff;
  --ink-dim: #c6d6f2;
  --ink-muted: #7e94bd;
  --cool: #4f95ef;
  --warm: #ff9a66;
  --danger: #ff8a8a;
  --success: #6fe3a1;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* .center-screen / .modal-backdrop gibi sınıflar display:flex tanımladığı
   için, aynı özgüllükteki [hidden] kuralı bunu ezemiyor — bu yüzden
   hidden'ı açıkça ve her zaman önceliklendiriyoruz. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-0);
  background-image: linear-gradient(125deg, var(--bg-0), var(--bg-1) 55%, var(--bg-2));
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}

.screen { min-height: 100vh; }
.center-screen { display: flex; align-items: center; justify-content: center; padding: 24px; }

.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: #fff; }

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
}

.panel-kicker {
  color: var(--cool);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 16px 0 20px;
}

.field-label { display: block; color: var(--ink-muted); font-size: 0.78rem; margin: 12px 0 6px; }

.field-input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(6, 18, 35, 0.6);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.field-input:focus { outline: 2px solid var(--cool); outline-offset: 1px; }

textarea.field-input { resize: vertical; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

select.field-input { appearance: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, #1e6fc5, #164b94);
  color: #fff;
  border-color: rgba(134, 199, 255, 0.6);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-dim);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }

.btn-small { padding: 0.55rem 1rem; font-size: 0.82rem; }

.hint-text { color: var(--ink-muted); font-size: 0.76rem; line-height: 1.5; margin-top: 10px; }

.alert {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  line-height: 1.4;
}
.alert-error { background: rgba(255, 138, 138, 0.12); border: 1px solid rgba(255, 138, 138, 0.35); color: #ffb4b4; }
.alert-success { background: rgba(111, 227, 161, 0.12); border: 1px solid rgba(111, 227, 161, 0.35); color: #9df0c0; }
.alert-info { background: rgba(79, 149, 239, 0.12); border: 1px solid rgba(79, 149, 239, 0.3); color: #bcd9ff; }

.spinner {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #fff;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- panel layout ---- */

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.4);
}

.muni-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: #fff; }
.muni-city { color: var(--ink-muted); font-size: 0.78rem; margin-top: 2px; }

.tabs {
  display: flex;
  gap: 8px;
  padding: 16px 24px 0;
  max-width: 760px;
  margin: 0 auto;
}

.tab-btn {
  padding: 0.65rem 1.1rem;
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.tab-btn.active { background: var(--surface); color: #fff; border-color: var(--border-strong); }

.tab-panel { display: none; max-width: 760px; margin: 0 auto; padding: 20px 24px 60px; }
.tab-panel.active { display: block; }

.events-list { display: flex; flex-direction: column; gap: 12px; }

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}

.event-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.event-title { font-weight: 700; color: #fff; font-size: 1rem; margin-bottom: 4px; }
.event-meta { color: var(--ink-muted); font-size: 0.8rem; line-height: 1.6; }
.event-desc { color: var(--ink-dim); font-size: 0.85rem; margin-top: 8px; line-height: 1.5; }

.status-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-active { background: rgba(111, 227, 161, 0.15); color: var(--success); }
.status-inactive { background: rgba(255, 255, 255, 0.08); color: var(--ink-muted); }

.event-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.event-form { display: flex; flex-direction: column; }

/* ---- QR modal ---- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 14, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 340px;
  background: #0c1f3a;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  position: relative;
}

.modal-card h3 { font-family: var(--font-display); color: #fff; margin: 0 0 16px; font-weight: 600; }

.qr-canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  margin: 0 auto;
  width: fit-content;
  min-height: 240px;
  min-width: 240px;
}

.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .panel-header { padding: 14px 16px; }
  .tabs, .tab-panel { padding-left: 16px; padding-right: 16px; }
}

/* Gecmis etkinlik temizleme cubugu */
.past-events-bar {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.past-events-bar:empty {
  margin-top: 0;
}


/* Tehlikeli islem butonu (etkinlik silme) */
.btn-danger {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}
.btn-danger:hover {
  background: #a93226;
  border-color: #a93226;
}
