/* AlgoVerde Access Monitor */
:root {
  --primary: #009688;
  --secondary: #8282E3;
  --neutral: #546E7A;
  --bg: #FAFBFC;
  --panel: #ffffff;
  --border: #D8DFE3;
  --text: #111827;
  --muted: #546E7A;
  --accent: #009688;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Mulish", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 16px 20px 60px;
}
.muted { color: var(--muted); font-size: 0.85em; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
header h1 { font-size: 1.35em; margin: 0; }
.header-actions { display: flex; align-items: center; gap: 10px; }

button {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.9em;
}
button:hover { border-color: var(--accent); color: var(--accent); }

/* Category filter toggle list */
.toggle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 320px;
}
.toggle-item {
  font-size: 0.82em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
}
.toggle-item.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.toggle-item.selected:hover { color: #fff; }

/* Cards */
#cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}
.card-value { font-size: 1.6em; font-weight: 600; color: var(--accent); }
.card-label { font-size: 0.82em; color: var(--muted); }

/* Charts */
#charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (min-width: 1100px) {
  #charts { grid-template-columns: 1fr 1fr; }
}
.section-title {
  font-size: 1.05em;
  margin: 4px 0 10px;
  color: var(--neutral);
}
#charts-instances {
  display: grid;
  grid-template-columns: 1fr; /* one chart per row */
  gap: 14px;
}
.chart-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  min-height: 300px; /* 260px; */
  position: relative;
  overflow: hidden;
}
.chart-box > canvas {
  max-height: 300px;
}

/* Filters */
#filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  width: min(360px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.login-card h1 { font-size: 1.2em; margin: 0; }
.login-card input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1em;
}
.login-error { color: #c0392b; margin: 0; font-size: 0.9em; }

#global-search {
  flex: 1 1 180px;
  min-width: 180px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95em;
}
#column-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-box {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  background: #fafbfd;
}
.filter-box label { font-size: 0.78em; color: var(--muted); }
.filter-box input, .filter-box select {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 0.85em;
  max-width: 140px;
}
.filter-box select[multiple] { max-height: 120px; max-width: 170px; }

/* Table */
#table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  margin-top: 1em;
}
table { border-collapse: collapse; width: 100%; font-size: 0.88em; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
thead th {
  background: #eef1f6;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
}
thead th:hover { color: var(--accent); }
tbody tr:hover { background: #f2f7fc; }
#status { padding: 10px 12px; }

/* Pagination */
#pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}
#pg-info { font-size: 0.9em; }
#pg-size { padding: 4px; border: 1px solid var(--border); border-radius: 4px; }
