.card { margin-bottom: 24px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.card.narrow { max-width: 460px; }
.card.center { text-align: center; }
.card > h1:first-child, .card > h2:first-child { margin: 0 0 16px; font-size: 21px; }
.card > h1:first-child { font-size: 24px; }
.card .table-wrap { margin-bottom: 16px; box-shadow: none; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; }
.section-title { margin: 32px 0 14px; font-size: 18px; }

.signed-in { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; font-size: 12px; font-weight: 700; color: var(--red-dark); background: var(--red-tint); border-radius: 50%; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 18px; }
.facts div { padding: 12px 14px; background: #f1f3f6; border-radius: 12px; }
.facts dt { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }
.facts dd { margin: 3px 0 0; font-weight: 500; color: var(--heading); overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; margin-bottom: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 11px 16px; font-family: var(--heading-font); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-align: left; color: var(--muted); text-transform: uppercase; background: var(--surface-2); border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfbfc; }
.row-title { font-weight: 600; color: var(--heading); text-decoration: none; }
.row-title:hover { color: var(--red); }
.table-wrap .capacity-track { flex-basis: 90px; }
.status-failed, .status-cancelled, .status-refunded { color: var(--muted); }
.status-pending { background: #fffbeb; }

.badge-paid { color: #05603a; background: #ecfdf3; }
.badge-pending { color: #92400e; background: #fef3c7; }
.badge-failed, .badge-refunded { color: var(--muted); background: #f2f4f7; }
.badge-cancelled { color: #92400e; background: #fef3c7; }
.badge-manual-paid { color: #05603a; background: #fff3cd; }
.badge-manual-unpaid { color: #92400e; background: #fff3cd; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; align-items: start; padding-bottom: 6px; }
.filters .field input, .filters .field select { height: 44px; padding-top: 0; padding-bottom: 0; }
td.nowrap { white-space: nowrap; }
.amount-due { margin: 0 0 6px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; }
.filter-actions { grid-column: 1 / -1; margin-bottom: 16px; }
td.amount { font-weight: 600; white-space: nowrap; color: var(--heading); }
td.reference { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

.leader-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.leader-chips:not(:has(li))::before { content: "Ingen ledare vald ännu."; font-size: 14px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; font-size: 14px; font-weight: 500; color: var(--red-dark); background: var(--red-tint); border: 1px solid #f3c4c6; border-radius: 999px; }
.chip-remove { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; font-size: 17px; line-height: 1; color: var(--red-dark); background: none; border: 0; border-radius: 50%; cursor: pointer; }
.chip-remove:hover { color: #fff; background: var(--red); }
.leader-picker .field { max-width: 360px; }

.assigned-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.assigned-head h2 { margin: 0; font-size: 19px; }
.assigned .capacity { margin-bottom: 16px; }
.past-slots { display: grid; margin: 0 0 24px; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.past-slots li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.past-slots li:last-child { border-bottom: 0; }
.show-more { margin: -12px 0 24px; text-align: center; }

.login-card { max-width: 400px; margin: 16px auto 32px; padding: 32px 28px 28px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 4px; font-size: 22px; }
.login-card > .muted { margin: 0 0 24px; }
.login-card form, .login-card .alert { text-align: left; }
.login-card .field input { background: var(--surface-2); }
.login-card .field input:focus { background: var(--surface); }
.login-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 14px; background: linear-gradient(to bottom, var(--red), var(--red-dark)); border-radius: 14px; }
.login-icon .icon { width: 24px; height: 24px; margin: 0; color: #fff; }

.menu-toggle { display: none; }
.menu-toggle .icon { width: 20px; height: 20px; margin: 0; color: #fff; }
.admin-nav .nav-links { display: contents; }
.nav-mail-text { display: none; }

@media (max-width: 599px) {
  .card { padding: 18px 16px; border-radius: 14px; }
  td, th { padding: 12px; }
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table-wrap tbody tr:last-child { border-bottom: 0; }
  .table-wrap td { position: relative; display: block; min-height: 30px; padding: 5px 0 5px 7.5em; border: 0; overflow-wrap: anywhere; }
  .table-wrap td::before { content: attr(data-label); position: absolute; top: 7px; left: 0; width: 7em; font-family: var(--heading-font); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }
  .table-wrap td:not([data-label]) { padding-left: 0; }
  .table-wrap td.nowrap, .table-wrap td.amount { white-space: normal; }
  .admin-nav { display: block; }
  .admin-nav .nav-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-nav .nav-links a, .admin-nav .nav-links button { padding: 10px 6px; text-align: center; }
  .admin-nav .nav-right { margin-left: 0; }
  .admin-nav form button { width: 100%; }
  .admin-nav .nav-mail { justify-content: center; }
  .admin-nav .mail-badge { position: static; margin-left: 4px; }
  .admin-nav.menu-ready .nav-links { display: none; }
  .admin-nav.menu-open .nav-links { display: grid; grid-template-columns: 1fr; border-top: 1px solid rgb(255 255 255 / 25%); }
  .admin-nav.menu-open .nav-links a, .admin-nav.menu-open .nav-links button { padding: 12px 16px; text-align: left; }
  .admin-nav.menu-open .nav-mail { justify-content: flex-start; }
  .admin-nav.menu-open .nav-mail-text { display: inline; margin-left: 8px; }
  .admin-nav .menu-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 16px; font-weight: 600; }
}

.my-booking { background: #f6fef9; border-color: #abefc6; }
.my-booking-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.my-booking-head h2 { margin: 2px 0; font-size: 19px; }
.my-booking-head p { margin: 0; }
.my-booking-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; background: #16a34a; border-radius: 50%; }
.my-booking-icon .icon, .booked-badge .icon { width: 14px; height: 14px; margin: 0; color: inherit; }
.my-booking-icon .icon { width: 22px; height: 22px; color: #fff; }
.my-booking-item { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; padding: 14px 16px; background: var(--surface); border: 1px solid #d1fadf; border-radius: 12px; }
.my-booking-item + .my-booking-item { margin-top: 10px; }
.my-booking-item h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }
.plain-list { margin: 0; padding: 0; list-style: none; }
.stacked { display: flex; flex-direction: column; margin: 0; }
.booked-badge { display: inline-flex; align-items: center; gap: 4px; margin: -2px 0 10px; }
.role-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.role-form .is-unchanged { visibility: hidden; }
.role-form select { padding: 6px 12px; font: inherit; font-size: 14px; color: var(--heading); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; }
.narrow-field { max-width: 280px; }
.alert-info { color: #1e3a8a; background: #eff6ff; border-color: #bfdbfe; }
.club-swish { margin: 18px 0; padding: 18px; background: var(--surface-2); border-radius: 14px; }
.club-swish p { margin: 4px 0; }
.swish-number { font-family: var(--heading-font); font-size: 28px; font-weight: 700; letter-spacing: 0.02em; color: var(--heading); }
.club-swish .qr { margin-top: 14px; }
.badge-awaiting { color: #1e3a8a; background: #dbeafe; }
.payment-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.payment-actions form { margin: 0; }
.steps { margin: 8px 0 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; }
.steps code { font-size: 13px; padding: 1px 5px; background: var(--surface-2); border-radius: 4px; }
.info-tip { position: relative; display: inline-flex; margin-left: 5px; color: var(--muted); vertical-align: -3px; cursor: help; border-radius: 50%; }
.info-tip .icon { margin: 0; color: inherit; }
.info-tip:hover, .info-tip:focus-visible { color: var(--heading); }
.info-tip-text { position: absolute; right: -10px; bottom: calc(100% + 8px); z-index: 10; width: max-content; max-width: 240px; padding: 8px 10px; font-size: 13px; font-weight: 400; line-height: 1.4; color: #fff; text-transform: none; letter-spacing: normal; background: var(--heading); border-radius: 8px; box-shadow: 0 6px 16px rgb(16 24 40 / 18%); opacity: 0; visibility: hidden; transition: opacity 0.15s; pointer-events: none; }
.info-tip-text::after { position: absolute; top: 100%; right: 14px; content: ""; border: 6px solid transparent; border-top-color: var(--heading); }
.info-tip:hover .info-tip-text, .info-tip:focus .info-tip-text { opacity: 1; visibility: visible; }
.site-nav .nav-mail { position: relative; display: inline-flex; align-items: center; }
.nav-mail .icon { width: 20px; height: 20px; margin: 0; color: #fff; }
.mail-badge { position: absolute; top: 3px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 700; line-height: 18px; color: var(--red-dark); text-align: center; background: #fff; border-radius: 999px; }
.message-list { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.message-item + .message-item { border-top: 1px solid var(--border); }
.message-item a { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; justify-content: space-between; padding: 14px 18px; color: var(--text); text-decoration: none; }
.message-item a:hover { background: var(--surface-2); }
.message-item.unread .message-subject { font-weight: 700; color: var(--heading); }
.message-meta { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; white-space: nowrap; }
.message-title { font-size: 22px; }
.payment-actions form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.paid-date { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.paid-date input { padding: 4px 6px; font: inherit; color: var(--text); border: 1px solid var(--border-strong); border-radius: 6px; }
.receipt-form { margin: 8px 0 0; }
.receipt-link { font-size: 14px; }
.link-button { padding: 0; font: inherit; font-size: 14px; color: var(--red); text-decoration: underline; cursor: pointer; background: none; border: 0; }
.login-card .small { margin: 14px 0 4px; font-size: 13px; }
.cancel-login { margin-top: 10px; }
.login-card .centered-form, .two-factor-setup .centered-form { text-align: center; }
.two-factor-setup { max-width: 640px; margin: 0 auto; }
.two-factor-setup .card .field { max-width: 240px; }
.secret { font-size: 14px; letter-spacing: 0.08em; white-space: nowrap; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.recovery-codes code { display: block; padding: 8px; font-size: 15px; letter-spacing: 0.06em; background: var(--surface-2); border-radius: 8px; }
.demo-mail { text-align: left; }
.demo-mail pre { margin-top: 6px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.transactions { margin-bottom: 24px; overflow: hidden; font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.transactions-head, .transaction > summary { display: grid; grid-template-columns: 96px minmax(0, 2fr) minmax(0, 1.4fr) 44px 72px 184px 16px; gap: 12px; align-items: center; padding: 12px 16px; }
.transactions-head { font-family: var(--heading-font); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.transaction + .transaction { border-top: 1px solid var(--border-soft); }
.transaction > summary { list-style: none; cursor: pointer; }
.transaction > summary::-webkit-details-marker { display: none; }
.transaction > summary:hover, .transaction[open] > summary { background: var(--surface-2); }
.transaction > summary:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.t-date { color: var(--muted); white-space: nowrap; }
.t-slot { display: flex; flex-direction: column; min-width: 0; }
.t-slot strong, .t-contact { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-slot strong { font-weight: 600; color: var(--heading); }
.t-slot .muted { font-size: 13px; }
.t-amount { font-weight: 600; text-align: right; white-space: nowrap; color: var(--heading); }
.t-toggle { display: flex; }
.t-toggle .icon { width: 16px; height: 16px; margin: 0; color: var(--muted); transition: transform 0.15s; }
.transaction[open] .t-toggle .icon { transform: rotate(90deg); }
.transaction-details { padding: 6px 16px 18px; background: var(--surface-2); }
.transaction-details dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 24px; margin: 0; }
.transaction-details dt { font-family: var(--heading-font); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }
.transaction-details dd { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 0; overflow-wrap: anywhere; }
.transaction-details .reference { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.refund-hint { margin: 16px 0 0; font-size: 14px; color: #92400e; }
.transaction-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.transaction-actions:empty { display: none; }
.transaction-actions .payment-actions, .transaction-actions .receipt-form { margin: 0; }

@media (max-width: 599px) {
  .transactions-head, .t-date, .t-count { display: none; }
  .transaction > summary { grid-template-columns: minmax(0, 1fr) auto 16px; grid-template-areas: "contact amount toggle" "slot status toggle"; gap: 4px 12px; }
  .t-contact { grid-area: contact; font-weight: 600; color: var(--heading); }
  .t-amount { grid-area: amount; }
  .t-slot { grid-area: slot; }
  .t-status { grid-area: status; justify-self: end; }
  .t-toggle { grid-area: toggle; }
}
