@import url("/theme.css");
:root {
  font-family: MrXSourceHan;
  color: var(--color-text);
  background: var(--color-background);
  font-size: 14px;
  line-height: 1.6;
  --primary: var(--color-primary);
  --muted: var(--color-muted);
  --line: var(--color-line);
  --paper: var(--color-surface);
  --accent: var(--color-primary);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 8px;
  padding: 11px 18px;
  color: white;
  background: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.secondary {
  background: var(--color-primary-soft);
  color: var(--primary);
}
.quiet {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--line);
}
input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--color-text);
  min-width: 0;
  width: 100%;
}
input:focus,
textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 500;
}
h1 {
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -0.8px;
  font-weight: 600;
  margin: 0 0 12px;
}
h2 {
  font-size: 19px;
  margin: 0 0 12px;
}
.brand {
  font-family: inherit;
  font-size: 30px;
  letter-spacing: -0.5px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand span {
  font-family: MrXSourceHan;
  font-size: 13px;
  letter-spacing: 1px;
  font-weight: normal;
  border-left: 1px solid var(--color-line);
  padding-left: 14px;
}
.muted,
.eyebrow {
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  margin: 0 0 10px;
}
.login {
  max-width: 440px;
  margin: 10vh auto;
  padding: 35px;
}
.login .brand {
  margin-bottom: 56px;
}
.login h1 {
  font-size: 28px;
}
.login form {
  display: grid;
  gap: 20px;
  margin-top: 35px;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  background: var(--color-surface);
  border-right: 1px solid var(--line);
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
}
aside .brand {
  font-size: 31px;
  margin: 0 4px 35px;
}
nav {
  display: grid;
  gap: 5px;
}
nav button {
  color: var(--color-muted);
  background: none;
  text-align: left;
  font-weight: 400;
}
nav button.active {
  background: var(--primary);
  color: white;
}
.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 15px;
  color: var(--muted);
  font-size: 12px;
}
main {
  margin-left: 230px;
  padding: 38px 44px;
  max-width: 1700px;
}
header,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
header {
  margin-bottom: 24px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 24px 0;
}
.card,
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.stat strong {
  display: block;
  font-family: inherit;
  font-size: 30px;
  font-weight: normal;
  margin-top: 10px;
}
.stat span {
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.card p {
  margin: 8px 0;
}
.badge {
  display: inline-block;
  border-radius: 20px;
  background: var(--color-primary-soft);
  padding: 3px 10px;
  font-size: 12px;
  margin-right: 8px;
}
.badge.warn {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.toolbar {
  margin-bottom: 18px;
}
.toolbar form {
  display: flex;
  gap: 10px;
  flex: 1;
}
.toolbar input {
  max-width: 450px;
}
.table-wrap {
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
}
td,
th {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-line);
  font-size: 13px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}
th {
  background: var(--color-background);
  color: var(--color-muted);
  font-weight: 500;
}
tbody tr {
  cursor: pointer;
}
tbody tr:hover {
  background: var(--color-background);
}
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin: 15px 0;
}
.action-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 14px;
  margin: 0 0 20px;
  padding: 20px;
  background: var(--color-surface);
  border-radius: 10px;
}
.action-form p,
.action-form h2 {
  grid-column: 1/-1;
  margin: 0;
}
.action-form button {
  align-self: end;
}
.error {
  color: var(--color-danger);
}
.success {
  color: var(--color-primary);
}
#notice {
  min-height: 24px;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  background: var(--color-background);
  padding: 16px;
  border-radius: 8px;
  max-height: 600px;
  overflow: auto;
}
#empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
#detail {
  margin-top: 24px;
}
#detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
[hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  aside {
    position: static;
    width: auto;
    padding: 18px;
  }
  aside .brand {
    margin: 0 0 15px;
  }
  nav {
    display: flex;
    overflow: auto;
  }
  .sidebar-foot {
    display: none;
  }
  main {
    margin: 0;
    padding: 22px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .action-form {
    grid-template-columns: 1fr 1fr;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  header h1 {
    font-size: 26px;
  }
}
.subnav {
  display: flex;
  gap: 8px;
  margin: 0 0 24px;
}
.subnav .selected {
  background: #b51e30;
  color: white;
}
.record-facts {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px 20px;
  margin: 20px 0 28px;
}
.record-facts dt {
  color: #686868;
}
.record-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.source-card {
  background: #fafaf9;
  border: 1px solid #dededb;
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}
.source-card button {
  margin-right: 10px;
}
.source-card h3 {
  margin-top: 0;
}
#detail-body details {
  border-top: 1px solid #e7e7e4;
  padding: 20px 0;
  margin-top: 18px;
}
#detail-body summary {
  cursor: pointer;
  font-weight: 600;
}
#detail-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 360px;
  overflow: auto;
  background: #f5f5f3;
  padding: 16px;
}
#detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
#detail-body > button {
  margin: 8px 12px 8px 0;
}
.action-form h3,
.action-form > p {
  grid-column: 1/-1;
  margin: 0;
}
.action-form input,
.action-form select {
  max-width: 100%;
}
.revealed-phone {
  font-weight: 600;
}
.table-wrap {
  overflow: auto;
}
td {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#overview > h2 {
  margin-top: 32px;
}
@media (max-width: 700px) {
  .record-facts {
    grid-template-columns: 90px 1fr;
  }
  #detail-actions {
    flex-wrap: wrap;
  }
}
/* Daily operating measures share a row when the workspace has room. */
.stats.daily-stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
/* Customer-manager views share the existing brand and type scale. */
.entitlement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.entitlement-card {
  margin: 0;
}
.entitlement-card button {
  margin: 6px 8px 0 0;
}
.entitlement-usable {
  color: var(--brand, #b51e30);
}
.source-details {
  margin: 12px 0 24px;
}
.source-details > summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
}
#issue-filters {
  align-items: center;
  gap: 20px;
  margin: 0 0 16px;
}
#issue-filters[hidden] {
  display: none;
}
#issue-filters select {
  margin-left: 8px;
  min-width: 140px;
}
