body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    margin: 0;
    background: #f3f6fb;
    color: #0f172a;
    overflow-x: hidden;
}

.container {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 1.25rem);
    box-sizing: border-box;
}

.site-header {
    background: linear-gradient(135deg, #3f6dd8, #7fb2ff);
    color: #fff;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 12px 32px rgba(12, 35, 92, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.site-logo {
    width: 72px;
    height: auto;
    border-radius: 14px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    background: #fff;
    padding: 0.35rem;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
}

.site-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.85rem;
    letter-spacing: 0.01em;
}

.primary-nav a {
    color: #e9f2ff;
    margin-right: 1.25rem;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    box-sizing: border-box;
}

.primary-nav a:hover,
.primary-nav a:focus {
    text-decoration: underline;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-subtitle {
    margin: 0;
    color: #cbd5f5;
    font-size: 0.9rem;
}

.admin-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #e2e8f0;
}

.admin-nav {
    margin-top: 1rem;
}

.admin-nav a {
    font-weight: 600;
}

.card {
    background: #fff;
    border-radius: 14px;
    padding: 1.75rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
}

.card h2 {
    margin-top: 0;
    font-size: 1.35rem;
}

.two-factor-card {
    max-width: 420px;
    margin: 0 auto;
}

.two-factor-card .two-factor-input {
    max-width: 7rem;
    font-size: 1.6rem;
    text-align: center;
    letter-spacing: 0.2rem;
    padding: 0.5rem 0.75rem;
}

.two-factor-links {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-start;
}

.btn.link {
    background: transparent;
    color: #3f6dd8;
    box-shadow: none;
    padding: 0;
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.application-subtitle {
    margin: 0.2rem 0 0;
    color: #475569;
    font-size: 1rem;
}

.application-status {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.application-meta {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

@media (min-width: 640px) {
    .application-meta {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.application-meta__item {
    background: #f8fbff;
    border: 1px solid #e4ecff;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.application-meta__label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.application-meta__value {
    font-weight: 600;
    color: #0f172a;
    font-size: 1.05rem;
}

.application-meta__hint {
    display: block;
    margin-top: 0.35rem;
    color: #475569;
    font-size: 0.85rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #c5d1e4;
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' fill='none'%3E%3Cpath fill='%23526389' d='M0 0l4 6 4-6H0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 0.65rem;
    padding-right: 2.25rem;
}

select::-ms-expand {
    display: none;
}

input[type="date"] {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.card--form input[type="date"] {
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #4b82f5;
    outline: none;
    box-shadow: 0 0 0 4px rgba(103, 151, 244, 0.22);
}

.grid {
    display: grid;
    row-gap: 1rem;
    column-gap: 1.75rem;
}

.grid > * {
    min-width: 0;
}

.grid.col-2 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid.col-3 {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.6rem;
    background: #4b82f5;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 12px 18px rgba(75, 130, 245, 0.25);
}

.btn.secondary {
    background: #475569;
    box-shadow: none;
}

.btn-success {
    background: #059669;
    color: #fff;
}

.btn:hover,
.btn:focus {
    background: #3c73e6;
    transform: translateY(-1px);
    box-shadow: 0 16px 24px rgba(75, 130, 245, 0.22);
}

.alert {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.warning {
    background: #fef3c7;
    color: #92400e;
}

.member-card {
    border: 1px solid #e3e9f5;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    background: #f9fbff;
    box-shadow: 0 8px 20px rgba(71, 84, 199, 0.08);
}

.admin-member-grid {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

@media (min-width: 768px) {
    .admin-member-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

.admin-member-card {
    background: #f8fbff;
    border: 1px solid #e4ecff;
    border-radius: 14px;
    padding: 1.4rem;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-member-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.admin-member-card__header h4 {
    margin: 0;
    font-size: 1.15rem;
}

.admin-member-card__meta {
    margin: 0.25rem 0 0;
    color: #475569;
    font-size: 0.9rem;
}

.admin-member-card__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-member-card__section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-member-card__label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 600;
}

.admin-member-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #e8f0ff;
    color: #1e3a8a;
    font-size: 0.85rem;
    font-weight: 600;
}

.chip span {
    font-weight: 500;
    color: #475569;
}

.chip--muted {
    background: #e2e8f0;
    color: #475569;
}

.member-card h3 {
    margin-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.member-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.note {
    font-size: 0.9rem;
    color: #475569;
}

.note--spaced {
    display: block;
    margin-bottom: 0.9rem;
}

.department-grid {
    column-gap: 1.5rem;
    row-gap: 1rem;
    margin-top: 0.75rem;
}

.member-card label + .department-grid {
    margin-top: 0.75rem;
}

.department-option {
    display: flex;
    width: 100%;
}

.department-option__label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #dbe2f6;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
    box-sizing: border-box;
}

.department-option__label input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.department-option__label span {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.department-option__title {
    font-weight: 600;
    color: #1f2937;
}

.department-option__price {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    display: inline-flex;
    align-items: flex-start;
    gap: 0.45rem;
    align-self: flex-start;
}

.department-option__price-tier {
    display: inline-flex;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    background: #f8fafc;
    line-height: 1.2;
}

.department-option__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #b45309;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    padding-top: 0.05rem;
}

.form-section {
    margin-top: 1.25rem;
}

.form-section:first-of-type {
    margin-top: 1.5rem;
}

.form-section + .form-section {
    margin-top: 1rem;
}

.form-checkbox {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-weight: 500;
    line-height: 1.5;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.form-checkbox span {
    display: inline-block;
    flex: 1;
    color: #1f2937;
    line-height: 1.5;
}

.form-checkbox .link-button {
    margin: 0 0.15rem;
    padding: 0;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.form-help {
    margin: 0 0 1.25rem;
    color: #475569;
    font-size: 0.95rem;
}

.field-note {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #64748b;
    min-height: 1em;
}

.input--short {
    max-width: 120px;
}

.input--zip {
    max-width: 160px;
}

.input--medium {
    max-width: 280px;
}

.input--iban {
    max-width: 420px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.input--bic {
    max-width: 100%;
    text-transform: uppercase;
}


.card form > div:not(.form-actions):not(.gdpr-notice):not(.waitlist-code-card):not(.alert) {
    margin-bottom: 1.25rem;
}

.card form .grid {
    margin-bottom: 1.25rem;
}

.card--narrow {
    max-width: 420px;
    margin: 2rem auto;
}

.gdpr-notice {
    margin-top: 1.25rem;
    padding: 1rem 1.15rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    color: #1e3a8a;
    font-size: 0.95rem;
    line-height: 1.5;
}

.admin .admin-grid {
    box-sizing: border-box;
    width: 100%;
}

.admin .admin-grid input,
.admin .admin-grid select,
.admin .admin-grid textarea {
    width: 100%;
    box-sizing: border-box;
}

.user-inline-form input,
.user-inline-form select,
.user-inline-form textarea {
    width: 100%;
    max-width: 340px;
    box-sizing: border-box;
}

.user-inline-form input[type="email"] {
    max-width: 360px;
}

.user-create-form input,
.user-create-form select,
.user-create-form textarea {
    width: 100%;
    box-sizing: border-box;
}

.page-flex {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 2.25rem;
    align-items: flex-start;
}

.summary-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
    border: 1px solid #e1e7f5;
    position: sticky;
    top: 1.5rem;
}

.waitlist-code-card {
    margin-top: 1.75rem;
    padding: 1.5rem;
    border: 1px solid #facc15;
    border-radius: 14px;
    background: #fffbeb;
    display: none;
}

.waitlist-code-card.is-visible {
    display: block;
}

.waitlist-hint {
    margin: 0 0 1rem;
    color: #92400e;
    font-size: 0.95rem;
    line-height: 1.5;
}

.waitlist-code-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.waitlist-code-item label {
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.submit-mobile {
    display: none;
}

.submit-desktop {
    display: inline-block;
}

.waitlist-code-item input {
    max-width: 220px;
}

.waitlist-code-item small {
    color: #b45309;
    font-size: 0.85rem;
}

.summary-panel h3 {
    margin-top: 0;
    font-size: 1.25rem;
}

.summary-placeholder {
    color: #64748b;
    line-height: 1.5;
    font-size: 0.95rem;
}

.summary-breakdown {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.summary-breakdown li {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.summary-section + .summary-section {
    margin-top: 1.4rem;
}

.summary-section h4 {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    color: #334155;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 2px solid #d1d9ec;
    font-weight: 700;
    font-size: 1.05rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(75, 130, 245, 0.12);
    color: #3c73e6;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tag--info {
    background: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
}

.tag--success {
    background: rgba(34, 197, 94, 0.18);
    color: #047857;
}

.tag--warning {
    background: rgba(250, 204, 21, 0.22);
    color: #b45309;
}

.tag--danger {
    background: rgba(248, 113, 113, 0.22);
    color: #b91c1c;
}

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

.table th,
.table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.table tr:hover {
    background: #f1f5f9;
}

.fee-summary th,
.fee-summary td {
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.fee-summary tr:last-child td {
    border-bottom: none;
}

.fee-summary .total {
    font-weight: 700;
}

.site-footer {
    background: #0f1a2f;
    color: #cbd5f5;
    padding: 1.25rem 0;
    margin-top: 2.5rem;
}

.site-footer small {
    display: block;
    text-align: center;
}

.link-button {
    background: none;
    border: none;
    color: #3c73e6;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    text-decoration: underline;
}

.link-button.inline-link {
    margin: 0 0.15rem;
    padding: 0;
    text-decoration: underline;
    display: inline;
}

.checkbox-text {
    display: inline;
}

.link-button:hover,
.link-button:focus {
    color: #2855c7;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
}

.modal.is-visible {
    display: flex;
}

.modal__dialog {
    background: #fff;
    border-radius: 16px;
    max-width: 640px;
    width: min(640px, 100%);
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
    position: relative;
    padding: 2rem;
}

.modal__dialog h3 {
    margin-top: 0;
}

.modal__content {
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.6;
    color: #1f2937;
}

.modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: none;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.modal__divider {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

.admin .admin-grid {
    background: #f4f7ff;
    border-radius: 14px;
    border: 1px solid #dbe2f6;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin .admin-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.filter-form__row {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: end;
}

.filter-form__field label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    display: block;
}

.filter-form__field--search {
    min-width: 280px;
}

.filter-form__search-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-form__search-controls input[type="search"] {
    flex: 1;
}

.card--form form,
.card--form .grid {
    width: 100%;
    box-sizing: border-box;
}

.card--form input,
.card--form select,
.card--form textarea {
    box-sizing: border-box;
}

.admin .note {
    margin-bottom: 0;
}

.user-actions {
    border: 1px solid #dce4f8;
    border-radius: 12px;
    background: #f8fbff;
    padding: 0.85rem 1rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.user-actions > summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
}

.user-actions > summary::-webkit-details-marker {
    display: none;
}

.user-actions > summary::after {
    content: '\276F';
    font-size: 0.85rem;
    transform: rotate(90deg);
    margin-left: auto;
    transition: transform 0.2s ease;
}

.user-actions[open] > summary::after {
    transform: rotate(-90deg);
}

.user-actions[open] > summary {
    margin-bottom: 0.85rem;
}

.user-inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.75rem;
}

.user-inline-form .form-actions {
    margin-top: 0.5rem;
}

.user-inline-form + .user-inline-form {
    border-top: 1px solid #e2e8f0;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.user-inline-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.user-inline-form small.alert {
    margin: 0;
}

.settings-section {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.settings-section summary {
    cursor: pointer;
    padding: 1rem 1.2rem;
    background: #f8fafc;
    font-weight: 700;
    list-style: none;
}

.settings-section summary::-webkit-details-marker {
    display: none;
}

.settings-section summary:after {
    content: '\25BC';
    float: right;
    transition: transform 0.2s ease;
}

.settings-section[open] summary:after {
    transform: rotate(-180deg);
}

.settings-section__content {
    padding: 1.25rem 1.5rem 1.5rem;
    background: #fff;
}

.admin .admin-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.admin .admin-grid input {
    border-radius: 10px;
}

@media (max-width: 768px) {
    .primary-nav {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        align-items: flex-start;
        width: 100%;
    }

    .primary-nav a {
        margin: 0 !important;
        width: 100%;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 999px;
        padding: 0.65rem 1rem;
        border: 1px solid rgba(255, 255, 255, 0.35);
        text-align: center;
        box-sizing: border-box;
    }

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

    .page-flex {
        grid-template-columns: 1fr;
    }

    .summary-panel {
        position: static;
        margin-top: 1.5rem;
    }

    .submit-desktop {
        display: none;
    }

    .submit-mobile {
        display: block;
        margin-top: 1rem;
    }

    .member-card {
        padding: 1.1rem;
    }

    .member-card h3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
        margin-bottom: 0.2rem;
    }

    .member-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .department-option__label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .department-option__label span {
        width: 100%;
        align-items: flex-start;
    }

    .input--short,
    .input--zip,
    .input--medium,
    .input--iban,
    .input--bic {
        max-width: 100%;
    }

    .grid.col-3 input[type="date"] {
        width: 90%;
        max-width: 90%;
        min-width: 0;
        display: block;
    }

    .filter-form__search-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .filter-form__search-controls .btn {
        width: 100%;
    }

    .filter-form__row {
        grid-template-columns: 1fr;
    }

    .filter-form__field--search {
        min-width: 0;
    }

    .form-checkbox input[type="checkbox"] {
        margin-top: 0;
    }
}
.code-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copy {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    line-height: 1;
    background: transparent;
    border: none;
    cursor: pointer;
}

.logout-link {
    font-weight: 600;
}

.page-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}
