:root {
    --bg: #efe7dd;
    --bg-2: #f8f4ee;
    --card: #fffdf8;
    --line: #d8cfc3;
    --text: #1f1b17;
    --muted: #5e554d;
    --accent: #0b6b5f;
    --accent-hover: #09574d;
    --warn-bg: #fff2db;
    --warn-fg: #8a5a12;
    --info-bg: #e6f3ef;
    --info-fg: #0a5a50;
    --ok-bg: #eaf7ee;
    --ok-fg: #1f6a36;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Gill Sans", sans-serif;
    background: linear-gradient(145deg, var(--bg) 0%, var(--bg-2) 55%, #fff8ee 100%);
    color: var(--text);
}

.container {
    width: 100%;
    max-width: 760px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 24px 60px rgba(31, 27, 23, 0.12);
}

h1 {
    margin: 0;
    font-size: 32px;
}

.subtitle {
    margin-top: 8px;
    color: var(--muted);
}

.kunde-brand {
    margin-bottom: 12px;
}

.kunde-logo {
    max-height: 58px;
    max-width: 240px;
    width: auto;
    display: block;
}

.kunde-brand-fallback {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.message {
    margin-top: 18px;
    padding: 12px;
    border-radius: 10px;
    background: var(--ok-bg);
    color: var(--ok-fg);
    border: 1px solid #b8e0c1;
    font-weight: 600;
}

.entry-sections {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.entry-card {
    background: #fffdf9;
}

.entry-card-muted {
    background: #f5f3ef;
    border-color: #d5ccc0;
}

.entry-card-muted .entry-item {
    border-bottom-color: #d9d0c5;
}

.entry-card-muted .section-summary {
    border-top-color: #d9d0c5;
}

.entry-card-muted .entry-amount,
.entry-card-muted .hint {
    color: #4f4740;
}

.entry-card-mint {
    background: #eef7f4;
    border-color: #cbe6de;
}

.entry-card-mint .entry-item {
    border-bottom-color: #cbe6de;
}

.entry-card-mint .section-summary {
    border-top-color: #cbe6de;
}

.entry-card-mint .section-title,
.entry-card-mint .entry-amount,
.entry-card-mint .hint {
    color: #0a5a50;
}

.section-title {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
    font-weight: 700;
}

.entry-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.entry-date-separator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    color: #999;
    font-size: 10px;
    line-height: 1;
}

.entry-date-separator-text {
    flex: 0 0 auto;
    white-space: nowrap;
}

.entry-date-separator-line {
    flex: 1 1 auto;
    min-width: 16px;
    height: 0;
    border-top: 0.5px solid #e0e0e0;
}

.entry-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    
}

.entry-item:last-child {
    border-bottom: 0;
}

.entry-bullet {
    color: var(--muted);
}

.entry-description {
    color: var(--text);
    word-break: break-word;
}

.entry-hours {
    text-align: end;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.entry-amount {
    color: var(--muted);
    white-space: nowrap;
}

.entry-empty {
    margin-top: 0;
    margin-bottom: 0;
}

.section-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ece4d8;
    font-weight: 700;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.stat {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: #fffdf9;
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    font-weight: 700;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.status-wrap {
    margin-top: 22px;
}

.status-pill {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
}

.status-offen {
    background: var(--warn-bg);
    color: var(--warn-fg);
}

.status-angefordert {
    background: var(--info-bg);
    color: var(--info-fg);
}

.status-bezahlt {
    background: var(--ok-bg);
    color: var(--ok-fg);
}

.hint {
    margin-top: 16px;
    color: var(--muted);
    line-height: 1.45;
}

button {
    margin-top: 20px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 13px 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background: var(--accent);
    color: #ffffff;
}

button:hover {
    background: var(--accent-hover);
}

button:disabled {
    background: #d8cfc3;
    color: #7b6f64;
    cursor: not-allowed;
}

.entry-card-muted .invoiced-toggle {
    margin-top: 0;
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 4px 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--text);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}



.entry-card-muted .invoiced-toggle-title {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.entry-card-muted .invoiced-toggle-summary {
    text-align: right;
}

.entry-card-muted .invoiced-toggle-icon {
    transition: transform 0.2s ease;
}

.entry-card-muted .invoiced-toggle[aria-expanded="true"] .invoiced-toggle-icon {
    transform: rotate(180deg);
}

.invoiced-content {
    margin-top: 8px;
}

.kunde-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(31, 27, 23, 0.46);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 40;
}

.kunde-modal-backdrop[hidden] {
    display: none !important;
}

.kunde-modal-card {
    width: min(760px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 20px 42px rgba(31, 27, 23, 0.18);
}

.kunde-modal-card h2 {
    margin: 0;
    font-size: 24px;
}

.entry-list-modal {
    margin-top: 8px;
}

.modal-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-actions form {
    margin: 0;
}

.modal-actions button {
    margin-top: 0;
    width: auto;
}

.btn-cancel {
    background: #f2ebe1;
    color: #3b342d;
}

.btn-cancel:hover {
    background: #e9dfd2;
}

body.modal-open {
    overflow: hidden;
}

.lang-switch {
    margin-top: 18px;
    font-size: 13px;
    color: var(--muted);
    text-align: right;
}

.lang-switch a {
    color: var(--accent);
    text-decoration: none;
    margin-left: 6px;
}

.lang-switch a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.powered-by {
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

.kunde-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    width: min(720px, calc(100% - 32px));
    background: #eef7f4;
    border: 1px solid #cbe6de;
    border-radius: 10px;
    padding: 12px;
    color: #0a5a50;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(31, 27, 23, 0.15);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.kunde-toast.toast-hide {
    opacity: 0;
    transform: translate(-50%, -8px);
}

.kunde-request-card {
   
    border: none;
    background: #fffdf9;
    padding-left: 0px;
}

.kunde-request-card .hint {
    margin-top: 4px;
}

.kunde-request-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.kunde-request-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.kunde-request-form textarea,
.kunde-request-form input[type="number"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--bg-2);
    resize: vertical;
}

.kunde-request-form textarea:focus,
.kunde-request-form input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    background: #fffdf9;
}

.kunde-request-cap {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0;
    display: grid;
    gap: 10px;
}

.kunde-request-cap legend {
    padding: 0 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.kunde-request-cap label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
}

.kunde-request-cap input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}

.kunde-request-form button {
    margin-top: 0;
}

@media (max-width: 640px) {
    .entry-item {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 5px 16px;
    }

    .entry-description {
        display: block;
        flex: 0 0 100%;
        width: 100%;
        min-width: 0;
    }

    .entry-hours,
    .entry-amount {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .entry-hours {
        text-align: left;
    }

    .entry-amount {
        margin-left: auto;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .entry-card-muted .invoiced-toggle {
        grid-template-columns: 1fr auto;
        gap: 2px 8px;
        text-align: left;
    }

    .entry-card-muted .invoiced-toggle-summary {
        grid-column: 1;
        text-align: left;
        font-size: 14px;
    }

    .entry-card-muted .invoiced-toggle-icon {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }

    h1 {
        font-size: 24px;
    }

    .stat-value {
        font-size: 24px;
    }
}

.kunde-request-open {
    width: auto;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    font-size: 15px;
    font-weight: 400;
    background: #f2ebe1;
    color: #3b342d;
}

.kunde-request-open:hover {
    background: #e9dfd2;
}

.kunde-request-plus {
    font-size: 18px;
    line-height: 1;
}

.kunde-request-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kunde-request-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-2);
}

.kunde-request-row-main {
    flex: 1 1 auto;
    min-width: 0;
}

.kunde-request-row-desc {
  
    color: var(--text);
    word-break: break-word;
}

.kunde-request-row-meta {
    margin-top: 3px;
    font-size: 13px;
    color: var(--muted);
}

.kunde-request-row-actions {
    display: inline-flex;
    gap: 4px;
    flex: 0 0 auto;
}

.kunde-request-delete {
    display: inline;
    margin: 0;
}

.kunde-request-icon {
    width: auto;
    margin-top: 0;
    padding: 6px 8px;
    font-size: 16px;
    line-height: 1;
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
}

.kunde-request-icon:hover {
    background: rgba(31, 27, 23, 0.08);
    color: var(--text);
}

@media (max-width: 640px) {
    .kunde-request-open {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: max-content;
        max-width: 100%;
        white-space: nowrap;
    }

    .container .site-footer-compact .site-footer-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px 10px;
        width: 100%;
        max-width: 100%;
        text-align: center;
        white-space: normal;
    }

    .container .site-footer-compact .site-footer-nav a {
        white-space: nowrap;
    }

    .container .site-footer-compact .site-footer-nav a + a::before {
        content: none;
    }
}
