:root {
  --paper: #f3eee4;
  --card: #fbf8f2;
  --ink: #13252f;
  --muted: #5d6d74;
  --sea: #1a5f68;
  --line: rgba(19, 37, 47, 0.12);
  --ok: #2c6a4a;
  --danger: #8f2d2d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", sans-serif;
}
a { color: var(--sea); }
img { max-width: 100%; }
.top, .foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.2rem;
}
.top { border-bottom: 1px solid var(--line); background: rgba(251,248,242,.9); position: sticky; top: 0; }
.brand { display: flex; gap: .6rem; align-items: center; color: inherit; text-decoration: none; font-weight: 650; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
nav { display: flex; flex-wrap: wrap; gap: .35rem .8rem; }
nav a { text-decoration: none; color: var(--ink); font-size: .92rem; }
nav a.on { color: var(--sea); font-weight: 700; }
main { width: auto; margin: 0; padding: 1.25rem 1.5rem 2.5rem; }
.foot { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
h1, h2 { font-family: Palatino, Georgia, serif; font-weight: 560; letter-spacing: -.02em; margin: 0 0 .4rem; }
.kicker { letter-spacing: .16em; text-transform: uppercase; font-size: .72rem; color: var(--muted); }
.hero {
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 1rem;
  align-items: stretch;
}
.hero-photo {
  min-height: 280px;
  border-radius: 28px;
  background: #1c3542 center/cover no-repeat;
  position: relative;
  overflow: hidden;
  color: #f6f3ec;
}
.hero-photo .copy { position: absolute; inset: auto 0 0 0; padding: 1.4rem; background: linear-gradient(transparent, rgba(10,20,26,.72)); }
.cards { display: grid; gap: .7rem; }
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1rem 1.1rem;
}
.card h2 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.btn, button, .btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--sea);
  background: var(--sea);
  color: #f6f3ec;
  padding: .55rem 1rem;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.btn.ghost, button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger, button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
label { display: block; font-size: .85rem; margin: .7rem 0 .25rem; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: .6rem .7rem;
  font: inherit;
  color: inherit;
}
input[type="checkbox"] { width: auto; margin-right: .4rem; }
.grid { display: grid; gap: .8rem 1rem; grid-template-columns: 1fr 1fr; }
.grid .full { grid-column: 1 / -1; }
.flash { padding: .7rem 1rem; border-radius: 12px; background: #e7f3ec; }
.flash.err { background: #f8e8e8; color: var(--danger); }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 16px; overflow: hidden; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: top; }
th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.row-actions .btn, .row-actions button { width: auto; }
.badge { display: inline-block; border-radius: 999px; padding: .1rem .5rem; background: #e4eeec; font-size: .78rem; }
.badge.ansokan { background: #f3e6cf; }
.badge.raderad, .badge.uttrad { background: #f0e4e4; }
.receipt { background: rgba(44,106,74,.1); border: 1px solid rgba(44,106,74,.3); border-radius: 16px; padding: 1rem; }
.file {
  border: 1.5px dashed var(--sea);
  background: #e4eeec;
  border-radius: 16px;
  padding: .9rem;
}
.file strong { display: block; margin-bottom: .3rem; }
.search { max-width: 22rem; }

body.is-admin { background: var(--paper); }
body.is-admin .flash { margin-bottom: 1rem; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 16rem minmax(0, 1fr); }
.admin-side {
  background: #13252f;
  color: #f6f3ec;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem 1.1rem;
  min-height: 100vh;
  position: sticky;
  top: 0;
}
.admin-brand { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; margin: .2rem .35rem 1.6rem; }
.admin-brand img, .admin-brand .mark {
  width: 42px; height: 42px; border-radius: 999px; object-fit: contain;
  display: grid; place-items: center; background: #f6f3ec; font-size: .72rem; padding: 4px;
}
.logo-preview, .stage-brand img { background: #fff; object-fit: contain; border-radius: 12px; }
.logo-preview { height: 72px; width: auto; max-width: 220px; padding: 6px; border: 1px solid var(--line); }
.forgot { text-align: center; margin: .15rem 0 0; }
.forgot a { color: var(--sea); font-size: .92rem; text-decoration: none; }
.forgot a:hover { text-decoration: underline; }
.stage-photo.is-plain::after { background: linear-gradient(160deg, #1c3d4a 0%, #13252f 70%); }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; margin: .4rem 0 1rem; }
.pick-label { margin: 0; font-weight: 650; }
.pick-card {
  position: relative; display: block; width: 14rem; min-height: 12rem; overflow: hidden;
  border: 2px dashed rgba(27, 77, 92, .45); border-radius: 16px; background: #f7f4ee; cursor: pointer;
}
.pick-card.is-wide { width: 100%; max-width: 40rem; height: 15rem; }
.pick-card input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}
.pick-img { display: block; width: 14rem; height: 12rem; object-fit: contain; background: #fff; padding: .8rem .8rem 3.4rem; }
.pick-card.is-wide .pick-img.wide {
  position: absolute; inset: 0 0 3rem 0; width: 100%; height: auto; max-width: none;
  object-fit: cover; padding: 0; background: #d7e2e4;
}
.pick-empty { display: grid; height: 12rem; place-items: center; color: var(--muted); padding-bottom: 2.4rem; }
.pick-btn {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3rem;
  display: flex; align-items: center; justify-content: center;
  background: #13252f; color: #f6f3ec; font-weight: 650;
}
.qr-box { margin-top: 1rem; background: var(--paper); border-radius: 16px; padding: 1rem; text-align: center; }
.qr-box img { width: 11rem; height: auto; background: #fff; border-radius: 8px; }
.qr-box p { margin: .7rem 0 0; }
.checkline { display: flex; align-items: center; gap: .55rem; margin: .8rem 0; font-weight: 600; }
.checkline input { width: auto; }
.hero-preview { height: 92px; width: auto; max-width: 100%; border-radius: 10px; object-fit: cover; }
.admin-brand .tiny { display: block; font-size: .68rem; letter-spacing: .16em; color: rgba(246,243,236,.5); }
.admin-brand .name { font-family: Palatino, Georgia, serif; font-size: 1.15rem; line-height: 1.1; }
.admin-nav { display: flex; flex-direction: column; gap: .15rem; }
.admin-nav a {
  display: flex; align-items: center; gap: .7rem; min-height: 2.75rem;
  padding: 0 .75rem; border-radius: 8px; color: rgba(246,243,236,.72); text-decoration: none; font-size: .95rem;
}
.admin-nav a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.admin-nav a.on, .admin-nav a:hover { background: rgba(246,243,236,.12); color: #f6f3ec; }
.admin-user { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 1.2rem .4rem 0; font-size: .75rem; color: rgba(246,243,236,.55); }
.admin-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user a { color: #f6f3ec; text-decoration: none; }
.admin-main { min-width: 0; padding: 1.6rem 2rem 3rem; }
.admin-main h1 { font-size: 2rem; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0 1rem; }
.stat { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 1.1rem 1.15rem; text-decoration: none; color: inherit; }
.stat strong { display: block; margin-top: .35rem; font-family: Palatino, Georgia, serif; font-size: 2.4rem; font-weight: 560; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem; }
.notice p { margin: 0; color: var(--muted); font-size: .92rem; }
.notice button { width: auto; white-space: nowrap; }
.recent { margin-top: 1.6rem; }
.recent-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.recent-head h2 { margin: 0; font-size: 1.25rem; }
.recent-list { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.recent-list a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.recent-list a:last-child { border-bottom: 0; }
.recent-list a:hover { background: #e4eeec; }
.recent-list strong { display: block; font-weight: 650; }
.recent-list small { color: var(--muted); }
.badge.aktiv { background: #e4eeec; color: #1a5f68; }
.badge.vilande { background: #eeeae2; color: #5d6d74; }
.badge.uttrad, .badge.raderad { background: #f0e4e4; color: #8f2d2d; }
.members-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.members-head .sub { margin: .2rem 0 0; font-size: .92rem; }
.toolrow { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.toolrow select, .filters select, .filters input {
  width: auto; height: 2.7rem; background: var(--card); border-radius: 12px;
}
.toolrow .btn, .toolrow button { height: 2.7rem; padding: 0 .9rem; background: var(--card); color: var(--ink); border-color: var(--line); }
.toolrow .btn:not(.ghost), .toolrow a.btn:last-child { background: var(--sea); color: #f6f3ec; border-color: var(--sea); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.filters input { width: min(22rem, 100%); }
.table-card { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
table.members { background: transparent; border-radius: 0; }
table.members th { padding: .85rem .7rem; }
table.members td { padding: .8rem .7rem; }
table.members .name { color: inherit; font-weight: 650; text-decoration: none; }
table.members .name:hover { color: var(--sea); }
table.members .fine { color: var(--muted); font-size: .72rem; }
table.members tr:hover td { background: rgba(228, 238, 236, .45); }
table.members .empty { text-align: center; color: var(--muted); padding: 2.5rem; }
table.members .badge { letter-spacing: .06em; text-transform: uppercase; font-size: .68rem; }
@media (max-width: 980px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: none; position: static; min-height: 0; }
  .nav-toggle:checked ~ .admin-side { display: flex; }
  .nav-burger { display: inline-flex; margin-bottom: .8rem; background: #13252f; color: #f6f3ec; border-radius: 999px; padding: .4rem .9rem; }
  .notice { flex-direction: column; align-items: stretch; }
}
body.is-home main { padding: 0; min-height: 100vh; }
.stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(22rem, 28rem);
}
.stage-photo {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.6rem 1.8rem 2rem;
  color: #f6f3ec;
  background: #13252f center/cover no-repeat;
}
.stage-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(19, 37, 47, 0.82), rgba(19, 37, 47, 0.22) 46%, rgba(19, 37, 47, 0.28));
}
.stage-photo > * { position: relative; z-index: 1; }
.stage-brand { display: flex; align-items: center; gap: .75rem; }
.stage-brand img { width: 88px; height: 88px; object-fit: contain; background: transparent; }
.stage-brand .name { font-family: Palatino, Georgia, serif; font-size: 1.35rem; }
.stage-brand .kicker, .stage-copy .kicker { color: rgba(246, 243, 236, 0.72); }
.stage-copy { max-width: 34rem; }
.stage-copy h1 { font-size: clamp(2.1rem, 4vw, 3.3rem); line-height: 1.08; margin: .35rem 0 .8rem; }
.stage-copy p { margin: 0; color: rgba(246, 243, 236, 0.84); max-width: 32rem; }
.stage-side {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1.35rem 2rem;
  background: var(--paper);
}
.stage-side .card h2 { margin: 0; }
.stage-side .btn, .stage-side button { width: 100%; }
.stage-meta { margin: 0; font-size: .92rem; }

@media (max-width: 860px) {
  .hero, .grid, .split { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
  .stage { grid-template-columns: 1fr; }
  .stage-photo, .stage-side { min-height: 0; }
  .stage-photo { min-height: 46vh; }
}
