* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
  background-size: cover;
  background-position: center;
}

.login-container {
  width: 100%;
  max-width: 450px;
  padding: 40px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  max-height: 120px;
  overflow: hidden;
}

.logo-placeholder {
  width: 100%;
  max-width: 370px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 24px;
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-weight: 500;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

input {
  width: 100%;
  padding: 6px 10px;
  /* Reduced padding from 10px to 6px for height */
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
  height: 32px;
  /* Set explicit height for consistency */
}

select {
  width: 100%;
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
  height: 32px;
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}

button {
  padding: 6px 15px;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
  height: auto;
  line-height: 1;
}

button:hover {
  background-color: #222;
}

.input-login {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

input:focus {
  border-color: #333;
  outline: none;
}

.login-btn,
.reset-btn {
  width: 100%;
  padding: 12px;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
}

.login-btn:hover,
.reset-btn:hover {
  background-color: #222;
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #0055b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.forgot-password,
.back-to-login {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: #666;
  text-decoration: none;
  font-size: 14px;
}

.forgot-password:hover,
.back-to-login:hover {
  text-decoration: underline;
}

/* Neue Styles für Passwort zurücksetzen */
p {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
  line-height: 1.5;
}

.error-message {
  color: #d9534f;
  background-color: rgba(217, 83, 79, 0.1);
  border: 1px solid #d9534f;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 14px;
}

/* dashboard styles */

:root {
  --primary-color: #0066cc;
  --sidebar-bg: #333;
  --sidebar-hover: #222;
  --text-light: #ffffff;
  --text-dark: #333333;
  --border-color: #e0e0e0;
  --status-overdue: #e74c3c;
  --status-resolved: #2ecc71;
  --status-closed: #95a5a6;
  --status-ontime: #f1c40f;
}

/* Override for dashboard body */
.dashboard-body {
  display: flex;
  height: auto;
  min-height: 100vh;
  background-color: #f5f7f9;
  background-image: none;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background-color: var(--sidebar-bg);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  transition: all 0.3s ease;
  z-index: 100;
  align-items: flex-start;
  /* Align items to the left */
}

.sidebar-logo {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  /* Ensure full width */
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin-top: 20px;
  width: 100%;
  /* Ensure full width */
}

.nav-item {
  padding: 0;
  cursor: pointer;
}

.nav-item:hover {
  background-color: transparent;
}

.nav-item.active {
  background-color: transparent;
}

.nav-item i {
  margin-right: 10px;
  width: 24px;
  text-align: center;
}

/* Add these styles to make sidebar text white */
.sidebar .nav-menu .nav-item a {
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  padding: 6px 15px;
  /* Reduced vertical padding from 12px to 9.6px (20% less) */
  transition: background-color 0.3s;
}

.sidebar .nav-menu .nav-item i,
.sidebar .nav-menu .nav-item span {
  color: #ffffff;
}

.sidebar .nav-menu .nav-item i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.sidebar .nav-menu .nav-item.active {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-menu .nav-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* If your nav menu has list styling */
.sidebar .nav-menu {
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar .nav-menu .nav-item {
  margin-bottom: 4px;
  /* If there was margin between items, reduced by 20% */
}

/* Updated sidebar navigation styles for full clickable areas */
.sidebar .nav-menu .nav-item {
  position: relative;
  margin-bottom: 4px;
}

.sidebar .nav-menu .nav-item a.nav-link {
  display: block;
  width: 100%;
  padding: 12px 20px;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: background-color 0.3s;
}

.sidebar .nav-menu .nav-item.active a.nav-link {
  background-color: rgba(255, 255, 255, 0.1);
  border-left: 4px solid white;
  padding-left: 16px;
}

.sidebar .nav-menu .nav-item a.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.sidebar .nav-menu .nav-item i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
  color: #ffffff;
}

.sidebar .nav-menu .nav-item span {
  color: #ffffff;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 220px;
  transition: margin-left 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100vh;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.greeting {
  color: var(--text-dark);
}

.greeting h2 {
  font-weight: 500;
}

.greeting p {
  color: #888;
  font-size: 14px;
}

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

.notification-icon {
  margin-right: 20px;
  font-size: 20px;
  color: #555;
  cursor: pointer;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.profile-dropdown {
  position: relative;
  cursor: pointer;
}

.profile-dropdown i {
  font-size: 12px;
  margin-left: 5px;
}

/* Profile dropdown styles moved from topbar.php */
.profile-dropdown {
  position: relative;
}

.profile-dropdown .dropdown-menu a {
  color: #fff;
  padding: 10px 16px;
  display: block;
  text-decoration: none;
}

.profile-dropdown .dropdown-menu a:hover {
  background: #333;
}

/* Content Area */
.content-area {
  padding: 10px 30px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  position: sticky;
  z-index: 90;
  padding: 15px 30px;
}

.content-header h1 {
  color: var(--primary-color);
  font-size: 24px;
  font-weight: bolder;
}

/* Merged search-bar styles */
.search-bar {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 10px;
  background-color: #fff;
  width: 100%;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 4px 6px;
  font-size: 0.875rem;
}

.search-bar i {
  color: #999;
  font-size: 0.85rem;
  margin-right: 6px;
}

/* Content controls */
.content-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  position: sticky;
  top: 60px;
  z-index: 90;
  background-color: #f5f5f5;
  padding: 8px 0;
}

.dropdown {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.875rem;
  background-color: #fff;
  cursor: pointer;
}

/* Table Styles */
.data-table {
  width: 100%;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  /* flex and overflow-y moved to combined rule below */
  /* padding moved to combined rule below */
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background-color: #f9f9f9;
  text-align: left;
  padding: 6px 12px;
  color: #555;
  font-weight: 500;
  font-size: 0.875rem;
}

.data-table td {
  padding: 5px 12px;
  font-size: 0.875rem;
}

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

.data-table tr:hover {
  background-color: #f5f5f5;
}




.checkbox {
  width: 18px;
  height: 18px;
}

.ticket-id {
  color: #888;
  font-size: 14px;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  color: white;
}

.overdue {
  background-color: var(--status-overdue);
}

.resolved {
  background-color: var(--status-resolved);
}

.closed {
  background-color: var(--status-closed);
}

.ontime {
  background-color: var(--status-ontime);
}

.task-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #e0e0e0;
  margin: 0 auto;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-top: 1px solid var(--border-color);
}

.page-info {
  color: #888;
  font-size: 14px;
}

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

.page-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: white;
  cursor: pointer;
}

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

.per-page-dropdown {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}

.per-page-dropdown i {
  margin-left: 8px;
  font-size: 12px;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  font-size: 24px;
  color: var(--text-dark);
  cursor: pointer;
}

/* Media Queries */
@media screen and (max-width: 992px) {
  .sidebar {
    width: 80px;
  }

  .sidebar-logo {
    padding: 15px;
  }

  .nav-item span {
    display: none;
  }

  .nav-item i {
    margin-right: 0;
    font-size: 18px;
  }

  .main-content {
    margin-left: 80px;
  }
}

@media screen and (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .sidebar {
    width: 0;
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    width: 220px;
    left: 0;
  }

  body.sidebar-open .nav-item span {
    display: inline;
  }

  body.sidebar-open .nav-item i {
    margin-right: 10px;
  }

  .main-content {
    margin-left: 0;
  }

  .content-controls {
    flex-wrap: wrap;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .greeting p {
    display: none;
  }
}

@media screen and (max-width: 576px) {
  .top-bar {
    padding: 10px 15px;
  }

  .content-area {
    padding: 15px;
  }

  .greeting h2 {
    font-size: 16px;
  }

  .content-header h1 {
    font-size: 20px;
  }

  .pagination {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .page-controls {
    width: 100%;
    justify-content: space-between;
  }
}

/* Remaining content should scroll under the fixed elements */
/* Combined styles for scrollable content areas */
.data-table,
.charts-container,
.settings-container {
  flex: 1;
  overflow-y: auto;
  padding: 15px 20px;
}

/* Data placeholder styles */
.data-placeholder {
  height: 500px;
  padding-left: 20px;
  background-color: #f9f9f9;
  display: flex;
  align-items: left;
  justify-content: left;
  margin-top: 20px;
  border-radius: 8px;
}

.data-placeholder p {
  font-size: 18px;
  color: #888;
  margin-bottom: 0;
  text-align: center;
}

/* Message styling */
.success, .error {
  padding: 12px 15px;
  margin: 10px 0;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  width: 500px;
  height: 40px;
  box-sizing: border-box;
  display: inline-block;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #28a745;
}

.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #dc3545;
}


/* Status colors */
.status-device-connected {
  color: #4CAF50;
  /* green */
  font-weight: bold;
}

.status-device-waiting {
  color: #2196F3;
  /* blue */
  font-weight: bold;
}

.status-device-inactive {
  color: #F44336;
  /* red */
  font-weight: bold;
}

/* Messung Details Styles */
.messung-detail-container {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.messung-measurement-info {
  margin-bottom: 20px;
  color: #000000;
}

.messung-measurement-info h2 {
  color: #000000;
  margin-bottom: 10px;
}

.messung-measurement-info p {
  color: #000000;
  margin: 5px 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.5rem;
}

.messung-detail-date {
  color: #666;
  font-style: italic;
}

.detail-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.detail-section {
  background-color: #f9f9f9;
  border-radius: 6px;
  padding: 15px;
  flex: 1;
  min-width: 250px;
}

.detail-section h3 {
  color: #3a3a3a;
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table td {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.detail-table td:first-child {
  font-weight: bold;
  width: 40%;
}

.full-width {
  flex-basis: 100%;
  width: 100%;
}

.comments-box {
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 12px;
  white-space: pre-line;
}

.measurement-data-container {
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 20px;
  padding-bottom: 0px;
  /* height: 300px; */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  text-align: center;
  flex-direction: column
}

.detail-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.detail-container {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.measurement-info {
  margin-bottom: 20px;
  color: #000000;
}

.measurement-info h2 {
  color: #000000;
  margin-bottom: 10px;
}

.measurement-info p {
  color: #000000;
  margin: 5px 0;
}


.clickable-row {
  cursor: pointer;
  transition: background-color 0.2s;
}

.clickable-row:hover {
  background-color: rgba(0, 0, 0, 0.05);
}


/* Dashboard Styles */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  align-items: left;
}

.stat-card i {
  font-size: 2.5rem;
  color: #0066cc;
  margin-right: 20px;
}

.stat-info h3 {
  margin: 0;
  font-size: 1.8rem;
  color: #333;
  align-items: left;
}

.stat-info p {
  margin: 5px 0 0;
  color: #666;
}

.dashboard-section {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: left;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.section-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

.view-all {
  color: #0066cc;
  text-decoration: none;
  font-size: 0.9rem;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.dashboard-table th {
  background-color: #f9f9f9;
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-active {
  background-color: #e3f7eb;
  color: #2ecc71;
}

.status-inactive {
  background-color: #fbe9e7;
  color: #e74c3c;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.btn-danger {
  background-color: #dc3545;
  color: #fff;
  border-color: #dc3545;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
  box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
}

.btn-danger:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3);
  outline: none;
}

.btn-danger i {
  margin-right: 5px;
}

/* Tag Badges */
.tag-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
  border: 1.5px solid var(--tag-color);
  background-color: color-mix(in srgb, var(--tag-color) 18%, white);
  color: color-mix(in srgb, var(--tag-color) 70%, black);
  font-weight: 600;
}

/* Tag-Auswahl in messung_edit */
.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tag-selector label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

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

.tag-create-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.tag-create-inline input[type="text"] {
  max-width: 200px;
}

.tag-create-inline input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}

/* Tag-Filter in Messungsliste */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-filter-active {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--tag-color);
  background-color: color-mix(in srgb, var(--tag-color) 18%, white);
  color: color-mix(in srgb, var(--tag-color) 70%, black);
}

.tag-filter-btn .tag-filter-x {
  font-size: 0.65rem;
  opacity: 0.7;
}

.tag-filter-btn:hover .tag-filter-x {
  opacity: 1;
}

/* Sortierbare Tabellenheader */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable i {
  margin-left: 4px;
  font-size: 0.75rem;
  opacity: 0.4;
}

th.sortable i.fa-sort-up,
th.sortable i.fa-sort-down {
  opacity: 1;
}

/* Tag-Inline-Bearbeitung in Messungsliste */
.meas-tags-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.meas-description-cell {
  cursor: default;
}

.meas-clickable {
  cursor: pointer;
}

.meas-tags-badges {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Löschbare Tag-Badges in Messungsliste */
.tag-badge-deletable {
  position: relative;
  cursor: default;
  padding-right: 8px;
  transition: padding-right 0.15s ease;
}

.tag-badge-deletable .tag-badge-x {
  display: none;
  font-size: 0.6rem;
  margin-left: 4px;
  opacity: 0.7;
  cursor: pointer;
  vertical-align: middle;
}

.tag-badge-deletable:hover {
  padding-right: 4px;
}

.tag-badge-deletable:hover .tag-badge-x {
  display: inline;
}

.tag-badge-deletable .tag-badge-x:hover {
  opacity: 1;
}

.meas-tag-add-btn {
  display: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px dashed #aaa;
  border-radius: 50%;
  background: #f8f9fa;
  color: #666;
  font-size: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.meas-tag-add-btn:hover {
  border-color: #007bff;
  color: #007bff;
  background: #e7f3ff;
}

.meas-tags-container:hover .meas-tag-add-btn {
  display: inline-flex;
}

/* Tag-Modal */
.meas-tag-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.meas-tag-modal {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.15s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.meas-tag-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid #dee2e6;
  background: #0d6efd;
  border-radius: 6px 6px 0 0;
}

.meas-tag-modal-header h5 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.5;
}

.meas-tag-modal-close {
  background: transparent;
  border: 0;
  font-size: 1.5rem;
  color: #fff;
  opacity: 0.8;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: opacity 0.15s;
}

.meas-tag-modal-close:hover {
  opacity: 1;
}

.meas-tag-modal-body {
  padding: 1rem;
  overflow-y: auto;
}

.meas-tag-search-container {
  position: relative;
  margin-bottom: 12px;
}

.meas-tag-search-container i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 14px;
}

.meas-tag-search {
  width: 100%;
  padding: 0.375rem 0.75rem 0.375rem 36px;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.meas-tag-search:focus {
  outline: none;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.meas-tag-list {
  height: 220px;
  min-height: 220px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  margin-bottom: 16px;
  background: #fff;
}

.meas-tag-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s ease;
  border-bottom: 1px solid #f0f0f0;
}

.meas-tag-list-item:last-child {
  border-bottom: none;
}

.meas-tag-list-item:hover {
  background: #f8f9fa;
}

.meas-tag-list-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #0d6efd;
}

.meas-tag-list-item .tag-badge {
  margin-left: 0;
}

.meas-tag-no-results {
  padding: 20px;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meas-tag-create-section {
  border-top: 1px solid #dee2e6;
  padding-top: 16px;
  margin-top: 8px;
}

.meas-tag-create-header {
  font-weight: 500;
  font-size: 0.95rem;
  color: #212529;
  margin-bottom: 12px;
}

.meas-tag-create-form {
  margin-bottom: 12px;
}

.meas-tag-form-group {
  margin-bottom: 12px;
}

.meas-tag-form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.875rem;
  color: #212529;
}

.meas-tag-create-label {
  width: 100%;
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  font-size: 1rem;
  line-height: 1.5;
}

.meas-tag-create-label:focus {
  outline: none;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.meas-tag-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meas-tag-create-color {
  width: 40px;
  height: 40px;
  padding: 2px;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  cursor: pointer;
  background: #fff;
}

.meas-tag-preview {
  display: inline-block;
  flex: 1;
}

.meas-tag-create-btn {
  padding: 4px 10px;
  background: #0d6efd;
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.15s ease-in-out;
  white-space: nowrap;
}

.meas-tag-create-btn:hover {
  background: #0b5ed7;
}

.meas-tag-create-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 8px;
  min-height: 20px;
}

.meas-tag-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0.75rem 1rem;
  border-top: 1px solid #dee2e6;
  background: #fff;
  border-radius: 0 0 6px 6px;
}

.meas-tag-modal-footer .btn {
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  border-radius: 0.375rem;
}

/* Wiederverwendbares Bestätigungs-Modal */
.confirm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.confirm-modal {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 400px;
  animation: modalFadeIn 0.15s ease;
}

.confirm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid #dee2e6;
  background: #0d6efd;
  border-radius: 6px 6px 0 0;
}

.confirm-modal-header h5 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.5;
}

.confirm-modal-close {
  background: transparent;
  border: 0;
  font-size: 1.5rem;
  color: #fff;
  opacity: 0.8;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: opacity 0.15s;
}

.confirm-modal-close:hover {
  opacity: 1;
}

.confirm-modal-body {
  padding: 1.5rem 1rem;
}

.confirm-modal-message {
  margin: 0;
  font-size: 1rem;
  color: #212529;
  line-height: 1.5;
}

.confirm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0.75rem 1rem;
  border-top: 1px solid #dee2e6;
  background: #fff;
  border-radius: 0 0 6px 6px;
}

.confirm-modal-footer .btn {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.confirm-modal-footer .btn-danger {
  background: #dc3545;
  color: #fff;
  border: 1px solid #dc3545;
}

.confirm-modal-footer .btn-danger:hover {
  background: #bb2d3b;
  border-color: #b02a37;
}

.confirm-modal-footer .confirm-modal-cancel {
  background: #6c757d;
  color: #fff;
  border: 1px solid #6c757d;
}

.confirm-modal-footer .confirm-modal-cancel:hover {
  background: #5c636a;
  border-color: #565e64;
}