:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #fafbfc;

  --border: #d8dde6;
  --border-soft: #e8ecf2;

  --text: #1f2937;
  --muted: #6b7280;
  --link: #4a6480;

  --success-bg: #e8f5e9;
  --success-border: #c8e6c9;

  --danger-bg: #f8d7da;
  --danger-border: #f5c2c7;

  --warning-bg: #fff3cd;
  --warning-border: #ffe69c;

  --info-bg: #eef6ff;
  --info-border: #cfe2ff;

  --brand-primary: #17458f;
  --brand-primary-dark: #0f4ea6;
  --brand-primary-mid: #2d72c9;
  --brand-accent: #f7a81b;
  --brand-accent-dark: #e29a18;

  --radius: 14px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  padding: 18px 12px 32px;
}

a {
  color: inherit;
  text-decoration: underline;
}

a:hover {
  text-decoration: none;
}

/* =========================================================
   LAYOUT
   ========================================================= */

.page {
  max-width: 900px;
  margin: 0 auto;
}

.page.page-narrow {
  max-width: 400px;
  margin: 40px auto;
}

.page-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

/* =========================================================
   LEGACY TOP / SIMPLE HEADER
   Beholdes midlertidigt til evt. ældre sider
   ========================================================= */

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.top h2 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
}

.top .muted {
  font-size: 14px;
  line-height: 1.5;
}

.top-links {
  white-space: nowrap;
  font-size: 14px;
  color: var(--muted);
  align-self: flex-start;
}

.top-links a {
  color: var(--link);
  text-decoration: none;
}

.top-links a:hover {
  text-decoration: underline;
}

/* =========================================================
   GENERIC CARDS / ALERTS
   ========================================================= */

.card,
.meeting-card,
.page-intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 16px 18px;
  margin-top: 16px;
}

.page-intro {
  margin: 8px 0 16px;
  padding: 12px 16px;
}

.page-intro .muted {
  font-size: 14px;
  line-height: 1.5;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  font-size: 0.95rem;
}

.alert-success {
  background: #e6f4ea;
  color: #1e7e34;
  border: 1px solid #b7dfc6;
}

.alert-warning {
  background: #fdecea;
  color: #a94442;
  border: 1px solid #f5c6cb;
}

.alert-error {
  background: #fdecea;
  color: #a94442;
  border: 1px solid #f5c6cb;
}

.alert ul {
  margin: 0;
  padding-left: 18px;
}

/* Legacy alerts - kan fjernes senere når alt er migreret */
.success,
.errors,
.info-declined {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin: 0 0 16px;
}

.success {
  background: #f3fff3;
  border: 1px solid #b8f2b8;
}

.errors {
  background: #fff3f3;
  border: 1px solid #f2b8b8;
}

.info-declined {
  background: #fff3f3;
  border: 1px solid #f2b8b8;
}

.errors ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

/* =========================================================
   NEW MEMBER HEADER + NAVIGATION
   ========================================================= */

.top-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 34px;
  margin-bottom: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow);
}

.banner-left {
  min-width: 0;
  flex: 1;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-primary);
}

.tagline {
  font-size: 16px;
  line-height: 1.4;
  color: var(--muted);
}

.user {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.banner-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px; 
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease;
}

.lang-switch a:hover {
  border-color: var(--brand-primary);
  background: #f5f8fc;
  text-decoration: none;
}

.lang-switch a:active {
  transform: scale(0.98);
}

.lang-switch a.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.member-nav-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 28px 16px;
  margin-bottom: 18px;
  background: linear-gradient(
    90deg,
    var(--brand-primary-dark) 0%,
    var(--brand-primary-mid) 55%,
    var(--brand-primary-dark) 100%
  );
  border: 1px solid var(--brand-primary);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow);
}

.member-nav-bar .member-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition:
    transform 0.08s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.member-nav-bar .member-nav-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10);
}

.member-nav-bar .member-nav-link.is-active {
  background: var(--brand-accent);
  border-color: var(--brand-accent-dark);
  color: #ffffff;
  font-weight: 700;
}

.member-nav-bar .member-nav-link-logout {
  margin-left: auto;
}

/* =========================================================
   LEGACY MEMBER NAVIGATION
   Beholdes midlertidigt
   ========================================================= */

.member-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 0;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.member-nav .member-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
}

.member-nav .member-nav-link:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.member-nav .member-nav-link.is-active {
  background: var(--info-bg);
  border-color: var(--info-border);
  font-weight: 700;
}

.member-nav .member-nav-link-logout {
  margin-left: auto;
}

/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
  margin: 6px 0 14px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.page-header-intro {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

/* =========================================================
   MEETING CARDS
   ========================================================= */

.meeting-card {
  padding: 20px;
  margin-top: 18px;
}

.meeting-layout {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 20px;
  align-items: start;
}

.meeting-date {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
}

.meeting-date-day {
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
}

.meeting-date-month {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--muted);
}

.meeting-date-weekday {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.1;
  color: var(--muted);
}

.meeting-main,
.meeting-card__content {
  min-width: 0;
  flex: 1;
}

.meeting-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.meeting-title a {
  text-decoration: none;
  color: inherit;
}

.meeting-title a:hover {
  text-decoration: underline;
}

.meeting-subtitle {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.meeting-status-row,
.meeting-card__status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}

.meeting-status-label {
  font-weight: 700;
  color: var(--text);
}

.meeting-meta,
.meeting-card__details {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
}

.meeting-meta div {
  color: var(--muted);
}

.meeting-meta div + div {
  margin-top: 6px;
}

.meeting-meta strong {
  color: var(--text);
  font-weight: 700;
}

.meeting-deadline-row,
.meeting-card__meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.meeting-link {
  margin-bottom: 14px;
}

.meeting-link a {
  font-size: 14px;
}

.details-status-row {
  margin-top: 6px;
}

.meeting-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.meeting-card__link {
  display: flex;
  align-items: center;
}

/* =========================================================
   PILLS / STATUS
   ========================================================= */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.status-pending {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.status-going {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.status-not-going {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.meeting-deadline-pill {
  background: #fff;
  border-color: var(--border);
}

/* =========================================================
   BUTTONS / ACTIONS
   ========================================================= */

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 11px 18px;
  min-width: 120px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(0.99);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-success {
  background: #4caf50;
  border-color: #3f9f44;
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #43a047;
}

.btn-danger {
  background: #f4cccc;
  border-color: #d88c8c;
  color: #7a1f1f;
}

.btn-danger:hover:not(:disabled) {
  background: #f5dede;
}

.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meeting-actions {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.meeting-actions-closed {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}

.meeting-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.meeting-actions-row-right {
  justify-content: flex-end;
}

.link-secondary {
  font-size: 14px;
  color: var(--link);
  text-decoration: none;
}

.link-secondary:hover {
  text-decoration: underline;
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.login-form-actions {
  margin-top: 16px;
}

/* =========================================================
   FORMS / SEARCH
   ========================================================= */

.search-form {
  margin: 0;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.form-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
}

.form-field input:disabled,
.form-field select:disabled {
  background: #f3f4f6;
  color: var(--muted);
}

.form-actions {
  display: flex;
  align-items: end;
  margin-top: 16px;
}

.form-help {
  margin-top: 12px;
}

.form-note {
  margin-top: 8px;
}

/* =========================================================
   DETAILS PAGE / SECTIONS
   ========================================================= */

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-item {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.detail-item-primary {
  border-color: var(--border);
}

.detail-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.detail-value {
  color: var(--text);
}

.detail-value-primary {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
}

.section-title {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.3;
}

.meeting-description {
  line-height: 1.6;
  color: var(--text);
}

/* =========================================================
   ATTENDEES / GUESTS
   ========================================================= */

.attendees-summary {
  display: grid;
  gap: 10px;
}

.attendees-summary-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.attendees-summary-label {
  font-weight: 700;
  color: var(--text);
}

.attendees-summary-value {
  color: var(--text);
}

.attendance-sections {
  display: grid;
  gap: 18px;
}

.attendance-section {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}

.attendance-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.attendance-heading {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.3;
}

.attendee-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attendee-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.attendee-main {
  min-width: 0;
  flex: 1;
}

.attendee-side {
  text-align: right;
}

.attendee-name {
  color: var(--text);
  font-weight: 700;
}

.attendee-meta {
  margin-top: 4px;
  font-size: 13px;
}

.attendee-guests {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.attendee-guest-name {
  font-size: 14px;
  color: var(--muted);
  padding-left: 12px;
  position: relative;
}

.attendee-guest-name::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.guest-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.guest-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.guest-item {
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

/* =========================================================
   CLUB MEMBERS / PROFILE ACTIONS
   ========================================================= */

.club-member-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.club-member-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.club-member-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  min-width: 220px;
}

.club-member-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.club-member-phone {
  color: var(--text);
}

.club-member-email a {
  color: var(--link);
  text-decoration: none;
}

.club-member-email a:hover {
  text-decoration: underline;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .top-banner {
    padding: 22px 22px;
  }

  .member-nav-bar {
    padding: 16px 22px 18px;
  }
}

@media (max-width: 800px) {
  .search-grid {
    grid-template-columns: 1fr;
  }

  .form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    padding: 14px 10px 24px;
  }

  .page-title,
  .top h2 {
    font-size: 22px;
  }

  .top {
    padding: 16px;
    gap: 12px;
  }

  .top-links {
    white-space: normal;
  }

  .top-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    border-radius: 20px 20px 0 0;
  }

  .banner-right {
    width: 100%;
    justify-content: flex-start;
  }

  .meeting-card {
    padding: 16px;
  }

  .meeting-title {
    font-size: 20px;
  }

  .meeting-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .meeting-date {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    text-align: left;
    padding: 10px 12px;
  }

  .meeting-date-day {
    font-size: 28px;
  }

  .meeting-date-month,
  .meeting-date-weekday {
    margin-top: 0;
  }

  .meeting-status-row,
  .meeting-card__status-row,
  .meeting-deadline-row,
  .meeting-card__meta-row,
  .btn-row,
  .meeting-actions-row,
  .meeting-actions-row-right,
  .meeting-card__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .meeting-actions-row-right {
    justify-content: flex-start;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .detail-value-primary {
    font-size: 24px;
  }

  .attendee-item {
    flex-direction: column;
    align-items: stretch;
  }

  .attendee-side {
    text-align: left;
  }

  .guest-form-grid {
    grid-template-columns: 1fr;
  }

  .member-nav-bar {
    border-radius: 0 0 20px 20px;
    gap: 8px;
  }

  .member-nav-bar .member-nav-link {
    width: 100%;
  }

  .member-nav-bar .member-nav-link-logout {
    margin-left: 0;
  }

  .member-nav {
    gap: 8px;
  }

  .member-nav .member-nav-link {
    width: 100%;
    justify-content: center;
  }

  .member-nav .member-nav-link-logout {
    margin-left: 0;
  }

  .club-member-item {
    flex-direction: column;
    align-items: stretch;
  }

  .club-member-name {
    min-width: 0;
  }

  .club-member-contact {
    text-align: left;
  }

  .profile-actions {
    flex-direction: column;
  }

  .pill,
  .btn {
    width: 100%;
  }

  .pill {
    justify-content: center;
  }
}

.btn-full {
  width: 100%;
}

.meeting-actions {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-button {
  background: #f37400;
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.admin-button:hover {
  opacity: 0.9;
}

.status-cancelled {
  background: #fdecea;
  border-color: #f5c6cb;
  color: #a94442;
}

.meeting-card.is-cancelled {
  opacity: 0.88;
}

.meeting-card.is-cancelled .meeting-title,
.meeting-card.is-cancelled .meeting-subtitle,
.meeting-card.is-cancelled .meeting-meta {
  opacity: 0.9;
}

.cancelled-note {
  margin-top: 10px;
  color: #a94442;
  font-weight: 600;
}

.status-cancelled {
  background: #fdecea;
  border-color: #f5c6cb;
  color: #a94442;
}

.is-cancelled {
  opacity: 0.9;
}

.cancelled-note {
  margin-top: 10px;
  color: #a94442;
  font-weight: 700;
}

.admin-meeting-datetime {
  margin-top: 4px;
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
}

.admin-meeting-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  margin-bottom: 12px;
}

.admin-meeting-main {
  flex: 1;
}

.admin-meeting-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.admin-meeting-datetime {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.admin-meeting-card.is-cancelled {
  background: #fff5f5;
  border-color: #f5c6cb;
}
