:root {
    --blue: #003cc8;
    --blue-dark: #00288c;
    --blue-light: #e9f0ff;
    --blue-soft: #f4f7ff;
    --white: #ffffff;
    --yellow: #ffe500;
    --text: #17233e;
    --muted: #5c6b86;
    --border: #cbd7ee;
    --success: #14713d;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--blue-soft);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

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

.container {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    border-bottom: 4px solid var(--yellow);
    background: linear-gradient(120deg, var(--blue-dark), var(--blue));
    color: var(--white);
    box-shadow: 0 3px 15px rgba(0, 40, 140, 0.2);
}

.header-inner {
    display: flex;
    min-height: 88px;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    color: var(--white);
    text-decoration: none;
}

.club-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--white);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-text strong {
    font-size: 19px;
}

.brand-text small {
    margin-top: 4px;
    opacity: 0.85;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 18px;
}

.navigation a {
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
}

.navigation a:hover {
    color: var(--yellow);
}

.user-name {
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

main.container {
    min-height: calc(100vh - 164px);
    padding-top: 35px;
    padding-bottom: 45px;
}

.site-footer {
    margin-top: 30px;
    padding: 18px 0;
    border-top: 4px solid var(--yellow);
    background: var(--blue-dark);
    color: var(--white);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 3px;
    background: var(--white);
}

.card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 5px 18px rgba(0, 45, 145, 0.08);
}

.hero,
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 25px;
    padding: 30px 34px;
    border-radius: 12px;
    background: linear-gradient(120deg, var(--blue-dark), var(--blue));
    color: var(--white);
    box-shadow: 0 7px 25px rgba(0, 45, 145, 0.22);
}

.hero h1,
.dashboard-hero h1 {
    margin: 4px 0 8px;
    font-size: clamp(28px, 4vw, 40px);
}

.hero p,
.dashboard-hero p {
    margin: 0;
}

.hero-kicker {
    margin: 0;
    color: var(--yellow);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.hero-logo,
.dashboard-logo {
    width: 150px;
    max-height: 175px;
    object-fit: contain;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.22));
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.page-heading h1 {
    margin: 3px 0 0;
}

.button {
    display: inline-block;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--blue);
    color: var(--white);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.button:hover {
    background: var(--blue-dark);
}

.button-secondary {
    background: var(--blue-light);
    color: var(--blue-dark);
}

.button-secondary:hover {
    background: #d7e4ff;
}

.button-full {
    width: 100%;
    margin-top: 5px;
}

.alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 6px;
    font-weight: 600;
}

.alert-success {
    border: 1px solid #9dd7b0;
    background: #e8f8ed;
    color: var(--success);
}

.alert-error {
    border: 1px solid #efb4ae;
    background: #fff1f0;
    color: var(--danger);
}

.login-card {
    width: min(460px, 100%);
    margin: 25px auto;
}

.login-card h1 {
    margin-bottom: 2px;
    color: var(--blue-dark);
    text-align: center;
}

.login-card p {
    margin-top: 0;
    color: var(--muted);
    text-align: center;
}

.login-logo-wrap {
    text-align: center;
}

.login-logo {
    width: 130px;
    height: 150px;
    object-fit: contain;
}

label {
    display: block;
    margin-bottom: 16px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #aebfe2;
    border-radius: 6px;
    background: var(--white);
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--blue);
    outline: 3px solid rgba(0, 60, 200, 0.15);
}

textarea {
    resize: vertical;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 17px;
    margin-bottom: 25px;
}

.dashboard-card {
    display: flex;
    min-height: 145px;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    border: 1px solid var(--border);
    border-top: 5px solid var(--blue);
    border-radius: 10px;
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0, 45, 145, 0.08);
    color: var(--text);
    text-decoration: none;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 45, 145, 0.15);
}

.dashboard-number {
    color: var(--blue);
    font-size: 40px;
    font-weight: 800;
}

.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
}

.admin-action-card {
    display: flex;
    min-height: 120px;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    border-radius: 10px;
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0, 45, 145, 0.08);
    color: var(--text);
    text-decoration: none;
}

.admin-action-card strong {
    margin-bottom: 5px;
    color: var(--blue-dark);
    font-size: 18px;
}

.admin-action-card span {
    color: var(--muted);
}

.admin-action-card:hover {
    background: var(--blue-light);
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 22px;
    padding: 16px;
}

.search-form input {
    margin: 0;
}

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

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

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #dce5f5;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--blue-light);
    color: var(--blue-dark);
}

tr:hover td {
    background: #f8faff;
}

small,
.muted {
    color: var(--muted);
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
}

.status-active,
.status-honorary {
    background: #dff5e7;
    color: #126334;
}

.status-passive,
.status-pending {
    background: #fff4cf;
    color: #7b5800;
}

.status-left,
.status-deceased {
    background: #e8edf5;
    color: #43536d;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 20px;
}

.full-width {
    grid-column: 1 / -1;
}

.form-section-title {
    margin-top: 14px;
    padding-top: 16px;
    border-top: 2px solid var(--blue-light);
}

.form-section-title h2 {
    margin: 0 0 15px;
    color: var(--blue-dark);
    font-size: 20px;
}

.form-actions {
    margin-top: 8px;
}

.department-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--blue-soft);
}

.department-selection legend {
    padding: 0 7px;
    color: var(--blue-dark);
    font-weight: 800;
}

.department-selection label,
.checkbox-line {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-weight: 400;
}

.department-selection input,
.checkbox-line input {
    width: auto;
    margin: 0;
}

.two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 22px;
    align-items: start;
}

.section-space {
    margin-top: 22px;
}

.highlight-row td {
    background: #fff8cd !important;
    font-weight: 700;
}

.calendar {
    padding: 0;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 22px;
    background: var(--blue);
    color: var(--white);
}

.calendar-header h2 {
    margin: 0;
}

.calendar-nav {
    border: 0;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    font-size: 29px;
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays {
    border-bottom: 1px solid var(--border);
    background: var(--blue-light);
    color: var(--blue-dark);
    font-weight: 800;
    text-align: center;
}

.calendar-weekdays div {
    padding: 11px 3px;
}

.calendar-day {
    min-height: 120px;
    padding: 7px;
    border-right: 1px solid #dce5f5;
    border-bottom: 1px solid #dce5f5;
}

.calendar-day:nth-child(7n) {
    border-right: 0;
}

.calendar-day.empty {
    background: #f8faff;
}

.calendar-day-number {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
}

.calendar-day.today .calendar-day-number {
    background: var(--blue);
    color: var(--white);
}

.calendar-event {
    display: block;
    width: 100%;
    overflow: hidden;
    margin: 3px 0;
    padding: 5px 6px;
    border: 0;
    border-left: 4px solid var(--blue);
    border-radius: 3px;
    background: var(--blue-light);
    color: var(--blue-dark);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.event-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 24, 85, 0.65);
}

.event-modal-content {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    border-top: 7px solid var(--blue);
    border-radius: 10px;
    background: var(--white);
}

.modal-close {
    position: absolute;
    top: 9px;
    right: 15px;
    border: 0;
    background: transparent;
    color: var(--blue-dark);
    cursor: pointer;
    font-size: 32px;
}

.event-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--blue);
    color: var(--white);
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .header-inner,
    .page-heading,
    .hero,
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-inner {
        padding: 12px 0;
    }

    .navigation {
        flex-wrap: wrap;
    }

    .user-name {
        padding-left: 0;
        border-left: 0;
    }

    .hero-logo,
    .dashboard-logo {
        align-self: center;
        width: 110px;
    }

    .dashboard-grid,
    .admin-action-grid,
    .two-columns,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .calendar-day {
        min-height: 83px;
        padding: 4px;
    }

    .calendar-weekdays div {
        font-size: 12px;
    }

    .calendar-event {
        padding: 3px;
        font-size: 10px;
    }
}

.filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 20px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--blue-soft);
}

.filter-form label {
    margin: 0;
}

.inline-form {
    display: inline;
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--blue);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.danger-link {
    margin-left: 10px;
    color: var(--danger);
}

.action-column {
    white-space: nowrap;
}

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

    .danger-link {
        margin-left: 6px;
    }
}
