* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f8f1;
    color: #0f5132;
}

header {
    background: #ffffff;
    color: #ffffff;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #90bd1f;
}

.container {
    width: min(1100px, 95%);
    margin: 0 auto;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #0b6b4a;
    text-decoration: none;
}

.brand-logo {
    width: 240px;
    max-width: 62vw;
    height: auto;
}

.admin-header-menu {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.admin-header-menu a {
    text-decoration: none;
    color: #0b6b4a;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.admin-header-menu a.active {
    text-decoration: underline;
    text-underline-offset: 0.18rem;
    color: #0b6b4a;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(11, 107, 74, 0.1);
}

.dashboard-error {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid #f5c2c7;
    border-left: 6px solid #d9534f;
    border-radius: 10px;
    background: #fff1f1;
    color: #7a1f1a;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.dashboard-error-icon {
    font-size: 1rem;
    line-height: 1;
}

#dashboard-error-message {
    flex: 1;
    min-width: 0;
}

.dashboard-error-close {
    border: 0;
    background: transparent;
    color: #7a1f1a;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
}

.dashboard-error-close:hover {
    color: #56100d;
}

.progress-card {
    margin-top: 0.9rem;
    display: grid;
    gap: 0.45rem;
}

.progress-card-compact {
    margin-top: 0;
    min-width: 150px;
    gap: 0.25rem;
}

.progress-card-compact .progress-meta {
    justify-content: flex-end;
    font-size: 0.85rem;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.progress-track {
    width: 100%;
    height: 0.9rem;
    border: none;
    border-radius: 999px;
    overflow: hidden;
    background: #e7f0df;
}

.progress-track-compact {
    height: 0.55rem;
}

.monitor-detail-button {
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #0b6b4a;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
    cursor: pointer;
}

.monitor-detail-modal {
    width: min(920px, 92vw);
    max-width: 92vw;
    border: 1px solid #d9e8cc;
    border-radius: 12px;
    padding: 1rem;
}

.monitor-detail-modal::backdrop {
    background: rgba(13, 31, 26, 0.48);
}

.monitor-detail-modal-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.6rem;
}

.monitor-modal-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.monitor-entries-table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    font-size: 0.92rem;
}

.monitor-entries-table th,
.monitor-entries-table td {
    padding: 0.4rem 0.5rem;
}

.mandatory-card {
    margin-top: 0.85rem;
    padding: 0.75rem;
    border: 1px solid #d4e4ca;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.mandatory-status {
    display: inline-block;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.mandatory-status-ok {
    background: #d8f1dc;
    color: #1f6e36;
}

.mandatory-status-open {
    background: #fce5d8;
    color: #8a3d1f;
}

.progress-track::-webkit-progress-bar {
    background: #e7f0df;
    border-radius: 999px;
}

.progress-track::-webkit-progress-value {
    background: linear-gradient(90deg, #90bd1f 0%, #3f8f2f 100%);
    border-radius: 999px;
}

.progress-track::-moz-progress-bar {
    background: linear-gradient(90deg, #90bd1f 0%, #3f8f2f 100%);
    border-radius: 999px;
}

.card-narrow {
    max-width: 440px;
}

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

.login-card {
    width: min(440px, 100%);
    margin: 0;
}

.form-grid {
    display: grid;
    gap: 0.75rem;
}

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

.form-4 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr !important;
    }
}

.form-align-end {
    align-items: end;
}

label {
    display: grid;
    gap: 0.3rem;
    font-size: 0.92rem;
    min-width: 0;
}

input,
button,
select {
    border: 1px solid #c2d8b2;
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    font-size: 0.95rem;
    min-width: 0;
    box-sizing: border-box;
}

input,
select {
    width: 100%;
}

select {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button {
    background: #90bd1f;
    color: #ffffff;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    width: fit-content;
}

button:hover {
    background: #7ea619;
}

.btn-secondary {
    background: #0b6b4a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    width: fit-content;
}

.danger {
    background: #b5412e;
    color: #ffffff;
}

.danger:hover {
    background: #983527;
}

.btn-link {
    background: transparent;
    color: #0f9ab6;
    text-decoration: underline;
    padding: 0;
    width: auto;
}

a {
    color: #0b6b4a;
}

a:hover {
    color: #08543a;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tabs a {
    padding: 0.75rem 1rem;
    border-radius: 10px 10px 0 0;
    border: 1px solid #d9e8cc;
    border-bottom: none;
    text-decoration: none;
    background: #f3f8ec;
    color: #3e6b54;
    font-weight: 600;
}

.tabs a.active {
    background: #ffffff;
    border-color: #d9e8cc;
    color: #0b6b4a;
    font-weight: 700;
}

.tabs-top {
    margin: -0.5rem 0 0.9rem;
    border-bottom: 1px solid #d9e8cc;
    align-items: flex-end;
}

.tabs-top a {
    position: relative;
    top: 1px;
}

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

th,
td {
    text-align: left;
    border-bottom: 1px solid #d9e8cc;
    padding: 0.55rem;
    vertical-align: top;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .container {
        width: 95%;
    }

    .row-between {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .header-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .brand-logo {
        max-width: 80vw;
    }

    .admin-header-menu {
        justify-content: center;
        margin-top: 0.5rem;
    }

    .header-right {
        display: flex;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .header-right button {
        width: 100%;
    }

    /* Responsive Table: Cards on Mobile */
    .table-responsive table, 
    .table-responsive thead, 
    .table-responsive tbody, 
    .table-responsive th, 
    .table-responsive td, 
    .table-responsive tr {
        display: block;
    }

    .table-responsive thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive tr {
        border: 1px solid #d9e8cc;
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 0.5rem;
        background: #fff;
    }

    .table-responsive td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 45%;
        text-align: right;
        min-height: 2rem;
    }

    .table-responsive td:last-child {
        border-bottom: 0;
    }

    .table-responsive td:before {
        position: absolute;
        top: 0.55rem;
        left: 0.55rem;
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        content: attr(data-label);
        color: #0b6b4a;
    }

    .entry-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-end;
    }

    .entry-actions .inline {
        margin-left: 0;
    }

    .review-actions {
        min-width: 0;
        width: 100%;
    }

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

    .review-form select, 
    .review-form input[type="text"], 
    .review-form button {
        width: 100%;
    }
}

th {
    color: #0b6b4a;
}

.inline,
.inline-form {
    display: inline;
}

.stack-actions {
    display: grid;
    gap: 0.5rem;
}

.entry-actions {
    white-space: nowrap;
}

.entry-actions .inline {
    margin-left: 0.55rem;
}

.review-actions {
    min-width: 280px;
}

.review-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.review-form select {
    width: auto;
    min-width: 8.5rem;
}

.review-form input[type="text"] {
    min-width: 12rem;
}

.review-form button {
    width: auto;
}

.target-actions {
    min-width: 210px;
}

.target-form {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
}

.target-form input[type="text"] {
    width: 7.5rem;
    min-width: 6.5rem;
}

.target-form button {
    width: auto;
    white-space: nowrap;
}

.login-card button {
    width: 100%;
}

.error {
    color: #bc5318;
}

.hint {
    color: #4a7058;
    font-size: 0.86rem;
}

.hint.small {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.2rem auto 1.6rem;
    font-size: 0.9rem;
    color: #4a7058;
}

/* Aufgabenbörse / Pinnwand */
.task-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
    .task-board {
        grid-template-columns: 1fr;
    }
}

.task-card {
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    border-left: 4px solid #90bd1f;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.task-category {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #666;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
}

.task-card h4 {
    margin: 0.5rem 0;
    color: #0b6b4a;
}

.task-description {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
    white-space: pre-wrap;
}

.task-details {
    font-size: 0.85rem;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.task-footer {
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    color: #888;
}

.btn-delete {
    color: #d9534f;
    text-decoration: none;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 5px;
}

.btn-delete:hover {
    color: #c9302c;
}

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

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

textarea {
    width: 100%;
    border: 1px solid #c2d8b2;
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}