:root {
    --green: #1a5632;
    --ink: #212832;
    --muted: #6b7684;
    --line: #e3e7ec;
    --bg: #f6f7f9;
    --card: #ffffff;
    --red: #a4262c;
    --amber: #8a6100;
}

* { box-sizing: border-box; }

/* Modern CSS reset (Josh Comeau / Meyer-style, trimmed). */
html, body, h1, h2, h3, h4, h5, h6, p, ol, ul, figure, blockquote, dl, dd, pre {
    margin: 0;
}
ol, ul { padding: 0; list-style: none; }
img, picture, svg, video, canvas { display: block; max-width: 100%; }
button, select, input, textarea {
    font: inherit; color: inherit;
    background: transparent;
}
button { cursor: pointer; border: none; }
table { border-collapse: collapse; border-spacing: 0; }
:where(input, button, select, textarea) { accent-color: var(--green); }

/* Keep layout width identical whether or not the page is tall enough to scroll. */
html { scrollbar-gutter: stable; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background-color: #f0f0f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cg fill='none' stroke='%23274b6d' stroke-opacity='0.055' stroke-width='1.2'%3E%3Ccircle cx='0' cy='0' r='30'/%3E%3Ccircle cx='60' cy='0' r='30'/%3E%3Ccircle cx='0' cy='60' r='30'/%3E%3Ccircle cx='60' cy='60' r='30'/%3E%3Ccircle cx='30' cy='30' r='30'/%3E%3C/g%3E%3C/svg%3E");
    line-height: 1.55;
}

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* Sticky footer: content column stretches so the footer always sits at the page bottom. */
body { display: flex; flex-direction: column; min-height: 100vh; }
body > header, body > footer { flex-shrink: 0; width: 100%; }
body > .wrap { flex: 1 0 auto; }

.site-header {
    padding: 18px 0;
    border-bottom: 2px solid #c3ccd6;
    background: #fcfcfd;
}

.dev-banner {
    margin: 0 0 16px;
    padding: 10px 14px;
    background: #fde8e8;
    border: 1px solid #a4262c;
    color: #a4262c;
    font-weight: 600;
    text-align: center;
    border-radius: 6px;
}

.site-header .wrap {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px;
}

.brand { font-size: 20px; font-weight: 700; color: var(--green); text-decoration: none; }
.site-header nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-header nav a:hover { color: var(--green); }

.dropdown { position: relative; display: inline-block; }
.dropbtn {
    background: none; border: none; cursor: pointer; font: inherit; font-weight: 600;
    color: var(--green); padding: 4px 2px;
}
.caret { font-size: 11px; }
.dropdown-content {
    display: none; position: absolute; right: 0; z-index: 20;
    min-width: 200px; background: #fff; border: 1px solid var(--green);
    border-radius: 8px; box-shadow: 0 10px 28px rgba(26, 86, 50, .22); padding: 6px 0;
}
.dropdown-content a { display: block; padding: 8px 16px !important; margin: 0 !important; white-space: nowrap; }
.dropdown-content a:hover { background: var(--bg); }
.dropdown-content hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }
.logout-form { margin: 0; }
.dropdown-content .logout-form button {
    display: block; width: 100%; text-align: left;
    background: none; border: none; cursor: pointer; font: inherit;
    color: var(--muted); font-weight: 500; padding: 8px 16px; white-space: nowrap;
}
.dropdown-content .logout-form button:hover { background: var(--bg); color: var(--green); }
.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content { display: block; }

main { padding: 28px 0 48px; min-height: 60vh; }

.site-footer { padding: 18px 0 30px; border-top: 2px solid #97a2ae; background: #ececec; }
.site-footer .wrap { display: flex; justify-content: flex-end; }
.site-footer a { color: var(--muted); font-size: 13px; text-decoration: none; }

h1 { font-size: 28px; margin: 0 0 12px; text-align: center; }
h2 { font-size: 20px; margin: 24px 0 8px; }
p.lead { font-size: 18px; color: var(--ink); }

.card {
    background: var(--card); border: 1px solid var(--green);
    border-radius: 10px; padding: 24px; margin: 16px 0;
    box-shadow: 0 10px 28px rgba(26, 86, 50, .22);
}

.label { display: block; font-weight: 600; margin: 14px 0 4px; }
input[type=text], input[type=email], input[type=number], input[type=date], select {
    width: 100%; padding: 10px 12px; font-size: 15px;
    border: 1px solid #9aa5b1; border-radius: 6px; background: #fff;
}
input[type=text]:focus, input[type=email]:focus, input[type=number]:focus, input[type=date]:focus, select:focus {
    border-color: var(--green);
}
input:focus, select:focus { outline: 2px solid var(--green); outline-offset: -1px; }

/* Every button carries the same blue border (the sign-up badge blue) and a
   small drop shadow in the same green family as the card shadows, so buttons
   sit slightly proud of the page like the cards do. */
.btn {
    display: inline-block; border: 1px solid #2b5aa5; cursor: pointer; text-decoration: none;
    font-size: 15px; font-weight: 600; border-radius: 6px; padding: 10px 18px;
    background: var(--green); color: #fff;
    box-shadow: 0 2px 4px rgba(26, 86, 50, .25);
}
.btn:hover { filter: brightness(1.1); }
.btn-secondary { background: #eef1f4; color: var(--ink); }
.btn-danger { background: var(--red); }
/* Pastel blue for the complimentary place action: clearly a positive,
   deliberate choice, but visually distinct from both the plain green
   "Offer place" button and the pale grey secondary buttons. Its border comes
   from .btn like every other button. */
.btn-complimentary { background: #cfe4f7; color: #17456e; }
.btn-complimentary:hover { filter: brightness(0.97); }
.btn-small { padding: 6px 10px; font-size: 13px; }
.btn-link { background: none; color: var(--green); padding: 0; font-weight: 600; text-decoration: underline; border: none; }

/* A lone action in a card: the full width of the card, so it reads as the one
   thing to do, with room to breathe between it and the copy above it. */
.btn-block {
    display: flex; align-items: center; justify-content: center;
    width: 100%; margin-top: 24px; padding: 12px 18px; text-align: center;
}
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.actions-cell form { margin: 0; }

.flash { padding: 12px 16px; border-radius: 8px; margin: 14px 0; font-weight: 500; box-shadow: 0 9px 24px rgba(0, 0, 0, .21); }
.flash-success { background: #e5f3ea; color: var(--green); border: 2px solid #c2e0cc; }
.flash-error { background: #fbe9ea; color: var(--red); border: 2px solid #efcdcf; }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:hover td { background: #fafbfc; }

/* An offered place whose 10-day payment window (from the offer email) has
   passed: a lightened amber tint so the organiser spots it in the list, and
   the offer date shown in red. The hover rule above is overridden — the tint
   must not disappear while the cursor is on it. */
tr.row-stale-offer td,
tr.row-stale-offer:hover td { background: #fef7eb; }
td.stale-date { color: var(--red); font-weight: 700; }

/* The Export button sits right-aligned above the table, away from the data. */
/* The page heading row: the tab-specific actions — Export on the paid tab,
   the All/Lapsed toggle on the offered tab — sit on the heading line itself
   instead of between the tab pills and the table. That way switching tabs
   can never change where the tables start. */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.page-head-actions { display: flex; gap: 6px; }

.tabs {
    display: flex; flex-wrap: wrap; gap: 4px;
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: 5px; margin: 0 auto 22px; width: fit-content; max-width: 100%;
    box-shadow: 0 2px 8px rgba(33, 40, 50, .06);
}
.tabs a {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 16px; text-decoration: none; color: var(--muted); font-weight: 600;
    border-radius: 999px; font-size: 14px; transition: background .12s ease, color .12s ease;
}
.tabs a:hover { background: var(--bg); color: var(--ink); }
.tabs a.active { background: var(--green); color: #fff; box-shadow: 0 1px 4px rgba(26, 86, 50, .35); }
.tabs a.active:hover { background: var(--green); color: #fff; }
.tabs .count {
    font-size: 12px; font-weight: 700; min-width: 22px; text-align: center;
    padding: 2px 7px; border-radius: 999px;
    background: #e9edf1; color: var(--muted);
}
.tabs a.active .count { background: rgba(255, 255, 255, .25); color: #fff; }

.badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700;
}
.badge-signedup { background: #e8eef7; color: #2b5aa5; }
.badge-offered { background: #fdf0d9; color: var(--amber); }
.badge-payed { background: #e5f3ea; color: var(--green); }
.badge-refund { background: #fbe9ea; color: var(--red); }
.badge-droppedout { background: var(--red); color: #fff; }

.price-big { font-size: 32px; font-weight: 700; color: var(--green); }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.2; }

.callout {
    background: #fdf0d9;
    border: 1px solid #f0ddb0;
    color: #8a6100;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    box-shadow: 0 9px 24px rgba(0, 0, 0, .21);
}

.callout-info {
    background: #e8f1fb;
    border: 1px solid #bcd9f0;
    color: #1e4b7a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.callout-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 1.2em;
}
.callout-text {
    flex: 1 1 auto;
    line-height: 1.2;
}

.callout-info {
    background: #e8f1fb;
    border: 1px solid #bcd9f0;
    color: #1e4b7a;
}

.meta { line-height: 1.1; margin-top: 2px; }
.price { font-weight: 600; color: var(--green); }

.radio { display: block; margin: 6px 0; }

.price-table { margin: 16px 0 0; border-collapse: collapse; width: auto; margin-left: 0; }
.price-table .price-label { padding-right: 16px; font-weight: 600; text-align: right; }
.price-table .price { text-align: left; }
.price-table td { padding: 2px 0; }
.price-table .price-label { padding-right: 8px; font-weight: 600; }
.price-table .price { text-align: right; }

.instructors {
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    margin: 0 0 18px;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.dates {
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    margin: 0 0 12px;
    color: var(--ink);
}

.location {
    text-align: center;
    margin: 0 0 12px;
    color: var(--ink);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.section-divider {
    width: 75%;
    margin: 12px auto;
    border: none;
    border-top: 2px solid #6b7684;
}
.form-narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.form-fields { max-width: 480px; margin-left: auto; margin-right: auto; }

.center-narrow { max-width: 460px; margin-left: auto; margin-right: auto; }

/* Detail page: name and state badge together, centred; badge sits top-right of the name. */
h1.aikidoka-title { display: flex; justify-content: center; gap: 10px; align-items: flex-start; text-align: center; }

.receipt-table td { border: none; padding: 6px 16px 6px 0; }
.receipt-table td.k { color: var(--muted); }

.events-table td { font-size: 14px; }
.events-table .session-id {
    max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters > div { flex: 1; min-width: 140px; }

.danger-zone { border-color: var(--red); background: #fffafa; }

.reset-confirm-input { max-width: 200px; }

.frame {
    background: var(--card); border: 1px solid var(--green);
    border-radius: 10px; box-shadow: 0 6px 18px rgba(26, 86, 50, .12);
    overflow: hidden; margin: 16px 0;
}
.frame table { margin: 0; }
