* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #111;
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e6e6e6;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1000;
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 650;
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.controls input,
.controls select,
.controls button {
  padding: 8px 10px;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  background: #fff;
}

.controls button {
  cursor: pointer;
}

.container {
  padding: 14px 16px;
}

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

.hint {
  color: #555;
  font-size: 13px;
}

.tablewrap {
  position: relative;
  overflow: auto;
  border: 1px solid #eee;
  border-radius: 14px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  text-align: left;
  font-size: 12px;
  color: #444;
  padding: 10px 12px;
  background: #fafafa;
  border-bottom: 1px solid #ddd;
}

/* Sticky inside the table area, not below the page header */
#headerRow th {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fafafa;
  cursor: pointer;
  user-select: none;
}

#filterRow th {
  position: sticky;
  top: 41px; /* adjust to 40-44px if needed */
  z-index: 20;
  background: #fff;
  padding-top: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

#filterRow input.colFilter {
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #d7d7d7;
  font-size: 12px;
}

th.sortAsc::after {
  content: " ▲";
  font-size: 11px;
  color: #666;
}

th.sortDesc::after {
  content: " ▼";
  font-size: 11px;
  color: #666;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
  font-size: 13px;
}

tbody tr:hover {
  background: #fcfcfc;
}

select.prioSelect {
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #d7d7d7;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.15);
}

.toast.error {
  background: #8b0000;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #d7d7d7;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.tab.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.chartHeader {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.chartHeader h2 {
  margin: 0;
  font-size: 16px;
}

.chartWrap {
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 12px;
}

.chartsGrid {
  display: grid;
  gap: 16px;
}

.chartCard {
  min-width: 0;
}

@media (min-width: 1080px) {
  .chartsGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}
