/* Emergency Information System - Central CSS */

/*
 * Tailwind v4 legt Utilities in @layer utilities (niedrige Priorität).
 * Diese Datei ist unlayered → hat automatisch Vorrang.
 * .hidden muss hier explizit stehen, damit es flex/grid/block immer überschreibt.
 */
.hidden {
    display: none !important;
}

/*
 * Tailwind v4 Preflight-Änderung: cursor:pointer für Buttons nicht mehr enthalten.
 * Explizit setzen, damit der Mauszeiger auf allen Buttons korrekt angezeigt wird.
 */
button, [role="button"] {
    cursor: pointer;
}

/*
 * Native <select>-Dropdowns im Dark Mode: Ohne color-scheme verwendet der Browser
 * immer helles System-Styling für die aufgeklappte Optionsliste – unabhängig von CSS.
 * color-scheme: dark weist den Browser an, das native Dark-Mode-Styling zu verwenden.
 */
.dark select {
    color-scheme: dark;
}

/* ── Action Buttons (kleine Icon-Buttons in Tabellen und Listen) ─────────────
 * Basis: .btn-action
 * Neutral (Vorschau, Duplizieren, Schließen):  nur .btn-action
 * Bearbeiten / primäre Aktion:                 .btn-action.btn-action-edit
 * Löschen / Deaktivieren:                      .btn-action.btn-action-danger
 * Veröffentlichen / Erfolg:                    .btn-action.btn-action-success
 * Zurückziehen / Warnung:                      .btn-action.btn-action-warning
 * ─────────────────────────────────────────────────────────────────────────── */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.375rem;
    border-radius: 0.25rem;
    border: none;
    background: transparent;
    text-decoration: none;
    cursor: pointer;
    color: rgb(var(--muted-foreground));
    transition: color 0.15s ease, background-color 0.15s ease;
}
.btn-action:hover {
    color: rgb(var(--foreground));
    background-color: rgb(var(--muted));
}
.btn-action.btn-action-edit:hover {
    color: rgb(var(--primary));
    background-color: rgb(var(--primary) / 0.1);
}
.btn-action.btn-action-danger:hover {
    color: rgb(var(--destructive));
    background-color: rgb(var(--destructive) / 0.1);
}
.btn-action.btn-action-success:hover {
    color: rgb(var(--success));
    background-color: rgb(var(--success) / 0.1);
}
.btn-action.btn-action-warning:hover {
    color: rgb(var(--warning));
    background-color: rgb(var(--warning) / 0.1);
}

/* Dark-Mode-Wechsel: Alle Transitions kurz deaktivieren um Ruckeln bei großen DOM-Bäumen zu vermeiden */
.no-theme-transition,
.no-theme-transition * {
    transition: none !important;
}

/* Status-Toggle-Switch: unlayered → gewinnt über alle Tailwind-Utilities */
.status-toggle:checked ~ .switch-track {
    background-color: rgb(var(--success));
}
.status-toggle:checked ~ * .switch-thumb,
.status-toggle:checked + * + .switch-thumb,
.status-toggle:checked ~ .switch-thumb {
    transform: translateX(1.25rem);
}

/* Base color variables for emergency system */
:root {
  --background: 255 255 255;
  --foreground: 55 65 81; /* Updated to match design brief */
  --card: 249 250 251; /* Light neutral gray instead of light red */
  --card-foreground: 55 65 81;
  --primary: 220 38 38; /* Emergency red */
  --primary-foreground: 255 255 255;
  --secondary: 245 158 11; /* Amber accent */
  --secondary-foreground: 255 255 255;
  --accent: 245 158 11; /* Amber accent */
  --accent-foreground: 55 65 81;
  --muted: 248 250 252; /* Light blue-gray muted */
  --muted-foreground: 100 116 139; /* Slightly darker for better contrast */
  --border: 226 232 240; /* Softer gray border */
  --destructive: 220 38 38; /* Emergency red for warnings */
  --destructive-foreground: 255 255 255;
  --warning: 245 158 11;
  --warning-foreground: 255 255 255;
  --success: 21 128 61; /* Green for success */
  --success-foreground: 255 255 255;
  --info: 59 130 246;
  --info-foreground: 255 255 255;
  --chart-1: 245 158 11; /* Amber */
  --chart-2: 220 38 38; /* Red */
  --chart-3: 21 128 61; /* Green */
  --chart-4: 234 88 12; /* Orange */
  --chart-5: 249 115 22; /* Orange variant */
}

/* Enhanced dark mode variables with better contrast for emergency use */
.dark {
  --background: 15 23 42;
  --foreground: 248 250 252;
  --card: 30 41 59;
  --card-foreground: 248 250 252;
  --primary: 220 38 38; /* Keep emergency red in dark mode */
  --primary-foreground: 255 255 255;
  --secondary: 245 158 11; /* Keep amber in dark mode */
  --secondary-foreground: 15 23 42;
  --accent: 245 158 11;
  --accent-foreground: 15 23 42;
  --muted: 71 85 105;
  --muted-foreground: 148 163 184;
  --border: 71 85 105;
  --destructive: 239 68 68;
  --destructive-foreground: 248 250 252;
  --warning: 251 191 36;
  --warning-foreground: 15 23 42;
  --success: 34 197 94;
  --success-foreground: 15 23 42;
  --info: 96 165 250;
  --info-foreground: 15 23 42;
}

/* Enhanced dark mode toggle with better mobile support */
.dark-mode-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: 1px solid rgb(var(--border));
  border-radius: 0.75rem; /* Larger border radius */
  background-color: rgb(var(--background));
  color: rgb(var(--foreground));
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  min-height: 48px; /* Larger touch target */
  min-width: 48px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

.dark-mode-toggle:hover {
  background-color: rgb(var(--muted));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark-mode-toggle:active {
  transform: translateY(0);
}

.dark-mode-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Added smooth transitions for dark mode switching */
* {
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: rgb(var(--background));
  color: rgb(var(--foreground));
  /* Prevent horizontal scrolling on mobile */
  overflow-x: hidden;
  /* Sticky footer implementation */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main content area that grows to push footer down */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Footer styling for sticky positioning */
.site-footer {
  margin-top: auto;
  background-color: rgb(var(--card));
  border-top: 1px solid rgb(var(--border));
  padding: 1rem 0;
  text-align: center;
  color: rgb(var(--muted-foreground));
  font-size: 0.875rem;
}

/* Enhanced touch-friendly navigation */
.emergency-nav-button {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1rem; /* Increased padding for better touch targets */
  border: 1px solid rgb(var(--border));
  border-radius: 0.5rem; /* Slightly larger border radius */
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--foreground));
  text-decoration: none;
  transition: background-color 0.2s ease-in-out;
  /* Minimum touch target size for mobile */
  min-height: 44px;
  min-width: 44px;
}

.emergency-nav-button svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}

.emergency-nav-button:hover {
  background-color: rgb(var(--muted));
}

/* Utility classes */
.bg-primary {
  background-color: rgb(var(--primary));
  color: rgb(var(--primary-foreground));
}
.bg-secondary {
  background-color: rgb(var(--secondary));
  color: rgb(var(--secondary-foreground));
}
.bg-accent {
  background-color: rgb(var(--accent));
  color: rgb(var(--accent-foreground));
}
.bg-background {
  background-color: rgb(var(--background));
}
.bg-card {
  background-color: rgb(var(--card));
}
.bg-muted {
  background-color: rgb(var(--muted));
}
.bg-destructive {
  background-color: rgb(var(--destructive));
  color: rgb(var(--destructive-foreground));
}
.bg-warning {
  background-color: rgb(var(--warning));
  color: rgb(var(--warning-foreground));
}
.bg-success {
  background-color: rgb(var(--success));
  color: rgb(var(--success-foreground));
}
.bg-info {
  background-color: rgb(var(--info));
  color: rgb(var(--info-foreground));
}
.bg-chart-1 {
  background-color: rgb(var(--chart-1));
  color: rgb(var(--primary-foreground));
}
.bg-chart-2 {
  background-color: rgb(var(--chart-2));
  color: rgb(var(--secondary-foreground));
}
.bg-chart-3 {
  background-color: rgb(var(--chart-3));
  color: rgb(var(--destructive-foreground));
}
.bg-chart-4 {
  background-color: rgb(var(--chart-4));
  color: rgb(var(--destructive-foreground));
}
.bg-chart-5 {
  background-color: rgb(var(--chart-5));
  color: rgb(var(--primary-foreground));
}

.text-foreground {
  color: rgb(var(--foreground));
}
.text-card-foreground {
  color: rgb(var(--card-foreground));
}
.text-muted-foreground {
  color: rgb(var(--muted-foreground));
}
.text-primary {
  color: rgb(var(--primary));
}
.text-secondary {
  color: rgb(var(--secondary));
}
.text-accent {
  color: rgb(var(--accent));
}
.text-destructive {
  color: rgb(var(--destructive));
}
.text-warning {
  color: rgb(var(--warning));
}
.text-success {
  color: rgb(var(--success));
}
.text-info {
  color: rgb(var(--info));
}

.border-border {
  border-color: rgb(var(--border));
}

/* Interactive states */
.hover\:bg-muted:hover {
  background-color: rgb(var(--muted));
}
.hover\:bg-primary:hover {
  background-color: rgb(var(--primary));
  color: rgb(var(--primary-foreground));
}
.hover\:text-foreground:hover {
  color: rgb(var(--foreground));
}
.hover\:opacity-90:hover {
  opacity: 0.9;
}

/* Card hover effects */
.card-hover {
  transition: all 0.2s ease-in-out;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Added module card hover effects from index.php */
.module-card {
  background-color: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: 0.75rem; /* Larger border radius for modern look */
  padding: 1.5rem;
  text-align: center;
  height: 100%;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease-in-out;
  /* Better touch feedback */
  -webkit-tap-highlight-color: transparent;
}

.module-card:active {
  transform: scale(0.98); /* Touch feedback */
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.module-card-icon {
  width: 4rem; /* Larger icons for mobile */
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-card-title {
  font-size: 1rem; /* Slightly larger for better readability */
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: rgb(var(--card-foreground));
}

.module-card-description {
  font-size: 0.875rem;
  color: rgb(var(--muted-foreground));
}

/* Rescue cards specific styles */
.manufacturer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Start with 2 columns on mobile */
  gap: 1rem;
}

@media (min-width: 480px) {
  .manufacturer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .manufacturer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .manufacturer-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1280px) {
  .manufacturer-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.manufacturer-card {
  background-color: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: 0.75rem;
  padding: 1.25rem; /* Increased padding */
  text-align: center;
  height: 100%;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease-in-out;
  /* Better touch feedback */
  -webkit-tap-highlight-color: transparent;
  min-height: 120px; /* Minimum height for consistent layout */
}

.manufacturer-card:active {
  transform: scale(0.95); /* Touch feedback */
}

.manufacturer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.manufacturer-logo {
  width: 3.5rem; /* Slightly smaller for mobile */
  height: 3.5rem;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.manufacturer-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--card-foreground));
}

/* Rescue card list styles */
.rescue-cards-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 1rem;
}

@media (min-width: 640px) {
  .rescue-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .rescue-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.rescue-card {
  background-color: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: 0.75rem;
  padding: 1.25rem; /* Increased padding for mobile */
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease-in-out;
  /* Better touch feedback */
  -webkit-tap-highlight-color: transparent;
}

.rescue-card:active {
  transform: scale(0.98); /* Touch feedback */
}

.rescue-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.rescue-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.rescue-card-info {
  display: flex;
  align-items: center;
}

.rescue-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgb(var(--primary));
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
}

.rescue-card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: rgb(var(--primary-foreground));
}

.rescue-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--card-foreground));
  margin-bottom: 0.25rem;
}

.rescue-card-meta {
  font-size: 0.75rem;
  color: rgb(var(--muted-foreground));
  text-transform: uppercase;
}

.rescue-card-external {
  width: 1rem;
  height: 1rem;
  color: rgb(var(--muted-foreground));
}

/* Search form styles */
.search-form {
  max-width: 100%; /* Full width on mobile */
  margin: 0 auto 2rem;
  position: relative;
}

@media (min-width: 640px) {
  .search-form {
    max-width: 28rem;
  }
}

.search-input {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 3rem; /* Increased padding for mobile */
  border: 1px solid rgb(var(--border));
  border-radius: 0.5rem; /* Larger border radius */
  background-color: rgb(var(--background));
  color: rgb(var(--foreground));
  font-size: 1rem; /* Larger font size to prevent zoom on iOS */
  line-height: 1.5;
  /* Better mobile input handling */
  -webkit-appearance: none;
  appearance: none;
}

.search-input:focus {
  outline: none;
  /*ring: 2px;
  ring-color: rgb(var(--primary));*/
  border-color: rgb(var(--primary));
}

.search-input:focus-visible {
  outline: 2px solid rgb(var(--primary));
  outline-offset: 2px;
}

.search-input::placeholder {
  color: rgb(var(--muted-foreground));
}

.search-icon {
  position: absolute;
  left: 1rem; /* Adjusted for larger padding */
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: rgb(var(--muted-foreground));
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(var(--muted-foreground));
  text-decoration: none;
}

.search-clear:focus-visible {
  outline: 2px solid rgb(var(--primary));
  outline-offset: 2px;
}

.search-clear:hover {
  color: rgb(var(--foreground));
}

.search-clear svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Empty state styles */
.empty-state {
  text-align: center;
  padding: 3rem 0;
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  background-color: rgb(var(--muted));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg {
  width: 2rem;
  height: 2rem;
  color: rgb(var(--muted-foreground));
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: rgb(var(--foreground));
  margin-bottom: 0.5rem;
}

.empty-state-description {
  color: rgb(var(--muted-foreground));
}

/* Responsive utilities */
.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem; /* Base mobile padding */
}

@media (min-width: 480px) {
  .container {
    padding: 0 1.25rem;
  }
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* Layout utilities */
.flex {
  display: flex;
}

.flex-col-mobile {
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .flex-col-mobile {
    flex-direction: row;
  }
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.space-x-2 > * + * {
  margin-left: 0.5rem;
}

.space-x-3 > * + * {
  margin-left: 0.75rem;
}

.space-x-4 > * + * {
  margin-left: 1rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.space-y-8 > * + * {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 0.75rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mb-8 {
  margin-bottom: 2rem;
}
.mr-2 {
  margin-right: 0.5rem;
}
.mr-3 {
  margin-right: 0.75rem;
}
.mr-4 {
  margin-right: 1rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.text-sm {
  font-size: 0.875rem;
}
.text-lg {
  font-size: 1.125rem;
}
.text-xl {
  font-size: 1.125rem;
}
.text-2xl {
  font-size: 1.375rem; /* Slightly smaller on mobile */
}
.text-3xl {
  font-size: 1.5rem;
}

.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}

.rounded-md {
  border-radius: 0.375rem;
}
.rounded-lg {
  border-radius: 0.5rem;
}
.rounded-xl {
  border-radius: 0.75rem;
}

.border {
  border-width: 1px;
}
.border-b {
  border-bottom-width: 1px;
}

.block {
  display: block;
}
.inline-flex {
  display: inline-flex;
}

.h-full {
  height: 100%;
}
.min-h-full {
  min-height: 100%;
}

.transition-colors {
  transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.transition-opacity {
  transition: opacity 0.2s ease-in-out;
}

/* Enhanced emergency header with better mobile responsiveness */
.emergency-header {
  background-color: rgb(var(--background));
  border-bottom: 2px solid rgb(var(--primary)); /* Red accent border */
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.emergency-header-content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.emergency-logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0; /* Allow shrinking */
}

.emergency-logo {
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, rgb(var(--primary)), rgb(var(--secondary)));
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.emergency-logo svg {
  width: 1.75rem;
  height: 1.75rem;
  color: white;
}

.emergency-logo-branded {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-color: rgb(var(--background));
}

.emergency-logo-branded img {
  background-color: rgb(var(--background));
}

.emergency-title-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.emergency-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: rgb(var(--foreground));
  margin: 0;
  line-height: 1.2;
  font-family: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

.emergency-subtitle {
  font-size: 0.875rem;
  color: rgb(var(--muted-foreground));
  margin: 0;
  line-height: 1.3;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

.emergency-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .emergency-header-content {
    padding: 0 0.75rem;
  }

  .emergency-title {
    font-size: 1.125rem;
  }

  .emergency-subtitle {
    font-size: 0.8125rem;
  }

  .emergency-logo {
    width: 2.5rem;
    height: 2.5rem;
  }

  .emergency-logo svg {
    width: 1.5rem;
    height: 1.5rem;
  }
}

@media (max-width: 480px) {
  .emergency-header-content {
    /*flex-direction: column;*/
    align-items: flex-start;
    gap: 0.75rem;
  }

  .emergency-logo-section {
    width: 100%;
    justify-content: space-between;
  }

  .emergency-controls {
    margin-left: auto;
  }
}

/* Touch-friendly button states */
button,
.emergency-nav-button,
.manufacturer-card,
.rescue-card,
.module-card {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Profile Menu Styles */
.profile-menu-container {
  position: relative;
  display: inline-block;
}

.profile-menu-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: 1px solid rgb(var(--border));
  border-radius: 0.75rem;
  background-color: rgb(var(--background));
  color: rgb(var(--foreground));
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  min-height: 48px;
  min-width: 48px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profile-menu-toggle:hover {
  background-color: rgb(var(--muted));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-menu-toggle:active {
  transform: translateY(0);
}

.profile-menu-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.profile-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 12rem;
  background-color: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.5rem);
  transition: all 0.2s ease-in-out;
  backdrop-filter: blur(12px);
}

.profile-menu-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: rgb(var(--card-foreground));
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out;
  border-radius: 0.5rem;
  margin: 0.25rem;
  min-height: 44px; /* Touch-friendly */
}

.profile-menu-item:first-child {
  margin-top: 0.5rem;
}

.profile-menu-item:last-child {
  margin-bottom: 0.5rem;
}

.profile-menu-item:hover {
  background-color: rgb(var(--muted));
}

.profile-menu-item:active {
  background-color: rgb(var(--accent));
  color: rgb(var(--accent-foreground));
}

.profile-menu-item svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

/* Added profile menu user info styles */
.profile-menu-header {
  padding: 0.75rem 1rem;
  /*border-bottom: 1px solid rgb(var(--border));*/
  margin: 0.5rem 0.25rem 0.25rem 0.25rem;
  border-radius: 0.5rem 0.5rem 0 0;
}

.profile-menu-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-menu-username {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(var(--card-foreground));
  line-height: 1.2;
}

.profile-menu-role {
  font-size: 0.75rem;
  color: rgb(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-weight: 500;
}

.profile-menu-divider {
  height: 1px;
  background-color: rgb(var(--border));
  margin: 0.25rem 0.5rem;
}

.profile-menu-logout {
  color: rgb(var(--destructive));
}

/* =============================================================
   Confirm Dialog  (confirm.js / confirm.php)
   Add this block to assets/css/emergency-system.css
   ============================================================= */

/* Backdrop */
#confirm-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
#confirm-overlay.confirm-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Dialog panel */
#confirm-dialog {
    transform: scale(0.95) translateY(8px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
#confirm-dialog.confirm-dialog-visible {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Icon wrapper */
.confirm-icon-wrapper {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-icon--danger  { background-color: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }
.confirm-icon--warning { background-color: hsl(var(--warning)     / 0.12); color: hsl(var(--warning)); }
.confirm-icon--default { background-color: hsl(var(--primary)     / 0.12); color: hsl(var(--primary)); }

/* Buttons */
.confirm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    transition: background-color 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.confirm-btn--cancel {
    background-color: transparent;
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}
.confirm-btn--cancel:hover  { background-color: hsl(var(--muted)); }

.confirm-btn--danger {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}
.confirm-btn--danger:hover  { opacity: 0.9; }

.confirm-btn--warning {
    background-color: hsl(var(--warning));
    color: hsl(var(--warning-foreground));
}
.confirm-btn--warning:hover { opacity: 0.9; }

.confirm-btn--default {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}
.confirm-btn--default:hover { opacity: 0.9; }

/* ==========================================================================
   Toast Notification System
   ========================================================================== */

#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
  max-width: min(22rem, calc(100vw - 2.5rem));
}

.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14), 0 1px 4px rgba(0, 0, 0, 0.08);
  font-size: 0.875rem;
  line-height: 1.45;
  pointer-events: all;
  position: relative;
  overflow: hidden;
  /* Enter: slide in from right */
  opacity: 0;
  transform: translateX(110%);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.toast-item.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-item.toast-hiding {
  opacity: 0;
  transform: translateX(110%);
}

/* Type colours – use CSS custom properties already in :root */
.toast-success {
  background-color: rgb(var(--card));
  border-color: rgba(var(--success), 0.35);
  color: rgb(var(--card-foreground));
}

.toast-success .toast-icon {
  color: rgb(var(--success));
}

.toast-success .toast-progress {
  background-color: rgb(var(--success));
}

.toast-error {
  background-color: rgb(var(--card));
  border-color: rgba(var(--destructive), 0.35);
  color: rgb(var(--card-foreground));
}

.toast-error .toast-icon {
  color: rgb(var(--destructive));
}

.toast-error .toast-progress {
  background-color: rgb(var(--destructive));
}

.toast-warning {
  background-color: rgb(var(--card));
  border-color: rgba(var(--warning), 0.35);
  color: rgb(var(--card-foreground));
}

.toast-warning .toast-icon {
  color: rgb(var(--warning));
}

.toast-warning .toast-progress {
  background-color: rgb(var(--warning));
}

.toast-info {
  background-color: rgb(var(--card));
  border-color: rgba(var(--info), 0.35);
  color: rgb(var(--card-foreground));
}

.toast-info .toast-icon {
  color: rgb(var(--info));
}

.toast-info .toast-progress {
  background-color: rgb(var(--info));
}

/* Icon */
.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.0625rem;
}

/* Message */
.toast-message {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* Close button */
.toast-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.0625rem;
  border: none;
  background: transparent;
  color: rgb(var(--muted-foreground));
  cursor: pointer;
  border-radius: 0.25rem;
  padding: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.toast-close:hover {
  color: rgb(var(--foreground));
  background-color: rgb(var(--muted));
}

/* Progress bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  opacity: 0.5;
  border-radius: 0 0 0.625rem 0.625rem;
  transition: width linear;
}

/* Dark mode adjustments */
.dark .toast-item {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 1px 6px rgba(0, 0, 0, 0.2);
}

/* Mobile: full-width at the bottom */
@media (max-width: 480px) {
  #toast-container {
    top: auto;
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
    max-width: 100%;
  }

  .toast-item {
    width: 100%;
  }
}

.profile-menu-logout:hover {
  background-color: rgba(var(--destructive), 0.1);
  color: rgb(var(--destructive));
}

.profile-menu-logout:active {
  background-color: rgba(var(--destructive), 0.2);
  color: rgb(var(--destructive));
}

/* Mobile responsive adjustments for profile menu */
@media (max-width: 640px) {
  .profile-menu-dropdown {
    right: -0.5rem;
    min-width: 10rem;
  }

  .profile-menu-item {
    padding: 1rem;
    font-size: 1rem; /* Larger text on mobile */
  }

  .profile-menu-header {
    padding: 1rem;
  }

  .profile-menu-username {
    font-size: 1rem;
  }

  .profile-menu-role {
    font-size: 0.875rem;
  }
}

/* Touch-friendly states for profile menu */
.profile-menu-toggle,
.profile-menu-item {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Added styles for collapsible permissions tables */
.permissions-collapse-content {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 1;
}

.permissions-collapse-content.collapsed {
  max-height: 0;
  opacity: 0;
  }

/* KO Preview Modal - Drag and Drop styles */
.ko-team-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: rgb(var(--background));
  border: 1.5px solid rgb(var(--border));
  border-radius: 0.5rem;
  cursor: grab;
  transition: all 0.15s ease-in-out;
  -webkit-user-select: none;
  user-select: none;
  min-height: 3rem;
}

.ko-team-chip:active {
  cursor: grabbing;
}

.ko-team-chip:hover {
  border-color: rgb(var(--primary));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ko-team-chip.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.ko-team-chip.ko-selected {
  border-color: rgb(var(--primary));
  box-shadow: 0 0 0 2px rgba(var(--primary), 0.25);
  background-color: rgba(var(--primary), 0.05);
}

.ko-team-chip.bye-chip {
  cursor: default;
  opacity: 0.5;
  border-style: dashed;
}

.ko-team-slot {
  flex: 1;
  min-width: 0;
  transition: all 0.15s ease-in-out;
  border-radius: 0.5rem;
}

.ko-team-slot.drag-over {
  background-color: rgba(var(--primary), 0.08);
  outline: 2px dashed rgb(var(--primary));
  outline-offset: 2px;
  border-radius: 0.5rem;
}

.ko-group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.ko-pairing-card {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.75rem;
  background-color: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: 0.5rem;
}

.ko-pairing-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: rgb(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  width: 2rem;
}

@media (max-width: 640px) {
  .ko-pairing-card {
    flex-direction: column;
    gap: 0.25rem;
  }
  .ko-pairing-vs {
    width: auto;
    padding: 0.125rem 0;
  }
}

/* ============================================================
   Live Monitor – Erweiterungen für emergency-system.css
   Anhängen ans Ende von /assets/css/emergency-system.css
   ============================================================ */

/* ── Monitor: Body override ── */
/* Normales body hat min-height:100vh + flex-col → Monitor braucht festes 100vh ohne Scroll */
body.monitor-page {
  overflow: hidden;
  min-height: 100vh;
  height: 100vh;
  display: block; /* überschreibt das flex-col des normalen body */
}

/* ── Monitor: Grundlayout ── */
.monitor-wrap {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  overflow: hidden;
}

/* ── Monitor: Kompakter Header-Balken ── */
.monitor-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  height: 44px;
  background-color: rgb(var(--background));
  border-bottom: 2px solid rgb(var(--primary));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  position: relative;
  z-index: 40;
}

.monitor-bar-logo {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--primary));
  white-space: nowrap;
  flex-shrink: 0;
}

.monitor-bar-sep {
  width: 1px;
  height: 20px;
  background: rgb(var(--border));
  flex-shrink: 0;
}

.monitor-bar-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgb(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.monitor-bar-meta {
  font-size: 0.7rem;
  color: rgb(var(--muted-foreground));
  white-space: nowrap;
  flex-shrink: 0;
}

.monitor-bar-spacer {
  flex: 1;
}

/* ── Live-Indikator ── */
.monitor-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(var(--success));
  flex-shrink: 0;
}

.monitor-live-dot::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(var(--success));
  animation: monitorLivePulse 1.5s ease-in-out infinite;
}

@keyframes monitorLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.7); }
}

/* ── Settings-Button ── */
.monitor-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgb(var(--border));
  background: transparent;
  color: rgb(var(--muted-foreground));
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.monitor-settings-btn:hover {
  background-color: rgb(var(--muted));
  color: rgb(var(--foreground));
}

.monitor-settings-btn svg {
  width: 15px;
  height: 15px;
}

/* ── Settings-Dropdown ── */
.monitor-settings-wrap {
  position: relative;
  flex-shrink: 0;
}

.monitor-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background-color: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
  display: none;
  backdrop-filter: blur(12px);
}

.monitor-dropdown.open {
  display: block;
}

.monitor-dd-section {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgb(var(--border));
}

.monitor-dd-section:last-child {
  border-bottom: none;
}

.monitor-dd-label {
  padding: 0.2rem 0.75rem 0.15rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(var(--muted-foreground));
}

.monitor-dd-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: rgb(var(--foreground));
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.1s ease;
  min-height: 32px;
}

.monitor-dd-item:hover {
  background-color: rgb(var(--muted));
}

.monitor-dd-item svg {
  width: 14px;
  height: 14px;
  color: rgb(var(--muted-foreground));
  flex-shrink: 0;
}

.monitor-dd-item.danger {
  color: rgb(var(--destructive));
}

.monitor-dd-item.danger svg {
  color: rgb(var(--destructive));
}

.monitor-dd-interval {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: rgb(var(--foreground));
}

.monitor-dd-interval select {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgb(var(--border));
  background-color: rgb(var(--background));
  color: rgb(var(--foreground));
  cursor: pointer;
}

/* ── Scrollbarer Content-Bereich ── */
.monitor-content {
  overflow-y: auto;
  padding: 1rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--border)) transparent;
}

.monitor-content::-webkit-scrollbar        { width: 4px; }
.monitor-content::-webkit-scrollbar-track  { background: transparent; }
.monitor-content::-webkit-scrollbar-thumb  { background: rgb(var(--border)); border-radius: 2px; }

/* ── Abschnitts-Überschriften ── */
.monitor-section-header {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(var(--muted-foreground));
  margin-bottom: 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgb(var(--border));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Match-Karten ── */
.monitor-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.monitor-match-card {
  border: 1px solid rgb(var(--border));
  border-radius: 0.5rem;
  padding: 0.65rem 0.8rem;
  background-color: rgb(var(--card));
  position: relative;
  overflow: hidden;
}

.monitor-match-card.live {
  border-color: rgb(var(--success));
  border-width: 2px;
  animation: monitorLiveGlow 2s ease-in-out infinite;
}

.monitor-match-card.live::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--success), 0.06) 0%, transparent 60%);
  pointer-events: none;
}

@keyframes monitorLiveGlow {
  0%, 100% { box-shadow: 0 0 0 0   rgba(var(--success), 0.35); }
  50%       { box-shadow: 0 0 0 4px rgba(var(--success), 0); }
}

.monitor-match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.monitor-field-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--muted-foreground));
}

.monitor-live-badge {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background-color: rgba(var(--success), 0.12);
  color: rgb(var(--success));
  border: 1px solid rgba(var(--success), 0.3);
}

.monitor-time-badge {
  font-size: 0.6rem;
  color: rgb(var(--muted-foreground));
}

.monitor-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0;
}

.monitor-team-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgb(var(--foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 78%;
}

.monitor-team-name.winner {
  color: rgb(var(--primary));
}

.monitor-team-vs {
  font-size: 0.65rem;
  color: rgb(var(--muted-foreground));
  padding: 1px 0;
}

.monitor-score {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgb(var(--foreground));
  min-width: 1.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.monitor-score.live {
  color: rgb(var(--success));
}

/* ── Tabellen-Bereich ── */
.monitor-standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.monitor-standings-card {
  background-color: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: 0.5rem;
  overflow: hidden;
}

.monitor-standings-group-header {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 0.75rem;
  background-color: rgb(var(--muted));
  color: rgb(var(--muted-foreground));
  border-bottom: 1px solid rgb(var(--border));
}

.monitor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.monitor-table th {
  padding: 0.3rem 0.75rem;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--muted-foreground));
  background-color: rgba(var(--muted), 0.5);
}

.monitor-table th:first-child,
.monitor-table th:nth-child(2) {
  text-align: left;
}

.monitor-table td {
  padding: 0.35rem 0.75rem;
  text-align: center;
  color: rgb(var(--foreground));
  border-top: 1px solid rgb(var(--border));
}

.monitor-table td:first-child {
  text-align: left;
  font-weight: 700;
  color: rgb(var(--muted-foreground));
  width: 1.5rem;
}

.monitor-table td:nth-child(2) {
  text-align: left;
  font-weight: 600;
}

.monitor-table .pts {
  font-weight: 700;
  color: rgb(var(--primary));
}

.monitor-table tr:hover td {
  background-color: rgba(var(--muted), 0.4);
}

.monitor-table tr.rank-1 td:first-child { color: rgb(var(--secondary)); } /* Amber = Gold */
.monitor-table tr.rank-2 td:first-child { color: rgb(var(--muted-foreground)); }

/* ── KO-Baum ── */
.monitor-bracket-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.monitor-bracket-phase {
  flex: 1;
  min-width: 190px;
}

.monitor-bracket-phase-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(var(--muted-foreground));
  margin-bottom: 0.5rem;
}

.monitor-bracket-match {
  border: 1px solid rgb(var(--border));
  border-radius: 0.4rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
  background-color: rgb(var(--card));
}

.monitor-bracket-match.live {
  border-color: rgb(var(--success));
  border-width: 2px;
}

.monitor-bracket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
}

.monitor-bracket-row:first-child {
  border-bottom: 1px solid rgb(var(--border));
}

.monitor-bracket-team {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
}

.monitor-bracket-team.winner {
  color: rgb(var(--primary));
}

.monitor-bracket-score {
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* Uhrzeit + Bahn im Bracket */
.monitor-bracket-meta {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(var(--muted-foreground));
  padding: 0.2rem 0.6rem;
  border-bottom: 1px solid rgb(var(--border));
  background-color: rgba(var(--muted), 0.5);
}

/* Noch nicht feststehende Teams */
.monitor-bracket-team.tbd {
  color: rgb(var(--muted-foreground));
  font-weight: 400;
  font-style: italic;
}

/* Spiel um Platz 3 – visuell vom Finale abgesetzt */
.monitor-bracket-third {
  border-left: 2px dashed rgb(var(--border));
  padding-left: 1rem;
  margin-left: 0.5rem;
  opacity: 0.85;
}

.monitor-bracket-third .monitor-bracket-phase-label {
  color: rgb(var(--muted-foreground));
}

/* ── Ticker-Leiste ── */
.monitor-ticker {
  height: 48px;
  border-top: 1px solid rgb(var(--border));
  background-color: rgb(var(--card));
  display: flex;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.monitor-ticker-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(var(--muted-foreground));
  padding: 0 0.75rem;
  border-right: 1px solid rgb(var(--border));
  white-space: nowrap;
  flex-shrink: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.monitor-ticker-scroll-wrap {
  flex: 1;
  overflow: hidden;
  height: 100%;
  position: relative;
}

.monitor-ticker-scroll {
  display: flex;
  height: 100%;
  width: max-content;
  animation: monitorTicker 45s linear infinite;
}

.monitor-ticker-scroll:hover {
  animation-play-state: paused;
}

@keyframes monitorTicker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.monitor-ticker-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  height: 100%;
  border-right: 1px solid rgba(var(--border), 0.5);
  flex-shrink: 0;
}

.monitor-ticker-field {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--muted-foreground));
  min-width: 3.5rem;
  flex-shrink: 0;
}

.monitor-ticker-match {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.monitor-ticker-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
}

.monitor-ticker-team {
  font-weight: 600;
  color: rgb(var(--foreground));
  white-space: nowrap;
}

.monitor-ticker-team.winner {
  color: rgb(var(--primary));
}

.monitor-ticker-score {
  font-weight: 700;
  font-size: 0.82rem;
  min-width: 1rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Lade-/Fehlerzustand ── */
.monitor-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 0.75rem;
  color: rgb(var(--muted-foreground));
  font-size: 0.8rem;
}

.monitor-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgb(var(--border));
  border-top-color: rgb(var(--primary));
  border-radius: 50%;
  animation: monitorSpin 0.8s linear infinite;
}

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

/* ── Fullscreen ── */
.monitor-wrap:-webkit-full-screen { display: grid; grid-template-rows: auto 1fr auto; }
.monitor-wrap:-moz-full-screen    { display: grid; grid-template-rows: auto 1fr auto; }
.monitor-wrap:fullscreen          { display: grid; grid-template-rows: auto 1fr auto; }

/* ============================================================
   Changelog-Modul – Klassen für modules/changelog/ und
   modules/admin-changelogmgr/
   ============================================================ */

/* --- Badge-Farben (Item-Typen) ----------------------------- */
.badge-new        { background: #dcfce7; color: #166534; }
.badge-improved   { background: #dbeafe; color: #1e40af; }
.badge-fixed      { background: #ffedd5; color: #9a3412; }
.badge-security   { background: #fee2e2; color: #991b1b; }
.badge-deprecated { background: #f3e8ff; color: #6b21a8; }

.dark .badge-new        { background: #14532d; color: #86efac; }
.dark .badge-improved   { background: #1e3a5f; color: #93c5fd; }
.dark .badge-fixed      { background: #431407; color: #fed7aa; }
.dark .badge-security   { background: #450a0a; color: #fca5a5; }
.dark .badge-deprecated { background: #3b0764; color: #d8b4fe; }

/* --- Status-Badges (draft / published) --------------------- */
.badge-draft     { background: #f3f4f6; color: #6b7280; }
.badge-published { background: #dcfce7; color: #166534; }

.dark .badge-draft     { background: #374151; color: #9ca3af; }
.dark .badge-published { background: #14532d; color: #86efac; }

/* --- Visibility-Badges ------------------------------------- */
.vis-public        { background: #dbeafe; color: #1e40af; }
.vis-authenticated { background: #fef9c3; color: #854d0e; }
.vis-tenant        { background: #ffedd5; color: #9a3412; }
.vis-private       { background: #fee2e2; color: #991b1b; }

.dark .vis-public        { background: #1e3a5f; color: #93c5fd; }
.dark .vis-authenticated { background: #422006; color: #fde68a; }
.dark .vis-tenant        { background: #431407; color: #fed7aa; }
.dark .vis-private       { background: #450a0a; color: #fca5a5; }

/* --- Unseen-Dot -------------------------------------------- */
.unseen-dot {
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: hsl(var(--primary));
    flex-shrink: 0;
    margin-top: .3rem;
}

/* --- Timeline-Linie (öffentliche Changelog-Seite) ---------- */
/* display:none by default – md:block funktioniert nicht wegen .hidden !important */
.timeline-line {
    display: none;
    position: absolute;
    left: 1.1rem;
    top: 2.5rem;
    bottom: 0;
    width: 2px;
    background: hsl(var(--border));
}
@media (min-width: 768px) {
    .timeline-line { display: block; }
}

/* --- Timeline-Punkt (öffentliche Changelog-Seite) ---------- */
/* Analog: hidden md:flex funktioniert nicht wegen .hidden !important */
.timeline-dot {
    display: none;
    position: absolute;
    left: 0;
    top: 1.25rem; /* top-5 */
    width: 2.25rem;  /* w-9 */
    height: 2.25rem; /* h-9 */
    border-radius: 9999px;
    border-width: 2px;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .timeline-dot { display: flex; }
}

/* --- Staggered fade-in animation --------------------------- */
@keyframes cl-fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.cl-entry { animation: cl-fadeUp .3s ease both; }

/* --- Filter-Button aktiv ----------------------------------- */
.filter-btn.active {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}

/* --- Security-Eintrag hervorgehoben ------------------------ */
.item-security-highlight {
    border-left: 3px solid #ef4444;
    padding-left: .5rem;
}

/* --- Subtle row hover (Admin-Tabelle) ---------------------- */
.cl-row:hover { background: hsl(var(--accent) / .5); }

/* --- Drag & Drop (Admin-Changelog-Manager) ----------------- */
.item-row.dragging  { opacity: .4; }
.item-row.drag-over { border-top: 2px solid hsl(var(--primary)); }
.drag-handle        { cursor: grab; }
.drag-handle:active { cursor: grabbing; }

/* --- Modal-Backdrop (Admin-Changelog-Manager) -------------- */
.modal-backdrop {
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(2px);
}

/* --- Generisches Fade-in (Admin-UI) ------------------------ */
@keyframes cl-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.fade-in { animation: cl-fadeIn .2s ease both; }

/* ============================================================
   Header – Tenant-Branding & Wartungsmodus-Banner
   Ehemals inline in includes/header.php
   ============================================================ */

.maintenance-banner {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

/* ============================================================
   Forms - Modul und Forms Manager
   modules/forms/ & modules/forms-manager
   ============================================================ */

 /* ── Editor-spezifische Styles ── */
  #editor-canvas { min-height: 300px; }

  /* Drag-over Indikator */
  .canvas-dropzone { transition: background 0.15s; }
  .canvas-dropzone.drag-over { background: hsl(var(--primary) / 0.06); }

  /* Drag-Handle Cursor */
  .element-drag-handle { cursor: grab; }
  .element-drag-handle:active { cursor: grabbing; }

  /* Sortable Ghost */
  .sortable-ghost { opacity: 0.35; }
  .sortable-chosen { box-shadow: 0 0 0 2px hsl(var(--primary) / 0.4); }

  /* Selektiertes Element */
  .canvas-element.selected {
      outline: 2px solid hsl(var(--primary));
      outline-offset: 2px;
  }

  /* Palette Kacheln */
  .palette-item {
      cursor: pointer;
      transition: background 0.12s, border-color 0.12s;
  }
  .palette-item:hover { background: hsl(var(--accent)); }

  /* Properties Panel – smooth erscheinen */
  #props-panel { transition: opacity 0.15s; }
  #props-panel.empty { opacity: 0.4; pointer-events: none; }

  /* Sterne-Bewertung */
.star-rating { display: flex; gap: 4px; }
.star-rating button {
    font-size: 1.5rem; color: var(--muted-foreground, #9ca3af);
    background: none; border: none; cursor: pointer; padding: 0; line-height: 1;
    transition: color 0.1s;
}
.star-rating button.active,
.star-rating button:hover ~ button { color: #f59e0b; }
.star-rating:hover button { color: #f59e0b; }
.star-rating button:hover ~ button { color: var(--muted-foreground, #9ca3af); }

/* Pflichtfeld-Markierung */
.field-required::after { content: ' *'; color: #ef4444; }

/* Touch-optimierte Inputs */
@media (max-width: 768px) {
    input[type="text"], input[type="email"], input[type="tel"],
    input[type="number"], input[type="date"], input[type="time"],
    input[type="url"], textarea, select {
        font-size: 16px !important; /* Verhindert iOS-Zoom */
        min-height: 44px;
    }
}

    