@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: var(--bg-alt-row);
  border: 2px solid var(--border-color);
  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);
}

/* Placeholder is now styled exactly like a real photo */

/* 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;
  }

  /* Placeholder image responsive styles removed */
}

: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;

  /* Border Radius */
  --border-radius-lg: 18px;
  --border-radius-md: 8px;
  
  /* Semantic Variables - Light Mode Default */
  --bg-body-start: var(--neutral-75);
  --bg-body-end: var(--neutral-100);
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text-heading: #000000;
  --border-color: var(--neutral-300);
  --border-color-light: var(--neutral-200);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 10px 26px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 4px 8px rgba(0, 0, 0, 0.1);
  --bg-active-filter: #ffffff;
  --bg-alt-row: #f8fafc;
  --bg-archived-row: #dfe2e7;
  --text-archived-row: #4b5563;
  --bg-notice-info: #e0f2fe;
  --text-notice-info: #0369a1;
  --bg-notice-warn: #fff6de;
  --text-notice-warn: #8a6d1a;
  --border-notice-warn: #f9c74f;
  --bg-mobile-bar-value: rgba(255, 255, 255, 0.92);
  --bg-chart-empty: rgba(255, 255, 255, 0.92);
  --bg-pill-critical: #fee2e2;
  --border-pill-critical: rgba(248, 113, 113, 0.6);
  --text-pill-critical: #b91c1c;
  --bg-critical-row: #fde9b5;
  --text-critical-row: #7a2e0b;
  --bg-critical-row-hover: #fcd975;
  --bg-verstorben-row: #fcd5d5;
  --text-verstorben-row: #7f1d1d;
  --bg-verstorben-row-hover: #f8bebe;
}

/* Dark Mode Overrides */
.dark-mode {
  --neutral-50: #1e293b;
  --neutral-75: #0f172a;
  --neutral-100: #020617;
  --neutral-200: #1e293b;
  --neutral-300: #334155;
  --neutral-400: #475569;
  
  --bg-body-start: #0f172a;
  --bg-body-end: #020617;
  --bg-card: #1e293b;
  --bg-input: #0f172a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-heading: #f8fafc;
  --border-color: #334155;
  --border-color-light: #1e293b;
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 4px 8px rgba(0, 0, 0, 0.2);
  --bg-active-filter: #334155;
  --bg-alt-row: #1e293b;
  --bg-archived-row: #334155;
  --text-archived-row: #94a3b8;
  
  --brand-color-dark: #00b8d4;
  --brand-color-light: rgba(0, 155, 180, 0.2);
  
  --bg-notice-info: #075985;
  --text-notice-info: #e0f2fe;
  --bg-notice-warn: #422006;
  --text-notice-warn: #fef3c7;
  --border-notice-warn: #78350f;
  --bg-mobile-bar-value: rgba(15, 23, 42, 0.92);
  --bg-chart-empty: rgba(30, 41, 59, 0.92);
  --bg-pill-critical: rgba(239, 68, 68, 0.15);
  --border-pill-critical: rgba(239, 68, 68, 0.4);
  --text-pill-critical: #fca5a5;
  --bg-critical-row: #422006;
  --text-critical-row: #fef3c7;
  --bg-critical-row-hover: #5f3007;
  --bg-verstorben-row: #4c0519;
  --text-verstorben-row: #fecdd3;
  --bg-verstorben-row-hover: #881337;
}

*,
*::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(--bg-body-start) 0%, var(--bg-body-end) 100%);
  /* line-height: 1.55; */
  padding: clamp(1rem, 4vw, 2.4rem) clamp(1rem, 5vw, 3rem);
}

body>*:not(.burger-menu, .mobile-nav, .mobile-nav-overlay) {
  /* width: 100%; */
  max-width: min(100%, 960px);
  margin-left: auto;
  margin-right: auto;
}

body>*:not(.burger-menu, .mobile-nav, .mobile-nav-overlay)+*:not(.burger-menu, .mobile-nav, .mobile-nav-overlay) {
  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: var(--bg-card);
  border-radius: 20px;
  padding: clamp(1rem, 3vw, 1.6rem);
  box-shadow: var(--shadow-lg);
}

body>.brand {
  background: var(--bg-card);
  padding: clamp(0.9rem, 2.5vw, 1.4rem);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

h1,
h2,
h3 {
  font-family: 'Jost', 'Roboto', sans-serif;
  color: var(--text-heading);
}

.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: inline-flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-start;
}

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

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid rgba(0, 155, 180, 0.35);
  background: var(--bg-card);
  color: var(--brand-color);
  font-size: 0.95rem;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}

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

.btn-icon--success {
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.35);
}
.btn-icon--success:hover,
.btn-icon--success:focus {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #16a34a !important;
}

.btn-icon--warning {
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.35);
}
.btn-icon--warning:hover,
.btn-icon--warning:focus {
  background: #fef3c7 !important;
  border-color: #d97706 !important;
  color: #d97706 !important;
}

.btn-icon--danger {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.35);
}
.btn-icon--danger:hover,
.btn-icon--danger:focus {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #dc2626 !important;
}

/* Unified 32px Status Icon Badges */
.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-sizing: border-box;
}

.status-icon--success {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.35);
}

.status-icon--open {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

/* Inline Status Icon Badges for Mobile View */
.status-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-sizing: border-box;
  vertical-align: middle;
  margin-left: 4px;
}

.status-icon-inline--success {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.35);
}

.status-icon-inline--open {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.dark-mode .status-icon-inline--success {
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.dark-mode .status-icon-inline--open {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* Dark Mode Overrides for 32px status icons */
.dark-mode .status-icon--success {
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
}

.dark-mode .status-icon--open {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.4);
}

@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: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  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(--border-color-light);
  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.col-details .log-header-mobile,
.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.col-details .log-header-mobile,
.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: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  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(--border-color-light);
  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#stammdaten .table-wrapper table {
  display: table !important;
  width: 100%;
}

.page-taube-view section#stammdaten .table-wrapper tbody {
  display: table-row-group !important;
}

.page-taube-view section#stammdaten .table-wrapper tbody tr {
  display: table-row !important;
}

.page-taube-view section#stammdaten .table-wrapper tbody th,
.page-taube-view section#stammdaten .table-wrapper tbody td {
  display: table-cell !important;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-color-light);
  vertical-align: top;
  text-align: left;
}

.page-taube-view section#stammdaten .table-wrapper tbody th,
.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(--border-color-light);
}

.page-taube-view section#stammdaten .table-wrapper tbody td,
.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;
    background: transparent !important;
  }

  .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 var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
  }

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

  /* 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.col-date,
  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td.col-category,
  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td.col-status {
    display: none !important;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td.col-details {
    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.col-details .log-header-mobile {
    font-weight: 600 !important;
    color: var(--text-secondary) !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.col-details .log-header-mobile strong {
    color: var(--text-secondary) !important;
  }

  .page-taube-view section#log .table-wrapper:not(.table-wrapper--static) tbody tr td.col-details .log-note {
    margin-top: 0.5rem !important;
    padding: 0.5rem !important;
    background: var(--bg-alt-row) !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 var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
  }

  .page-dashboard section .table-wrapper tbody tr.archived {
    background: var(--bg-alt-row);
  }

  /* Spezielle Behandlung für Todo-Liste: Alle Spalten außer Details zusammenfassen */
  .page-dashboard section .table-wrapper tbody tr td.col-date,
  .page-dashboard section .table-wrapper tbody tr td.col-taube,
  .page-dashboard section .table-wrapper tbody tr td.col-category,
  .page-dashboard section .table-wrapper tbody tr td.col-status {
    display: none !important;
  }

  .page-dashboard section .table-wrapper tbody tr td.col-details {
    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.col-details .log-header-mobile {
    font-weight: 600 !important;
    color: var(--text-secondary) !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.col-details .log-header-mobile strong {
    color: var(--text-secondary) !important;
  }

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

  .page-dashboard section .table-wrapper tbody tr td.col-details .log-header-mobile a:hover {
    text-decoration: underline !important;
  }

  .page-dashboard section .table-wrapper tbody tr td.col-details .log-note {
    margin-top: 0.5rem !important;
    padding: 0.5rem !important;
    background: var(--bg-alt-row) !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.col-details .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.col-actions {
    display: block !important;
    border: none !important;
    padding: 0 !important;
    margin-top: 0.5rem !important;
  }

  .page-dashboard section .table-wrapper tbody tr td.col-actions .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.col-actions .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.col-actions {
    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.col-actions .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.col-actions .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 ohne horizontales Scrollen */
  .page-taube-view section#stammdaten .table-wrapper,
  .page-taube-view section:first-of-type .table-wrapper {
    overflow-x: hidden;
  }

  .page-taube-view section#stammdaten .table-wrapper table,
  .page-taube-view section:first-of-type .table-wrapper table {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: fixed;
  }

  .page-taube-view section#stammdaten .table-wrapper tbody th,
  .page-taube-view section:first-of-type .table-wrapper tbody th {
    width: 35%;
    word-break: break-word;
    hyphens: auto;
  }

  .page-taube-view section#stammdaten .table-wrapper tbody td,
  .page-taube-view section:first-of-type .table-wrapper tbody td {
    width: 65%;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .page-taube-view section#stammdaten .injury-schema-wrapper {
    max-width: 220px;
    width: 100%;
    height: fit-content;
    margin: 0.25rem 0;
  }
}

@media (max-width: 540px) {
  .page-taube-view section#stammdaten .table-wrapper tbody th,
  .page-taube-view section:first-of-type .table-wrapper tbody th {
    width: 38%;
  }

  .page-taube-view section#stammdaten .table-wrapper tbody td,
  .page-taube-view section:first-of-type .table-wrapper tbody td {
    width: 62%;
  }

  .page-taube-view section#stammdaten .injury-schema-wrapper {
    max-width: 160px;
    height: fit-content;
  }
}

@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: var(--bg-card);
  padding: clamp(1rem, 3vw, 1.7rem);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.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: var(--text-secondary);
  font-weight: 600;
}

.page-dashboard .pflegestelle-stats__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-heading);
  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, var(--bg-card) 0%, var(--bg-body-start) 100%);
  border: 1px solid rgba(0, 155, 180, 0.1);
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: var(--shadow-md);
  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: var(--text-heading);
  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), var(--neutral-300) 0 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: var(--bg-card);
}

.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: var(--text-heading);
}

.stat-donut__inner small {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.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: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid rgba(0, 155, 180, 0.16);
  border-radius: 12px;
  padding: 0.5rem 0.65rem;
  box-shadow: var(--shadow-lg);
  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: var(--text-heading);
  margin-top: 0.25rem;
}

.legend-sub {
  color: var(--text-secondary);
}

.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: var(--text-heading);
}

.mobile-bar__rail {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: var(--neutral-300);
  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: var(--neutral-300);
}

.mobile-bar__segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-heading);
  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: var(--bg-mobile-bar-value);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-heading);
  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: var(--bg-card);
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  border: 1px solid var(--neutral-300);
  box-shadow: var(--shadow-lg);
  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(--border-color);
  border-radius: 8px;
  min-width: 12rem;
  font: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
}

.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 var(--border-color);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--text-primary);
}

.page-dashboard .active-filter {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.92rem;
  background: var(--bg-card);
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--neutral-300);
  box-shadow: var(--shadow-lg);
}

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

.page-dashboard tr.archived {
  background: var(--bg-archived-row);
  color: var(--text-archived-row);
}

.page-dashboard tr.critical {
  background: var(--bg-critical-row);
  color: var(--text-critical-row);
}

.page-dashboard tr.critical:hover {
  background: var(--bg-critical-row-hover);
}

.page-dashboard tr.verstorben {
  background: var(--bg-verstorben-row);
  color: var(--text-verstorben-row);
}

.page-dashboard tr.verstorben:hover {
  background: var(--bg-verstorben-row-hover);
}

@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;
  background: var(--bg-card);
}

.page-login input,
.page-login button,
.page-login select,
.page-login textarea {
  font: inherit;
  padding: .6rem;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  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 var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  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 var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  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 var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  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 var(--border-notice-warn);
  background: var(--bg-notice-warn);
  color: var(--text-notice-warn);
}

.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;
  }
}

/* Form Section Accordions */
.form-section {
  grid-column: 1 / -1;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.form-section h2 {
  margin-top: 0 !important;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--neutral-200);
  margin-bottom: 1rem;
}

.form-section .collapsible-content {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.1rem;
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}

.form-section:not(.collapsed) .collapsible-content {
  overflow: visible;
}

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

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

@media (max-width: 640px) {
  .form-section .collapsible-content {
    grid-template-columns: 1fr;
  }
  .form-section .collapsible-content > * {
    grid-column: 1 / -1 !important;
  }
}

/* Gender Toggle Buttons */
.gender-toggle {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
  width: 100%;
}

.btn-gender {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--neutral-300);
  background: var(--bg-card);
  border-radius: 8px;
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
  text-align: center;
}

.btn-gender:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-400);
}

.btn-gender.active {
  background: var(--brand-color-light);
  border-color: var(--brand-color);
  color: var(--brand-color-dark);
  font-weight: 600;
}

@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: var(--text-primary);
}

.page-taube-view header {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: clamp(1rem, 3vw, 1.6rem);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  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-logo 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: var(--text-secondary);
  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: var(--bg-card);
  border: 1px solid #dbe8ef;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  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 auto;
  max-width: min(100%, 680px);
}

.taube-chart-card {
  margin: 1.6rem auto;
  background: var(--bg-card);
  padding: clamp(1rem, 3vw, 1.6rem);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  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: var(--text-secondary);
  font-size: .95rem;
}

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

.chart-pill--critical {
  background: var(--bg-pill-critical);
  border: 1px solid var(--border-pill-critical);
  color: var(--text-pill-critical);
}

.taube-chart {
  position: relative;
  margin-top: 1rem;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-card);
}

.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: var(--text-secondary);
  background: var(--bg-chart-empty);
  font-size: .95rem;
}

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

.taube-chart-legend {
  margin-top: 1rem;
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  color: var(--text-secondary);
  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: var(--bg-card);
}

.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: var(--text-secondary);
}

.page-taube-view .tag {
  display: inline-block;
  padding: .15rem .5rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--text-primary);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.page-taube-view a.tag {
  text-decoration: none;
  cursor: pointer;
}

.page-taube-view a.tag:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}


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

  .page-taube-view .brand-logo 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 var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  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: var(--bg-card);
  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 input,
.page-permissions select,
.page-permissions textarea {
  font: inherit;
  padding: .6rem;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  border-radius: 8px;
  width: 100%;
}

.page-permissions .filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  margin: 0;
  background: var(--bg-card);
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  border: 1px solid var(--neutral-300);
  box-shadow: var(--shadow-lg);
  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;
}

/* Permissions Page Layout */
body.page-permissions>*:not(.burger-menu, .mobile-nav, .mobile-nav-overlay) {
  max-width: min(100%, 1200px);
}

/* Permissions Table & Sticky Header */
.page-permissions .table-wrapper {
  overflow: visible;
  position: relative;
}

.page-permissions .table-wrapper table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.page-permissions .table-wrapper th,
.page-permissions .table-wrapper td {
  padding: 0.7rem 0.65rem;
  font-size: 0.9rem;
}

.page-permissions .table-wrapper thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  font-size: 0.75rem;
  padding: 0.75rem 0.65rem;
  white-space: nowrap;
}

.page-permissions .table-wrapper th.col-actions,
.page-permissions .table-wrapper th:last-child {
  text-align: right;
  width: 90px;
  white-space: nowrap;
  padding-right: 1.1rem;
}

.page-permissions .table-wrapper td.col-actions {
  text-align: right;
  width: 90px;
  white-space: nowrap;
  padding-right: 1.1rem;
  vertical-align: middle;
}

.page-permissions .table-actions {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}

.page-permissions .table-actions form {
  display: inline-flex;
  margin: 0;
}

.page-permissions .th-compact {
  display: none;
}

.page-permissions .permission-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.page-permissions .permission-badge .badge-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.page-permissions .permission-badge .badge-text {
  line-height: 1.2;
}

.page-permissions .table-group-row td {
  background: var(--neutral-100, #f1f5f9);
  border-top: 2px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
}

.page-permissions .table-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.page-permissions .table-group-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.page-permissions .table-group-icon {
  font-size: 1.25rem;
}

.page-permissions .table-group-owner {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 0.4rem;
}

.page-permissions .table-group-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.page-permissions .badge-count {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.page-permissions .table-group-row--tier td {
  background: var(--brand-color-light, rgba(0, 155, 180, 0.08));
}

.page-permissions .meta-date {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

@media (max-width: 768px) {
  .page-permissions .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-permissions .table-wrapper th,
  .page-permissions .table-wrapper td {
    padding: 0.5rem 0.4rem;
    font-size: 0.82rem;
  }

  .page-permissions .table-wrapper thead th {
    padding: 0.55rem 0.4rem;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
  }

  .page-permissions .th-full {
    display: none;
  }

  .page-permissions .th-compact {
    display: inline;
  }

  /* Kompakte runde Icon-Chips auf Mobilgeräten */
  .page-permissions .permission-badge {
    padding: 0;
    width: 26px;
    height: 26px;
    min-width: 26px;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
    gap: 0;
  }

  .page-permissions .permission-badge .badge-icon {
    font-size: 0.85rem;
    line-height: 1;
  }

  .page-permissions .permission-badge .badge-text {
    display: none;
  }

  .page-permissions td[data-label="Rolle / Typ"],
  .page-permissions td[data-label="Berechtigung"] {
    text-align: center;
    width: 34px;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }

  .page-permissions th.col-actions,
  .page-permissions th:last-child,
  .page-permissions td.col-actions {
    text-align: center;
    width: auto;
    padding-right: 0.4rem;
  }

  .page-permissions .table-actions {
    flex-direction: row !important;
    justify-content: center !important;
  }

  .page-permissions .table-actions form {
    flex-direction: row !important;
  }

  .page-permissions .table-actions .btn-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    flex: 0 0 28px;
    font-size: 0.85rem;
  }

  .page-permissions .table-group-row td {
    padding: 0.55rem 0.5rem;
  }

  .page-permissions .table-group-title {
    font-size: 0.9rem;
    gap: 0.4rem;
  }

  .page-permissions .badge-count {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
  }

  .page-permissions .meta-date {
    font-size: 0.72rem;
  }
}

@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;
  }
}

/* App Tabs */
.app-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0 1rem;
  border-bottom: 2px solid var(--neutral-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  scroll-snap-type: x mandatory;
}

.app-tabs::-webkit-scrollbar {
  display: none;
}

.page-taube-view .app-tabs {
  max-width: min(100%, 680px);
  margin-left: auto;
  margin-right: auto;
}

.app-tab {
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: var(--neutral-100, #f1f5f9);
  color: var(--text-secondary, var(--neutral-600, #475569));
  cursor: pointer;
  font-size: 0.98rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: -2px;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 8px 8px 0 0;
  scroll-snap-align: start;
  user-select: none;
}

.app-tab:hover {
  background: var(--brand-color-light, #e0f2fe);
  color: var(--brand-color, #0284c7);
}

.app-tab.active {
  background: var(--brand-color, #0284c7);
  color: #ffffff;
  font-weight: 700;
  border-color: var(--brand-color, #0284c7);
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08);
}

.app-tab:focus-visible {
  outline: 2px solid var(--brand-color, #0284c7);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.app-tab .badge {
  background: var(--border-color-light);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.app-tab .badge-red {
  background: #ef4444;
  color: white;
}

.app-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.app-tab-content.active {
  display: block;
}

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

/* 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 var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  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 var(--border-notice-warn);
  background: var(--bg-notice-warn);
  color: var(--text-notice-warn);
  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 var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  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: var(--bg-card);
  padding: 1.2rem 1.4rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .03);
  scroll-margin-top: 1rem;
}

.page-changelog .entry h2 {
  margin: .2rem 0;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.page-changelog .anchor-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.5;
  transition: opacity 0.2s;
  cursor: pointer;
  user-select: none;
}

.page-changelog .entry h2:hover .anchor-link {
  opacity: 1;
}

.page-changelog .anchor-link:hover {
  color: var(--brand-color);
}

@media (max-width: 600px) {
  .page-changelog .anchor-link {
    opacity: 0.5;
  }
}

.page-changelog .entry time {
  font-size: .9rem;
  color: var(--text-primary);
  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;
  color: var(--text-secondary);
}

.page-profile input {
  font: inherit;
  padding: .55rem;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  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;
  color: var(--text-primary);
}

.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: var(--bg-card) !important;
  border: 2px solid var(--brand-color) !important;
  border-radius: 0 0 8px 0;
  z-index: 1001 !important;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.burger-menu:hover {
  background: var(--bg-body-start);
  border-color: var(--brand-color-dark);
  box-shadow: var(--shadow-md);
}

.burger-menu span {
  display: block !important;
  width: 25px;
  height: 3px;
  background-color: var(--brand-color) !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: var(--bg-card);
  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;
  font-size: 1rem;
  font-family: inherit;
  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 var(--border-color-light);
  margin-bottom: 20px;
}

.mobile-nav-header h3 {
  margin: 0;
  color: var(--text-heading);
  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;
}

.heic-converting-notice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  margin-top: 0.5rem;
  background-color: var(--bg-notice-info);
  color: var(--text-notice-info);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

.heic-converting-notice .upload-spinner {
  display: inline-block !important;
  width: 14px;
  height: 14px;
  border: 2px solid var(--text-notice-info);
  border-top-color: transparent;
  margin-right: 0;
}

.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,
.page-logging-dashboard input,
.page-logging-dashboard select {
  font: inherit;
  padding: .6rem;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  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-danger,
button.btn-danger,
a.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.28);
}

.btn-danger:hover,
.btn-danger:focus,
button.btn-danger:hover,
button.btn-danger:focus,
a.btn-danger:hover,
a.btn-danger:focus {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.btn-outline,
button.btn-outline,
a.btn-outline {
  background: var(--bg-card);
  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"]):not(.upload-remove) {
  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: var(--text-heading);
  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"]):not(.upload-remove):hover {
  background: var(--bg-alt-row);
  border-color: var(--brand-color);
  box-shadow: var(--shadow-sm);
}

.checkbox-label:focus-within,
label.checkbox-field:focus-within,
label:has(> input[type="checkbox"]):not(.upload-remove):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"]):not(.upload-remove)>input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background: var(--bg-card);
  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: var(--text-heading);
  user-select: none;
}

button,
input[type="submit"],
input[type="button"] {
  background: var(--brand-color);
  border: 1px solid var(--brand-color);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  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 var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  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: var(--text-secondary);
  border: 1px solid #cbd5e1;
}

.permission-tier {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.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: var(--bg-card);
  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 var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  border-radius: var(--border-radius-lg) !important;
  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: var(--bg-card);
  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: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  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;
  color: var(--text-primary);
}

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

.label-autocomplete-item small {
  color: var(--text-secondary);
  background: var(--neutral-200);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
}
/* Passkey Management */
.passkey-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.passkey-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--neutral-50);
  border: 1px solid var(--neutral-300);
  border-radius: 12px;
}

.passkey-item__info {
  display: flex;
  flex-direction: column;
}

.passkey-item__name {
  font-weight: 600;
}

.passkey-item__date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.passkey-item__actions {
  display: flex;
  gap: 0.5rem;
}

.btn-delete-passkey {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-delete-passkey:hover {
  background: #fecaca;
}

.passkey-only-notice {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fef9c3;
  border: 1px solid #fef08a;
  border-radius: 12px;
  color: #854d0e;
  font-size: 0.9rem;
}

.btn-passkey-register {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}

.btn-passkey-register:hover {
  background: #e0f2fe;
}

/* Premium Image Gallery Overlay & Swipe/Nav styling */
.image-overlay-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 54px;
  height: 54px;
  font-size: 28px;
  cursor: pointer;
  display: none; /* set to flex dynamically */
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1010;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.image-overlay-nav:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.image-overlay-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.image-overlay-nav.prev {
  left: 24px;
}

.image-overlay-nav.next {
  right: 24px;
}

.image-overlay-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  display: none; /* set to block dynamically */
  z-index: 1010;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Glassmorphic File Preview Card inside Overlay */
.overlay-file-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  transition: opacity 0.15s ease-in-out;
}

.file-card-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.file-card-name {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 24px;
  word-break: break-all;
  line-height: 1.4;
}

/* Premium Close Button inside Overlay */
.image-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1020;
}

.image-overlay-close:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.image-overlay-close:active {
  transform: scale(0.95);
}

#overlayImage {
  transition: opacity 0.15s ease-in-out;
}

/* Attachments button & count styling in table */
.attachments-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-alt-row, #f8fafc);
  border: 1px solid var(--border-color-light, #e2e8f0);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: all 0.2s ease;
}

.attachments-btn:hover {
  background: var(--border-color-light, #e2e8f0);
  border-color: var(--text-secondary, #475569);
  transform: translateY(-1px);
}

.attachments-btn:active {
  transform: translateY(0);
}

.attachments-count {
  font-size: 0.75rem;
  background: var(--brand-color, #0284c7);
  color: white;
  border-radius: 12px;
  padding: 2px 7px;
  font-weight: bold;
  display: inline-block;
  min-width: 14px;
  text-align: center;
}

@media (max-width: 768px) {
  .image-overlay-nav {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }
  .image-overlay-nav.prev {
    left: 10px;
  }
  .image-overlay-nav.next {
    right: 10px;
  }
}

/* Massenauswahl Spalte standardmäßig ausblenden und bei Aktivierung anzeigen */
.col-checkbox {
  display: none !important;
}

.bulk-select-active .col-checkbox {
  display: table-cell !important;
}

/* Visual Injury Diagram (Tauben-Schema) */
.injury-schema-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: fit-content;
  margin: 0.75rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--neutral-300, #cbd5e1);
  background: #ffffff;
  user-select: none;
}

.injury-schema-wrapper--zoomable {
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.injury-schema-wrapper--zoomable:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.injury-schema-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 600 / 500;
  height: auto;
  cursor: crosshair;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.injury-schema-canvas img,
.injury-schema-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  object-fit: contain;
}

.injury-pin {
  position: absolute;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  margin-top: -24px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.injury-pin:hover {
  transform: scale(1.3);
  z-index: 20;
}

.injury-pin-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  user-select: none;
}

.injury-pin--wunde .injury-pin-marker,
.injury-pin-marker.injury-pin--wunde {
  background: #ef4444; /* red */
}

.injury-pin--verschnuerung .injury-pin-marker,
.injury-pin-marker.injury-pin--verschnuerung {
  background: #3b82f6; /* blue */
}

.injury-pin--bruch .injury-pin-marker,
.injury-pin-marker.injury-pin--bruch {
  background: #f97316; /* orange */
}

.injury-pin--sonstiges .injury-pin-marker,
.injury-pin-marker.injury-pin--sonstiges {
  background: #22c55e; /* green */
}

/* Injury Schema Overlay Legend */
.injury-schema-legend {
  width: 100%;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color-light, #e2e8f0);
}

.injury-legend-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.injury-legend-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.injury-legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--neutral-50, #f8fafc);
  border: 1px solid var(--border-color-light, #e2e8f0);
  border-radius: 8px;
  font-size: 0.9rem;
}

.injury-legend-item .injury-pin-marker {
  position: static;
  margin: 0;
  flex-shrink: 0;
}

.injury-legend-cat {
  font-weight: 600;
  min-width: 110px;
  flex-shrink: 0;
}

.injury-legend-cat--wunde { color: #dc2626; }
.injury-legend-cat--verschnuerung { color: #2563eb; }
.injury-legend-cat--bruch { color: #ea580c; }
.injury-legend-cat--sonstiges { color: #16a34a; }

.injury-legend-note {
  color: var(--text-primary, #1e293b);
  word-break: break-word;
}

.injury-pin-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #1e293b;
  color: #ffffff;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  line-height: 1.25;
  white-space: normal;
  max-width: 140px;
  width: max-content;
  word-break: break-word;
  overflow-wrap: break-word;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  z-index: 30;
}

.injury-schema-overlay .injury-pin-tooltip {
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  max-width: 200px;
}

.injury-pin:hover .injury-pin-tooltip,
.injury-pin.active .injury-pin-tooltip {
  opacity: 1;
  visibility: visible;
}

.injury-pin-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border-width: 4px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

/* Smart Tooltip Edge Alignment */
.injury-pin--align-left .injury-pin-tooltip {
  left: 0;
  transform: translateY(-6px);
}
.injury-pin--align-left .injury-pin-tooltip::after {
  left: 10px;
  margin-left: 0;
}

.injury-pin--align-right .injury-pin-tooltip {
  left: auto;
  right: 0;
  transform: translateY(-6px);
}
.injury-pin--align-right .injury-pin-tooltip::after {
  left: auto;
  right: 10px;
  margin-left: 0;
}

.injury-pin--align-bottom .injury-pin-tooltip {
  bottom: auto;
  top: 100%;
  transform: translateX(-50%) translateY(6px);
}
.injury-pin--align-bottom .injury-pin-tooltip::after {
  top: auto;
  bottom: 100%;
  border-color: transparent transparent #1e293b transparent;
}

.injury-pin--align-left.injury-pin--align-bottom .injury-pin-tooltip {
  transform: translateY(6px);
}
.injury-pin--align-left.injury-pin--align-bottom .injury-pin-tooltip::after {
  top: auto;
  bottom: 100%;
  left: 10px;
  border-color: transparent transparent #1e293b transparent;
}

.injury-pin--align-right.injury-pin--align-bottom .injury-pin-tooltip {
  transform: translateY(6px);
}
.injury-pin--align-right.injury-pin--align-bottom .injury-pin-tooltip::after {
  top: auto;
  bottom: 100%;
  left: auto;
  right: 10px;
  border-color: transparent transparent #1e293b transparent;
}

.injury-pins-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.injury-pin-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--neutral-50, #f8fafc);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--neutral-200, #e2e8f0);
}

.injury-pin-item .injury-pin-marker-preview {
  flex-shrink: 0;
}

.injury-pin-delete-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--neutral-300, #cbd5e1);
  background: #ffffff;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.injury-pin-delete-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

.injury-pin-item .injury-cat-select {
  width: 185px;
  flex-shrink: 0;
}

.injury-pin-item input[type="text"] {
  flex: 1;
  min-width: 140px;
}

@media (max-width: 600px) {
  .injury-pin-item {
    flex-wrap: wrap;
  }
  .injury-pin-item .injury-cat-select {
    width: calc(100% - 64px);
  }
  .injury-pin-item input[type="text"] {
    width: 100%;
  }
}

/* Fullscreen Overlay for Injury Schema Diagram */
.injury-schema-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.injury-schema-overlay-content {
  position: relative;
  width: 95vw;
  max-width: 850px;
  max-height: 90vh;
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  border: 1px solid var(--neutral-200, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: auto;
}

.injury-schema-overlay-content h3,
.injury-schema-overlay-title {
  color: var(--text-primary, #0f172a) !important;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  width: 100%;
  text-align: left;
  padding-right: 2.5rem;
}

.injury-schema-overlay-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--neutral-100, #f1f5f9);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.injury-schema-overlay-close:hover {
  background: #ef4444;
  color: #ffffff;
}

.injury-schema-zoom-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--brand-color, #0284c7);
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-weight: 600;
  margin-top: 0.35rem;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.injury-schema-zoom-btn:hover {
  background: var(--brand-color-light, #e0f2fe);
}

