body {
  display: flex;
  min-height: 100vh;
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #1c1e21;
}

body.signed-out {
  display: block;
}

body.signed-out main {
  max-width: 24rem;
  margin: 12vh auto;
}

nav {
  width: 14rem;
  flex: none;
  background: #1c1e21;
  padding: 1.25rem 0;
}

nav a {
  display: block;
  padding: 0.7rem 1.1rem;
  color: #f4f5f7;
  text-decoration: none;
}

nav a.active, nav a:hover {
  background: #343841;
}

main {
  flex: 1;
  min-width: 0;
  max-width: 64rem;
  margin: 2rem;
  padding: 2rem;
  background: #fff;
  border: 1px solid #d8dbe2;
  border-radius: 8px;
}

#report-table {
  max-width: 100%;
  max-height: 32rem;
  overflow: auto;
}

#report-table table.status {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

#report-table table.status th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

#report-table table.sticky-first th:first-child,
#report-table table.sticky-first td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  box-shadow: 1px 0 0 #e6e8ee;
}

#report-table table.sticky-first th:first-child {
  z-index: 3;
}

#report-table table.status th,
#report-table table.status td {
  white-space: nowrap;
}

td form {
  display: inline;
}

button.danger {
  background: #9b1c1c;
}

button.danger:hover {
  background: #7f1d1d;
}

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.status-head h2 {
  margin: 0;
}

.status-head .button {
  margin-top: 0;
}

table.status {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

table.status thead button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

table.status thead button.sorted-asc::after {
  content: " \2191";
}

table.status thead button.sorted-desc::after {
  content: " \2193";
}

table.status th, table.status td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #e6e8ee;
  text-align: left;
  font-size: 0.95rem;
}

table.status tr.split td {
  padding-top: 1rem;
  color: #4b5563;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill {
  display: inline-block;
  min-width: 6.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  text-align: center;
  font-size: 0.85rem;
}

.pill.up { background: #e8f6ee; color: #146c36; }
.pill.down { background: #fde8e8; color: #9b1c1c; }
.pill.wait { background: #fef3c7; color: #92400e; }
.pill.missing { background: #f3f4f6; color: #4b5563; }

.warn {
  padding: 0.75rem 1rem;
  background: #fde8e8;
  border-radius: 6px;
}

.warning {
  margin-top: 0;
  color: #9b1c1c;
  font-weight: 600;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}

p {
  line-height: 1.45;
}

.role {
  margin: 0;
  color: #4b5563;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.email {
  color: #4b5563;
}

.notice {
  padding: 0.75rem 1rem;
  background: #e8f6ee;
  border-radius: 6px;
}

.brand-picker {
  display: inline-block;
  vertical-align: top;
}

#brand-search {
  display: block;
  width: 18rem;
  margin-left: 0.5rem;
}

#brand-options {
  display: none;
  width: 18rem;
  max-height: 16rem;
  margin: 0.25rem 0 0 0.5rem;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  background: #fff;
  border: 1px solid #d8dbe2;
  border-radius: 6px;
}

#brand-options.open {
  display: block;
}

#brand-options li {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

#brand-options li:hover {
  background: #e8eefc;
}

#brand-options li.note {
  color: #4b5563;
  cursor: default;
}

#brand-options li.note:hover {
  background: #fff;
}

input[type="date"], input[type="number"], select {
  margin-left: 0.5rem;
  padding: 0.4rem;
  font: inherit;
}

label {
  display: inline-block;
  margin-right: 1rem;
}

a.button, button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 6px;
  background: #1a56db;
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.button:hover, button:hover {
  background: #1648b8;
}
