:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1c2333;
  --muted: #6a7180;
  --accent: #2f7de1;
  --accent-dark: #1e5fb3;
  --border: #e3e6ee;
  --ok: #1f9d55;
  --err: #d0342c;
  --shadow: 0 1px 3px rgba(20, 30, 60, .10), 0 6px 18px rgba(20, 30, 60, .07);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
h1, h2, h3 { margin: 0 0 .3rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: .3rem 0; }
.muted { color: var(--muted); }

header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: .9rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem 1.5rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: .6rem; }
.brand .logo { font-size: 1.7rem; }
.brand h1 { font-size: 1.15rem; }
.brand .tagline { font-size: .8rem; margin: 0; }

.eventsbar { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.eventsbar label { color: var(--muted); font-size: .9rem; }

select, input[type=text], input[type=password] {
  font: inherit;
  padding: .5rem .7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
select { min-width: 16rem; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  font: inherit;
  font-weight: 600;
  padding: .5rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.linklike {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font: inherit; padding: 0; text-decoration: underline;
}

main { max-width: 1160px; margin: 0 auto; padding: 1.4rem 1.2rem 4rem; }

.eventgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.eventcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.eventcard:hover { border-color: var(--accent); }
.eventcard h3 { margin-bottom: .2rem; }
.eventcard .muted { font-size: .85rem; }

.galleryhead {
  display: flex; flex-wrap: wrap; gap: .8rem 1.5rem;
  align-items: flex-end; justify-content: space-between;
  margin-bottom: 1rem;
}
.galleryactions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.photo { position: relative; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.photo img { width: 100%; height: 150px; object-fit: cover; display: block; background: #dfe3ec; cursor: zoom-in; }
.photo .tick {
  position: absolute; top: .4rem; left: .4rem; width: 22px; height: 22px;
  border-radius: 6px; background: rgba(255,255,255,.9); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 14px; color: #fff; font-weight: 700; user-select: none;
}
.photo .tick.on { background: var(--accent); }
.photo .dl-ind {
  position: absolute; right: .4rem; bottom: .4rem; background: rgba(17,24,39,.65);
  color: #fff; border-radius: 6px; padding: .15rem .4rem; font-size: .72rem;
}

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.row { display: flex; gap: .6rem; flex-wrap: wrap; }
.row > select, .row > input { flex: 1 1 15rem; }
.err { color: var(--err); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }

#dropzone {
  border: 2px dashed var(--accent); background: #f0f6ff; border-radius: 12px;
  padding: 2.4rem 1rem; text-align: center; font-weight: 600; color: var(--accent-dark);
  cursor: pointer; margin: .6rem 0;
}
#dropzone.drag { background: #d9e9ff; }
#progress .bar {
  height: 10px; background: var(--border); border-radius: 6px; overflow: hidden; margin-top: .4rem;
}
#progress .fill { height: 100%; width: 0; background: var(--ok); transition: width .2s; }

.sharelink {
  display: block; margin: .4rem 0; padding: .6rem .8rem; background: #eef4ff;
  border: 1px solid #cfe0ff; border-radius: 8px; word-break: break-all; font-size: .88rem;
}

#lightbox {
  position: fixed; inset: 0; background: rgba(10,14,24,.92); z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 2rem 1rem;
}
#lightbox img {
  max-width: 92vw; max-height: 80vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.lbclose { position: absolute; top: 1rem; right: 1.6rem; font-size: 2.6rem; color: #fff; cursor: pointer; line-height: 1; }
#lightbox .btn { background: #fff; color: var(--accent-dark); }
footer { text-align: center; padding: 2rem 1rem 3rem; }

[hidden] { display: none !important; }
@media (max-width: 520px) {
  .eventsbar { margin-left: 0; width: 100%; }
  select { min-width: 0; flex: 1; }
}