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

:root {
    --black: #0a0a0a;
    --black-2: #141414;
    --black-3: #1c1c1c;
    --gold: #d4af37;
    --gold-bright: #f5c842;
    --gold-dim: #8b7128;
    --blue: #4a9eff;
    --blue-deep: #1e3a8a;
    --white: #f5f5f5;
    --gray: #9ca3af;
    --gray-dark: #2a2a2a;
    --red-bg: #2a0f12;
    --red-border: #7a1d24;
    --red-text: #ff8a92;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(ellipse at top, #1a1a1a 0%, var(--black) 60%);
    color: var(--white);
    line-height: 1.5;
    min-height: 100vh;
    background-attachment: fixed;
}

.topbar {
    background: var(--black);
    border-bottom: 2px solid var(--gold);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.08);
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gold);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.topbar nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-name {
    color: var(--gray);
    font-size: 0.9rem;
}

.topbar nav a {
    color: var(--blue);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    border: 1px solid rgba(74, 158, 255, 0.3);
    transition: all 0.2s ease;
    font-weight: 500;
}

.topbar nav a:hover {
    color: var(--white);
    background: var(--blue-deep);
    border-color: var(--blue);
}

.container {
    max-width: 440px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.container-wide {
    max-width: 800px;
}

.card {
    background: linear-gradient(180deg, var(--black-3) 0%, var(--black-2) 100%);
    border: 1px solid var(--gray-dark);
    border-top: 3px solid var(--gold);
    border-radius: 10px;
    padding: 2.25rem;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(212, 175, 55, 0.05);
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--white);
    letter-spacing: -0.3px;
}

.subtitle {
    color: var(--gold-bright);
    margin-bottom: 1.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.muted {
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 1rem;
}

label {
    display: block;
    margin-bottom: 1.1rem;
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="tel"],
input[type="time"],
input[type="date"],
select {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--gray-dark);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--black);
    color: var(--white);
    transition: all 0.2s ease;
}

input::placeholder {
    color: #555;
}

input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
    background: var(--black-2);
}

button {
    display: block;
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
    color: var(--black);
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.75rem;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.15s ease;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
}

button:hover {
    background: linear-gradient(180deg, #ffd54a 0%, var(--gold-bright) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.error {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red-text);
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.card p {
    color: var(--white);
}

.card p strong {
    color: var(--gold-bright);
    font-weight: 700;
}

p + p {
    margin-top: 0.6rem;
}

/* ---------- nav active state ---------- */
.topbar nav a.active {
    background: var(--black-3);
    border-color: var(--gold);
    color: var(--gold);
}

/* ---------- page head with action ---------- */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.page-head h1 {
    margin: 0;
}

.card-flat {
    padding: 1rem;
}

/* ---------- table ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--white);
}

.data-table th,
.data-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-dark);
}

.data-table thead th {
    color: var(--gold);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--gold-dim);
    font-weight: 700;
}

.data-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.04);
}

.data-table td.num,
.data-table th.num {
    text-align: right;
}

.data-table td.actions,
.data-table th.actions {
    text-align: right;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state p:first-child {
    color: var(--gold);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ---------- buttons (non-primary) ---------- */
.btn {
    display: inline-block;
    padding: 0.6rem 1.15rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.15s ease;
}

.btn-gold {
    background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
    color: var(--black);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
}

.btn-gold:hover {
    background: linear-gradient(180deg, #ffd54a 0%, var(--gold-bright) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-danger {
    background: #5a1820;
    color: var(--red-text);
    border: 1px solid var(--red-border);
}

.btn-danger:hover {
    background: #7a1d24;
    color: #fff;
}

.btn-small {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--gray-dark);
    color: var(--blue);
    background: transparent;
    cursor: pointer;
    margin-left: 0.4rem;
    font-family: inherit;
    transition: all 0.15s ease;
}

.btn-small:hover {
    border-color: var(--blue);
    background: var(--blue-deep);
    color: #fff;
}

.btn-small.btn-danger {
    color: var(--red-text);
    border-color: var(--red-border);
}

.btn-small.btn-danger:hover {
    background: #5a1820;
    color: #fff;
}

.btn-secondary {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--gray);
    border: 1px solid var(--gray-dark);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    width: auto;
}

.btn-secondary:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.btn-ghost {
    background: transparent;
    color: var(--gray);
    border: 1px solid var(--gray-dark);
}

.btn-ghost:hover {
    border-color: var(--red-border);
    color: var(--red-text);
}

.btn-link {
    color: var(--blue);
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-link:hover {
    color: var(--white);
}

/* ---------- forms ---------- */
.form-section {
    color: var(--gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-dark);
}

.form-section:first-child {
    margin-top: 0;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

textarea {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--gray-dark);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--black);
    color: var(--white);
    resize: vertical;
    min-height: 70px;
}

textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
    background: var(--black-2);
}

input[type="number"] {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--gray-dark);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--black);
    color: var(--white);
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
    background: var(--black-2);
}

.req {
    color: var(--red-text);
    font-weight: 700;
}

.field-error {
    display: block;
    color: var(--red-text);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.muted.small {
    font-size: 0.85rem;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--red-text);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0;
}

.checkbox-inline input {
    width: auto;
    margin: 0;
}

.athlete-entry {
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-dark);
}

.athlete-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.remove-link {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-block;
    background: none;
    border: none;
    color: var(--red-text);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    width: auto;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
    font-family: inherit;
}

.remove-link:hover {
    color: #fff;
    background: none;
    transform: none;
    box-shadow: none;
}

.remove-check {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--red-text);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 0;
}

.remove-check input {
    width: auto;
    margin: 0;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.form-actions-row {
    justify-content: space-between;
    gap: 0.75rem;
}

.form-actions .btn,
.form-actions button {
    width: auto;
    padding: 0.75rem 1.5rem;
}

/* ---------- availability week grid ---------- */
.week-grid {
    width: 100%;
    border-collapse: collapse;
    user-select: none;
    table-layout: fixed;
}

.week-grid th {
    padding: 0.5rem 0.15rem 0.35rem;
    text-align: center;
    font-size: 0.7rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    border-bottom: 1px solid var(--gray-dark);
}

.week-grid th.wg-corner {
    width: 70px;
}

.clear-day-btn {
    display: block;
    margin: 0.25rem auto 0;
    padding: 0.1rem 0.4rem;
    width: auto;
    background: transparent;
    color: var(--gray);
    border: 1px solid var(--gray-dark);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1;
    box-shadow: none;
}

.clear-day-btn:hover {
    color: var(--red-text);
    border-color: var(--red-border);
    background: rgba(122, 29, 36, 0.3);
    transform: none;
    box-shadow: none;
}

.week-grid .wg-time {
    padding: 0.25rem 0.5rem 0.25rem 0;
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
    width: 70px;
}

.week-grid td.wg-cell {
    padding: 0.15rem;
}

.wg-box {
    height: 30px;
    border-radius: 4px;
    border: 1px solid var(--gray-dark);
    background: var(--black);
    cursor: pointer;
    transition: all 0.12s ease;
}

.wg-box:hover {
    border-color: var(--gold-dim);
}

.wg-box.active {
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

.wg-box.blocked {
    background: linear-gradient(180deg, #7a1d24 0%, #5a1820 100%);
    border-color: var(--red-border);
    box-shadow: 0 0 8px rgba(255, 138, 146, 0.15);
}

/* single-day grid (for date exceptions) */
.time-grid {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.time-slot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--gray-dark);
    background: var(--black);
    transition: all 0.15s ease;
    user-select: none;
}

.time-slot:hover {
    border-color: var(--gold-dim);
}

.time-slot.active {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
}

.time-slot .time-label {
    width: 80px;
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 600;
    flex-shrink: 0;
}

.time-slot.active .time-label {
    color: var(--gold-bright);
}

.time-slot .slot-bar {
    flex: 1;
    height: 24px;
    border-radius: 4px;
    background: var(--black-3);
    transition: all 0.15s ease;
}

.time-slot.active .slot-bar {
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dim) 100%);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

/* ---------- public booking grid ---------- */
.week-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.week-nav-btn {
    color: var(--blue);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 6px;
    transition: all 0.15s ease;
}

.week-nav-btn:hover {
    background: var(--blue-deep);
    border-color: var(--blue);
    color: var(--white);
}

.week-nav-btn.disabled {
    visibility: hidden;
}

.week-nav-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-bright);
}

.book-grid th {
    line-height: 1.3;
}

.book-grid th.past-day {
    opacity: 0.35;
}

.book-day-name {
    display: block;
    font-size: 0.7rem;
    color: var(--gold);
}

.book-day-date {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
    font-weight: 600;
}

.wg-box.bookable {
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
    border-color: var(--gold);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.wg-box.bookable:hover {
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.45);
    transform: scale(1.05);
}

.wg-box.bookable.selected {
    background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
    border-color: var(--gold-bright);
    box-shadow: 0 0 18px rgba(245, 200, 66, 0.6);
    transform: scale(1.08);
}

.wg-box.unavailable {
    background: var(--black);
    border-color: var(--gray-dark);
    cursor: default;
    opacity: 0.4;
}

/* ---------- session type picker ---------- */
.session-type-picker {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-type-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--gray-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--black);
    margin-bottom: 0;
}

.session-type-option:hover {
    border-color: var(--gold-dim);
}

.session-type-option.selected {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

.session-type-option input[type="radio"] {
    display: none;
}

.st-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
    text-transform: none;
    letter-spacing: 0;
}

.session-type-option.selected .st-label {
    color: var(--gold-bright);
}

.st-price {
    font-size: 0.8rem;
    color: var(--gray);
    margin-left: auto;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

/* ---------- athlete auto-suggestions ---------- */
#athlete-fields label {
    position: relative;
}

.athlete-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 100;
    background: var(--black-2);
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.sug-item {
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--white);
    transition: background 0.12s ease;
    border-bottom: 1px solid var(--gray-dark);
}

.sug-item:last-child {
    border-bottom: none;
}

.sug-item:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-bright);
}

/* ---------- session type badge ---------- */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-solo {
    background: rgba(74, 158, 255, 0.15);
    color: var(--blue);
    border: 1px solid rgba(74, 158, 255, 0.3);
}

.badge-semi {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-bright);
    border: 1px solid var(--gold-dim);
}

.badge-trio {
    background: rgba(122, 223, 153, 0.15);
    color: #7adf99;
    border: 1px solid rgba(42, 106, 61, 0.6);
}

/* ---------- flash messages ---------- */
.flash {
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.flash-success {
    background: #102a17;
    border: 1px solid #2a6a3d;
    color: #7adf99;
}

.flash-error {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red-text);
}

.flash-info {
    background: rgba(74, 158, 255, 0.08);
    border: 1px solid rgba(74, 158, 255, 0.3);
    color: var(--blue);
}

/* ---------- honeypot (anti-bot) ---------- */
.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- copy-link row ---------- */
.copy-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin-top: 0.4rem;
}

.copy-row input {
    flex: 1;
    margin-top: 0;
    background: var(--black);
    color: var(--gold-bright);
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.9rem;
}

.copy-row .btn,
.copy-row .btn-secondary {
    margin-top: 0;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .copy-row {
        flex-direction: column;
    }
    .row {
        grid-template-columns: 1fr;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--gray-dark);
        border-radius: 6px;
        padding: 0.5rem;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        border: none;
        padding: 0.4rem 0.5rem;
    }

    .data-table td.actions {
        justify-content: flex-end;
    }

    .session-type-option {
        flex-wrap: wrap;
    }

    .st-price {
        width: 100%;
        margin-left: 0;
        margin-top: 0.25rem;
        font-size: 0.75rem;
    }
}
