:root {
  color-scheme: light;
  --topbar-height: 58px;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9dee8;
  --nav: #101828;
  --blue: #2368b8;
  --green: #147d64;
  --amber: #b56b14;
  --red: #b42318;
  --focus: #6c8cff;
}

html {
  scroll-padding-top: calc(var(--topbar-height) + 16px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.button:hover {
  filter: brightness(0.95);
  text-decoration: none;
}

.secondary,
.ghost {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.ghost {
  min-height: 34px;
}

input,
select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  padding: 0 10px;
}

input:focus,
select:focus,
button:focus,
.button:focus {
  outline: 3px solid color-mix(in srgb, var(--focus) 32%, transparent);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #293449;
  background: var(--nav);
  color: #ffffff;
  padding: 0 24px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.18);
}

.brand {
  color: #ffffff;
  font-weight: 750;
}

.period {
  margin-left: 14px;
  color: #cbd5e1;
  font-size: 13px;
}

.page {
  width: min(1480px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

h1,
h2 {
  margin: 0;
  font-weight: 750;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.subtle {
  margin: 4px 0 0;
  color: var(--muted);
}

.week-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric,
.panel,
.table-wrap,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.metric {
  min-height: 104px;
  border-top: 4px solid #8792a6;
  padding: 14px 14px 12px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 4px 0;
  font-size: 28px;
  line-height: 1.1;
}

.accent-blue {
  border-top-color: var(--blue);
}

.accent-green {
  border-top-color: var(--green);
}

.accent-amber {
  border-top-color: var(--amber);
}

.panel {
  overflow: hidden;
}

.table-wrap {
  overflow: visible;
}

.table-wrap h2,
.panel h2 {
  padding: 16px 16px 0;
}

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

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

thead th {
  position: sticky;
  top: var(--topbar-height);
  z-index: 20;
  background: #eef2f7;
  box-shadow: 0 1px 0 var(--line);
  color: #344054;
  font-size: 13px;
  font-weight: 750;
}

tbody tr:hover {
  background: #f9fbfd;
}

td span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hash {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.recording-ref {
  max-width: 360px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.recording-ref a {
  display: inline-block;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 650;
}

.recording-ref span {
  display: block;
  margin-top: 4px;
}

.quiet-row {
  color: #98a2b3;
}

.table-link {
  display: inline-block;
  color: var(--ink);
  font-weight: 650;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.7fr);
  gap: 16px;
  margin-bottom: 20px;
}

.customer-data dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 18px;
  margin: 0;
  padding: 0 16px 18px;
}

.customer-data dt {
  color: var(--muted);
}

.customer-data dd {
  margin: 0;
  font-weight: 650;
}

.back-link {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #eef2f7;
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
}

.login-panel h1 {
  margin-bottom: 20px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  color: var(--muted);
  font-weight: 650;
}

.login-form button {
  margin-top: 6px;
}

.form-error {
  border-left: 4px solid var(--red);
  background: #fff1f0;
  color: var(--red);
  padding: 10px 12px;
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }

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

@media (max-width: 760px) {
  :root {
    --topbar-height: 88px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 12px 16px;
  }

  .period {
    display: block;
    margin: 4px 0 0;
  }

  .page {
    width: min(100% - 20px, 1480px);
    margin-top: 16px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(135px, 1fr));
  }

  .week-form {
    justify-content: stretch;
  }

  .week-form input,
  .week-form select,
  .week-form button,
  .week-form .button {
    flex: 1 1 140px;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 980px;
  }
}
