:root {
  --ink: #122027;
  --muted: #64757f;
  --line: #dce5e8;
  --panel: #ffffff;
  --soft: #f4f8f9;
  --soft-2: #edf4f6;
  --brand: #006b79;
  --brand-2: #12a8bd;
  --danger: #b83232;
  --warn: #fff2b8;
  --shadow: 0 18px 60px rgba(18, 32, 39, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

#appShell[hidden],
#loginScreen[hidden] {
  display: none;
}
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  padding: 20px;
}
.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 40px 44px;
}
.login-logo {
  display: block;
  width: 100%;
  max-width: 260px;
  margin: 0 auto 8px;
}
.login-card h1 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 6px;
}
.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.login-card input {
  min-height: 46px;
  font-size: 15px;
}
.login-card .primary-button {
  min-height: 46px;
  font-size: 15px;
  margin-top: 4px;
}
.login-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: #0f252c;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand {
  display: block;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.brand-logo {
  display: block;
  width: 100%;
  max-width: 220px;
  border-radius: 6px;
  background: white;
  padding: 10px;
}
nav { display: grid; gap: 7px; }
.nav-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  text-align: left;
  color: #d7e7eb;
  background: transparent;
}
.nav-button.active, .nav-button:hover { background: rgba(18,168,189,.18); color: white; }
.nav-badge {
  display: inline-block;
  min-width: 20px;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #d64545;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}
.nav-badge.muted { background: #6f858d; }
.beta-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ffd76e;
  color: #5b4a05;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}
.sidebar-actions { margin-top: auto; display: grid; gap: 8px; }

main { min-width: 0; padding: 26px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: 31px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.today-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 190px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.today-text span, .today-text strong { display: block; }
.today-text span { color: var(--muted); font-size: 13px; }
.user-badge {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: default;
}
.sync-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  background: #c93030;
}
.sync-dot.connected { background: #2f9e55; }
.sync-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  background: #203038;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  max-width: 320px;
}
.view { display: none; }
.active-view { display: block; }

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar input, .toolbar select, .toolbar textarea, .form-grid input, .form-grid select, dialog input, dialog select {
  min-height: 40px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: white;
}
.toolbar label, .form-grid label, dialog label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.inline-check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--brand);
}
.primary-button, .ghost-button, .icon-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  font-weight: 800;
}
.primary-button { background: var(--brand); color: white; }
.ghost-button { background: #e6eff2; color: var(--ink); }
.ghost-button.active { background: var(--brand); color: white; }
.ghost-button.danger { color: var(--danger); }
.compact-button {
  min-height: 32px;
  margin: 2px;
  padding: 0 9px;
  font-size: 12px;
}
.icon-button {
  width: 40px;
  padding: 0;
  font-size: 24px;
  background: #ecf3f5;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.panel, .metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.panel { padding: 16px; margin-bottom: 14px; }
.success-panel {
  border-color: #a9d9bd;
  background: #edf8f1;
  color: #1d6235;
  font-weight: 800;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.metric-card { padding: 15px; }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 5px; font-size: 28px; }

.my-day-list {
  display: grid;
  gap: 8px;
}
.my-day-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.my-day-row.weekend {
  background: var(--soft-2);
}
.my-day-date {
  flex: 0 0 76px;
  display: grid;
  gap: 2px;
}
.my-day-date strong {
  font-size: 13px;
  line-height: 1.25;
}
.my-day-date small {
  color: var(--muted);
  font-size: 11px;
}
.my-day-content {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: center;
}
.my-entry {
  border-radius: 6px;
  padding: 8px 10px;
}
.my-entry strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.my-entry small {
  display: block;
  color: rgba(0, 0, 0, 0.62);
  font-size: 11px;
  margin-top: 2px;
}
.my-entry .my-contact { margin-top: 4px; }
.my-entry a {
  white-space: nowrap;
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
}
.my-entry-calendar {
  background: var(--warn);
}
.my-entry-empty {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}
.mobile-date-col {
  min-width: 84px;
  max-width: 84px;
}
.mobile-date-col strong { display: block; font-size: 12px; }
.mobile-date-col small { display: block; color: var(--muted); }
.mobile-emp-col strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.metric-link {
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.metric-link:hover { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(18, 168, 189, 0.25); }
.team-summary .team-link { cursor: pointer; }
.team-summary .team-link:hover,
.team-summary .team-link:focus-visible { background: #e3f4f7; outline: none; }
.team-summary .team-link strong { color: var(--brand); }
.team-summary header.team-open { cursor: pointer; flex-wrap: wrap; }
.team-summary header.team-open:hover,
.team-summary header.team-open:focus-visible { background: #dcedf1; outline: none; }
.team-summary header.team-open strong { color: var(--brand); }
.team-summary header.team-open span { color: var(--brand); font-weight: 600; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.dashboard-team-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
}
.team-summary {
  width: calc(50% - 5px);
  min-width: 240px;
  max-width: 100%;
  resize: horizontal;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
  overflow: hidden;
}
.team-summary header,
.team-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}
.team-summary header {
  background: #eef6f8;
}
.team-summary div:last-child {
  border-bottom: 0;
}
.team-summary span {
  color: var(--muted);
}
.training-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.training-overview article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}
.training-overview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.training-overview strong {
  display: block;
  margin-top: 4px;
  font-size: 25px;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
table { border-collapse: separate; border-spacing: 0; width: 100%; }
.resizable-table {
  width: max-content;
  min-width: 100%;
}
th, td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
}
th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef6f8;
  text-align: left;
  font-size: 12px;
  padding-right: 16px;
}
.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
  z-index: 8;
}
.col-resizer::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 3px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: rgba(0, 107, 121, .18);
}
.col-resizer:hover::after,
.col-resizer.active::after {
  background: var(--brand);
}
.col-resizer::after { background: rgba(0, 107, 121, .32); }
th:last-child > .col-resizer { right: 0; }
.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
}
.table-tools .helper-text { margin: 0; }
.table-wrap .employee-table.resizable-table {
  table-layout: fixed;
  width: 100%;
  min-width: 960px;
}
.employee-table td { overflow-wrap: anywhere; }
.employee-table input,
.employee-table select {
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}
.employee-table .compact-button { white-space: nowrap; }
.sticky-col {
  position: sticky;
  left: 0;
  z-index: 4;
  background: white;
}
th.sticky-col { z-index: 5; background: #eef6f8; }
.team-col {
  position: sticky;
  left: 188px;
  z-index: 4;
  min-width: 150px;
}
th.team-col { z-index: 5; }
.employee-col { min-width: 188px; }
.conflict-badge {
  display: block;
  margin-top: 5px;
  border: 0;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  background: #ffe0e0;
  color: #b02a2a;
  cursor: pointer;
}
.conflict-badge:hover { background: #ffc9c9; }
.leave-counts {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.day-col { min-width: 132px; max-width: 132px; }
.weekend { background-image: repeating-linear-gradient(135deg, rgba(18,32,39,.05) 0 6px, rgba(18,32,39,.1) 6px 12px); }
.holiday-head { outline: 3px solid rgba(184,50,50,.35); outline-offset: -3px; }
.section-row td {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ddebee;
  color: #17343d;
  font-weight: 900;
}
.notice-section-row td {
  background: #fff8d8;
  color: #40360b;
}
.notice-section-row .sticky-col,
.notice-section-row .team-col {
  z-index: 4;
  background: #fff0a8;
}
.notice-day {
  min-height: 58px;
}
.notice-day strong,
.notice-day small {
  display: block;
}
.notice-day strong {
  font-size: 12px;
  line-height: 1.25;
}
.notice-day small {
  margin-top: 4px;
  color: rgba(64, 54, 11, .72);
  font-size: 11px;
}
.calendar-section-row td {
  background: #f3f8ef;
  color: #314524;
}
.calendar-section-row .sticky-col,
.calendar-section-row .team-col {
  z-index: 4;
  background: #e3f0d6;
}
.calendar-day strong,
.calendar-day small {
  display: block;
}
.calendar-day strong {
  font-size: 12px;
  line-height: 1.25;
}
.calendar-day small {
  margin-top: 4px;
  color: rgba(49, 69, 36, .68);
  font-size: 11px;
}
.cell-button {
  display: block;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 6px;
  padding: 7px;
  text-align: left;
  color: #182126;
}
.cell-button small { display: block; margin-top: 4px; color: rgba(0,0,0,.62); }
.training-table th,
.training-table td {
  min-width: 148px;
}
.training-table .employee-col {
  min-width: 230px;
}
.training-table .employee-col small {
  display: block;
  margin-top: 3px;
}
.training-card {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px;
  text-align: left;
  background: #f1f4f5;
  color: var(--ink);
}
.training-card.required {
  border-color: rgba(0, 107, 121, .22);
  background: #edf8f1;
}
.training-card.dated {
  background: #e0f0ff;
  border-color: rgba(0, 107, 121, .28);
}
.training-card strong {
  font-size: 13px;
}
.training-card small {
  color: var(--muted);
  font-size: 11px;
}
.empty-cell {
  position: relative;
  overflow: hidden;
}
.calendar-cell-note {
  position: absolute;
  right: 7px;
  bottom: 5px;
  left: 7px;
  overflow: hidden;
  color: rgba(49, 69, 36, .42);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-stack {
  display: grid;
  gap: 6px;
  min-height: 56px;
  border-radius: 7px;
}
.cell-stack.drag-over {
  outline: 3px solid rgba(0, 107, 121, .35);
  outline-offset: 2px;
}
.entry-block {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 4px;
  min-height: 56px;
  border-radius: 6px;
  color: #182126;
  box-shadow: inset 0 0 0 1px rgba(18, 32, 39, .06);
}
.entry-block.dragging {
  opacity: .58;
}
.entry-main {
  min-width: 0;
  min-height: 56px;
  border: 0;
  border-radius: 6px 0 0 6px;
  padding: 7px;
  text-align: left;
  color: inherit;
  background: transparent;
}
.entry-main strong,
.entry-main small {
  display: block;
}
.entry-main strong {
  line-height: 1.22;
  overflow-wrap: anywhere;
}
.entry-main small {
  margin-top: 4px;
  color: rgba(0,0,0,.62);
}
.entry-main .hr-hint {
  color: #765900;
  font-weight: 800;
}
.entry-delete {
  align-self: start;
  justify-self: end;
  width: 22px;
  min-height: 22px;
  border: 0;
  border-radius: 0 6px 0 6px;
  background: rgba(255,255,255,.62);
  color: var(--danger);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}
.entry-delete:hover {
  background: #ffe0e0;
}
.conflict {
  box-shadow: inset 0 0 0 3px #c93030;
}
.empty-cell { background: #f7fafb; color: #8aa0a8; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}
.form-grid .wide-field {
  grid-column: span 2;
}
.form-grid.cols-person { grid-template-columns: minmax(110px, 150px) repeat(2, minmax(0, 1fr)) minmax(120px, 160px); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-title { margin: 22px 0 10px; font-size: 16px; }
.request-card {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 6px solid #e0b43c;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.request-card.status-approved { border-left-color: #2f9e55; }
.request-card.status-rejected { border-left-color: #c93030; }
.request-card.status-withdrawn { border-left-color: #8a9ca3; }
.request-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.request-card header strong { font-size: 16px; }
.request-card small { color: var(--muted); font-size: 12px; }
.request-period { margin: 0; font-weight: 800; }
.request-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff2b8;
  color: #765900;
  font-size: 12px;
  font-weight: 800;
}
.request-card.status-approved .request-status, .request-status.status-approved { background: #dff4e7; color: #1d6235; }
.request-card.status-rejected .request-status, .request-status.status-rejected { background: #ffe0e0; color: #9b2222; }
.request-card.status-withdrawn .request-status, .request-status.status-withdrawn { background: #e6eff2; color: #4a5f67; }
.request-decision { color: #203038; }
.request-insight { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.request-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: #e6eff2;
  color: #203038;
  font-size: 12px;
}
.request-chip.warn { background: #fff2b8; color: #765900; font-weight: 700; }
.request-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.request-actions input { flex: 1 1 240px; min-height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
#cellContactFields { display: contents; }
#cellContactFields[hidden] { display: none; }
.combo { position: relative; display: block; }
.combo input[type="text"] { width: 100%; }
.combo-list {
  position: absolute;
  z-index: 40;
  top: 100%;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  max-height: 340px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.combo-list[hidden] { display: none; }
.combo-list li {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #203038;
  font-weight: 400;
  cursor: pointer;
}
.combo-list li strong { font-size: 13px; }
.combo-list li small { color: var(--muted); font-size: 11px; font-weight: 400; }
.combo-list li.active,
.combo-list li:hover { background: #e3f4f7; }
.combo-list li.combo-empty { color: var(--muted); font-size: 12px; cursor: default; background: none; }
.form-actions.work-actions { grid-column: span 2; align-self: end; gap: 10px; margin-top: 0; }
.form-section { margin-top: 18px; }
.form-section > h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.form-section .helper-text { margin: 8px 0 0; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
.form-grid select {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.compact-field {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.compact-field input,
.phase-row input,
.number-field {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  font-weight: 700;
  background: #fff;
}
.phase-cell {
  min-width: 360px;
}
.phase-row {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) 118px 118px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.phase-row strong {
  font-size: 12px;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.inline-check input {
  width: 17px;
  height: 17px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #edf4f6;
}
.ok-pill {
  background: #dff4e7;
  color: #1d6235;
}
.warn-pill {
  background: #fff2b8;
  color: #765900;
}
.helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.info-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.info-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfd;
  padding: 8px 10px;
}
.info-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.project-table > tbody > tr.project-row > td { border-bottom: 4px solid #8aa6af; }
.project-table > tbody > tr.project-row:nth-child(even) > td { background: #f2f8fa; }
.project-table > tbody > tr.project-row > td:first-child { border-left: 10px solid var(--project-color, #fff2a8); }
.project-status-cell { min-width: 190px; }
.project-table select[data-project-phase-mode] {
  width: 230px;
  max-width: 100%;
  text-overflow: ellipsis;
}
.project-title {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.color-input {
  width: 48px;
  height: 34px;
  padding: 2px;
  border: 1px solid rgba(0, 0, 0, .3);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.color-input:hover { border-color: var(--brand); }
.color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.2);
  vertical-align: middle;
}
.list-stack { display: grid; gap: 10px; }
.org-tree-table .org-team-cell {
  vertical-align: top;
  font-weight: 700;
  background: #f4f7f8;
  border-right: 1px solid rgba(0,0,0,.08);
}
.org-tree-table tr[hidden] { display: none; }
.org-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.org-toolbar .helper-text { margin: 0 0 0 6px; }
/* Segment-Kopfzeile: immer sichtbar, klappt die Teams und Bereiche darunter auf und zu */
.org-tree-table .org-segment-row td {
  padding: 0;
  background: #e7f1f3;
  cursor: pointer;
}
.org-tree-table .org-segment-row:hover td { background: #dcebee; }
.org-tree-table .org-segment-row.open td { border-bottom: 2px solid var(--brand); }
/* sticky: bleibt auch bei breiter, seitlich scrollender Tabelle (Handy) am linken Rand sichtbar */
.org-segment-head {
  position: sticky;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  width: fit-content;
  max-width: calc(100vw - 48px);
  padding: 8px 10px;
}
.org-segment-name { display: flex; align-items: center; min-width: 0; }
.org-segment-summary { color: var(--muted); font-size: 13px; font-weight: 400; }
.org-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.org-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--panel);
  color: var(--brand);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.org-toggle:hover .org-toggle-icon, .org-toggle:focus-visible .org-toggle-icon { background: var(--brand); color: #fff; }
.org-rename-btn {
  margin-left: 6px;
  padding: 0 7px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--brand);
  font-size: 14px;
  cursor: pointer;
  vertical-align: middle;
}
.org-rename-btn:hover, .org-rename-btn:focus-visible { background: var(--brand); color: #fff; }
.org-rename-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.org-rename-input { min-width: 160px; flex: 1 1 160px; min-height: 34px; font-weight: 700; }
.org-tree-table .org-edit-row td { padding: 0; background: #f4fbfc; border-top: 2px solid var(--brand); border-bottom: 2px solid var(--brand); }
.org-tree-table tr.org-editing .org-area-cell { outline: 2px solid var(--brand); outline-offset: -2px; }
.org-team-lead { margin-top: 6px; display: block; font-weight: 400; }
.org-team-lead small { color: var(--muted); }
.org-team-lead small strong { color: var(--ink); }
.org-team-lead .org-rename-box { margin-bottom: 2px; }
.org-lead-cell .org-rename-box { min-width: 240px; }
.org-edit-panel { padding: 12px 14px; }
.org-edit-panel h3 { margin: 0 0 8px; font-size: 15px; }
.org-edit-panel .inline-check { grid-column: 1 / -1; }
.org-tree-table .org-area-cell {
  padding-left: 22px;
  position: relative;
}
.org-tree-table .org-area-cell::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0,0,0,.12);
}
.week-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}
.week-card header {
  padding: 12px 14px;
  background: #e7f1f3;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.week-card .week-body { display: grid; gap: 6px; padding: 12px; }
.free-person {
  width: 100%;
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfd;
  padding: 8px 10px;
  text-align: left;
}
.free-person-main {
  display: grid;
  gap: 3px;
}
.free-person-main small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.free-person span:last-child { color: var(--muted); }

dialog {
  border: 0;
  border-radius: 10px;
  padding: 0;
  width: min(520px, calc(100vw - 24px));
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(5, 22, 27, .48); }
.dialog-card { display: grid; gap: 13px; padding: 18px; }
.dialog-card header, .dialog-card footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; }

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-button { background: rgba(255,255,255,.06); }
  main { padding: 14px; }
  .topbar { display: grid; }
  h1 { font-size: 25px; }
  .team-col { left: 152px; min-width: 124px; }
  .employee-col { min-width: 152px; }
  .day-col { min-width: 118px; max-width: 118px; }
  .cell-button { min-height: 62px; }
  .free-person { display: grid; }
  .form-grid .wide-field { grid-column: auto; }
  .form-grid.cols-person, .form-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .form-actions .primary-button { width: 100%; }
  .team-summary { width: 100%; }
  .form-actions.work-actions { grid-column: auto; }
}

/* Hinweis bei fehlendem Änderungsrecht */
.readonly-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid #ecd58a;
  border-radius: 8px;
  background: var(--warn);
  color: #5b4a05;
  font-size: 13px;
  font-weight: 600;
}
.readonly-banner[hidden] { display: none; }

/* Einstellungen > Berechtigungen */
.settings-tabs { margin-bottom: 14px; }
.permission-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}
.permission-table th, .permission-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.permission-table thead th { background: var(--soft-2); }
.permission-table th small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.permission-table thead th:first-child { min-width: 200px; }
.permission-table thead th:not(:first-child) { min-width: 170px; }
.permission-table tbody th[scope="row"] { font-weight: 700; }
.permission-table .group-row th {
  background: var(--soft);
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.perm-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.perm-check:last-child { margin-right: 0; }
.perm-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.perm-check.locked { color: var(--muted); cursor: not-allowed; }
.perm-check.locked input { cursor: not-allowed; }
.perm-actions {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.perm-actions .helper-text { margin: 0 0 0 auto; }
@media (max-width: 820px) {
  .perm-check { display: flex; margin: 0 0 6px; }
}

/* Rollen als Spalten: Name direkt in der Spaltenüberschrift änderbar, eigene Rollen löschbar */
.role-name-input {
  width: 100%;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}
.role-name-input:hover, .role-name-input:focus { border-color: var(--line); background: var(--panel); }
.permission-table thead th .compact-button { margin-top: 6px; }
.role-add { margin: 12px 0 16px; align-items: end; }

/* SAP-Import (Abwesenheit) */
dialog.wide-dialog { width: min(1180px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
.sap-import-card { gap: 12px; }
.sap-grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.sap-grid { width: 100%; min-width: 1000px; border-collapse: collapse; }
.sap-grid thead th {
  padding: 8px 6px;
  background: var(--soft-2);
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}
.sap-grid td { padding: 3px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sap-grid td input { width: 100%; min-height: 34px; padding: 4px 6px; font-size: 13px; }
.sap-grid td.sap-check { padding: 3px 8px; font-size: 12px; line-height: 1.35; }
.sap-grid .sap-ok { color: #1e7a3a; font-weight: 700; }
.sap-grid .sap-warn { color: #8a5a00; display: block; font-weight: 600; }
.sap-grid .sap-error { color: var(--danger); font-weight: 700; }
.sap-grid tr.has-error td input { border-color: #e7a0a0; background: #fff6f6; }
.sap-actions, .sap-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sap-footer { justify-content: space-between; }
.sap-footer .helper-text { margin: 0; }
.sap-top { max-width: 520px; }
.sap-import-card, #sapImportBody { grid-template-columns: minmax(0, 1fr); min-width: 0; }
#sapImportBody { display: grid; gap: 12px; }
dialog.wide-dialog { overflow-x: hidden; }
@media (max-width: 820px) {
  .sap-footer { flex-direction: column; align-items: stretch; }
  .sap-footer .sap-actions { justify-content: flex-end; }
}

/* Mein Einsatzplan: Überstunden / FZA-Abbau mit Pfeilen melden (Smartphone) */
.my-hours-step { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.my-hours-step button {
  width: 44px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
  touch-action: manipulation;
}
.my-hours-step button:active { background: var(--brand); color: #fff; }
.my-hours-chip { border-radius: 6px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.my-hours-chip.draft { background: #e6f6f8; color: var(--brand); border: 1px dashed var(--brand); }
.my-hours-chip.pending { background: var(--warn); color: #5b4a05; }
.hours-bar {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}
.hours-bar[hidden] { display: none; }
.hours-bar strong { font-size: 13px; }
.hours-bar .hours-bar-actions { display: flex; gap: 8px; }
.hours-list { display: grid; gap: 6px; margin: 4px 0 10px; padding: 0; list-style: none; }
.hours-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.hours-list li span:last-child { font-weight: 800; color: var(--brand); }
/* Arbeitsplanung: bearbeitbare Projekt-Legende (Farbe, Name, Löschen) */
.legend-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 4px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
}
.legend-item .legend-color {
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.legend-item .legend-name {
  min-height: 0;
  padding: 3px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  width: auto;
}
.legend-item .legend-name:hover,
.legend-item .legend-name:focus { border-color: rgba(0, 0, 0, 0.35); background: rgba(255, 255, 255, 0.55); outline: none; }
.legend-item .legend-delete {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.legend-item .legend-delete:hover { background: #d64545; color: #fff !important; }

/* Personalplan: kein großer Seitentitel, schlanke Kopfleiste (Datum/Anmeldung rechts), Plan beginnt weiter oben.
   Der Titel bleibt für Screenreader im Dokument. */
#appShell[data-view="plan"] main { padding-top: 10px; }
#appShell[data-view="plan"] .topbar { margin-bottom: 6px; justify-content: flex-end; }
#appShell[data-view="plan"] .topbar-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
#appShell[data-view="plan"] .today-card { padding: 4px 10px; min-width: 0; gap: 12px; box-shadow: none; }
#appShell[data-view="plan"] .today-text span,
#appShell[data-view="plan"] .today-text strong { display: inline; font-size: 13px; }
#appShell[data-view="plan"] .today-text span { margin-right: 6px; }
#appShell[data-view="plan"] .user-badge { width: 32px; height: 32px; font-size: 12px; }
#appShell[data-view="plan"] .plan-table td.team-col strong { font-size: 13px; line-height: 1.25; }

/* Personalplan: Mehrfachauswahl für Segment / Team / Bereich per Häkchen */
.plan-filters { display: contents; }
.multi-filter { position: relative; display: grid; gap: 5px; width: 210px; max-width: 100%; min-width: 0; }
.multi-filter-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.multi-filter-box { position: relative; }
.multi-filter-box > summary {
  min-height: 40px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-size: 14px;
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.multi-filter-box > summary::-webkit-details-marker { display: none; }
.multi-filter-box > summary::after { content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.multi-filter-box[open] > summary { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(0, 107, 121, 0.18); }
.multi-filter-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  max-height: 340px;
  overflow: auto;
  display: grid;
  gap: 2px;
  padding: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.toolbar .multi-option, .multi-option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.toolbar .multi-option:hover { background: var(--soft-2); }
.toolbar .multi-option input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: none; border: 0; background: none; accent-color: var(--brand); }
.multi-filter-panel .link-button { text-align: left; padding: 6px 8px; white-space: normal; }
.multi-filter-panel .link-button:disabled { opacity: 0.45; cursor: default; text-decoration: none; }
.multi-filter-panel .helper-text { display: block; padding: 6px 8px 2px; max-width: 300px; }
@media (max-width: 820px) {
  /* Schmale Bildschirme: Auswahlfenster so breit wie die Filterleiste, direkt darunter */
  #plan .toolbar { position: relative; }
  #plan .multi-filter, #plan .multi-filter-box { position: static; }
  #plan .multi-filter-panel { left: 0; right: 0; top: 100%; min-width: 0; width: auto; }
}

/* Mitarbeiterliste: Suche, Filter, Sortierung (bleibt beim Scrollen oben stehen) */
.employee-filter {
  background: var(--soft);
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--line);
}
.employee-filter .employee-search { flex: 1 1 260px; max-width: 420px; }
.employee-filter .employee-search input { width: 100%; }
@media (min-width: 900px) {
  .employee-filter { position: sticky; top: 0; z-index: 15; }
}

/* Mein Einsatzplan: Tage für Urlaub / FZA / Sonstiges wählen (nur im Auswahlmodus antippbar) */
.select-toggle-row { margin-top: 10px; }
.select-toggle-row button { width: 100%; max-width: 420px; min-height: 44px; }
.my-day-row.selectable {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.my-day-row.selectable:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 1px; }
.my-day-row.unselectable { opacity: 0.5; }
.my-day-pick {
  flex: 0 0 auto;
  align-self: center;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}
.my-day-row.unselectable .my-day-pick { visibility: hidden; }
.my-day-row.selectable.in-range { background: #e6f6f8; border-color: var(--brand-2); }
.my-day-row.selectable.in-range .my-day-pick { background: var(--brand); border-color: var(--brand); }
.my-day-row.selectable.sel-edge { border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.hours-bar button:disabled { opacity: 0.45; }
#hoursBody { display: grid; gap: 12px; }
#hoursBody label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
#hoursBody select, #hoursBody input { width: 100%; min-height: 44px; }
.sap-grid .sap-note { color: var(--muted); display: block; font-style: italic; }

/* Einklappbarer Bereich "Zuletzt bearbeitet" (Plus/Minus) */
.collapsible { margin-top: 18px; }
.collapse-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.collapse-head:hover { background: var(--soft-2); }
.collapse-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--soft-2);
  color: var(--brand);
  font-size: 20px;
  line-height: 1;
}
.collapse-head small { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 700; }
.collapse-body { display: grid; gap: 10px; margin-top: 10px; }
.collapse-body[hidden] { display: none; }

/* Phasen und Mitarbeiter einplanen (Arbeitsplanung, Projektplanung) */
.avail-hint { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.avail-hint[hidden] { display: none; }
.phase-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.phase-foot .compact-field { width: 96px; margin-bottom: 0; }
.phase-foot .status-pill { align-self: center; }
.staff-add-button { min-height: 32px; padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.project-status-cell .staff-add-button { display: block; margin: 8px 0 6px; }
#projectStaffBody { display: grid; gap: 12px; }
#projectStaffBody label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
#projectStaffBody select, #projectStaffBody input { width: 100%; min-height: 40px; }
.ps-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ps-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ps-staffing .status-pill { font-size: 13px; }
.staff-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.staff-chips-label { color: var(--muted); font-size: 12px; font-weight: 800; }
.staff-chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: var(--soft); font-size: 12px; font-weight: 700; }
.avail-hint .status-pill { border-radius: 8px; line-height: 1.35; }
.ps-queue { display: grid; gap: 8px; }
.ps-queue-row { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--soft); }
.ps-queue-head { display: flex; align-items: center; gap: 8px; }
.ps-queue-head strong { font-size: 14px; }
.ps-queue-head small { color: var(--muted); font-size: 12px; }
.ps-queue-row .avail-hint { margin-top: 6px; }
.ps-remove { margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.ps-remove:hover { background: var(--soft-2); color: var(--danger); }
.ps-queue .helper-text { margin: 0; }

/* Personalplan: Kopieren und Einfügen (Rechtsklick-Menü, Hinweis oben, markierter Block) */
.ctx-menu {
  position: fixed;
  z-index: 1000;
  min-width: 230px;
  max-width: calc(100vw - 16px);
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.ctx-menu button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.ctx-menu button:hover:not(:disabled),
.ctx-menu button:focus-visible { background: var(--soft-2); outline: none; }
.ctx-menu button:disabled { color: #9aa9b0; cursor: default; }
.ctx-menu .ctx-hint { color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.ctx-menu hr { margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
.entry-block.copied { outline: 2px dashed var(--brand); outline-offset: 2px; }
.clip-pill { gap: 8px; border: 1px dashed var(--brand); background: #e6f6f8; color: var(--brand); }
.clip-pill[hidden] { display: none; }
.clip-pill button { border: 0; background: transparent; color: inherit; font-size: 16px; font-weight: 800; line-height: 1; cursor: pointer; }

/* Personalplan (Desktop): der Plan füllt die Fensterhöhe und scrollt in sich. Dadurch bleibt die Datumszeile oben
   stehen und die seitliche Bildlaufleiste ist immer am unteren Fensterrand zu sehen. --plan-wrap-top setzt app.js
   (Abstand des Plans zum Seitenanfang), plan-fit wird nur im Desktop-Layout gesetzt. */
@media (min-width: 821px) {
  #appShell[data-view="plan"] main { padding-bottom: 8px; }
  #planWrap.plan-fit {
    max-height: max(260px, calc(100vh - var(--plan-wrap-top, 230px) - 8px));
    overflow: auto;
    cursor: grab;
  }
  #planWrap.plan-fit.panning,
  #planWrap.plan-fit.panning * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
}

/* Plangröße (Regler in der Plan-Werkzeugleiste) */
#planWrap .plan-table { zoom: var(--plan-zoom, 1); }
.zoom-control { min-width: 220px; }
.zoom-row { display: flex; align-items: center; gap: 8px; }
.zoom-row input[type="range"] { width: 130px; min-height: 0; padding: 0; accent-color: var(--brand); }
.zoom-row output { min-width: 44px; font-size: 13px; font-weight: 800; color: var(--ink); }
.zoom-row .compact-button { min-height: 30px; padding: 3px 8px; font-size: 12px; }

/* Infos direkt im Personalplan eintragen (Zeile "Stillstände / wichtige Infos") */
.notice-day { position: relative; }
.notice-chip {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  margin-bottom: 4px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, .55);
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.notice-chip:hover, .notice-chip:focus-visible { background: #fff; outline: 2px solid var(--brand); }
.notice-add {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 22px;
  font-weight: 800;
  opacity: 0;
  cursor: pointer;
}
.notice-editable:hover .notice-add, .notice-add:focus-visible { opacity: 1; background: rgba(255, 255, 255, .35); }
@media (hover: none) { .notice-add { opacity: .35; } }

/* Infos in "Mein Einsatzplan" */
.my-entry-notice { background: #fff8d8; border-left: 4px solid #e0b400; }
.my-entry-notice small { display: block; color: #7a5f00; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }

.notice-form { display: grid; gap: 12px; }
.notice-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.notice-form input { width: 100%; min-height: 40px; }
.notice-actions { display: flex; justify-content: space-between; gap: 8px; }
.notice-actions .primary-button { margin-left: auto; }

/* Speicherstatus (Zeilenweiser Abgleich) */
.save-status {
  order: -1;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf4f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.save-status[hidden] { display: none; }
.save-status[data-state="saved"] { background: #dff4e7; color: #1d6235; }
.save-status[data-state="error"] { background: #fde0e0; color: var(--danger); }
.sync-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid #e6b0b0;
  border-radius: 8px;
  background: #fde0e0;
  color: #7a1f1f;
  font-size: 13px;
  font-weight: 700;
}
.sync-banner[hidden] { display: none; }

/* Änderungsverlauf */
.history-list { display: grid; gap: 10px; max-height: 60vh; margin: 0; padding: 0; overflow: auto; list-style: none; }
.history-list li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.history-list li span { color: var(--muted); font-size: 12px; }
.history-change { margin-top: 4px; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }

/* Passwort: Regeln, Ändern, Vergessen, Verwaltung */
.login-screen[hidden] { display: none; }
.link-button {
  justify-self: center;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}
.forgot-panel { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.forgot-panel[hidden] { display: none; }
.pw-form { display: grid; gap: 14px; }
.pw-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.pw-form input { width: 100%; min-height: 44px; font-size: 15px; }
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 96px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: var(--soft-2);
  color: var(--brand);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.pw-rules { display: grid; gap: 6px; margin: 0; padding: 12px; list-style: none; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.pw-rules li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 700; }
.pw-rules li.ok { color: #1d6235; }
.pw-check {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e3ebee;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.pw-rules li.ok .pw-check { background: #1d8a4a; color: #fff; }
.pw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pw-actions .primary-button { flex: 1 1 200px; }
.pw-chip { display: block; margin: 4px 0; padding: 2px 8px; width: fit-content; border-radius: 999px; background: #e6f6f8; color: var(--brand); font-size: 11px; font-weight: 800; }
.pw-chip.warn { background: #fde0e0; color: var(--danger); }
.pw-request-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.temp-password-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.temp-password { padding: 10px 14px; border: 1px dashed var(--brand); border-radius: 8px; background: #f4fbfc; color: var(--ink); font-family: Consolas, "Courier New", monospace; font-size: 24px; font-weight: 800; letter-spacing: .06em; user-select: all; }
.pw-request { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fbfdfd; }
.pw-request span { color: var(--muted); font-size: 12px; font-weight: 700; }
.pw-request strong { font-size: 14px; }
.pw-request > .pw-request-actions { margin-left: auto; }
.info-list + h3, #pwAdminPanel h3 { margin-top: 14px; }

/* Anträge: Vertreter-Regel (Hinweis an der Karte, Zeile mit Vertretung in der Werkzeugleiste) */
.request-card .request-deputy-note { display: block; margin-top: 4px; padding: 4px 8px; border-left: 3px solid var(--brand-2); background: #e6f6f8; color: var(--brand); font-weight: 600; }
.request-deputy-info { margin: 0 0 0 6px; }
.request-deputy-info .link-button { margin-left: 4px; }

/* Projektplanung: Reiter Mein Team / Alle Teams, Gruppenkopf je Team */
.project-scope-tabs, .project-group-tabs { margin-bottom: 10px; }
.project-scope-tabs .helper-text { margin: 0 0 0 6px; }
.project-group-tabs { gap: 6px; }
.project-unassigned { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 14px; background: #fff8d8; border-color: #e6d27a; }
.project-group-row { margin: 6px 0 -4px; padding: 8px 12px; border-radius: 8px; background: #e7f1f3; border-bottom: 2px solid var(--brand); color: var(--ink); }
.project-group-row .helper-text { margin: 0 0 0 8px; display: inline; }

/* Projektplanung: Formular "Neues Projekt" in Gruppen nebeneinander, Projekte als Karten - ohne seitliches Scrollen */
.project-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 10px; }
.project-fieldset { min-width: 0; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfd; }
.project-fieldset legend { padding: 0 6px; color: var(--brand); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.project-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.project-fields .span-all { grid-column: 1 / -1; }
.project-create .project-fields label, .group-form .project-fields label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.project-create .project-fields input, .project-create .project-fields select, .group-form .project-fields input, .group-form .project-fields select { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; color: var(--ink); text-overflow: ellipsis; }
.project-form-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.project-list { display: grid; gap: 14px; }
.project-card { border: 1px solid var(--line); border-left: 10px solid var(--project-color, #fff2a8); border-radius: 8px; background: #fff; overflow: hidden; }
.project-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; background: #f2f8fa; border-bottom: 1px solid var(--line); }
.project-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.project-card-title .project-title { margin: 0; font-size: 17px; }
.project-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.project-card-actions .staff-add-button { margin: 0; }
.project-color-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.project-card-body { display: flex; flex-wrap: wrap; }
.project-block { flex: 1 1 270px; min-width: 0; padding: 12px 14px; border-right: 1px solid var(--line); }
.project-block:last-child { border-right: 0; }
.project-phases { flex: 2 1 380px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px 10px; align-content: start; }
.project-phases h4 { grid-column: 1 / -1; margin-bottom: 0; }
.project-block h4 { margin: 0 0 8px; color: var(--brand); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.project-block .project-fields .compact-field { margin-bottom: 0; }
.project-block select { width: 100%; min-height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-weight: 700; text-overflow: ellipsis; }
.project-phases .phase-row { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfd; }
.project-phases .phase-row > strong { grid-column: 1 / -1; font-size: 13px; }
@media (max-width: 700px) {
  .project-card-head { flex-direction: column; align-items: flex-start; }
  .project-block { border-right: 0; border-bottom: 1px solid var(--line); }
  .project-block:last-child { border-bottom: 0; }
}

/* Personalplan: Kurzansicht (Dashboard-Team / Freie Mitarbeiter) */
.status-pill.override-pill { background: #e6f6f8; border: 1px dashed var(--brand); color: var(--brand); font-weight: 600; white-space: normal; }
.override-pill .link-button { margin-left: 6px; }

/* Organisation: Mitarbeiter eines Bereichs aufklappen, Person per Suche hinzufügen */
.org-staff-cell { min-width: 220px; }
.org-staff-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.org-staff-toggle:hover, .org-staff-toggle:focus-visible { border-color: var(--brand); background: #e6f6f8; }
.org-staff-toggle small { color: var(--brand); font-size: 11px; }
.org-staff-panel { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfd; }
.org-staff-list { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 4px; }
.org-staff-list li { padding: 3px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.org-staff-list li small { display: block; color: var(--muted); font-size: 11px; }
.org-staff-panel .combo input { width: 100%; min-height: 36px; }

/* Schulungen: Regeln je Schulung, Tabellenfelder, Termin-Fenster */
.training-type-list { display: grid; gap: 0; margin: 10px 0; }
.training-type-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.training-type-row.editing { background: #f4fbfc; }
.training-type-row .helper-text { margin: 0; flex: 1 1 260px; }
.training-type-actions { display: inline-flex; gap: 6px; }
.training-add { margin: 12px 0 0; }
.training-rule-editor { margin-top: 14px; padding: 12px 14px; border: 2px solid var(--brand); border-radius: 8px; background: #f4fbfc; }
.rule-tree { max-height: 340px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.rule-children { margin-left: 22px; }
.rule-seg { padding: 4px 0; }
.rule-team { padding: 2px 0; }
.rule-check { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-weight: 400; cursor: pointer; }
.rule-check input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--brand); }
.rule-check small { color: var(--muted); font-size: 11px; }
.rule-check input:disabled + * , .rule-check input:disabled { cursor: default; }
.training-th-note { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; }
.training-card { cursor: pointer; }
.training-card:hover { border-color: var(--brand); }
.training-card.open { border-color: #e0a030; background: #fff3d6; }
.training-card.done { border-color: #7bbf91; background: #e3f5e8; }
.training-card.required.dated:not(.done) { background: #e3f5e8; }
.training-custom { margin-left: 4px; padding: 1px 5px; border-radius: 999px; background: #ffe9b0; color: #6b4a00; font-size: 10px; font-weight: 700; }
#trainingDialog .training-dialog-person { margin: 0 0 10px; }
.training-mode-choice { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.training-mode-choice legend { padding: 0 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.training-mode-choice label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.training-date-row { display: flex; gap: 8px; align-items: center; }
.training-date-row input { flex: 1 1 auto; }

/* Anwesenheit: Kürzel der anderen angemeldeten Personen neben dem eigenen */
.presence-bar { display: flex; flex-direction: row-reverse; align-items: center; }
.presence-bar:empty { display: none; }
.presence-chip { display: grid; place-items: center; width: 34px; height: 34px; margin-left: -8px; border: 2px solid #fff; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .03em; cursor: default; }
.presence-chip.presence-more { background: var(--muted) !important; }
#appShell[data-view="plan"] .presence-chip { width: 28px; height: 28px; font-size: 11px; }

/* Konflikt bewusst bestätigen */
.entry-confirm { display: block; margin: 4px 0 0; padding: 2px 8px; border: 1px solid rgba(0,0,0,.25); border-radius: 999px; background: #fff; color: var(--brand); font-size: 11px; font-weight: 800; cursor: pointer; }
.entry-confirm:hover { background: var(--brand); color: #fff; }

/* Einheitliche Eingabebereiche (Kalender, Arbeitsplanung, Abwesenheit, Organisation): Gruppen mit farbiger Überschrift */
.group-form .form-section { margin-top: 12px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfd; }
.group-form .form-section > h3 { margin: 0 0 8px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.work-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; }
.work-groups .form-section { margin-top: 12px; }
.work-groups .form-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.work-groups .form-grid .wide-field { grid-column: 1 / -1; }
.work-groups .form-actions.work-actions { grid-column: 1 / -1; justify-content: flex-end; }
.group-form .project-form-actions { gap: 8px; }
.calendar-info-list { max-height: 360px; overflow: auto; }
.collapsible > .collapse-head { color: var(--brand); }
.collapse-body > .group-form + .info-list { margin-top: 4px; }
@media (max-width: 520px) { .work-groups { grid-template-columns: 1fr; } }

.absence-grid { grid-template-columns: 2fr 1fr 1fr; }
.absence-grid > label:first-child { grid-column: span 2; }
@media (max-width: 700px) { .absence-grid { grid-template-columns: 1fr 1fr; } .absence-grid > label:first-child { grid-column: 1 / -1; } }
.org-tree-table .org-area-cell { display: table-cell; }
.org-area-cell .org-color { float: right; width: 30px; height: 24px; padding: 0; border: 1px solid rgba(0,0,0,.3); border-radius: 6px; background: #fff; cursor: pointer; }
.org-area-cell .org-color:hover { border-color: var(--brand); }

/* Schichtplan */
.shift-table { border-collapse: collapse; font-size: 12px; }
.shift-table th, .shift-table td { border: 1px solid var(--line, #d9dee7); padding: 0; text-align: center; }
.shift-day-head { min-width: 30px; font-size: 11px; padding: 2px 0; }
.shift-day-head.weekend, .shift-day.weekend { background: #f3f4f8; }
.shift-day-head.holiday-head { background: #fde7e7; }
.shift-name, .shift-name-head { text-align: left !important; padding: 4px 8px !important; min-width: 170px; background: #fff; }
.shift-name small { display: block; color: #6b7280; font-size: 10px; }
.shift-cell { width: 30px; height: 28px; border: 0; background: transparent; font-weight: 700; font-size: 12px; cursor: pointer; }
.shift-cell:hover { outline: 2px solid #2563eb; outline-offset: -2px; }
.shift-cell.bring { box-shadow: inset 0 0 0 2px #e11d48; }
.shift-sum { min-width: 28px; font-weight: 700; padding: 0 4px !important; }
.shift-group-row td { background: #eef2f8; text-align: left; padding: 6px 8px; }
.shift-count-row td { font-size: 10px; color: #6b7280; height: 18px; }
.shift-count-row .sticky-col { text-align: left; padding-left: 8px; }
.shift-chip { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; font-weight: 700; font-size: 12px; text-align: center; }
.shift-chip.big { min-width: 34px; padding: 6px 8px; font-size: 15px; }
.shift-chip.free { background: #eee; color: #888; }
.shift-legend { margin: 8px 0; }
.shift-month { min-width: 150px; text-align: center; text-transform: capitalize; }
.shift-wrap { max-height: 70vh; overflow: auto; }
.shift-group-card { margin: 12px 0; }
.shift-members { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.shift-member { background: #eef2f8; border-radius: 14px; padding: 3px 4px 3px 10px; font-size: 13px; }
.shift-member button { border: 0; background: transparent; cursor: pointer; font-size: 16px; color: #b91c1c; }
.shift-model-row { align-items: end; margin-bottom: 8px; }
.shift-code-input { width: 60px; text-transform: uppercase; }
.shift-choice label { display: block; padding: 3px 0; }
.my-shift-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid #eee; }
.my-shift-row.today { background: #eef6ff; font-weight: 600; }
.my-shift-row.weekend { background: #fafafa; }
.my-shift-date { min-width: 90px; }
.my-shift-row small { display: block; color: #6b7280; }
.shift-group-card > summary { cursor: pointer; padding: 4px 0; list-style-position: inside; }
.shift-group-card[open] > summary { margin-bottom: 10px; }
.shift-group-tag { float: right; background: #0b6b73; color: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.shift-group-banner { display: flex; align-items: baseline; gap: 10px; background: #e6f4f5; border-left: 4px solid #0b6b73; border-radius: 8px; padding: 10px 14px; margin: 6px 0 12px; }
.shift-group-banner span { font-size: 12px; color: #4b5563; text-transform: uppercase; letter-spacing: .04em; }
.shift-group-banner strong { font-size: 18px; color: #0b6b73; }
.my-shift-row.clickable { cursor: pointer; }
.my-shift-row.clickable:hover { background: #eef6ff; }
.shift-notice-list { list-style: none; margin: 0 0 12px; padding: 0; }
.shift-notice-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e5e7eb; }
.shift-offer { margin: 10px 0; }
.shift-offer.highlight { outline: 3px solid #0b6b73; }
.shift-offer header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.shift-applicant { display: grid; gap: 4px; border-top: 1px solid #e5e7eb; padding: 8px 0; }
.shift-around { display: flex; gap: 16px; font-size: 13px; }
.shift-warn { margin: 2px 0; padding-left: 18px; color: #b45309; font-size: 13px; }
.shift-ok { color: #15803d; }
.shift-assign { display: flex; align-items: end; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #d1d5db; flex-wrap: wrap; }
.history-detail { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; color: #4b5563; }
.history-detail li { padding: 1px 0; }
.history-field { color: #6b7280; }
/* Zeile mit mehreren Einträgen pro Tag: zugeklappt ein Block + "+N", Plus am Namen klappt auf */
.row-toggle { float: right; margin-left: 6px; width: 22px; height: 22px; padding: 0; line-height: 20px; border: 1px solid #94a3b8; border-radius: 6px; background: #fff; color: #0b6b73; font-weight: 800; cursor: pointer; }
.row-toggle:hover { background: #e6f4f5; }
.cell-stack { position: relative; }
.entry-more { position: absolute; right: 6px; bottom: 6px; z-index: 2; padding: 1px 7px; border: 0; border-radius: 10px; background: #0b6b73; color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
.entry-more.conflict { background: #dc2626; }

/* Personalplan: Filterleiste auf einer Linie (Beschriftung oben, Felder und Knöpfe unten bündig, gleiche Höhe) */
#plan .toolbar { align-items: flex-end; }
#plan .toolbar > button, #plan .toolbar > .multi-filter, #plan .toolbar > label { align-self: flex-end; }
#plan .toolbar > button { min-height: 40px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; }
#plan .toolbar select, #plan .toolbar input[type="date"], #plan .toolbar input[type="search"] { min-height: 40px; box-sizing: border-box; }
#plan .multi-filter-box > summary { min-height: 40px; box-sizing: border-box; display: flex; align-items: center; }
#plan .zoom-control { align-self: flex-end; }
#plan .zoom-control .zoom-row { min-height: 40px; display: flex; align-items: center; gap: 8px; }

/* Excel-ähnlicher Spaltenfilter im Plankopf */
.plan-table th .th-title { vertical-align: middle; }
.col-filter-btn { float: right; margin-left: 6px; width: 22px; height: 22px; padding: 0; border: 1px solid #94a3b8; border-radius: 4px; background: #fff; color: #475569; font-size: 11px; line-height: 20px; cursor: pointer; }
.col-filter-btn:hover { background: #e6f4f5; }
.col-filter-btn.active { background: #0b6b73; border-color: #0b6b73; color: #fff; }
.col-filter-pop { position: fixed; z-index: 1000; width: 290px; max-height: 70vh; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #fff; border: 1px solid #94a3b8; border-radius: 8px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25); font-size: 13px; }
.col-filter-search { min-height: 34px; padding: 6px 8px; border: 1px solid var(--line, #d9dee7); border-radius: 6px; }
.col-filter-list { overflow: auto; max-height: 40vh; border: 1px solid #e5e7eb; border-radius: 6px; padding: 4px; }
.col-filter-item { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.col-filter-item:hover { background: #eef2f8; }
.col-filter-item.all { border-bottom: 1px solid #e5e7eb; margin-bottom: 3px; }
.col-filter-item input { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: #0b6b73; }
.col-filter-count { color: #6b7280; font-size: 12px; }
.col-filter-actions { display: flex; align-items: center; gap: 8px; }
.col-filter-actions .link-button { margin-left: auto; }

/* Abwesenheit: Liste der eigenen Einträge, zunächst zugeklappt (Plus-Zeichen) */
.abs-list > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
.abs-list > summary::-webkit-details-marker { display: none; }
.abs-list > summary::before { content: "+"; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid #94a3b8; border-radius: 6px; background: #fff; color: #0b6b73; font-weight: 800; }
.abs-list[open] > summary::before { content: "−"; }
.abs-list[open] > summary { margin-bottom: 8px; }

/* ===== Kompakteres Layout (24-Zoll-Bildschirme: mehr Platz für den Plan) ===== */
.app-shell { grid-template-columns: 218px minmax(0, 1fr); }
.sidebar { padding: 14px 12px; gap: 12px; }
.brand { padding-bottom: 10px; }
.brand-logo { max-width: 150px; padding: 7px; }
nav { gap: 3px; }
.nav-button { min-height: 36px; padding: 0 10px; font-size: 14px; }
.beta-tag { margin-left: 5px; padding: 0 5px; font-size: 9px; }
.nav-badge { margin-left: 5px; }
.sidebar-actions { gap: 6px; }
.sidebar-actions .ghost-button { min-height: 34px; padding: 0 8px; font-size: 13px; }
/* Wer ist online: unter dem Firmenlogo */
.sidebar .presence-bar { flex-direction: row; flex-wrap: wrap; gap: 5px; padding: 6px 0 8px; margin: -4px 0 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.sidebar .presence-bar::before { content: "Online:"; flex: 0 0 100%; color: #9fb7bd; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.sidebar .presence-chip { width: 28px; height: 28px; margin-left: 0; border-color: #0f252c; font-size: 11px; }
main { padding: 12px 16px; }
.topbar { margin-bottom: 8px; align-items: center; }
.topbar .eyebrow { display: none; }
h1 { font-size: 24px; }
.today-card { padding: 5px 10px; min-width: 0; gap: 12px; box-shadow: none; }
.user-badge { width: 32px; height: 32px; font-size: 12px; }

/* Personalplan: Filterleiste und Kopfzeile schmaler */
#plan .toolbar { gap: 6px 10px; margin-bottom: 8px; }
#plan .toolbar label, #plan .multi-filter-label { font-size: 11px; gap: 3px; }
#plan .toolbar > button { min-height: 34px; padding: 0 12px; font-size: 14px; }
#plan .toolbar select, #plan .toolbar input[type="date"], #plan .toolbar input[type="search"] { min-height: 34px; padding: 4px 8px; font-size: 14px; }
#plan .multi-filter { width: 175px; }
#plan .multi-filter-box > summary { min-height: 34px; }
#plan .zoom-control .zoom-row { min-height: 34px; }
#plan > .panel { padding: 5px 12px; margin-bottom: 8px; }
#plan > .panel .status-pill { padding: 2px 8px; font-size: 12px; }
.cell-color-row { display: flex; align-items: flex-end; gap: 12px; }
.cell-color-row input[type="color"] { width: 64px; padding: 2px; }
.entry-info { display: block; font-style: italic; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Mitteilungszentrale */
.message-list { display: grid; gap: 8px; margin: 8px 0 12px; }
.message-card { border: 1px solid #d9dee7; border-left: 4px solid #cbd5e1; border-radius: 8px; padding: 8px 12px; background: #fff; }
.message-card.unread { border-left-color: #0b6b73; background: #f1fafb; }
.message-card small { color: #6b7280; }
.message-card p { margin: 4px 0 0; line-height: 1.45; }
.msg-employee { margin: 8px 0; padding: 8px 12px; }
.msg-employee header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.msg-change { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0 3px 4px; font-size: 14px; cursor: pointer; }
.msg-change input { margin-top: 3px; width: 16px; height: 16px; min-height: 0; accent-color: #0b6b73; }

/* Schulungen: übersichtlicher Kopfbereich (Kennzahlen kompakt, Schulungen als Karten mit Schildern) */
.training-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.training-overview article { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 14px; }
.training-overview span { font-size: 11px; }
.training-overview strong { margin: 0; font-size: 22px; }
.training-rules-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 6px; }
.training-rules-head h2 { margin: 0; }
.training-rules-head .training-add { display: flex; gap: 8px; margin: 0; }
.training-rules-head .training-add input { min-width: 280px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.training-help { margin: 0 0 10px; }
.training-help > summary { cursor: pointer; color: var(--brand, #0b6b73); font-size: 13px; font-weight: 700; }
.training-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; margin: 8px 0; }
.training-card-type { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line, #d9dee7); border-radius: 8px; background: #fff; }
.training-card-type.editing { border-color: #0b6b73; box-shadow: 0 0 0 2px rgba(11, 107, 115, .15); background: #f4fbfc; }
.training-card-type header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.training-card-type header strong { font-size: 15px; overflow-wrap: anywhere; }
.training-count { flex: none; padding: 2px 9px; border-radius: 999px; background: #e6f4f5; color: #0b6b73; font-size: 12px; font-weight: 800; }
.training-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: baseline; gap: 4px; max-width: 100%; padding: 2px 8px; border-radius: 6px; background: #eef2f8; color: #1f2937; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip small { color: #6b7280; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; }
.chip-segment { background: #e0ecff; }
.chip-team { background: #e8f5e9; }
.chip-bereich { background: #fff4d6; }
.chip-none, .chip-more { background: #f3f4f6; color: #6b7280; }
.training-card-type footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; border-top: 1px solid #eef0f3; }
.open-note { color: #b45309; font-weight: 700; }
.done-note { color: #15803d; font-weight: 700; }
@media (max-width: 820px) { .training-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); } .training-rules-head .training-add input { min-width: 0; flex: 1; } }

/* Status (Datum, Kürzel, Speicherstand) wandert in die Seitenleiste; im Personalplan entfällt die leere Kopfzeile */
.sidebar .today-card { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; padding: 6px 8px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; box-shadow: none; color: #fff; }
.sidebar .today-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar .today-text span { display: block; margin: 0; color: #9fb7bd; font-size: 11px; }
.sidebar .today-text strong { display: block; font-size: 13px; color: #fff; }
.sidebar .user-badge { width: 34px; height: 34px; font-size: 12px; }
.sidebar .save-status { flex: 0 0 100%; justify-content: center; text-align: center; font-size: 11px; }
#appShell[data-view="plan"] .topbar { display: none; }
#appShell[data-view="plan"] main { padding-top: 8px; }

/* Filterleiste im Plan: die drei Auswahlfelder behalten feste Breite und überdecken sich nicht (Text mit "…" gekürzt) */
#plan .multi-filter { flex: 0 0 200px; width: 200px; min-width: 200px; max-width: 200px; margin-right: 4px; }
#plan .multi-filter-label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#plan .multi-filter-box > summary { display: block; line-height: 24px; padding: 4px 28px 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#plan .toolbar > * { min-width: 0; }

/* Schulungs-Varianten */
.training-card.excluded { display: block; width: 100%; padding: 8px 10px; border: 1px dashed #cbd5e1; border-radius: 8px; background: #f8fafc; color: #94a3b8; cursor: not-allowed; }
.training-card.excluded strong { color: #94a3b8; text-decoration: line-through; }
.training-pick { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0; padding: 8px 10px; background: #f1fafb; border: 1px solid #cfe6e8; border-radius: 8px; font-size: 13px; }
.training-pick input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: #0b6b73; }
.training-group-input { display: grid; gap: 4px; max-width: 320px; margin: 10px 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); }

/* Segment-/Team-/Bereichszeilen: die Beschriftung bleibt beim seitlichen Verschieben links sichtbar */
.segment-section-row td, .team-section-row td, .area-section-row td { position: static; }
.section-row .section-label { position: sticky; left: 10px; z-index: 3; display: inline-block; white-space: nowrap; }

/* Dashboard: Zeitraum-Auswahl, Blöcke ausblenden / wieder einblenden */
.dash-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; margin-bottom: 10px; }
.dash-toolbar label { display: grid; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.dash-toolbar select { min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 14px; }
.dash-block { position: relative; }
.dash-hide { position: absolute; top: 4px; right: 4px; z-index: 2; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #94a3b8; font-size: 16px; line-height: 22px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.dash-block:hover .dash-hide, .dash-hide:focus-visible { opacity: 1; }
.dash-hide:hover { background: #fee2e2; color: #b91c1c; }
.metric-link-inner { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.metric-link-inner span, .metric-link-inner strong, .metric-link-inner small { display: block; }
.metric-link-inner small { color: var(--muted); font-size: 12px; }
.dash-hidden { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px; margin-top: 10px; font-size: 13px; }
@media (hover: none) { .dash-hide { opacity: 1; } }

/* Offene Anträge: "Zuletzt bearbeitet" je Mitarbeiter aufklappbar */
.req-history { display: grid; gap: 6px; }
.req-person { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.req-person > summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; list-style: none; }
.req-person > summary::-webkit-details-marker { display: none; }
.req-person > summary::before { content: "+"; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 1px solid #94a3b8; border-radius: 5px; color: #0b6b73; font-weight: 800; }
.req-person[open] > summary::before { content: "−"; }
.req-person .table-wrap { margin: 0 10px 10px; }

/* Mitarbeitertabelle: Suche und Filter direkt im Tabellenkopf, Sortieren per Klick auf den Titel */
.employee-table .emp-filter-row td { padding: 4px 6px; background: #f1f6f8; border-bottom: 2px solid var(--line); }
.employee-table .emp-filter-row input, .employee-table .emp-filter-row select { width: 100%; min-height: 32px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; box-sizing: border-box; }
.th-sort { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 800; cursor: pointer; text-align: left; }
.th-sort:hover, .th-sort.active { color: var(--brand, #0b6b73); }
.emp-count { display: block; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
#cellTextField[hidden], #cellHoursField[hidden] { display: none; }
.req-type-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.req-type-filter select { min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.abs-list > summary + .req-person, .abs-list .req-person { margin-top: 6px; }
