@import url('https://fonts.googleapis.com/css2?family=Jost:wght@500;600;700&family=Roboto:wght@400;500;700&display=swap');

/* Image Overlay Styles */
.image-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
  margin: 0;
}

/* Ensure overlay covers entire viewport */
.image-overlay * {
  box-sizing: border-box;
}

/* Force overlay to cover entire screen */
.image-overlay {
  min-width: 100vw;
  min-height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
}

/* Reset any potential body/html margins when overlay is active */
body.overlay-active {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

html.overlay-active {
  margin: 0;
  padding: 0;
}

.image-overlay.active {
  opacity: 1;
  visibility: visible;
}

.image-overlay-content {
  position: relative;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-overlay img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.image-overlay-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.image-overlay-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Thumbnail Styles */
.thumbnail {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 2px solid var(--neutral-300);
}

.thumbnail:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #94a3b8;
}

/* Large Thumbnail Styles für Taubenseite */
.thumbnail-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 3px solid var(--neutral-300);
}

.thumbnail-large:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.thumbnail-large.placeholder {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--neutral-300);
}

.thumbnail-large.placeholder img {
  width: 60px;
  height: 60px;
  opacity: 0.6;
}

/* Mobile Responsive für Large Thumbnails */
@media (max-width: 768px) {
  .image-overlay {
    padding: 10px;
  }

  .image-overlay-content {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .image-overlay img {
    max-height: calc(100vh - 40px);
  }

  .thumbnail {
    width: 35px;
    height: 35px;
  }

  .thumbnail-placeholder {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .thumbnail-large {
    width: 100px;
    height: 100px;
  }

  .thumbnail-large.placeholder img {
    width: 50px;
    height: 50px;
  }
}

:root {
  --brand-color: #009BB4;
  --brand-color-dark: #007a8d;
  --brand-color-light: rgba(0, 155, 180, 0.12);
  --neutral-50: #f8fafc;
  --neutral-75: #f5f9fc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e5e9f2;
  --neutral-300: #e2e8f0;
  --neutral-400: #cbd5e1;
  --text-primary: #15202b;
  --text-secondary: #475467;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--neutral-75) 0%, var(--neutral-100) 100%);
  /* line-height: 1.55; */
  padding: clamp(1rem, 4vw, 2.4rem) clamp(1rem, 5vw, 3rem);
}

body>*:not(.app-meta) {
  /* width: 100%; */
  max-width: min(100%, 960px);
  margin-left: auto;
  margin-right: auto;
}

body>*:not(.app-meta)+*:not(.burger-menu) {
  margin-top: clamp(1.1rem, 3vw, 1.9rem);
  margin-left: auto;
  margin-right: auto;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body>form {
  background: #fff;
  border-radius: 20px;
  padding: clamp(1rem, 3vw, 1.6rem);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

body>.brand {
  background: #fff;
  padding: clamp(0.9rem, 2.5vw, 1.4rem);
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.app-meta {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--brand-color);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 155, 180, 0.35);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: opacity .2s ease, transform .2s ease;
}

.app-meta:hover,
.app-meta:focus {
  transform: translateY(-2px);
}

.app-meta.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .app-meta {
    right: 50%;
    transform: translateX(50%);
    bottom: 1rem;
  }
}

h1,
h2,
h3 {
  font-family: 'Jost', 'Roboto', sans-serif;
  color: #000;
}

.brand a {
  color: inherit;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo img {
  display: block;
}

@font-face {
  font-family: 'Asimovian';
  src: url('lib/tcpdf/fonts/Asimovian-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

.brand h1,
.app-header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
}

.text-logo {
  font-family: 'Asimovian', sans-serif;
  letter-spacing: 0.05em;
}

.brand img {
  height: clamp(46px, 10vw, 64px);
  width: auto;
}

.table-actions {
  /* display: flex; */
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-start;
}

.table-actions form {
  margin: 0;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 155, 180, 0.35);
  background: #fff;
  font-size: 1.15rem;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.btn-icon:hover,
.btn-icon:focus {
  background: var(--brand-color-light);
  border-color: var(--brand-color);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .table-actions {
    /* flex-direction: column; */
    align-items: stretch;
  }

  .table-actions form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
}

.table-wrapper {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--neutral-300);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}

.table-wrapper thead th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--neutral-50);
}

.table-wrapper th,
.table-wrapper td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--neutral-200);
  text-align: left;
  vertical-align: middle;
  font-size: 0.95rem;
}

.table-wrapper tbody tr:last-child td {
  border-bottom: none;
}

.table-wrapper--static {
  overflow-x: auto;
}

.table-wrapper--static table {
  min-width: 480px;
}

.table-wrapper--static .status-cell {
  text-align: center;
}

.status-emoji {
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* Desktop: Details-Header in Log-Tabelle ausblenden */
.page-taube-view section#log .table-wrapper tbody tr td:nth-child(3) .log-header-mobile {
  display: none !important;
}

/* Desktop: Details-Header in Todo-Liste ausblenden */
.page-dashboard section .table-wrapper tbody tr td:nth-child(4) .log-header-mobile {
  display: none !important;
}

/* Desktop: Todo-Liste normale Tabellenstruktur beibehalten */
.page-dashboard section .table-wrapper {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--neutral-300);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.page-dashboard section .table-wrapper table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}

.page-dashboard section .table-wrapper thead th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--neutral-50);
}

.page-dashboard section .table-wrapper th,
.page-dashboard section .table-wrapper td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--neutral-200);
  text-align: left;
  vertical-align: middle;
  font-size: 0.95rem;
}

.page-dashboard section .table-wrapper tbody tr:last-child td {
  border-bottom: none;
}

/* 2-Spalten-Tabellenlayout für Stammdaten - Desktop */
.page-taube-view section:first-of-type .table-wrapper table {
  display: table !important;
  width: 100%;
}

.page-taube-view section:first-of-type .table-wrapper tbody {
  display: table-row-group !important;
}

.page-taube-view section:first-of-type .table-wrapper tbody tr {
  display: table-row !important;
}

.page-taube-view section:first-of-type .table-wrapper tbody th,
.page-taube-view section:first-of-type .table-wrapper tbody td {
  display: table-cell !important;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #e5e9f2;
  vertical-align: top;
  text-align: left;
}

.page-taube-view section:first-of-type .table-wrapper tbody th {
  width: 40%;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--neutral-50);
  border-right: 1px solid var(--neutral-200);
}

.page-taube-view section:first-of-type .table-wrapper tbody td {
  width: 60%;
}

@media (max-width: 768px) {

  /* Mobile Layout für Log-Tabelle (zweite section) */
  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) table {
    display: block;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) thead {
    display: none;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody {
    display: grid;
    gap: 1rem;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody th {
    display: none;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr {
    display: grid;
    gap: 0.55rem 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr.archived {
    background: #f8fafc;
  }

  /* Spezielle Behandlung für Log-Tabelle: Alle Spalten außer Details zusammenfassen */
  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td:nth-child(1),
  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td:nth-child(2),
  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td:nth-child(4) {
    display: none !important;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td:nth-child(3) {
    border: none !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.35rem !important;
    align-items: flex-start !important;
    font-size: 0.95rem !important;
    word-break: break-word !important;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td:nth-child(3) .log-header-mobile {
    font-weight: 600 !important;
    color: #475467 !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.15rem !important;
    display: block !important;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td:nth-child(3) .log-header-mobile strong {
    color: #475467 !important;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td:nth-child(3) .log-note {
    margin-top: 0.5rem !important;
    padding: 0.5rem !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    border-left: 3px solid var(--brand-color) !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }

  /* Mobile Layout für Todo-Liste */
  .page-dashboard section .table-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .page-dashboard section .table-wrapper table {
    display: block;
  }

  .page-dashboard section .table-wrapper thead {
    display: none;
  }

  .page-dashboard section .table-wrapper tbody {
    display: grid;
    gap: 1rem;
  }

  .page-dashboard section .table-wrapper tbody th {
    display: none;
  }

  .page-dashboard section .table-wrapper tbody tr {
    display: grid;
    gap: 0.55rem 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
  }

  .page-dashboard section .table-wrapper tbody tr.archived {
    background: #f8fafc;
  }

  /* Spezielle Behandlung für Todo-Liste: Alle Spalten außer Details zusammenfassen */
  .page-dashboard section .table-wrapper tbody tr td:nth-child(1),
  .page-dashboard section .table-wrapper tbody tr td:nth-child(2),
  .page-dashboard section .table-wrapper tbody tr td:nth-child(3),
  .page-dashboard section .table-wrapper tbody tr td:nth-child(5),
  .page-dashboard section .table-wrapper tbody tr td:nth-child(6) {
    display: none !important;
  }

  .page-dashboard section .table-wrapper tbody tr td:nth-child(4) {
    border: none !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.35rem !important;
    align-items: flex-start !important;
    font-size: 0.95rem !important;
    word-break: break-word !important;
  }

  .page-dashboard section .table-wrapper tbody tr td:nth-child(4) .log-header-mobile {
    font-weight: 600 !important;
    color: #475467 !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.15rem !important;
    display: block !important;
  }

  .page-dashboard section .table-wrapper tbody tr td:nth-child(4) .log-header-mobile strong {
    color: #475467 !important;
  }

  .page-dashboard section .table-wrapper tbody tr td:nth-child(4) .log-header-mobile a {
    color: var(--brand-color) !important;
    text-decoration: none !important;
  }

  .page-dashboard section .table-wrapper tbody tr td:nth-child(4) .log-header-mobile a:hover {
    text-decoration: underline !important;
  }

  .page-dashboard section .table-wrapper tbody tr td:nth-child(4) .log-note {
    margin-top: 0.5rem !important;
    padding: 0.5rem !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    border-left: 3px solid var(--brand-color) !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }

  .page-dashboard section .table-wrapper tbody tr td:nth-child(4) .log-weight {
    margin-top: 0.5rem !important;
    font-weight: 600 !important;
    color: var(--brand-color) !important;
  }

  /* Buttons in der mobilen Ansicht für Todo-Liste wieder anzeigen */
  .page-dashboard section .table-wrapper tbody tr td:nth-child(6) {
    display: block !important;
    border: none !important;
    padding: 0 !important;
    margin-top: 0.5rem !important;
  }

  .page-dashboard section .table-wrapper tbody tr td:nth-child(6) .table-actions {
    display: flex !important;
    gap: 0.4rem !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  .page-dashboard section .table-wrapper tbody tr td:nth-child(6) .table-actions form {
    display: inline-flex !important;
    gap: 0.4rem !important;
    align-items: center !important;
  }



  /* Buttons in der mobilen Ansicht wieder anzeigen */
  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td:nth-child(5) {
    display: block !important;
    border: none !important;
    padding: 0 !important;
    margin-top: 0.5rem !important;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td:nth-child(5) .table-actions {
    display: flex !important;
    gap: 0.4rem !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td:nth-child(5) .table-actions form {
    display: inline-flex !important;
    gap: 0.4rem !important;
    align-items: center !important;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td a {
    word-break: break-word;
  }

  /* Mobile Layout für Stammdaten-Tabelle - 2-Spalten beibehalten */
  .page-taube-view section:first-of-type .table-wrapper {
    overflow-x: auto;
  }

  .page-taube-view section:first-of-type .table-wrapper table {
    min-width: 500px;
  }

  .page-taube-view section:first-of-type .table-wrapper tbody th {
    width: 35%;
  }

  .page-taube-view section:first-of-type .table-wrapper tbody td {
    width: 65%;
  }
}

@media (max-width: 540px) {

  /* Für sehr kleine Bildschirme: Stammdaten-Tabelle horizontal scrollbar */
  .page-taube-view section:first-of-type .table-wrapper table {
    min-width: 400px;
  }

  .page-taube-view section:first-of-type .table-wrapper tbody th {
    width: 30%;
  }

  .page-taube-view section:first-of-type .table-wrapper tbody td {
    width: 70%;
  }
}

@media (max-width: 768px) {
  .page-taube-view .table-actions {
    flex-direction: row;
    align-items: center;
  }

  .page-taube-view .table-actions::before {
    display: block;
    flex-basis: 100%;
    margin-bottom: 0.25rem;
  }

  .page-taube-view .table-actions form {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
  }

  .page-taube-view .table-wrapper td.table-actions .btn,
  .page-taube-view .table-wrapper td.table-actions button,
  .page-taube-view .table-wrapper td.table-actions form {
    width: auto;
  }

  .page-taube-view .table-wrapper td.table-actions form button {
    flex: 0 0 auto;
  }
}

a {
  color: var(--brand-color);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--brand-color-dark);
  text-decoration: underline;
}

/* Dashboard */
.page-dashboard header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  background: #fff;
  padding: clamp(1rem, 3vw, 1.7rem);
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.page-dashboard .pflegestelle-stats {
  display: grid;
  gap: 0.9rem;
  align-items: start;
  width: 100%;
}

.page-dashboard .pflegestelle-stats__header {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  overflow-x: auto;
  white-space: nowrap;
}

.page-dashboard .pflegestelle-stats__title {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #475569;
  font-weight: 600;
}

.page-dashboard .pflegestelle-stats__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #111827;
  line-height: 1.2;
  white-space: nowrap;
  display: inline-block;
}

.page-dashboard .pflegestelle-stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.pflegestelle-stat-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.pflegestelle-stat-card-link .pflegestelle-stat-card {
  height: 100%;
  cursor: pointer;
}

.pflegestelle-stat-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  border: 1px solid rgba(0, 155, 180, 0.1);
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
  display: grid;
  gap: 0.6rem;
  position: relative;
  overflow: visible;
}

.pflegestelle-stat-card--vertical {
  padding-left: 3.4rem;
}

.pflegestelle-stat-card__title {
  font-weight: 700;
  color: #0f172a;
  font-size: 1rem;
}

.pflegestelle-stat-card__title-full {
  display: inline;
}

.pflegestelle-stat-card__title-compact {
  display: none;
}

.pflegestelle-stat-card__title--vertical {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  white-space: nowrap;
  font-size: 1.05rem;
}

.stat-donut {
  --p-filled: 65%;
  --donut-color: var(--brand-color);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--donut-color) 0 var(--p-filled), #e2e8f0 var(--p-filled) 100%);
  display: grid;
  place-items: center;
  position: relative;
  margin: 0.25rem 0;
}

.stat-donut::after {
  content: '';
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #fff;
}

.stat-donut__inner {
  position: relative;
  text-align: center;
  z-index: 1;
  display: grid;
  gap: 0.1rem;
}

.stat-donut__value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
}

.stat-donut__inner small {
  font-size: 0.85rem;
  color: #475569;
}

.stat-donut__over {
  color: #ec5b62;
  font-weight: 700;
}

.stat-donut--triple {
  --p-green: 0%;
  --p-yellow: 0%;
  background: conic-gradient(#20b77c 0 var(--p-green),
      #f3af2a var(--p-green) var(--p-yellow),
      #ec5b62 var(--p-yellow) 100%);
}

.donut-legend {
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: #334155;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 155, 180, 0.16);
  border-radius: 12px;
  padding: 0.5rem 0.65rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  opacity: 0;
  transform: translateY(-4px);
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease;
  position: absolute;
  min-width: 220px;
  z-index: 3;
}

.pflegestelle-stat-card:hover .donut-legend,
.pflegestelle-stat-card:focus-within .donut-legend {
  opacity: 1;
  transform: translateY(0);
  max-height: 240px;
  pointer-events: auto;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.35rem;
}

.legend-dot--green {
  background: #20b77c;
}

.legend-dot--yellow {
  background: #f3af2a;
}

.legend-dot--red {
  background: #ec5b62;
}

.legend-headline {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-weight: 800;
}

.legend-headline .legend-percent {
  color: #009bb4;
  font-size: 1.1rem;
}

.legend-headline .legend-over {
  color: #ec5b62;
  font-size: 1rem;
}

.legend-title {
  font-weight: 700;
  color: #444;
  margin-top: 0.25rem;
}

.legend-sub {
  color: #666;
}

.legend-line {
  margin-top: 0.2rem;
}

.legend-line--free {
  color: #22c55e;
}

.legend-line--over {
  color: #ef4444;
}

.mobile-bar__over-label {
  margin-left: 0.25rem;
  color: #ec5b62;
  font-weight: 700;
}

.mobile-bar {
  display: none;
  gap: 0.35rem;
}

.mobile-bar__label {
  font-weight: 700;
  color: #0f172a;
}

.mobile-bar__rail {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.mobile-bar__fill {
  height: 100%;
  background: var(--bar-color, var(--brand-color));
  border-radius: 999px 0 0 999px;
}

.mobile-bar__fill--over {
  background: #ec5b62;
}

.mobile-bar__overhang {
  position: absolute;
  top: 0;
  left: 100%;
  height: 100%;
  background: #ec5b62;
  border-radius: 0 999px 999px 0;
}

.mobile-bar__rail--stacked {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  background: #e2e8f0;
}

.mobile-bar__segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  position: relative;
}

.mobile-bar__segment small {
  position: relative;
  z-index: 1;
}

.mobile-bar__segment--green {
  background: #20b77c;
  color: #0b1f1a;
}

.mobile-bar__segment--yellow {
  background: #f3af2a;
  color: #4b3a0d;
}

.mobile-bar__segment--red {
  background: #ec5b62;
  color: #fff;
}

.mobile-bar__value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
  z-index: 2;
  white-space: nowrap;
}

.page-dashboard nav {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

@media (max-width: 640px) {
  .page-dashboard nav {
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
  }

  .page-dashboard nav::-webkit-scrollbar {
    display: none;
  }
}

@media (min-width: 880px) {
  .page-dashboard header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .page-dashboard nav {
    width: auto;
    justify-content: flex-end;
  }

  .page-dashboard .pflegestelle-stats {
    max-width: 620px;
  }
}

.page-dashboard .filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  margin: 0;
  background: #fff;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  border: 1px solid var(--neutral-300);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.page-dashboard .filters::-webkit-scrollbar {
  display: none;
}

.page-dashboard .filters a {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 155, 180, 0.35);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brand-color);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  flex: 0 0 auto;
  white-space: nowrap;
}

.page-dashboard .filters select {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  min-width: 12rem;
  font: inherit;
  background: #fff;
}

.page-dashboard .filters a.active {
  background: var(--brand-color);
  border-color: var(--brand-color);
  color: #fff;
}

.page-dashboard .filters a:hover,
.page-dashboard .filters a:focus {
  border-color: var(--brand-color);
  background: var(--brand-color-light);
}

.page-dashboard .filters a.active:hover,
.page-dashboard .filters a.active:focus {
  background: var(--brand-color-dark);
  border-color: var(--brand-color-dark);
  color: #fff;
}

.page-dashboard .filters .filters__pflegestelle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.page-dashboard .filters .filters__pflegestelle span[aria-hidden="true"] {
  font-size: 1.1rem;
  line-height: 1;
}

@media (max-width: 640px) {
  .page-dashboard .filters .filters__pflegestelle {
    margin-left: 0;
  }
}

.page-dashboard a.btn,
.page-dashboard button.btn {
  padding: .55rem .9rem;
  border-radius: 10px;
  display: inline-block;
}

.page-dashboard .table-wrapper {
  margin-top: 1rem;
}

.page-dashboard .table-wrapper th,
.page-dashboard .table-wrapper td {
  padding: .6rem;
}

.page-dashboard th {
  text-align: left;
}

.page-dashboard .tag {
  display: inline-block;
  padding: .15rem .5rem;
  border: 1px solid #aaa;
  border-radius: 999px;
  font-size: .82rem;
  color: #333;
}

.page-dashboard .active-filter {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.92rem;
  background: #fff;
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--neutral-300);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.page-dashboard .active-filter a {
  color: var(--brand-color);
}

.page-dashboard tr.archived {
  background: #dfe2e7;
  color: #4b5563;
}

.page-dashboard tr.critical {
  background: #fde9b5;
  color: #7a2e0b;
}

.page-dashboard tr.critical:hover {
  background: #fcd975;
}

.page-dashboard tr.verstorben {
  background: #fcd5d5;
  color: #7f1d1d;
}

.page-dashboard tr.verstorben:hover {
  background: #f8bebe;
}

@media (max-width:720px) {
  .page-dashboard nav {
    width: 100%;
    justify-content: flex-start;
  }

  .page-dashboard .table-wrapper {
    margin-top: 1.5rem;
  }

  .page-dashboard .brand img {
    height: 48px;
  }

  .page-dashboard header {
    align-items: flex-start;
  }

  .dashboard--hide-mobile-stats .pflegestelle-stats {
    display: none;
  }

  .page-dashboard .pflegestelle-stats {
    order: 2;
    margin-top: .5rem;
  }

  .page-dashboard .brand {
    order: 1;
  }

  .stat-donut {
    display: none !important;
  }

  .donut-legend {
    display: none !important;
  }

  .mobile-bar {
    display: grid;
  }

  .pflegestelle-stat-card--vertical {
    padding-left: 0.9rem;
  }

  .pflegestelle-stat-card__title--vertical {
    position: static;
    transform: none;
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .pflegestelle-stat-card__title-full {
    display: none;
  }

  .pflegestelle-stat-card__title-compact {
    display: inline;
  }

  /* Verstecke erste Spalte auf Mobile für Users und Pflegestellen */
  .page-users .table-wrapper tbody tr td:nth-child(1),
  .page-pflegestellen .table-wrapper tbody tr td:nth-child(1),
  .page-users .table-wrapper thead tr th:nth-child(1),
  .page-pflegestellen .table-wrapper thead tr th:nth-child(1) {
    display: none !important;
  }
}

/* Login */
.page-login form {
  display: grid;
  gap: .9rem;
  max-width: 400px;
  margin: 0 auto;
}

.page-login input,
.page-login button,
.page-login select,
.page-login textarea {
  font: inherit;
  padding: .6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.page-login button {
  cursor: pointer;
}

.page-login input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.page-login label[style*="display:flex"] {
  justify-content: flex-start;
  align-items: center;
}

/* Password Reset - gleiches Design wie Login */
.page-password-reset form {
  display: grid;
  gap: .9rem;
  max-width: 400px;
  margin: 0 auto;
}

.page-password-reset input,
.page-password-reset button,
.page-password-reset select,
.page-password-reset textarea {
  font: inherit;
  padding: .6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.page-password-reset button {
  cursor: pointer;
}

.page-login .app-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.6rem;
}

.page-login .app-header h1 {
  margin: 0;
  font-size: 1.85rem;
}

.page-login .app-header img {
  height: 60px;
  width: auto;
}

@media (max-width:600px) {
  .page-login form {
    gap: 1.1rem;
  }

  .page-login button {
    width: 100%;
  }

  .page-login .app-header {
    gap: .7rem;
    margin-bottom: 1.4rem;
  }

  .page-login .app-header img {
    height: 48px;
  }

  .page-login .app-header h1 {
    font-size: 1.55rem;
  }
}

/* Log-Formulare (Behandlung, Fütterung, etc.) */
.page-log-form form,
.page-behandlung-form form,
.page-fuetterung-form form {
  display: grid;
  gap: 1.1rem;
}

.page-log-form input,
.page-log-form select,
.page-log-form textarea,
.page-behandlung-form input,
.page-behandlung-form select,
.page-behandlung-form textarea,
.page-fuetterung-form input,
.page-fuetterung-form select,
.page-fuetterung-form textarea {
  font: inherit;
  padding: .6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

.page-log-form textarea,
.page-behandlung-form textarea,
.page-fuetterung-form textarea {
  min-height: 90px;
}

.page-log-form button,
.page-behandlung-form button,
.page-fuetterung-form button {
  padding: .7rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .2s ease;
}

.page-log-form button:disabled,
.page-behandlung-form button:disabled,
.page-fuetterung-form button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

@media (max-width: 640px) {

  .page-log-form button,
  .page-behandlung-form button,
  .page-fuetterung-form button {
    width: 100%;
  }
}

/* Taube Formular */
.page-taube-form .brand {
  gap: .9rem;
  margin-bottom: 1.6rem;
}

.page-taube-form form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.1rem;
}

.page-taube-form label {
  font-size: .95rem;
}

.page-taube-form input,
.page-taube-form select,
.page-taube-form textarea {
  font: inherit;
  padding: .55rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.page-taube-form textarea {
  min-height: 90px;
}

.page-taube-form h2 {
  grid-column: 1/-1;
  margin-top: 1.3rem;
}

.page-taube-form .notice {
  grid-column: 1/-1;
  padding: .75rem 1rem;
  border-radius: 10px;
  border: 1px solid #f9c74f;
  background: #fff6de;
  color: #8a6d1a;
}

.page-taube-form .notice-error {
  border-color: #f2b8b5;
  background: #fdecea;
  color: #7d1212;
}

.page-taube-form button:not(.burger-menu) {
  grid-column: 1/-1;
  padding: .7rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .2s ease;
}

.page-taube-form button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.page-taube-form [data-field="alter_kategorie"].is-disabled {
  opacity: .6;
}

.page-taube-form [data-field="alter_kategorie"].is-disabled select {
  background: #f5f5f5;
  cursor: not-allowed;
}

@media (max-width:1000px) {
  .page-taube-form form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .page-taube-form .brand {
    margin-bottom: 1.4rem;
  }

  .page-taube-form .brand img {
    height: 50px;
  }
}

@media (max-width:760px) {
  .page-taube-form form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width:640px) {
  .page-taube-form form {
    grid-template-columns: 1fr;
  }

  .page-taube-form form>* {
    grid-column: 1/-1 !important;
  }

  /* .page-taube-form button{width:100%;} */
  .page-taube-form .brand img {
    height: 46px;
  }
}

@media (max-width:640px) {
  .page-taube-view header {
    gap: .85rem;
  }

  .page-taube-view .brand {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo photo"
      "summary photo";
    column-gap: .75rem;
    row-gap: .75rem;
    width: 100%;
    align-items: start;
  }

  .page-taube-view .brand-logo {
    grid-area: logo;
  }

  .page-taube-view .taube-summary {
    grid-area: summary;
  }

  .page-taube-view .taube-photo {
    grid-area: photo;
    margin: 0;
    justify-content: flex-end;
  }

  .page-taube-view .taube-photo img {
    width: 100%;
    max-width: 110px;
    aspect-ratio: 1/1;
    border-radius: 18px;
    object-fit: cover;
  }
}

/* Taube Detail */
.page-taube-view {
  color: #333;
}

.page-taube-view header {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  background: #fff;
  padding: clamp(1rem, 3vw, 1.6rem);
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
  max-width: min(100%, 680px);
  margin-left: auto;
  margin-right: auto;
}

.page-taube-view nav {
  width: 100%;
}

.page-taube-view .brand {
  gap: .9rem;
  align-items: flex-start;
}

.page-taube-view .brand img {
  height: 64px;
  width: auto;
}

.page-taube-view .taube-photo {
  display: flex;
  align-items: center;
  margin-right: 1rem;
}

.page-taube-view .taube-photo img {
  width: 100%;
  max-width: 140px;
  aspect-ratio: 1/1;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.page-taube-view .brand h1 {
  margin: .2rem 0 0;
}

.page-taube-view .sub {
  color: #666;
  font-weight: normal;
}

.page-taube-view a.link {
  color: var(--brand-color);
  text-decoration: none;
}

.taube-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}

.taube-actions--compact {
  justify-content: flex-start;
}

.btn-edit-compact {
  border-radius: 999px;
  padding: .5rem 1.2rem;
  font-weight: 600;
}

.btn-ghost {
  border-radius: 999px;
  padding: .45rem 1.4rem;
}

.actions-menu {
  position: relative;
}

.btn-menu {
  border-radius: 999px;
  padding: .45rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.actions-menu__panel {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  background: #fff;
  border: 1px solid #dbe8ef;
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .18);
  padding: .4rem;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  z-index: 20;
}

.actions-menu__panel[hidden] {
  display: none;
}

.btn-menu-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  border-radius: 10px;
  padding: .45rem .8rem;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  font-size: .95rem;
  font-weight: 600;
}

[data-actions-menu][data-open] .btn-menu {
  background: var(--brand-color-light);
  border-color: var(--brand-color);
  color: var(--brand-color-dark);
}

.btn-menu-item--danger {
  background: #ffecec;
  border-color: #f5b4b4;
  color: #c62828;
}

.btn-menu-item--danger:hover,
.btn-menu-item--danger:focus {
  background: #ffd4d4;
  border-color: #e68a8a;
  color: #a01414;
}

.taube-summary .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}

.taube-status-action {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.page-taube-view section {
  margin: 1.6rem 0;
  background: #fff;
  padding: clamp(1rem, 3vw, 1.6rem);
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
  max-width: min(100%, 680px);
  margin-left: auto;
  margin-right: auto;
}

.taube-chart-card {
  margin: 1.6rem auto;
  background: #fff;
  padding: clamp(1rem, 3vw, 1.6rem);
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
  max-width: min(100%, 680px);
}

.taube-chart-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.taube-chart-card__head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.taube-chart-card__range {
  margin: .15rem 0 0;
  color: #475569;
  font-size: .95rem;
}

.chart-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .9rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 600;
}

.chart-pill--critical {
  background: #fee2e2;
  border: 1px solid rgba(248, 113, 113, .6);
  color: #b91c1c;
}

.taube-chart {
  position: relative;
  margin-top: 1rem;
  border-radius: 18px;
  overflow: hidden;
  background: #f8fafc;
}

.taube-chart canvas {
  display: block;
  width: 100%;
  height: 260px;
}

.taube-chart__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
  color: #475569;
  background: rgba(255, 255, 255, .92);
  font-size: .95rem;
}

.taube-chart__empty[hidden] {
  display: none;
}

.taube-chart-legend {
  margin-top: 1rem;
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  color: #475569;
  font-size: .9rem;
}

.legend-swatch {
  display: inline-block;
  width: 16px;
  height: 10px;
  border-radius: 999px;
  margin-right: .35rem;
}

.legend-swatch--line {
  background: linear-gradient(90deg, #0ea5e9, #0369a1);
  height: 3px;
  margin-top: 4px;
}

.legend-swatch--critical {
  background: rgba(248, 113, 113, .35);
  border: 1px solid rgba(248, 113, 113, .6);
}

.page-taube-view .table-wrapper {
  border: 1px solid #eee;
}

.log-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .6rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 155, 180, .25);
}

.page-taube-view .table-wrapper table {
  min-width: 0;
  background: #fff;
}

.page-taube-view .table-wrapper th,
.page-taube-view .table-wrapper td {
  padding: .6rem;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.page-taube-view .table-wrapper tbody th {
  text-align: left;
}

.attachment-list {
  margin-top: .5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.attachment-link {
  font-size: .9rem;
  color: var(--brand-color);
  text-decoration: none;
}

.attachment-link:hover {
  text-decoration: underline;
}

.page-taube-view .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}

.page-taube-view .meta {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  color: #555;
}

.page-taube-view .tag {
  display: inline-block;
  padding: .15rem .5rem;
  border: 1px solid #aaa;
  border-radius: 999px;
  font-size: .82rem;
}


@media (max-width:700px) {
  .page-taube-view nav {
    width: 100%;
    justify-content: flex-start;
  }

  .page-taube-view .brand img {
    height: 52px;
  }
}

@media (min-width:720px) {
  .page-taube-view nav {
    width: auto;
    justify-content: flex-end;
  }
}

/* Pflegestellen */
.page-pflegestellen .brand {
  margin-bottom: 1.6rem;
}

.page-pflegestellen form {
  /* display:grid; */
  gap: 1.2rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-bottom: 2.2rem;
}

.page-pflegestellen label {
  font-size: .95rem;
  display: block;
}

.page-pflegestellen input,
.page-pflegestellen select {
  font: inherit;
  padding: .6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.page-pflegestellen .form-actions {
  grid-column: 1/-1;
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
  align-items: center;
}

.page-pflegestellen .btn,
.page-pflegestellen button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  font-weight: 600;
  padding: .55rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  min-width: 6.5rem;
}

.page-pflegestellen .btn-primary,
.page-pflegestellen button.btn-primary {
  box-shadow: 0 4px 12px rgba(0, 155, 180, .28);
}

.page-pflegestellen .info {
  grid-column: 1/-1;
  background: #eef3ff;
  color: #1f3d8f;
  padding: .75rem 1rem;
  border-radius: 10px;
}

.page-pflegestellen .errors {
  grid-column: 1/-1;
  background: #fceaea;
  color: #7d1212;
  padding: .75rem 1rem;
  border-radius: 10px;
}

.page-pflegestellen .table-wrapper {
  margin-top: 0;
}

.page-pflegestellen .table-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

/* Status Toggle Styling */
.page-pflegestellen .status-toggle {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
}

.page-pflegestellen .table-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.page-pflegestellen .table-actions form {
  /* display:inline-flex; */
  display: contents;
}

.page-pflegestellen .filters {
  display: flex;
  gap: .6rem;
  margin: 0;
  flex-wrap: nowrap;
  background: #fff;
  padding: .75rem .85rem;
  border-radius: 16px;
  border: 1px solid var(--neutral-300);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.page-pflegestellen .filters::-webkit-scrollbar {
  display: none;
}

.page-pflegestellen .filters a {
  padding: .45rem .95rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 155, 180, .35);
  text-decoration: none;
  color: var(--brand-color);
  font-weight: 600;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  flex: 0 0 auto;
  white-space: nowrap;
}

.page-pflegestellen .filters a.active {
  background: var(--brand-color);
  color: #fff;
  border-color: var(--brand-color);
}

.page-pflegestellen .filters a:hover,
.page-pflegestellen .filters a:focus {
  border-color: var(--brand-color);
  background: var(--brand-color-light);
}

.page-pflegestellen .filters a.active:hover,
.page-pflegestellen .filters a.active:focus {
  background: var(--brand-color-dark);
  border-color: var(--brand-color-dark);
  color: #fff;
}

.page-pflegestellen .table-wrapper table {
  min-width: 0;
}

@media (max-width:900px) {
  .page-pflegestellen form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .page-pflegestellen .brand img {
    height: 52px;
  }
}

/* Permissions Page */
.page-permissions .filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  margin: 0;
  background: #fff;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  border: 1px solid var(--neutral-300);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.page-permissions .filters::-webkit-scrollbar {
  display: none;
}

.page-permissions .filters a {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 155, 180, 0.35);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brand-color);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  flex: 0 0 auto;
  white-space: nowrap;
}

.page-permissions .filters a.active {
  background: var(--brand-color);
  border-color: var(--brand-color);
  color: #fff;
}

.page-permissions .filters a:hover,
.page-permissions .filters a:focus {
  border-color: var(--brand-color);
  background: var(--brand-color-light);
}

.page-permissions .filters a.active:hover,
.page-permissions .filters a.active:focus {
  background: var(--brand-color-dark);
  border-color: var(--brand-color-dark);
  color: #fff;
}

@media (max-width:640px) {
  .page-pflegestellen form {
    grid-template-columns: 1fr;
  }

  .page-pflegestellen form>* {
    grid-column: 1/-1 !important;
  }

  .page-pflegestellen .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-pflegestellen .btn,
  .page-pflegestellen button.btn {
    width: 100%;
    text-align: center;
  }

  .page-pflegestellen .brand {
    margin-bottom: 1.2rem;
  }

  .page-pflegestellen .brand img {
    height: 46px;
  }

  /* Mobile Status Toggle */
  .page-pflegestellen .status-toggle {
    padding: 0.5rem 0;
    margin-top: 0.25rem;
  }

  .page-pflegestellen .checkbox-label {
    padding: 0.4rem 0.6rem;
    width: 100%;
    justify-content: center;
  }

  /* Mobile horizontal scrollbar for Pflegestellen tables */
  .page-pflegestellen .table-wrapper {
    overflow-x: auto;
  }

  .page-pflegestellen .table-wrapper table {
    min-width: 600px;
  }
}

/* Einfache Formseiten (Behandlung/Fütterung) */
.page-simple-form .brand {
  margin-bottom: 1.5rem;
}

.page-simple-form .brand img {
  height: 56px;
  width: auto;
}

.page-simple-form form {
  display: grid;
  gap: .9rem;
}

.page-simple-form textarea,
.page-simple-form input,
.page-simple-form select {
  font: inherit;
  padding: .55rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.page-simple-form button:not(.burger-menu) {
  padding: .65rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
}

.page-simple-form .notice {
  padding: .75rem 1rem;
  border-radius: 10px;
  border: 1px solid #f9c74f;
  background: #fff6de;
  color: #8a6d1a;
  margin-bottom: 1rem;
}

.page-simple-form .notice-error {
  border-color: #f2b8b5;
  background: #fdecea;
  color: #7d1212;
}

@media (max-width:640px) {
  .page-simple-form button:not(.burger-menu) {
    width: 100%;
  }

  .page-simple-form .brand {
    margin-bottom: 1.2rem;
  }

  .page-simple-form .brand img {
    height: 46px;
  }
}

/* Passwortseiten */
.page-password-reset .brand {
  gap: .8rem;
  align-items: center;
}

.page-password-reset .brand h1 {
  font-size: 1.8rem;
}

.page-password-reset .brand img {
  height: 58px;
  width: auto;
}

.page-password-reset form {
  display: grid;
  gap: 1rem;
  margin-top: 1.6rem;
}

.page-password-reset label {
  font-size: .95rem;
}

.page-password-reset input,
.page-password-reset button {
  font: inherit;
  padding: .6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.page-password-reset button {
  cursor: pointer;
}

.page-password-reset .error {
  background: #fceaea;
  color: #7d1212;
  padding: .8rem 1rem;
  border-radius: 10px;
  margin-top: 1rem;
}

.page-password-reset .success {
  background: #e8f7ef;
  color: var(--brand-color);
  padding: .8rem 1rem;
  border-radius: 10px;
  margin-top: 1rem;
}

.page-password-reset .message {
  background: #eef3ff;
  color: #1f3d8f;
  padding: .8rem 1rem;
  border-radius: 10px;
  margin-top: 1rem;
}

@media (max-width:600px) {
  .page-password-reset .brand img {
    height: 46px;
  }

  .page-password-reset .brand h1 {
    font-size: 1.55rem;
  }
}

/* Changelog */
.page-changelog .timeline {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.6rem;
}

.page-changelog .entry {
  border: 1px solid #e3e7ef;
  border-radius: 12px;
  background: #fff;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .03);
}

.page-changelog .entry h2 {
  margin: .2rem 0;
  font-size: 1.4rem;
}

.page-changelog .entry time {
  font-size: .9rem;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.page-changelog .entry ul {
  margin: .8rem 0 0 1.2rem;
  padding: 0;
  display: grid;
  gap: .5rem;
}

@media (max-width:640px) {
  .page-changelog .entry {
    padding: 1rem 1.1rem;
  }

  .page-changelog .entry h2 {
    font-size: 1.25rem;
  }
}

/* Profil */
.page-profile form {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-top: 1.6rem;
}

.page-profile label {
  font-size: .95rem;
  display: block;
}

.page-profile input {
  font: inherit;
  padding: .55rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.page-profile h2 {
  grid-column: 1/-1;
  margin-top: 1.3rem;
}

.page-profile .grid-span-6 {
  grid-column: span 6;
}

.page-profile .notice {
  grid-column: 1/-1;
  padding: .75rem 1rem;
  border-radius: 10px;
}

.page-profile .notice-success {
  background: #e8f7ef;
  color: var(--brand-color);
}

.page-profile .notice-error {
  background: #fdecea;
  color: #7d1212;
}

.form-upload {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.form-upload label {
  font-weight: 600;
}

.form-upload input[type="file"] {
  padding: .35rem 0;
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.upload-preview__image {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

.upload-remove {
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.upload-remove input {
  margin-right: .3rem;
}

/* Burger Menu */
.burger-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  padding: 0;
  background: rgba(255, 255, 255, 1) !important;
  border: 2px solid #007cba !important;
  border-radius: 0 0 8px 0;
  z-index: 1001 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.burger-menu:hover {
  background: rgba(255, 255, 255, 1);
  border-color: #005a87;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.burger-menu span {
  display: block !important;
  width: 25px;
  height: 3px;
  background-color: #007cba !important;
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.burger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
  padding-top: 60px;
}

.mobile-nav.active {
  left: 0;
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 280px;
  width: calc(100% - 280px);
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-content {
  padding: 20px;
}

.mobile-nav-content .btn {
  display: block !important;
  width: 100%;
  margin-bottom: 10px;
  text-align: left;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-300);
  color: var(--text-secondary);
  font-weight: normal !important;
  transition: all 0.2s ease;
}

.mobile-nav-content .btn:hover {
  background: var(--brand-color-light);
  border-color: var(--brand-color);
}

.mobile-nav-content .btn.btn-primary {
  background: var(--brand-color);
  color: #fff;
  border-color: var(--brand-color);
}

.mobile-nav-content .btn.btn-primary:hover {
  background: var(--brand-color-dark);
  border-color: var(--brand-color-dark);
}

.mobile-nav-content .btn.btn-outline {
  background: transparent;
  border-color: var(--brand-color);
  color: var(--brand-color);
}

.mobile-nav-content .btn.btn-outline:hover {
  background: var(--brand-color);
  color: #fff;
}

.mobile-nav-header {
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 20px;
}

.mobile-nav-header h3 {
  margin: 0;
  color: #495057;
  font-size: 1.1rem;
}

/* Upload Spinner Animation */
.upload-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.upload-button-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.upload-button-loading .upload-spinner {
  display: inline-block !important;
}

.page-profile button:not(.burger-menu) {
  grid-column: 1/-1;
  padding: .7rem 1rem;
  border-radius: 10px;
  cursor: pointer;
}

@media (max-width:760px) {
  .page-profile form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .page-profile .grid-span-6 {
    grid-column: span 6;
  }
}

@media (max-width:640px) {
  .page-profile form {
    grid-template-columns: 1fr;
  }

  .page-profile form>* {
    grid-column: 1/-1 !important;
  }

  /* .page-profile button{width:100%;} */
}

/* Navigation - Always use burger menu */
header nav {
  display: none;
}

.mobile-nav {
  display: block;
}

.mobile-nav-overlay {
  display: block;
}

/* Benutzerverwaltung */
.page-users .brand {
  margin-bottom: 1.6rem;
}

.page-users form {
  /* display:grid; */
  gap: 1.2rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  /* margin-bottom:2.6rem; */
}

.page-users label {
  font-size: .95rem;
  display: block;
}

.page-users input,
.page-users select {
  font: inherit;
  padding: .6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.page-users .form-actions {
  grid-column: 1/-1;
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
  align-items: center;
}

.page-users .btn:not(.mobile-nav-content),
.page-users button.btn:not(.mobile-nav-content) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  font-size: 1rem;
  font-weight: 600;
  padding: .55rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  white-space: nowrap;
}

.page-users .btn-primary,
.page-users button.btn-primary {
  box-shadow: 0 4px 12px rgba(0, 155, 180, .28);
}

.page-users .errors {
  grid-column: 1/-1;
  background: #fceaea;
  color: #7d1212;
  padding: .7rem 1rem;
  border-radius: 10px;
}

.page-users .message {
  grid-column: 1/-1;
  background: #e8f7ef;
  color: var(--brand-color);
  padding: .7rem 1rem;
  border-radius: 10px;
}

.page-users .info {
  grid-column: 1/-1;
  background: #eef3ff;
  color: #1f3d8f;
  padding: .7rem 1rem;
  border-radius: 10px;
}

.page-users .table-wrapper table {
  min-width: 0;
}

/* Actions in Users table: keep emoji buttons in a single row on mobile */
@media (max-width: 768px) {
  .page-users .table-actions {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  .page-users .table-wrapper td.table-actions .btn,
  .page-users .table-wrapper td.table-actions button,
  .page-users .table-wrapper td.table-actions form {
    width: auto;
  }

  .page-users .table-actions form {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
  }

  /* Override the mobile table layout to keep action buttons inline and round */
  .page-users .table-wrapper:not(.table-wrapper--static) td.table-actions {
    display: flex;
    grid-template-columns: none;
    gap: 0.4rem;
    align-items: center;
  }

  .page-users .table-wrapper:not(.table-wrapper--static) td.table-actions::before {
    margin-bottom: 0.2rem;
  }

  .page-users .table-wrapper:not(.table-wrapper--static) td.table-actions form {
    width: auto;
    display: inline-flex;
  }
}


.page-users .form-hint {
  grid-column: span 12;
  background: #f7fdf9;
  color: var(--brand-color);
  padding: .7rem 1rem;
  border-radius: 10px;
  font-size: .92rem;
}

@media (max-width:900px) {
  .page-users form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .page-users .brand img {
    height: 52px;
  }
}

@media (max-width:640px) {
  .page-users form {
    grid-template-columns: 1fr;
  }

  .page-users form>* {
    grid-column: 1/-1 !important;
  }

  .page-users .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-users button.btn,
  .page-users .btn {
    width: 100%;
    text-align: center;
  }

  .page-users .brand {
    margin-bottom: 1.2rem;
  }

  .page-users .brand img {
    height: 46px;
  }

  /* Mobile horizontal scrollbar for Users tables */
  .page-users .table-wrapper {
    overflow-x: auto;
  }

  .page-users .table-wrapper table {
    min-width: 600px;
  }
}

.btn,
button.btn,
a.btn {
  border: 1px solid var(--brand-color);
  color: var(--brand-color);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}

.btn:hover,
.btn:focus,
button.btn:hover,
button.btn:focus,
a.btn:hover,
a.btn:focus {
  background: var(--brand-color-light);
  border-color: var(--brand-color-dark);
  color: var(--brand-color-dark);
}

.btn-primary,
button.btn-primary,
a.btn-primary {
  background: var(--brand-color);
  border-color: var(--brand-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 155, 180, 0.28);
}

.btn-primary:hover,
.btn-primary:focus,
button.btn-primary:hover,
button.btn-primary:focus,
a.btn-primary:hover,
a.btn-primary:focus {
  background: var(--brand-color-dark);
  border-color: var(--brand-color-dark);
  color: #fff;
}

.btn-outline,
button.btn-outline,
a.btn-outline {
  background: #fff;
  color: var(--brand-color);
  border-color: rgba(0, 155, 180, 0.5);
}

.btn-outline:hover,
.btn-outline:focus,
button.btn-outline:hover,
button.btn-outline:focus,
a.btn-outline:hover,
a.btn-outline:focus {
  background: var(--brand-color-light);
  border-color: var(--brand-color);
  color: var(--brand-color-dark);
}

/* Global Checkbox Styling */
.checkbox-label,
label.checkbox-field,
label:has(> input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--neutral-300);
  background: var(--neutral-50);
  color: #0f172a;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.checkbox-label:hover,
label.checkbox-field:hover,
label:has(> input[type="checkbox"]):hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.12);
}

.checkbox-label:focus-within,
label.checkbox-field:focus-within,
label:has(> input[type="checkbox"]):focus-within {
  outline: 2px solid var(--brand-color-light);
  outline-offset: 2px;
}

.checkbox-label>input[type="checkbox"],
label.checkbox-field>input[type="checkbox"],
label:has(> input[type="checkbox"])>input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-items: center;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  margin: 0;
  padding: 0;
}

.checkbox-label>input[type="checkbox"]:checked,
label.checkbox-field>input[type="checkbox"]:checked,
label:has(> input[type="checkbox"])>input[type="checkbox"]:checked {
  background: var(--brand-color);
  border-color: var(--brand-color);
  box-shadow: 0 4px 10px rgba(0, 155, 180, 0.3);
}

.checkbox-label>input[type="checkbox"]:checked::after,
label.checkbox-field>input[type="checkbox"]:checked::after,
label:has(> input[type="checkbox"])>input[type="checkbox"]:checked::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.checkbox-label>input[type="checkbox"]:disabled,
label.checkbox-field>input[type="checkbox"]:disabled,
label:has(> input[type="checkbox"])>input[type="checkbox"]:disabled {
  border-color: #cbd5f5;
  background: var(--neutral-300);
  cursor: not-allowed;
}

.checkbox-label .checkbox-text,
label.checkbox-field .checkbox-text,
label:has(> input[type="checkbox"]) .checkbox-text {
  font-size: 0.95rem;
  color: #0f172a;
  user-select: none;
}

button,
input[type="submit"],
input[type="button"] {
  background: var(--brand-color);
  border: 1px solid var(--brand-color);
  color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus,
input[type="button"]:hover,
input[type="button"]:focus {
  background: var(--brand-color-dark);
  border-color: var(--brand-color-dark);
}

/* Mentoring-System Styles */
.page-mentoring {
  background: linear-gradient(180deg, #f5f9fc 0%, #f1f5f9 100%);
}

.page-mentoring .brand {
  margin-bottom: 1.6rem;
}

.page-mentoring form {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-bottom: 2.2rem;
}

.page-mentoring label {
  font-size: 0.95rem;
  display: block;
}

.page-mentoring input,
.page-mentoring select,
.page-mentoring textarea {
  font: inherit;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.page-mentoring textarea {
  min-height: 90px;
}

.page-mentoring .form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.page-mentoring .btn:not(.mobile-nav),
.page-mentoring button.btn:not(.mobile-nav) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  min-width: 6.5rem;
}

.page-mentoring .btn-primary,
.page-mentoring button.btn-primary {
  box-shadow: 0 4px 12px rgba(0, 155, 180, 0.28);
}

.page-mentoring .info {
  grid-column: 1 / -1;
  background: #eef3ff;
  color: #1f3d8f;
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.page-mentoring .errors {
  grid-column: 1 / -1;
  background: #fceaea;
  color: #7d1212;
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.page-mentoring .table-wrapper {
  margin-top: 0;
}

@media (max-width: 900px) {
  .page-mentoring form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .page-mentoring .brand img {
    height: 52px;
  }
}

@media (max-width: 640px) {
  .page-mentoring form {
    grid-template-columns: 1fr;
  }

  .page-mentoring form>* {
    grid-column: 1 / -1 !important;
  }

  .page-mentoring .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-mentoring .btn,
  .page-mentoring button.btn {
    width: 100%;
    text-align: center;
  }

  .page-mentoring .brand {
    margin-bottom: 1.2rem;
  }

  .page-mentoring .brand img {
    height: 46px;
  }
}

.permission-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.permission-read {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.permission-write {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.permission-mentor {
  background: #ede9fe;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

.permission-normal {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.permission-tier {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.text-danger {
  color: #dc2626;
}

.text-warning {
  color: #d97706;
}

.text-muted {
  color: #6b7280;
}

/* Future log entries styling */
.log-entry-future {
  opacity: 0.6;
  background-color: #f8fafc !important;
}

.log-entry-future td {
  color: #6b7280;
}

.log-entry-future .log-header-mobile {
  opacity: 0.8;
}

.log-entry-future .log-note {
  background-color: #f1f5f9 !important;
  border-left-color: #cbd5e1 !important;
}

.log-entry-future .log-meta {
  opacity: 0.8;
}

.log-entry-future .attachment-list {
  opacity: 0.8;
}

.page-dashboard .filters,
.page-pflegestellen .filters,
.page-permissions .filters {
  background: #fff;
  border: 1px solid var(--neutral-300);
}

/* Collapsible sections */
.collapsible-section {
  position: relative;
}

.collapsible-section h2 {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 2rem;
  transition: color 0.2s ease;
  margin: 0;
}

.collapsible-section h2:hover {
  color: var(--brand-color);
}

.collapsible-toggle {
  position: absolute;
  right: 0;
  top: 0;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--brand-color);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background-color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
}

.collapsible-toggle:hover {
  background-color: var(--brand-color-light);
}

.collapsible-toggle:focus {
  outline: 2px solid var(--brand-color);
  outline-offset: 2px;
}

.collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
  /* max-height: 1000px; */
  opacity: 1;
}

.collapsible-section.collapsed .collapsible-content {
  max-height: 0;
  opacity: 0;
}

.collapsible-toggle::before {
  content: '▼';
  transition: transform 0.2s ease;
}

.collapsible-section:not(.collapsed) .collapsible-toggle::before {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Logging Dashboard */
.page-logging-dashboard .brand {
  margin-bottom: 1.6rem;
}

.page-logging-dashboard .table-wrapper {
  margin-top: 0;
}

/* Activity type styling for logging dashboard */
.page-logging-dashboard .activity-type {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.page-logging-dashboard .activity-type.login_success {
  background: #d4edda;
  color: #155724;
}

.page-logging-dashboard .activity-type.login_failed {
  background: #f8d7da;
  color: #721c24;
}

.page-logging-dashboard .activity-type.log_entry_created {
  background: #d1ecf1;
  color: #0c5460;
}

.page-logging-dashboard .activity-type.user_created {
  background: #fff3cd;
  color: #856404;
}

.page-logging-dashboard .activity-type.user_updated {
  background: #e2e3e5;
  color: #383d41;
}

@media (max-width: 640px) {

  /* Mobile horizontal scrollbar for Logging Dashboard tables */
  .page-logging-dashboard .table-wrapper {
    overflow-x: auto;
  }

  .page-logging-dashboard .table-wrapper table {
    min-width: 800px;
  }
}

/* Pflegestellen-Tabelle horizontaler Scroll */
.page-pflegestellen .table-wrapper {
  overflow-x: auto;
}

.page-pflegestellen .table-wrapper table {
  min-width: 1000px;
}

/* Sortable Table Styles */
.sortable-header {
  position: relative;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.sortable-header:hover {
  background-color: var(--brand-color-light);
}

.sort-indicator {
  font-size: 0.8em;
  margin-left: 0.25rem;
  opacity: 0.5;
  user-select: none;
}

.sortable-header[data-sort-direction="asc"] .sort-indicator,
.sortable-header[data-sort-direction="desc"] .sort-indicator {
  opacity: 1;
}

/* Table Search Styles */
.table-search {
  margin-bottom: 1rem;
}

.table-search-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.table-search-input:focus {
  outline: none;
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-light);
}

/* Label Styles */
.label-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.4rem;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  background: #fff;
  min-height: 38px;
  position: relative;
}

.label-input-container:focus-within {
  border-color: var(--brand-color);
  box-shadow: 0 0 0 3px var(--brand-color-light);
}

.label-tag {
  background: var(--brand-color-light);
  color: var(--brand-color-dark);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.label-tag-remove {
  cursor: pointer;
  font-weight: bold;
  opacity: 0.6;
}

.label-tag-remove:hover {
  opacity: 1;
  /* color: #ef4444; Removed as requested */
}

.label-input-field {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0.1rem !important;
  min-width: 60px;
  flex-grow: 1;
  background: transparent;
  font-size: 0.95rem;
}

.label-input-field:focus {
  box-shadow: none !important;
}

.label-autocomplete-wrapper {
  position: relative;
  flex-grow: 1;
}

.label-autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.label-autocomplete-list.active {
  display: block;
}

.label-autocomplete-item {
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-autocomplete-item:hover {
  background: var(--neutral-100);
}

.label-autocomplete-item small {
  color: #64748b;
  background: #e2e8f0;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
}