/* Maßnahmenplan – Oberfläche im Aufbau des bisherigen OMP (orange, Kopfbereich mit Menü, Inhalt mittig) */
:root {
  --ink: #595959;
  --muted: #818181;
  --line: #dddddd;
  --surface: #ffffff;
  --soft: #ffffff;
  --brand: #f39200;
  --brand2: #d97f00;
  --orange-light: #fdedd5;
  --cream: #fff8e8;
  --border: #ffca5e;
  --danger: #b42318;
  --success: #067647;
  --radius: 8px;
  font-family: 'Segoe UI', Arial, Verdana, sans-serif;
  color: var(--ink);
  background: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; background: #fff; font-size: 15px; line-height: 1.45; }
a { color: var(--ink); font-weight: bold; text-decoration: none; }
a:hover { color: #f8a704; text-decoration: underline; }
img { border: 0; }
button, .button, input, select, textarea { font: inherit; }
h1 { font-size: 1.5rem; margin: 0 0 6px; }
h2 { font-size: 1.2rem; margin: 0 0 14px; }
h3 { font-size: 1rem; margin: 22px 0 8px; }
.muted { color: var(--muted); margin: 0; }
small { color: var(--muted); font-weight: 400; }

/* ---------- Kopfbereich ---------- */
.site-header { box-shadow: 0 0 4px #595959; background: #fff; position: relative; z-index: 30; }
.header-inner { max-width: 1100px; margin: 0 auto; min-height: 100px; display: flex; align-items: center; gap: 24px; padding: 0 16px; }
.brand { flex: 0 0 auto; display: block; }
.brand img { display: block; width: 203px; height: 54px; }
.header-search { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; justify-content: center; }
.header-search input[type=search] { width: 270px; max-width: 100%; border-radius: 8px; border: 1px solid #ccc; box-shadow: 0 0 3px 1px #f3b250; padding: 4px 8px; }
.userinfo { flex: 0 0 auto; text-align: right; font-size: .88rem; color: #777; min-width: 190px; }
.userinfo p { margin: 0; }
.userinfo .timestamp { margin-top: 8px; color: var(--muted); }

.mainnav { max-width: 1100px; margin: 0 auto; text-align: center; padding: 0 16px; }
.mainnav ul { list-style: none; margin: 0; padding: 0; }
.mainnav > ul { display: inline-flex; flex-wrap: wrap; justify-content: center; }
.mainnav li { position: relative; }
.mainnav a, .mainnav .logout-link { display: block; padding: 8px 18px; font-weight: 600; color: var(--ink); background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; text-decoration: none; font-size: .95rem; border-radius: 0; }
.mainnav a:hover, .mainnav .logout-link:hover, .mainnav li:focus-within > a { color: var(--brand); border-bottom-color: var(--brand); text-decoration: none; }
.mainnav li.active > a { color: var(--brand); border-bottom-color: var(--brand); }
.mainnav .caret { display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; vertical-align: middle; }
.mainnav .dropdown ul { display: none; position: absolute; left: 0; top: 100%; min-width: 210px; background: #fff; border: 1px solid var(--border); box-shadow: 0 6px 14px rgba(0, 0, 0, .15); text-align: left; padding: 4px 0; }
.mainnav .dropdown:hover > ul, .mainnav .dropdown:focus-within > ul, .mainnav .dropdown.open > ul { display: block; }
.mainnav .dropdown ul a { border-bottom: 0; padding: 7px 18px; font-weight: 500; white-space: nowrap; }
.mainnav .dropdown ul a:hover, .mainnav .dropdown ul li.active > a { background: var(--orange-light); color: var(--ink); }
.menu-toggle { display: none; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; margin: 6px 0; cursor: pointer; font-weight: 600; }
.logout-form { margin: 0; }

/* ---------- Inhalt ---------- */
.wrapper { max-width: 1100px; margin: 0 auto; padding: 18px 16px 0; }
main.content { min-height: 520px; padding-bottom: 20px; }
footer.site-footer { border-top: 1px solid #eee; padding: 14px 0; text-align: center; font-size: .85rem; color: #818181; }
footer.site-footer a { font-weight: normal; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 14px; }
.page-head h1 { margin: 2px 0 4px; }
.eyebrow { font-size: .8rem; font-weight: 600; }
.breadcrumb { margin: 0 0 6px; line-height: 1.7; }
.breadcrumb span { margin-right: 4px; }
hr { border: 0; border-top: 1px solid #ddd; margin: 12px 0 16px; }

/* ---------- Schaltflächen ---------- */
.button, button, input[type=submit] { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #ccc; border-radius: 10px; background: #fff; color: var(--ink); padding: 4px 14px; cursor: pointer; font-weight: 600; text-decoration: none; }
.button:hover, button:hover { text-decoration: none; border-color: var(--brand); color: var(--ink); }
.primary { color: #fff; border-color: var(--brand); background: linear-gradient(to bottom, #f9b24a, #f39200); text-shadow: 0 1px 1px rgba(0, 0, 0, .3); box-shadow: 0 0 2px 2px rgba(243, 146, 0, .35); }
.primary:hover { color: #fff; background: linear-gradient(to bottom, #f5a42b, #d97f00); }
.small { font-size: .82rem; padding: 2px 10px; margin-left: 10px; }
.danger { border-color: #f0b8b3; color: var(--danger); background: #fff; }

/* ---------- Karten, Hinweise ---------- */
.panel, .login-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.notice { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; }
.success { background: #e9f8f0; color: var(--success); border: 1px solid #a8dec3; }
.notice.danger { background: #fff0ef; color: var(--danger); border: 1px solid #f0b8b3; }
.empty { border: 1px dashed #bec8d8; border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); }
.hint { font-size: .88rem; color: var(--muted); }
.prose { line-height: 1.6; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; margin-bottom: 14px; }
table { border-collapse: collapse; width: 100%; border: 1px solid var(--border); }
thead th { background: linear-gradient(to bottom, #f9b24a, #f39200); color: #fff; text-align: left; padding: 5px 8px; font-size: .88rem; text-shadow: 0 0 2px #212121; border-right: 1px solid #fcf1d4; white-space: nowrap; }
tbody td { padding: 6px 8px; border-top: 1px solid var(--border); border-right: 1px solid #ddd; vertical-align: top; font-size: .9rem; color: #777; }
tbody tr:nth-child(even) td { background: var(--cream); }
td.aktionen { text-align: center; white-space: nowrap; width: 70px; }
td.aktionen img, .icon { width: 16px; height: 16px; vertical-align: middle; }
.clickable { cursor: pointer; }
.clickable:hover td { background: var(--orange-light) !important; }
.compact { margin-top: 8px; }
.red { color: #e00000; }
.yellow { color: #f39200; }
.green { color: #1a8a1a; }

/* ---------- Filter, Formulare ---------- */
.filters, .search-large, .userbar { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; background: #fff; }
.filters label { min-width: 160px; }
.search-large input { flex: 1; min-width: 220px; }
.userbar { align-items: center; justify-content: space-between; border: 0; padding: 0; background: none; }
.userbar form { display: flex; align-items: center; gap: 10px; margin: 0; }
.userbar select { width: auto; min-width: 220px; }
.viewswitch { color: var(--muted); }
.viewswitch a.active { color: var(--brand); text-decoration: underline; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid #ccc; border-radius: 6px; background: #fff; color: var(--ink); padding: 7px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(243, 146, 0, .2); }
textarea { resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.danger-zone { margin: 16px 0; padding: 14px; border: 1px dashed #e8aaa5; border-radius: 10px; text-align: right; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs a { padding: 5px 14px; border-radius: 8px 8px 0 0; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Übersicht: Teilaufgaben ---------- */
.uebersicht h3, .tasks-heading { margin: 22px 0 6px; font-size: 1.05rem; }
.uebersicht .col-massnahme { width: 28%; }
.uebersicht .col-teilaufgabe { width: 26%; }
.uebersicht .col-ziel { width: 110px; white-space: nowrap; }

/* ---------- Plan-Ansicht ---------- */
.mp-haupttitel { margin: 0; font-size: 1.5rem; }
.mp-untertitel { margin: 2px 0 8px; font-size: 1.08rem; }
.mp-untertitel a { color: #f39000; font-weight: normal; }
.mp-stammdaten table { border: 0; margin-top: 8px; }
.mp-stammdaten td { width: 33%; border: 0 !important; background: none !important; padding: 2px 0; font-size: .95rem; }
.mp-stammdaten td:nth-child(2) { text-align: center; }
.mp-stammdaten td:nth-child(3) { text-align: right; }
.edit-icon { display: inline-block; margin-left: 6px; vertical-align: middle; }
.edit-icon img { width: 16px; height: 16px; }
.briefing { border: 1px solid var(--border); border-radius: 6px; margin: 14px 0; background: #fff; }
.briefing .header { padding: 5px 10px; font-weight: 700; background: var(--orange-light); display: flex; justify-content: space-between; align-items: center; }
.briefing .header a, .briefing .header img { width: auto; }
.briefing .header img { width: 14px; height: 14px; }
.briefing .content-briefing-wrapper { padding: 8px 12px; }
table.plan { margin-top: 12px; }
table.plan .mp-headline { background: linear-gradient(to bottom, #fdedd5, #fbd9a3) !important; color: var(--ink); padding: 8px 10px; border-top: 2px solid var(--brand); }
.mp-headline .head-flex { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mp-title { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.mp-beschreibung { display: block; font-weight: 400; color: #666; }
.mp-headline-icons { white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.mp-headline-icons .button { font-size: .8rem; }
table.plan td.mp-titel { width: 190px; background: #fff !important; }
.mp-massnahme-info table { border: 0; }
.mp-massnahme-info td { border: 0 !important; background: none !important; padding: 1px 2px; font-size: .85rem; }
.mp-massnahme-info td:last-child { text-align: right; }
.massnahme-actions { margin-top: 8px; display: flex; gap: 8px; }
.massnahme-actions img { width: 16px; height: 16px; }
.subtable { margin-bottom: 12px; }
.subtable > strong { display: block; margin-bottom: 4px; }
.subtable table { border: 1px solid var(--border); }
.subtable .col-wer { width: 90px; }
.subtable .col-status { width: 110px; }
.subtable .col-datum { width: 92px; white-space: nowrap; }
.subtable .col-dauer { width: 70px; text-align: right; }
.subtable .edititem { white-space: nowrap; margin-right: 6px; }
.subtable .edititem img { width: 12px; height: 12px; }
.subtable tr.add td { background: #fff !important; }
.subtable tr.add a { font-weight: 600; }
.subtable tr.add img { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.warning td { background: #ffeedd !important; }
.infofeld { white-space: pre-wrap; padding: 4px 2px; }
.sum-line { text-align: right; font-weight: 700; margin-top: 4px; }
.mp-liste td.col-ak { width: 70px; }
.kunde-tabelle { border: 0; }
.kunde-tabelle td { border: 0 !important; background: none !important; padding: 2px 8px 2px 0; font-size: .92rem; }
.kunde-tabelle td:first-child { font-weight: 700; width: 130px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.erstellen-row a { font-weight: 600; }
.erstellen-row img { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
fieldset { margin: 0; }

.hidden-row { display: none; }
table.show-all .hidden-row { display: table-row; }
.linklike { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 700; text-decoration: underline; border-radius: 0; }
.linklike:hover { color: #f8a704; }
table.plan tr.add td { background: #fff !important; }
.userbar label { flex-direction: row; align-items: center; gap: 10px; }
.subtable .edit-icon { margin-left: 8px; }

/* ---------- Anmeldung ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-wrap { width: 100%; max-width: 420px; text-align: center; }
.login-card { padding: 28px; text-align: left; box-shadow: 0 0 6px rgba(243, 146, 0, .35); }
.login-card h1 { margin: 14px 0 4px; }
.login-logo { display: block; margin: 0 auto 6px; }
.stack { display: grid; gap: 14px; margin-top: 20px; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; min-height: 0; padding: 10px 16px; gap: 10px; }
  .header-search { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .userinfo { text-align: right; min-width: 0; margin-left: auto; }
  .menu-toggle { display: inline-block; }
  .mainnav { text-align: left; }
  .mainnav > ul { display: none; flex-direction: column; width: 100%; }
  .menu-open .mainnav > ul { display: flex; }
  .mainnav a, .mainnav .logout-link { text-align: left; border-bottom: 0; width: 100%; }
  .mainnav .dropdown ul { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; }
  .two-col { grid-template-columns: 1fr; }
  table.plan td.mp-titel { width: auto; }
}
@media (max-width: 620px) {
  .wrapper { padding: 12px 10px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .page-head { flex-direction: column; }
  .header-search input[type=search] { width: 100%; }
  .filters > *, .userbar select { width: 100%; }
  .filters label { min-width: 100%; }
  .brand img { width: 160px; height: auto; }
  table.plan, table.plan > tbody, table.plan > tbody > tr, table.plan > tbody > tr > td { display: block; width: 100%; box-sizing: border-box; }
  table.plan td.mp-titel { width: 100%; border-bottom: 0; }
  .subtable { overflow-x: auto; }
  .subtable table { min-width: 460px; }
  .wrapper { overflow-x: hidden; }
}
@media print {
  .site-header .header-search, .mainnav, .menu-toggle, .edititem, tr.add, .massnahme-actions, .site-footer { display: none !important; }
  .site-header { box-shadow: none; }
}
