:root {
  --bg: #f4f6f7;
  --panel: #ffffff;
  --panel-2: #eef3f2;
  --text: #15211f;
  --muted: #64716d;
  --line: #dbe3e1;
  --teal: #0f8b7f;
  --blue: #2b5f9e;
  --amber: #c47a1f;
  --red: #bf3b3b;
  --shadow: 0 8px 24px rgba(20, 32, 30, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px;
  background: #111917;
  color: white;
}

.eyebrow {
  color: #73d4c8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  font-size: 19px;
}

h3 {
  margin-top: 22px;
  margin-bottom: 10px;
  font-size: 15px;
}

main {
  padding: 18px;
}

.filters,
.kpis,
.main-pane,
.detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--text);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  color: var(--text);
}

.check input {
  width: 18px;
  height: 18px;
}

button {
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: var(--teal);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.96);
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: currentColor;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  background: var(--line);
}

.app-error {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #efb4b4;
  border-radius: 6px;
  background: #fff3f3;
  color: var(--red);
  font-size: 14px;
}

.kpi {
  min-height: 88px;
  padding: 14px;
  background: white;
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
  margin-top: 14px;
}

.main-pane,
.detail {
  min-width: 0;
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.chart {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr 70px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 13px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--panel-2);
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf3f1;
  color: #3e4c49;
  font-size: 12px;
}

tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #edf8f6;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.load-low {
  color: var(--red);
  font-weight: 800;
}

.load-mid {
  color: var(--amber);
  font-weight: 800;
}

.load-ok {
  color: var(--teal);
  font-weight: 800;
}

.detail {
  align-self: start;
  position: sticky;
  top: 14px;
}

.empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mini {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcfc;
}

.mini span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mini strong {
  display: block;
  margin-top: 4px;
}

.trend {
  height: 170px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.employee-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.employee {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfcfc;
  font-size: 12px;
}

.employee small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.login {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(17, 25, 23, 0.72);
}

.login-panel {
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 6px;
  background: white;
}

.login-panel h1 {
  color: var(--text);
}

.error {
  min-height: 18px;
  color: var(--red);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .filters {
    grid-template-columns: repeat(3, 1fr);
  }

  .kpis {
    grid-template-columns: repeat(3, 1fr);
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .detail {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 16px;
  }

  main {
    padding: 10px;
  }

  .filters,
  .kpis {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }
}
