:root {
  --green: #2e8b57;
  --yellow: #f0ad4e;
  --red: #d9534f;
  --bg: #f8f9fa;
  --panel: #ffffff;
  --muted: #666;
  font-family: Arial, Helvetica, sans-serif;
}

/* Prevenção de Transbordo (Barramento de Overflow Lateral Mobile) */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  background: var(--bg);
  color: #222;
  -webkit-text-size-adjust: 100%;
}

header {
  background: #0b57a4;
  color: white;
  padding: 12px 18px;
}

header h1 {
  margin: 0 0 8px 0;
  font-size: 20px;
}

.top-info {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.gauge {
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

/* Limitação Dinâmica e Fluidez para Elementos Vetoriais */
.gauge svg {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.gauge-text {
  text-align: center;
  font-size: 14px;
  position: absolute;
  bottom: 5px;
  width: 100%;
}

#gauge .gauge-text #oeePercent {
  font-size: 20px;
  font-weight: bold;
}

.summary {
  background: var(--panel);
  padding: 10px;
  border-radius: 6px;
  color: #222;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

main {
  padding: 16px;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

button {
  padding: 6px 12px;
  cursor: pointer;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-weight: bold;
}

button:hover {
  background-color: #ededed;
}

.layout {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.left-column {
  flex: 1;
  background: var(--panel);
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  min-width: 280px;
  max-width: 100%;
}

/* Container de rolagem interna isolada para tabelas de dados em telas pequenas */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 8px;
}

.right-column {
  width: 320px;
  background: var(--panel);
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  border: 1px solid #e6e6e6;
  padding: 6px;
  text-align: center;
  white-space: nowrap; /* Preserva o alinhamento da linha de dados industrial */
}

td[contenteditable="true"] {
  background-color: #fffdf4;
  outline: none;
}

td[contenteditable="true"]:focus {
  background-color: #fff9d6;
  box-shadow: inset 0 0 3px #f0ad4e;
}

.stop-list {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #eee;
  padding: 6px;
}

.stop-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px dashed #efefef;
  align-items: center;
}

.quick-stop {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  background: #f1f1f1;
  padding: 10px;
  border-radius: 4px;
}

.quick-stop-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

footer {
  padding: 10px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Media Queries Avançadas para Mobile e Escassez de Viewport */
@media (max-width: 768px) {
  .top-info {
    flex-direction: column;
    align-items: stretch;
  }
  .layout {
    flex-direction: column;
  }
  .right-column {
    width: 100%;
    box-sizing: border-box;
  }
  .gauge {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
  }
}