/* admin.css — Admin-panel för Kalaset */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

:root {
  --color-rust-deep:  #6B2E0E;
  --color-rust:       #B2571F;
  --color-rust-light: #FCE7CC;
  --color-amber:        #F0923D;
  --color-amber-light:  #FDECD1;
  --color-ember:        #D8592E;
  --color-cream:       #FDFAF4;
  --color-gray-light:  #F1EFE8;
  --color-text:        #2A1F17;
  --color-text-muted:  #7A6F63;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-gray-light);
  min-height: 100dvh;
}

/* ─── Login ─────────────────────────────────────────────────────────────── */

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 1.5rem;
  background: var(--color-rust-deep);
}

.login-screen[hidden] { display: none; }

.login-box {
  background: var(--color-cream);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.login-logo {
  height: 56px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(240, 146, 61, 0.35));
}

.login-box h1 {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  color: var(--color-rust-deep);
  text-align: center;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

#login-form label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

#login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #D5D2C8;
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--color-text);
  transition: border-color 0.15s;
}

#login-form input:focus {
  outline: none;
  border-color: var(--color-rust);
}

.login-error {
  font-size: 0.875rem;
  color: var(--color-ember);
  background: #FFF0EB;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

#login-btn {
  margin-top: 0.25rem;
  padding: 0.75rem;
  background: var(--color-rust-deep);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

#login-btn:hover:not(:disabled) { background: var(--color-rust); }
#login-btn:disabled { opacity: 0.6; cursor: default; }

/* ─── Admin-panel ────────────────────────────────────────────────────────── */

.admin-panel {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: var(--color-rust-deep);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-logo {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1) opacity(0.9);
}

.admin-header h1 {
  font-family: Georgia, serif;
  font-size: 1.125rem;
  font-weight: 400;
}

.admin-slideshow-link {
  padding: 0.4rem 0.875rem;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  color: #fff;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.admin-slideshow-link:hover,
.admin-slideshow-link:focus-visible {
  background: rgba(255,255,255,0.1);
}

.admin-nav {
  position: sticky;
  top: 58px;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  width: 100%;
  padding: 0.45rem max(1rem, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid #ded7ca;
  background: rgba(253, 250, 244, 0.97);
  box-shadow: 0 4px 14px rgba(42, 31, 23, 0.06);
  backdrop-filter: blur(10px);
}

.admin-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 46px;
  padding: 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-nav-item:hover { background: var(--color-rust-light); }
.admin-nav-item.active { background: var(--color-rust-deep); color: #fff; }

.admin-panel > section:not(.stats-bar),
.admin-panel > .stats-bar {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.btn-logout {
  padding: 0.4rem 0.875rem;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-logout:hover { background: rgba(255,255,255,0.1); }

.back-to-site-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-rust-deep);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 24px rgba(42, 31, 23, 0.18);
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
  z-index: 20;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.back-to-site-fab:hover {
  transform: translateY(-2px);
  background: var(--color-rust);
  box-shadow: 0 14px 28px rgba(42, 31, 23, 0.22);
}

.back-to-site-fab:focus-visible {
  outline: 3px solid var(--color-amber-light);
  outline-offset: 3px;
}

/* ─── Statistik ──────────────────────────────────────────────────────────── */

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--color-cream);
  border-bottom: 1px solid #E0DDD5;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  min-width: 72px;
  padding: 0.625rem 0.875rem;
  background: var(--color-gray-light);
  border-radius: 8px;
  border: 1px solid #E0DDD5;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.stat-card:hover,
.stat-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-amber);
  box-shadow: 0 5px 14px rgba(42, 31, 23, 0.1);
  outline: none;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-rust-deep);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.stat-card--yes   .stat-num { color: #2E7D32; }
.stat-card--maybe .stat-num { color: var(--color-amber); }
.stat-card--no    .stat-num { color: var(--color-ember); }
.stat-card--warn  .stat-num { color: var(--color-ember); }

/* ─── Generell hidden-fix (display: flex/grid överskriver [hidden]) ───── */
[hidden] { display: none !important; }

/* ─── Bildkvalitet ───────────────────────────────────────────────────────── */

.quality-section {
  padding: 1rem 1.25rem;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-gray-light);
}

.section-heading {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.quality-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quality-row label {
  font-size: 0.875rem;
  white-space: nowrap;
}

.quality-status {
  font-size: 0.8125rem;
  color: var(--color-rust);
}

/* ─── Lägg till inbjuden ──────────────────────────────────────────────── */

.add-invitee-section {
  padding: 1rem 1.25rem;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-gray-light);
}

.add-invitee-toggle {
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 7px;
  background: var(--color-rust-deep);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.add-invitee-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.export-guests-btn {
  margin-left: auto;
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-rust-deep);
  border-radius: 7px;
  background: transparent;
  color: var(--color-rust-deep);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.export-guests-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.add-invitee-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 820px;
  padding: 1rem;
  border: 1px solid #ead5b8;
  border-radius: 10px;
  background: #fffaf1;
}

.add-invitee-form[hidden] { display: none; }
.add-invitee-form .section-heading,
.add-invitee-message-field,
.add-invitee-actions,
.add-invitee-form .quality-status { grid-column: 1 / -1; }
.add-invitee-form label > span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.add-invitee-form input,
.add-invitee-form select,
.add-invitee-form textarea {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #d5d2c8;
  border-radius: 6px;
  background: #fff;
  font: inherit;
}
.add-invitee-form textarea { resize: vertical; }
.add-invitee-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-cancel-add {
  padding: 0.55rem 0.85rem;
  border: 1px solid #c8c3b8;
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}

@media (max-width: 560px) {
  .add-invitee-form { grid-template-columns: 1fr; }
  .add-invitee-form > * { grid-column: 1; }
}

/* ─── Galleri- & hälsningsmoderering ──────────────────────────────────── */

.gallery-mgmt-section,
.halsningar-mgmt-section {
  padding: 1rem 1.25rem;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-gray-light);
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-heading-row .section-heading {
  margin-bottom: 0;
}

.gallery-mgmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.625rem;
}

.gallery-mgmt-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #E0DDD5;
  background: #fff;
}

.gallery-mgmt-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

.gallery-mgmt-item .gc-msg {
  display: block;
  padding: 0.3rem 0.4rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.gallery-mgmt-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.8125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.halsningar-mgmt-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.halsningar-mgmt-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: #fff;
  border: 1px solid #E0DDD5;
  border-radius: 8px;
}

.halsningar-mgmt-item p {
  margin-bottom: 2px;
  font-size: 0.9375rem;
}

.halsningar-mgmt-item .gc-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

/* ─── Ta bort-knapp ───────────────────────────────────────────────────── */

.btn-delete-guest {
  background: none;
  border: 1px solid #D5D2C8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: var(--font-body);
  padding: 0.3rem 0.75rem;
  color: var(--color-text-muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-delete-guest:hover {
  color: var(--color-ember);
  border-color: var(--color-ember);
  background: rgba(216, 89, 46, 0.06);
}

/* ─── Toolbar ────────────────────────────────────────────────────────────── */

.section-actions {
  display: none;
  padding: 1rem 1.25rem 0;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.btn-toggle-guests {
  flex: 1 1 160px;
  padding: 0.75rem;
  border: 1.5px solid var(--color-rust-deep);
  border-radius: 8px;
  background: var(--color-cream);
  color: var(--color-rust-deep);
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-toggle-guests:hover:not(:disabled) {
  background: var(--color-rust-deep);
  color: #fff;
}

.btn-toggle-guests:disabled { opacity: 0.5; cursor: default; }

/* ─── Bordsplacering ─────────────────────────────────────────────────────── */
.seating-mgmt-section {
  margin-top: 1.25rem;
  border-top: 1px solid #E0DDD5;
}

.content-hidden { opacity: 0.55; }

.content-meta {
  display: block;
  padding: 0.35rem 0.5rem 0;
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.content-visibility {
  margin: 0.45rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #d5d2c8;
  border-radius: 6px;
  background: #fff;
  color: var(--color-rust-deep);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.content-visibility:hover { border-color: var(--color-rust); }

.bingo-countdown {
  margin: 0.75rem 1.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-amber);
  border-radius: 8px;
  background: var(--color-amber-light);
  color: var(--color-rust-deep);
  font-weight: 600;
}

@media (max-width: 720px) {
  body { padding-bottom: 74px; }
  .admin-header { position: static; }
  .admin-header h1 { font-size: 1rem; }
  .admin-logo { display: none; }
  .admin-slideshow-link { padding-inline: 0.55rem; font-size: 0.78rem; }
  .admin-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    grid-template-columns: repeat(6, 1fr);
    padding: 0.3rem 0.15rem max(0.3rem, env(safe-area-inset-bottom));
    border-top: 1px solid #ded7ca;
    border-bottom: 0;
  }
  .admin-nav-item {
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    min-height: 54px;
    padding: 0.25rem 0.1rem;
    font-size: 1rem;
  }
  .admin-nav-item span { font-size: 0.58rem; }
  .back-to-site-fab { bottom: 5.2rem; }
  .stats-bar { flex-wrap: nowrap; overflow-x: auto; }
  .stat-card { flex: 0 0 auto; }
}

.seating-mgmt-intro {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.seating-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--color-cream);
}

.seating-table-editor {
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid #e0ddd5;
  background: #fff;
}

.seating-table-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.7rem; }
.seating-table-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.45rem 0.4rem 0.65rem;
  border-left: 4px solid var(--table-color);
  border-radius: 6px;
  background: var(--color-gray-light);
}
.seating-table-chip input {
  min-width: 0;
  padding: 0.25rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font: inherit;
}
.seating-table-chip input:focus { border-color: var(--color-amber); background: #fff; outline: none; }
.seating-table-icon-input { width: 42px; text-align: center; }
.seating-table-name-input { width: 110px; }
.seating-table-chip .seating-table-color-input { width: 30px; padding: 0; }
.seating-table-chip button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--color-ember);
  cursor: pointer;
}
.seating-table-add { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.seating-table-add input {
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid #d5d2c8;
  border-radius: 6px;
  font: inherit;
}
#seating-new-icon { width: 64px; }
#seating-new-name { flex: 1 1 180px; }
.seating-status-error { color: var(--color-ember) !important; }

.seating-summary-chip {
  padding: 0.25rem 0.55rem;
  border-left: 4px solid var(--table-color);
  border-radius: 5px;
  background: #fff;
  font-size: 0.82rem;
}

.seating-mgmt-list { padding: 0 1.25rem; }

.seating-dnd-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.seating-drop-zone {
  min-height: 120px;
  padding: 0.65rem;
  border: 1.5px dashed #cfc6b8;
  border-radius: 9px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}
.seating-drop-zone:first-child { grid-column: 1 / -1; min-height: 90px; }
.seating-drop-zone:first-child .seating-drop-list { flex-direction: row; flex-wrap: wrap; min-height: 38px; }
.seating-drop-zone:first-child .seating-drag-guest { flex: 0 0 auto; }
.seating-drop-zone.drag-over { border-color: var(--color-rust); background: var(--color-rust-light); }
.seating-drop-zone h3 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--color-rust-deep);
  font-size: 0.9rem;
}
.seating-drop-zone h3 span {
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--color-gray-light);
  color: var(--color-text-muted);
}
.seating-drop-list { display: flex; flex-direction: column; gap: 0.35rem; min-height: 60px; }
.seating-drop-zone:not(:first-child) .seating-drop-list { max-height: 320px; overflow-y: auto; }
.seating-drag-guest {
  padding: 0.45rem 0.55rem;
  border: 1px solid #e5dfd5;
  border-radius: 6px;
  background: var(--color-cream);
  font-size: 0.82rem;
  cursor: grab;
}
.seating-drag-guest span {
  display: inline-grid;
  width: 1.45rem;
  height: 1.45rem;
  margin-right: 0.4rem;
  place-items: center;
  border-radius: 50%;
  background: var(--color-rust-deep);
  color: #fff;
  font-size: 0.7rem;
}

.seating-detail-list {
  margin: 0 1.25rem 1rem;
  border: 1px solid #ddd6ca;
  border-radius: 8px;
  background: #fff;
}
.seating-detail-list summary {
  padding: 0.75rem 1rem;
  color: var(--color-rust-deep);
  font-weight: 600;
  cursor: pointer;
}

.seating-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.8fr) 90px;
  align-items: end;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #ECEAE3;
}

.seating-row--inactive { opacity: 0.58; }
.seating-guest { align-self: center; }
.seating-guest strong, .seating-guest span { display: block; }
.seating-guest span, .seating-row label > span {
  color: var(--color-text-muted);
  font-size: 0.76rem;
}

.seating-row select,
.seating-row input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.2rem;
  padding: 0.55rem;
  border: 1px solid #D5D2C8;
  border-radius: 7px;
  background: #fff;
  font: inherit;
}

.seating-save-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.seating-save-row--top {
  margin: 0 1.25rem 1rem;
  padding: 0.8rem;
  border: 1px solid #ddd6ca;
  border-radius: 8px;
  background: var(--color-cream);
}

.btn-save-seating {
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--color-rust-deep);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-save-seating:disabled { opacity: 0.55; cursor: default; }

@media (max-width: 620px) {
  .seating-row { grid-template-columns: 1fr 82px; }
  .seating-guest { grid-column: 1 / -1; }
}

.guests-section {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  padding: 0.875rem 1.25rem;
  background: var(--color-cream);
  border-bottom: 1px solid #E0DDD5;
}

.search-input,
.filter-select {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid #D5D2C8;
  border-radius: 7px;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s;
}

.search-input { flex: 1 1 180px; }
.filter-select { flex: 0 1 160px; }

.search-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--color-rust);
}

.btn-refresh {
  padding: 0.5rem 0.875rem;
  border: 1.5px solid #D5D2C8;
  border-radius: 7px;
  background: #fff;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--color-rust-deep);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-refresh:hover:not(:disabled) {
  background: var(--color-rust-light);
  border-color: var(--color-rust);
}

.btn-refresh:disabled { opacity: 0.5; cursor: default; }

/* ─── Gästkort ───────────────────────────────────────────────────────────── */

.guests-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem 2rem;
}

.empty-msg {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem 0;
}

.guest-card {
  background: #fff;
  border: 1px solid #ECEAE3;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.12s;
}

.guest-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.gc-header {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.875rem;
  background: var(--color-gray-light);
  border-bottom: 1px solid #ECEAE3;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.gc-header:hover {
  background: #E8E6DD;
}

.gc-name {
  font-weight: 500;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.gc-track-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.gc-check {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

.gc-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-rust);
  cursor: pointer;
  margin: 0;
}

.gc-check-label {
  white-space: nowrap;
}

.gc-expand-icon {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.gc-actions {
  padding-top: 0.375rem;
  border-top: 1px solid #ECEAE3;
  margin-top: 0.25rem;
}

.gc-osa {
  font-size: 0.875rem;
  white-space: nowrap;
}

.gc-details {
  padding: 0.5rem 0.875rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.gc-email-row,
.gc-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9375rem;
  flex-wrap: wrap;
}

.gc-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  font-weight: 600;
  min-width: 70px;
  flex-shrink: 0;
}

.gc-msg {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* OSA-färger */
.osa-yes   { color: #2E7D32; }
.osa-maybe { color: var(--color-amber); }
.osa-no    { color: var(--color-ember); }

/* Ej registrerad-tagg */
.tag-unreg {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-gray-light);
  border: 1px solid #D5D2C8;
  border-radius: 4px;
  vertical-align: middle;
}

/* ─── E-postkoll / inline-redigering ─────────────────────────────────────── */

.email-cell {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.email-val {
  color: var(--color-text);
  word-break: break-all;
}

.email-val:empty::before {
  content: '—';
  color: var(--color-ember);
  font-style: italic;
}

.btn-edit-email {
  flex-shrink: 0;
  padding: 0.125rem 0.375rem;
  border: 1px solid #D5D2C8;
  border-radius: 5px;
  background: #fff;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.1s, color 0.1s;
}

.btn-edit-email:hover {
  border-color: var(--color-rust);
  color: var(--color-rust);
}

.email-edit {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.email-input {
  flex: 1;
  min-width: 140px;
  padding: 0.3rem 0.5rem;
  border: 1.5px solid var(--color-rust);
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--color-text);
}

.email-input:focus { outline: none; }

.btn-save-email,
.btn-cancel-email {
  padding: 0.3rem 0.625rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.12s;
}

.btn-save-email {
  background: var(--color-rust-deep);
  color: #fff;
}

.btn-save-email:hover:not(:disabled) { background: var(--color-rust); }
.btn-save-email:disabled { opacity: 0.55; cursor: default; }

.btn-cancel-email {
  background: transparent;
  color: var(--color-text-muted);
  border-color: #D5D2C8;
}

.btn-cancel-email:hover { background: var(--color-gray-light); }

.email-feedback {
  font-size: 0.8125rem;
  color: var(--color-ember);
  margin-top: 0.25rem;
}

.admin-guest-avatar {
  width: 72px;
  height: 72px;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  object-fit: cover;
}

.guest-edit-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.9rem;
  padding: 0.85rem;
  border-radius: 8px;
  background: var(--color-gray-light);
}

.guest-osa-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.9rem;
  padding: 0.85rem;
  border: 1px solid #ead5b8;
  border-radius: 8px;
  background: var(--color-cream);
}
.guest-osa-panel h4,
.guest-osa-message,
.btn-save-osa,
.guest-osa-status { grid-column: 1 / -1; }
.guest-osa-panel h4 { color: var(--color-rust-deep); font-size: 0.9rem; }
.guest-osa-panel label > span { display: block; margin-bottom: 0.2rem; }
.guest-osa-panel input,
.guest-osa-panel select,
.guest-osa-panel textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d5d2c8;
  border-radius: 6px;
  background: #fff;
  font: inherit;
}
.btn-save-osa {
  padding: 0.55rem;
  border: 1px solid var(--color-rust-deep);
  border-radius: 6px;
  background: #fff;
  color: var(--color-rust-deep);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.guest-osa-status { color: var(--color-text-muted); font-size: 0.8rem; }

.guest-edit-panel label span { display: block; }
.guest-edit-panel input[type='text'],
.guest-edit-panel input[type='email'],
.guest-name-input,
.guest-email-input {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  border: 1px solid #d5d2c8;
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

.reset-checkin-label,
.btn-save-guest,
.guest-save-status { grid-column: 1 / -1; }
.reset-checkin-label { font-size: 0.82rem; color: var(--color-text-muted); }
.btn-save-guest {
  padding: 0.55rem;
  border: 0;
  border-radius: 6px;
  background: var(--color-rust-deep);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.guest-save-status { font-size: 0.8rem; color: var(--color-text-muted); }

@media (max-width: 560px) {
  .guest-edit-panel { grid-template-columns: 1fr; }
  .guest-edit-panel > * { grid-column: 1; }
  .guest-osa-panel { grid-template-columns: 1fr; }
  .guest-osa-panel > * { grid-column: 1; }
}
