:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --line: #d7dee7;
  --text: #18202a;
  --muted: #627083;
  --brand: #0f8a83;
  --brand-strong: #09645f;
  --blue: #2f6fed;
  --green: #228b5f;
  --red: #c73642;
  --amber: #b87407;
  --orange: #bf5b19;
  --shadow: 0 14px 40px rgba(26, 39, 53, 0.12);
  --radius: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
}

@media (max-width: 900px) {
  .employees-layout {
    grid-template-columns: 1fr;
  }

  .project-planning-header,
  .project-planning-row {
    grid-template-columns: minmax(120px, 26%) minmax(0, 1fr);
    gap: 6px;
  }

  .project-planning-day-strip {
    gap: 2px;
  }

  .project-planning-cell {
    height: 22px;
    font-size: 8px;
  }
}

body.dark {
  --nonworking-day: #3b4249;
  color-scheme: dark;
  --bg: #11161c;
  --surface: #171f28;
  --surface-2: #202b36;
  --line: #334253;
  --text: #edf2f7;
  --muted: #aab7c5;
  --brand: #33b8a9;
  --brand-strong: #5fd0c3;
  --blue: #78a6ff;
  --green: #65c78f;
  --red: #ff7f88;
  --amber: #f0b94f;
  --orange: #ff9a5c;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
}

:root { --nonworking-day: #d2d6da; }
.planning-record .week-chip.is-nonworking,
.total-planning-cell-wrap.is-nonworking,
.project-planning-cell-wrap.is-nonworking { background-color: var(--nonworking-day); }
.total-planning-cell-wrap.is-nonworking .total-planning-cell:not([class*="status-"]),
.project-planning-cell-wrap.is-nonworking .project-planning-cell:not([class*="status-"]) { background-color: var(--nonworking-day); }
.total-planning-cell-wrap.is-nonworking,
.project-planning-cell-wrap.is-nonworking { padding: 0; border-radius: 3px; }
span.total-planning-cell-wrap { cursor: default; }
.heatmap-capacity, .heatmap-used { display: block; white-space: nowrap; font-size: 11px; line-height: 1.5; color: var(--muted); }
.close-all-tabs { flex: 0 0 auto; align-self: center; margin-left: auto; }
.help-guide { max-width: 1440px; margin: 0 auto; }
.help-header { padding-bottom: 22px; border-bottom: 1px solid var(--line); scroll-margin-top: 140px; }
.help-header h1 { margin: 0 0 10px; font-size: 30px; }
.help-header p { margin: 0; color: var(--muted); }
.help-layout { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 40px; align-items: start; }
.help-index { position: sticky; top: 132px; max-height: calc(100dvh - 152px); overflow-y: auto; padding: 24px 18px 24px 0; border-right: 1px solid var(--line); }
.help-index, .help-index nav { scrollbar-width: none; }
.help-index::-webkit-scrollbar, .help-index nav::-webkit-scrollbar { display: none; }
.help-index h2 { font-size: 18px; margin: 24px 0 12px; }
.help-index h3 { font-size: 13px; color: var(--muted); margin: 22px 0 8px; }
.help-index ul { list-style: none; padding: 0; margin: 0; }
.help-index a { display: block; padding: 7px 10px; border-left: 2px solid transparent; line-height: 1.45; text-decoration: none; color: var(--text); }
.help-index a:hover, .help-index a[aria-current] { background: var(--surface-2); border-left-color: var(--brand); color: var(--brand-strong); }
.help-guide a:focus-visible, .help-guide [tabindex="-1"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.help-search { display: block; font-weight: 600; }
.help-search input { display: block; width: 100%; margin-top: 6px; }
.help-clear { margin-bottom: 6px; }
#helpCount { font-size: 13px; color: var(--muted); margin: 10px 0; }
.help-chapters { min-width: 0; max-width: 900px; }
.help-chapter { padding: 28px 0; border-bottom: 1px solid var(--line); }
.help-chapter[hidden] { display: none; }
.help-chapter h2 { font-size: 22px; margin: 8px 0 18px; scroll-margin-top: 140px; }
.help-chapter p, .help-chapter li { line-height: 1.7; }
.help-chapter ol { padding-left: 26px; }
.help-chapter ol > li { padding: 5px 0 5px 8px; }
.help-chapter ol > li::marker { color: var(--brand-strong); font-weight: 700; }
.help-eyebrow { color: var(--muted); font-size: 13px; margin: 0; }
.help-notice { border-left: 3px solid var(--amber); padding: 12px 16px; background: var(--surface-2); }
.help-chapter-footer { display: flex; gap: 20px; justify-content: space-between; align-items: start; margin-top: 22px; font-size: 13px; }
.help-chapter-footer ul { list-style: none; padding: 0; margin: 8px 0 0; }
.help-chapter-footer a { color: var(--brand-strong); text-underline-offset: 3px; }
.help-chapter-footer li { margin-bottom: 6px; }
.help-guide :is(h1, h2, h3, p, a, li) { overflow-wrap: anywhere; letter-spacing: 0; }
@media (max-width: 1100px) {
  .help-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .help-index { position: static; max-height: none; padding-right: 0; border-right: 0; }
  .help-index nav { max-height: 310px; overflow-y: auto; border-block: 1px solid var(--line); margin-top: 16px; }
  .help-search { max-width: 520px; }
  .help-chapter-footer { flex-direction: column; }
}
@media (max-width: 980px) {
  .help-header { scroll-margin-top: 250px; }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  contain: layout paint;
  transition: padding 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 46px;
  transition: gap 180ms ease, transform 180ms ease;
}

.brand-mark,
.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
}

.brand-mark {
  background: var(--brand);
  color: white;
  font-weight: 800;
}

.brand-icon {
  display: block;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.05;
}

.brand-wordmark {
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-word-human {
  color: #18202a;
}

.brand-word-ress {
  color: #2f7f83;
}

body.dark .brand-word-human {
  color: #edf2f7;
}

body.dark .brand-word-ress {
  color: #5fd0c3;
}

.brand small,
.brand-subtitle {
  color: var(--muted);
}

.brand-subtitle {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
  transition: margin-top 180ms ease;
}

.sidebar-version {
  display: block;
  margin-top: 1px;
  padding: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  opacity: 0.82;
  text-align: left;
}

.nav-group-title {
  margin: 14px 8px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: padding 180ms ease, justify-content 180ms ease, background-color 140ms ease, color 140ms ease, transform 180ms ease;
}

.nav-main {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  transition: gap 180ms ease, transform 180ms ease;
}

.brand div,
.nav-label,
.nav-group-title {
  opacity: 1;
  max-width: 220px;
  transform: translateX(0);
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 140ms ease, transform 180ms ease, max-width 180ms ease;
}

.nav button:hover,
.nav button.active {
  background: var(--surface-2);
  color: var(--text);
}

body.sidebar-collapsed .sidebar {
  padding-inline: 10px;
}

body.sidebar-collapsed .brand div,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-group-title {
  opacity: 0;
  max-width: 0;
  transform: translateX(-10px);
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-version {
  opacity: 0;
  max-height: 0;
  padding-block: 0;
  overflow: hidden;
  pointer-events: none;
}

body.sidebar-collapsed .brand,
body.sidebar-collapsed .nav-main,
body.sidebar-collapsed .nav button {
  justify-content: center;
}

body.sidebar-collapsed .nav button {
  padding-inline: 0;
  gap: 0;
  transform: none;
}

body.sidebar-collapsed .brand {
  gap: 0;
}

body.sidebar-collapsed .nav-main {
  gap: 0;
  width: auto;
}

body.sidebar-collapsed .brand-icon {
  margin-inline: auto;
}

.workspace {
  min-width: 0;
}

.topbar {
  min-height: 72px;
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 300;
  backdrop-filter: blur(12px);
}

.workspace-tabs {
  position: sticky;
  top: 72px;
  z-index: 290;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 24px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: thin;
}

.workspace-tabs[hidden] {
  display: none !important;
}

.workspace-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 240px;
  padding: 12px 14px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transform-origin: bottom center;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  animation: workspace-tab-in 220ms ease;
}

.workspace-tab[draggable="true"] {
  cursor: grab;
}

.workspace-tab.dragging,
.workspace-tab[draggable="true"]:active {
  cursor: grabbing;
}

.workspace-tab:hover {
  background: color-mix(in srgb, var(--surface-elevated) 94%, transparent);
  color: var(--text);
  transform: translateY(-1px);
}

.workspace-tab.active {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.08);
}

.workspace-tab.dragging {
  opacity: 0.7;
  transform: scale(0.98);
}

.workspace-tab.closing {
  opacity: 0;
  transform: translateY(-8px) scale(0.94);
}

.workspace-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.workspace-tab-icon .material-icon {
  width: 1rem;
  height: 1rem;
}

.workspace-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 700;
}

.workspace-tab-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: inherit;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.workspace-tab-close:hover {
  background: color-mix(in srgb, var(--surface-soft) 84%, transparent);
  color: var(--text);
  transform: scale(1.04);
}

.workspace-tab-close .material-icon {
  width: 0.9rem;
  height: 0.9rem;
}

@keyframes workspace-tab-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-box {
  display: grid;
  grid-template-columns: 18px minmax(240px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: min(520px, 52vw);
  color: var(--muted);
}

.search-box-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search-box-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.search-box input,
.field input,
.field select,
.field textarea,
.inline-field input,
.inline-field select,
label input,
label select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  position: relative;
}

.undo-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 520;
  width: min(360px, 72vw);
}

.undo-popover-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.undo-popover-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
}

.undo-popover-head strong {
  font-size: 14px;
}

.undo-popover-head small {
  color: var(--muted);
}

.undo-popover-list {
  display: grid;
  gap: 0;
  max-height: min(340px, 56vh);
  overflow: auto;
}

.undo-popover-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.undo-popover-item:last-child {
  border-bottom: 0;
}

.undo-popover-item:hover {
  background: var(--surface-2);
}

.undo-popover-item b {
  font-size: 14px;
}

.undo-popover-item span,
.undo-popover-item small {
  color: var(--muted);
}

.topbar-search-return {
  white-space: nowrap;
  flex: 0 0 auto;
}

.permission-grid {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.permission-overrides {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(76, 110, 245, 0.06);
  padding: 0;
  overflow: hidden;
}

.permission-overrides summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(76, 110, 245, 0.1);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.permission-overrides summary:hover {
  background: rgba(76, 110, 245, 0.16);
}

.permission-overrides summary::-webkit-details-marker {
  display: none;
}

.permission-overrides summary::after {
  content: "+";
  font-size: 20px;
  line-height: 1;
  opacity: 0.85;
  font-weight: 700;
}

.permission-overrides[open] summary::after {
  content: "-";
}

.permission-overrides-summary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.permission-overrides-summary strong {
  display: block;
  font-size: 0.98rem;
}

.permission-overrides-summary small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 2px;
}

.permission-overrides-summary .material-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(76, 110, 245, 0.14);
  color: var(--text);
}

.permission-overrides .permission-grid {
  padding: 0 12px 12px;
  margin-top: 0;
}

.permission-group {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.permission-group-title {
  display: block;
  margin-bottom: 10px;
}

.permission-list {
  display: grid;
  gap: 8px;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: center;
}

.topbar-info-button {
  width: 38px;
  height: 38px;
  padding: 0;
}

.content {
  padding: 24px;
  transform-origin: top center;
  transition: transform 180ms ease, opacity 180ms ease;
}

.content:focus {
  outline: none;
}

body.sidebar-transitioning.sidebar-collapsed .content {
  transform: scale(1.012);
}

body.sidebar-transitioning:not(.sidebar-collapsed) .content {
  transform: scale(0.992);
}

.page-head {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-pad {
  padding: 16px;
}

.filter-panel {
  position: sticky;
  top: calc(71px + var(--workspace-tabs-height, 0px));
  z-index: 280;
  margin-top: 0;
  position: sticky;
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: 0 12px 28px rgba(26, 39, 53, 0.14);
  isolation: isolate;
}

.filter-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 0;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
  background: var(--surface);
  z-index: 0;
}

.filter-panel > * {
  position: relative;
  z-index: 1;
}

.inline-filter-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-radius: var(--radius);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid > * {
  min-width: 0;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-top-row {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.35fr);
  gap: 16px;
  align-items: stretch;
}

.dashboard-hero-row {
  display: grid;
  grid-template-columns: minmax(520px, 1.4fr) minmax(520px, 1.1fr);
  gap: 16px;
  align-items: stretch;
}

.dashboard-widget-manager {
  margin-top: 10px;
}

.dashboard-widget-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-widget-toggle small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-widget-panel {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.dashboard-widget-panel-head {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: start;
}

.dashboard-widget-panel-head strong {
  display: block;
  margin-bottom: 4px;
}

.dashboard-widget-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.dashboard-widget-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.dashboard-widget-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  cursor: pointer;
}

.dashboard-widget-option:hover {
  border-color: var(--accent);
}

.dashboard-widget-option input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.metric {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.metric small {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.toolbar:has(.multi-select-box[open]) {
  margin-bottom: 14px;
  z-index: 6;
}

.compact-toolbar {
  margin-top: 12px;
}

.filter-toolbar-secondary {
  align-items: end;
  margin-bottom: 0;
  position: relative;
  z-index: 2;
}

.filter-toolbar-secondary .multi-select-list {
  top: calc(100% - 1px);
  bottom: auto;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  box-shadow: 0 16px 30px rgba(26, 39, 53, 0.18);
}

.filter-toolbar-secondary .multi-select-box[open] .multi-select-summary {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.filter-toolbar-secondary .multi-select-box.floating-open .multi-select-list {
  position: fixed;
  top: var(--floating-dropdown-top, calc(100% - 1px));
  left: var(--floating-dropdown-left, 0px);
  width: var(--floating-dropdown-width, 220px);
  z-index: 620;
}

.field,
.inline-field {
  display: grid;
  gap: 5px;
  min-width: 170px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.multi-select-field {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  flex: 0 0 220px;
  position: relative;
}

.multi-select-field:has(.multi-select-box[open]) {
  z-index: 70;
}

.compact-field {
  min-width: 138px;
  max-width: 172px;
}

.filter-toolbar-secondary .ghost-button,
.filter-toolbar-secondary .filter-tools {
  align-self: end;
}

.toolbar-spacer {
  flex: 1 1 auto;
}

.print-only {
  display: none;
}

.multi-select-box {
  position: relative;
  min-height: 38px;
  width: 100%;
}

.multi-select-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.multi-select-summary::after {
  content: "";
  width: 10px;
  height: 10px;
  margin-left: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
  flex: 0 0 auto;
}

.multi-select-summary::-webkit-details-marker {
  display: none;
}

.multi-select-box[open] .multi-select-summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.multi-select-list {
  display: grid;
  gap: 8px;
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  width: 100%;
  z-index: 90;
  max-height: 352px;
  overflow: auto;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  box-shadow: 0 16px 30px rgba(26, 39, 53, 0.18);
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
}

.multi-select-option input {
  margin: 0;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.multi-select-option span {
  word-break: break-word;
}

.overview-filter-toolbar {
  align-items: end;
}

.inline-field {
  min-width: 120px;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.cell-plan {
  display: grid;
  gap: 6px;
  width: 164px;
}

.cell-plan select,
.cell-plan input {
  min-height: 32px;
}

.planning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.planning-layout.editor-open {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
}

.planning-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.planning-list-head,
.editor-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.planning-record {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.planning-record:hover,
.planning-record.active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

.overview-record {
  cursor: default;
}

.overview-record:hover,
.overview-record.active,
.overview-record.open {
  border-color: var(--line);
  background: var(--surface);
}

.planning-editor-close {
  flex: 0 0 auto;
}

.planning-record strong,
.planning-record span,
.planning-record small {
  display: block;
}

.planning-record small {
  color: var(--muted);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.month-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.week-chip,
.month-chip {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.month-chip {
  min-height: 132px;
  cursor: default;
}

.month-chip span,
.month-chip em {
  color: var(--muted);
  overflow-wrap: anywhere;
  white-space: normal;
}

.month-chip-head,
.month-metric span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.month-metric {
  display: grid;
  gap: 4px;
}

.month-metric em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.month-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 65%, transparent);
}

.month-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.month-bar .status-project-capacity { background: var(--red); }
.month-bar .status-eingeplant { background: var(--blue); }
.month-bar .status-sonstiges { background: var(--orange); }
.month-bar .status-eingesetzt { background: var(--green); }

.week-chip.selected {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.week-chip {
  position: relative;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  gap: 0;
  height: 148px;
  min-height: 148px;
  padding: 2px 3px;
  overflow: hidden;
}

.week-chip span,
.week-chip small {
  overflow-wrap: anywhere;
  white-space: normal;
}

.planning-record .week-chip-head {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 3px;
  height: 14px;
  min-height: 14px;
  width: 100%;
}

.week-chip-head-main {
  display: inline-flex !important;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: nowrap !important;
  gap: 2px;
  min-width: 0;
  white-space: nowrap !important;
}

.week-chip-head-meta {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  margin-left: auto;
  flex: 0 0 auto;
}

.week-chip-head b {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap !important;
}

body:not(.dark) .week-chip,
body:not(.dark) .week-chip-head b,
body:not(.dark) .week-chip-week-indicator {
  color: #000000;
}

body.dark .week-chip,
body.dark .week-chip-head b,
body.dark .week-chip-week-indicator {
  color: #f1f5f9;
}

.week-chip-note-spacer {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.week-chip-meta {
  display: flex;
  align-items: center;
  min-height: 24px;
}

.week-chip-week-spacer {
  display: inline-flex;
  min-height: 22px;
}

.week-chip-status-stack {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 4px;
  height: 100%;
  min-height: 0;
}

.week-chip-status-cards {
  display: grid !important;
  grid-template-rows: repeat(var(--day-status-count, 1), minmax(0, 1fr));
  gap: 4px;
  min-height: 0;
}

.week-chip-status-card {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.week-chip-status-detail {
  display: flex !important;
  flex-direction: column;
  align-content: center;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 0 0 2px;
  line-height: 1.15;
}

.week-chip-status-card.is-free {
  border-color: transparent;
  background: transparent;
}

.planning-record .planning-note-tooltip-trigger {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--text);
}

.planning-note-tooltip-trigger > .material-icon,
.planning-note-tooltip-trigger > .material-icon svg {
  width: 14px;
  height: 14px;
}

.week-chip-status-badge {
  display: inline-flex !important;
  align-items: center;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 19px;
  padding: 2px 5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
}

.week-chip-status-badge strong {
  display: inline-block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-chip-status-badge small {
  display: inline-block !important;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
}

.week-chip-status-reason {
  display: -webkit-box !important;
  overflow: hidden;
  max-width: 100%;
  padding: 0 2px !important;
  border: 0 !important;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.week-chip-status-stack[data-status-count="1"] .week-chip-status-badge strong {
  font-size: 12px;
}

.week-chip-status-stack[data-status-count="1"] .week-chip-status-badge small {
  font-size: 11px;
}

.week-chip-status-stack[data-status-count]:not([data-status-count="1"]) .week-chip-status-reason {
  font-size: 8px;
  line-height: 1.1;
}

.week-chip-week-indicator {
  display: inline-flex !important;
  align-items: center;
  flex: 0 0 auto;
  width: fit-content;
  max-width: 100%;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
  align-self: start;
}

.week-chip-note-indicator {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 14px;
  color: var(--amber);
}

.week-chip-note-indicator .material-icon {
  width: 14px;
  height: 14px;
}

.week-chip-note-indicator .material-icon svg {
  width: 14px;
  height: 14px;
}

.planning-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.planning-note-row textarea {
  min-height: 78px;
  resize: vertical;
}

.record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.record-head-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.record-head-copy strong,
.record-head-copy span,
.record-head-copy small {
  display: block;
}

.record-head-actions {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  flex: 0 0 auto;
}

.planning-record-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.planning-editor {
  position: sticky;
  top: calc(71px + var(--workspace-tabs-height, 0px) + var(--view-filter-height, 0px) + 16px);
  max-height: calc(100vh - (71px + var(--workspace-tabs-height, 0px) + var(--view-filter-height, 0px) + 24px));
  overflow: auto;
  display: grid;
  gap: 12px;
}

.editor-title h2 {
  margin: 0;
  font-size: 20px;
}

.editor-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.editor-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
}

.planning-editor { grid-template-columns: minmax(0, 1fr); }
.editor-form > * { min-width: 0; }
.editor-form .row-actions { flex-wrap: wrap; }

.planning-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.planning-status-editor {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.planning-status-editor legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.planning-status-editor-compact {
  gap: 6px;
}

.planning-date-range {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 200px) minmax(max-content, 1fr);
  align-items: end;
  gap: 14px;
}

.planning-date-range .field,
.planning-date-range input[type="date"] { min-width: 0; width: 100%; }
.planning-free-controls { display: flex; align-items: end; justify-self: end; gap: 10px; }
.planning-free-controls .field { margin: 0; }
.planning-free-controls .planning-free-switch {
  appearance: none;
  position: relative;
  width: 48px !important;
  height: 28px;
  min-height: 28px !important;
  margin: 5px 0;
  padding: 0 !important;
  border: 1px solid var(--muted);
  border-radius: 16px;
  background: var(--surface-2);
  cursor: pointer;
}
.planning-free-switch::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: var(--muted);
}
.planning-free-controls .planning-free-switch:checked { background: var(--brand); border-color: var(--brand); }
.planning-free-switch:checked::before { left: 23px; background: #fff; }
.planning-free-switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.planning-status-editor:disabled { opacity: .55; }
@media (max-width: 540px) {
  .planning-date-range { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .planning-free-controls { grid-column: 1 / -1; justify-self: end; }
}

.planning-selected-status-list {
  display: grid;
  gap: 6px;
}

.planning-selected-status {
  display: grid;
  grid-template-columns: minmax(110px, 180px) minmax(72px, 88px) minmax(0, 1fr) 34px 34px;
  align-items: center;
  column-gap: 10px;
  row-gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.planning-selected-status-select {
  grid-column: 1;
  justify-self: start;
  width: 100%;
  max-width: 180px;
  min-width: 0;
  height: 28px;
  min-height: 28px !important;
  padding: 2px 22px 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-selected-status-hours,
.planning-selected-status-reason {
  min-width: 0;
}

.planning-selected-status-hours {
  grid-column: 2;
  max-width: 88px;
  height: 28px;
  min-height: 28px !important;
  padding: 4px 7px;
}

.planning-selected-status-reason {
  grid-column: 3;
}

.planning-status-add,
.planning-status-remove {
  grid-row: 1;
}

.planning-status-add {
  grid-column: 4;
}

.planning-status-remove {
  grid-column: 5;
}

.planning-selected-status:not(:has(.planning-status-remove:not([hidden]))) .planning-status-add {
  grid-column: 5;
}

.planning-status-add,
.planning-status-remove {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.planning-status-first-choice {
  max-width: 280px;
}

.planning-status-dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.planning-status-dialog::backdrop {
  background: rgba(9, 12, 17, 0.52);
  backdrop-filter: blur(6px);
}

.planning-status-dialog-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.planning-status-dialog-card .dialog-actions {
  margin-top: 4px;
}

.planning-status-option {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(90px, 120px) minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.planning-status-toggle {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.planning-status-option input[type="number"] { min-width: 0; }

@media (max-width: 700px) {
  .planning-status-option { grid-template-columns: minmax(130px, 1fr) minmax(80px, 100px); }
  .planning-status-option input[name^="reason-"] { grid-column: 1 / -1; }
  .planning-selected-status,
  .planning-selected-status:not(:has(.planning-selected-status-reason)) {
    grid-template-columns: minmax(100px, 1fr) minmax(70px, 92px) minmax(0, 1fr) 34px 34px;
    column-gap: 8px;
  }
  .planning-selected-status-reason {
    grid-column: 1 / -1;
  }
}

.planning-reason-field input[readonly] {
  background: color-mix(in srgb, var(--surface-2) 84%, transparent);
}

.planning-editor .metric {
  padding: 10px;
}

.planning-editor .metric strong {
  margin-top: 4px;
  font-size: 20px;
}

.planning-editor .grid.three {
  gap: 8px;
}

.total-planning-panel {
  position: relative;
  gap: 14px;
  overflow: visible;
}

.total-planning-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.total-planning-filter-legend {
  position: static;
  width: 100%;
  max-width: none;
  justify-content: flex-start;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  pointer-events: auto;
}

.total-planning-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.total-planning-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--surface-2) 94%, white);
}

.total-planning-cell {
  width: 100%;
  min-width: 0;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--surface-2) 94%, white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  color: var(--muted);
}

.total-planning-cell-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-width: 0;
  overflow: visible;
  z-index: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: inherit;
}

.total-planning-cell-wrap:hover,
.total-planning-cell-wrap:focus-within {
  z-index: 320;
}

.total-planning-cell-wrap .total-planning-cell {
  position: relative;
  z-index: 1;
}

.total-planning-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(6px);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  min-width: 180px;
  max-width: 240px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  background: color-mix(in srgb, var(--surface) 96%, white);
  color: var(--text);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  transition: opacity .14s ease, transform .14s ease;
}

body.dark .total-planning-tooltip {
  background: color-mix(in srgb, var(--surface-2) 94%, #0f172a);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

.total-planning-tooltip strong {
  font-size: 12px;
  font-weight: 800;
}

.total-planning-cell-wrap:hover .total-planning-tooltip,
.total-planning-cell-wrap:focus-within .total-planning-tooltip,
.planning-note-tooltip-trigger:hover .total-planning-tooltip,
.planning-note-tooltip-trigger:focus-within .total-planning-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.planning-note-tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  min-height: 14px;
  color: inherit;
  cursor: help;
}

.week-chip:has(.planning-note-tooltip-trigger:hover),
.week-chip:has(.planning-note-tooltip-trigger:focus-within) {
  overflow: visible;
  z-index: 320;
}

.planning-note-tooltip-trigger .total-planning-tooltip {
  bottom: calc(100% + 8px);
}

.total-planning-swatch.status-project-capacity,
.total-planning-cell.status-project-capacity {
  background: color-mix(in srgb, var(--red) 82%, white);
  border-color: color-mix(in srgb, var(--red) 44%, var(--line));
  color: #fff4f6;
}

.total-planning-swatch.status-eingeplant,
.total-planning-cell.status-eingeplant {
  background: color-mix(in srgb, var(--blue) 84%, white);
  border-color: color-mix(in srgb, var(--blue) 44%, var(--line));
  color: #f6f9ff;
}

.total-planning-swatch.status-eingesetzt,
.total-planning-cell.status-eingesetzt {
  background: color-mix(in srgb, var(--green) 82%, white);
  border-color: color-mix(in srgb, var(--green) 44%, var(--line));
  color: #f3fff8;
}

.total-planning-swatch.status-sonstiges,
.total-planning-cell.status-sonstiges {
  background: color-mix(in srgb, var(--orange) 82%, white);
  border-color: color-mix(in srgb, var(--orange) 44%, var(--line));
  color: #fff7f0;
}

.total-planning-swatch.status-urlaub,
.total-planning-cell.status-urlaub {
  background: color-mix(in srgb, var(--amber) 82%, white);
  border-color: color-mix(in srgb, var(--amber) 44%, var(--line));
  color: #2d2410;
}

.total-planning-swatch.status-krank,
.total-planning-cell.status-krank {
  background: color-mix(in srgb, #8d67e8 82%, white);
  border-color: color-mix(in srgb, #8d67e8 44%, var(--line));
  color: #faf7ff;
}

.total-planning-board {
  display: grid;
  gap: 8px;
  overflow: visible;
  padding-bottom: 2px;
  width: 100%;
}

.total-planning-month-wrap {
  display: grid;
  gap: 10px;
  overflow: visible;
}

.total-planning-month-divider {
  height: 3px;
  margin-left: calc(clamp(220px, 24vw, 320px) + 12px);
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 92%, var(--surface-2));
  box-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 82%, transparent);
}

.total-planning-month-section {
  position: relative;
  overflow: visible;
  padding-top: 8px;
}

.total-planning-header,
.total-planning-row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
}

.total-planning-body {
  display: grid;
  gap: 6px;
}

.total-planning-row {
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  overflow: visible;
}

.total-planning-row:first-child {
  border-top: 0;
}

.total-planning-header,
.total-planning-row,
.total-planning-month-section,
.total-planning-month-wrap {
  position: relative;
}

.total-planning-header:hover,
.total-planning-header:focus-within,
.total-planning-row:hover,
.total-planning-row:focus-within,
.total-planning-month-section:hover,
.total-planning-month-section:focus-within,
.total-planning-month-wrap:hover,
.total-planning-month-wrap:focus-within {
  z-index: auto;
}

.total-planning-row-label {
  display: grid;
  gap: 2px;
  min-width: 0;
  position: sticky;
  left: 0;
  z-index: 1;
  padding-right: 8px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface) 88%, transparent 100%);
}

.total-planning-row-label strong,
.total-planning-row-label span,
.total-planning-row-label small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.total-planning-row-label strong {
  font-size: 14px;
}

.total-planning-row-label span,
.total-planning-row-label small {
  color: var(--muted);
  font-size: 12px;
}

.total-planning-row-label-head {
  align-content: end;
}

.total-planning-day-strip {
  display: grid;
  grid-template-columns: repeat(var(--total-planning-day-count, 31), minmax(var(--total-planning-cell-min, 24px), 1fr));
  gap: 5px;
  align-items: stretch;
  width: 100%;
}

.total-planning-day-head {
  display: grid;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  justify-items: center;
  align-content: center;
  text-align: center;
}

.total-planning-day-head small,
.total-planning-day-head strong {
  display: block;
  line-height: 1.1;
}

.total-planning-day-head small {
  font-size: 9px;
  font-weight: 700;
}

.total-planning-day-head strong {
  font-size: 11px;
  font-weight: 800;
}

.total-planning-cell {
  justify-self: stretch;
  align-self: stretch;
}

.total-planning-day-head.is-week-start,
.total-planning-cell.is-week-start {
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--text) 28%, transparent);
}

.chart-wrap {
  display: grid;
  align-content: start;
  gap: 10px;
  width: 100%;
  flex: 1;
}

.utilization-chart {
  width: 100%;
  height: auto;
  min-height: 250px;
}

.dashboard-current-week-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-team-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-summary-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  flex: 1;
  align-content: start;
}

.dashboard-summary-panel .metric {
  min-height: 0;
  padding: 12px 10px;
}

.dashboard-summary-panel .metric strong {
  margin-top: 6px;
  font-size: 22px;
}

.dashboard-team-panel .toolbar {
  max-width: 100%;
}

.dashboard-current-week-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-current-week-panel .metric {
  min-height: 0;
  padding: 12px 10px;
}

.dashboard-current-week-panel .metric strong {
  margin-top: 6px;
  font-size: 22px;
}

.dashboard-team-secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mini-chart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-2) 6%);
  padding: 14px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.mini-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-chart-head h3 {
  margin: 0;
  font-size: 15px;
}

.donut-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.mini-donut-chart {
  width: 160px;
  height: 160px;
}

.donut-track,
.donut-ring {
  fill: none;
  stroke-width: 14;
  transform: rotate(-90deg);
  transform-origin: 80px 80px;
  stroke-linecap: round;
}

.donut-track {
  stroke: color-mix(in srgb, var(--line) 78%, transparent);
}

.donut-project-capacity { stroke: var(--red); }
.donut-planned { stroke: var(--blue); }
.donut-used { stroke: var(--green); }

.donut-center-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.donut-center-value {
  fill: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.mini-legend,
.mini-bars,
.delta-bars {
  display: grid;
  gap: 8px;
}

.mini-legend span,
.mini-bar-row,
.delta-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.mini-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
}

.mini-bar-track,
.delta-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
  overflow: hidden;
}

.mini-bar-fill,
.delta-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.mini-bar-fill.ok { background: color-mix(in srgb, var(--green) 82%, white 18%); }
.mini-bar-fill.high { background: color-mix(in srgb, var(--amber) 84%, white 16%); }
.mini-bar-fill.critical { background: color-mix(in srgb, var(--red) 86%, white 14%); }

.delta-fill.positive { background: color-mix(in srgb, var(--red) 86%, white 14%); }
.delta-fill.negative { background: color-mix(in srgb, var(--green) 84%, white 16%); }

.utilization-chart line {
  stroke: var(--line);
  stroke-width: 1.5;
}

.axis-line {
  stroke: color-mix(in srgb, var(--line) 88%, transparent);
  stroke-width: 1.2;
}

.axis-tick {
  stroke: color-mix(in srgb, var(--line) 52%, transparent);
  stroke-width: 0.9;
  stroke-dasharray: 2 4;
}

.axis-tick-x {
  stroke-dasharray: none;
}

.utilization-chart text {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.chart-axis-label {
  font-size: 8px;
  opacity: 0.92;
}

.chart-month-label {
  font-size: 8px;
}

.chart-percent-label {
  font-size: 7px;
  opacity: 0.82;
}

.line-planned,
.line-used,
.line-committed,
.line-capacity,
.line-project-capacity {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-planned { stroke: var(--blue); }
.line-used { stroke: var(--green); }
.line-committed { stroke: var(--amber); }
.line-capacity {
  stroke: var(--text);
  stroke-dasharray: 6 6;
}
.line-project-capacity {
  stroke: var(--red);
  stroke-dasharray: 3 6;
}

.point-planned { fill: var(--blue); }
.point-used { fill: var(--green); }
.point-committed { fill: var(--amber); }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.legend-plan { background: var(--blue); }
.legend-used { background: var(--green); }
.legend-committed { background: var(--amber); }
.legend-capacity { background: var(--text); }
.legend-project-capacity { background: var(--red); }

.compact-table table {
  min-width: 560px;
}

.num-input {
  max-width: 110px;
}

.primary-button,
.ghost-button,
.danger-button,
.success-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 700;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.ghost-button,
.icon-button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-button {
  background: var(--red);
  color: #fff;
}

.danger-button:hover {
  background: color-mix(in srgb, var(--red) 88%, #000 12%);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.success-button {
  background: var(--green);
  color: #fff;
}

.success-button:hover,
.ghost-button:hover,
.icon-button:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.success-button:hover {
  background: color-mix(in srgb, var(--green) 86%, #000 14%);
}

.ghost-button:hover,
.icon-button:hover {
  background: color-mix(in srgb, var(--surface-2) 70%, var(--brand) 30%);
  border-color: color-mix(in srgb, var(--line) 55%, var(--brand) 45%);
}

.primary-button:active,
.ghost-button:active,
.danger-button:active,
.success-button:active,
.icon-button:active {
  transform: translateY(0);
}

.icon-button {
  width: 38px;
  padding: 0;
}

.icon-only-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.favorite-button {
  width: 32px;
  min-height: 32px;
  margin-left: 8px;
}

.favorite-button.active {
  color: #e0a400;
  background: rgba(224, 164, 0, 0.14);
}

.material-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: currentColor;
}

.material-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compact-actions {
  flex-wrap: wrap;
}

.compact-actions {
  flex-wrap: wrap;
}

.people-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.person-row strong,
.person-row span {
  display: block;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
}

.status-project-capacity {
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
}

.status-eingeplant {
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 45%, transparent);
}

.status-eingesetzt {
  background: color-mix(in srgb, var(--green) 14%, transparent);
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 45%, transparent);
}

.status-sonstiges {
  background: color-mix(in srgb, var(--orange) 18%, transparent);
  color: var(--orange);
  border-color: color-mix(in srgb, var(--orange) 45%, transparent);
}

.status-urlaub {
  background: color-mix(in srgb, #ffd438 24%, transparent);
  color: #846400;
  border-color: color-mix(in srgb, #ffd438 70%, transparent);
}

.status-krank {
  background: color-mix(in srgb, var(--orange) 18%, transparent);
  color: var(--orange);
  border-color: color-mix(in srgb, var(--orange) 45%, transparent);
}

.muted {
  color: var(--muted);
}

.summary-cell {
  display: grid;
  gap: 4px;
  min-width: 138px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.search-results {
  display: grid;
  gap: 12px;
}

.result-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.result-item:hover,
.result-item:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  outline: none;
}

.absence-toggle {
  appearance: none;
}

.absence-toggle.active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffd438 80%, transparent);
}

.overview-absence-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
  padding: 4px 0 0;
  min-height: 420px;
  max-height: 420px;
  align-items: stretch;
  overflow: hidden;
}

.overview-detail-title {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  padding: 2px 4px 0;
}

.overview-detail-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.overview-detail-body::-webkit-scrollbar {
  width: 8px;
}

.overview-detail-body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 999px;
}

.overview-detail-body::-webkit-scrollbar-track {
  background: transparent;
}

.overview-detail-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.stack-list {
  display: grid;
  gap: 12px;
}

.overview-absence-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.overview-absence-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.overview-absence-item > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.overview-absence-item b,
.overview-absence-item .muted {
  word-break: break-word;
}

.utilization-chart {
  max-width: 100%;
  height: auto;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable::after {
  content: " \2195";
  color: var(--muted);
  font-size: 11px;
}

th.sortable[data-sort-direction="asc"]::after {
  content: " \2191";
}

th.sortable[data-sort-direction="desc"]::after {
  content: " \2193";
}

.transfer-layout {
  display: grid;
  gap: 16px;
}

.employees-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 280px);
  gap: 16px;
  align-items: start;
}

.employee-grid-panel {
  min-width: 0;
}

.employee-grid-panel .employee-actions-head,
.employee-grid-panel td.row-actions {
  position: sticky;
  right: 0;
  z-index: 3;
  background: var(--surface);
}

.employee-grid-panel .employee-actions-head {
  background: var(--surface-2);
}

.employee-grid-panel td.row-actions {
  box-shadow: -8px 0 12px rgba(26, 39, 53, 0.08);
}

.skills-panel {
  min-width: 0;
}

.skill-create-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 1200px) {
  .employees-layout {
    grid-template-columns: 1fr;
  }
}

.skill-tag-list,
.skill-tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.skill-tag,
.skill-tag-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.skill-tag-option {
  cursor: pointer;
}

.skill-color-0 { --skill-accent: #0f8b8d; }
.skill-color-1 { --skill-accent: #2f6fed; }
.skill-color-2 { --skill-accent: #c05a2c; }
.skill-color-3 { --skill-accent: #7b5cc7; }
.skill-color-4 { --skill-accent: #258a5b; }
.skill-color-5 { --skill-accent: #b07b12; }
.skill-color-6 { --skill-accent: #c23d68; }
.skill-color-7 { --skill-accent: #3e7895; }

.skill-tag,
.skill-tag-option {
  border-color: color-mix(in srgb, var(--skill-accent, var(--brand)) 42%, var(--line));
  background: color-mix(in srgb, var(--skill-accent, var(--brand)) 11%, var(--surface));
  color: color-mix(in srgb, var(--skill-accent, var(--brand)) 82%, var(--text));
}

.skill-tag-option:has(input:checked) {
  border-color: var(--skill-accent, var(--brand));
  background: color-mix(in srgb, var(--skill-accent, var(--brand)) 22%, var(--surface));
  color: var(--skill-accent, var(--brand));
}

.skill-tag-option input {
  margin: 0;
  accent-color: var(--skill-accent, var(--brand));
}

.skill-tag-remove {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.skill-tag-remove .material-icon,
.skill-tag-remove svg {
  width: 13px;
  height: 13px;
}

.project-planning-panel {
  overflow: visible;
}

.project-planning-month-section {
  display: grid;
  gap: 8px;
  overflow: visible;
}

.project-planning-month-title {
  padding: 6px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.project-planning-month-divider {
  height: 3px;
  margin: 12px 0 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 55%, var(--line));
}

.project-planning-matrix {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
  overflow: visible;
  padding-bottom: 4px;
}

.project-planning-header,
.project-planning-row {
  display: grid;
  grid-template-columns: minmax(160px, 22%) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 0;
  align-items: center;
}

.project-planning-row {
  padding: 7px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
}

.project-planning-label-head,
.project-planning-row-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-planning-label-head span,
.project-planning-row-label span {
  color: var(--muted);
  font-size: 11px;
}

.project-planning-row-label strong,
.project-planning-row-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-planning-day-strip {
  display: grid;
  grid-template-columns: repeat(var(--project-planning-day-count, 31), minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  min-width: 0;
}

.project-planning-cell-wrap {
  position: relative;
  display: flex;
  min-width: 0;
  overflow: visible;
  z-index: 0;
}

.project-planning-cell-wrap:hover,
.project-planning-cell-wrap:focus-within {
  z-index: 320;
}

.project-planning-day-head {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1px;
  min-height: 34px;
  color: var(--muted);
  font-size: 10px;
}

.project-planning-day-head strong {
  color: var(--text);
}

.project-planning-day-head.is-week-start {
  border-left: 2px solid color-mix(in srgb, var(--line) 80%, var(--text));
}

.project-planning-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 24px;
  padding: 0 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-align: center;
}

.project-planning-cell.is-free {
  background: var(--surface-2);
  color: transparent;
}

.project-planning-cell.is-blocked {
  cursor: default;
}

.project-planning-cell:hover,
.project-planning-cell:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.project-planning-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(6px);
  opacity: 0;
  pointer-events: none;
  z-index: 1200;
  min-width: 210px;
  max-width: 300px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 96%, white);
  color: var(--text);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  transition: opacity .14s ease, transform .14s ease;
}

body.dark .project-planning-tooltip {
  background: color-mix(in srgb, var(--surface-2) 94%, #0f172a);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

.project-planning-cell-wrap:hover .project-planning-tooltip,
.project-planning-cell-wrap:focus-within .project-planning-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.project-planning-tooltip-group {
  display: grid;
  gap: 2px;
  padding-top: 3px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.holiday-badge {
  display: inline-grid;
  place-items: center;
  color: var(--amber);
  font-size: 10px;
}

.holiday-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.skill-suggestion-list {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
}

.skill-suggestion-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}

.skill-suggestion-row span {
  display: grid;
  gap: 2px;
}

.skill-suggestion-row small {
  color: var(--muted);
}

.skill-suggestion-row .skill-suggestion-warning {
  color: var(--red);
  font-weight: 700;
}

.transfer-widget-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.transfer-control-panel,
.transfer-import-panel,
.transfer-master-panel,
.transfer-preview-panel {
  position: relative;
}

.transfer-control-panel,
.transfer-import-panel,
.transfer-master-panel {
  min-height: 100%;
}

.transfer-filter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transfer-filter-actions {
  display: flex;
  align-items: start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.transfer-filter-actions > .ghost-button {
  min-width: 0;
}

.transfer-filter-actions .filter-tools {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 10px;
  align-items: start;
}

.transfer-filter-actions .filter-tools > .ghost-button {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0 0 6px;
}

.section-head .muted {
  margin: 0;
}

.plan-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.plan-summary-stack {
  display: grid;
  gap: 10px;
}

.plan-summary-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-2));
  display: grid;
  gap: 0;
  overflow: hidden;
}

.plan-summary-card.plan-risk-ok {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 18%, transparent);
}

.plan-summary-card.plan-risk-warning {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 26%, transparent);
}

.plan-summary-card.plan-risk-critical {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 26%, transparent);
}

.plan-summary-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.plan-summary-summary {
  list-style: none;
  display: grid;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
}

.plan-summary-summary::-webkit-details-marker {
  display: none;
}

.plan-summary-summary-main {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.plan-summary-detail {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
}

.plan-summary-card-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.plan-summary-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.plan-summary-risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.plan-summary-risk.plan-risk-ok {
  background: color-mix(in srgb, var(--green) 14%, transparent);
  color: var(--green);
}

.plan-summary-risk.plan-risk-warning {
  background: color-mix(in srgb, var(--amber) 16%, transparent);
  color: var(--amber);
}

.plan-summary-risk.plan-risk-critical {
  background: color-mix(in srgb, var(--red) 15%, transparent);
  color: var(--red);
}

.plan-summary-metrics .metric-card {
  min-height: 74px;
}

.plan-summary-metrics.compact .metric-card {
  min-height: 64px;
}

.plan-summary-metrics.compact {
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  justify-content: stretch;
  gap: 10px;
}

.plan-summary-metrics .metric {
  padding: 8px 9px;
  text-align: center;
}

.plan-summary-metrics .metric small {
  font-size: 10px;
  line-height: 1.15;
  display: block;
}

.plan-summary-metrics .metric strong {
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.1;
  text-align: center;
}

.plan-summary-progress {
  display: grid;
  gap: 6px;
}

.plan-summary-progress strong {
  font-size: 12px;
}

.plan-summary-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--line);
}

.plan-summary-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--green);
}

.plan-summary-progress-fill.plan-risk-warning {
  background: var(--amber);
}

.plan-summary-progress-fill.plan-risk-critical {
  background: var(--red);
}

.plan-summary-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-summary-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.plan-summary-note.ok {
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
}

.plan-summary-note.warning {
  background: color-mix(in srgb, var(--amber) 14%, transparent);
  color: var(--amber);
}

.plan-summary-note.critical {
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--red);
}

.plan-summary-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.plan-summary-table-head,
.plan-summary-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(72px, 0.5fr));
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
}

.plan-summary-table-head {
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.plan-summary-table-row {
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.plan-summary-table-row strong {
  display: block;
  margin-bottom: 2px;
}

.plan-summary-table-row small {
  color: var(--muted);
  font-size: 11px;
}

.plan-summary-empty-row {
  padding: 14px;
}

.dashboard-widget-head.compact {
  margin-bottom: 10px;
}

.dashboard-widget-head.compact h2 {
  margin-bottom: 4px;
}

.transfer-master-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-bottom: 12px;
}

.transfer-master-meta p {
  margin: 0;
  display: grid;
  gap: 4px;
}

.transfer-master-meta span {
  color: var(--muted);
  word-break: break-word;
}

.transfer-master-actions {
  align-items: end;
  flex-wrap: wrap;
}

.transfer-export-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  margin-top: 14px;
}

.transfer-export-actions button,
.transfer-master-actions button {
  width: 100%;
}

.transfer-file-field {
  gap: 6px;
}

.transfer-meta-label {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  color: inherit;
}

.settings-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-width: 320px;
}

.login-screen {
  position: relative;
  min-height: 100dvh;
  overflow: auto;
  padding: 0;
  background: var(--bg) url("/assets/login-background-project-management.png?v=0.75.9-light-brand-en") center top / cover no-repeat;
}

body.dark .login-screen {
  background-image: url("/assets/login-background-project-management-dark.png?v=0.75.9-dark-slogan");
}

.login-panel {
  position: absolute;
  top: clamp(300px, 38vh, 480px);
  left: clamp(24px, 12vw, 300px);
  width: min(560px, calc(100vw - 48px));
  display: grid;
  gap: 18px;
  padding: clamp(34px, 4.3vh, 46px) clamp(30px, 3.1vw, 52px) clamp(34px, 4.4vh, 48px);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 0;
  box-shadow: 0 18px 40px rgba(26, 39, 53, 0.16);
  z-index: 1;
}

.login-panel-head {
  display: contents;
}

.login-brand {
  display: none;
}

.login-panel-head .login-brand {
  display: none;
}

.login-panel-head #loginThemeToggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2;
}

.login-panel label {
  display: grid;
  gap: 6px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 400;
}

.login-field-label {
  color: #35414d;
  font-size: 15px;
  font-weight: 400;
}

.login-input-wrap {
  position: relative;
  display: block;
}

.login-input-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #63707b;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}

.login-input-icon .material-icon,
.login-input-icon .material-icon svg {
  width: 22px;
  height: 22px;
}

.login-panel input {
  width: 100%;
  min-height: 48px;
  border-color: #d4d7d8;
  background: rgba(255, 255, 255, 0.82);
  color: #26313b;
  padding-left: 50px;
}

.login-panel .primary-button {
  min-height: 50px;
  background: #3f8789;
  border-color: #3f8789;
  color: #fff;
  font-weight: 600;
}

body.dark .login-panel input {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}

body.dark .login-panel {
  background: rgba(28, 37, 47, 0.96);
}

body.dark .login-field-label,
body.dark .login-input-icon {
  color: var(--text);
}

body.dark .login-panel .primary-button {
  background: var(--brand);
  border-color: var(--brand);
  color: #082d2b;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
}

.login-auth-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 6vw, 72px);
  width: 100%;
}

.login-auth-link {
  min-width: 0;
  min-height: 34px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #3f8789;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 140ms ease, text-decoration-color 140ms ease, opacity 140ms ease;
}

.login-auth-link:hover,
.login-auth-link:focus-visible {
  color: #256d70;
  text-decoration-color: currentColor;
}

.login-reset-action.is-revealing {
  animation: loginResetReveal 420ms ease both;
}

@keyframes loginResetReveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

body.dark .login-auth-link {
  color: var(--brand);
}

body.dark .login-auth-link:hover,
body.dark .login-auth-link:focus-visible {
  color: var(--brand-strong);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
}

.auth-form-hint,
.auth-form-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-form-message {
  color: var(--red);
  font-weight: 600;
}

.login-slogan {
  color: #8a9299;
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-slogan-rule {
  display: block;
  width: 48px;
  height: 1px;
  margin-bottom: 12px;
  background: #a4aaae;
}

.login-slogan p {
  margin: 0;
}

.user-pill {
  color: var(--muted);
  font-weight: 700;
}

.toast-hub {
  position: fixed;
  inset: auto 20px 20px auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
  pointer-events: none;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  z-index: 600;
}
.toast-hub::backdrop { background: transparent; pointer-events: none; }

.toast-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast-card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--brand);
}

.toast-card-copy strong {
  display: block;
  margin-bottom: 4px;
}

.toast-card-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.toast-card.tone-success .toast-card-icon {
  background: rgba(34, 139, 95, 0.16);
  color: var(--green);
}

.toast-card.tone-warning .toast-card-icon {
  background: rgba(184, 116, 7, 0.16);
  color: var(--amber);
}

.toast-card.tone-danger .toast-card-icon {
  background: rgba(199, 54, 66, 0.16);
  color: var(--red);
}

.filter-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-field {
  min-width: 210px;
}

.filter-saved-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flash-highlight {
  animation: flash-highlight 1.8s ease;
}

@keyframes flash-highlight {
  0% { box-shadow: 0 0 0 0 rgba(15, 138, 131, 0.35); background: rgba(15, 138, 131, 0.10); }
  100% { box-shadow: none; background: transparent; }
}

.warning-text {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(214, 84, 80, 0.10);
  color: #a13b38;
  border: 1px solid rgba(214, 84, 80, 0.24);
}

.planning-month-remaining.warning {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(214, 84, 80, 0.12);
  border: 1px solid rgba(214, 84, 80, 0.24);
  color: #a13b38;
  font-weight: 700;
}

.planning-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.planning-tool-card {
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  align-content: start;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  min-height: 250px;
}

.planning-tool-head {
  display: block;
  gap: 8px;
  min-width: 0;
}

.planning-tool-head strong {
  font-size: 14px;
  line-height: 1.2;
  min-width: 0;
}

.planning-tool-fields {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.planning-tool-actions {
  display: flex;
  justify-content: stretch;
  align-items: center;
  margin-top: auto;
}

#planningCopyWeekForm .planning-tool-actions,
#planningCopyMonthForm .planning-tool-actions {
  grid-row: 4;
}

.compact-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.planning-bulk-fields {
  grid-template-columns: minmax(0, 1.5fr) minmax(88px, 0.7fr);
  align-items: end;
}

.planning-tool-card .field,
.planning-tool-card .inline-field,
.planning-tool-card .compact-field-label {
  min-width: 0;
}

.compact-field-label {
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.compact-field-label input,
.compact-field-label select {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.compact-inline-pair {
  gap: 6px;
  grid-template-columns: minmax(0, 74px) minmax(0, 1fr);
}

.compact-inline-pair input,
.compact-inline-pair select {
  min-width: 0;
}

.inline-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.week-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-week-grid {
  gap: 6px;
  max-height: 84px;
  overflow: auto;
  padding-right: 2px;
  align-content: start;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.compact-check-chip {
  padding: 3px 7px;
  font-size: 11px;
  min-width: 0;
}

.compact-check-chip input {
  margin: 0;
  width: 14px;
  height: 14px;
  min-height: 14px;
  flex: 0 0 14px;
}

.bulk-status-field select {
  min-width: 0;
}

.bulk-hours-field input {
  max-width: 96px;
  justify-self: start;
}

.week-chip-warning,
.month-chip-warning {
  outline: 2px solid rgba(214, 84, 80, 0.35);
  outline-offset: 1px;
}

.clickable-card {
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.clickable-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.heatmap-wrap {
  overflow-x: auto;
}

.heatmap-table th,
.heatmap-table td {
  white-space: nowrap;
  text-align: center;
}

.heatmap-table th:first-child,
.heatmap-table td:first-child {
  text-align: left;
}

.heatmap-cell {
  display: inline-flex;
  min-width: 48px;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-weight: 700;
  color: #17313a;
}

.heatmap-cell.empty { background: rgba(148, 163, 184, 0.14); }
.heatmap-cell.low { background: rgba(91, 192, 132, 0.20); }
.heatmap-cell.mid { background: rgba(240, 196, 25, 0.24); }
.heatmap-cell.high { background: rgba(255, 154, 60, 0.26); }
.heatmap-cell.critical { background: rgba(214, 84, 80, 0.30); color: #6d1f1d; }

body.dark .heatmap-cell {
  color: #f8fafc;
}

body.dark .heatmap-cell.critical {
  color: #ffffff;
}

.overlay-shell {
  position: fixed;
  inset: 0;
  z-index: 560;
  display: grid;
  place-items: center;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 12, 17, 0.52);
  backdrop-filter: blur(8px);
}

.overlay-card {
  position: relative;
  width: min(620px, calc(100vw - 28px));
  max-height: min(82vh, 820px);
  overflow: auto;
  padding: 20px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(51, 184, 169, 0.18), transparent 30%),
    color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
  animation: overlayCardIn 220ms ease;
}

.overlay-shell[data-kind="planning-editor-modal"] .overlay-card {
  width: min(980px, calc(100vw - 40px));
  max-height: min(94vh, 980px);
  padding: 18px 20px;
}

.overlay-shell[data-kind="planning-editor-modal"] #overlayCloseButton {
  display: none;
}

.overlay-shell[data-kind="planning-editor-modal"] .overlay-card-head {
  display: none;
}

.overlay-shell[data-kind="planning-editor-modal"] .overlay-card-body {
  margin-top: 0;
}

.overlay-shell[data-kind="planning-editor-modal"] .planning-editor {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.overlay-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.overlay-card-title-wrap {
  display: flex;
  gap: 12px;
  align-items: start;
}

.overlay-card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--brand);
  flex: 0 0 auto;
}

.overlay-card-title-wrap strong {
  display: block;
  font-size: 20px;
}

.overlay-card-title-wrap small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.overlay-card-body {
  margin-top: 16px;
}

.overlay-card-body p {
  margin: 0 0 12px;
  line-height: 1.55;
}

.dialog-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-dialog-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dialog-form-grid .field:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.dialog-field-span {
  grid-column: 1 / -1;
}

.planning-plus-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.planning-plus-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.planning-plus-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.planning-plus-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-weight: 700;
}

.planning-plus-select-all input,
.planning-plus-project-row input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.planning-plus-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: min(48vh, 420px);
  margin-top: 12px;
  overflow: auto;
  padding-right: 4px;
}

.planning-plus-project-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-sizing: border-box;
  min-height: 68px;
  min-width: 0;
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.planning-plus-project-row > span {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.planning-plus-project-row strong {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.planning-plus-project-row small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
}

.planning-plus-project-row.has-conflict {
  min-height: 88px;
  border-color: color-mix(in srgb, var(--red) 58%, var(--line));
  background: color-mix(in srgb, var(--red) 7%, var(--surface));
}

.planning-plus-project-row .planning-plus-project-conflict {
  display: -webkit-box;
  max-height: 2.7em;
  color: var(--red);
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.planning-plus-conflict-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 0;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--red) 38%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.overlay-note {
  color: var(--brand);
  font-weight: 700;
}

.overlay-card-actions,
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

body.overlay-open {
  overflow: hidden;
}

.activity-shell {
  position: fixed;
  inset: 0;
  z-index: 580;
  display: grid;
  place-items: center;
}

.activity-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 12, 17, 0.58);
  backdrop-filter: blur(10px);
}

.activity-card {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  padding: 22px 24px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background:
    radial-gradient(circle at top right, rgba(51, 184, 169, 0.18), transparent 35%),
    color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
}

.activity-card strong {
  font-size: 20px;
}

.activity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.activity-spinner {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 4px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-top-color: var(--brand);
  animation: activitySpin 900ms linear infinite;
}

body.activity-open {
  overflow: hidden;
}

@keyframes activitySpin {
  to { transform: rotate(360deg); }
}

@keyframes overlayCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tips-badge,
.tip-flyout-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--brand);
  font-weight: 700;
}

.tip-flyout {
  position: fixed;
  right: 18px;
  bottom: 96px;
  width: min(360px, calc(100vw - 28px));
  padding: 18px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background:
    radial-gradient(circle at top right, rgba(51, 184, 169, 0.18), transparent 35%),
    color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  z-index: 500;
  opacity: 0;
  transform: translateX(18px) translateY(6px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.tip-flyout.show {
  opacity: 1;
  transform: translateX(0) translateY(0) scale(1);
}

.tip-flyout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tip-flyout-title {
  display: block;
  margin-top: 14px;
  font-size: 20px;
}

.tip-flyout-text {
  margin: 10px 0 0;
  line-height: 1.6;
}

.tip-flyout-accent {
  margin: 14px 0 0;
  color: var(--brand);
  font-weight: 700;
}

.tip-flyout-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.hide {
  display: none !important;
}

button,
.planning-record,
.week-chip,
.person-row {
  transition: transform 130ms ease, box-shadow 130ms ease, background-color 130ms ease, border-color 130ms ease;
}

button:active,
.planning-record:active,
.week-chip:active,
.person-row:active {
  transform: scale(0.985);
}

.click-animate {
  animation: clickPulse 220ms ease;
}

@keyframes clickPulse {
  0% { transform: scale(1); }
  45% { transform: scale(0.975); }
  100% { transform: scale(1); }
}

@media (max-width: 980px) {
  .total-planning-filter-legend {
    position: static;
    max-width: none;
    justify-content: flex-start;
    margin-top: 10px;
    pointer-events: auto;
  }

  .login-screen {
    min-height: 100dvh;
    padding: clamp(300px, 42vh, 360px) 16px 24px;
    background-position: left top;
    background-size: auto 100%;
  }

  .login-panel {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: min(420px, 100%);
    min-width: 0;
    margin: 0 auto;
    padding: 30px 24px 32px;
  }

  body.dark .login-panel {
    top: auto;
    right: auto;
  }

  .login-panel-head #loginThemeToggle {
    top: 16px;
    right: 16px;
  }

  .login-auth-actions {
    gap: 6px;
  }

  .login-auth-link {
    font-size: 13px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav button {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 54px;
  }

  .transfer-master-meta {
    grid-template-columns: 1fr;
  }

  .transfer-export-actions {
    grid-template-columns: 1fr;
  }

  .transfer-widget-grid,
  .transfer-filter-grid {
    grid-template-columns: 1fr;
  }

  .transfer-filter-actions .filter-tools {
    grid-auto-flow: row;
  }

  .undo-popover {
    left: auto;
    right: 0;
    width: min(340px, calc(100vw - 48px));
  }

  body.sidebar-collapsed .brand div,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-group-title,
  body.sidebar-collapsed .sidebar-info-button span:not(.material-icon) {
    display: inline;
  }

  body.sidebar-collapsed .nav {
    display: none;
  }

  body.sidebar-collapsed .sidebar-footer {
    display: none;
  }

  .topbar,
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-tabs {
    top: 72px;
    gap: 8px;
    padding: 8px 16px 0;
  }

  .workspace-tab {
    max-width: 180px;
    padding: 10px 12px 8px;
  }

  .search-box {
    min-width: 100%;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .dashboard-hero-row,
  .dashboard-top-row,
  .plan-summary-grid,
  .overview-absence-panel,
  .planning-layout,
  .transfer-widget-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-current-week-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-team-secondary,
  .donut-layout {
    grid-template-columns: 1fr;
  }

  .tips-stage {
    grid-template-columns: 1fr;
  }

  .tips-stack {
    padding-top: 0;
  }

  .dashboard-widget-panel-head {
    flex-direction: column;
  }

  .dashboard-widget-actions {
    justify-content: flex-start;
  }

  .plan-summary-table-head,
  .plan-summary-table-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .planning-tool-grid,
  .compact-split {
    grid-template-columns: 1fr;
  }

  .dialog-form-grid,
  .project-dialog-grid {
    grid-template-columns: 1fr;
  }

  .planning-plus-head {
    flex-direction: column;
    align-items: stretch;
  }

  .planning-plus-actions {
    justify-content: flex-start;
  }

  .planning-plus-project-grid {
    grid-template-columns: 1fr;
  }

  .overview-absence-panel {
    min-height: auto;
    max-height: none;
  }

  .plan-summary-card-head {
    grid-template-columns: 1fr;
  }

  .plan-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-detail-column {
    min-height: 240px;
  }

  .planning-editor {
    position: static;
  }

.content {
  padding: 16px;
}
}

@media print {
  @page {
    size: A4 landscape;
    margin: 6mm 6mm 10mm 6mm;
  }

  body {
    background: #fff;
    position: relative;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sidebar,
  .topbar,
  .workspace-tabs,
  .page-head,
  .filter-panel,
  .tip-flyout,
  .toast-stage,
  .dialog-backdrop {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .content,
  #appView {
    display: block !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }

  .panel {
    box-shadow: none !important;
    border: 0 !important;
    break-inside: avoid;
  }

  .print-only {
    display: grid !important;
  }

  .screen-only {
    display: none !important;
  }

  .total-planning-panel {
    gap: 8px;
    padding: 0 0 8mm 0 !important;
  }

  .total-planning-print-wrap {
    display: grid !important;
    gap: 4px;
  }

  .total-planning-print-header {
    display: block;
    margin: 0;
    padding: 0 0 2px 0;
  }

  .total-planning-print-section {
    display: block !important;
  }

  .total-planning-print-section + .total-planning-print-section {
    break-before: page;
    page-break-before: always;
    padding-top: 2mm;
  }

  .total-planning-print-legend {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px 8px;
    margin-top: 0;
    align-items: center;
    justify-content: flex-start;
  }

  .total-planning-print-legend .total-planning-legend-item {
    font-size: 5.8pt;
    gap: 3px;
    white-space: nowrap;
  }

  .total-planning-print-legend .total-planning-swatch {
    width: 9px;
    height: 9px;
  }

  .total-planning-print-filter {
    display: block;
    margin-top: 1px;
    color: #5a697b;
    font-size: 5.9pt;
    line-height: 1.05;
  }

  .total-planning-print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0;
  }

  .total-planning-print-table thead {
    display: table-header-group;
  }

  .total-planning-print-table tbody {
    display: table-row-group;
  }

  .total-planning-print-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .total-planning-print-label-head,
  .total-planning-print-label {
    width: 210px;
    min-width: 210px;
    max-width: 210px;
    padding: 3px 5px 3px 0;
    text-align: left;
    vertical-align: top;
    border: 0;
    background: #fff;
    overflow: visible;
  }

  .total-planning-print-label-head strong,
  .total-planning-print-label strong {
    display: block;
    font-size: 7.4pt;
    line-height: 1.02;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .total-planning-print-label-head small,
  .total-planning-print-label span {
    display: block;
    color: #465466;
    font-size: 6pt;
    line-height: 1.02;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .total-planning-print-day-head,
  .total-planning-print-day-cell {
    width: calc((100% - 210px) / 31);
    padding: 0;
    border: 0;
    text-align: center;
    vertical-align: middle;
    background: #fff;
    overflow: visible;
  }

  .total-planning-print-day-head {
    height: 18px;
    padding-top: 1px;
    vertical-align: top;
  }

  .total-planning-print-day-head small,
  .total-planning-print-day-head strong {
    display: block;
    line-height: 1;
    color: #223244;
  }

  .total-planning-print-day-head small {
    font-size: 4.9pt;
  }

  .total-planning-print-day-head strong {
    font-size: 5.8pt;
  }

  .total-planning-print-day-head.is-week-start,
  .total-planning-print-day-cell.is-week-start {
    border-left: 1px solid #b8c3d1;
  }

  .total-planning-print-row + .total-planning-print-row .total-planning-print-label,
  .total-planning-print-row + .total-planning-print-row .total-planning-print-day-cell {
    border-top: 1px solid #e4e9f0;
  }

  .total-planning-print-day-cell {
    height: 14px;
  }

  .total-planning-print-row {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .total-planning-print-day-cell .total-planning-cell {
    background: #edf2f7;
    border-color: #d3ddea;
    width: calc(100% - 2px);
    height: 10px;
    margin: 1px auto;
    font-size: 5.1pt;
    border-radius: 2px;
    padding: 0 1px;
    line-height: 10px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #fff !important;
  }

  .total-planning-print-day-cell .total-planning-cell.status-project-capacity {
    background: #c73642 !important;
    border-color: #c73642 !important;
  }

  .total-planning-print-day-cell .total-planning-cell.status-eingeplant {
    background: #2f6fed !important;
    border-color: #2f6fed !important;
  }

  .total-planning-print-day-cell .total-planning-cell.status-eingesetzt {
    background: #228b5f !important;
    border-color: #228b5f !important;
  }

  .total-planning-print-day-cell .total-planning-cell.status-sonstiges {
    background: #bf5b19 !important;
    border-color: #bf5b19 !important;
  }

  .total-planning-print-day-cell .total-planning-cell.status-urlaub {
    background: #b87407 !important;
    border-color: #b87407 !important;
  }

  .total-planning-print-day-cell .total-planning-cell.status-krank {
    background: #8d67e8 !important;
    border-color: #8d67e8 !important;
  }
  .total-planning-print-wrap { color: #111; }
  .total-planning-print-label strong,
  .total-planning-print-label-head strong { color: #111; }
}

.total-planning-cell.master-multi-status { padding: 0; gap: 0; }
.total-planning-cell.master-multi-status > .master-status-segment {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 1px;
  border: 0;
  border-radius: 0;
  font-size: inherit;
  line-height: inherit;
}
.master-multi-status > .master-status-segment + .master-status-segment {
  box-shadow: inset 1px 0 rgba(255, 255, 255, 0.4);
}
.project-planning-cell.project-status-cell { padding: 0; border: 0; border-radius: 3px; }
.project-status-cell > .total-planning-cell { height: 100%; }
.project-planning-cell-wrap.is-nonworking .project-status-cell.is-free > .total-planning-cell { background: var(--nonworking-day); }
@media screen {
  body:not(.dark) .total-planning-cell.status-urlaub,
  body:not(.dark) .total-planning-swatch.status-urlaub {
    background: #efa954;
    border-color: #da963f;
    color: #f1f2f3;
  }
}
