/* === BASISSTILE === */
html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background: #f6f8fa;
  min-height: 100vh;
}

/* === CONTAINER UND GRUNDELEMENTE === */
.container {
  max-width: 460px;
  margin: 5vh auto 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
  padding: 2em;
  transition: .3s;
}

h1 {
  font-size: 2rem;
  margin: 0 0 1.5em 0;
  text-align: center;
  letter-spacing: 2px;
  font-weight: 700;
}

label {
  font-size: .95rem;
  font-weight: 500;
  margin-top: .9em;
  display: block;
}

.input-wrap {
  margin-bottom: 1.4em;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  box-sizing: border-box;
  padding: .75em 1em;
  border-radius: 8px;
  border: 1px solid #cfd8dc;
  font-size: 1.1em;
  background: #f6f8fa;
  outline: none;
  display: block;
  transition: box-shadow .2s, border-color .2s;
}

input:focus,
select:focus {
  box-shadow: 0 0 0 2px #3182ce33;
  border-color: #3182ce;
}

select {
  appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg width="14" height="14" viewBox="0 0 20 20" fill="gray" xmlns="http://www.w3.org/2000/svg"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 1em center;
  background-size: 1.1em;
}

.btn {
  display: inline-block;
  background: #3182ce;
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: .9em 2em;
  font-size: 1.1em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(49, 130, 206, .07);
  transition: background .2s, transform .2s;
}

.btn:active {
  background: #2959a6;
  transform: scale(.97);
}

.add-btn {
  background: #10b981;
  margin-left: 1em;
}

/* === ANIMATIONEN UND HINWEISE === */
.fadein {
  opacity: 0;
  animation: fadein .6s forwards;
}

@keyframes fadein {
  to {
    opacity: 1;
  }
}

.error {
  color: #e53e3e;
  font-size: 1em;
  text-align: center;
  margin-bottom: .8em;
}

.loader {
  margin: 2em auto;
  border: 4px solid #cfd8dc;
  border-top: 4px solid #3182ce;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* === DASHBOARD-BEREICH === */
.dashboard {
  max-width: 900px;
  margin: 5vh auto 0;
  padding: 2em;
}



.dashboard-content {
  flex: 1 1 0%;
  min-width: 0;
  padding: 2.3em;
  background: transparent;
  overflow-y: auto;
}
/*
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}
*/

.dashboard-layout {
  display: flex;
  height: 100vh;         /* Gesamthöhe des Viewports */
  width: 100vw;
  overflow: hidden;      /* Keine Scrollbars für den gesamten Body */
}
/* === SYSTEMINFO UND USERBOXEN === */
.sysinfo,
.users-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  margin-bottom: 2em;
  padding: 1.5em;
}

.sysinfo {
  border-left: 7px solid #3182ce;
}

/* === USER-TABELLE === */

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.users-table {
  width: 100%;
  min-width: 600px;    /* Optional, an deine Spalten anpassen */
  border-collapse: collapse;
  margin-top: .8em;
}

.users-table th,
.users-table td {
  padding: .8em 1em;
  text-align: left;  
}

@media (max-width: 600px) {
  .users-table th, .users-table td {
    padding: .5em .4em;
    font-size: 0.98em;
  }
}

.users-table th {
  background: #f6f8fa;
}

.users-table tr {
  transition: background .2s;
}

.users-table tr:hover {
  background: #eaf3fb;
}



.orders-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  margin-bottom: 2em;
  padding: 1.5em;
}

.orders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.orders-table {
  width: 100%;
  min-width: 600px;    /* Optional, an deine Spalten anpassen */
  border-collapse: collapse;
  margin-top: .8em;
}

.orders-table th,
.orders-table td {
  padding: .8em 1em;
  text-align: left;  
  font-size: 14px
}

@media (max-width: 600px) {
  .orders-table th, .orders-table td {
    padding: .5em .4em;
    font-size: 0.98em;
  }
}

.orders-table th {
  background: #fafaf6;
}

.orders-table tr {
  transition: background .2s;
}

.orders-table tr:hover {
  background: #eaf3fb;
}

/* === MODAL === */
.modal-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0005;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadein .15s;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 2em;
  min-width: 320px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .19);
}

.modal h2 {
  font-size: 1.4em;
  margin: 0 0 1em 0;
}

.modal-close {
  float: right;
  color: #aaa;
  font-size: 1.2em;
  cursor: pointer;
}

/* === SYSINFO CARD UND SECTIONS === */
.sysinfo-card {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  padding: 2em 1.5em;
  margin-bottom: 2em;
  justify-content: space-between;
}

.sysinfo-section {
  flex: 1 1 220px;
  min-width: 220px;
}

.sysinfo-section:not(:last-child) {
  border-right: 1px solid #f0f3f8;
  padding-right: 2em;
}

.sysinfo-title {
  font-size: 1.1em;
  color: #2563eb;
  margin-bottom: 0.7em;
  font-weight: bold;
  letter-spacing: 1px;
}

.sysinfo-value {
  font-size: 1.4em;
  font-weight: bold;
  margin-bottom: .2em;
  color: #10b981;
}

.sysinfo-label {
  font-size: .98em;
  color: #666;
  margin-bottom: 1.3em;
}

.sysinfo-note {
  color: #eab308;
  font-size: 1em;
  margin-top: 1.1em;
}

/* === SYSTEMBALKEN === */
.sys-bar {
  width: 100%;
  background: #f1f5f9;
  border-radius: 8px;
  height: 20px;
  position: relative;
  margin-bottom: .6em;
  margin-top: .2em;
  box-shadow: 0 1px 4px #e5e7eb inset;
}

.sys-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.7s, background 0.3s;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
}

.sys-bar-label {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: .98em;
  color: #333;
  line-height: 20px;
  pointer-events: none;
}

.sys-bar-danger {
  background: linear-gradient(90deg, #fbbf24, #f87171);
}

.sys-bar-warn {
  background: linear-gradient(90deg, #facc15, #fbbf24);
}

.sys-bar-ok {
  background: linear-gradient(90deg, #34d399, #38bdf8);
}

/* === SIDEBAR-LAYOUT === */
#sidebarWrapper {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background: transparent;
  transition: all .25s;
}

.sidebar {
  width: 300px;
  min-width: 240px;
  background: linear-gradient(120deg, #2d3748 80%, #3b82f6 150%);
  color: #fff;
  border-top-right-radius: 22px;
  border-bottom-right-radius: 22px;
  box-shadow: 4px 0 18px rgba(44, 62, 80, 0.09);
  padding-top: 2.5em;
  display: flex;
  flex-direction: column;
  transition: width .22s cubic-bezier(.5, .1, .5, 1), min-width .22s cubic-bezier(.5, .1, .5, 1);
  flex-shrink: 0;
}

.sidebar-logo {
  font-size: 1.5em;
  font-weight: bold;
  padding: 0 2em 2.2em 2em;
  letter-spacing: 1.3px;
  color: #f9fafb;
  text-shadow: 0 2px 16px #28334770;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  width: 100%;
}

.sidebar li {
  margin-bottom: 1.4em;
  width: 95%;
}

.sidebar a {
  color: #fff;
  text-decoration: none;
  font-size: 1.14em;
  padding: .85em 1.6em .85em 2.2em;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: .75em;
  font-weight: 500;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgba(49, 130, 206, .03);
  transition: background .16s, color .16s, box-shadow .16s, padding .2s;
  white-space: normal;
  max-width: 100%;
  line-height: 1.3;
}

.sidebar a span {
  display: inline-block;
  width: 1.4em;
  text-align: center;
  flex-shrink: 0;
}

.sidebar li.active a,
.sidebar a:hover {
  background: linear-gradient(90deg, #3182ce 90%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 4px 16px #2563eb22;
  border-left: 6px solid #38bdf8;
  font-weight: 600;
  letter-spacing: 0.7px;
}

.sidebar li.active a {
  filter: brightness(1.08) saturate(1.1);
}

.sidebar a:active {
  background: #2959a6;
  color: #dbeafe;
}

/* === SIDEBAR COLLAPSED === */
#sidebarWrapper.sidebar-collapsed .sidebar {
  width: 60px;
  min-width: 60px;
  padding-top: 1.2em;
}

#sidebarWrapper.sidebar-collapsed .sidebar-logo span,
#sidebarWrapper.sidebar-collapsed .sidebar-text {
  display: none;
}

#sidebarWrapper.sidebar-collapsed .sidebar a {
  padding: .85em 0 .85em 0.5em;
  justify-content: center;
}

#sidebarWrapper.sidebar-collapsed .sidebar ul {
  padding: 0;
}

#sidebarWrapper.sidebar-collapsed .sidebar li {
  margin-bottom: 1.1em;
  width: 100%;
}

#sidebarWrapper.sidebar-collapsed .sidebar-logo {
  padding-left: .3em;
  padding-right: .3em;
}


/* === RESPONSIVE BREAKPOINTS === */
@media (max-width: 900px) {
  .sysinfo-card {
    flex-direction: column;
    gap: 1em;
  }

  .sysinfo-section {
    border-right: none !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 800px) {
  .sidebar {
    width: 58px;
    min-width: 58px;
    border-radius: 0 12px 12px 0;
    padding-top: 1em;
    align-items: center;
  }

  .sidebar-logo span {
    display: none;
  }

  .sidebar-logo {
    padding: 0 .2em 1.2em .2em;
  }

  .sidebar a {
    font-size: 1.2em;
    padding: .75em 0;
  }

  .sidebar-text {
    display: none !important;
  }
}

@media (max-width: 600px) {

  .container,
  .dashboard {
    max-width: 98vw;
    margin: 2vh auto 0;
  }

  .sysinfo,
  .users-box {
    padding: .6em;
  }

  .modal {
    padding: 1em;
  }
}