.app-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

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

.welcome-user {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.95rem;
}

.site-nav .active {
    color: var(--accent);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg-elev);
    color: var(--text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-hero {
    padding: 2.4rem 0;
    background: linear-gradient(135deg, color-mix(in srgb, var(--bg-hero) 88%, #121d33), color-mix(in srgb, var(--bg-hero) 74%, #243d68));
    color: #fff;
}

.app-hero h1 {
    margin: 0.3rem 0 0.7rem;
    font-family: "Outfit", sans-serif;
    font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.app-content {
    padding: 2rem 0 3.2rem;
}

.card-panel {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.card-panel h2 {
    margin: 0 0 1rem;
    font-family: "Outfit", sans-serif;
    font-size: 1.45rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-field label {
    font-size: 0.92rem;
    font-weight: 700;
}

.form-field input,
.form-field select {
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font: inherit;
    width: 100%;
    min-height: 42px;
    line-height: 1.2;
}

.form-field input[type="checkbox"],
.form-field input[type="radio"] {
    width: auto;
    min-height: auto;
    padding: 0;
    border-radius: 4px;
    accent-color: var(--accent);
}

.form-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.2rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-soft) 50%),
        linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% - 3px),
        calc(100% - 10px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.form-field select:focus,
.form-field input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.form-actions {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.9rem;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.7rem;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 700;
}

.row-actions {
    display: inline-flex;
    gap: 0.3rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg-elev);
    color: var(--text-soft);
    cursor: pointer;
}

.icon-btn.edit {
    color: #1f74d6;
}

.icon-btn.delete {
    color: #c02830;
}

.inline-delete-form {
    margin: 0;
}

.interest-form {
    margin: 0;
    display: inline-flex;
}

.btn-contact {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.data-table tr.match-mutual td {
    background: color-mix(in srgb, #27ae60 18%, var(--bg-elev));
}

.seat-thumb {
    width: 56px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
    display: block;
}

.seat-thumb-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 18, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 1rem;
}

.image-modal.open {
    display: flex;
}

.image-modal__dialog {
    width: min(92vw, 820px);
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 0.85rem;
    position: relative;
}

.image-modal__close {
    position: absolute;
    right: 0.65rem;
    top: 0.65rem;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

.image-modal__title {
    margin: 0 0 0.7rem;
    font-size: 1rem;
    padding-right: 2.2rem;
}

.image-modal__img {
    width: 100%;
    max-height: 76vh;
    border-radius: 10px;
    object-fit: contain;
    background: color-mix(in srgb, var(--bg) 80%, #000);
}

.flash {
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.8rem;
    border: 1px solid transparent;
}

.flash.success {
    background: color-mix(in srgb, #27ae60 16%, var(--bg-elev));
    border-color: color-mix(in srgb, #27ae60 40%, var(--line));
}

.flash.error {
    background: color-mix(in srgb, #e74c3c 16%, var(--bg-elev));
    border-color: color-mix(in srgb, #e74c3c 40%, var(--line));
}

.muted {
    color: var(--text-soft);
}

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

.profile-layout {
    display: grid;
    gap: 1rem;
}

.profile-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.profile-layout,
.profile-row > * {
    min-width: 0;
}

.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.profile-name {
    font-weight: 700;
    font-size: 1.05rem;
}

.kv-list {
    display: grid;
    gap: 0.6rem;
}

.kv-item {
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.45rem;
}

.kv-item span {
    color: var(--text-soft);
    display: block;
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
    margin-bottom: 0;
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #ed1c24, #b8141b);
    box-shadow: 0 16px 32px rgba(102, 12, 16, 0.25);
}

:root[data-club="s04"] .stat-card {
    background: linear-gradient(135deg, #004d9d, #003f82);
    box-shadow: 0 16px 32px rgba(0, 46, 98, 0.25);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.26);
}

.stat-label {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 700;
    font-size: 0.9rem;
}

.stat-value {
    font-family: "Outfit", sans-serif;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 980px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .profile-layout {
        gap: 0.8rem;
    }

    .profile-row {
        grid-template-columns: 1fr;
    }

    .profile-avatar-row {
        align-items: flex-start;
    }

    .profile-layout .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .profile-activity-table th,
    .profile-activity-table td {
        white-space: normal;
        word-break: break-word;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-panel {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        padding: 0.5rem 0 0.9rem;
    }

    .nav-panel.open {
        display: flex;
    }

    .site-nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .site-nav a {
        padding: 0.3rem 0;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    .welcome-user {
        width: 100%;
    }
}
