* {
    box-sizing: border-box;
}

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

.container {
    width: min(1100px, calc(100% - 24px));
    margin: 0 auto;
}

.site-header {
    background: #1f5fbf;
    color: #fff;
    padding: 16px 0;
    margin-bottom: 20px;
}

.site-header h1 {
    margin: 0;
    font-size: 1.4rem;
}

.site-main {
    padding-bottom: 30px;
}

.card {
    background: #fff;
    border: 1px solid #d8dde3;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    background: #e8f6ea;
    color: #1e6a2f;
}

.alert-error {
    background: #fdeaea;
    color: #9b1d1d;
}

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

.field {
    display: flex;
    flex-direction: column;
}

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

.field-checkbox {
    justify-content: flex-end;
}

.field label {
    font-weight: bold;
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #b8c0cc;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.btn {
    background: #1f5fbf;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
}

.btn:hover {
    background: #184d9d;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #d8dde3;
    text-align: left;
    vertical-align: top;
}

.button-table th,
.button-table td {
    padding: 10px 12px;
    border-bottom: none;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #eef2f6;
}

.field-inline .inline-fields {
    display: flex;
    gap: 8px;
    align-items: center;
}

.anrede {
    width: 110px;
    padding: 10px;
    border: 1px solid #b8c0cc;
    border-radius: 8px;
}

.ansprechpartner {
    flex: 1;
    min-width: 120px;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #6b7280;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-small {
    padding: 7px 12px;
    font-size: 13px;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 999;
    height: 50px;
    background: #2d5ea8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    font-weight: bold;
}

.app-topbar-title {
    font-size: 16px;
}

.app-menu-toggle {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.app-menu-panel {
    position: fixed;
    top: 0;
    right: -280px;
    width: 260px;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    transition: right 0.25s ease;
    box-shadow: -3px 0 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

.app-menu-panel.open {
    right: 0;
}

.app-menu-header {
    background: #2d5ea8;
    color: #fff;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-menu-header button {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.app-menu-nav {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-menu-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f2f4f7;
    color: #333;
    text-decoration: none;
}

.app-menu-nav a:hover {
    background: #e4e8ee;
}

.app-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: none;
    z-index: 900;
}

.app-menu-backdrop.show {
    display: block;
}

.status-ok {
    color: #1e6a2f;
}

.status-open {
    color: #9b1d1d;
}

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

    .site-header h1 {
        font-size: 1.15rem;
    }

    .card {
        padding: 14px;
    }

    .data-table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 13px;
    }

    .data-table:not(.responsive-table) th:first-child,
    .data-table:not(.responsive-table) td:first-child {
        width: 80px;
    }

    .data-table:not(.responsive-table) th:nth-child(2),
    .data-table:not(.responsive-table) td:nth-child(2) {
        width: auto;
    }

    .data-table:not(.responsive-table) th:nth-child(3),
    .data-table:not(.responsive-table) td:nth-child(3) {
        width: 100px;
    }

    .btn-small {
        padding: 6px 8px;
        font-size: 12px;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .responsive-table {
        min-width: 0 !important;
        table-layout: auto !important;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        margin-bottom: 14px;
        border: 1px solid #d8dde3;
        border-radius: 14px;
        padding: 12px 14px;
        background: #fff;
        box-sizing: border-box;
    }

    .responsive-table td {
        display: flex;
        align-items: flex-start;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #eee;
        font-size: 14px;
        text-align: left;
        box-sizing: border-box;
        width: 100% !important;
    }

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

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #333;
        width: 105px;
        min-width: 105px;
        padding-right: 12px;
        box-sizing: border-box;
    }

    .responsive-table .cell-value {
        display: block;
        width: calc(100% - 105px);
        min-width: 0;
        margin-left: 0;
        text-align: right;
        white-space: normal;
        word-break: normal;
        overflow-wrap: normal;
    }

    .responsive-table td[data-label="Monteure"] .cell-value {
        text-align: right;
        white-space: normal;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .responsive-table td[data-label="KW"] .cell-value,
    .responsive-table td[data-label="Von"] .cell-value,
    .responsive-table td[data-label="Bis"] .cell-value,
    .responsive-table td[data-label="Status"] .cell-value {
        white-space: nowrap;
    }

    .responsive-table td[data-label="Aktionen"] .cell-value {
        width: calc(100% - 105px);
    }

    .responsive-table td[data-label="Aktionen"] .form-actions {
        justify-content: flex-end;
    }
}