:root {
    --petrol-950: #123a3a;
    --petrol-900: #174848;
    --petrol-800: #1f5b5a;
    --petrol-200: #c4dddb;
    --petrol-100: #dcebea;
    --petrol-50: #eff7f6;
    --ink: #20272b;
    --muted: #68747b;
    --line: #e1e6e8;
    --bg: #f5f6f7;
    --card: #ffffff;
    --danger: #a63b3b;
    --success: #2f7256;
    --shadow: 0 12px 30px rgba(18, 58, 58, .07);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { color: var(--ink); background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: var(--petrol-800); text-decoration: none; }
a:hover { color: var(--petrol-950); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px; background: var(--petrol-950); color: #fff; }
.brand {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 100%;
    color: #fff;
    padding: 5px 7px 24px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand:hover { color: #fff; }
.brand-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin-top: 1px;
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    font-size: 22px;
    line-height: 1;
}
.brand > span:last-child { min-width: 0; flex: 1 1 auto; }
.brand strong, .auth-brand strong {
    display: block;
    font-size: 18px;
    line-height: 1.22;
    letter-spacing: .01em;
    white-space: normal;
    overflow-wrap: anywhere;
}
.brand small, .auth-brand small {
    display: block;
    margin-top: 2px;
    color: rgba(255,255,255,.65);
    font-size: 12px;
    line-height: 1.35;
}
.sidebar nav { display: grid; gap: 5px; margin-top: 25px; }
.sidebar nav a { color: rgba(255,255,255,.76); padding: 11px 13px; border-radius: 9px; font-size: 14px; font-weight: 650; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: rgba(255,255,255,.11); }
.sidebar nav a.active { box-shadow: inset 3px 0 rgba(255,255,255,.72); }
.sidebar-footer { margin-top: auto; display: flex; justify-content: space-between; gap: 10px; padding: 18px 7px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 12px; color: rgba(255,255,255,.6); }
.sidebar-footer a { color: rgba(255,255,255,.78); }
.main { min-width: 0; }
.page-head { padding: 28px clamp(22px, 4vw, 54px) 22px; background: #fff; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 3px 0 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; letter-spacing: -.025em; }
.eyebrow { margin: 0; color: var(--petrol-800); font-weight: 800; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.content { padding: 26px clamp(22px, 4vw, 54px) 55px; display: grid; gap: 22px; }
.notice { margin: 20px clamp(22px, 4vw, 54px) -6px; padding: 13px 15px; border: 1px solid; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.notice.success { background: #edf8f2; border-color: #cce8d8; color: #245f46; }
.notice.error { background: #fff1f1; border-color: #f0cece; color: #8a3030; }
.notice.info { background: var(--petrol-50); border-color: var(--petrol-100); color: var(--petrol-950); }
.content > .notice { margin: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 19px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.kpi span, .summary-line span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi strong { display: block; margin-top: 9px; font-size: clamp(21px, 2vw, 28px); letter-spacing: -.025em; }
.kpi small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.kpi.accent { background: var(--petrol-900); color: #fff; border-color: var(--petrol-900); }
.kpi.accent span, .kpi.accent small { color: rgba(255,255,255,.7); }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.costs-layout, .production-layout { grid-template-columns: minmax(310px, .72fr) minmax(0, 1.5fr); }
.settings-layout { grid-template-columns: 1.1fr .9fr; }
.updates-layout { grid-template-columns: 1.15fr .85fr; }
.card { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; box-shadow: var(--shadow); }
.card h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.015em; }
.card h3 { margin: 20px 0 10px; font-size: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; padding-bottom: 15px; border-bottom: 2px solid var(--petrol-100); }
.card-head form { margin: 0; }
.sticky-card { position: sticky; top: 20px; }
.metric-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.metric-list div { padding: 15px; border-bottom: 1px solid var(--line); }
.metric-list div:nth-child(odd) { border-right: 1px solid var(--line); }
.metric-list div:nth-last-child(-n+2) { border-bottom: 0; }
.metric-list div:last-child:nth-child(odd) { grid-column: span 2; border-right: 0; }
.metric-list span { display: block; font-size: 12px; color: var(--muted); }
.metric-list strong { display: block; margin-top: 4px; font-size: 17px; }
.metric-list.large strong { font-size: 20px; }
.positive { color: var(--success); }
.negative { color: var(--danger); }
.empty-state { padding: 25px 15px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); font-size: 16px; }
.empty-state p { max-width: 520px; margin: 8px auto 17px; }
.muted { color: var(--muted); }
.bar-chart { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 125px minmax(80px, 1fr) 45px; align-items: center; gap: 12px; font-size: 12px; }
.bar-track { height: 11px; border-radius: 999px; background: var(--petrol-50); overflow: hidden; }
.bar-track i { display: block; height: 100%; min-width: 3px; background: var(--petrol-800); border-radius: inherit; }
.bar-row strong { text-align: right; }
.summary-line { display: flex; flex-wrap: wrap; gap: 35px; align-items: center; padding: 16px 20px; border-radius: 11px; background: var(--petrol-50); border: 1px solid var(--petrol-100); }
.summary-line strong { display: block; margin-top: 3px; font-size: 18px; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 720; }
label small, .form-hint { color: var(--muted); font-size: 11px; line-height: 1.45; font-weight: 500; }
input, select, textarea { width: 100%; padding: 10px 11px; color: var(--ink); background: #fff; border: 1px solid #cfdad8; border-radius: 8px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--petrol-800); box-shadow: 0 0 0 3px rgba(31,91,90,.11); }
textarea { resize: vertical; min-height: 72px; }
input[type=file] { padding: 8px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--petrol-800); }
.check span { display: grid; gap: 3px; }
.check small { display: block; }
.method-fields { display: grid; gap: 15px; padding: 15px; border-radius: 9px; background: #f7f9f9; border: 1px solid var(--line); }
.method-fields[hidden] { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; padding-top: 2px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 9px 14px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 750; }
.button.primary { background: var(--petrol-800); color: #fff; border-color: var(--petrol-800); }
.button.primary:hover { background: var(--petrol-950); color: #fff; }
.button.subtle { background: #fff; color: var(--petrol-900); border-color: var(--line); }
.button.subtle:hover { background: var(--petrol-50); }
.link { padding: 0; border: 0; background: none; color: var(--petrol-800); font-size: 12px; font-weight: 700; }
.link.danger, a.danger { color: var(--danger); }
.form-separator { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.form-separator:before, .form-separator:after { content: ""; height: 1px; flex: 1; background: var(--line); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 10px 11px; text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
td { padding: 13px 11px; vertical-align: middle; border-bottom: 1px solid #e9eeee; }
tbody tr:last-child td { border-bottom: 0; }
td strong { font-size: 13px; }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
th.num, td.num { text-align: right; white-space: nowrap; }
tfoot th { padding-top: 14px; border-top: 2px solid var(--petrol-100); border-bottom: 0; color: var(--ink); font-size: 13px; text-transform: none; letter-spacing: 0; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; white-space: nowrap; }
.actions form { display: inline; margin: 0; }
.actions a, .actions .link { font-size: 12px; font-weight: 700; }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.ok { color: #276148; background: #e6f4ec; }
.badge.off { color: #6a7474; background: #edf0f0; }
.badge.error { color: #8a3030; background: #f9e5e5; }
.muted-row { opacity: .62; }
.info-card { display: grid; grid-template-columns: 240px 1fr; gap: 30px; align-items: start; background: var(--petrol-50); }
.info-card p:last-child { margin: 0; color: #49605f; line-height: 1.65; }
.update-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.update-summary div { padding: 12px; background: var(--petrol-50); border-radius: 8px; }
.update-summary span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.update-summary strong { display: block; margin-top: 4px; font-size: 13px; }
.release-notes { margin: 0 0 16px; padding: 13px; border-left: 3px solid var(--petrol-800); background: #f7f9f9; }
.release-notes p { margin: 5px 0 0; color: var(--muted); line-height: 1.5; }
.backup-choice { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfc; }
.cancel-update { margin-top: 12px; }
.inline-form { display: inline; }
.backup-list { display: grid; }
.backup-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.backup-list > div:last-child { border-bottom: 0; }
.backup-list strong, .backup-list small { display: block; }
.backup-list strong { font-size: 12px; }
.backup-list small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: linear-gradient(145deg, var(--petrol-950), #2a6765); }
.auth-card { width: min(420px, 100%); padding: 28px; background: #fff; border-radius: 15px; box-shadow: 0 25px 70px rgba(0,0,0,.24); }
.auth-card.install-card { width: min(730px, 100%); }
.auth-card h1 { margin: 22px 0 8px; font-size: 25px; }
.auth-card > .muted { margin-top: 0; line-height: 1.55; }
.auth-card .notice { margin: 15px 0; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand > span { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; background: var(--petrol-50); font-size: 22px; }
.auth-brand > div { min-width: 0; }
.auth-brand strong { line-height: 1.25; }
.auth-brand small { color: var(--muted); }
@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .costs-layout, .production-layout, .updates-layout { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
}
@media (max-width: 820px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; padding: 15px 17px; }
    .brand { padding-bottom: 14px; }
    .sidebar-footer { display: none; }
    .split-grid, .settings-layout { grid-template-columns: 1fr; }
    .info-card { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 600px) {
    .page-head, .content { padding-left: 16px; padding-right: 16px; }
    .notice { margin-left: 16px; margin-right: 16px; }
    .kpi-grid { grid-template-columns: 1fr; }
    .form-grid.two-col { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .card { padding: 17px; }
    .card-head { flex-direction: column; }
    .metric-list { grid-template-columns: 1fr; }
    .metric-list div, .metric-list div:nth-child(odd), .metric-list div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
    .metric-list div:last-child { grid-column: auto; border-bottom: 0; }
    .bar-row { grid-template-columns: 88px 1fr 34px; gap: 7px; }
    .update-summary { grid-template-columns: repeat(2, 1fr); }
    .backup-list > div { align-items: flex-start; flex-direction: column; }
    .auth-card { padding: 22px; }
}
.notice.warning { background: #fff8e8; border-color: #ead9aa; color: #72551b; }
.notice.compact { margin: 0; padding: 11px 13px; font-size: 12px; }
.capture-reminder a { margin-left: 8px; font-weight: 800; white-space: nowrap; }
.retrospective-note { margin-bottom: 0; }
.assignment-preview { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 11px 13px; border: 1px solid #cfe5da; border-radius: 9px; background: #f1faf5; color: #285f49; }
.assignment-preview.has-open { border-color: #ead9aa; background: #fff8e8; color: #72551b; }
.assignment-preview span { font-size: 12px; font-weight: 700; }
.assignment-preview strong { font-size: 14px; }
.snapshot-box { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafa; }
.snapshot-box > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.snapshot-box > strong { font-size: 20px; }
.snapshot-box .check { margin-top: 5px; padding-top: 12px; border-top: 1px solid var(--line); }
.calculation-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.calculation-preview div { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafa; }
.calculation-preview span { display: block; color: var(--muted); font-size: 10px; line-height: 1.35; }
.calculation-preview strong { display: block; margin-top: 5px; font-size: 15px; }
.table-note { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.cost-examples { margin-bottom: 0; }
@media (max-width: 600px) {
    .calculation-preview { grid-template-columns: 1fr; }
    .capture-reminder a { display: inline-block; margin: 7px 0 0; }
}
/* Bestands- und Futterverwaltung */
.feed-layout { grid-template-columns: minmax(330px, .8fr) minmax(0, 1.7fr); }
.dashboard-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-kpis .kpi { min-height: 112px; }
.snapshot-box > small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.cost-snapshot-preview { background: var(--petrol-50); border-color: var(--petrol-100); }
.latest-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.latest-title > strong { font-size: 18px; }
.feed-layout table { min-width: 850px; }
.production-layout table { min-width: 920px; }
@media (max-width: 1100px) {
    .feed-layout, .dashboard-main-grid { grid-template-columns: 1fr; }
}
/* kompakte Monatshistorie und prozentualer Verlust */
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.section-toolbar p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.section-toolbar .eyebrow { margin-bottom: 3px; color: var(--petrol-900); }
.month-entry-card { max-width: 920px; margin: 0 auto 18px; }
.month-history-card { margin-top: 0; }
.assignment-preview.has-error { border-color: #e9b8b8; background: #fff0f0; color: var(--danger); }
.calculation-preview.four-col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
    .calculation-preview.four-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .section-toolbar { align-items: stretch; flex-direction: column; }
    .section-toolbar .button { width: 100%; }
    .calculation-preview.four-col { grid-template-columns: 1fr; }
}

/* einheitliche Zeilenhöhen in den Einstellungen */
.settings-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 118px;
    gap: 15px;
}
.settings-field-grid.single-col { grid-template-columns: 1fr; }
.setting-field {
    min-width: 0;
    height: 118px;
    display: grid;
    grid-template-rows: 18px 42px 34px;
    align-content: start;
    gap: 6px;
}
.setting-field .field-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 18px;
}
.setting-field input,
.setting-field select {
    height: 42px;
    min-height: 42px;
}
.setting-field .field-help {
    min-height: 34px;
    margin: 0;
    overflow: hidden;
}
.setting-field .field-help.is-empty { visibility: hidden; }
.settings-form .form-actions { min-height: 39px; }
@media (max-width: 600px) {
    .settings-field-grid { grid-template-columns: 1fr; }
    .settings-field-grid .span-2 { grid-column: span 1; }
}

/* kompakte Neuordnung von Einstellungen und Futter */
.compact-card-head {
    margin-bottom: 14px;
    padding-bottom: 11px;
}
.compact-card-head h2 { font-size: 19px; }

.settings-page,
.feed-page {
    display: grid;
    gap: 16px;
}
.compact-settings-card,
.compact-security-card,
.feed-entry-card,
.feed-history-card {
    padding: 19px;
}
.settings-compact-form,
.feed-compact-form {
    display: grid;
    gap: 15px;
}
.settings-section + .settings-section {
    margin-top: 1px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
}
.settings-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.settings-section-head strong,
.settings-section-head small {
    display: block;
}
.settings-section-head strong { font-size: 14px; }
.settings-section-head small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}
.compact-field-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}
.compact-setting-field,
.feed-field {
    min-width: 0;
    display: grid;
    grid-template-rows: 17px 38px 15px;
    gap: 3px;
    align-content: start;
    font-size: 12px;
}
.compact-setting-field .field-label,
.feed-field > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 17px;
    font-weight: 750;
}
.compact-setting-field input,
.compact-setting-field select,
.feed-field input,
.feed-field select {
    height: 38px;
    min-height: 38px;
    padding: 8px 10px;
}
.compact-setting-field .field-help,
.feed-field small {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 15px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.compact-preview { gap: 7px; }
.compact-preview div { padding: 9px 10px; }
.compact-preview strong { margin-top: 3px; font-size: 14px; }
.compact-actions {
    padding-top: 0;
    min-height: 0;
}
.settings-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
    gap: 16px;
    align-items: stretch;
}
.password-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact-explanation-card {
    display: grid;
    align-content: center;
    gap: 9px;
    padding: 19px;
    background: var(--petrol-50);
}
.compact-explanation-card h2 { margin: 4px 0 0; font-size: 18px; }
.compact-explanation-card p:last-child {
    margin: 0;
    color: #49605f;
    font-size: 12px;
    line-height: 1.55;
}

.feed-notice { line-height: 1.45; }
.feed-kpis { gap: 12px; }
.feed-kpis .kpi {
    min-height: 88px;
    padding: 14px 16px;
}
.feed-kpis .kpi strong {
    margin-top: 5px;
    font-size: clamp(19px, 2vw, 24px);
}
.feed-kpis .kpi small { margin-top: 3px; }
.feed-toolbar { margin: 0; padding: 11px 13px; }
.feed-entry-card { margin: 0; }
.feed-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
}
.feed-history-card .card-head { margin-bottom: 8px; }
.feed-table { min-width: 850px; }
.feed-table th { padding-top: 8px; padding-bottom: 8px; }
.feed-table td { padding-top: 10px; padding-bottom: 10px; }

@media (max-width: 1100px) {
    .compact-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .planning-grid .compact-setting-field { grid-column: span 1; }
    .password-grid { grid-template-columns: 1fr; }
    .settings-lower-grid { grid-template-columns: 1fr; }
    .feed-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .compact-settings-card,
    .compact-security-card,
    .feed-entry-card,
    .feed-history-card,
    .compact-explanation-card { padding: 16px; }
    .compact-field-grid,
    .feed-field-grid { grid-template-columns: 1fr; }
    .compact-field-grid .span-2,
    .feed-field-grid .span-2 { grid-column: span 1; }
    .compact-setting-field,
    .feed-field {
        grid-template-rows: auto 38px auto;
    }
    .compact-setting-field .field-label,
    .feed-field > span,
    .compact-setting-field .field-help,
    .feed-field small {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
    .feed-toolbar { align-items: stretch; }
}

/* Übersicht, Kosten und Update-Dialog aus einem Guss */
.dashboard-page,
.costs-page,
.updates-page {
    display: grid;
    gap: 16px;
}
.dashboard-page > .notice,
.costs-page > .notice,
.updates-page > .notice { margin: 0; }

/* Übersicht */
.dashboard-kpis { gap: 12px; }
.dashboard-kpis .kpi {
    min-height: 104px;
    padding: 15px 17px;
    box-shadow: none;
}
.dashboard-kpis .kpi strong {
    margin-top: 6px;
    font-size: clamp(20px, 2vw, 25px);
}
.dashboard-kpis .kpi small { margin-top: 3px; }
.dashboard-status-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--petrol-100);
    border-radius: 11px;
    background: var(--petrol-50);
}
.dashboard-status-strip > div {
    min-width: 0;
    padding: 12px 14px;
    border-right: 1px solid var(--petrol-100);
}
.dashboard-status-strip > div:last-child { border-right: 0; }
.dashboard-status-strip span,
.dashboard-metric-grid span,
.compact-data-list span,
.compact-report-grid span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
}
.dashboard-status-strip strong {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-focus-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr);
    gap: 16px;
    align-items: stretch;
}
.dashboard-primary-card,
.dashboard-side-card,
.dashboard-report-grid .card,
.dashboard-chart-card { padding: 19px; }
.dashboard-side-stack {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.dashboard-month-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.dashboard-month-title > div { min-width: 0; }
.dashboard-month-title > div > strong {
    display: block;
    font-size: 21px;
    letter-spacing: -.02em;
}
.dashboard-month-title > div > span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}
.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}
.dashboard-metric-grid > div {
    min-width: 0;
    padding: 11px 12px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.dashboard-metric-grid > div:nth-child(4n) { border-right: 0; }
.dashboard-metric-grid > div:nth-last-child(-n+4) { border-bottom: 0; }
.dashboard-metric-grid > div.feature {
    grid-column: span 2;
    grid-row: span 2;
    display: grid;
    align-content: center;
    background: var(--petrol-50);
}
.dashboard-metric-grid strong {
    display: block;
    margin-top: 3px;
    font-size: 17px;
}
.dashboard-metric-grid .feature strong { font-size: 35px; }
.dashboard-metric-grid small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}
.compact-data-list { display: grid; }
.compact-data-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}
.compact-data-list > div:last-child { border-bottom: 0; }
.compact-data-list strong {
    min-width: 0;
    max-width: 58%;
    overflow: hidden;
    font-size: 13px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.compact-empty {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px dashed #cfdad8;
    border-radius: 9px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}
.compact-empty strong { color: var(--ink); font-size: 13px; }
.dashboard-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.compact-report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.compact-report-grid > div {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfc;
}
.compact-report-grid strong {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-chart-card { overflow: hidden; }
.dashboard-chart-card .card-head { align-items: center; margin-bottom: 12px; }
.chart-card-head { border-bottom: 0; }
.chart-control-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.chart-mode-switch {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--petrol-50);
}
.chart-mode-button {
    min-height: 32px;
    padding: 6px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.chart-mode-button:hover { color: var(--petrol-950); }
.chart-mode-button.active {
    background: #fff;
    color: var(--petrol-950);
    box-shadow: 0 3px 10px rgba(22, 45, 45, .08);
}
.chart-axis-hint {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px 14px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}
.chart-axis-hint span { display: inline-flex; align-items: center; gap: 6px; }
.axis-dot { width: 8px; height: 8px; border-radius: 50%; }
.axis-dot.count { background: var(--petrol-800); }
.axis-dot.money { background: #6f5a9e; }
.chart-series-groups {
    display: grid;
    gap: 8px;
    margin-bottom: 11px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
}
.chart-series-group {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
}
.chart-series-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .045em;
}
.chart-series-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.chart-series-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 29px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font: inherit;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.chart-series-chip:hover { transform: translateY(-1px); color: var(--ink); }
.chart-series-chip i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #aeb7b7;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.chart-series-chip.active {
    border-color: var(--petrol-100);
    background: var(--petrol-50);
    color: var(--ink);
}
.chart-series-chip.series-produced i { background: var(--petrol-800); }
.chart-series-chip.series-sold i { background: var(--petrol-950); }
.chart-series-chip.series-target i { background: linear-gradient(90deg, var(--petrol-800) 0 45%, transparent 45% 60%, var(--petrol-800) 60%); }
.chart-series-chip.series-self i { background: #a1702e; }
.chart-series-chip.series-loss i { background: #b65353; }
.chart-series-chip.series-costs i { background: #6f5a9e; }
.chart-series-chip.series-one-time i { background: #b14f78; }
.chart-series-chip.series-revenue i { background: #2f7d54; }
.chart-series-chip.series-cash i { background: #c26c2d; }
.chart-series-chip.series-economic i { background: #267c87; }
.egg-chart-wrap {
    position: relative;
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 13px;
    background:
        radial-gradient(circle at 15% -15%, var(--petrol-100), transparent 34%),
        linear-gradient(180deg, var(--petrol-50), #fff 44%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.egg-chart {
    display: block;
    width: 100%;
    min-width: 720px;
    height: auto;
    font-family: inherit;
    touch-action: pan-x;
}
.chart-grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; }
.chart-zero-line { stroke: #809090; stroke-width: 1.4; stroke-dasharray: 5 4; }
.chart-axis-label,
.chart-month-label { fill: var(--muted); font-size: 10px; font-weight: 700; }
.chart-axis-money { fill: #68598d; }
.chart-axis-title { fill: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.chart-month-label { font-size: 10.5px; }
.chart-produced-bar { transition: opacity .15s ease; }
.chart-produced-bar:hover { opacity: .76; }
.chart-series-line { vector-effect: non-scaling-stroke; filter: drop-shadow(0 2px 2px rgba(18, 45, 45, .06)); }
.chart-series-point { vector-effect: non-scaling-stroke; }
.chart-hover-line { stroke: var(--petrol-900); stroke-width: 1; stroke-dasharray: 4 4; opacity: .55; }
.chart-empty-label { fill: var(--muted); font-size: 13px; font-weight: 750; }
.chart-tooltip {
    position: absolute;
    z-index: 4;
    min-width: 214px;
    max-width: 260px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 12px 28px rgba(18, 45, 45, .17);
    pointer-events: none;
    backdrop-filter: blur(6px);
}
.chart-tooltip-title {
    display: block;
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 12px;
}
.chart-tooltip-values { display: grid; gap: 5px; }
.chart-tooltip-values > div {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 10px;
}
.chart-tooltip-values i { width: 8px; height: 8px; border-radius: 50%; }
.chart-tooltip-values strong { color: var(--ink); font-size: 10px; }
.chart-note { margin: 8px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

.dashboard-footnote {
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}
.dashboard-footnote strong { color: var(--ink); }

/* Kosten */
.cost-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.cost-kpis .kpi {
    min-height: 92px;
    padding: 14px 16px;
    box-shadow: none;
}
.cost-kpis .kpi strong { margin-top: 5px; font-size: 23px; }
.cost-kpis .kpi small { margin-top: 3px; }
.cost-toolbar { margin: 0; padding: 11px 13px; }
.cost-entry-card,
.cost-history-card { padding: 19px; }
.cost-compact-form { display: grid; gap: 14px; }
.cost-field-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}
.cost-field-grid.two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cost-field-grid.three-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cost-field-grid.one-field { grid-template-columns: minmax(240px, 1fr); max-width: 420px; }
.cost-field {
    min-width: 0;
    display: grid;
    grid-template-rows: 17px 38px 15px;
    gap: 3px;
    align-content: start;
}
.cost-field > span {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    font-weight: 750;
    line-height: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cost-field input,
.cost-field select {
    height: 38px;
    min-height: 38px;
    padding: 8px 10px;
}
.cost-field small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cost-method-box {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8fafa;
}
.cost-method-box .form-hint { margin: 8px 0 0; }
.cost-field-grid-bottom { align-items: end; }
.compact-check {
    min-height: 73px;
    align-items: center;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.compact-check input { flex: 0 0 auto; }
.compact-check strong { font-size: 12px; }
.compact-check small { font-size: 10px; }
.cost-history-card .card-head { margin-bottom: 7px; }
.cost-table { min-width: 760px; }
.cost-table th { padding-top: 8px; padding-bottom: 8px; }
.cost-table td { padding-top: 10px; padding-bottom: 10px; }
.cost-table tfoot th { padding-top: 11px; padding-bottom: 4px; }

/* Update-Manager */
.update-policy-bar {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border: 1px solid var(--petrol-100);
    border-radius: 10px;
    background: var(--petrol-50);
}
.update-policy-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--petrol-800);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}
.update-policy-bar strong,
.update-policy-bar small { display: block; }
.update-policy-bar strong { font-size: 13px; }
.update-policy-bar small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.update-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr);
    gap: 16px;
    align-items: start;
}
.update-install-card,
.update-backup-card,
.update-history-card { padding: 19px; }
.version-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid var(--petrol-100);
    border-radius: 999px;
    background: var(--petrol-50);
    color: var(--petrol-900);
    font-size: 10px;
    font-weight: 800;
}
.update-dropzone {
    min-height: 178px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 22px;
    border: 1.5px dashed #a9c5c2;
    border-radius: 12px;
    background: #f8fbfb;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.update-dropzone:hover { border-color: var(--petrol-800); background: var(--petrol-50); }
.update-dropzone-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    margin-bottom: 3px;
    border-radius: 12px;
    background: var(--petrol-100);
    color: var(--petrol-900);
    font-size: 20px;
    font-weight: 900;
}
.update-dropzone strong { font-size: 16px; }
.update-dropzone small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.45; }
.update-file-name {
    margin-top: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #edf1f1;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
}
.update-file-name.has-file { background: #e6f4ec; color: var(--success); }
.visually-hidden-file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.update-upload-form,
.update-apply-form { display: grid; gap: 13px; }
.update-check-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}
.update-version-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
}
.update-version-flow > div {
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fbfcfc;
}
.update-version-flow > div.target { border-color: var(--petrol-100); background: var(--petrol-50); }
.update-version-flow span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.update-version-flow strong { display: block; margin-top: 3px; font-size: 22px; }
.update-version-flow i { color: var(--petrol-800); font-size: 20px; font-style: normal; text-align: center; }
.update-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.update-facts > div {
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.update-facts span,
.update-facts small { display: block; color: var(--muted); font-size: 10px; }
.update-facts strong { display: block; margin: 3px 0 2px; font-size: 14px; }
.update-release-notes { margin: 0 0 12px; padding: 12px 13px; }
.update-release-notes > span { display: block; color: var(--petrol-800); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.update-release-notes p { margin: 5px 0 0; font-size: 12px; line-height: 1.55; }
.refined-backup-choice { padding: 11px 12px; background: #fbfcfc; }
.update-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.install-button { min-width: 150px; }
.hidden-form { display: none; }
.compact-backup-list { max-height: 330px; overflow: auto; }
.rollback-note {
    display: grid;
    gap: 3px;
    margin-top: 12px;
    padding: 10px 11px;
    border-radius: 8px;
    background: #f7f9f9;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}
.rollback-note strong { color: var(--ink); font-size: 11px; }
.update-history-card .card-head { margin-bottom: 7px; }
.update-history-table { min-width: 760px; }
.update-history-table th { padding-top: 8px; padding-bottom: 8px; }
.update-history-table td { padding-top: 10px; padding-bottom: 10px; }

/* Einheitlicher Bestätigungsdialog */
.confirm-dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: 0 24px 65px rgba(18, 58, 58, .24);
}
.confirm-dialog::backdrop { background: rgba(12, 30, 30, .45); backdrop-filter: blur(2px); }
.confirm-dialog-panel {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.confirm-dialog-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--petrol-50);
    color: var(--petrol-900);
    font-size: 20px;
    font-weight: 900;
}
.confirm-dialog-copy h2 { margin: 3px 0 0; font-size: 20px; }
.confirm-dialog-copy > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.confirm-dialog-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 3px;
}
.button.danger-button { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.danger-button:hover { background: #873030; border-color: #873030; color: #fff; }

@media (max-width: 1180px) {
    .dashboard-status-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-status-strip > div:nth-child(3) { border-right: 0; }
    .dashboard-status-strip > div:nth-child(-n+3) { border-bottom: 1px solid var(--petrol-100); }
    .dashboard-focus-grid { grid-template-columns: 1fr; }
    .dashboard-side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
    .update-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .dashboard-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-metric-grid > div:nth-child(4n) { border-right: 1px solid var(--line); }
    .dashboard-metric-grid > div:nth-child(3n) { border-right: 0; }
    .dashboard-metric-grid > div:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
    .dashboard-metric-grid > div:nth-last-child(-n+3) { border-bottom: 0; }
    .dashboard-report-grid { grid-template-columns: 1fr; }
    .cost-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .dashboard-status-strip { grid-template-columns: 1fr; }
    .dashboard-status-strip > div,
    .dashboard-status-strip > div:nth-child(3) { border-right: 0; border-bottom: 1px solid var(--petrol-100); }
    .dashboard-status-strip > div:last-child { border-bottom: 0; }
    .dashboard-side-stack { grid-template-columns: 1fr; }
    .dashboard-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-metric-grid > div:nth-child(3n) { border-right: 1px solid var(--line); }
    .dashboard-metric-grid > div:nth-child(2n) { border-right: 0; }
    .dashboard-metric-grid > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
    .dashboard-metric-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
    .compact-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cost-kpis { grid-template-columns: 1fr; }
    .cost-field-grid,
    .cost-field-grid.two-fields,
    .cost-field-grid.three-fields { grid-template-columns: 1fr; }
    .cost-field-grid.one-field { max-width: none; }
    .cost-field-grid .span-2 { grid-column: span 1; }
    .cost-field { grid-template-rows: auto 38px auto; }
    .cost-field > span,
    .cost-field small { overflow: visible; text-overflow: clip; white-space: normal; }
    .update-facts { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .dashboard-primary-card,
    .dashboard-side-card,
    .dashboard-report-grid .card,
    .dashboard-chart-card,
    .cost-entry-card,
    .cost-history-card,
    .update-install-card,
    .update-backup-card,
    .update-history-card { padding: 16px; }
    .dashboard-month-title { align-items: flex-start; flex-direction: column; }
    .dashboard-metric-grid { grid-template-columns: 1fr; }
    .dashboard-metric-grid > div,
    .dashboard-metric-grid > div:nth-child(2n),
    .dashboard-metric-grid > div:nth-child(3n) { border-right: 0; border-bottom: 1px solid var(--line); }
    .dashboard-metric-grid > div.feature { grid-column: auto; grid-row: auto; }
    .dashboard-metric-grid > div:last-child { border-bottom: 0; }
    .compact-report-grid { grid-template-columns: 1fr; }
    .egg-chart { min-width: 680px; }
    .update-version-flow { grid-template-columns: 1fr; }
    .update-version-flow i { transform: rotate(90deg); }
    .confirm-dialog-panel { grid-template-columns: 36px minmax(0, 1fr); padding: 17px; }
    .confirm-dialog-mark { width: 36px; height: 36px; }
    .confirm-dialog-actions { flex-direction: column-reverse; }
    .confirm-dialog-actions .button { width: 100%; }
}

/* frei wählbare Akzentfarbe und PDF-Export */
.theme-picker {
    display: grid;
    grid-template-columns: minmax(240px, 1.25fr) minmax(210px, .8fr) minmax(190px, .7fr);
    gap: 12px;
    align-items: stretch;
}
.theme-color-field,
.theme-presets,
.theme-live-preview {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfc;
}
.theme-color-field { display: grid; gap: 6px; }
.theme-color-field > .field-label,
.theme-presets > span,
.theme-live-preview > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
}
.theme-input-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}
.theme-input-row input[type="color"] {
    width: 44px;
    height: 38px;
    min-height: 38px;
    padding: 3px;
    border-radius: 8px;
    cursor: pointer;
}
.theme-input-row input[type="text"],
.theme-input-row input:not([type]) { height: 38px; min-height: 38px; }
.theme-color-field small { color: var(--muted); font-size: 10px; line-height: 1.35; font-weight: 500; }
.theme-presets { display: grid; align-content: center; gap: 10px; }
.theme-presets > div { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-presets button {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--swatch);
    box-shadow: 0 0 0 1px #cdd8d6;
}
.theme-presets button:hover,
.theme-presets button:focus-visible { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--petrol-100); }
.theme-live-preview {
    --preview-color: var(--petrol-800);
    display: grid;
    align-content: center;
    gap: 3px;
    color: #fff;
    background: var(--preview-color);
    border-color: transparent;
}
.theme-live-preview > span,
.theme-live-preview small { color: rgba(255,255,255,.72); }
.theme-live-preview strong { font-size: 16px; }
.theme-live-preview small { font-size: 10px; }

.export-page { display: grid; gap: 16px; }
.export-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px;
    background: linear-gradient(135deg, #fff, var(--petrol-50));
}
.export-intro h2 { margin: 4px 0 7px; font-size: 22px; }
.export-intro p:last-child { max-width: 720px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.export-file-icon {
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--petrol-800);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .05em;
    box-shadow: var(--shadow);
}
.export-options-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}
.export-option-card {
    position: relative;
    min-height: 285px;
    display: flex;
    flex-direction: column;
    gap: 17px;
    padding: 20px;
    overflow: hidden;
}
.export-option-card.featured { border-color: var(--petrol-100); }
.export-option-card.featured::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--petrol-800);
}
.export-option-number {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--petrol-50);
    color: var(--petrol-900);
    font-size: 11px;
    font-weight: 900;
}
.export-option-card h2 { margin: 4px 0 7px; font-size: 20px; }
.export-option-card p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.export-option-card > .button,
.export-option-card > .export-form { margin-top: auto; }
.export-form { display: grid; gap: 10px; }
.export-form label { gap: 5px; }
.export-form select { height: 39px; min-height: 39px; }
.export-form .button { width: 100%; }
.export-note { margin: 0; }
.button:disabled,
button:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 980px) {
    .theme-picker { grid-template-columns: 1fr 1fr; }
    .theme-live-preview { grid-column: span 2; min-height: 78px; }
    .export-options-grid { grid-template-columns: 1fr; }
    .export-option-card { min-height: 0; }
}
@media (max-width: 600px) {
    .theme-picker { grid-template-columns: 1fr; }
    .theme-live-preview { grid-column: span 1; }
    .export-intro { align-items: flex-start; }
    .export-file-icon { width: 52px; height: 52px; border-radius: 13px; }
}

@media (max-width: 820px) {
    .chart-control-panel { align-items: flex-start; flex-direction: column; }
    .chart-axis-hint { justify-content: flex-start; }
    .chart-series-group { grid-template-columns: 1fr; gap: 5px; }
    .chart-series-label { padding-left: 2px; }
}

@media (max-width: 540px) {
    .chart-mode-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
    .chart-mode-button { padding-inline: 7px; }
    .chart-series-groups { padding: 9px; }
    .chart-series-chip { min-height: 31px; }
}

/* Bestand, Ereignisse, Futterreichweite und CSV */
.setting-readonly-card {
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--petrol-50);
}
.setting-readonly-card > strong { font-size: 18px; color: var(--petrol-950); }
.setting-readonly-card a { font-weight: 800; }
.compact-entry-card { margin-bottom: 16px; }
.compact-form-grid { gap: 12px; }
.flock-kpis { margin-bottom: 16px; }

.event-panel {
    display: grid;
    gap: 11px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--petrol-50);
    box-sizing: border-box;
    overflow: hidden;
}
.event-panel-heading {
    display: grid;
    gap: 5px;
    min-width: 0;
}
.event-panel-heading h3 {
    margin: 0;
    color: var(--petrol-950);
    font-size: 16px;
    font-weight: 850;
    line-height: 1.25;
}
.event-panel-heading p {
    max-width: 100%;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.event-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    min-width: 0;
}
.event-check {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.25;
    box-sizing: border-box;
}
.event-check input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--petrol-800);
}
.event-check span {
    display: block;
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}
.event-check:has(input:checked) { border-color: var(--petrol-800); background: var(--petrol-100); color: var(--petrol-950); }
.event-auto-note { display: block; margin-top: 9px; color: var(--petrol-900); }
.event-tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 1px; }
.event-tag-row.compact { margin-top: 5px; }
.event-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border-radius: 999px; background: var(--petrol-100); color: var(--petrol-950); font-size: 10px; font-weight: 800; }

.feed-forecast-panel {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 0;
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
}
.feed-forecast-panel > div { display: grid; gap: 3px; padding: 15px 17px; border-left: 1px solid var(--line); }
.feed-forecast-panel > div:first-child { border-left: 0; }
.feed-forecast-panel span { color: var(--muted); font-size: 11px; font-weight: 750; }
.feed-forecast-panel strong { color: var(--petrol-950); font-size: 19px; }
.feed-forecast-panel small { color: var(--muted); font-size: 10px; }
.feed-forecast-panel.low, .feed-range-card.low, .feed-range-kpi.low { border-color: #e8b7b7; }
.feed-forecast-panel.medium, .feed-range-card.medium, .feed-range-kpi.medium { border-color: #ead1a3; }
.feed-range-warning { margin: 10px 0 0; padding: 7px 9px; border-radius: 8px; background: #fff1f1; color: #963d3d; font-size: 11px; font-weight: 800; }

.csv-export-section { padding: 20px; }
.csv-export-section > .muted { margin: -3px 0 14px; }
.csv-export-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.csv-export-link { display: grid; align-content: start; gap: 5px; min-height: 118px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-decoration: none; transition: .18s ease; }
.csv-export-link:hover { transform: translateY(-1px); border-color: var(--petrol-800); box-shadow: var(--shadow); }
.csv-export-link strong { color: var(--ink); font-size: 14px; }
.csv-export-link span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.csv-export-link b { margin-top: auto; color: var(--petrol-900); font-size: 11px; }

.chart-series-chip.series-laying-rate i { background: #477bb5; }
.chart-series-chip.series-sales-rate i { background: #397a66; }
.chart-series-chip.series-cost-per-egg i { background: #78529c; }
.chart-series-chip.series-feed-per-egg i { background: #b06b2c; }
.chart-event-marker { fill: var(--petrol-800); stroke: #fff; stroke-width: 1.5; filter: drop-shadow(0 2px 3px rgba(0,0,0,.15)); }
.chart-tooltip-events { align-items: start !important; }
.chart-tooltip-events strong { max-width: 145px; white-space: normal; text-align: right; line-height: 1.25; }

@media (max-width: 1040px) {
    .csv-export-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .feed-forecast-panel { grid-template-columns: 1fr; }
    .feed-forecast-panel > div { border-left: 0; border-top: 1px solid var(--line); }
    .feed-forecast-panel > div:first-child { border-top: 0; }
}
@media (max-width: 600px) {
    .csv-export-grid { grid-template-columns: 1fr; }
    .event-panel { padding: 12px; }
    .event-checkbox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .event-checkbox-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
    .chart-mode-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.feed-forecast-panel.planned, .feed-range-card.planned, .feed-range-kpi.planned { border-color: var(--petrol-100); }


/* Ereignisauswahl auf zwei feste Spalten begrenzt.
   Fieldset und Grid dürfen keine Mindestbreite mehr aus dem Formular erzwingen. */


/* Der komplette Ereignisbereich einschließlich Überschrift
   und Hinweistext liegt innerhalb derselben getönten Karte. */

/* Datenprüfung, Systemprüfung, Diagramm-Zeitraum und Jahresvergleich */
.chart-range-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}
.chart-range-control select {
    width: auto;
    min-width: 168px;
    height: 36px;
    padding: 6px 30px 6px 10px;
    border-radius: 9px;
    background-color: #fff;
    font-size: 12px;
}

.check-page,
.year-compare-page { display: grid; gap: 16px; }
.check-overview {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-left: 4px solid var(--petrol-800);
}
.check-overview.warning { border-left-color: #c58a2e; }
.check-overview.error { border-left-color: #b64c4c; }
.check-overview-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--petrol-100);
    color: var(--petrol-950);
    font-size: 25px;
    font-weight: 900;
}
.check-overview.warning .check-overview-icon { background: #fff4df; color: #8b5b13; }
.check-overview.error .check-overview-icon { background: #fff0f0; color: #9c3636; }
.check-overview h2 { margin: 1px 0 4px; }
.check-overview p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.check-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.check-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.check-summary span { color: var(--muted); font-size: 11px; font-weight: 800; }
.check-summary strong { font-size: 24px; color: var(--petrol-950); }
.check-summary.info { background: var(--petrol-50); }
.check-summary.warning { border-color: #ecd29d; background: #fffaf0; }
.check-summary.error { border-color: #ecc0c0; background: #fff6f6; }
.check-summary.warning strong { color: #8b5b13; }
.check-summary.error strong { color: #a43e3e; }
.check-list-card { overflow: hidden; }
.check-list { display: grid; }
.check-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}
.check-row:first-child { border-top: 0; }
.check-row:hover { background: var(--petrol-50); }
.check-row-icon {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: var(--petrol-100);
    color: var(--petrol-950);
    font-size: 12px;
    font-weight: 900;
}
.check-row.info .check-row-icon { background: #eaf2f7; color: #35637d; }
.check-row.warning .check-row-icon { background: #fff1d7; color: #8b5b13; }
.check-row.error .check-row-icon { background: #ffe8e8; color: #a23d3d; }
.check-row-content { min-width: 0; }
.check-row-content > strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 13px; }
.check-row-content p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.check-row-content details { margin-top: 7px; }
.check-row-content summary { cursor: pointer; color: var(--petrol-900); font-size: 10px; font-weight: 800; }
.check-row-content code {
    display: block;
    max-width: 100%;
    margin-top: 6px;
    padding: 8px 9px;
    overflow-wrap: anywhere;
    border-radius: 7px;
    background: var(--petrol-50);
    color: var(--muted);
    font-size: 9px;
    white-space: pre-wrap;
}
.button.small { min-height: 31px; padding: 6px 9px; font-size: 10px; }

.year-compare-controls { padding: 18px; }
.year-compare-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 11px;
}
.year-compare-form label { display: grid; gap: 5px; min-width: 0; }
.year-compare-form label > span { color: var(--muted); font-size: 10px; font-weight: 800; }
.year-compare-form select { width: 100%; }
.comparison-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.year-comparison-chart-card { overflow: hidden; }
.year-chart-wrap {
    position: relative;
    min-width: 0;
    overflow-x: auto;
    padding: 4px 10px 8px;
}
.year-comparison-chart { display: block; width: 100%; min-width: 760px; height: auto; }
.year-chart-hit { cursor: crosshair; }
.comparison-table-card { overflow: hidden; }
.comparison-table-card .table-wrap { margin: 0; }

@media (max-width: 1050px) {
    .year-compare-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .year-compare-form .button { align-self: stretch; }
}
@media (max-width: 820px) {
    .check-overview { grid-template-columns: auto minmax(0, 1fr); }
    .check-overview > .button { grid-column: 1 / -1; justify-self: start; }
    .check-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .comparison-kpis { grid-template-columns: 1fr; }
    .chart-card-head { align-items: flex-start; }
}
@media (max-width: 620px) {
    .chart-range-control { width: 100%; justify-content: space-between; }
    .chart-range-control select { min-width: 0; width: 68%; }
    .check-overview { grid-template-columns: 1fr; }
    .check-overview-icon { width: 42px; height: 42px; }
    .check-summary-grid { grid-template-columns: 1fr 1fr; }
    .check-row { grid-template-columns: 29px minmax(0, 1fr); align-items: start; padding: 13px; }
    .check-row > .button { grid-column: 2; justify-self: start; }
    .year-compare-form { grid-template-columns: 1fr; }
}

/* kontrollierte Protokoll- und Rückrolldatenverwaltung */
.backup-purpose-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff0e2;
    color: #8b4a18;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    vertical-align: middle;
}
.technical-artifacts-card { margin-top: 18px; }
.history-maintenance,
.log-maintenance-card .maintenance-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.history-maintenance {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--petrol-50);
}
.history-maintenance > div {
    min-width: 220px;
    flex: 1 1 340px;
}
.history-maintenance strong,
.history-maintenance small { display: block; }
.history-maintenance small { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.history-clean-form {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 1 480px;
}
.history-clean-form select { min-width: 250px; }
.maintenance-policy-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.maintenance-policy-grid > div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--petrol-50);
}
.maintenance-policy-grid span,
.maintenance-policy-grid strong,
.maintenance-policy-grid small { display: block; }
.maintenance-policy-grid span { color: var(--muted); font-size: 12px; }
.maintenance-policy-grid strong { margin-top: 5px; font-size: 16px; }
.maintenance-policy-grid small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.log-maintenance-card .maintenance-actions { margin-top: 14px; justify-content: flex-start; }
.button:disabled { opacity: .48; cursor: not-allowed; }
@media (max-width: 840px) {
    .maintenance-policy-grid { grid-template-columns: 1fr; }
    .history-clean-form { width: 100%; flex: 1 1 100%; }
}
@media (max-width: 620px) {
    .history-clean-form { align-items: stretch; flex-direction: column; }
    .history-clean-form select,
    .history-clean-form .button { width: 100%; min-width: 0; }
}

/* gruppierte Navigation, Sammel-Neuberechnung und Futter-Übergang */
.sidebar nav.sidebar-nav {
    display: block;
    margin-top: 22px;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
}
.sidebar-nav > .nav-entry {
    min-width: 0;
    margin: 0;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar-nav > .nav-entry:first-child {
    padding-top: 0;
    border-top: 0;
}
.sidebar-nav > .nav-entry:last-child { padding-bottom: 0; }
.sidebar-nav .nav-entry-home > a.nav-home {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 13px;
    border-radius: 10px;
    color: rgba(255,255,255,.84);
    font-size: 14px;
    font-weight: 780;
}
.nav-group { min-width: 0; }
.nav-group summary {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 28px 10px 11px;
    border-radius: 9px;
    color: rgba(255,255,255,.64);
    cursor: pointer;
    list-style: none;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
    user-select: none;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after {
    content: "›";
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.48);
    font-size: 17px;
    line-height: 1;
    transition: transform .15s ease;
}
.nav-group[open] summary::after { transform: translateY(-50%) rotate(90deg); }
.nav-group summary:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-group-links {
    display: grid;
    gap: 3px;
    padding: 2px 0 5px 10px;
}
.sidebar nav.sidebar-nav .nav-group-links a {
    padding: 9px 11px;
    border-radius: 9px;
    color: rgba(255,255,255,.73);
    font-size: 13px;
    font-weight: 650;
}
.sidebar nav.sidebar-nav a:hover,
.sidebar nav.sidebar-nav a.active { color: #fff; background: rgba(255,255,255,.11); }
.sidebar nav.sidebar-nav a.active { box-shadow: inset 3px 0 rgba(255,255,255,.72); }

.dashboard-actionbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid var(--petrol-100);
    border-radius: 13px;
    background: var(--petrol-50);
}
.dashboard-actionbar p { margin: 0; }
.dashboard-actionbar > div:first-child > p:last-child {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
.dashboard-actionbar-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex: 0 0 auto;
}
.dashboard-actionbar-buttons form { margin: 0; }

@media (max-width: 820px) {
    .sidebar nav.sidebar-nav {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        overflow: visible;
        margin-top: 12px;
        padding-bottom: 0;
    }
    .sidebar-nav .nav-entry-home > a.nav-home { text-align: left; }
    .sidebar nav.sidebar-nav a.active { box-shadow: inset 3px 0 rgba(255,255,255,.72); }
    .sidebar-nav > .nav-entry { padding: 6px 0; }
    .nav-group-links { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 0; }
    .sidebar nav.sidebar-nav .nav-group-links a { text-align: left; }
}
@media (max-width: 620px) {
    .nav-group-links { grid-template-columns: 1fr; }
    .dashboard-actionbar { align-items: stretch; flex-direction: column; }
    .dashboard-actionbar-buttons { justify-content: stretch; flex-wrap: wrap; }
    .dashboard-actionbar-buttons > *,
    .dashboard-actionbar-buttons .button { flex: 1 1 100%; width: 100%; }
}

/* Standardverkauf und beliebig ergänzbare Sonderverkäufe */
.sale-entry-panel {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--petrol-100);
    border-radius: 14px;
    background: var(--petrol-50);
}
.sale-entry-heading,
.special-sales-heading,
.special-sale-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.sale-entry-heading h3,
.sale-entry-heading p { margin: 0; }
.sale-entry-heading h3 { font-size: 17px; }
.sale-entry-heading p,
.special-sales-heading small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
.sale-standard-price {
    flex: 0 0 auto;
    min-width: 190px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    text-align: right;
}
.sale-standard-price span,
.sale-standard-price strong,
.special-sales-heading strong,
.special-sales-heading small { display: block; }
.sale-standard-price span { color: var(--muted); font-size: 11px; }
.sale-standard-price strong { margin-top: 3px; font-size: 15px; }
.special-sales-section {
    display: grid;
    gap: 10px;
    padding-top: 2px;
}
.special-sales-heading { align-items: center; }
.special-sales-list { display: grid; gap: 10px; }
.special-sale-item {
    display: grid;
    gap: 10px;
    padding: 12px 13px;
    border: 1px dashed var(--petrol-200);
    border-radius: 12px;
    background: rgba(255,255,255,.72);
}
.special-sale-item-head { align-items: center; }
.special-sale-item-head strong { font-size: 12px; }
.special-sale-fields {
    display: grid;
    grid-template-columns: minmax(100px, .55fr) minmax(135px, .75fr) minmax(190px, 1.7fr);
    gap: 11px;
    align-items: end;
}
.special-sale-fields label { margin: 0; }
.special-sale-fields label > span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}
.sale-calculation-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.sale-calculation-preview > div {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
}
.sale-calculation-preview span,
.sale-calculation-preview strong { display: block; }
.sale-calculation-preview span { color: var(--muted); font-size: 11px; }
.sale-calculation-preview strong { margin-top: 4px; font-size: 15px; }
@media (max-width: 760px) {
    .sale-entry-heading { flex-direction: column; }
    .sale-standard-price { width: 100%; min-width: 0; text-align: left; }
    .special-sale-fields { grid-template-columns: 1fr 1fr; }
    .special-sale-fields label:last-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .special-sales-heading { align-items: stretch; flex-direction: column; }
    .special-sales-heading .button { width: 100%; }
    .special-sale-fields,
    .sale-calculation-preview { grid-template-columns: 1fr; }
    .special-sale-fields label:last-child { grid-column: auto; }
}


/* Tabellenaktionen bleiben echte Tabellenzellen */
td.table-actions-cell {
    width: 1%;
    min-width: 116px;
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}
.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    white-space: nowrap;
}
.table-actions form {
    display: inline;
    margin: 0;
}
.table-actions a,
.table-actions .link {
    font-size: 12px;
    font-weight: 700;
}
@media (max-width: 620px) {
    td.table-actions-cell {
        min-width: 104px;
    }
    .table-actions {
        gap: 8px;
    }
}

/* Diagrammkopf auf breiten Ansichten in einer Reihe */
.chart-card-head {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto;
    align-items: center;
    gap: 14px 22px;
}
.chart-head-copy {
    min-width: 0;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}
.chart-head-copy > div { min-width: 0; }
.chart-head-subtitle {
    min-width: 0;
    padding-bottom: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.chart-head-actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
}
.chart-head-actions .chart-range-control {
    flex: 0 0 auto;
    width: auto;
    justify-content: flex-start;
    white-space: nowrap;
}
.chart-head-actions .chart-range-control select {
    width: auto;
    min-width: 168px;
}
@media (max-width: 1080px) {
    .chart-card-head {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .chart-head-actions {
        width: 100%;
        justify-content: space-between;
    }
}
@media (max-width: 680px) {
    .chart-head-copy {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
    .chart-head-subtitle { white-space: normal; }
    .chart-head-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .chart-head-actions .chart-range-control,
    .chart-head-actions .chart-range-control select {
        width: 100%;
    }
    .chart-head-actions .chart-range-control {
        justify-content: space-between;
    }
}

/* vorläufiger laufender Monat und gleichmäßige Plan-Infozeile */
.badge.warning { color: #8b5b13; background: #fff3d7; }
@media (min-width: 1181px) {
    .dashboard-status-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.production-toolbar .toolbar-actions,
.empty-actions,
.month-entry-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.month-entry-badges { justify-content: flex-end; }
.draft-reminder { margin: 0; }
.draft-snapshot-note { border-style: dashed; }
.provisional-month-row { background: var(--petrol-50); }
.provisional-month-row td { border-bottom-color: var(--petrol-100); }
.month-row-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.muted-value { color: var(--muted); font-weight: 700; }
@media (max-width: 760px) {
    .production-toolbar { align-items: stretch; }
    .production-toolbar .toolbar-actions { width: 100%; }
    .production-toolbar .toolbar-actions .button { flex: 1 1 220px; }
    .month-entry-badges { justify-content: flex-start; }
}

/* aufgeräumte Seitenstruktur, einmalige Monatskosten und einheitliche Diagramme */
.page-head-copy { max-width: 920px; }
.page-description {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}
.sidebar-nav .nav-entry-direct > a.nav-direct {
    display: flex;
    align-items: center;
    min-height: 42px;
    color: rgba(255,255,255,.76);
    padding: 10px 13px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 650;
}
.content {
    width: 100%;
    max-width: 1580px;
}
.content > .kpi-grid,
.content > .comparison-kpis { margin-bottom: 0; }
.section-toolbar {
    margin-bottom: 0;
    box-shadow: 0 6px 18px rgba(18,58,58,.035);
}
.entry-section-panel,
.monthly-cost-panel {
    display: grid;
    gap: 15px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfcfc;
}
.entry-section-panel.compact { gap: 13px; }
.sale-entry-panel.entry-section-panel,
.monthly-cost-panel {
    border-color: var(--petrol-100);
    background: var(--petrol-50);
}
.entry-section-heading,
.monthly-cost-heading,
.section-title-line {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}
.entry-section-heading,
.monthly-cost-heading {
    justify-content: space-between;
}
.entry-section-heading > div,
.section-title-line { align-items: center; }
.entry-section-heading h3,
.entry-section-heading p,
.monthly-cost-heading h3,
.monthly-cost-heading p { margin: 0; }
.entry-section-heading h3,
.monthly-cost-heading h3 { font-size: 17px; }
.entry-section-heading p,
.monthly-cost-heading p {
    max-width: 560px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
.step-number {
    display: inline-grid;
    place-items: center;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border-radius: 999px;
    color: #fff;
    background: var(--petrol-800);
    font-size: 11px;
    font-weight: 850;
}
.monthly-cost-total {
    flex: 0 0 auto;
    min-width: 135px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    text-align: right;
}
.monthly-cost-total span,
.monthly-cost-total strong { display: block; }
.monthly-cost-total span { color: var(--muted); font-size: 11px; }
.monthly-cost-total strong { margin-top: 3px; font-size: 16px; }
.monthly-cost-actions {
    display: flex;
    justify-content: flex-end;
}
.one-time-cost-list { display: grid; gap: 10px; }
.one-time-cost-item {
    display: grid;
    gap: 10px;
    padding: 12px 13px;
    border: 1px dashed var(--petrol-200);
    border-radius: 12px;
    background: rgba(255,255,255,.78);
}
.one-time-cost-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.one-time-cost-item-head strong { font-size: 12px; }
.one-time-cost-fields {
    display: grid;
    grid-template-columns: minmax(130px,.8fr) minmax(170px,1.25fr) minmax(105px,.55fr) minmax(170px,1.25fr);
    gap: 11px;
    align-items: end;
}
.one-time-cost-fields label { margin: 0; }
.one-time-cost-fields label > span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}
.panel-note {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}
.year-chart-control-panel {
    margin-bottom: 12px;
}
.compact-year-series { margin: 0; }
.series-year-base i { background: var(--petrol-800); }
.series-year-compare i { background: #9a6d35; }
.year-comparison-chart-card .chart-head-subtitle { padding-bottom: 1px; }
.year-comparison-chart-card .egg-chart-wrap {
    min-height: 350px;
    border-radius: 14px;
    background: linear-gradient(180deg, var(--petrol-50), #fff 74%);
}
.year-comparison-chart-card .egg-chart { min-width: 780px; }
.year-comparison-chart-card .chart-series-chip { min-width: 88px; }
.year-compare-controls,
.comparison-table-card,
.year-comparison-chart-card { margin: 0; }
.year-compare-page { display: grid; gap: 18px; }
.year-compare-form { align-items: end; }

@media (max-width: 980px) {
    .one-time-cost-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 680px) {
    .entry-section-heading,
    .monthly-cost-heading { align-items: stretch; flex-direction: column; }
    .monthly-cost-total { width: 100%; text-align: left; }
    .monthly-cost-actions .button { width: 100%; }
    .one-time-cost-fields { grid-template-columns: 1fr; }
    .page-description { font-size: 12px; }
}

.sidebar-nav .nav-entry-home > a.nav-home,
.sidebar-nav .nav-entry-direct > a.nav-direct { padding-left: 13px; }
.nav-group summary { padding-left: 11px; }
.sidebar nav.sidebar-nav .nav-group-links a { padding-left: 11px; }

/* Neuberechnung wieder bei der Datenpflege; im Diagrammkopf bleibt nur der Zeitraum. */
.dashboard-actionbar-buttons form { flex: 0 0 auto; }
.chart-head-actions { justify-content: flex-end; }
.chart-head-actions .chart-range-control { margin-left: auto; }

/* Zehn Monatskennzahlen bilden auf breiten Ansichten zwei vollständige Reihen. */
.dashboard-metric-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.dashboard-metric-grid > div,
.dashboard-metric-grid > div.feature {
    min-height: 88px;
    display: grid;
    align-content: center;
    grid-column: auto;
    grid-row: auto;
}
.dashboard-metric-grid > div:nth-child(4n),
.dashboard-metric-grid > div:nth-child(3n),
.dashboard-metric-grid > div:nth-child(2n) {
    border-right: 1px solid var(--line);
}
.dashboard-metric-grid > div:nth-last-child(-n+4),
.dashboard-metric-grid > div:nth-last-child(-n+3),
.dashboard-metric-grid > div:nth-last-child(-n+2) {
    border-bottom: 1px solid var(--line);
}
.dashboard-metric-grid > div:nth-child(5n) { border-right: 0; }
.dashboard-metric-grid > div:nth-last-child(-n+5) { border-bottom: 0; }
.dashboard-metric-grid .feature strong { font-size: 28px; }

@media (max-width: 900px) {
    .dashboard-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-metric-grid > div,
    .dashboard-metric-grid > div:nth-child(3n),
    .dashboard-metric-grid > div:nth-child(4n),
    .dashboard-metric-grid > div:nth-child(5n) {
        border-right: 1px solid var(--line);
    }
    .dashboard-metric-grid > div:nth-child(2n) { border-right: 0; }
    .dashboard-metric-grid > div,
    .dashboard-metric-grid > div:nth-last-child(-n+3),
    .dashboard-metric-grid > div:nth-last-child(-n+4),
    .dashboard-metric-grid > div:nth-last-child(-n+5) {
        border-bottom: 1px solid var(--line);
    }
    .dashboard-metric-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 520px) {
    .brand-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 20px;
    }
    .dashboard-metric-grid { grid-template-columns: 1fr; }
    .dashboard-metric-grid > div,
    .dashboard-metric-grid > div:nth-child(2n),
    .dashboard-metric-grid > div:nth-child(3n),
    .dashboard-metric-grid > div:nth-child(4n),
    .dashboard-metric-grid > div:nth-child(5n) {
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .dashboard-metric-grid > div:nth-last-child(-n+2),
    .dashboard-metric-grid > div:nth-last-child(-n+3),
    .dashboard-metric-grid > div:nth-last-child(-n+4),
    .dashboard-metric-grid > div:nth-last-child(-n+5) { border-bottom: 1px solid var(--line); }
    .dashboard-metric-grid > div:last-child { border-bottom: 0; }
}

/* Einheitliche vertikale Abstände der Hauptnavigation. */
.sidebar-nav > .nav-entry {
    padding-block: 8px;
}
.sidebar-nav > .nav-entry:first-child { padding-top: 0; }
.sidebar-nav > .nav-entry:last-child { padding-bottom: 0; }
.sidebar-nav .nav-entry-home > a.nav-home,
.sidebar-nav .nav-entry-direct > a.nav-direct,
.nav-group summary {
    min-height: 42px;
}
@media (max-width: 820px) {
    .sidebar-nav > .nav-entry { padding-block: 6px; }
    .sidebar-nav > .nav-entry:first-child { padding-top: 0; }
    .sidebar-nav > .nav-entry:last-child { padding-bottom: 0; }
}

/* Rassen- und Bestandsprofile */
.flock-profile-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.kpi-text-value { font-size: 16px !important; line-height: 1.25; overflow-wrap: anywhere; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.flock-color-panel { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--petrol-50); }
.flock-color-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flock-color-heading h3 { margin: 2px 0 0; font-size: 16px; color: var(--petrol-950); }
.flock-color-rows { display: grid; gap: 8px; }
.flock-color-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(90px, .55fr) auto; gap: 8px; align-items: center; }
.flock-color-row .link { white-space: nowrap; }
.flock-color-total { display: flex; align-items: baseline; gap: 8px; padding-top: 2px; color: var(--muted); font-size: 11px; }
.flock-color-total strong { color: var(--petrol-950); font-size: 18px; }
.flock-color-total small { margin-left: auto; }
@media (max-width: 1040px) {
    .flock-profile-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .toolbar-actions { width: 100%; justify-content: stretch; }
    .toolbar-actions .button { flex: 1 1 auto; }
    .flock-color-row { grid-template-columns: 1fr 90px; }
    .flock-color-row .link { grid-column: 1 / -1; justify-self: start; }
    .flock-color-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
    .flock-profile-kpis { grid-template-columns: 1fr; }
    .flock-color-row { grid-template-columns: 1fr; }
    .flock-color-total { align-items: flex-start; flex-wrap: wrap; }
    .flock-color-total small { width: 100%; margin-left: 0; }
}

/* Version 1.9.2: zusammengeführte Bestandsverwaltung */
.flock-action-toolbar { align-items: center; }
.flock-switch-card { display: grid; gap: 15px; }
.flock-switch-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.flock-switch-summary > div {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--petrol-50);
}
.flock-switch-summary span,
.flock-switch-summary strong,
.flock-switch-summary small { display: block; }
.flock-switch-summary span { color: var(--muted); font-size: 11px; font-weight: 750; }
.flock-switch-summary strong { margin-top: 4px; color: var(--petrol-950); font-size: 16px; line-height: 1.35; }
.flock-switch-summary small { margin-top: 5px; color: var(--muted); line-height: 1.4; }
.flock-switch-summary + .form-actions { margin-top: 16px; }
.compact-notice { margin: 0; padding: 11px 13px; }
.flock-timeline-card { overflow: hidden; }
.flock-timeline {
    position: relative;
    display: grid;
    margin-top: 3px;
}
.flock-timeline::before {
    content: "";
    position: absolute;
    top: 22px;
    bottom: 22px;
    left: 174px;
    width: 1px;
    background: var(--line);
}
.flock-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 145px 34px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}
.flock-timeline-item:last-child { border-bottom: 0; }
.flock-timeline-date { min-width: 0; text-align: right; }
.flock-timeline-date strong,
.flock-timeline-date span { display: block; }
.flock-timeline-date strong { color: var(--petrol-950); font-size: 13px; }
.flock-timeline-date span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.flock-timeline-marker {
    position: relative;
    z-index: 1;
    width: 13px;
    height: 13px;
    justify-self: center;
    border: 3px solid #fff;
    border-radius: 999px;
    background: var(--petrol-700);
    box-shadow: 0 0 0 1px var(--petrol-200);
}
.flock-timeline-marker.addition { background: var(--petrol-700); }
.flock-timeline-marker.removal { background: #a45d5d; }
.flock-timeline-marker.profile-start { background: #8a6b35; }
.flock-timeline-marker.profile-end { background: #7d8790; }
.flock-timeline-content { min-width: 0; }
.flock-timeline-content > strong { display: block; color: var(--petrol-950); font-size: 14px; line-height: 1.35; }
.flock-timeline-content small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.4; }
.flock-timeline-content p { margin: 5px 0 0; color: var(--text); font-size: 12px; line-height: 1.45; }
.flock-timeline-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    white-space: nowrap;
    font-size: 12px;
}
.flock-timeline-actions form { margin: 0; }

@media (max-width: 860px) {
    .flock-switch-summary { grid-template-columns: 1fr; }
    .flock-timeline::before { left: 12px; }
    .flock-timeline-item {
        grid-template-columns: 24px minmax(0, 1fr) auto;
        gap: 10px;
        align-items: start;
        padding: 13px 0;
    }
    .flock-timeline-date {
        grid-column: 2;
        grid-row: 1;
        text-align: left;
    }
    .flock-timeline-marker {
        grid-column: 1;
        grid-row: 1 / span 2;
        margin-top: 2px;
    }
    .flock-timeline-content {
        grid-column: 2;
        grid-row: 2;
    }
    .flock-timeline-actions {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: center;
    }
}
@media (max-width: 580px) {
    .flock-timeline::before { left: 7px; }
    .flock-timeline-item {
        grid-template-columns: 15px minmax(0, 1fr);
    }
    .flock-timeline-marker { width: 11px; height: 11px; }
    .flock-timeline-actions {
        grid-column: 2;
        grid-row: 3;
        justify-content: flex-start;
        margin-top: 7px;
    }
}

/* Datensicherung und Wiederherstellung */
.docker-import-page { display: grid; gap: 18px; }
.docker-import-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px; align-items: start; }
.docker-import-card { min-width: 0; }
.docker-import-card .muted { margin: 0 0 16px; line-height: 1.6; }
.docker-import-upload-form { max-width: 620px; }
.docker-import-upload-form input[type="file"] { padding: 10px; background: #fff; }
.docker-import-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.docker-import-summary > div { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--petrol-50); }
.docker-import-summary span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.docker-import-summary strong { overflow-wrap: anywhere; }
.docker-import-table-wrap { max-height: 310px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.docker-import-table-wrap table { margin: 0; }
.docker-import-cancel-form { margin-top: 14px; }
.docker-current-data { display: grid; gap: 5px; margin: 16px 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfc; }
.docker-current-data span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.docker-import-confirm { align-items: flex-start; padding: 12px; border: 1px solid #ead1d1; border-radius: 9px; background: #fff7f7; }
.docker-import-confirm input { margin-top: 3px; }
.docker-import-help-card { margin-top: 0; }

@media (max-width: 980px) {
    .docker-import-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .docker-import-summary { grid-template-columns: 1fr; }
    .docker-import-card .button { width: 100%; }
}
