body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 12px;
    background: #e0e1dd;
}
.top {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
    background: #fff;
    padding-top: 20px;
    padding-right: 20px;
    padding-left: 20px;
    padding-bottom: 20px;
    border-radius: 0px;
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    color: #000;
    background: hsla(0, 0%, 100%, 1);
    background: linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -moz-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -webkit-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFF", endColorstr="#F1F1F1", GradientType=1);
}
.center-align {
    text-align: center;
}
.right-align {
    text-align: right;
}
.top2 {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    color: #000;
    border-top: 0;
}
input, select, button {
    font-size: 16px;
    padding: 8px 10px;
    border-radius: 3px;
    border: 1px solid #ddd;
}
button {
    cursor: pointer;
    background: hsla(0, 0%, 100%, 1);
    background: linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -moz-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -webkit-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFF", endColorstr="#F1F1F1", GradientType=1);
}
button:hover {
    background: #fff;
}
.btn-ghost {
    border: 1px solid #ddd;
    background: hsla(0, 0%, 100%, 1);
    background: linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -moz-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -webkit-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFF", endColorstr="#F1F1F1", GradientType=1);
}
.btn-primary {
    border: 1px solid #ddd;
    background: hsla(0, 0%, 100%, 1);
    background: linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -moz-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -webkit-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFF", endColorstr="#F1F1F1", GradientType=1);
    font-weight: 600;
}
.stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 260px;
}
.daynote-box {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.daynote-latest {
    font-size: 13px;
    color: #444;
    background: #fafafa;
    border: 1px solid #e6e6e6;
    padding: 8px 10px;
    border-radius: 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.daynote-history {
    font-size: 13px;
    color: #555;
    line-height: 1.3;
    max-height: 110px;
    overflow: auto;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
}
.daynote-history .item {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}
.daynote-history .item:last-child {
    border-bottom: 0;
}
.daynote-history .meta {
    color: #777;
    font-size: 12px;
    margin-bottom: 2px;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
th, td {
    border-bottom: 1px solid #eee;
    padding: 10px;
    text-align: left;
    vertical-align: middle;
}
th {
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 1;
    user-select: none;
    white-space: nowrap;
}
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #ddd;
    font-size: 13px;
    background: hsla(0, 0%, 100%, 1);
    background: linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -moz-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -webkit-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFF", endColorstr="#F1F1F1", GradientType=1);
    white-space: nowrap;
}
.small {
    font-size: 13px;
    color: #555;
}
#status {
    margin-left: auto;
    font-size: 13px;
    color: #666;
}
.btn-action {
    padding: 8px 10px;
    border: 1px solid #ddd;
    background: hsla(0, 0%, 100%, 1);
    color: #000;
    font-weight: bold;
    background: linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -moz-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    background: -webkit-linear-gradient(270deg, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 95%, 1) 100%);
    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFF", endColorstr="#F1F1F1", GradientType=1);
    border-radius: 3px;
    cursor: pointer;
    margin-right: 4px;
    white-space: nowrap;
}
.btn-action:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.source-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #bbb;
    font-size: 12px;
    background: #fff;
    white-space: nowrap;
}
/* ✅ Markierung: IServ Plan != Gilt */
.row-changed td {
    /*background: #FB607F;*/
}
.row-changed td:first-child {
    box-shadow: inset 4px 0 0 #FB607F;
}
/* ✅ Markierung: früher gegangen als Plan */
.row-earlier td {
    /*background: #fff;*/
}
.row-earlier td:first-child {
    box-shadow: inset 4px 0 0 #FFBF02;
}
/* wenn gegangen -> ausgegraut */
.row-done {
    opacity: 0.45;
    background: #f3f3f3;
}
.row-done td {
    background: inherit;
}
.note-cell {
    max-width: 240px;
    word-break: break-word;
}
/* Klick-Feedback */
.row-saved td {
    background: #dff7e3 !important;
}
.row-fadeout {
    transition: opacity 550ms ease, transform 550ms ease;
    opacity: 0;
    transform: translateX(10px);
}
/* Sort-Indikatoren */
.th-sortable {
    cursor: pointer;
    position: relative;
    padding-right: 26px;
}
.th-sortable .sort-ind {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.6;
}
.th-sortable.active {
    background: #f2f2f2;
}
/* kompakte Zeiten-Zelle */
.times-cell {
    min-width: 140px;
}
.times-line {
    font-size: 12px;
    color: #444;
    line-height: 1.25;
    white-space: nowrap;
}
.times-key {
    display: inline-block;
    min-width: 52px;
    color: #666;
}
/* Zwei-Zeilen-Layout pro Kind */
.row-top td {
    /*background: #fff;*/
    border-bottom: 0;
    padding-top: 10px;
    padding-bottom: 0px;
    color: #000;
    font-weight: bold;
}
.row-detail td {}
.row-top .name-line {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 1.4em;
}
.row-top .contact {
    margin-left: auto;
    /*font-size: 13px;*/
    color: #444;
    white-space: nowrap;
}
.row-top .contact .label {
    color: #777;
    margin-right: 4px;
}
.toolbar-btn {
    padding: 8px 10px;
    border: 1px solid #333;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
}
.toolbar-btn small {
    opacity: 0.7;
    margin-left: 6px;
}
/* iPad: etwas kompakter */
@media (max-width: 1024px) {
    body {
        margin: 10px;
    }
    th, td {
        padding: 9px;
    }
    .top {
        gap: 8px;
        padding: 10px;
    }
    input, select, button {
        padding: 8px 10px;
    }
    .note-cell {
        max-width: 180px;
    }
}
/* ===== Fixed Header (nur oberer Block) ===== */
#fixedTopWrap {
    position: fixed;
    left: 0px;
    right: 0px;
    top: 0px;
    z-index: 999;
    transform: translateY(0);
    transition: transform 220ms ease;
}
/* blendet beim runterscrollen aus */
#fixedTopWrap.is-hidden {
    transform: translateY(calc(-100% - 18px));
}
/* wird beim scrollen kompakter */
#fixedTopWrap.is-compact .top {}
#fixedTopWrap.is-compact input, #fixedTopWrap.is-compact select, #fixedTopWrap.is-compact button {
    padding: 7px 10px;
}
#fixedTopSpacer {
    height: 0px; /* wird per JS gesetzt */
}
.daynote-box {
    display: flex;
    align-items: flex-end; /* richtet Button unten am Input aus */
    gap: 30px;
}
.daynote-box label {
    display: flex;
    flex-direction: column;
    flex: 1;
}
#saveDayNote {
    height: 38px; /* gleiche Höhe wie Input */
    white-space: nowrap;
}
.row-saved td {
    background: #dff7e3 !important;
}
.row-fadeout {
    transition: opacity 550ms ease, transform 550ms ease;
    opacity: 0;
    transform: translateX(10px);
}
#dayNoteLatest {
    display: none !important;
}
.bigtime-cell {
    width: 74px; /* iPad: schmal aber gut lesbar */
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    border-top: 1px solid #eee;
}
.bigtime {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.0;
}
.bigtime-sub {
    margin-top: 6px;
    font-size: 12px;
    color: #555;
    line-height: 1.15;
}
#tbody tr:nth-child(4n+1), #tbody tr:nth-child(4n+2) {
    background-color: #ffffff;
}
#tbody tr:nth-child(4n+3), #tbody tr:nth-child(4n+4) {
    background-color: #fafafa;
}
.actions-cell {
    width: 250px;
    vertical-align: middle;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.actions-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    justify-content: center;
    text-align: right;
}
.actions-wrap .btn-action {
    height: 48px;
    font-size: 20px !important;
    border-radius: 10px;
}
.demo-footer {
    padding: 10px 12px;
    text-align: right;
    opacity: .35;
}
.demo-footer:hover {
    opacity: .9;
}
.demo-reset-link {
    color: inherit;
    text-decoration: none;
    font-size: 12px;
}
.demo-reset-link:hover {
    text-decoration: underline;
}
.btn-alone:disabled {
    opacity: 0.4;
    background: #ddd;
}

.row-late {background: #ffe0e0 !important;}