* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f5f7;
  color: #222;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.container {
  width: 100%;
  max-width: 1000px;
  margin: auto;
  padding: 30px 20px;
}

/* HEADER */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.subtitle {
  margin-top: 6px;
  color: #777;
  font-size: 13px;
}

/* SERVER STATUS */

.status {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.status.connected {
  color: #16803c;
}

.status.disconnected {
  color: #d93025;
}

/* MENU */

.menu {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.menu-item {
  padding: 10px 18px;
  background: white;
  color: #555;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .08);
  transition: background .2s, color .2s;
}

.menu-item:hover {
  background: #222;
  color: white;
}

/* SECTION */

.section {
  margin-top: 30px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.section-arrow {
  margin-left: auto;
  font-size: 12px;
  color: #999;
  transition: transform .2s;
}

.section.collapsed .section-arrow {
  transform: rotate(-90deg);
}

/* GRID */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.device-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

/* CARD */

.card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .08);
  min-width: 0;
}

.card-title {
  margin-bottom: 16px;
  font-size: 13px;
  color: #777;
  font-weight: 600;
}

.card-description {
  margin-top: -10px;
  margin-bottom: 16px;
  font-size: 11px;
  color: #999;
}

/* ROW */

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.row:last-child {
  border-bottom: 0;
}

.row>span:first-child {
  color: #555;
}

.value {
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

/* CONNECTION STATUS */

.value.connected {
  color: #16803c;
}

.value.disconnected {
  color: #d93025;
}

/* SENSOR GRID */

.sensor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

/* SENSOR BOX */

.sensor-box {
  padding: 15px;
  background: #f7f8fa;
  border-radius: 10px;
  min-width: 0;
}

.sensor-name {
  color: #777;
  font-size: 12px;
  font-weight: 600;
}

.sensor-value {
  margin: 10px 0;
  font-size: 30px;
  font-weight: 700;
  white-space: nowrap;
}

.sensor-unit {
  font-size: 14px;
  color: #777;
  font-weight: 500;
}

.sensor-status {
  margin-top: 15px;
  font-size: 11px;
  color: #16803c;
  font-weight: 600;
  word-break: break-word;
}

.sensor-status.sensor-offline {
  color: #999;
}

/* PROGRESS BAR */

.bar {
  height: 7px;
  margin-top: 8px;
  margin-bottom: 10px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  width: 0;
  height: 100%;
  background: #333;
  border-radius: 4px;
  transition: width .3s ease;
}

/* EMPTY */

.empty {
  padding: 30px 0;
  color: #999;
  text-align: center;
}

/* FOOTER */

.footer {
  margin-top: 30px;
  color: #999;
  font-size: 11px;
  text-align: center;
}

/* TABLET */

@media (max-width: 800px) {
  .container {
    padding: 25px 18px;
  }

  .device-grid {
    grid-template-columns: 1fr;
  }

  .sensor-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* MOBILE */

@media (max-width: 700px) {
  .container {
    padding: 20px 15px;
  }

  .header {
    margin-bottom: 18px;
  }

  h1 {
    font-size: 24px;
  }

  .subtitle {
    font-size: 12px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .device-grid {
    grid-template-columns: 1fr;
  }

  .sensor-grid {
    grid-template-columns: 1fr;
  }

  .section {
    margin-top: 25px;
  }

  .card {
    padding: 18px;
  }

  .sensor-value {
    font-size: 28px;
  }
}

/* SMALL MOBILE */

@media (max-width: 450px) {
  .container {
    padding: 18px 12px;
  }

  .header {
    align-items: flex-start;
    gap: 10px;
  }

  h1 {
    font-size: 22px;
  }

  .status {
    font-size: 11px;
  }

  .menu {
    gap: 6px;
  }

  .menu-item {
    padding: 9px 14px;
    font-size: 12px;
  }

  .card {
    padding: 16px;
  }

  .row {
    gap: 10px;
    font-size: 13px;
  }

  .sensor-value {
    font-size: 26px;
  }
}