:root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #151515;
    background: #f3f4f6;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f3f4f6;
}

a { color: inherit; text-decoration: none; }

button, input, select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app {
    width: min(820px, 100%);
    margin: 0 auto;
    padding: 0 16px 48px;
}

.topbar {
    min-height: 58px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(243,244,246,.95);
    backdrop-filter: blur(12px);
}

.back {
    font-weight: 650;
}

.home-link {
    font-weight: 750;
    text-align: center;
}

.hero, .page-title, .selected-header {
    padding: 28px 4px 20px;
}

.hero h1, .page-title h1, .selected-header h1 {
    margin: 0 0 6px;
    line-height: 1.1;
}

.hero p, .page-title p, .selected-header p {
    margin: 0;
    color: #6b7280;
}

.selected-header {
    text-align: center;
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin: 12px 0 24px;
    box-shadow: 0 5px 24px rgba(0,0,0,.05);
}

.eyebrow {
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    margin-bottom: 8px;
}

.large-icon {
    font-size: 42px;
    margin-bottom: 8px;
}

.menu-grid {
    display: grid;
    gap: 14px;
}

.menu-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 5px 24px rgba(0,0,0,.05);
}

.menu-card strong {
    font-size: 20px;
}

.menu-card small {
    color: #6b7280;
}

.menu-icon {
    font-size: 34px;
}

.admin-card {
    margin-top: 8px;
}

.list-stack {
    display: grid;
    gap: 10px;
}

.list-stack.compact {
    gap: 8px;
}

.list-card {
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 3px 16px rgba(0,0,0,.04);
}

.list-card.static {
    min-height: 64px;
}

.list-card small,
.player-label small {
    display: block;
    color: #6b7280;
    margin-top: 2px;
}

.number, .jersey {
    min-width: 48px;
    font-size: 19px;
    font-weight: 800;
}

.chevron {
    margin-left: auto;
    font-size: 32px;
    color: #9ca3af;
}

.grow { flex: 1; }

.section-title {
    margin: 8px 4px 14px;
    font-size: 19px;
}

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

.penalty-tile {
    min-height: 190px;
    background: white;
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,.05);
}

.penalty-tile.selectable {
    justify-content: center;
}

.tile-icon {
    font-size: 34px;
}

.penalty-tile strong {
    line-height: 1.15;
}

.amount {
    color: #6b7280;
    font-weight: 700;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: auto;
}

.action-row form {
    margin: 0;
}

.action {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 12px;
    font-size: 29px;
    font-weight: 800;
}

.minus {
    background: #fee2e2;
    color: #991b1b;
}

.plus {
    background: #dcfce7;
    color: #166534;
}

.player-action-grid {
    display: grid;
    gap: 12px;
}

.player-action-card {
    background: white;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,.05);
}

.player-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.billing-card .open-amount {
    text-align: right;
}

.open-amount small {
    display: block;
    color: #6b7280;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
}

.summary-card small {
    display: block;
    color: #6b7280;
    margin-bottom: 6px;
}

.summary-card strong {
    font-size: 23px;
}

.summary-card.emphasis {
    background: #111827;
    color: white;
}

.summary-card.emphasis small {
    color: #d1d5db;
}

.panel {
    background: white;
    border-radius: 18px;
    padding: 18px;
    margin: 14px 0;
    box-shadow: 0 4px 18px rgba(0,0,0,.04);
}

.panel h2 {
    margin-top: 0;
}

.form-stack {
    display: grid;
    gap: 12px;
}

.form-stack label {
    display: grid;
    gap: 6px;
    font-weight: 650;
}

input, select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: white;
}

.primary-button {
    border: 0;
    border-radius: 12px;
    padding: 14px 16px;
    background: #111827;
    color: white;
    font-weight: 750;
}

.history {
    display: grid;
}

.history-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #eceff3;
}

.history-row:last-child {
    border-bottom: 0;
}

.history-main {
    display: grid;
    gap: 4px;
}

.history-main small {
    color: #6b7280;
}

.history-top {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.badge {
    font-size: 12px;
    font-weight: 750;
    padding: 4px 7px;
    border-radius: 999px;
    background: #eef2ff;
}

.positive { color: #991b1b; }
.negative { color: #166534; }

.flash-wrap {
    display: grid;
    gap: 8px;
    margin: 6px 0 12px;
}

.flash {
    background: #111827;
    color: white;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
}

.toggle {
    border: 0;
    padding: 9px 12px;
    border-radius: 999px;
    font-weight: 750;
}

.toggle.on {
    background: #dcfce7;
    color: #166534;
}

.toggle.off {
    background: #e5e7eb;
    color: #4b5563;
}

hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

.hint, .muted {
    color: #6b7280;
    font-size: 14px;
}

.muted-panel {
    color: #6b7280;
}

@media (min-width: 700px) {
    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

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


.action:disabled {
    opacity: .72;
}

.action.pressed {
    transform: scale(.94);
}

.action-toast {
    position: fixed;
    left: 50%;
    bottom: max(22px, env(safe-area-inset-bottom));
    transform: translate(-50%, 18px);
    width: min(92vw, 620px);
    padding: 13px 16px;
    border-radius: 14px;
    background: #111827;
    color: white;
    box-shadow: 0 14px 35px rgba(0,0,0,.22);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    z-index: 100;
    font-weight: 700;
    line-height: 1.35;
}

.action-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.action-toast.error {
    background: #991b1b;
}

.action-toast > div + div {
    margin-top: 6px;
}


.logout-form {
    margin: 0;
    justify-self: end;
}

.user-chip {
    border: 0;
    background: white;
    border-radius: 999px;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 750;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.login-shell {
    min-height: calc(100vh - 90px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(100%, 430px);
    background: white;
    padding: 28px;
    border-radius: 22px;
    box-shadow: 0 10px 35px rgba(0,0,0,.07);
}

.login-card h1 {
    margin: 8px 0 4px;
    text-align: center;
}

.login-card > p {
    margin: 0 0 22px;
    text-align: center;
    color: #6b7280;
}

.login-icon {
    text-align: center;
    font-size: 44px;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 11px 13px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: 650;
}

.passkey-preview {
    display: grid;
    gap: 3px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
}

.passkey-preview small {
    line-height: 1.35;
}


.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.overview-table {
    display: grid;
    gap: 10px;
}

.overview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid #eceff3;
    border-radius: 15px;
    background: #fff;
}

.overview-row.overdue {
    border-color: #f59e0b;
    background: #fffbeb;
}

.overview-player {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.overview-player small {
    display: block;
    color: #6b7280;
    margin-top: 2px;
}

.warning-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 750;
}

.overview-metrics {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 18px;
    text-align: right;
}

.overview-metrics small {
    display: block;
    color: #6b7280;
    margin-bottom: 3px;
}

.overview-metrics strong {
    white-space: nowrap;
}

@media (max-width: 650px) {
    .overview-row {
        grid-template-columns: 1fr;
    }

    .overview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        text-align: left;
        padding-left: 60px;
    }

    .overview-metrics .last-payment {
        grid-column: 1 / -1;
    }
}


.brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 0;
}

.brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-name {
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 430px) {
    .brand-logo {
        width: 31px;
        height: 31px;
    }

    .brand-name {
        font-size: 14px;
    }
}


/* Login hat bewusst keinen Mannschafts-Header. */
.login-shell {
    min-height: calc(100vh - 32px);
}


/* Header-Logo proportional zur Schrift statt mit fixer Pixelgröße */
.brand-link {
    font-size: 16px;
    line-height: 1;
    gap: 0.55em;
}

.brand-logo {
    width: auto;
    height: 1.45em;
    max-width: 1.45em;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-name {
    font-size: 1em;
    line-height: 1;
}

.login-version {
    margin-top: 18px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 430px) {
    .brand-link {
        font-size: 14px;
    }

    .brand-logo {
        width: auto;
        height: 1.45em;
        max-width: 1.45em;
    }

    .brand-name {
        font-size: 1em;
    }
}


/* Kompakter Benutzer-Chip */
.user-chip {
    min-width: 2.55em;
    height: 2.2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3em;
    padding: 0 .65em;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1;
}

.user-chip-number {
    padding-left: .35em;
    border-left: 1px solid #e5e7eb;
}

/* Versionsstand klar unterhalb der Login-Karte */
.login-shell {
    grid-template-rows: auto auto;
    align-content: center;
    row-gap: 14px;
}

.login-version-footer {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .02em;
}

@media (max-width: 430px) {
    .user-chip {
        min-width: 2.35em;
        height: 2.05em;
        padding: 0 .55em;
        font-size: 12px;
    }
}

/* Admin-Verwaltung v0.5 */
.panel-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-heading-row h2 {
    margin-bottom: 4px;
}

.panel-heading-row .hint {
    margin: 0;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.secondary-button {
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 11px 14px;
    background: white;
    color: #111827;
    font-weight: 750;
}

.full-button {
    width: 100%;
}

.admin-list {
    display: grid;
    gap: 10px;
}

.admin-manage-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.admin-manage-card.is-inactive {
    opacity: .68;
}

.admin-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.admin-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.admin-title-line strong {
    overflow-wrap: anywhere;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
}

.status-pill.status-on {
    background: #dcfce7;
    color: #166534;
}

.status-pill.status-off {
    background: #e5e7eb;
    color: #4b5563;
}

.admin-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-card-actions form {
    margin: 0;
}

.admin-penalty-card {
    color: inherit;
}

.admin-penalty-icon {
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 12px;
    background: white;
    display: grid;
    place-items: center;
    font-size: 24px;
}

.admin-note {
    margin: 14px 2px 0;
}

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

.setting-switch-list {
    display: grid;
    gap: 10px;
    margin: 4px 0;
}

.setting-switch-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
}

.setting-switch-row span {
    min-width: 0;
}

.setting-switch-row small {
    display: block;
    color: #6b7280;
    font-weight: 500;
    margin-top: 4px;
    line-height: 1.35;
}

.setting-switch-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    accent-color: #111827;
}

.form-error {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 700;
}

.form-page-note {
    margin: 12px 4px;
}

@media (max-width: 620px) {
    .panel-heading-row {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-heading-row .primary-button {
        width: 100%;
    }

    .admin-manage-card:not(.admin-penalty-card) {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-card-actions {
        justify-content: stretch;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .admin-card-actions .toggle,
    .admin-card-actions .secondary-button {
        width: 100%;
        min-height: 42px;
    }

    .form-two-columns {
        grid-template-columns: 1fr;
    }
}

/* Version 0.65: kompakter Adminbereich mit Untermenüs */
.admin-page-title {
    padding-bottom: 10px;
}

.admin-management-panel {
    padding-bottom: 16px;
}

.admin-submenu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-submenu-card {
    position: relative;
    min-height: 145px;
    padding: 18px;
}

.admin-submenu-card .menu-icon {
    font-size: 30px;
}

.admin-submenu-card strong {
    font-size: 18px;
}

.submenu-chevron {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 30px;
}

.admin-subpage-title {
    padding-bottom: 10px;
}

.admin-list-panel {
    margin-top: 4px;
}

@media (max-width: 540px) {
    .admin-submenu-card {
        min-height: 132px;
        padding: 16px;
    }

    .admin-submenu-card small {
        padding-right: 18px;
    }
}

/* Version 0.66: Excel-Exporte in der Übersicht */
.export-panel {
    margin-top: 4px;
}

.export-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 14px;
    align-items: end;
}

.export-main-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.export-stat-form {
    display: grid;
    gap: 7px;
    margin: 0;
}

.export-stat-form label {
    font-weight: 700;
    font-size: 14px;
}

.export-stat-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.export-stat-controls select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: white;
    padding: 0 12px;
    font: inherit;
}

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

    .export-stat-controls {
        grid-template-columns: 1fr;
    }

    .export-main-button,
    .export-stat-controls .secondary-button {
        width: 100%;
    }
}

/* Version 0.68: Saisonverwaltung */
.season-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
}

.season-active-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.season-active-row p {
    margin: 5px 0 0;
}

.season-checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
    grid-template-columns: none !important;
}

.season-checkbox-row input {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.season-card {
    align-items: flex-start;
}

.season-card.is-inactive {
    opacity: 1;
}

.season-dates {
    display: block;
    margin-top: 5px;
    color: #6b7280;
}

.season-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(90px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.season-metrics span {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    background: white;
    border: 1px solid #e5e7eb;
}

.season-metrics small {
    color: #6b7280;
}

.season-activate-form {
    margin: 0;
}

.season-warning {
    margin: 12px 4px 0;
}

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

    .season-card {
        flex-direction: column;
    }

    .season-activate-form,
    .season-activate-form .secondary-button {
        width: 100%;
    }
}
