:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f0f3f6;
  --line: #d8dde5;
  --text: #17202a;
  --muted: #667085;
  --accent: #1769aa;
  --accent-soft: #e8f2fb;
  --good: #0f7b55;
  --warn: #9a5b00;
  --shadow: 0 16px 42px rgba(20, 31, 43, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

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

h2 {
  font-size: 22px;
}

.header-actions {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box,
.filter-control {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-box.compact {
  min-width: 128px;
}

input,
select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 11px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  height: 38px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

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

.hidden {
  display: none !important;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  gap: 16px;
  width: min(100%, 380px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}

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

.login-panel button {
  width: 100%;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: #b42318;
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 14px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  padding: 0 13px;
  text-decoration: none;
  font-weight: 700;
}

.tab:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #c7def2;
}

main {
  padding: 22px 32px 32px;
}

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

.muted {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.table-shell {
  overflow: auto;
  max-height: calc(100vh - 255px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f5;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

th button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

tbody tr:hover {
  background: #f8fafc;
}

.address {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  height: auto;
  font-weight: 700;
  cursor: pointer;
}

.small-action {
  height: 30px;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 12px;
}

.small-action.danger {
  border-color: #b42318;
  background: #b42318;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--panel-soft);
  color: #344054;
  font-weight: 700;
  white-space: nowrap;
}

.badge.good {
  background: #e7f6ef;
  color: var(--good);
}

.badge.warn {
  background: #fff3d8;
  color: var(--warn);
}

.link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.link:hover {
  text-decoration: underline;
}

.empty {
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 7px;
  background: #17202a;
  color: #fff;
  padding: 10px 13px;
  font-size: 13px;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 760px) {
  .app-header {
    align-items: stretch;
    padding: 22px 18px 16px;
    flex-direction: column;
  }

  .header-actions,
  .search-box,
  .filter-control {
    width: 100%;
  }

  .tabs {
    padding: 12px 18px;
  }

  main {
    padding: 18px;
  }

  .table-head {
    display: grid;
  }

  .status {
    white-space: normal;
  }

  .table-shell {
    max-height: none;
  }
}
