html {
  font-family: Arial, Helvetica, sans-serif; 
  display: block; 
  text-align: center;
  height: 100vh;
  overflow: hidden;
}

h1 {
  font-size: 1.8rem; 
  color: rgb(0, 0, 0);
}
h3 {
  font-size: 0.8rem; 
  color: rgb(0, 0, 0);
}

p { 
  font-size: 1.4rem;
}

.topnav { 
  overflow: hidden; 
  background-color: #f7d219;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: center;
  padding: 18px 16px 12px;
  box-sizing: border-box;
  text-align: left;
}

body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
  background-color: #fffbea;
}

.content { 
  padding: 0%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 60px;
}
.imgpato{
  padding: 1%;
  margin: 5px;
  border: 1px;
  width: 4%;
  height: auto;

}
.imgpato2{
  width: 4%;
  height: auto;

}
.imgumayor{
  width: 15%;
  height: auto;

}

.topnav-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.topnav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.topnav-right {
  display: none;
  min-width: 0;
}

.topnav-university-link {
  display: block;
  margin-top: 4px;
}

.topnav-logo {
  width: 96px;
  height: auto;
  display: block;
  cursor: pointer;
}

.topnav-badge {
  width: 140px;
  max-width: 100%;
  height: auto;
  display: block;
}

.topnav-badge-left {
  width: 130px;
}

.topnav h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.05;
}

.topnav h2 {
  margin: 0;
  font-size: clamp(0.95rem, 1.2vw, 1.2rem);
  line-height: 1.1;
}

.topnav h3 {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1;
}

.topnav-device-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  color: #555;
  font-size: 13px;
  line-height: 1.25;
}

.topnav-device-info span {
  white-space: nowrap;
}

.topnav-user-status {
  position: absolute;
  top: 8px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #333;
  font-size: 12px;
  flex-wrap: wrap;
}

.topnav-user-status button {
  display: none;
  margin: 0;
  padding: 5px 10px;
  background-color: #ffb300;
  color: black;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
}

@media (max-width: 900px) {
  .topnav {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .topnav-brand,
  .topnav-center,
  .topnav-right {
    width: 100%;
  }

  .topnav-right {
    display: none;
  }

  .topnav-user-status {
    position: static;
    margin-top: 4px;
  }

  .topnav-device-info {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
}

.imgpato3{
  width: 4%;
  height: auto;

}
.card-grid { 
  max-width: 800px; 
  margin: 0 auto; 
  display: grid; 
  grid-gap: 2rem; 
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card { 
  background-color: white; 
  box-shadow: 2px 2px 12px 1px rgba(140,140,140,.5);
}

.content {
  width: 100%;
  max-width: none;
}

.card-grid {
  max-width: none;
  width: min(1880px, calc(100vw - 16px));
  margin: 0 auto;
  display: block;
  height: auto;
  overflow: visible;
}

.card {
  box-shadow: none;
  background: transparent;
}

.saiot-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  position: relative;
  min-height: auto;
  padding: 12px;
  box-sizing: border-box;
  text-align: left;
}

.saiot-sidebar {
  position: static;
  width: auto;
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 12px;
  border-radius: 0;
  background: #fffbea;
  box-shadow: none;
  z-index: 1;
}

.saiot-sidebar-intro {
  position: relative;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 7px;
  border: 2px solid #f7d219;
  background: #f7d219;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.saiot-sidebar-intro-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}

.saiot-sidebar-badge {
  width: 132px;
  height: auto;
  display: block;
}

.saiot-sidebar-intro-copy {
  min-width: 0;
}

.saiot-sidebar-intro-copy h1,
.saiot-sidebar-intro-copy h2,
.saiot-sidebar-intro-copy h3 {
  margin: 0;
  color: #000;
}

.saiot-sidebar-intro-copy h1 {
  font-size: 1.35rem;
  line-height: 1.05;
}

.saiot-sidebar-intro-copy h2 {
  margin-top: 2px;
  font-size: 0.95rem;
  line-height: 1.05;
}

.saiot-sidebar-intro-copy h3 {
  margin-top: 2px;
  font-size: 0.8rem;
  line-height: 1;
}

.saiot-sidebar-device-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
  color: #333;
  font-size: 12px;
  line-height: 1.2;
}

.saiot-sidebar-device-info span {
  white-space: nowrap;
}

.saiot-sidebar-university-link {
  display: inline-block;
  margin-top: 6px;
}

.saiot-sidebar-umayor {
  width: 72px;
  height: auto;
  display: block;
}

.saiot-sidebar-user-status {
  position: static;
  margin: 0;
  gap: 4px;
  font-size: 10px;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.saiot-sidebar-user-status button {
  display: inline-block;
  padding: 3px 6px;
  font-size: 9px;
  background-color: #ffb300;
  color: black;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.config-panel {
  box-sizing: border-box;
}

.config-panel-field {
  display: grid;
  grid-template-columns: minmax(130px, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.config-panel-field label {
  margin: 0;
  color: #111;
}

.config-panel-field input[type=text],
.config-panel-field input[type=number] {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.config-panel h4 {
  margin-top: 0;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.config-panel-actions {
  display: flex;
  gap: 10px;
  margin: 8px 0 0 0;
  flex-wrap: wrap;
}

.config-panel-actions button {
  flex: 1;
  min-width: 150px;
}

.config-panel-toggle {
  margin-bottom: 8px;
}

.config-panel-check {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  color: #333;
  font-size: 16px;
}

.config-panel-check input[type=checkbox] {
  margin: 0;
  cursor: pointer;
}

.config-panel-check .config-panel-check-text {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.config-panel label[for],
.config-panel input[type=text],
.config-panel input[type=number] {
  margin-top: 6px;
  margin-bottom: 6px;
}

.config-panel-field label[for],
.config-panel-field input[type=text],
.config-panel-field input[type=number] {
  margin-top: 0;
  margin-bottom: 0;
}

.config-panel #wifi2-section,
.config-panel #server-2-section {
  margin-bottom: 6px !important;
}

@media (max-width: 620px) {
  .config-panel-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.saiot-sidebar-header {
  margin-bottom: 12px;
  padding: 0px 0px;
  border-radius: 7px;
  background: #111;
  color: #f7d219;
}

.saiot-sidebar-auth {
  margin: 4px 0 4px;
  padding: 4px 6px;
  border-radius: 4px;
  background: transparent;
  border: none;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}

.saiot-sidebar-header strong,
.saiot-sidebar-header span {
  display: block;
}

.saiot-sidebar-header strong {
  font-size: 15px;
}

.saiot-page-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  padding: 8px 10px 8px;
  border-radius: 0;
  background: #111;
  color: #f7d219;
  text-align: center;
  z-index: 100;
  border-top: 3px solid #f7d219;
  box-shadow: none;
  box-sizing: border-box;
  display: block;
  clear: both;
}

.saiot-page-footer-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.saiot-page-footer-links button {
  min-width: 120px;
  padding: 10px 14px;
  background: #f7d219;
  color: black;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
}

.saiot-page-footer p {
  position: static;
  width: 100%;
  margin: 4px 0;
}

.saiot-sidebar-header span {
  margin-top: 2px;
  font-size: 11px;
  color: #fff8b8;
}

.saiot-sidebar > div,
.saiot-sidebar > p {
  max-width: 100%;
}

.heap-chart-wrap {
  padding: 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfcff 0%, #f2f5fb 100%);
  border: 1px solid #e1e7f0;
}

.heap-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 260px;
}

.heap-chart-caption {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #111;
  color: #f7d219;
  font-size: 12px;
  line-height: 1.35;
}

.saiot-sidebar input[type=text],
.saiot-sidebar input[type=number],
.saiot-sidebar select {
  width: calc(100% - 20px);
  margin: 8px 10px;
}

.saiot-sidebar label {
  font-size: 14px;
}

.saiot-workspace {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  grid-auto-flow: row;
  gap: 14px;
  align-items: start;
  justify-items: stretch;
  min-height: 400px;
  height: auto;
  padding: 12px;
  overflow: visible;
  background-color: #fffbea;
}

/* Solo los paneles con resize:both (el usuario puede agrandarlos a mano)
   ocupan su propia fila completa: son los únicos que pueden crecer más
   allá de su celda original y chocar con un vecino ya ubicado. El resto
   de los paneles se acomodan libremente varios por fila (auto-fit) y
   bajan de fila solo cuando ya no caben, gracias al grid normal. */
.saiot-workspace > #networkConfigSection,
.saiot-workspace > #mqtt-config-section,
.saiot-workspace > #camera-panel,
.saiot-workspace > #video-websocket-panel,
.saiot-workspace > #health-status-panel,
.saiot-workspace > #memory-status-panel {
  grid-column: 1 / -1;
}

.saiot-panel-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px !important;
  margin: 10px 0 14px !important;
  padding: 6px 0 0 !important;
  border: none !important;
  background: transparent !important;
}

.saiot-panel-picker .panel-toggle-button {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #f7d219;
  border-radius: 6px;
  background: #fffdf3;
  color: #111;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  line-height: 1.2;
  box-sizing: border-box;
}

.saiot-panel-picker .panel-toggle-button.is-active {
  background: #f7d219;
  color: #111;
  border-color: #f0b700;
}

@media (max-width: 620px) {
  .saiot-panel-picker {
    grid-template-columns: 1fr;
  }
}

.saiot-action-row {
  margin-top: 12px !important;
  gap: 8px !important;
}

.saiot-action-row button {
  min-width: 0 !important;
  flex: 1 1 160px !important;
}

.card > form {
  min-height: 0;
}

.card > form > .saiot-workbench {
  min-height: 0;
}

.workspace-empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 2px dashed #f7d219;
  border-radius: 10px;
  background: #fffbea;
  color: #5b6472;
  font-size: 14px;
  text-align: center;
}

.workspace-panel {
  min-width: 360px;
  min-height: 260px;
  max-width: none;
  resize: both;
  overflow: auto;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(24, 32, 42, 0.10);
  /* Sin esto, justify-items:stretch del grid padre estira el panel para
     llenar toda su columna en vez de abrirlo en su min-width/min-height. */
  justify-self: start;
}

.workspace-panel-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -6px -6px 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #e6c200;
  color: black;
  cursor: move;
  user-select: none;
  font-size: 12px;
  font-weight: 800;
}

.workspace-panel-close {
  width: auto;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid black;
  border-radius: 5px;
  background: transparent;
  color: black;
  cursor: pointer;
  font-size: 11px;
}

.workspace-panel--dragging {
  opacity: 0.6;
}

@media (max-width: 980px) {
  .saiot-workbench {
    grid-template-columns: 1fr;
  }

  .saiot-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .saiot-sidebar-intro-main {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .saiot-sidebar-user-status {
    margin-top: 0;
  }

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

  .workspace-panel {
    min-width: 0;
    resize: vertical;
  }

  .saiot-panel-picker {
    grid-template-columns: 1fr;
  }
}

.card-title { 
  font-size: 1.2rem;
  font-weight: bold;
  color: #034078
}

input[type=submit] {
  border: none;
  color: #FEFCFB;
  background-color: #034078;
  padding: 15px 15px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  width: 100px;
  margin-right: 10px;
  border-radius: 4px;
  transition-duration: 0.4s;
  }

input[type=submit]:hover {
  background-color: #c9ec2b;
}

input[type=text], input[type=number], select {
  width: 50%;
  padding: 12px 20px;
  margin: 18px;
  display: inline-block;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

label {
  font-size: 1.2rem; 
}
.value{
  font-size: 1.2rem;
  color: #1282A2;  
}
.state {
  font-size: 1.2rem;
  color: #1282A2;
}
button {
  border: none;
  color: #FEFCFB;
  padding: 15px 32px;
  text-align: center;
  font-size: 16px;
  width: 100px;
  border-radius: 4px;
  transition-duration: 0.4s;
}
.button-on {
  background-color: #034078;
}
.button-on:hover {
  background-color: #1282A2;
}
.button-off {
  background-color: #858585;
  margin: 0;
  z-index: 2;
}

.memory-card-dram {
  grid-area: dram;
}

.memory-card-flash {
  grid-area: flash;
}

.memory-card-psram {
  grid-area: psram;
}

.memory-card-system {
  grid-area: system;
}

.memory-card-chart {
  grid-area: chart;
  min-height: 310px;
  display: flex;
  flex-direction: column;
}

.heap-chart-wrap {
  position: relative;
  flex: 1;
  min-height: 250px;
}

#heap-live-chart {
  width: 100%;
  height: 250px;
  display: block;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: #fbfcff;
}

.heap-chart-caption {
  margin-top: 8px;
  color: #5b6472;
  font-size: 12px;
  line-height: 1.3;
}

.memory-dashboard-panel > button[onclick="loadMemoryStatus()"] {
  display: none !important;
}

.memory-dashboard-panel [style*="background-color: white"] {
  text-align: left !important;
  border: 1px solid #eef0f4;
  box-shadow: 0 4px 14px rgba(24, 32, 42, 0.06);
}

.memory-dashboard-panel h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px !important;
  color: #151b24 !important;
  font-size: 15px;
  line-height: 1.2;
}

.memory-dashboard-panel h4 span {
  color: #7b8492;
  font-size: 11px;
  font-weight: 600;
}

.mem-card-content {
  display: grid;
  gap: 10px;
}

.mem-usage-row,
.mem-usage-foot {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  color: #5b6472;
  font-size: 12px;
}

.mem-usage-row strong,
.mem-usage-foot strong {
  color: #1f2937;
  font-size: 16px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mem-usage-row small,
.mem-usage-foot small {
  color: #7b8492;
  font-size: 12px;
}

.mem-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dde2ea;
}

.mem-progress div {
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.mem-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.mem-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--badge-color);
  color: var(--badge-color);
  font-size: 11px;
  font-weight: 800;
}

.mem-subtle {
  color: #7b8492;
  font-size: 12px;
  font-weight: 700;
}

.mem-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mem-metric {
  min-width: 0;
  padding: 8px;
  border: 1px solid #edf0f5;
  border-radius: 6px;
  background: #fafbfc;
}

.mem-metric span,
.mem-trace-stat span {
  display: block;
  color: #7b8492;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.mem-metric strong,
.mem-trace-stat strong {
  display: block;
  margin-top: 3px;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.2;
}

.mem-metric small,
.mem-trace-stat small {
  display: block;
  margin-top: 2px;
  color: #7b8492;
  font-size: 11px;
}

.mem-trace-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mem-trace-stat {
  padding: 10px;
  border: 1px solid #edf0f5;
  border-radius: 6px;
  background: #fafbfc;
}

.mem-trace-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 12px;
  overflow: hidden;
  border: 1px solid #edf0f5;
  border-radius: 6px;
}

.mem-trace-table th {
  padding: 8px;
  background: #f7d219;
  color: #111;
  text-align: left;
}

.mem-trace-table td {
  padding: 8px;
  border-bottom: 1px solid #edf0f5;
  color: #3b4350;
  text-align: right;
}

.mem-trace-table td:first-child,
.mem-trace-table th:first-child {
  text-align: left;
}

.memory-auto-text {
  margin: 8px 0 0 !important;
  color: #6b7280 !important;
  text-align: center !important;
  font-size: 12px !important;
}

@media (max-width: 760px) {
  .memory-dashboard-panel [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .memory-live-layout {
    grid-template-areas:
      "dram"
      "flash"
      "psram"
      "chart"
      "system";
    grid-template-columns: 1fr !important;
  }

  .memory-card-chart {
    min-height: 280px;
  }

  .heap-chart-wrap {
    min-height: 220px;
  }

  #heap-live-chart {
    height: 220px;
  }

  .mem-metric-grid,
  .mem-trace-summary {
    grid-template-columns: 1fr;
  }

  .mem-usage-row,
  .mem-usage-foot {
    grid-template-columns: 72px 1fr;
  }

  .mem-usage-row small,
  .mem-usage-foot small {
    grid-column: 2;
  }
}

/* Health dashboard panel */
.health-dashboard-panel {
  text-align: left !important;
}

.health-dashboard-host {
  padding: 0 !important;
  background: transparent !important;
}

.health-dashboard {
  display: grid;
  gap: 10px;
}

.health-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--health-color, #4CAF50);
  color: #fff;
  box-shadow: 0 4px 14px rgba(24, 32, 42, 0.10);
}

.health-hero-label,
.health-score small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.88;
  text-transform: uppercase;
}

.health-hero strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.health-score {
  min-width: 82px;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.18);
  text-align: center;
}

.health-score span {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.health-top-grid,
.health-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.health-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.health-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #edf0f5;
  border-left: 4px solid #d7dde8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(24, 32, 42, 0.06);
}

.health-card h4 {
  margin: 0 0 10px;
  color: #151b24;
  font-size: 14px;
}

.health-card--success {
  border-left-color: #4CAF50;
}

.health-card--info {
  border-left-color: #2196F3;
}

.health-card--warn {
  border-left-color: #f7d219;
}

.health-card--purple {
  border-left-color: #9C27B0;
}

.health-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.health-metric-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.health-metric {
  min-width: 0;
  padding: 8px;
  border: 2px solid #f7d219;
  border-radius: 7px;
  background: #fefdfb;
}

.health-metric span {
  display: block;
  color: #777;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.health-metric strong {
  display: block;
  margin-top: 3px;
  color: #333;
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.health-metric small {
  display: block;
  margin-top: 2px;
  color: #777;
  font-size: 11px;
}

.health-boot-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #edf0f5;
  color: #5b6472;
  font-size: 12px;
}

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

.health-boot-row strong {
  color: #1f2937;
}

.health-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.health-badge.ok {
  background: #4CAF50;
}

.health-badge.warn {
  background: #FF9800;
}

.health-badge.muted {
  background: #7b8492;
}

.health-recommendations {
  margin: 0;
  padding-left: 18px;
  color: #3b4350;
  font-size: 12px;
  line-height: 1.5;
}

.health-dashboard-panel > button {
  min-width: 112px;
  margin-top: 10px !important;
}

@media (max-width: 860px) {
  .health-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-metric-grid--three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .health-top-grid,
  .health-card-grid,
  .health-metric-grid {
    grid-template-columns: 1fr;
  }

  .health-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .health-score {
    width: 100%;
  }
}

/* WiFi dashboard panel */
.wifi-dashboard-panel {
  text-align: left !important;
}

.wifi-dashboard-host {
  padding: 0 !important;
  background: transparent !important;
}

.wifi-dashboard {
  display: grid;
  gap: 10px;
}

.wifi-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--wifi-color, #4CAF50);
  color: #fff;
  box-shadow: 0 4px 14px rgba(24, 32, 42, 0.10);
}

.wifi-hero-label,
.wifi-active small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.88;
  text-transform: uppercase;
}

.wifi-hero strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.wifi-active {
  min-width: 130px;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.18);
  text-align: right;
}

.wifi-active span {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.wifi-main-grid,
.wifi-network-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wifi-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #edf0f5;
  border-left: 4px solid #d7dde8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(24, 32, 42, 0.06);
}

.wifi-card h4 {
  margin: 0 0 10px;
  color: #151b24;
  font-size: 14px;
}

.wifi-card--status,
.wifi-card--primary {
  border-left-color: #f7d219;
}

.wifi-card--stats {
  border-left-color: #f7d219;
}

.wifi-card--backup {
  border-left-color: #f7d219;
}

.wifi-card--disabled {
  opacity: 0.72;
}

.wifi-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.wifi-card-title strong {
  color: #151b24;
  font-size: 14px;
}

.wifi-card-title span {
  color: #7b8492;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.wifi-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wifi-metric {
  min-width: 0;
  padding: 8px;
  border: 2px solid #f7d219;
  border-radius: 7px;
  background: #fefdfb;
}

.wifi-metric span {
  display: block;
  color: #777;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.wifi-metric strong {
  display: block;
  margin-top: 3px;
  color: #333;
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.wifi-dashboard-panel > button {
  min-width: 112px;
  margin-top: 10px !important;
}

@media (max-width: 620px) {
  .wifi-main-grid,
  .wifi-network-grid,
  .wifi-metric-grid {
    grid-template-columns: 1fr;
  }

  .wifi-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .wifi-active {
    width: 100%;
    text-align: left;
  }
}
