/* ////////////////////////////////////////////////
   /// Basislayout & Reset
/////////////////////////////////////////////////// */

body {
  margin: 0;
  font-family: sans-serif;
}

/* ////////////////////////////////////////////////
   /// Trennstrich Sidebar/Content
/////////////////////////////////////////////////// */

.vertical-divider {
  width: 2px;
  background-color: black;
}

/* ////////////////////////////////////////////////
   /// Haupt-Container
/////////////////////////////////////////////////// */

.container {
  display: flex;
  height: 100vh;
}

/* ////////////////////////////////////////////////
   /// Sidebar
/////////////////////////////////////////////////// */

.sidebar {
  width: 200px;
  display: flex;
  flex-direction: column;
  background-color: #8aad8d;
}

/* ////////////////////////////////////////////////
   /// Logo-Box oben
/////////////////////////////////////////////////// */

.logo-box {
  background-color: #bbf9c0;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  max-height: 80px;
  max-width: 100%;
}

/* ////////////////////////////////////////////////
   /// Navigationsbereich (mittlerer Block)
/////////////////////////////////////////////////// */

.nav-box {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px;
}

/* ////////////////////////////////////////////////
   /// Navigation
/////////////////////////////////////////////////// */

.nav-section {
  margin-bottom: 5px;
}

.nav-button {
  background-color: #7ea184;
  color: white;
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
  text-align: left;
  border: none;
  transition: background-color 0.2s;
}

.nav-button:hover {
  background-color: #6f9273;
}

.nav-submenu {
  display: none;
  padding-left: 8px;
  margin-top: 4px;
}

.nav-link {
  display: block;
  background-color: #9ab89d;
  color: white;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 3px;
  font-size: 12px;
  margin: 2px 0;
}

.nav-link:hover {
  background-color: #87a98f;
}

/* ////////////////////////////////////////////////
   /// Benutzerbox unten in der Sidebar
/////////////////////////////////////////////////// */

.user-box {
  background-color: #6e8470;
  color: #fff;
  padding: 10px 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  position: relative;
  gap: 4px;
}

.user-box .icon {
  font-size: 16px;
}

.user-box .username {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-toggle {
  cursor: pointer;
  font-size: 18px;
}

/* ////////////////////////////////////////////////
   /// Dropdown-Men� (Benutzerbox)
/////////////////////////////////////////////////// */

.dropdown-menu {
  display: none;
  position: absolute;
  bottom: 40px;
  left: 10px;
  background-color: #ffffff;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 5px;
  min-width: 120px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 1000;
}

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

.dropdown-menu a {
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  color: #333;
}

.dropdown-menu a:hover {
  background-color: #f0f0f0;
}

/* ////////////////////////////////////////////////
   /// Content-Bereich mit Iframe
/////////////////////////////////////////////////// */

.content {
  flex-grow: 1;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ////////////////////////////////////////////////
   /// Login-Seite
/////////////////////////////////////////////////// */

.login-container {
  width: 300px;
  margin: 100px auto;
  padding: 20px;
  background: #f4f4f4;
  border-radius: 8px;
  box-shadow: 0 0 10px #ccc;
  text-align: center;
}

.login-container input {
  width: 90%;
  padding: 8px;
  margin: 8px 0;
}

.login-container button {
  padding: 10px 20px;
}

.error {
  color: red;
}

.login-logo {
  max-width: 150px;
  margin-bottom: 20px;
}

/* ////////////////////////////////////////////////
   /// Content-Seite
/////////////////////////////////////////////////// */

.content-header {
  background-color: #bbf9c0;
  height: 90px;
  padding: 16px 24px;
  box-sizing: border-box;
}

.content-header h1 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.content-header .subtext {
  margin: 4px 0 0;
  font-size: 12px;
  color: #666;
}

.content-body {
  margin-top: 20px;       /* Abstand zum .content-header */
  margin-left: 10px;      /* Abstand zur Trennlinie */
}


/* ///////////////////////// */
/* DataTable Kopfbereich UI */
/* ///////////////////////// */

.datatable-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  margin-top: 20px;
}

.datatable-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.datatable-right {
  display: flex;
  align-items: center;
}

.btn-new-user {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
}

.btn-new-user:hover {
  background-color: #449c48;
}

/* CSV Export Button: styled similarly to .btn-new-user */
.btn-export-csv {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  margin-left: 8px;
}
.btn-export-csv:hover {
  background-color: #449c48;
}

.btn-new-garden {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
}

.btn-new-garden:hover {
  background-color: #449c48;
}

/* Trennlinie unterhalb der Toolbar */
.table-divider {
  height: 1px;
  background-color: #ccc;
  margin: 30px 10px 10px 10px;
}

/* Content-Body rechter Abstand */
.content-body {
  padding-right: 10px;
}

.table-divider {
  height: 1px;
  background-color: #ccc;
  margin: 30px 10px 10px 10px;
}

.bottom-divider {
  margin-top: 20px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background-color: #fff;
  padding: 20px 30px;
  border-radius: 8px;
  position: relative;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
}

.modal-close:hover {
  color: #000;
}

.modal-content form input,
.modal-content form select {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.modal-actions {
  text-align: right;
  margin-top: 15px;
}

.btn-save {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
}

.inline-checkbox {
  transform: scale(1.2);
  cursor: pointer;
}

.btn-delete-user {
  background-color: #c0392b;
  border: none;
  color: white;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 3px;
}

.btn-delete-user:hover {
  background-color: #e74c3c;
}

.btn-delete-garden {
  background-color: #c0392b;
  border: none;
  color: white;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 3px;
}

.btn-delete-garden:hover {
  background-color: #e74c3c;
}

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

.select2-container--default .select2-selection--single {
  height: 36px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 26px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
}

/* ////////////////////////////////////////////////
   /// Modernes Formular im Modal (Gartenanlage)
/////////////////////////////////////////////////// */

.form-standard {
  display: flex;
  flex-direction: column;
}

.form-standard .form-row {
  margin-bottom: 16px;
}

.form-standard label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
}

.form-standard input[type="text"],
.form-standard input[type="number"],
.form-standard select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  transition: border-color 0.2s ease-in-out;
}

.form-standard input:focus,
.form-standard select:focus {
  border-color: #69ab6d;
  outline: none;
}

.form-standard .checkbox-row {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* Styling f�r Select2 im Formular */
.select2-container {
  font-family: inherit;
  font-size: 14px;
}

.select2-container--default .select2-selection--single {
  height: 38px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 10px;
  background-color: #fff;
  box-sizing: border-box;
  transition: border-color 0.2s ease-in-out;
}

.select2-container--default .select2-selection--single:hover {
  border-color: #69ab6d;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 28px;
  color: #333;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px;
  right: 10px;
}

/* //// Readings */

.reading-missing {
  background-color: #f8d7da !important;
  color: #721c24;
}

.reading-available {
  background-color: #d4edda !important;
  color: #155724;
}

.reading-history-box {
  margin-top: 30px;
  padding: 15px;
  border-top: 1px solid #ccc;
  background: #f9f9f9;
}

.reading-history-box h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.modal-content.wide {
  width: 80%;
  max-width: 900px;
}

/* Einheitlicher Stil f�r nicht-editierbare Metafelder */
td.meta-cell {
  background-color: #f6f6f6;
  font-weight: 500;
}

table.dataTable tbody tr.odd {
  background-color: #fff;
}
table.dataTable tbody tr.even {
  background-color: #f9f9f9;
}

/* //// Modal f�r Z�hlerstand */

.modal-content.wide-modal {
  width: 80%;
  max-width: 1000px;
  padding: 20px;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-entry-table td {
  padding-right: 20px;
  vertical-align: top;
}

.modal-history {
  border-top: 1px solid #ccc;
  padding-top: 10px;
}

.modal-history-scroll {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  padding: 10px;
}

/* Grauer Hintergrund f�r getrennte Container */
.gray-background {
  background-color: #f4f4f4;
  padding: 15px 20px;
  border-radius: 6px;
}

/* Abstand zwischen Zeile 1 und Eingabezeile */
.input-row {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.input-block {
  flex: 1;
  min-width: 200px;
}

/* Button rechtsb�ndig unter Eingabe */
.modal-actions.right-align {
  text-align: right;
  margin-top: 20px;
}

/* Tabelle im Stil von users.php */
.simple-history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.simple-history-table thead {
  background-color: #e9e9e9;
}

.simple-history-table th,
.simple-history-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ccc;
}

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

.preview-thumb {
  height: 30px;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}
.preview-thumb:hover {
  transform: scale(6);
  z-index: 10;
  position: relative;
}

.reading-manual {
  background-color: #fff9d6; /* hellgelb */
}
.reading-auto {
  background-color: #9CFB97; /* hellgr�n */
}

.history-filters {
  margin-bottom: 10px;
  display: flex;
  gap: 20px;
}
.history-filters label {
  font-size: 0.9em;
}

#usersTable td {
  font-size: clamp(0.4em, 0.9vw, 1em);  /* passt sich automatisch an */
  word-break: break-word;
  white-space: normal;
  max-width: 180px;  /* verhindert zu breite Spalten */
}

#usersTable th {
  font-size: clamp(0.4em, 0.9vw, 1em);  /* passt sich automatisch an */
  word-break: break-word;
  white-space: normal;
  max-width: 180px;  /* verhindert zu breite Spalten */
}

#usersTable {
  table-layout: auto;
}

#usersTable_wrapper {
  overflow-x: hidden;
}

td.disabled-cell {
  color: #888;
  background: #685151;
  pointer-events: none;   /* verhindert Klick/Focus */
  opacity: .8;
}
td.required-missing {
  background: #ec3636 !important;    /* Rot-Ton für fehlende Pflicht */
}

