body { display: flex; font-family: Arial,sans-serif; margin:0; background:#f9f9f9; color:#333; }

.sidebar {
  width: 220px;
  background: #f0f0f0;
  color: #333;
  padding: 20px;
  border-right: 1px solid #ccc;

  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar h3 { margin-top:0; font-size:20px; border-bottom:1px solid #ccc; padding-bottom:10px; }
.sidebar ul { list-style:none; padding:0; margin-top:10px; }
.sidebar li { margin:8px 0; cursor:pointer; padding:5px 8px; border-radius:4px; transition:0.2s; }
.sidebar li:hover, .sidebar li.active { background:#d0d0d0; }

.container { flex:1; padding:25px; position:relative; }

#addBtn { 
		margin: 10px;
	background:#27ae60; 
	color:#fff; 
	padding:15px 20px;	 
	border:none; 
	border-radius:11px; 
	cursor:pointer; 
	margin-bottom:20px;
	
	transition: all 2s ease;
}
#addBtn:hover { background:#2ecc71; }

.items-table { width:100%; border-collapse:collapse; overflow:visible; background:#fff; border-radius:6px; }
.items-table th, .items-table td { padding:15px; text-align:left; position:relative; overflow:visible; }
.items-table th { background:#3498db; color:#fff; }
.items-table tr:nth-child(even) { background:#f8f8f8; }
.items-table tr:hover { background:#e1f0ff; }




.editable { padding:4px 6px; border-radius:4px; }
.editable:focus { outline:2px solid #3498db; background:#f0f8ff; }

.dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown Button (☰) */
.dropdown .btn {
  background: #3385ff;
  border: none;
  color: #fff;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropdown .btn:hover {
  background: #2672e6;
}

/* Dropdown Content */
.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  min-width: 140px;
  border-radius: 8px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  z-index: 100000;
  overflow: hidden;
  transition: all 0.25s ease;
}

/* Buttons innerhalb des Dropdowns */
.dropdown-content button {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  border-bottom: 1px solid #eee;
  border-radius: 0;
}

.dropdown-content button:last-child {
  border-bottom: none;
}

/* Farbliche Gestaltung der Buttons */
.dropdown-content .btn-plus { color: #27ae60; font-weight: 600; }
.dropdown-content .btn-minus { color: #e67e22; font-weight: 600; }
.dropdown-content .btn-delete { color: #e74c3c; font-weight: 600; }

/* Hover Effekte für die Buttons */
.dropdown-content button:hover {
  background-color: #f0f4ff;
}

/* Dropdown anzeigen beim Hover */
.dropdown:hover .dropdown-content {
  display: block;
}

/* Inline Save Button daneben */
.btn-save-inline {
  position: absolute;
  right: 45px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-save-inline:hover {
  background-color: #45a049;
}


.modal { display:none; position:fixed; z-index:100; left:0; top:0; width:100%; height:100%; background:rgba(0,0,0,0.4); }
.modal-content { background:#fff; margin:10% auto; padding:25px; width:350px; border-radius:10px; position:relative; box-shadow:0 5px 15px rgba(0,0,0,0.15); }
.modal-content input { width:100%; margin:8px 0; padding:8px; border-radius:6px; border:1px solid #ccc; box-sizing:border-box; }
.modal-content button { width:100%; padding:10px; margin-top:12px; background:#27ae60; border:none; border-radius:6px; color:#fff; cursor:pointer; }
.modal-content button:hover { background:#2ecc71; }
.close { position:absolute; top:10px; right:15px; font-size:26px; cursor:pointer; color:#888; }
.close:hover { color:#333; }

#modalCategory {
    width: 100%;
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;   
    font-size: 14px;
    appearance: none;           
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

#modalCategory:hover {
    border-color: #3498db;
    background-color: #f0f8ff;
}

#modalCategory:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    background-color: #f0f8ff;
}

#loginModal{
	background: rgba(0, 0, 0, 1);
}

#loginModal .modal-content {
    width: 300px;
}
#loginModal input {
    width: 100%;
    padding: 10px;
    margin: 6px 0;
    border-radius: 6px;
    border: 1px solid #ccc;
}
#loginBtn {
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    border: none;
    border-radius: 6px;
    background-color: #3498db;
    color: white;
    cursor: pointer;
}
#loginBtn:hover { background-color: #2980b9; }

/* ======================
   Tabellen & Dropdown
   ====================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

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

table th {
  background: #f6f8fa;
  font-weight: 600;
  color: #444;
}

.editable {
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s;
}

.editable:focus {
  outline: none;
  background: #e6f0ff;
  border: 1px solid #99c2ff;
}

.category-select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  transition: border 0.2s, box-shadow 0.2s;
}

.category-select:hover {
  border-color: #66a3ff;
}

.category-select:focus {
  outline: none;
  border-color: #3385ff;
  box-shadow: 0 0 4px rgba(51,133,255,0.4);
}

/* ======================
   Dropdown Menü (☰)
   ====================== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown .btn {
  background: #3385ff;
  border: none;
  color: white;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown .btn:hover {
  background: #2672e6;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background: #fff;
  min-width: 120px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  border-radius: 8px;
  z-index: 100;
}

.dropdown-content button {
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.dropdown-content button:hover {
  background: #f0f4ff;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.qr-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
}

/* Dialog */
.qr-dialog {
  width: 90%;
  max-width: 400px;
  padding: 20px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  color: #000;
}

body.dark-mode .qr-dialog {
  background: #2c2c2c;
  color: #eee;
}

/* Input */
.qr-dialog input[type="number"] {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  color: #000;
  box-sizing: border-box;
}

body.dark-mode .qr-dialog input[type="number"] {
  border: 1px solid #555;
  background: #3a3a3a;
  color: #eee;
}

/* Buttons Container */
.qr-actions {
  display: flex;
  gap: 10px;
}

/* Buttons */
.qr-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: none;
  color: #fff;
  cursor: pointer;
}

.qr-actions button#qrAddBtn {
  background: #2ecc71;
}

body.dark-mode .qr-actions button#qrAddBtn {
  background: #27ae60;
}

.qr-actions button#qrRemoveBtn {
  background: #e74c3c;
}

body.dark-mode .qr-actions button#qrRemoveBtn {
  background: #c0392b;
}

/* ======================
   Inline Speichern-Button
   ====================== */
.btn-save-inline {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 6px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  z-index: 2;
}

.btn-save-inline:hover {
  background-color: #45a049;
}


td:last-child {
  position: relative;
  padding-right: 40px;
}

#productSearch {
  padding: 8px 14px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  width: 250px;
  transition: all 2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#productSearch:focus {
  border-color: #3385ff;
  box-shadow: 0 2px 8px rgba(51, 133, 255, 0.3);
}




#categoryMenu li {
  list-style: none;
  padding: 10px 12px 10px 28px;
  margin: 4px 0;
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #425c77;
  font-weight: 500;
  color: #fff;
}

#categoryMenu li.has-children::before {
  content: "▶";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  transition: transform 0.2s ease;
}


#categoryMenu li:hover, 
#categoryMenu li.active {
  background-color: #86bfe6;
  color: #2c3e50;
}

#categoryMenu li > ul {
  margin-top: 4px;
  margin-left: 20px;
  padding-left: 0;
  transition: max-height 0.3s ease;
  overflow: hidden;
}

#categoryMenu li.has-children::before {
  content: "▶";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  transition: transform 0.25s ease;
}

#categoryMenu li.has-children.open::before {
  transform: rotate(90deg);
}

.user-menu {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 200;
}

.user-menu button {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: #3385ff;
  color: rgb(0, 0, 0);
  cursor: pointer;
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  margin-top: 4px;
  background: #eee5e5;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 1000;
}

.user-dropdown button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}

.user-dropdown button:hover {
  background: #f0f4ff;
}

#userBtn{
	display:none;
}

/* Container zentrieren */
.login-container {
  max-width: 300px;
  margin: 100px auto;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  text-align: center;
  font-family: Arial, sans-serif;
  color: #000;
}

/* Inputs */
.login-container input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  color: #000;
  background-color: #fff;
  box-sizing: border-box;
}

/* Buttons */
.login-container button {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border: none;
  border-radius: 6px;
  background-color: #3385ff;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}

.login-container button:hover {
  background-color: #2672e6;
}

#qrScanner {
  display: none;
  position: fixed;
  top:0; left:0;
  width:100vw; height:100vh;
  background: rgba(0,0,0,0.75);
  z-index: 99999;
  justify-content: center;
  align-items: center;
}
#qrScannerContent {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#qrScannerVideo video {
  width: 90vw;
  max-width: 400px;
  border: 4px solid #000;
  border-radius: 12px;
}
#qrScannerClose {
  margin-top: 15px;
  padding: 6px 12px;
  cursor: pointer;
  background: #e74c3c;
  color:white;
  border:none;
  border-radius:6px;
  font-weight:bold;
}
#qrScannerClose:hover { background: #c0392b; }

#scanQRBtn {
	margin: 10px;
	background:#596eda; 
	color:#fff; 
	padding:15px 20px;	 
	border:none; 
	border-radius:11px; 
	cursor:pointer; 
	margin-bottom:20px;

	transition: all 2s ease;
}

.csv-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.csv-container {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  max-height: 80vh;
  overflow-y: auto;
  width: 90%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

.csv-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.csv-btn {
  padding: 6px 12px;
  cursor: pointer;
  border: none;
  border-radius: 4px;
}

.csv-btn.cancel {
  background: #eee;
}

.csv-btn.import {
  background: #3498db;
  color: white;
}

.admin-overlay {
  position: fixed;
  top:0; left:0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5);
  display:flex;
  justify-content:center;
  align-items:center;
  z-index: 10000;
}

.admin-container {
  background: #fff;
  color: #000;
  padding: 20px;
  border-radius: 10px;
  max-height: 80vh;
  width: 90%;
  max-width: 700px;
  overflow-y: auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  position: relative;
}

body.dark-mode .admin-container {
  background: #2c2c2c;
  color: #eee;
}

.admin-close-btn {
  position:absolute;
  top:10px; right:10px;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

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

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

.admin-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.admin-btn {
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.admin-btn.delete { background: #e74c3c; color:white; }
.admin-btn.export { background: #3498db; color:white; }

body.dark-mode .admin-btn.delete { background: #c0392b; }
body.dark-mode .admin-btn.export { background: #2980b9; }

/* Overlay */
#userMgmtOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Container */
#userMgmtInline {
  position: relative;
  padding: 60px 40px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

body.dark-mode #userMgmtInline {
  background: #2c2c2c;
  color: #eee;
}

body:not(.dark-mode) #userMgmtInline {
  background: #f9f9f9;
  color: #000;
}

/* Close button */
#userMgmtInline .close-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

/* Scroll area */
#userMgmtInline .scroll-area {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}


.user-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.user-row input,
.user-row select {
  padding: 6px 8px;
  font-size: 14px;
  border-radius: 4px;
  min-width: 100px;
}

body.dark-mode .user-row input,
body.dark-mode .user-row select {
  background: #3a3a3a;
  border: 1px solid #555;
  color: #eee;
}

body:not(.dark-mode) .user-row input,
body:not(.dark-mode) .user-row select {
  background: #fff;
  border: 1px solid #ccc;
  color: #000;
}


#userMgmtInline .logged-in-info {
  position: absolute;
  bottom: 10px;
  left: 20px;
  font-size: 14px;
  color: inherit;
}

#categoryEditorOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  animation: fadeInOverlay 0.2s ease;
}

/* Box innen */
#categoryEditorContainer {
  background: #fff;
  padding: 20px 30px;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 5px 25px rgba(0,0,0,0.3);
  animation: slideIn 0.25s ease;
}

/* Close-Button */
#categoryEditorContainer .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #555;
}
#categoryEditorContainer .close-btn:hover {
  color: #e74c3c;
}

/* Zeilen für Kategorien */
.category-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* Eingabefeld */
.category-row input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

/* Buttons */
.category-row button {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  background: #3498db;
  color: white;
  transition: background 0.2s;
}
.category-row button:hover {
  background: #2980b9;
}

#categoryEditorContainer .close-btn {
	position: fixed;
   	top: 10px; right: 10px;
   	background: transparent;
   	border: none;
   	font-size: 22px;
   	cursor: pointer;
   	text-align: right;
}

/* ==========================
   Global Dark Mode
   ========================== */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
  transition: background 0.3s ease, color 0.3s ease;
  font-family: Arial, sans-serif;
}

/* ==========================
   Container, Sidebar, Modals
   ========================== */
body.dark-mode .container,
body.dark-mode .sidebar,
body.dark-mode .modal-content,
body.dark-mode .user-dropdown {
  background-color: #1e1e1e;
  color: #e0e0e0;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ==========================
   Sidebar Dark Mode
   ========================== */
body.dark-mode .sidebar {
  background-color: #1b1b1b;
  position: sticky;
  top: 0px;
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  border: none; 
}

body.dark-mode #userBtn {
	
}

body.dark-mode #qrScannerContent {
	background-color: #1b1b1b;
}

body.dark-mode .sidebar h2 {
  color: #fff;
	padding-top: 25px;
  padding-bottom: 10px;
  margin-top: 0;
  border: none;
}

body.dark-mode #categoryMenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.dark-mode #categoryMenu li {
  position: relative;
  padding: 10px 12px 10px 28px;
  margin: 4px 0;
  border: none;
  background-color: #2c2c2c;
  color: #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-weight: 500;
}

body.dark-mode #categoryMenu li:hover,
body.dark-mode #categoryMenu li.active {
  background-color: #444;
  color: #fff;
  font-weight: bold;
}

body.dark-mode #categoryMenu li > ul {
  margin: 4px 0 0 20px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  list-style: none;
}

body.dark-mode #categoryMenu li > ul li {
  background-color: #333;
  padding-left: 36px;
  border: none;
  border-radius: 4px;
}

body.dark-mode #categoryMenu li > ul li:hover,
body.dark-mode #categoryMenu li > ul li.active {
  background-color: #555;
  color: #fff;
}

body.dark-mode #categoryMenu li.has-children::before {
  content: "▶";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #e0e0e0;
  transition: transform 0.25s ease;
}

body.dark-mode #categoryMenu li.has-children.open::before {
  transform: translateY(-50%) rotate(90deg);
}

body.dark-mode #categoryMenu li.has-children.open > ul {
  max-height: 500px; 
}

/* ==========================
   Tabelle
   ========================== */
body.dark-mode table {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border-collapse: collapse;
  width: 100%;
  border: 1px solid #333;
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode th {
  background-color: #2a2a2a;
  color: #fff;
  font-weight: bold;
  transition: background 0.25s ease, color 0.25s ease;
}

body.dark-mode td {
  color: #e0e0e0;
  border-bottom: 1px solid #333;
  transition: background 0.25s ease, color 0.25s ease;
}

body.dark-mode .category-header td {
  background-color: #2c2c2c;
  color: #fff;
  font-weight: bold;
}

body.dark-mode .dark-mode-row {
  background-color: #1e1e1e;
  color: #e0e0e0;
  transition: background 0.25s ease;
}

body.dark-mode .dark-mode-row:nth-of-type(even) {
  background-color: #232323;
}

body.dark-mode .dark-mode-row:hover {
  background-color: #2a2a2a !important;
}

/* ==========================
   Inputs & Selects
   ========================== */
body.dark-mode input,
body.dark-mode select,
body.dark-mode .editable,
body.dark-mode #modalCategory,
body.dark-mode #productSearch {
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #555;
  border-radius: 4px;
  transition: background 0.25s ease, border 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

body.dark-mode input::placeholder,
body.dark-mode select::placeholder {
  color: #aaa;
}

/* ==========================
   Buttons & Dropdowns
   ========================== */
body.dark-mode button,
body.dark-mode .dropdown .btn,
body.dark-mode .dropdown-content button,
body.dark-mode .btn-save-inline {
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border 0.25s ease;
}

body.dark-mode button:hover,
body.dark-mode .dropdown .btn:hover,
body.dark-mode .dropdown-content button:hover,
body.dark-mode .btn-save-inline:hover {
  background-color: #555;
}


body.dark-mode .dropdown-content {
  background-color: #1f1f1f;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: all 0.25s ease;
}


body.dark-mode .modal {
  background-color: rgba(0, 0, 0, 0.6);
  transition: background 0.25s ease;
}

/* ==========================
   User Management Box
   ========================== */
body.dark-mode #userMgmtInline {
  background: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #333;
  transition: background 0.25s ease, color 0.25s ease, border 0.25s ease;
}

body.dark-mode #userMgmtInline input,
body.dark-mode #userMgmtInline select,
body.dark-mode #userMgmtInline button {
  transition: background 0.25s ease, border 0.25s ease, color 0.25s ease;
}




body.dark-mode .editable {
  border: none;           
  background: transparent; 
  color: #fff;         
  padding: 2px 4px;
  outline: none;          
}


body.dark-mode .editable:focus {
  border: 1px dashed #fff;
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

/* ======================= */
/* Darkmode Kategorie-Editor */
/* ======================= */
body.dark-mode #categoryEditorOverlay {
  background: rgba(0, 0, 0, 0.8);
}

body.dark-mode #categoryEditorContainer {
  background: #1e1e1e;
  color: #f0f0f0;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.7);
}

body.dark-mode #categoryEditorContainer .close-btn {
  color: #bbb;
}
body.dark-mode #categoryEditorContainer .close-btn:hover {
  color: #ff6b6b;
}

body.dark-mode .category-row input {
  background: #2b2b2b;
  border: 1px solid #444;
  color: #f0f0f0;
}

body.dark-mode .category-row button {
  background: #3b82f6;
}
body.dark-mode .category-row button:hover {
  background: #2563eb;
}

@media (max-width: 1657px max-width: 900px) {
	.container h1 {
		color: #1e1e1e;
	}
}

@media (min-width: 901px) {
  .user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
  }

  .user-menu:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  }

  .user-dropdown {
    display: flex !important;
    position: static;
    background: transparent;
    gap: 10px;
    margin: 0;
  }

  .user-dropdown button {
    background: #3385ff;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }

  .user-dropdown button:hover {
    background: #2672e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  }


  body.dark-mode .user-menu {
    background: rgba(30,30,30,0.9);
    backdrop-filter: blur(6px);
  }

  body.dark-mode .user-dropdown button {
    background: #3b82f6;
    color: #fff;
  }

  body.dark-mode .user-dropdown button:hover {
    background: #2563eb;
  }
}


/*================*/
/* media querys*/
/*================*/


@media (max-width: 900px) {
  .sidebar { display: none; }
  header, .site-header { display: none; }
  body { font-size: 16px; overflow-x: hidden; }
  .container { padding: 12px; }

  #categoryDropdownMobile {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    font-size: 16px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
  }
	
  .admin-container .admin-close-btn{
		position: fixed;
  		right: 10px;
  		background: transparent;
  		border: none;
  		font-size: 22px;
  		cursor: pointer;
	 	text-align: right;
	}

  #productSearch,
  #addBtn,
  button {
    width: 100%;
    font-size: 16px;
    padding: 14px;
    margin-bottom: 12px;
    min-height: 48px;
    border-radius: 8px;
    box-sizing: border-box;
  }

  #qrScannerVideo video {
    width: 100%;
    max-width: 360px;
    border-radius: 12px;
  }

  #qrScannerContent {
    padding: 15px;
    width: 95%;
    max-width: 400px;
  }

  #productSearch { width: 100%; }
	
	#categoryEditorContainer button {
		padding: 0px;
		min-height: 40px;
		margin-top: 10px;
		max-width: 75px;
	}
	#categoryEditorContainer input {
		padding: 0px;
		min-height: 40px;
	}
	#categoryEditorContainer .close-btn {
		position: fixed;
    	top: 10px; right: 10px;
    	background: transparent;
    	border: none;
    	font-size: 22px;
    	cursor: pointer;
    	text-align: right;
	}
	#userBtn {
    display: block;
  }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  header, .site-header { display: none; }
  body { font-size: 16px; overflow-x: hidden; }
  .container { padding: 12px; }

  #categoryDropdownMobile {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    font-size: 16px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
  }

  #productSearch,
  #addBtn,
  #scanQRBtn,
  button {
    width: 100%;
    margin-left: 0px;
    font-size: 16px;
    padding: 14px;
    margin-bottom: 12px;
    min-height: 48px;
    border-radius: 8px;
    box-sizing: border-box;
  }

  .items-table,
  .items-table tbody { display: block; }

  #itemsTable thead tr th { display: none; }
  #itemsTable thead tr { display: none; }
  .items-table tr {
    display: block;
    margin-bottom: 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 12px;
    box-sizing: border-box;
  }

  .items-table td {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 15px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    position: relative;
  }

  .items-table td::before {
    content: attr(data-label);
    font-weight: bold;
    width: 50%;
    margin-bottom: 4px;
  }

  .btn-save-inline {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border-radius: 8px;
  }

  .dropdown {
    position: relative;
    width: 100%;
  }

  .dropdown .dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: none;
    z-index: 2000;
  }

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

  .dropdown .dropdown-content button {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 16px;
    border-bottom: 1px solid #eee;
  }

  .dropdown .dropdown-content button:last-child {
    border-bottom: none;
  }

  body.dark-mode .dropdown .dropdown-content {
    background: #2c2c2c;
    border-color: #444;
  }

  body.dark-mode .dropdown .dropdown-content button {
    color: #eee;
  }

  body.dark-mode .dropdown .dropdown-content button:hover {
    background: #3a3a3a;
  }

  .modal-content {
    width: 80%;
    max-height: 80vh;
    margin: 15% auto;
    margin-top: 200px;
    padding: 20px;
    font-size: 15px;
    overflow-y: auto;
  }

  #userMgmtInline {
    width: 90%;
    padding: 30px 10px;
  }
  #userMgmtInline button {
    font-size: 12px;
    padding: 2px 2px;
    margin-top: 12px;
    border-radius: 4px;
    min-height: 32px;
    border: none;
    line-height: 1;
  }
  #userMgmtInline .close-btn {
    position: fixed;
  	right: 10px;
  	background: transparent;
  	border: none;
  	font-size: 22px;
  	cursor: pointer;
	 text-align: right;
  }
  .user-row input {
    padding: 0px;
  }

  .admin-container {
    width: 90%;
	padding: 10px;
  }
  .admin-container .admin-close-btn {
    position: fixed;
    top: 10px; right: 10px;
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    text-align: right;
  }

  .modal-content input,
  .modal-content select {
    width: 100%;
    font-size: 15px;
    padding: 12px;
    margin-bottom: 10px;
    box-sizing: border-box;
  }

  #qrScannerVideo video {
    width: 100%;
    max-width: 360px;
    border-radius: 12px;
  }

  #qrScannerContent {
    padding: 15px;
    width: 95%;
    max-width: 400px;
  }

  #productSearch { width: 100%; }

  body.dark-mode .items-table tr {
    background: #1e1e1e;
    color: #e0e0e0;
    border-bottom: 1px solid #333;
  }
	
	#categoryEditorContainer button {
		padding: 0px;
		min-height: 40px;
		margin-top: 10px;
		max-width: 75px;
	}
	#categoryEditorContainer input {
		padding: 0px;
		min-height: 40px;
	}
	#categoryEditorContainer .close-btn {
		position: fixed;
    	top: 10px; right: 10px;
    	background: transparent;
    	border: none;
    	font-size: 22px;
    	cursor: pointer;
    	text-align: right;
	}

  body.dark-mode .items-table tr:nth-of-type(even) { background: #232323; }

  body.dark-mode .items-table tr:hover { background: #2a2a2a; }

  body.dark-mode .items-table tr.category-header td {
    background-color: #2c2c2c !important;
    font-weight: bold;
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    box-sizing: border-box;
  }
	
	.category-header td {
		font-size: 18px;
	}
}

@media (max-width: 405px) {
  #userBtn {
  	/*display: none;*/	
  }
	.container h1 {
		font-size: 20px;
		margin-bottom: 50px;
	}

}

@media (max-width: 300px) {
  #userBtn {
  	/*display: none;*/	
  }
	.container h1 {
		font-size: 15px;
	}

}