:root {
  color-scheme: light;
  --brand: #00066d;
  --brand-dark: #000455;
  --brand-soft: rgba(0, 6, 109, 0.08);
  --accent: #00b69f;
  --accent-dark: #009780;
  --danger: #d71920;
  --warn: #f59e0b;
  --ink: #182127;
  --muted: #5e6a78;
  --line: #dbe2ea;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --soft: rgba(0, 182, 159, 0.14);
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 8%, rgba(0, 182, 159, 0.13), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 11px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.97);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid var(--soft);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

a {
  text-decoration: none;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(0, 6, 109, 0.96), rgba(0, 4, 85, 0.98)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 2px, transparent 2px 96px);
}

.login-shell {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 390px;
  gap: 22px;
  align-items: stretch;
}

.login-brand,
.login-card,
.panel,
.module-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 56px);
  color: #fff;
  background:
    linear-gradient(135deg, transparent 0 20%, rgba(0,182,159,.12) 20% 21%, transparent 21% 44%, rgba(255,255,255,.045) 44% 45%, transparent 45%),
    linear-gradient(180deg, rgba(0, 6, 109, 0.98), rgba(0, 4, 85, 0.96));
}

.login-brand img {
  width: min(310px, 78%);
  height: auto;
}

.login-brand h1 {
  max-width: 620px;
  margin: 8px 0 12px;
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1;
}

.login-brand p {
  max-width: 600px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
  line-height: 1.5;
}

.login-card {
  align-self: center;
  padding: 28px;
  background: #fff;
}

.login-card h2 {
  margin: 0 0 18px;
  color: var(--brand);
  font-size: 28px;
}

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

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.form-error {
  margin: 0 0 14px;
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--danger);
  background: rgba(215, 25, 32, 0.08);
  font-weight: 700;
}

.app-body {
  display: grid;
  grid-template-columns: 292px 1fr;
}

.sidebar {
  min-height: 100vh;
  padding: 28px 22px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(0, 6, 109, 0.98), rgba(0, 4, 85, 0.96)),
    var(--brand);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.brand {
  display: grid;
  gap: 12px;
}

.brand img {
  width: min(210px, 100%);
  height: auto;
  display: block;
}

.brand h1 {
  margin: 10px 0 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.1;
}

.brand p,
.logout,
.settings-link {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
}

nav {
  display: grid;
  gap: 8px;
}

.nav,
.logout,
.settings-link {
  width: 100%;
  border-radius: 6px;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--brand);
  color: #fff;
  position: relative;
}

.nav:hover,
.logout:hover,
.settings-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav.active {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.9);
}

.nav.active .nav-icon {
  background: var(--brand);
}

.nav-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.nav-icon-clock::before {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  mask-image: none;
  -webkit-mask-image: none;
}

.nav-icon-clock::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  left: 50%;
  top: 50%;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: translate(-1px, -7px) rotate(-45deg);
  transform-origin: left bottom;
  border-radius: 1px;
}

.nav-icon-sun::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 1h2v4h-2V1Zm0 18h2v4h-2v-4ZM1 11h4v2H1v-2Zm18 0h4v2h-4v-2ZM4.22 2.81l2.83 2.83-1.41 1.41-2.83-2.83 1.41-1.41Zm12.73 12.73 2.83 2.83-1.41 1.41-2.83-2.83 1.41-1.41Zm2.83-11.32-2.83 2.83-1.41-1.41 2.83-2.83 1.41 1.41ZM7.05 16.95l-2.83 2.83-1.41-1.41 2.83-2.83 1.41 1.41ZM12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 1h2v4h-2V1Zm0 18h2v4h-2v-4ZM1 11h4v2H1v-2Zm18 0h4v2h-4v-2ZM4.22 2.81l2.83 2.83-1.41 1.41-2.83-2.83 1.41-1.41Zm12.73 12.73 2.83 2.83-1.41 1.41-2.83-2.83 1.41-1.41Zm2.83-11.32-2.83 2.83-1.41-1.41 2.83-2.83 1.41 1.41ZM7.05 16.95l-2.83 2.83-1.41-1.41 2.83-2.83 1.41 1.41ZM12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10Z'/%3E%3C/svg%3E");
}

.nav-icon-cap::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3 1 8.5 12 14l9-4.5V16h2V8.5L12 3Zm-6 9.2V16c0 2.2 3.6 4 6 4s6-1.8 6-4v-3.8l-6 3-6-3Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3 1 8.5 12 14l9-4.5V16h2V8.5L12 3Zm-6 9.2V16c0 2.2 3.6 4 6 4s6-1.8 6-4v-3.8l-6 3-6-3Z'/%3E%3C/svg%3E");
}

.nav-icon-responsible::before {
  width: 18px;
  height: 12px;
  position: absolute;
  top: 4px;
  left: 5px;
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 1 1 6.5 12 12l9-4.5V14h2V6.5L12 1ZM6 10v2c0 1.7 3.1 3 6 3s6-1.3 6-3v-2l-6 3-6-3Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 1 1 6.5 12 12l9-4.5V14h2V6.5L12 1ZM6 10v2c0 1.7 3.1 3 6 3s6-1.3 6-3v-2l-6 3-6-3Z'/%3E%3C/svg%3E");
}

.nav-icon-responsible::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 11px;
  right: 4px;
  bottom: 4px;
  border: 2px solid #fff;
  border-radius: 3px;
  background:
    linear-gradient(#fff, #fff) 0 3px / 100% 2px no-repeat,
    linear-gradient(#fff, #fff) 3px 0 / 2px 100% no-repeat,
    linear-gradient(#fff, #fff) 7px 0 / 2px 100% no-repeat;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.dashboard {
  padding: 30px;
  overflow: auto;
}

.topbar,
.panel-head,
.training-list article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar {
  margin-bottom: 20px;
}

.time-clock {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.time-clock button,
.time-counter,
.clock-status {
  min-height: 46px;
}

.time-clock button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-button {
  border-color: #dbe2ea;
  background: #fff;
  color: var(--brand);
}

.time-counter {
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.time-counter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.time-counter strong {
  color: var(--brand);
  font-size: 18px;
}

.clock-status {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.clock-status-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}

.clock-status.is-in .clock-status-dot {
  background: var(--accent);
}

.clock-status.is-out .clock-status-dot {
  background: var(--danger);
}

h2,
h3 {
  margin: 0 0 12px;
}

h2 {
  color: var(--brand);
  font-size: 32px;
}

h3 {
  color: var(--brand);
  font-size: 20px;
}

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

.eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--accent-dark);
}

.profile-pill {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
  box-shadow: var(--shadow);
  overflow: hidden;
  flex: 0 0 auto;
}

.profile-pill.has-image {
  padding: 0;
  background: #eef3f7;
}

.profile-pill img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.time-clock .profile-pill {
  width: 46px;
  height: 46px;
  min-width: 46px;
  max-width: 46px;
  min-height: 46px;
  max-height: 46px;
  border-radius: 50%;
}

.time-clock .profile-pill.has-image img {
  width: 46px;
  height: 46px;
  max-width: 46px;
  max-height: 46px;
  border-radius: 50%;
  object-fit: cover;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
  background: var(--panel);
}

.panel-head {
  margin-bottom: 14px;
}

.panel-head.compact {
  align-items: flex-start;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.news-panel {
  min-height: 338px;
}

.training-panel {
  min-height: 338px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  color: #007d6d;
  background: #dff8f1;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.status-ueberfaellig {
  color: var(--danger);
  background: rgba(215, 25, 32, 0.08);
}

.badge.status-offen {
  color: #9a4b00;
  background: #fff3d8;
}

.badge.status-krank {
  color: var(--danger);
  background: #ffe4e6;
}

.news-item {
  display: block;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
  color: inherit;
}

.news-item[hidden] {
  display: none !important;
}

.news-item + .news-item {
  margin-top: 10px;
}

.news-item strong {
  color: var(--ink);
}

.news-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.news-title-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-title-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.news-category-info {
  border-left-color: var(--accent);
}

.news-category-hinweis {
  border-left-color: var(--brand);
}

.news-category-abstimmung {
  border-left-color: var(--warn);
}

.news-category-warnung {
  border-left-color: var(--danger);
  background: #fff1f2;
}

.news-category-hilfe {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.news-item p,
.training-list p,
.module-card p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.news-panel .news-item p,
.training-list .training-item p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-title-link {
  color: inherit;
}

.news-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.news-list {
  display: grid;
  gap: 10px;
}

.vacation-overview,
.vacation-requests-panel {
  width: 100%;
  max-width: none;
  margin-bottom: 18px;
}

.vacation-calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.vacation-view-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.vacation-view-switch a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.vacation-view-switch a.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.vacation-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 14px;
  padding: 10px 0 2px;
}

.vacation-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.vacation-legend .vacation-balance-info {
  color: var(--ink);
}

.vacation-legend .vacation-balance-info b {
  color: var(--brand);
}

.vacation-legend .legend-dot {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border-radius: 5px;
  border: 2px solid transparent;
  background: #fff;
}

.vacation-legend .legend-dot.today {
  border-color: #7c3aed;
}

.vacation-legend .legend-dot.holiday {
  background: var(--brand);
}

.vacation-legend .legend-dot.school-holiday {
  border-color: #8bd2ff;
  background: #e8f6ff;
}

.vacation-legend .legend-dot.approved {
  background: #dcfce7;
  border-color: #22c55e;
}

.vacation-legend .legend-dot.planned {
  background: #fef3c7;
  border-color: #f59e0b;
}

.vacation-month {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.vacation-month h4 {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 15px;
}

.vacation-weekdays,
.vacation-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.vacation-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.vacation-day {
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.vacation-day.selectable,
.vacation-detail-day.selectable {
  cursor: pointer;
}

.vacation-day.today {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.vacation-day.muted {
  background: transparent;
}

.vacation-day.weekend {
  color: var(--muted);
  background: #f3f6f9;
}

.vacation-day.holiday {
  color: #fff;
  background: var(--brand);
}

.vacation-day.school-holiday {
  border-color: #8bd2ff;
  background: #e8f6ff;
  color: var(--brand);
}

.vacation-day.holiday.school-holiday {
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0 52%, #8bd2ff 52% 100%);
}

.vacation-day.planned-vacation {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.vacation-day.approved-vacation {
  border-color: #22c55e;
  background: #dcfce7;
  color: #166534;
}

.vacation-day.holiday.planned-vacation {
  color: #92400e;
  background: linear-gradient(135deg, var(--brand) 0 50%, #fef3c7 50% 100%);
}

.vacation-day.holiday.approved-vacation {
  color: #166534;
  background: linear-gradient(135deg, var(--brand) 0 50%, #dcfce7 50% 100%);
}

.vacation-day.today {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.vacation-dialog {
  width: min(560px, calc(100vw - 32px));
}

.vacation-preview {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfd;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.vacation-selection-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid #fb923c;
  border-radius: 8px;
  padding: 12px;
  background: #fff7ed;
  box-shadow: var(--shadow);
}

.vacation-selection-bar[hidden] {
  display: none !important;
}

.vacation-selection-bar span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.vacation-detail-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
}

.vacation-week-grid {
  align-items: stretch;
}

.vacation-calendar-controls {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 2px;
}

.vacation-calendar-controls strong {
  color: var(--brand);
  font-size: 15px;
}

.vacation-detail-day {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid #d8e1e9;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.vacation-detail-day.weekend {
  background: #f5f8fb;
}

.vacation-detail-day.holiday {
  border-left-color: var(--brand);
  background: #edf6ff;
}

.vacation-detail-day.school-holiday {
  background: #f0f9ff;
}

.vacation-detail-day.today {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
}

.vacation-day.selected-vacation-day,
.vacation-day.school-holiday.selected-vacation-day,
.vacation-day.holiday.selected-vacation-day,
.vacation-day.holiday.school-holiday.selected-vacation-day,
.vacation-detail-day.selected-vacation-day,
.vacation-detail-day.school-holiday.selected-vacation-day,
.vacation-detail-day.holiday.selected-vacation-day {
  border-color: #fb923c;
  background: #ffedd5;
  color: #9a3412;
  box-shadow: inset 0 0 0 2px rgba(251, 146, 60, 0.28);
}

.vacation-detail-day.planned-vacation {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.vacation-detail-day.approved-vacation {
  border-left-color: #22c55e;
  background: #f0fdf4;
}

.vacation-detail-day.holiday.planned-vacation {
  box-shadow: inset 5px 0 0 #f59e0b;
}

.vacation-detail-day.holiday.approved-vacation {
  box-shadow: inset 5px 0 0 #22c55e;
}

.vacation-detail-day.today {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
}

.vacation-detail-head,
.vacation-detail-list {
  display: grid;
  gap: 5px;
}

.vacation-detail-head strong {
  color: var(--ink);
  font-size: 14px;
}

.vacation-detail-head span,
.vacation-detail-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.vacation-detail-list b {
  color: var(--ink);
}

.news-layout {
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(420px, 1fr);
}

.news-filter-form {
  margin-bottom: 16px;
}

.form-grid.news-filter-grid {
  grid-template-columns: minmax(130px, 160px) minmax(150px, 190px) minmax(135px, 160px) minmax(135px, 160px) max-content;
  align-items: end;
}

.news-filter-actions {
  align-items: end;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}

.news-filter-actions button {
  white-space: nowrap;
}

.news-create-dialog {
  width: min(680px, calc(100vw - 32px));
}

.news-detail p {
  white-space: pre-wrap;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
}

.news-dialog {
  width: min(720px, calc(100vw - 32px));
}

.news-detail-text {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
  white-space: pre-wrap;
  line-height: 1.6;
}

.poll-box {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.poll-options,
.poll-results {
  display: grid;
  gap: 8px;
}

.poll-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.poll-option input {
  width: auto;
}

.poll-form {
  display: grid;
  gap: 12px;
}

.poll-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

.poll-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.poll-editor[hidden] {
  display: none;
}

.poll-option-editor {
  display: grid;
  gap: 10px;
}

.poll-option-field {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.training-list {
  display: grid;
  gap: 10px;
}

.training-list article {
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.training-list .training-item {
  display: block;
  padding: 14px;
  border-left: 5px solid var(--brand);
  cursor: pointer;
}

.training-list .training-item:not([data-dialog]) {
  cursor: default;
}

.training-list .training-empty {
  border-left-color: var(--brand);
}

.training-list .training-status-planned {
  border-left-color: var(--brand);
}

.training-list .training-status-overdue {
  border-left-color: var(--danger);
  background: #fff1f2;
}

.training-dialog {
  width: min(560px, calc(100vw - 32px));
}

.date-box {
  width: 48px;
  min-width: 48px;
  border-radius: 6px;
  padding: 7px 0;
  color: #fff;
  background: var(--accent);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
}

.date-box.muted-box {
  background: var(--brand);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.module-card {
  padding: 18px;
  background: var(--panel);
  position: relative;
  overflow: hidden;
  color: inherit;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}

.module-card span {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent-dark);
  font-weight: 700;
}

.module-card h3 {
  margin-bottom: 6px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.workflow-panel {
  min-height: 220px;
}

.workflow-list {
  display: grid;
  gap: 10px;
}

.workflow-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfcfd;
  min-width: 0;
}

.request-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  border-left: 5px solid var(--accent);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
}

.request-card[hidden] {
  display: none !important;
}

.request-card.status-eingereicht {
  border-left-color: var(--brand);
}

.request-card.status-freigegeben {
  border-left-color: var(--accent);
}

.request-card.status-abgelehnt {
  border-left-color: var(--danger);
}

.request-card + .request-card {
  margin-top: 0;
}

.request-toolbar {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.request-toolbar label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.request-toolbar select {
  width: 150px;
  padding: 8px 10px;
  font-size: 13px;
}

.request-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 35px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.request-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.request-overview-actions {
  gap: 14px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.submitted {
  background: var(--brand);
}

.legend-dot.approved {
  background: var(--accent);
}

.legend-dot.rejected {
  background: var(--danger);
}

.request-line {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 auto;
  min-width: 0;
}

.request-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.request-action {
  padding: 7px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.request-card .badge {
  flex: 0 0 auto;
}

.approval-card {
  cursor: pointer;
}

.request-line span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-reject-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.approval-reject-form[hidden] {
  display: none;
}

.approval-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.approval-reason {
  margin-top: 12px;
}

.approval-reason strong {
  display: block;
  margin-bottom: 6px;
}

.approval-reason p {
  min-height: 130px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
  white-space: pre-wrap;
  line-height: 1.5;
}

.correction-dialog .approval-reason p {
  overflow: auto !important;
  text-overflow: clip !important;
  white-space: pre-wrap !important;
}

.workflow-item.compact {
  align-items: start;
}

.workflow-item strong {
  color: var(--ink);
  white-space: nowrap;
}

.workflow-item > div {
  min-width: 0;
}

.workflow-item p {
  margin: 2px 0 0;
  color: var(--muted);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  margin-top: 0;
}

.settings-card {
  min-height: 180px;
}

.training-management-tiles {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  margin-top: 0;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(420px, 560px) minmax(320px, 420px);
  gap: 18px;
  align-items: start;
}

.settings-layout.news-layout {
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(0, 1fr);
}

.employees-layout {
  grid-template-columns: minmax(340px, 440px) minmax(560px, 1fr);
}

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

.settings-form label {
  display: grid;
  gap: 7px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.settings-form .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.profile-image-field {
  display: grid;
  gap: 12px;
}

.profile-editor {
  display: grid;
  grid-template-columns: 96px 160px;
  gap: 14px;
  align-items: center;
}

.profile-preview,
.profile-editor canvas {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #eef3f7;
  border: 1px solid var(--line);
  overflow: hidden;
}

.profile-preview {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.profile-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-editor canvas {
  width: 160px;
  height: 160px;
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
}

.profile-editor canvas:active {
  cursor: grabbing;
}

.profile-scale {
  max-width: 280px;
}

.field-title {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.settings-form-field {
  display: grid;
  gap: 7px;
}

.multi-select-dropdown {
  position: relative;
}

.multi-select-dropdown summary {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 38px 11px 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

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

.multi-select-dropdown summary::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg);
}

.multi-select-dropdown[open] summary::after {
  top: 20px;
  transform: rotate(225deg);
}

.multi-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.dropdown-check-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 10px !important;
  padding: 8px;
  border-radius: 6px;
  color: var(--ink) !important;
  font-weight: 700;
}

.dropdown-check-row:hover {
  background: #f4f7fa;
}

.dropdown-check-row input {
  width: auto;
}

.check-list {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.list-check {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
}

.list-check:last-child {
  border-bottom: 0;
}

.list-check small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.check-row input {
  width: auto;
  accent-color: var(--accent);
}

.notice {
  max-width: 980px;
  margin: 0 0 18px;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
}

.notice.success {
  color: #007d6d;
  background: #dff8f1;
  border: 1px solid rgba(0, 182, 159, 0.25);
}

.notice.error {
  color: var(--danger);
  background: rgba(215, 25, 32, 0.08);
  border: 1px solid rgba(215, 25, 32, 0.2);
}

.help-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.help-box strong {
  color: var(--brand);
}

.help-box p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.employee-list {
  display: grid;
  gap: 10px;
}

.employee-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
  min-width: 0;
  overflow: hidden;
}

.employee-row > div:first-child {
  min-width: 0;
}

.employee-row strong,
.employee-row p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.employee-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.small-action,
.secondary-link {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--brand);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.small-action:hover,
.secondary-link:hover {
  background: var(--brand-soft);
}

.single-column {
  grid-template-columns: minmax(420px, 560px);
}

.training-admin-grid {
  display: grid;
  grid-template-columns: minmax(340px, 440px) minmax(420px, 1fr);
  gap: 18px;
  align-items: start;
}

.training-admin-wide {
  grid-column: 1 / -1;
}

.training-plan-form {
  margin-bottom: 18px;
}

.training-plan-overview {
  max-width: 1180px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.compact-grid {
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px);
}

.select-all-row {
  margin-bottom: 8px;
}

.evidence-filter {
  margin-bottom: 18px;
}

.evidence-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}

.evidence-grid select {
  min-height: 150px;
}

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

.evidence-row p + p {
  margin-top: 6px;
}

.inline-form {
  margin: 0;
}

.danger-button {
  border-color: var(--danger);
  background: var(--danger);
}

.schedule-row p + p {
  margin-top: 6px;
}

.employee-time-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.employee-time-row.sickness-day-row {
  border-left: 5px solid var(--danger);
  background: #fff1f2;
}

.employee-time-row.sickness-pending-row {
  border-left: 5px solid var(--danger);
}

.employee-time-overview {
  width: 100%;
  max-width: none;
}

.time-filter-form {
  margin-bottom: 16px;
}

.form-grid.time-filter-grid {
  grid-template-columns: minmax(160px, 190px) minmax(160px, 190px) max-content;
  align-items: end;
}

.time-filter-actions {
  align-items: end;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}

.time-filter-actions button {
  white-space: nowrap;
}

.time-account-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.time-account-summary span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.time-account-summary b {
  color: var(--brand);
}

.time-day-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.time-day-summary strong {
  color: var(--ink);
  white-space: nowrap;
}

.time-day-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.time-day-metrics b {
  color: var(--brand);
}

.time-segment-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.time-segment {
  display: grid;
  grid-template-columns: minmax(110px, max-content) auto;
  justify-content: start;
  align-items: center;
  gap: 10px;
}

.time-segment span {
  font-weight: 800;
  color: var(--text);
}

.correction-dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.correction-dialog::backdrop {
  background: rgba(17, 24, 39, 0.45);
}

.correction-dialog-form label {
  margin: 0;
}

.correction-dialog-form textarea {
  min-height: 92px;
  resize: vertical;
}

.icon-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.player-body {
  background: var(--bg);
}

.training-player {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(720px, 1fr);
  gap: 18px;
  padding: 24px;
}

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

.training-frame {
  width: 100%;
  min-height: calc(100vh - 150px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 560px) {
  .employee-row {
    grid-template-columns: 1fr;
  }

  .employee-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 1080px) {
  .app-body,
  .login-shell,
  .dashboard-grid,
  .module-grid,
  .workflow-grid,
  .vacation-calendar-grid,
  .vacation-detail-grid,
  .settings-layout,
  .training-admin-grid,
  .form-grid,
  .time-segment,
  .correction-dialog .compact-grid {
    grid-template-columns: 1fr;
  }

  .news-layout {
    width: 100%;
    min-width: 0;
  }

  .training-admin-wide {
    grid-column: auto;
  }

  .sidebar {
    min-height: auto;
  }

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

@media (max-width: 720px) {
  .login-body,
  .dashboard {
    padding: 18px;
  }

  .login-brand {
    min-height: 360px;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    grid-template-columns: 1fr;
  }
}
