/* assets/anwesenheitsliste.css */
html.anw-scroll-page, 
body.anw-scroll-page {
    overflow: auto !important;
    height: auto !important;
}

.anw-container {
    --bg: #f4f4f6;
    --surface: #ffffff;
    --surface-muted: #f8f8f9;
    --border: #d6d6da;
    --text: #202124;
    --text-muted: #5f6368;
    --accent: #c43124;
    --accent-dark: #9d241a;
    --danger-bg: #fff0ef;
    --danger-border: #efc1bc;
    --success-bg: #edf7ef;
    --success-border: #bfdcc4;
    display: block !important;
    width: 100% !important;
    grid-template-columns: none !important;
}

body.dark-mode .anw-container {
    --bg: #1c1e22;
    --surface: #282b30;
    --surface-muted: #1e2024;
    --border: #3a3f47;
    --text: #e0e0e0;
    --text-muted: #9aa0a6;
    --accent: #e57373;
    --accent-dark: #f44336;
    --danger-bg: #4a1919;
    --danger-border: #732a2a;
    --success-bg: #1b3d20;
    --success-border: #2e6035;
}

.anw-container .page-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 40px;
}

.anw-container .page-header { margin-bottom: 20px; }
.anw-container .page-header h1 { margin: 0 0 8px; font-size: 2rem; color: var(--text); }
.anw-container .page-header p { margin: 0; color: var(--text-muted); }

.anw-container .message {
    margin-bottom: 20px; padding: 16px 18px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
    color: var(--text);
}
.anw-container .message h2 { margin: 0 0 10px; font-size: 1rem; }
.anw-container .message-error { background: var(--danger-bg); border-color: var(--danger-border); }
.anw-container .message-success { background: var(--success-bg); border-color: var(--success-border); }

.anw-container .attendance-form { display: grid; gap: 20px; }
.anw-container .form-section {
    padding: 22px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
}
.anw-container .field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.anw-container .field { display: grid; gap: 8px; }
.anw-container .field span, .anw-container .section-head p, .anw-container .helper-text { color: var(--text-muted); }
.anw-container .required-mark { color: var(--accent); font-weight: 700; }
.anw-container .optional-mark { color: var(--text-muted); font-size: 0.92em; }
.anw-container .field input, .anw-container .field select, .anw-container .field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; 
    background: var(--surface); color: var(--text); font: inherit;
}
.anw-container .field textarea { resize: vertical; min-height: 110px; }
.anw-container .field-full { margin-top: 18px; }
.anw-container .is-hidden { display: none !important; }

.anw-container .section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.anw-container .section-head h2 { margin: 0 0 6px; font-size: 1.1rem; }
.anw-container .icon-toggle-button {
    width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface-muted); color: var(--text-muted);
    display: inline-grid; place-items: center; font-size: 1.25rem; line-height: 1; cursor: pointer;
    transition: all 0.15s ease;
}
.anw-container .icon-toggle-button:hover { background: var(--surface); color: var(--text); }
.anw-container .icon-toggle-button.is-open { color: var(--accent); transform: rotate(45deg); }

.anw-container .member-manager-panel {
    margin-bottom: 16px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted);
}
.anw-container .management-form { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.8fr) auto; gap: 16px; align-items: end; }
.anw-container .context-note { margin: 0 0 12px; color: var(--text-muted); }

.anw-container .participant-table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.anw-container .participant-header, .anw-container .participant-row {
    display: grid; grid-template-columns: minmax(220px, 1fr) repeat(4, 78px); align-items: center;
}
.anw-container .participant-header { background: var(--surface-muted); font-weight: 600; }
.anw-container .participant-header span { padding: 14px 10px; text-align: center; }
.anw-container .participant-header span:first-child { text-align: left; padding-left: 14px; }
.anw-container .participant-row { border-top: 1px solid var(--border); }
.anw-container .participant-name-cell { display: flex; align-items: center; min-height: 52px; border-right: 1px solid var(--border); padding: 0 14px; }
.anw-container .participant-empty { padding: 16px 14px; color: var(--text-muted); }
.anw-container .checkbox-cell { display: grid; place-items: center; min-height: 52px; border-left: 1px solid var(--border); }
.anw-container .checkbox-cell input { width: 18px; height: 18px; }

.anw-container .secondary-button, .anw-container .primary-button {
    cursor: pointer; border: 1px solid transparent; border-radius: 6px; font: inherit; padding: 10px 14px; transition: all 0.15s ease;
}
.anw-container .secondary-button { background: var(--surface-muted); border-color: var(--border); color: var(--text); }
.anw-container .secondary-button:hover:not(:disabled) { background: var(--surface); }
.anw-container .secondary-button:disabled { opacity: 0.6; cursor: not-allowed; }

.anw-container .primary-button { padding: 12px 18px; background: var(--accent); color: #fff; }
.anw-container .primary-button:hover:not(:disabled) { background: var(--accent-dark); }
.anw-container .primary-button:disabled { opacity: 0.6; cursor: not-allowed; }

.anw-container .mail-button { background: #1565c0; color: #fff; }
.anw-container .mail-button:hover:not(:disabled) { background: #0d47a1; }

.anw-container .form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }

@media (max-width: 920px) {
    .anw-container .field-grid { grid-template-columns: 1fr; }
    .anw-container .management-form { grid-template-columns: 1fr; }
    .anw-container .participant-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .anw-container .participant-header, .anw-container .participant-row { min-width: 500px; }
}

@media (max-width: 600px) {
    .anw-container .page-shell { padding: 10px 5px; }
    .anw-container .page-header { margin-bottom: 12px; }
    .anw-container .page-header h1 { font-size: 1.25rem; }
    .anw-container .page-header p { font-size: 0.85rem; }
    
    .anw-container .form-section { padding: 12px 10px; gap: 12px; }
    .anw-container .field-grid { gap: 10px; }
    
    .anw-container .field span { font-size: 0.85rem; }
    .anw-container .field input, .anw-container .field select { padding: 8px 10px; font-size: 0.95rem; }
    .anw-container .field textarea { min-height: 80px; padding: 8px 10px; }

    .anw-container .form-actions { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 10px; }
    .anw-container .form-actions button { width: 100%; margin: 0; padding: 10px; font-size: 0.95rem; }
    
    .anw-container .participant-header, .anw-container .participant-row { 
        min-width: 380px; 
        grid-template-columns: 1fr repeat(4, 42px); 
    }
    .anw-container .participant-header span, .anw-container .participant-name-cell { 
        padding: 8px 6px; 
        font-size: 0.85rem;
    }
    .anw-container .participant-name-cell { min-height: 40px; padding-left: 8px; }
    .anw-container .checkbox-cell { min-height: 40px; }
    .anw-container .checkbox-cell input { width: 16px; height: 16px; }
    
    .anw-container .login-info { display: none; }
    
    .login-form-inline { flex-direction: column; align-items: stretch !important; gap: 8px; }
    .login-form-inline input { width: 100% !important; padding: 8px 10px; }
}

/* Login Form Styling */
.login-form-inline {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.login-form-inline input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    width: 200px;
}

.login-error-msg {
    color: var(--accent);
    margin-top: 10px;
    font-weight: 600;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0 10px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
}

.delete-btn:hover {
    transform: scale(1.2);
    color: var(--accent-dark);
}
