* { box-sizing: border-box; }
:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #eef5fb;
    --text: #17324a;
    --muted: #6a7b8f;
    --line: #d7e1eb;
    --primary: #1976ba;
    --primary-dark: #125d96;
    --primary-soft: #e8f2f9;
    --danger: #d92d20;
    --success: #1f9d55;
    --warning: #e09f1f;
    --radius: 14px;
}
html, body { margin: 0; padding: 0; }
body { font-family: var(--app-font-family, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif); font-weight: 400; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: block; }
.top-nav-shell { background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(255,255,255,.18); }
.top-nav-inner { max-width: 1560px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 13px 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.16); color: #fff; font-weight: 900; }
.brand strong { display: block; font-size: 18px; line-height: 1; }
.brand small { display: block; margin-top: 4px; color: rgba(255,255,255,.82); font-size: 12px; }
.top-nav { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; min-width: 0; overflow-x: auto; padding: 3px 0; }
.nav-link, .logout-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 11px; border-radius: 10px; color: rgba(255,255,255,.94); border: 1px solid transparent; white-space: nowrap; font-weight: 700; }
.nav-link:hover, .logout-link:hover { background: rgba(255,255,255,.12); }
.nav-link.is-active { background: #fff; color: var(--primary); }
.nav-icon { width: 23px; height: 23px; min-width: 23px; display: inline-grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.12); }
.nav-link.is-active .nav-icon { background: var(--primary-soft); }
.nav-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.top-user { display: inline-flex; align-items: center; gap: 10px; margin-left: 0; }
.user-avatar { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: rgba(255,255,255,.16); color: #fff; }
.user-meta { display: grid; gap: 2px; line-height: 1.1; }
.user-meta strong { font-size: 14px; }
.user-meta small { color: rgba(255,255,255,.82); font-size: 12px; }
.logout-link { padding: 9px 10px; border: 1px solid rgba(255,255,255,.16); }
.nav-toggle { display: none; margin-left: auto; border: 1px solid rgba(255,255,255,.26); background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; padding: 10px 12px; font-weight: 800; cursor: pointer; }
.main-content { width: min(1560px, 100%); margin: 0 auto; padding: 26px; }
.main-content-login { min-height: 100vh; display: grid; place-items: center; width: 100%; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 4vw, 36px); }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card-title { margin: 0 0 14px; font-size: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-group { display: grid; gap: 7px; }
label { font-weight: 700; font-size: 14px; }
.label-with-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.info-icon { width: 24px; height: 24px; border: 1px solid var(--primary); color: var(--primary); background: #fff; border-radius: 999px; font-weight: 900; line-height: 1; cursor: pointer; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 11px 12px; font: inherit; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input:disabled, textarea:disabled, select:disabled { background: #f8fafc; color: var(--muted); cursor: not-allowed; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset:disabled { opacity: .76; }
textarea { min-height: 96px; resize: vertical; }
.checkbox-line { display: flex; align-items: center; gap: 10px; padding-top: 26px; font-weight: 600; }
.checkbox-line input { width: auto; accent-color: var(--primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 15px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-weight: 700; background: #eef2f6; color: var(--text); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-success { background: #eaf8ef; color: var(--success); }
.btn-small { padding: 7px 10px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 1200px; background: #fff; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f6f9fc; color: #456; font-size: 13px; }
small, .help-text { color: var(--muted); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; }
.badge-Neu { background: #e6f1fb; color: #0d6fb8; }
.badge-In-Bearbeitung { background: #fff4db; color: #b97100; }
.badge-Korrektur { background: #fdecec; color: #c62828; }
.badge-Nachbearbeitung { background: #fdecec; color: #c62828; }
.badge-Versendet { background: #e6f7eb; color: #1b8b46; }
.badge-Abgeschlossen { background: #dcf0ff; color: #135ea3; }
.badge-Storniert { background: #eff2f5; color: #6a7886; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi strong { display: block; font-size: 28px; color: var(--primary-dark); }
.kpi span { color: var(--muted); }
.kpi small { display: block; margin-top: 4px; }
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; border: 1px solid transparent; }
.alert-success { background: #eaf8ef; color: #1b8b46; border-color: #c5ebd1; }
.alert-error { background: #fdecec; color: #c62828; border-color: #f7c4c4; }
.alert-info { background: #eaf2fb; color: #125d96; border-color: #c8dbf0; }
.alert-warning { background: #fff6df; color: #9a6800; border-color: #f0d49a; }
.login-card { width: min(440px, 100%); }
.login-logo { text-align: center; margin-bottom: 16px; }
.pagination { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sticky-actions { position: sticky; bottom: 0; background: rgba(244,247,251,.95); padding-top: 12px; }
.app-footer { color: var(--muted); font-size: 12px; padding-top: 8px; }
.list-clean { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list-clean li { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.two-col { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: 0; }
.section-subtitle { margin: -4px 0 12px; color: var(--muted); font-size: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.info-item { background: var(--surface-soft); padding: 12px; border-radius: 10px; border: 1px solid var(--line); }
.info-item strong { display: block; margin-bottom: 4px; }
.info-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.info-pill { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--surface-soft); color: var(--primary-dark); border-radius: 999px; padding: 7px 11px; font-weight: 700; font-size: 13px; }
.lock-indicator, .lock-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; border: 1px solid #f0d49a; background: #fff6df; color: #9a6800; border-radius: 999px; padding: 5px 9px; font-weight: 800; font-size: 12px; }
.lock-pill { margin: 0; font-size: 13px; padding: 7px 11px; }
.lock-icon { width: 16px; height: 16px; display: inline-grid; place-items: center; }
.lock-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lock-banner { border: 1px solid #f0d49a; background: #fff6df; color: #7a5200; border-radius: var(--radius); padding: 16px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lock-banner strong { display: block; font-size: 17px; margin-bottom: 4px; }
.summary-list { display: grid; gap: 12px; }
.summary-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.progress-bar { width: 100%; height: 9px; background: var(--surface-soft); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.timeline { display: grid; gap: 12px; }
.timeline-item { border-left: 4px solid var(--primary); background: #fff; border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; padding: 12px; display: grid; gap: 6px; }
.timeline-item strong { color: var(--text); }
.timeline-item span { color: var(--text); line-height: 1.45; }
.file-list { display: grid; gap: 10px; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.mobile-list { display: none; }
.mobile-card { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; display: grid; gap: 9px; margin-bottom: 10px; }
.mobile-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(12, 31, 48, .42); display: grid; place-items: center; padding: 18px; }
.modal-card { width: min(620px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 20px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; }
.modal-close { border: 0; background: #eef2f6; border-radius: 10px; padding: 8px 11px; cursor: pointer; font-weight: 900; }
.legend-list { display: grid; gap: 10px; margin: 0; }
.legend-row { display: grid; grid-template-columns: 86px 1fr; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.legend-row dt { font-weight: 900; color: var(--primary-dark); }
.legend-row dd { margin: 0; color: var(--text); }
@media (max-width: 1220px) {
    .top-nav-inner { flex-wrap: wrap; }
    .top-nav { order: 3; flex-basis: 100%; }
    .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .top-nav-inner { align-items: flex-start; }
    .nav-toggle { display: inline-flex; }
    .top-nav { display: none; order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch; overflow: visible; }
    .top-nav.is-open { display: flex; }
    .nav-link { justify-content: flex-start; }
    .top-user { flex-basis: 100%; justify-content: space-between; margin-left: 0; }
    .main-content { padding: 18px; }
    .grid-2, .grid-3, .grid-4, .grid-5, .kpi-grid, .info-grid { grid-template-columns: 1fr; }
    .page-head, .lock-banner { flex-direction: column; align-items: stretch; }
    .actions { width: 100%; }
    .btn { width: 100%; }
    .user-meta { flex: 1; }
}
@media (max-width: 760px) {
    .desktop-table { display: none; }
    .mobile-list { display: grid; gap: 10px; }
    .file-row { align-items: flex-start; flex-direction: column; }
    .info-strip { display: grid; }
    .legend-row { grid-template-columns: 1fr; }
}

/* v1.3.2 Rangliste */
.ranking-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.points-legend { display: flex; flex-wrap: wrap; gap: 10px; }
.points-legend span { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 999px; padding: 8px 12px; color: var(--text); }
.points-legend strong { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 999px; background: var(--primary); color: #fff; }
.ranking-table { min-width: 1100px; }
.rank-badge { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 999px; background: #eef2f6; font-weight: 900; color: var(--text); }
.rank-1 .rank-badge { background: #fff6df; color: #9a6800; }
.rank-2 .rank-badge { background: #eff2f5; color: #53606d; }
.rank-3 .rank-badge { background: #f6eadf; color: #8a4b16; }
.rank-1 td, .rank-2 td, .rank-3 td { background: #fbfdff; }
@media (max-width: 900px) { .ranking-kpis { grid-template-columns: 1fr; } }

/* v1.3.3 Google Font und Mitarbeiter-Kuerzel */
.initials-pill { display: inline-grid; place-items: center; min-width: 38px; height: 32px; padding: 0 10px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 900; letter-spacing: .04em; }
.settings-link { background: rgba(255,255,255,.08); }
.font-preview { font-family: var(--app-font-family, Inter, Arial, sans-serif); font-size: 28px; font-weight: 900; letter-spacing: -0.03em; margin: 0; }
.form-hint { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 2px 0 0; }
.user-name-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* v1.3.4 Regular Textgewicht */
p, td, input, select, textarea, small, .help-text, .form-hint, .section-subtitle, .page-head p, .timeline-item span, .legend-row dd, .info-item, .mobile-card, .card li { font-weight: 400; }

/* v1.3.6 Monatsrangliste und Navigation */
.ranking-month-form select { min-width: 190px; }
.champion-card { border-color: rgba(25, 118, 186, .22); }
.bottom-card { border-color: rgba(220, 38, 38, .16); }
.winner-line { display: flex; align-items: center; gap: 12px; font-size: 18px; margin: 0 0 8px; }
.winner-line strong { font-size: 28px; color: var(--primary); letter-spacing: .02em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }


/* v1.3.6 Schalttermin-Pruefung */
.timeline-item.is-checkup { border-color: rgba(224, 159, 31, .38); background: #fff8eb; }
.timeline-item.is-checkup strong { color: #9a6700; }
