/* Base layout */
html, body {
  font-family: 'Segoe UI', sans-serif;
  background: #f7f7f7;
  color: #222;
  margin: 0;
  padding: 0.5rem 1.5rem 1.5rem 1.5rem;
}

h1 {
  color: #222;
  margin: 0 0 0.5rem 0; /* Top 0, bottom reduced to 0.5rem */
}

h2 {
  color: #222;
  margin: 0 0 0.5rem 0; /* Top 0, bottom reduced to 0.5rem */
}

p {
  margin: 0.25rem;
}

/* Layout grid */
.dashboard {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 1rem;
  flex-wrap: wrap;
}

.sensor-values {
  min-width: 240px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Chart container */
.chart-container {
  flex: 1;
  min-width: 300px;
}

.chart-wrapper {
  margin: 0 auto 15px;
  width: 100%;
  height: 250px;
  position: relative;
  gap: 30px;
}

/* Canvas full fit */
canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background-color: white; /* Ensure charts are white */
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  padding: 5px;
}

/* Labels */
label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
  display: block;
  margin-bottom: 0.4rem;
}

/* Input fields and dropdowns */
input[type="datetime-local"],
select {
  background-color: #fff;
  color: #222;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

input[type="number"] {
  background-color: #fff;
  color: #222;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
}

/* Buttons */
button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  background-color: #e0e0e0;
  color: #222;
  border: 1px solid #bbb;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex: 1;
}

button:hover {
  background-color: #d5d5d5;
}

.date-range {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Filter checkboxes */
#location-filters {
  columns: 2;
  column-gap: 1rem;
}

#location-filters label {
  display: block;
  margin-bottom: 0.3rem;
}

/* Current values section */
.current-values-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Current dropdown */
#current-location {
  max-width: 100%;
}

/* Current values card */
.current-cards .card {
  background-color: #ffffff;
  color: #222;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .dashboard {
    flex-direction: column;
  }

  .sensor-values {
    width: 100%;
  }
}

.load-data-row {
  display: flex;
  flex-direction: column; /* Stack on small screens */
  gap: 0.5rem;
}

.load-data-row > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.load-data-row label {
  margin: 0;
  min-width: 60px;
  text-align: right;
  white-space: nowrap;
}

.load-data-row input {
  flex: 1;
  min-width: 0;
}


.load-button {
  margin-top: 0.5rem;
  display: flex;
}

input[type="datetime-local"],
button {
  padding: 0.3rem 0.6rem;
  font-size: 0.95rem;
}

.section-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 1rem 1rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}


/* General table layout */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    background-color: #fff;
    color: #222;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

/* Table headers */
thead {
    background-color: #f0f0f0;
}

th, td {
    border: 1px solid #ddd;
    padding: 0.5rem 0.75rem;
    text-align: center;
}

/* Bold headers */
th {
    font-weight: 600;
    color: #333;
}

/* Zebra striping */
tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* Input fields inside tables */
table input[type="text"] {
    width: 100px;
    padding: 0.3rem;
    background: #fff;
    color: #222;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Checkbox appearance */
table input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: #3a6ea5;
}

/* Buttons inside tables */
table button {
    padding: 4px 8px;
    font-size: 0.85rem;
    background-color: #3a6ea5;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

table button:hover {
    background-color: #2e5a89;
}

td.dirty-cell {
  background-color: #ffe6e6 !important; /* light red */
}


.tabbar {
  display: flex;
  gap: 1rem;
  padding: 0 1.5rem 0.5rem 1.5rem;
  background-color: #f7f7f7;
  border-bottom: 2px solid #ccc;
}

.tabbar a {
  text-decoration: none;
  color: #666;
  font-size: 1.2rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px 6px 0 0;
  transition: background-color 0.2s ease;
}

.tabbar a:hover {
  background-color: #eaeaea;
}

.tabbar .active-tab {
  background-color: white;
  color: #222;
  font-size: 1.5rem;
  font-weight: 700;
  border-bottom: 2px solid white;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}
