* {
  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: 32px;
  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;
  background-color: white;
  border-radius: 4px;
  padding: 10px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: 100%;
  position: sticky;
  top: 110px;
  /* Topbar + header height, adjust if needed */
  z-index: 90;
  border-bottom: 1px solid #eaeaea;
  /* Added border-bottom from second rule */
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px;
  font-size: 16px;
}

.search-bar i {
  color: #888;
  margin-right: 10px;
}

/* Merged content-controls styles */
.content-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;
  gap: 15px;
  position: sticky;
  top: 80px;
  /* Topbar + header + search bar height, adjust if needed */
  z-index: 90;
  background-color: #fff;
  padding: 10px 20px;
  border-bottom: 1px solid #eaeaea;
  /* Added border-bottom from second rule */
}

.dropdown {
  display: flex;
  align-items: center;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px 12px;
  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: 12px 15px;
  color: #555;
  font-weight: 500;
  /*  border-bottom: 1px solid var(--border-color); */
}

.data-table td {
  padding: 12px 15px;
  /* border-bottom: 1px solid var(--border-color); */
}

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