/* lohn.keybuki.de - Kanzlei-Oberflaeche
   Durchgehend Keybuki-CI: die Kanzlei betreut mehrere Mandanten,
   ein mandantenspezifisches Branding waere hier sinnlos. */

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#lohn-app { display: flex; flex-direction: column; min-height: 100vh; }

/* --- Header --- */
.lohn-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
}
.lohn-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.lohn-brand { display: flex; align-items: center; gap: 10px; }
.lohn-logo { height: 28px; max-width: 140px; object-fit: contain; }
.lohn-header-right { display: flex; align-items: center; gap: 16px; }
.lohn-kanzlei { font-size: 14px; color: var(--color-text-secondary); }

/* --- Layout --- */
.lohn-main { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 32px 24px; box-sizing: border-box; }
.lohn-footer {
    padding: 20px 24px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
    border-top: 1px solid #f1f3f5;
}

.lohn-loading { text-align: center; padding: 80px 20px; color: var(--color-text-secondary); }
.spinner {
    width: 32px; height: 32px; margin: 0 auto 16px;
    border: 3px solid #e9ecef;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: lohn-spin 0.8s linear infinite;
}
@keyframes lohn-spin { to { transform: rotate(360deg); } }

/* --- Mandantenwahl --- */
.lohn-mandant-grid { display: grid; gap: 12px; margin-top: 20px; }
.lohn-mandant-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.lohn-mandant-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(199,49,120,.08);
}
.lohn-mandant-name { font-weight: 600; font-size: 16px; flex: 1; }

.lohn-mandant-visual {
    width: 44px; height: 44px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.lohn-mandant-logo { max-width: 100%; max-height: 100%; object-fit: contain; }
.lohn-initialen {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .02em;
}

/* --- Kontextleiste --- */
.lohn-kontext {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}
.lohn-kontext-mandant { font-size: 18px; font-weight: 600; }
.lohn-kontext-label { font-size: 13px; color: var(--color-text-secondary); }

/* --- Drop-Zone --- */
.lohn-dropzone {
    border: 2px dashed #d9dde2;
    border-radius: 12px;
    padding: 56px 24px;
    text-align: center;
    background: #fff;
    transition: border-color .15s, background .15s;
    cursor: pointer;
}
.lohn-dropzone.dragover {
    border-color: var(--color-primary);
    background: #fdf5f9;
}
.lohn-dropzone .material-icons {
    font-size: 44px;
    color: var(--color-primary);
    margin-bottom: 12px;
}
.lohn-dropzone-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.lohn-dropzone-hint { font-size: 14px; color: var(--color-text-secondary); }

/* --- Ergebnisliste --- */
.lohn-datei-liste { margin-top: 24px; }
.lohn-datei {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}
.lohn-datei-name { flex: 1; word-break: break-all; }
.lohn-datei-info { color: var(--color-text-secondary); font-size: 13px; white-space: nowrap; }
.lohn-status-icon { width: 22px; text-align: center; flex-shrink: 0; }
.lohn-status-icon .material-icons { font-size: 20px; vertical-align: middle; }
.st-sicher   { color: var(--color-success); }
.st-unsicher { color: var(--color-warning); }
.st-offen    { color: var(--color-text-muted); }
.st-fehler   { color: var(--color-error); }

.lohn-zusammenfassung {
    margin-top: 20px; padding: 16px 18px;
    background: #fff; border: 1px solid #e9ecef; border-radius: 10px;
    font-size: 14px; line-height: 1.6;
}

/* --- Batch-Historie --- */
.lohn-section-title {
    font-size: 15px; font-weight: 600;
    margin: 36px 0 12px; color: var(--color-text-primary);
}
.lohn-batch {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 14px; background: #fff;
    border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 8px;
    font-size: 14px;
}
.lohn-badge {
    font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.badge-offen           { background: #fff3cd; color: #92400e; }
.badge-teilfreigegeben { background: #dbeafe; color: #1e40af; }
.badge-freigegeben     { background: #d4edda; color: #166534; }
.badge-verworfen       { background: #f1f3f5; color: #6c757d; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

@media (max-width: 640px) {
    .lohn-main { padding: 20px 16px; }
    .lohn-header-inner { padding: 12px 16px; }
    .lohn-kanzlei { display: none; }
    .lohn-dropzone { padding: 36px 16px; }
}

/* --- Monatsgruppen --- */
.lohn-monat {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}
.lohn-monat-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.lohn-monat-kopf::-webkit-details-marker { display: none; }
.lohn-monat-kopf::before {
    content: 'expand_more';
    font-family: 'Material Icons';
    font-size: 20px;
    color: var(--color-text-muted);
    transition: transform .15s;
    order: 3;
}
.lohn-monat[open] .lohn-monat-kopf::before { transform: rotate(180deg); }
.lohn-monat-kopf:hover { background: #fdfafb; }
.lohn-monat-name { font-weight: 600; font-size: 15px; flex: 1; }
.lohn-monat-anzahl { font-size: 13px; color: var(--color-text-secondary); }
.lohn-monat-inhalt { padding: 0 14px 14px; }
.lohn-monat-inhalt .lohn-batch { margin-bottom: 8px; }
.lohn-monat-inhalt .lohn-batch:last-child { margin-bottom: 0; }