
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f5f7;
    color: #202938;
}

.login-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

h1 {
    margin-top: 0;
    margin-bottom: 8px;
    text-align: center;
    font-size: 26px;
}

.subtitle {
    text-align: center;
    color: #667085;
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: bold;
    font-size: 14px;
}

input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
}

input:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

button {
    width: 100%;
    padding: 13px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error {
    color: #b42318;
    background: #fef3f2;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}


/* Sportangebotsauswahl */

.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

.app-header h1 {
    text-align: left;
}

.app-header .subtitle {
    text-align: left;
    margin-bottom: 0;
}

.secondary-button {
    width: auto;
    flex-shrink: 0;
    background: #e2e8f0;
    color: #202938;
}

.secondary-button:hover {
    background: #cbd5e1;
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(100%, 250px), 1fr)
    );
    gap: 16px;
}

.activity-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    text-align: left;
    color: #202938;
    cursor: pointer;
    width: 100%;
}

.activity-card:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

.activity-card h2 {
    font-size: 19px;
    margin: 0 0 8px;
}

.activity-card p {
    margin: 0;
    font-size: 14px;
    color: #667085;
}

.activity-details {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: white;
}

[hidden] {
    display: none !important;
}

@media (max-width: 500px) {
    .app-header {
        flex-direction: column;
    }
}

.event-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.event-actions button {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.date-editor:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}

.date-editor input {
    padding: 0.5rem;
    font: inherit;
}

.date-editor button {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.event-status {
    display: inline-block;
    width: fit-content;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-open {
    background: #e7f3ea;
    color: #226b3a;
}

.status-moved {
    background: #fff1d6;
    color: #885600;
}

.status-cancelled {
    background: #fde8e8;
    color: #a12626;
}

.attendance-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
}

.attendance-card p {
    margin: 0.3rem 0 0;
}

.attendance-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.attendance-checkbox input {
    width: 1.3rem;
    height: 1.3rem;
}
.trial-warning {
    color: #b45309;
    font-weight: 600;
}

.activity-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.activity-navigation a {
    display: inline-block;
    padding: 0.6rem 1rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.activity-navigation a:hover {
    background-color: #f0f0f0;
}

.participant-edit-form:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.participant-edit-form input {
    padding: 0.5rem;
    font: inherit;
}

.participant-edit-form button {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.archive-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

#archive-container:not([hidden]) {
    margin-top: 1rem;
}

.archived-label {
    color: #777;
    font-size: 0.85rem;
    font-style: italic;
    font-weight: normal;
}

.quick-create-section {
    margin-top: 1.5rem;
}

#quick-create-container:not([hidden]) {
    margin-top: 1rem;
    padding: 1.25rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#quick-create-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#quick-create-form h3 {
    margin-top: 1rem;
}

.quick-create-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.guardian-container:not([hidden]) {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
}

.guardian-entry {
    padding: 0.5rem 0;
}

.guardian-entry + .guardian-entry {
    border-top: 1px solid #ddd;
}

.guardian-entry strong {
    display: block;
    margin-bottom: 0.25rem;
}

.guardian-add-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.guardian-add-button {
    margin-top: 0.75rem;
}


/* =========================================
   Teilnehmerverwaltung – kompakte Darstellung
   ========================================= */

#participants-list,
#archived-list {
    display: grid;
    gap: 16px;
}

#participants-list .activity-card,
#archived-list .activity-card {
    padding: 20px;
    border: 1px solid #dce3ed;
    border-radius: 14px;
    background: #ffffff;
    cursor: default;
}

#participants-list .activity-card:hover,
#archived-list .activity-card:hover {
    background: #ffffff;
    border-color: #dce3ed;
}

.participant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.participant-header h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.participant-status {
    margin: 0;
    font-size: 13px;
    color: #667085;
}

.participant-actions,
.guardian-actions,
.guardian-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.participant-actions button,
.guardian-actions button,
.guardian-footer-actions button {
    width: auto;
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 600;
}

.participant-actions .secondary-button,
.guardian-actions .secondary-button,
.guardian-footer-actions .secondary-button {
    background: #e8edf4;
    color: #344054;
}

.participant-actions .secondary-button:hover,
.guardian-actions .secondary-button:hover,
.guardian-footer-actions .secondary-button:hover {
    background: #d7e0eb;
}

.participant-actions .danger-button,
.guardian-actions .danger-button {
    background: #fff1f0;
    color: #b42318;
    border: 1px solid #fecdca;
}

.participant-actions .danger-button:hover,
.guardian-actions .danger-button:hover {
    background: #fee4e2;
}

.guardian-container:not([hidden]) {
    margin-top: 16px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.guardian-entry {
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #ffffff;
}

.guardian-entry + .guardian-entry {
    border-top: 1px solid #e2e8f0;
}

.guardian-entry strong {
    font-size: 14px;
}

.guardian-entry a {
    color: #2563eb;
    font-size: 14px;
    text-decoration: none;
}

.guardian-entry a:hover {
    text-decoration: underline;
}

.guardian-add-form input,
.participant-edit-form input {
    width: 100%;
    margin-bottom: 4px;
}

.guardian-add-form button,
.participant-edit-form button {
    width: auto;
    align-self: flex-start;
}

.guardian-footer-actions {
    margin-top: 12px;
}

@media (max-width: 500px) {
    #participants-list .activity-card,
    #archived-list .activity-card {
        padding: 15px;
    }

    .participant-actions button,
    .guardian-actions button,
    .guardian-footer-actions button {
        flex: 1 1 auto;
    }
}

/* Admin-Eventverwaltung */

.admin-event-section {
    margin-bottom: 24px;
    padding: 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-section-header h2 {
    margin: 0;
    font-size: 20px;
}

#create-event-form:not([hidden]) {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

#create-event-form h3 {
    margin: 0 0 20px;
    font-size: 17px;
}

#create-event-form input {
    max-width: 450px;
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-form-actions button {
    width: auto;
}

#create-event-message {
    font-size: 14px;
    color: #b42318;
}

@media (max-width: 500px) {
    .admin-section-header {
        align-items: stretch;
    }

    .admin-section-header button,
    .admin-form-actions button {
        width: 100%;
    }
}

/* Admin: Sportangebote verwalten */

.admin-description {
    margin: 6px 0 0;
    font-size: 14px;
    color: #667085;
}

#create-activity-form:not([hidden]) {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

#create-activity-form h3 {
    margin: 0 0 20px;
    font-size: 17px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

#create-activity-form input,
#create-activity-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #202938;
}

#create-activity-form select:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

#create-activity-message {
    font-size: 14px;
    color: #b42318;
}

@media (max-width: 500px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}


/* =========================================
   Admin: Betreuerverwaltung
   ========================================= */

#admin-supervisors-section {
    margin-top: 20px;
}

#supervisor-activity-select,
#add-supervisor-user,
#add-supervisor-role {
    width: 100%;
    padding: 12px;
    margin: 8px 0 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    color: #202938;
    font-size: 16px;
}

#supervisor-management {
    margin-top: 24px;
}

#supervisor-activity-title {
    margin-bottom: 16px;
}

.supervisor-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
}

.supervisor-info {
    min-width: 0;
}

.supervisor-info strong {
    overflow-wrap: anywhere;
}

.supervisor-info p {
    margin: 6px 0 0;
    font-size: 14px;
    color: #64748b;
}

.supervisor-info .supervisor-inactive {
    color: #b42318;
}

.supervisor-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.supervisor-actions select {
    width: auto;
    min-width: 120px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
}

.supervisor-actions button {
    width: auto;
    min-width: 120px;
    padding: 10px 12px;
}

#add-supervisor-form {
    margin-top: 16px;
}

#supervisor-message {
    margin-top: 16px;
    font-size: 14px;
}

@media (max-width: 700px) {
    .supervisor-card {
        flex-direction: column;
        align-items: stretch;
    }

    .supervisor-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .supervisor-actions select,
    .supervisor-actions button {
        width: 100%;
    }
}


/* =========================================
   Schritt 130b – Mobile Anwesenheitsliste
   ========================================= */

.attendance-card {
    background: #ffffff;
    border: 1px solid #dce3ed;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    min-width: 0;
}

.attendance-card > div:first-child {
    min-width: 0;
}

.attendance-card strong {
    font-size: 16px;
    overflow-wrap: anywhere;
}

.attendance-card p {
    font-size: 13px;
    color: #667085;
    line-height: 1.5;
}

/* Große, gut bedienbare Checkbox */

.attendance-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    flex-shrink: 0;
    cursor: pointer;
}

.attendance-checkbox input[type="checkbox"] {
    appearance: auto;
    width: 28px;
    height: 28px;
    min-width: 28px;
    margin: 0;
    padding: 0;
    accent-color: #2563eb;
    cursor: pointer;
}

.attendance-checkbox input[type="checkbox"]:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

/* Anwesenheitszähler */

.attendance-summary {
    padding: 16px 20px;
    margin-bottom: 20px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
}

.attendance-summary strong {
    display: block;
    font-size: 24px;
    color: #1d4ed8;
}

.attendance-summary p {
    margin: 5px 0 0;
    font-size: 14px;
    color: #475569;
}

/* Smartphone */

@media (max-width: 600px) {
    .app-container {
        padding: 18px 12px;
    }

    .attendance-card {
        padding: 14px;
        gap: 12px;
        min-height: 76px;
    }

    .attendance-card strong {
        font-size: 16px;
    }

    .attendance-checkbox {
        min-width: 48px;
        min-height: 48px;
    }

    .attendance-checkbox input[type="checkbox"] {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .attendance-summary {
        padding: 14px 16px;
    }

    .attendance-summary strong {
        font-size: 22px;
    }

    .activity-navigation {
        gap: 8px;
    }

    .activity-navigation a {
        flex: 1 1 auto;
        text-align: center;
        padding: 12px;
    }
}


/* =========================================
   Schritt 130b – Mobile Anwesenheitsliste
   ========================================= */

.attendance-page {
    max-width: 760px;
}

.attendance-page h1 {
    text-align: left;
}

.attendance-page #event-title {
    font-size: 21px;
    margin: 24px 0 12px;
}

/* Anwesenheitszähler */

.attendance-summary {
    padding: 20px;
    margin: 20px 0;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
}

.attendance-summary strong {
    display: block;
    font-size: 28px;
    color: #1d4ed8;
}

.attendance-summary p {
    margin: 5px 0 14px;
    font-size: 14px;
    color: #475569;
}

.attendance-progress {
    width: 100%;
    height: 9px;
    background: #dbeafe;
    border-radius: 999px;
    overflow: hidden;
}

#attendance-progress-fill {
    height: 100%;
    width: 0;
    background: #2563eb;
    border-radius: inherit;
    transition: width 0.2s ease;
}

/* Teilnehmerkarten */

.attendance-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px;
    margin-bottom: 12px;
    background: #ffffff;
    border: 1px solid #dce3ed;
    border-radius: 14px;
    min-width: 0;
}

.attendance-card > div:first-child {
    min-width: 0;
}

.attendance-card strong {
    font-size: 16px;
    overflow-wrap: anywhere;
}

.attendance-card p {
    margin: 6px 0 0;
    font-size: 13px;
    color: #667085;
    line-height: 1.5;
}

/* Anwesende Kinder hervorheben */

.attendance-card.is-present {
    border-color: #86efac;
    background: #f0fdf4;
}

.attendance-card.is-archived {
    opacity: 0.65;
}

/* Große Checkboxen */

.attendance-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    flex-shrink: 0;
    cursor: pointer;
}

.attendance-checkbox input[type="checkbox"] {
    width: 28px;
    height: 28px;
    min-width: 28px;
    margin: 0;
    padding: 0;
    accent-color: #16a34a;
    cursor: pointer;
}

.attendance-checkbox input[type="checkbox"]:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

/* Smartphone */

@media (max-width: 600px) {
    .attendance-page {
        padding: 18px 12px;
    }

    .attendance-page h1 {
        font-size: 23px;
    }

    .attendance-page #event-title {
        font-size: 18px;
    }

    .attendance-summary {
        padding: 16px;
    }

    .attendance-summary strong {
        font-size: 26px;
    }

    .attendance-card {
        padding: 14px;
        gap: 12px;
        min-height: 80px;
    }

    .attendance-checkbox {
        min-width: 48px;
        min-height: 48px;
    }

    .attendance-checkbox input[type="checkbox"] {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .attendance-checkbox span {
        display: none;
    }

    .attendance-page .quick-create-section button {
        min-height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #attendance-progress-fill {
        transition: none;
    }
}
/* Schnuppergrenze erreicht */

.attendance-card.trial-limit-reached,
.attendance-card.is-present.trial-limit-reached {
    background: #fffbeb;
    border: 2px solid #f59e0b;
}

.attendance-card.trial-limit-reached .trial-warning {
    color: #92400e;
    font-weight: 700;
}


/* =========================================
   Schritt 130c.1 – Teilnehmersuche
   ========================================= */

.participant-search {
    margin: 16px 0 20px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.participant-search label {
    margin-bottom: 10px;
}

.participant-search input {
    width: 100%;
    margin-bottom: 8px;
    min-height: 48px;
    font-size: 16px;
}

.participant-search-count {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
}

@media (max-width: 600px) {
    .participant-search {
        padding: 12px;
        margin: 12px 0 16px;
    }

    .participant-search input {
        min-height: 52px;
    }
}


/* =========================================
   Schritt 130c.2 – Einklappbare Teilnehmerkarten
   ========================================= */

/* Desktop: Details immer sichtbar */

.participant-details {
    display: block;
}

.participant-details-toggle {
    display: none;
}

/* Smartphone */

@media (max-width: 600px) {
    #participants-list .participant-header {
        align-items: center;
    }

    #participants-list .participant-header h3 {
        font-size: 17px;
        margin: 0;
    }

    #participants-list .participant-details-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        min-width: 115px;
        min-height: 44px;
        padding: 10px;
        font-size: 13px;
        flex-shrink: 0;
    }

    #participants-list .participant-details {
        display: none;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e2e8f0;
    }

    #participants-list .activity-card:has(
        .participant-details-toggle[aria-expanded="true"]
    ) .participant-details {
        display: block;
    }

    #participants-list .participant-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #participants-list .participant-actions button {
        width: 100%;
        min-height: 44px;
        font-size: 14px;
    }

    #participants-list .participant-edit-form button {
        min-height: 44px;
    }
}


/* =========================================
   Schritt 130c.2 – Archivierte Teilnehmer mobil
   ========================================= */

@media (max-width: 600px) {

    #archived-list .participant-header {
        align-items: center;
    }

    #archived-list .participant-header h3 {
        font-size: 17px;
        margin: 0;
    }

    #archived-list .participant-details-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        min-width: 115px;
        min-height: 44px;
        padding: 10px;
        font-size: 13px;
        flex-shrink: 0;
    }

    #archived-list .participant-details {
        display: none;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e2e8f0;
    }

    #archived-list .activity-card:has(
        .participant-details-toggle[aria-expanded="true"]
    ) .participant-details {
        display: block;
    }

    #archived-list .participant-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #archived-list .participant-actions button {
        width: 100%;
        min-height: 44px;
        font-size: 14px;
    }
}

/* =========================================
   Schritt 130c.3 – Mobile Kontaktpersonen
   ========================================= */

.guardian-container {
    min-width: 0;
}

.guardian-entry {
    min-width: 0;
}

.guardian-entry strong {
    font-size: 15px;
    overflow-wrap: anywhere;
}

/* Telefonnummer gut sichtbar und antippbar */

.guardian-entry a[href^="tel:"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 0;
    color: #1d4ed8;
    font-size: 16px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

/* Einheitliche Eingabefelder */

.guardian-add-form input,
.guardian-add-form select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 12px;
    margin-bottom: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #202938;
    font-size: 16px;
}

.guardian-add-form input:focus,
.guardian-add-form select:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

/* Smartphone */

@media (max-width: 600px) {

    .guardian-container:not([hidden]) {
        padding: 10px;
    }

    .guardian-entry {
        padding: 14px;
        margin-bottom: 10px;
    }

    .guardian-actions,
    .guardian-footer-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .guardian-actions button,
    .guardian-footer-actions button {
        width: 100%;
        min-height: 48px;
        padding: 12px;
        font-size: 14px;
    }

    .guardian-add-form {
        padding: 12px;
    }

    .guardian-add-form button {
        width: 100%;
        min-height: 48px;
        align-self: stretch;
    }

    .guardian-entry a[href^="tel:"] {
        min-height: 48px;
    }
}