:root {
  --primary: #002B45;
  --primary-light: #003d5c;
  --accent: #FF8A72;
  --accent-dark: #e06b52;
  --accent-light: #fff0ec;
  --accent-border: #ffc9bb;
  --primary-tint: #eef3f7;
  --primary-tint-border: #c5d4e0;
  --primary-ring: rgba(0, 43, 69, 0.15);
  --accent-ring: rgba(255, 138, 114, 0.35);
  --header-bg: #ffffff;
  --bg: #FDF1E9;
  --surface: #ffffff;
  --surface-inset: #ffffff;
  --text: #1a3344;
  --text-muted: #5a7080;
  --border: #dde5eb;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0, 43, 69, 0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.hidden { display: none !important; }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #002B45;
}

#login-view .btn-primary {
  background: #002B45;
}

#login-view .btn-primary:hover:not(:disabled) {
  background: #003d5c;
}

#login-view .form-group input:focus {
  border-color: #002B45;
  box-shadow: 0 0 0 3px rgba(0, 43, 69, 0.15);
}

.login-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.login-card .logo { text-align: center; margin-bottom: 2rem; }
.login-card .logo h1 { font-size: 1.5rem; color: #002B45; font-weight: 700; }
.login-card .logo p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-primary:hover:not(:disabled) { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #cbd5e1; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn-auto { width: auto; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-info { background: var(--primary-tint); color: var(--primary); border: 1px solid var(--primary-tint-border); }
.alert-warning { background: var(--accent-light); color: var(--accent-dark); border: 1px solid var(--accent-border); }

.flash-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  max-width: min(32rem, calc(100vw - 2rem));
  margin: 0;
  box-shadow: 0 8px 24px rgba(0, 43, 69, 0.18);
  pointer-events: none;
}

#app-view {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.app-header {
  background: var(--header-bg);
  color: var(--primary);
  padding: 0 1.5rem;
  height: 60px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.app-header .brand {
  justify-self: start;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.app-header-logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: min(160px, 40vw);
  object-fit: contain;
  justify-self: center;
}

.app-header .user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  justify-self: end;
  min-width: 0;
}

.role-badge {
  background: var(--accent);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.filiale-badge {
  background: rgba(0, 43, 69, 0.08);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.btn-logout {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(0, 43, 69, 0.2);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.btn-logout:hover { background: rgba(0, 43, 69, 0.06); }

.top-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0.35rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid #000000;
  border-bottom: 1px solid #000000;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: none;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.nav-badge--alert {
  background: var(--danger);
}

.top-nav a:hover,
.top-nav a.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}

.main-content {
  padding: 2rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary);
}

.card .comment.is-new,
.news-post .comment.is-new {
  background: var(--accent-light);
}

.card .az-fl-section-divider::after {
  background: var(--surface);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.stat-card .number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

.dashboard-news-teaser {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  background: var(--surface-inset);
  border-radius: 0 8px 8px 0;
  margin-bottom: 0.75rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 0.15s, box-shadow 0.15s;
}

.dashboard-news-teaser:hover {
  background: var(--primary-tint);
  box-shadow: 0 2px 8px rgba(0, 43, 69, 0.08);
}

.dashboard-news-teaser:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dashboard-news-teaser-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.dashboard-news-teaser-title {
  display: block;
  color: var(--primary);
}

.dashboard-news-teaser-excerpt {
  font-size: 0.9rem;
  margin-top: 0.35rem;
  margin-bottom: 0;
  color: var(--text-muted);
}

.news-post--highlight {
  box-shadow: 0 0 0 3px var(--accent-ring);
  transition: box-shadow 0.3s ease;
}

.news-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.news-post.is-pinned {
  border-left: 4px solid var(--accent);
}

.news-pinned-carousel {
  margin-bottom: 1.5rem;
  --carousel-gap: 0.75rem;
  --carousel-card-height: 22.5rem;
}

.news-post--carousel {
  margin-bottom: 0;
  padding: 1rem;
  width: 100%;
  height: 100%;
  min-height: var(--carousel-card-height);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.news-post--carousel .meta {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}

.news-post--carousel h4 {
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(0.95rem * 1.35 * 2);
  max-height: calc(0.95rem * 1.35 * 2);
  margin-bottom: 0.5rem;
}

.news-post--carousel .body {
  flex-shrink: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: calc(0.85rem * 1.45 * 6);
  margin-bottom: 0.5rem;
}

.news-post-carousel-bottom {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
}

.news-carousel-attachments-info {
  flex-shrink: 0;
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.news-post-carousel-footer {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.news-post-carousel-footer:empty {
  padding-top: 0;
}

.news-post--carousel .news-post-carousel-footer .news-post-actions {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.news-post--carousel .news-post-actions {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 0.75rem;
  padding-bottom: 0;
  border-top: 1px solid var(--border);
  border-bottom: none;
  flex-wrap: nowrap;
  width: 100%;
  flex-shrink: 0;
}

.news-post--carousel .news-post-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
}

.news-pinned-carousel .carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.news-pinned-carousel .carousel-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--primary);
}

.carousel-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.carousel-viewport {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: var(--carousel-gap);
  will-change: transform;
  align-items: stretch;
}

.carousel-slide {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  height: var(--carousel-card-height);
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.carousel-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-inset);
  color: var(--primary);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}

.carousel-btn:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.carousel-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
}

.carousel-dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

.news-post .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.news-post .meta .tag {
  background: var(--surface-inset);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.news-post .meta .tag-pinned {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 700;
}

.tag-new {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 700;
}

.news-post.is-new {
  box-shadow: inset 3px 0 0 var(--accent);
}

.news-post--carousel.is-new {
  box-shadow: none;
  outline: 2px solid var(--accent-ring);
  outline-offset: -2px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.news-post h4 { font-size: 1.15rem; margin-bottom: 0.6rem; color: var(--primary); }
.news-post .body { font-size: 0.95rem; white-space: pre-wrap; margin-bottom: 1rem; }

.news-post-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.comments-section h5 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.comment {
  background: var(--surface-inset);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid transparent;
}

.comment.is-new {
  border-left-color: var(--accent);
  background: var(--accent-light);
}

.comment .comment-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.comment .comment-meta strong { color: var(--text); }
.comment p { font-size: 0.9rem; white-space: pre-wrap; }

.comment-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 70px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.arbeitszeiten-table {
  min-width: 0;
}

.arbeitszeiten-table .note-cell {
  max-width: 14rem;
  word-break: break-word;
}

.arbeitszeiten-table .col-actions,
.arbeitszeiten-table .actions-cell {
  min-width: 9.5rem;
  white-space: normal;
}

.arbeitszeiten-table .actions-cell .btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.az-entry-kind {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.az-entry-kind-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  cursor: pointer;
}

.az-entry-kind-option input {
  width: auto;
  margin: 0;
}

.arbeitszeiten-table tr.row-absence td {
  background: var(--primary-tint);
}

.absence-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-inset);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.filiale-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filiale-group-header h3 {
  margin-bottom: 0;
}

.filiale-group-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Teamleiter – Arbeitszeiten: zwei getrennte Bereiche */
.az-fl-team-toolbar {
  margin-bottom: 1rem;
}

.az-fl-section {
  margin-bottom: 0;
}

.az-fl-section-head {
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--primary-tint);
  border: 1px solid var(--primary-tint-border);
  border-left: 5px solid var(--primary-light);
}

.az-fl-section-head--team {
  background: var(--accent-light);
  border-color: var(--accent-border);
  border-left-color: var(--accent);
}

.az-fl-section-badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.az-fl-section-badge--team {
  background: var(--accent-dark);
}

.az-fl-section-head h3 {
  margin-bottom: 0.2rem;
  font-size: 1.2rem;
  color: var(--primary);
}

.az-fl-section-head--team h3 {
  color: var(--accent-dark);
}

.az-fl-section-head p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.az-fl-section-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.az-fl-section-divider {
  margin: 2.5rem 0;
  border: 0;
  border-top: 3px solid var(--border);
  position: relative;
}

.az-fl-section-divider::after {
  content: "Teamleitung";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0 1rem;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.az-fl-own-list-card h4,
.az-fl-own-list-card .filiale-group-header h4,
.az-fl-team-list-card .filiale-group-header h4 {
  margin-bottom: 0;
  font-size: 1rem;
  color: var(--primary);
}

.az-fl-team-list-card .filiale-group-header h4 {
  color: var(--accent-dark);
}

.stats-grid--compact .stat-card {
  padding: 0.85rem 1rem;
}

.stat-card--team {
  border-color: var(--accent-border);
  background: var(--accent-light);
}

.hours-total {
  background: var(--surface-inset);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pending { background: var(--accent-light); color: var(--accent-dark); }
.status-confirmed { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-cancelled { background: #f1f5f9; color: #64748b; text-decoration: line-through; }

.row-storniert { opacity: 0.65; }

.actions-cell {
  vertical-align: middle;
}

.actions-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.actions-cell .btn {
  margin: 0;
  white-space: nowrap;
  box-sizing: border-box;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.modal-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.news-post-modal {
  max-width: 42rem;
  position: relative;
  padding-top: 2.75rem;
}

.news-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.news-post-modal .news-post {
  margin-bottom: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.news-post-modal .news-post h4 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.news-post--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.news-post--clickable:hover,
.news-post--clickable:focus-visible {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 43, 69, 0.2);
}

.confirm-modal h3 {
  margin-bottom: 0;
}

.confirm-modal-text {
  margin: 1rem 0 1.25rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.audit-list { display: flex; flex-direction: column; gap: 0.75rem; }

.audit-item {
  background: var(--surface-inset);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
}

.audit-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.filter-bar .btn {
  margin-top: 0.25rem;
}

.month-filter-field {
  margin-bottom: 0;
  min-width: 11rem;
}

.filiale-group-header .month-filter-field,
.az-fl-team-toolbar .month-filter-field {
  flex-shrink: 0;
}

.az-fl-team-toolbar .month-filter-field {
  max-width: 14rem;
}

.month-filter-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.month-filter-field input[type="month"],
input[type="month"].month-input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s;
}

.month-filter-field input[type="month"]:focus,
input[type="month"].month-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

input[type="month"].month-input::-webkit-calendar-picker-indicator,
.month-filter-field input[type="month"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
}

.form-hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.worktime-notifications {
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid #f5c2c7;
  background: #fff5f5;
}

.worktime-notifications--compact {
  margin-bottom: 1.25rem;
}

.worktime-notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.worktime-notifications-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #991b1b;
}

.worktime-notifications-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.worktime-notification {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.worktime-notification--rejected {
  border-left-color: var(--accent-dark);
}

.worktime-notification-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.worktime-notification-message,
.worktime-notification-reason {
  margin: 0.25rem 0 0;
  color: var(--text);
  font-size: 0.92rem;
}

.worktime-notification-reason {
  color: var(--text-muted);
}

.worktime-notification-meta {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.news-attachments {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.news-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.news-image-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 100%;
}

.news-image-link img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: var(--surface-inset);
}

.news-files {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.news-file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-inset);
  border-radius: 8px;
  text-decoration: none;
  color: var(--primary);
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.news-file-link:hover {
  background: var(--primary-tint);
}

.news-file-link .file-size {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.news-files-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.news-files-counter {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.news-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  background: var(--surface-inset);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.news-upload-zone:hover,
.news-upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--primary-tint);
}

.news-upload-zone-text {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary-light);
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--primary);
}

.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}

.file-chip-remove {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 999px;
  background: #fee2e2;
  color: var(--danger);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.file-chip-remove:hover {
  background: #fecaca;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .app-header { padding: 0 0.75rem; }
  .app-header .brand { font-size: 0.95rem; }
  .app-header-logo { height: 26px; max-width: min(120px, 36vw); }
  .app-header .user-info { gap: 0.5rem; font-size: 0.8rem; }
  .top-nav { padding: 0 0.75rem; }
  .top-nav a { padding: 0.75rem 0.85rem; font-size: 0.85rem; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .main-content { padding: 1.25rem; }
}

.ma-carryover-fields {
  margin: 0.75rem 0 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.ma-carryover-fields .form-hint {
  margin-bottom: 0.75rem;
}

/* Stundenabrechnung (Admin-Muster) */
.stundenabrechnung-toolbar-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.stunden-rules-card {
  margin-bottom: 1.25rem;
}

.stunden-rules-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.stunden-rules-summary::-webkit-details-marker {
  display: none;
}

.stunden-rules-chevron {
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  margin-top: -0.15rem;
}

.stunden-rules-card[open] .stunden-rules-chevron {
  transform: rotate(45deg);
  margin-top: 0.15rem;
}

.stunden-rules-summary h3 {
  display: inline;
  font-size: 1.05rem;
  color: var(--primary);
  margin: 0;
}

.stunden-rules-body {
  margin-top: 1rem;
  font-size: 0.92rem;
  color: var(--text);
}

.stunden-rules-body h4 {
  font-size: 0.95rem;
  margin: 1rem 0 0.5rem;
  color: var(--primary);
}

.stunden-rules-body h4:first-child {
  margin-top: 0;
}

.stunden-rules-body ul {
  margin: 0 0 0.5rem 1.2rem;
}

.stunden-rules-body li {
  margin-bottom: 0.35rem;
}

.stunden-rules-note {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.85rem;
  background: var(--primary-tint);
  border: 1px solid var(--primary-tint-border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.stunden-rules-absence-list {
  columns: 2;
  column-gap: 1.5rem;
}

@media (max-width: 640px) {
  .stunden-rules-absence-list {
    columns: 1;
  }
}

.stundenabrechnung-pending,
.az-pending-release {
  margin-top: 1.5rem;
  margin-bottom: 2.75rem;
}

.az-pending-release + .az-all-entries-section {
  margin-top: 0.25rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

.az-all-entries-section-title {
  margin: 0 0 1.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.az-all-entries-section .filiale-group + .filiale-group {
  margin-top: 1rem;
}

.stundenabrechnung-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.stundenabrechnung-pending-head h3 {
  margin: 0;
}

.az-pending-filiale-group + .az-pending-filiale-group {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.az-pending-filiale-group .filiale-group-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.stundenabrechnung-carryover-form {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.stundenabrechnung-carryover-form h3 {
  margin-bottom: 0.25rem;
}

.stundenabrechnung-carryover-form .page-subtitle {
  margin-bottom: 1rem;
}

.stundenabrechnung-carryover-actions {
  display: flex;
  align-items: flex-end;
}

.stundenabrechnung-preview {
  padding: 1.5rem;
  overflow-x: auto;
}

.stundenabrechnung-sheet {
  max-width: 960px;
  margin: 0 auto;
  color: #111;
}

.stundenabrechnung-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}

.stundenabrechnung-company {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stundenabrechnung-title {
  margin-top: 0.35rem;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.stundenabrechnung-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}

.stundenabrechnung-meta > div {
  display: grid;
  grid-template-columns: minmax(9rem, 42%) 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.stundenabrechnung-meta-carryover {
  grid-column: 1 / -1;
}

.stundenabrechnung-carryover-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 2rem;
  align-items: baseline;
}

.stundenabrechnung-carryover-line .num {
  font-variant-numeric: tabular-nums;
}

.stundenabrechnung-meta dt {
  font-weight: 600;
  color: var(--text-muted);
}

.stundenabrechnung-meta dd {
  margin: 0;
}

.stundenabrechnung-month strong {
  font-weight: 700;
}

.stundenabrechnung-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stundenabrechnung-table th,
.stundenabrechnung-table td {
  border: 1px solid #cbd5e1;
  padding: 0.4rem 0.5rem;
  vertical-align: top;
  text-align: left;
}

.stundenabrechnung-table th {
  background: var(--primary-tint);
  font-weight: 600;
}

.stundenabrechnung-table td.num {
  font-variant-numeric: tabular-nums;
}

.stundenabrechnung-meta dd.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stundenabrechnung-row-empty td {
  color: #94a3b8;
}

.stundenabrechnung-row-sunday td {
  background: var(--primary-tint);
}

.stundenabrechnung-absence-cell {
  text-align: left;
  font-weight: 600;
}

.stundenabrechnung-row-summary td {
  background: var(--primary-tint);
}

.stundenabrechnung-summary {
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .stundenabrechnung-meta {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    height: auto;
  }

  body * {
    visibility: hidden;
  }

  .stundenabrechnung-sheet,
  .stundenabrechnung-sheet * {
    visibility: visible;
  }

  .stundenabrechnung-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
    padding: 0;
    min-height: calc(297mm - 20mm);
    display: flex;
    flex-direction: column;
    font-size: 7.5pt;
    line-height: 1.15;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    page-break-after: avoid;
    page-break-inside: avoid;
    box-sizing: border-box;
  }

  .stundenabrechnung-header {
    margin-bottom: 0.35rem;
    padding-bottom: 0.25rem;
    border-bottom-width: 1px;
    flex: 0 0 auto;
  }

  .stundenabrechnung-company {
    font-size: 9pt;
  }

  .stundenabrechnung-title {
    margin-top: 0.1rem;
    font-size: 10.5pt;
    letter-spacing: 0.04em;
  }

  .stundenabrechnung-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.2rem 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 7.5pt;
    flex: 0 0 auto;
  }

  .stundenabrechnung-meta > div {
    grid-template-columns: minmax(6.5rem, 38%) 1fr;
    gap: 0.25rem;
  }

  .stundenabrechnung-carryover-line {
    gap: 0.15rem 1.25rem;
  }

  .stundenabrechnung-sheet > .table-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .stundenabrechnung-table {
    flex: 1 1 auto;
    height: 100%;
    font-size: 8pt;
    line-height: 1.2;
    table-layout: fixed;
  }

  .stundenabrechnung-table th:nth-child(1),
  .stundenabrechnung-table td:nth-child(1) { width: 7%; }
  .stundenabrechnung-table th:nth-child(2),
  .stundenabrechnung-table td:nth-child(2) { width: 6%; }
  .stundenabrechnung-table th:nth-child(3),
  .stundenabrechnung-table td:nth-child(3) { width: 8%; }
  .stundenabrechnung-table th:nth-child(4),
  .stundenabrechnung-table td:nth-child(4) { width: 8%; }
  .stundenabrechnung-table th:nth-child(5),
  .stundenabrechnung-table td:nth-child(5) { width: 8%; }
  .stundenabrechnung-table th:nth-child(6),
  .stundenabrechnung-table td:nth-child(6) { width: 9%; }
  .stundenabrechnung-table th:nth-child(7),
  .stundenabrechnung-table td:nth-child(7) {
    width: 9%;
    max-width: 14mm;
  }

  .stundenabrechnung-table th:nth-child(7) {
    font-size: 6pt;
    line-height: 1.1;
    padding-left: 0.1rem;
    padding-right: 0.1rem;
    hyphens: auto;
  }

  .stundenabrechnung-table td:nth-child(7) {
    font-size: 8pt;
    white-space: nowrap;
    padding-left: 0.12rem;
    padding-right: 0.12rem;
  }

  .stundenabrechnung-table th:last-child,
  .stundenabrechnung-table td:last-child {
    width: 17%;
    max-width: 32mm;
    font-size: 7pt;
    line-height: 1.1;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .stundenabrechnung-table th:last-child {
    font-size: 6pt;
    padding-left: 0.12rem;
    padding-right: 0.12rem;
  }

  .stundenabrechnung-table th,
  .stundenabrechnung-table td {
    padding: 0.14rem 0.2rem;
    border-width: 0.5px;
  }

  .stundenabrechnung-table th {
    font-size: 7.5pt;
    line-height: 1.15;
    vertical-align: bottom;
  }

  .stundenabrechnung-table tbody tr {
    height: 1%;
  }

  .stundenabrechnung-table tbody td {
    vertical-align: middle;
  }

  .stundenabrechnung-row-summary td {
    background: #f8fafc;
  }

  .stundenabrechnung-row-sunday td {
    background: #f8fafc !important;
  }

  .stundenabrechnung-summary {
    display: none !important;
  }

  .stundenabrechnung-no-print,
  .top-header,
  .top-nav,
  .loading-overlay {
    display: none !important;
  }

  .main-content {
    padding: 0;
    margin: 0;
  }

  .stundenabrechnung-preview {
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
  }
}
