*{
    box-sizing:border-box;
}

body{
    margin:0;
    min-height:100vh;
    font-family:Arial, Helvetica, sans-serif;
    background:#f3f4f6;
    color:#1f2937;
}

.site-header{
    background:#c1121f;
    color:#fff;
    box-shadow:0 2px 8px rgba(0,0,0,0.15);
}

.header-inner{
    max-width:1200px;
    margin:0 auto;
    padding:15px 20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
}

.logo-area a{
    color:#fff;
    text-decoration:none;
    font-size:22px;
    font-weight:bold;
}

.main-nav{
    display:flex;
    gap:18px;
    flex-wrap:wrap;
}

.main-nav a{
    color:#fff;
    text-decoration:none;
    font-weight:600;
}

.main-nav a:hover{
    text-decoration:underline;
}

.container{
    max-width:1200px;
    margin:30px auto;
    padding:0 20px;
}

.card{
    background:#fff;
    border-radius:12px;
    padding:25px;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
}

.login-card{
    max-width:480px;
    margin:0 auto;
}

.btn{
    display:inline-block;
    padding:10px 18px;
    border:none;
    border-radius:8px;
    text-decoration:none;
    cursor:pointer;
    background:#c1121f;
    color:#fff;
    font-weight:600;
}

.btn:hover{
    opacity:0.9;
}

.btn-secondary{
    background:#374151;
}

.button-row{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-top:20px;
}

input,
select,
textarea{
    width:100%;
    padding:10px;
    border:1px solid #d1d5db;
    border-radius:8px;
    margin-top:5px;
    margin-bottom:15px;
}

label{
    font-weight:600;
}

.alert{
    padding:12px 15px;
    border-radius:8px;
    margin-bottom:18px;
}

.alert-error{
    background:#fee2e2;
    color:#991b1b;
    border:1px solid #fecaca;
}

.footer{
    margin-top:40px;
    padding:25px;
    text-align:center;
    background:#ffffff;
    border-top:1px solid #dbe2ea;
    color:#64748b;
    font-size:14px;
}

.footer p{
    margin:6px 0;
}

.footer a{
    color:#c1121f;
    text-decoration:none;
    font-weight:600;
}

.footer a:hover{
    text-decoration:underline;
}

@media(max-width:700px){
    .header-inner{
        flex-direction:column;
        align-items:flex-start;
    }

    .main-nav{
        gap:12px;
    }
}

.dashboard-title{
    margin-bottom:20px;
}

.dashboard-title h2{
    margin-bottom:5px;
}

.dashboard-title p{
    color:#64748b;
    margin-top:0;
}

.grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:18px;
    margin-bottom:25px;
}

.stat-card{
    background:#ffffff;
    border-radius:12px;
    padding:22px;
    box-shadow:0 2px 10px rgba(0,0,0,0.08);
    border-left:5px solid #c1121f;
}

.stat-number{
    display:block;
    font-size:32px;
    font-weight:bold;
    color:#c1121f;
}

.stat-label{
    display:block;
    margin-top:6px;
    color:#475569;
    font-weight:600;
}

.alert-success{
    background:#dcfce7;
    color:#166534;
    border:1px solid #bbf7d0;
}

.table-responsive{
    width:100%;
    overflow-x:auto;
}

.data-table{
    width:100%;
    border-collapse:collapse;
}

.data-table th,
.data-table td{
    padding:12px 10px;
    border-bottom:1px solid #e5e7eb;
    text-align:left;
    vertical-align:top;
}

.data-table th{
    background:#f9fafb;
    font-weight:700;
    color:#374151;
}

.data-table tr:hover{
    background:#f9fafb;
}

.inline-form{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.btn-small{
    padding:7px 10px;
    font-size:13px;
}

.badge{
    display:inline-block;
    padding:5px 9px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.badge-offen{
    background:#fef3c7;
    color:#92400e;
}

.badge-freigegeben{
    background:#dcfce7;
    color:#166534;
}

.badge-abgelehnt{
    background:#fee2e2;
    color:#991b1b;
}

.compact-row{
    margin-top:0;
    gap:8px;
}

.card h3{
    margin-top:0;
}

input[readonly]{
    background:#f9fafb;
    color:#374151;
}

.checkbox-label{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:18px;
    font-weight:600;
}

.checkbox-label input{
    width:auto;
    margin:0;
}

.btn-danger{
    background:#991b1b;
}

.table-checkbox{
    margin:0;
}

.data-table input,
.data-table select,
.data-table textarea{
    margin-bottom:0;
}

.checklist-category{
    margin-bottom:24px;
    padding:18px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#f9fafb;
}

.checklist-category h4{
    margin:0 0 12px 0;
    color:#1f2937;
}

.checklist-list{
    list-style:none;
    padding:0;
    margin:0;
}

.checklist-list li{
    padding:8px 0;
    border-bottom:1px solid #e5e7eb;
}

.checklist-list li:last-child{
    border-bottom:none;
}

.checkmark{
    display:inline-block;
    color:#166534;
    font-weight:bold;
    margin-right:8px;
}

.muted{
    color:#64748b;
    margin-left:8px;
    font-size:12px;
}

.template-item-list{
    margin-top:18px;
}

.template-item-list h4{
    margin:22px 0 10px 0;
    padding-bottom:6px;
    border-bottom:1px solid #e5e7eb;
}

.template-check-item{
    display:flex;
    align-items:center;
    gap:10px;
    padding:9px 0;
    font-weight:500;
}

.template-check-item input{
    width:auto;
    margin:0;
}

.embedded-form-cell{
    padding:14px 10px !important;
}

.checklist-edit-row{
    display:grid;
    grid-template-columns:100px 180px 1fr 140px 100px auto;
    gap:10px;
    align-items:end;
}

.checklist-edit-row label{
    font-size:12px;
    color:#64748b;
}

.checklist-edit-row input{
    margin-bottom:0;
}

@media(max-width:900px){
    .checklist-edit-row{
        grid-template-columns:1fr;
    }
}

.badge-in_bearbeitung{
    background:#dbeafe;
    color:#1e40af;
}

.badge-geschlossen{
    background:#dcfce7;
    color:#166534;
}

.badge-archiv{
    background:#e5e7eb;
    color:#374151;
}

.note-box{
    padding:15px;
    border:1px solid #e5e7eb;
    border-radius:10px;
    background:#f9fafb;
    margin-bottom:12px;
}

.note-meta{
    color:#475569;
    font-size:14px;
    margin-bottom:8px;
}

.note-text{
    color:#111827;
}

.attachment-list{
    padding-left:20px;
}

.attachment-list li{
    margin-bottom:8px;
}

.attachment-list a{
    color:#c1121f;
    font-weight:600;
    text-decoration:none;
}

.attachment-list a:hover{
    text-decoration:underline;
}

.compact-check-item{
    display:grid;
    grid-template-columns:auto 1fr;
    gap:18px;
    align-items:center;
}

.check-item-title{
    font-weight:700;
}

.check-item-control{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.check-item-control-left{
    justify-content:flex-start;
}

.status-option{
    display:flex;
    align-items:center;
    gap:6px;
    padding:8px 12px;
    border:1px solid #d1d5db;
    border-radius:999px;
    background:#f9fafb;
    cursor:pointer;
    font-weight:600;
    white-space:nowrap;
}

.status-option input{
    width:auto;
    margin:0;
}

.ok-option{
    color:#166534;
}

.defect-option{
    color:#991b1b;
}

@media(max-width:800px){
    .compact-check-item{
        grid-template-columns:1fr;
    }
}

.recipient-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.recipient-item{
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#ffffff;
    overflow:hidden;
}


.recipient-item summary::-webkit-details-marker{
    display:none;
}

.recipient-item[open] summary::before{
    content:"▾";
}

.recipient-summary-main{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.recipient-summary-main span{
    color:#64748b;
    font-size:14px;
}

.recipient-summary-badges{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.recipient-edit-box{
    border-top:1px solid #e5e7eb;
    padding:18px;
    background:#f9fafb;
}

.mini-badge{
    display:inline-block;
    padding:4px 8px;
    border-radius:999px;
    background:#eef2ff;
    color:#3730a3;
    font-size:12px;
    font-weight:700;
}

.recipient-item summary{
    cursor:pointer;
    padding:14px 16px;
    display:flex;
    align-items:flex-start;
    gap:12px;
    list-style:none;
}

.recipient-item summary::before{
    content:"▸";
    font-weight:bold;
    color:#c1121f;
    margin-top:2px;
    flex:0 0 auto;
}

.recipient-item[open] summary::before{
    content:"▾";
}

.recipient-summary-main{
    display:flex;
    flex-direction:column;
    gap:4px;
    flex:1;
}

.recipient-summary-badges{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
    justify-content:flex-start;
    margin-top:8px;
}

@media(max-width:800px){
    .recipient-item summary{
        grid-template-columns:1fr;
    }

    .recipient-summary-badges{
        justify-content:flex-start;
    }
}

.history-box{
    border:1px solid #e5e7eb;
    border-radius:12px;
    padding:16px;
    margin-bottom:14px;
    background:#f9fafb;
}

.history-head{
    margin-bottom:10px;
    color:#374151;
}

.history-changes{
    margin-top:12px;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.history-change-row{
    padding:10px;
    border-radius:8px;
    background:#ffffff;
    border:1px solid #e5e7eb;
}

.history-change-values{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:6px;
    color:#475569;
}