:root { color-scheme: light dark; }
body { font-family: system-ui, Arial, sans-serif; margin: 16px; }
.wrap { max-width: 1100px; margin: 0 auto; }
textarea {width: 100%; min-height: 140px; padding: 10px; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.row { 
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap; 
  margin-top: 12px; 
  align-items: center;

  &.zoomButtons{
    justify-content: right;
  }
}
label { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
input[type="checkbox"] { transform: translateY(1px);}
.chartShell {
  position: relative;
  margin-top: 12px;
}
canvas { display: block; width: 100%; height: 560px; box-shadow: 0 4px 20px rgba(0,0,0,0.25); border-radius: 8px; touch-action: none; }
.loadingOverlay {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #111;
  z-index: 2;
  pointer-events: all;
}
.loadingOverlayContent {
  position: absolute;
  left: 55px;
  right: 16px;
  inset-block: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.loadingOverlay[hidden] {
  display: none;
}
.loadingSpinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(0, 0, 0, 0.18);
  border-top-color: #006ad4;
  border-radius: 50%;
  animation: loadingSpin 0.8s linear infinite;
}
.notFoundIcon {
  position: relative;
  display: none;
  width: 34px;
  height: 34px;
  border: 3px solid #777;
  border-radius: 50%;
}
.notFoundIcon::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 3px;
  right: -11px;
  bottom: -5px;
  border-radius: 999px;
  background: #777;
  transform: rotate(45deg);
  transform-origin: left center;
}
.notFoundIcon::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 3px;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  background: #d95a70;
  transform: translate(-50%, -50%);
}
.loadingOverlay.isNotFound .loadingSpinner {
  display: none;
}
.loadingOverlay.isNotFound .notFoundIcon {
  display: block;
}
.loadingOverlay.isNotFound .loadingText {
  color: #777;
}
.loadingText {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
@keyframes loadingSpin {
  to {
    transform: rotate(360deg);
  }
}
.hint { opacity: .8; font-size: 13px; margin-top: 6px; }
.pill { padding: 2px 8px; border: 1px solid rgba(127,127,127,.35); border-radius: 999px; font-size: 12px; opacity: .85; }
.status { font-size: 13px; opacity: .85; }
.status b { opacity: 1; }
input[type="text"] { padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(127,127,127,.35); background: transparent; color: inherit; }
button { padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(127,127,127,.35); background: transparent; color: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
.loadBtn {
  width: 100%;
  padding: 10px;
  margin-top: 15px;
}

.dateInput{
  display:flex;
  padding-bottom: 10px;
  justify-content: center;
}

.dateInput input {
  margin-left: 10px;
  margin-right: 10px;
  text-align:center;
  width: 142px;
}

.machinePicker {
  display:flex;
  justify-content: center;
  padding-top: 20px;
  padding-bottom: 10px;
}

.machinePicker button {
  cursor: pointer;
}

.machinePicker select {
  width:160px;
  padding: 6px 8px; 
  margin: 0px 10px;
  border-radius: 8px;
  border: 1px solid rgba(127,127,127,.35);
  background: transparent; 
  color: inherit; 
  text-align:center
}

.machine-btn {
  padding: 6px 10px;
  border: 1px solid #999;
  background: #f2f2f2;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
}
.machine-btn.active {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}
.machine-btn:hover {
  background: #ddd;
}
.machine-name {
  align-self: center;
}
.zoomButtons{
  justify-items: right;
}

.mqttApiStatus {
  color: #000;
}

.mqttApiStatusValue.isConnected {
  color: #188a4b;
  font-weight: 700;
}

.mqttApiStatusValue.isDisconnected {
  color: #be3535;
  font-weight: 700;
}

.adminAuth {
  margin-top: 10px;
  font-size: 13px;
}

.adminAuthLine {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.adminAuthAuthorized {
  color: #188a4b;
  font-weight: 700;
}

.adminLogoutBtn {
  margin-left: 8px;
  padding: 3px 8px;
  font-size: 12px;
}

.adminAuthForm {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.adminAuthForm[hidden],
.adminAuthUser[hidden] {
  display: none;
}

.adminAuthUsername {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.adminAuthForm input:not(.adminAuthUsername) {
  width: min(100%, 220px);
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(127,127,127,.35);
  background: transparent;
  color: inherit;
  font: inherit;
}

.adminAuthMessage.isFailed {
  color: #be3535;
}

.adminPanel {
  position: relative;
  margin-top: 16px;
  border: 1px solid rgba(127,127,127,.35);
  border-radius: 8px;
  overflow: hidden;
}

.adminPanel.isUnavailable {
  opacity: .5;
  filter: grayscale(1);
}

.adminHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(127,127,127,.25);
}

.adminHeader h2 {
  margin: 0;
  font-size: 16px;
}

.adminMachine,
.adminTable {
  font-size: 13px;
}

.adminMachine {
  text-align: right;
  opacity: .9;
}


.adminTableWrap {
  width: 100%;
  overflow-x: auto;
}

.adminTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.adminTable th,
.adminTable td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(127,127,127,.22);
  text-align: left;
  vertical-align: middle;
}

.adminTable tr:last-child td {
  border-bottom: 0;
}

.adminTable th {
  font-size: 11px;
  text-transform: uppercase;
  opacity: .7;
}

.adminTable th:nth-child(1),
.adminTable td:nth-child(1) {
  width: 32%;
}

.adminTable th:nth-child(2),
.adminTable td:nth-child(2) {
  width: 18%;
}

.adminTable th:nth-child(3),
.adminTable td:nth-child(3) {
  width: 30%;
}

.adminTable th:nth-child(4),
.adminTable td:nth-child(4) {
  width: 20%;
  text-align: right;
}

.adminTable button {
  min-width: 78px;
}

.adminCurrentValue {
  overflow-wrap: anywhere;
}

.adminValue input,
.adminValue select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(127,127,127,.35);
  background: transparent;
  color: inherit;
  font: inherit;
}

.adminConfirmModal {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 46px 10px 10px;
  background: rgba(255, 255, 255, 0.68);
}

.adminConfirmModal[hidden] {
  display: none;
}

.adminConfirmBox {
  width: min(100%, 360px);
  border: 1px solid rgba(127,127,127,.35);
  border-radius: 8px;
  background: Canvas;
  color: CanvasText;
  box-shadow: 0 8px 26px rgba(0,0,0,.24);
  padding: 12px;
}

.adminConfirmBox h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.adminConfirmBox p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.adminConfirmActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.adminConfirmActions button {
  min-width: 74px;
}

.muted {
  opacity: .65;
}

@media (max-width: 520px) {
  body {
    margin: 10px;
  }

  .adminHeader {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .adminMachine {
    text-align: left;
  }

  .adminTable {
    min-width: 0;
  }

  .adminTable th,
  .adminTable td {
    padding: 8px 6px;
  }

  .adminCurrentValue.isDryingModeValue {
    font-size: 11px;
    line-height: 1.15;
  }

  .adminTable th:nth-child(1),
  .adminTable td:nth-child(1) {
    width: 32%;
  }

  .adminTable th:nth-child(2),
  .adminTable td:nth-child(2) {
    width: 18%;
  }

  .adminTable th:nth-child(3),
  .adminTable td:nth-child(3) {
    width: 30%;
  }

  .adminTable th:nth-child(4),
  .adminTable td:nth-child(4) {
    width: 20%;
  }

  .adminTable button {
    width: 100%;
    min-width: 0;
    padding-inline: 6px;
  }
}
