:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --text: #172033;
    --muted: #657087;
    --line: #dfe4ec;
    --primary: #2856c6;
    --primary-dark: #1f449e;
    --danger: #b42318;
    --success: #177245;
    --warning: #8a5a00;
    --shadow: 0 8px 28px rgba(23, 32, 51, .07);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--primary); }
.topbar { min-height: 64px; background: #15223d; color: white; display: flex; align-items: center; gap: 22px; padding: 10px max(18px, calc((100vw - 1440px) / 2)); flex-wrap: wrap; }
.brand { color: white; font-size: 1.25rem; font-weight: 800; text-decoration: none; margin-right: auto; }
.topbar nav { display: flex; gap: 8px; flex-wrap: wrap; }
.topbar nav a { color: #dfe8ff; text-decoration: none; padding: 8px 10px; border-radius: 7px; }
.topbar nav a:hover { background: rgba(255,255,255,.1); color: white; }
.nav-link-with-badge { display: inline-flex; align-items: center; gap: 7px; }
.nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f04438;
    color: #fff;
    font-size: .75rem;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(255,255,255,.12);
}
.user-chip { font-size: .83rem; color: #d5def2; }
.container { max-width: 1440px; margin: 0 auto; padding: 28px 18px 48px; }
.footer { text-align: center; color: var(--muted); padding: 22px; font-size: .85rem; }
h1, h2 { line-height: 1.2; margin-top: 0; }
h1 { font-size: clamp(1.65rem, 3vw, 2.25rem); margin-bottom: 6px; }
h2 { font-size: 1.18rem; margin-bottom: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.auth-card { max-width: 640px; margin: 38px auto; }
.narrow { max-width: 620px; margin-left: auto; margin-right: auto; }
.narrow-wide { max-width: 850px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.form-grid { display: grid; gap: 15px; }
.form-grid h2 { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
label { display: grid; gap: 6px; font-weight: 650; font-size: .92rem; }
input, select, textarea { width: 100%; border: 1px solid #bcc5d3; border-radius: 8px; padding: 10px 11px; font: inherit; color: var(--text); background: white; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(40,86,198,.14); border-color: var(--primary); }
textarea { resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 8px; padding: 10px 15px; background: var(--primary); color: white; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--primary-dark); }
button.danger, .button.danger { background: var(--danger); }
.button.secondary { background: #e9edf5; color: #28344b; }
.button.secondary:hover { background: #dce3ef; }
.button.small, button.small { padding: 7px 10px; font-size: .83rem; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.inline-form, .filter-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.inline-form label, .filter-form label { min-width: 150px; }
.work-fields { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 22px; align-items: start; }
.admin-users-grid { grid-template-columns: minmax(330px, .72fr) minmax(560px, 1.28fr); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 17px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.stat strong { font-size: 1.3rem; }
.stat span { color: var(--muted); font-size: .88rem; }
.employee-stat strong { font-size: 1rem; margin-bottom: 6px; }
.pending-text { color: var(--warning) !important; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 700px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #536078; font-size: .78rem; text-transform: uppercase; letter-spacing: .035em; background: #f8f9fb; }
tr:last-child td { border-bottom: 0; }
tr.work-warning > td { background: #fff0c7; }
tr.work-critical > td { background: #ffd9d5; }
tr.work-warning > td:first-child { box-shadow: inset 5px 0 0 #d97706; }
tr.work-critical > td:first-child { box-shadow: inset 5px 0 0 #b42318; }
small { color: var(--muted); }
.legend-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; border: 1px solid rgba(23, 32, 51, .16); }
.legend-swatch.work-warning { background: #fff0c7; }
.legend-swatch.work-critical { background: #ffd9d5; }
.duration-alert { display: inline-block; margin-top: 4px; border-radius: 999px; padding: 3px 7px; font-size: .72rem; font-weight: 800; }
.duration-alert.work-warning { color: #744000; background: #ffd98a; }
.duration-alert.work-critical { color: #8e1d16; background: #ffbdb6; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: .76rem; font-weight: 800; }
.badge.approved { color: #11613b; background: #daf4e6; }
.badge.pending { color: #775000; background: #fff0c2; }
.badge.rejected { color: #8e1d16; background: #fde2df; }
.flash { border-radius: 9px; padding: 12px 14px; margin-bottom: 18px; border: 1px solid transparent; }
.flash.success { background: #e3f6eb; color: #145c39; border-color: #b5e5c8; }
.flash.error { background: #fde8e6; color: #842018; border-color: #f6c4bf; }
.flash.warning { background: #fff3d4; color: #704b00; border-color: #f0d58f; }
.decision-form { display: grid; grid-template-columns: minmax(170px,1fr) auto auto; gap: 7px; }
.actions, .pagination { display: flex; gap: 10px; flex-wrap: wrap; }
.delete-form { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
pre { max-width: 580px; max-height: 320px; overflow: auto; background: #111827; color: #e5e7eb; padding: 12px; border-radius: 8px; font-size: .78rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
hr { border: 0; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
    .grid-two, .admin-users-grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; }
    .topbar nav { order: 3; width: 100%; }
    .decision-form { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
    .container { padding: 18px 10px 36px; }
    .card { padding: 16px; border-radius: 10px; }
    .work-fields { grid-template-columns: 1fr; }
    .topbar { padding: 10px 12px; }
}


.workdays-fieldset { border: 1px solid #d6d9df; border-radius: 10px; padding: 12px 14px; margin: 0; }
.workdays-fieldset legend { font-weight: 700; padding: 0 6px; }
.weekday-options { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 8px; }
.weekday-options .checkbox { margin: 0; }

/* Siems & Klein Header */
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { display: block; width: 66px; height: 66px; object-fit: contain; flex: 0 0 auto; }
.brand-title { white-space: nowrap; }
.range-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.range-fields .range-hint { grid-column: 1 / -1; }
[hidden] { display: none !important; }
@media (max-width: 700px) {
    .brand-logo { width: 56px; height: 56px; }
    .brand-title { font-size: 1rem; }
    .range-fields { grid-template-columns: 1fr; }
    .range-fields .range-hint { grid-column: auto; }
}


/* Individuelle Sollzeit pro Wochentag */
.workday-target-grid { display: grid; gap: 8px; margin-bottom: 10px; }
.workday-target-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(130px, .75fr); align-items: end; gap: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfc; transition: opacity .15s ease; }
.workday-target-row .checkbox { align-self: center; }
.target-hours-label { font-size: .8rem; color: var(--muted); }
.target-hours-label input { color: var(--text); }
.workday-target-row.is-inactive { opacity: .55; }
@media (max-width: 580px) {
    .workday-target-row { grid-template-columns: 1fr; }
}


/* Kompaktes Infofeld für Urlaub & Überstunden */
.entry-card { position: relative; }
.entry-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.entry-card-head h2 { margin: 0; }
.info-popover { position: relative; margin-left: auto; flex: 0 0 auto; }
.info-icon { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid #b9c3d2; background: #f6f8fb; color: #31425f; font-family: Georgia, serif; font-size: 1rem; font-weight: 800; line-height: 1; }
.info-icon:hover, .info-icon:focus { background: #e8edf5; color: #172033; outline: 3px solid rgba(40,86,198,.14); }
.info-panel { position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; width: min(430px, calc(100vw - 44px)); padding: 16px 17px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 16px 42px rgba(23,32,51,.18); opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none; transition: opacity .14s ease, transform .14s ease, visibility .14s ease; }
.info-panel::before { content: ''; position: absolute; top: -7px; right: 9px; width: 12px; height: 12px; background: white; border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.info-panel h3 { margin: 0 0 10px; font-size: 1rem; }
.info-panel p { margin: 8px 0; font-size: .86rem; font-weight: 400; }
.info-popover:hover .info-panel, .info-popover:focus-within .info-panel { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
@media (max-width: 580px) {
    .info-panel { position: fixed; top: 78px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 100px); overflow: auto; }
    .info-panel::before { display: none; }
}

/* Zeitraumsauswahl für Urlaub / Zeitausgleich / Krankenstand */
.range-fields .range-title { grid-column: 1 / -1; margin-bottom: -0.2rem; }
.range-fields .range-hint { grid-column: 1 / -1; }
