:root {
  --bg: #0e0b16;
  --bg-2: #171226;
  --card: #1d1730;
  --card-2: #251d3d;
  --line: #322a4d;
  --text: #ece9f5;
  --muted: #a99fc4;
  --primary: #ff4d8d;
  --primary-2: #ff6fa3;
  --accent: #7c5cff;
  --good: #2fd7a0;
  --danger: #ff5b6a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #2a1b45 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding-top: 26px; padding-bottom: 60px; }
.muted { color: var(--muted); }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(14,11,22,.82);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-weight: 800; font-size: 1.35rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { margin-right: 4px; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--muted); font-weight: 600; font-size: .95rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav-user { color: var(--muted); font-size: .9rem; }
.inline { display: inline; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  font-weight: 700; font-size: .95rem; padding: 10px 18px;
  transition: transform .05s ease, filter .15s ease, background .15s ease;
  font-family: inherit; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 6px 18px rgba(255,77,141,.28); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--card-2); }
.btn-danger { background: transparent; border-color: #5a2733; color: var(--danger); }
.btn-danger:hover { background: rgba(255,91,106,.12); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }

/* flashes */
.flashes { margin-bottom: 18px; display: grid; gap: 8px; }
.flash { padding: 11px 14px; border-radius: 10px; font-weight: 600; border: 1px solid var(--line); }
.flash-success { background: rgba(47,215,160,.12); border-color: #1f5f4d; color: #7ff0cf; }
.flash-error { background: rgba(255,91,106,.12); border-color: #5a2733; color: #ffb3ba; }

/* hero */
.hero { padding: 22px 0 12px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.03em; background: linear-gradient(120deg, #fff, #ffb3d0 40%, #b7a4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.12rem; max-width: 620px; }

/* day strip */
.daystrip { display: flex; gap: 10px; overflow-x: auto; padding: 14px 0 8px; }
.day {
  flex: 0 0 auto; width: 66px; text-align: center; padding: 10px 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  color: var(--muted); display: grid; gap: 2px;
}
.day:hover { text-decoration: none; border-color: var(--accent); color: var(--text); }
.day-dow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.day-num { font-size: 1.35rem; font-weight: 800; color: var(--text); }
.day-mon { font-size: .7rem; text-transform: uppercase; }
.day-active { background: linear-gradient(135deg, var(--primary), var(--accent)); border-color: transparent; color: #fff; }
.day-active .day-num, .day-active .day-dow, .day-active .day-mon { color: #fff; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 4px; }
.filters input, .filters select {
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: .92rem; font-family: inherit;
}
.filters input:focus, .filters select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.25); }
.filter-search { flex: 1 1 240px; min-width: 180px; }

/* map */
.map { height: 320px; border-radius: var(--radius); border: 1px solid var(--line); margin: 18px 0 4px; z-index: 1; }
.map .leaflet-popup-content a { color: var(--primary); }
.hint { font-size: .8rem; margin: -4px 0 0; }

/* section heads */
.section-head { margin: 26px 0 14px; }
.section-head h1, .section-head h2 { font-size: 1.4rem; }

/* grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .12s ease, border-color .12s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card-body { padding: 15px 16px; }
.card-title { font-size: 1.12rem; margin-bottom: 4px; }
.card-title a { color: var(--text); }
.card-meta { color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.card-when { font-size: .92rem; margin: 4px 0; }
.card-price { display: inline-block; font-weight: 700; color: var(--good); font-size: .9rem; }
.card-going { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }

/* tags */
.tag { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; margin-bottom: 8px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.tag-happy_hour { color: #ffd27f; border-color: #6b5320; }
.tag-live_music { color: #9db4ff; border-color: #33417a; }
.tag-trivia { color: #7ff0cf; border-color: #1f5f4d; }
.tag-karaoke { color: #ff9de0; border-color: #7a3468; }
.tag-dj { color: #c6a3ff; border-color: #4a367a; }
.tag-sports { color: #7fe0a0; border-color: #2c6b45; }
.tag-comedy { color: #ffc078; border-color: #6b4a20; }

/* bar cards / hero */
.bar-img { height: 130px; background-size: cover; background-position: center; }
.bar-img-ph { display: flex; align-items: center; justify-content: center; font-size: 2.4rem; background: var(--card-2); }
.bar-hero { display: grid; gap: 18px; margin-bottom: 10px; }
.bar-hero-img { height: 220px; border-radius: var(--radius); background-size: cover; background-position: center; border: 1px solid var(--line); }
.bar-hero h1 { font-size: 2rem; }
.bar-desc { max-width: 640px; }

/* event detail */
.event-detail { max-width: 640px; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); }
.event-detail h1 { font-size: 2rem; }
.event-when { font-size: 1.05rem; color: var(--text); }
.event-price { font-weight: 800; color: var(--good); }
.event-desc { color: var(--text); }
.event-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; }

/* empty */
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); }
.error-page h1 { font-size: 3rem; }

/* auth / forms */
.auth { max-width: 460px; margin: 10px auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px; box-shadow: var(--shadow); }
.auth h1 { font-size: 1.6rem; }
.form { display: grid; gap: 14px; margin-top: 8px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.form input, .form select, .form textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: 1rem; font-family: inherit;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.25); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.auth-alt { text-align: center; margin-top: 16px; color: var(--muted); }

/* role toggle */
.role-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.role { position: relative; display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--bg-2); }
.role input { position: absolute; opacity: 0; }
.role strong { color: var(--text); font-size: .95rem; }
.role span { color: var(--muted); font-size: .78rem; }
.role-on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,77,141,.2); }

/* dashboard */
.dash-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 20px; flex-wrap: wrap; gap: 12px; }
.dash-actions { display: flex; gap: 10px; }
.dash-section { margin-bottom: 34px; }
.dash-section h2 { font-size: 1.25rem; margin-bottom: 12px; }
.row-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row-actions form { display: inline; }

/* table */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: middle; }
.table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.table tr:last-child td { border-bottom: none; }
.table .tag { margin: 0 8px 0 0; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: .88rem; }

@media (max-width: 560px) {
  .role-toggle { grid-template-columns: 1fr; }
  .nav { gap: 12px; }
  .nav-user { display: none; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .table td { border: none; padding: 6px 14px; }
}
