:root {
    --pfl-blue: #064e2f;
    --pfl-blue-2: #12814f;
    --pfl-blue-soft: #dff5e8;
    --pfl-yellow: #c9f24a;
    --pfl-red: #0f8a45;
    --pfl-ink: #142033;
    --pfl-muted: #667085;
    --pfl-line: #dbe3ee;
    --pfl-bg: #dcefe4;
}

body {
    background:
        linear-gradient(180deg, #b8dfc9 0, var(--pfl-bg) 230px, #eef8f2 100%);
    color: var(--pfl-ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

a {
    color: var(--pfl-blue-2);
}

.pfl-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--pfl-blue) !important;
    border-bottom: 4px solid var(--pfl-yellow);
    box-shadow: 0 10px 24px rgba(6, 43, 95, 0.18);
}

.scroll-top-btn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1040;
    display: none;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--pfl-blue);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(6, 78, 47, 0.28);
}

.scroll-top-btn.is-visible {
    display: grid;
    place-items: center;
}

.scroll-top-btn:hover {
    background: var(--pfl-blue-2);
}

.pfl-header .navbar {
    min-height: 66px;
    background: linear-gradient(90deg, #06381f, #0f6f42, var(--pfl-blue-2)) !important;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    height: 34px;
    padding: 0 8px;
    border: 2px solid var(--pfl-yellow);
    border-radius: 4px;
    color: var(--pfl-yellow);
    font-weight: 900;
    line-height: 1;
}

.pfl-header .nav-link {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.pfl-header .nav-link:hover,
.pfl-header .nav-link:focus {
    color: #fff;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.club-jump-form {
    width: min(280px, 100%);
    margin-right: 14px;
}

.club-jump-form .form-select {
    border-color: rgba(255, 255, 255, 0.35);
    background-color: rgba(255, 255, 255, 0.94);
    color: var(--pfl-blue);
    font-weight: 700;
}

.user-name {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page {
    min-height: calc(100vh - 70px);
}

.page-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(6, 78, 47, 0.94), rgba(18, 129, 79, 0.86));
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 16px 34px rgba(6, 78, 47, 0.2);
}

.page-title h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
}

.page-subtitle {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.78);
}

.section-kicker {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--pfl-yellow);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(11, 61, 38, 0.94), rgba(25, 135, 84, 0.86)),
        radial-gradient(circle at 20% 20%, rgba(214, 243, 91, 0.24), transparent 34%),
        var(--pfl-blue);
}

.login-card {
    width: min(440px, calc(100% - 32px));
    padding: 30px;
    background: #fff;
    border-top: 5px solid var(--pfl-yellow);
    border-radius: 8px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.login-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
}

.login-brand .brand-mark {
    color: var(--pfl-blue);
    border-color: var(--pfl-yellow);
}

.login-card h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
}

.login-card p {
    margin: 4px 0 0;
    color: var(--pfl-muted);
}

.login-form .form-label,
label {
    font-weight: 700;
}

.btn {
    border-radius: 6px;
    font-weight: 700;
}

.btn-primary,
.btn.primary {
    border-color: var(--pfl-blue-2);
    background: var(--pfl-blue-2);
    color: #fff;
}

.btn-primary:hover,
.btn.primary:hover {
    border-color: var(--pfl-blue);
    background: var(--pfl-blue);
    color: #fff;
}

.btn-outline-primary {
    border-color: var(--pfl-blue-2);
    color: var(--pfl-blue-2);
}

.btn-outline-primary:hover {
    border-color: var(--pfl-blue-2);
    background: var(--pfl-blue-2);
}

.panel,
.club-card,
.empty-state {
    margin-bottom: 22px;
    padding: 22px;
    background: #f7fff9;
    border: 1px solid #9bd7b5;
    border-top: 4px solid var(--pfl-blue-2);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(6, 78, 47, 0.12);
}

.club-card {
    scroll-margin-top: 96px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-heading h2,
.panel h2 {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 800;
}

.admin-grid,
.org-buttons,
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.admin-tile,
.org-button {
    min-height: 110px;
    padding: 20px;
    background: linear-gradient(180deg, #ffffff, #effaf4);
    border: 1px solid #9bd7b5;
    border-left: 6px solid var(--pfl-blue-2);
    border-radius: 8px;
    color: var(--pfl-ink);
    text-align: left;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(6, 78, 47, 0.11);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-tile:hover,
.org-button:hover {
    color: var(--pfl-blue);
    border-color: var(--pfl-blue-2);
    background: linear-gradient(180deg, #ffffff, #dff5e8);
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(20, 32, 51, 0.12);
}

.tile-label {
    display: block;
    font-size: 18px;
    font-weight: 800;
}

.tile-note {
    display: block;
    margin-top: 6px;
    color: var(--pfl-muted);
    font-size: 13px;
}

.org-button img {
    display: block;
    height: 72px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 12px;
}

.organization-logo-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 90px;
    padding: 10px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #9bd7b5;
    border-radius: 8px;
}

.organization-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    margin-bottom: 16px;
}

.autocomplete-wrap {
    position: relative;
}

.autocomplete-box {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1100;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid #9bd7b5;
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(6, 78, 47, 0.18);
}

.autocomplete-box.is-open {
    display: block;
}

.autocomplete-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--pfl-ink);
    text-align: left;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
    background: var(--pfl-blue-soft);
    color: var(--pfl-blue);
}

.autocomplete-item span {
    font-weight: 700;
}

.autocomplete-item small {
    color: var(--pfl-muted);
    white-space: nowrap;
}

.data-table {
    --bs-table-bg: #fafffc;
    --bs-table-hover-bg: var(--pfl-blue-soft);
    border-color: #a8dcbc;
}

.data-table th {
    background: #cfeedd;
    color: var(--pfl-blue);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.grid-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    color: var(--pfl-muted);
}

.pagination {
    margin: 0;
}

.club-card header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.club-card h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
}

.club-profile {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 420px;
    gap: 24px;
    margin-bottom: 20px;
}

.club-logo img,
.logo-placeholder {
    width: 140px;
    height: 140px;
    object-fit: contain;
}

.logo-placeholder {
    display: grid;
    place-items: center;
    border: 1px solid #9bd7b5;
    background: #e9f7ef;
    border-radius: 8px;
    color: var(--pfl-muted);
    font-weight: 800;
}

.club-info p {
    margin: 0 0 12px;
    line-height: 1.35;
}

.stadium-photo {
    align-self: start;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid #9bd7b5;
    border-radius: 8px;
    background: #e9f7ef;
}

.stadium-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.editable-table td[contenteditable="true"] {
    min-width: 140px;
    background: #fff;
    outline: none;
}

.editable-table td[contenteditable="true"]:focus {
    box-shadow: inset 0 0 0 2px var(--pfl-blue-2);
}

.editable-table td.is-saving {
    background: #fff8e5;
}

.editable-table td.is-saved {
    background: #ecfdf3;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    padding: 40px 18px;
    background: rgba(15, 23, 42, 0.55);
    overflow: auto;
}

.modal.is-open {
    display: block;
}

.modal-panel {
    position: relative;
    width: min(820px, 100%);
    margin: 0 auto;
    padding: 28px;
    background: #fff;
    border-top: 5px solid var(--pfl-blue-2);
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--pfl-line);
    border-radius: 6px;
    background: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.text-block {
    white-space: normal;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .navbar-user,
    .club-jump-form,
    .club-card header {
        align-items: flex-start;
        flex-direction: column;
    }

    .club-jump-form {
        width: 100%;
        margin: 10px 0;
    }

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

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

    .grid-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
