/* Lettered admin. One stylesheet, no build step. */
:root {
  --bg: #f1f1f1;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --line: #e3e3e3;
  --line-strong: #c9c9c9;
  --text: #303030;
  --muted: #616161;
  --faint: #8a8a8a;
  --primary: #303030;
  --primary-hover: #1a1a1a;
  --link: #005bd3;
  --ok: #29845a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --font:
    -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* {
  box-sizing: border-box;
}
html {
  font-size: 14px;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 20px;
}
h2 {
  font-size: 15px;
}
h3 {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
p {
  margin: 0;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 16px;
  background: #1a1a1a;
  color: #fff;
}
.brand {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand span {
  color: #9a9a9a;
  font-weight: 500;
}
.brand b {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #3a3a3a;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.search {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
}
.search input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #303030;
  color: #fff;
  font: inherit;
}
.search input::placeholder {
  color: #9a9a9a;
}
.search input:focus {
  outline: 2px solid #6b9cff;
  outline-offset: 0;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.topnav a,
.topnav button {
  color: #d0d0d0;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}
.topnav a:hover,
.topnav button:hover {
  background: #303030;
  color: #fff;
  text-decoration: none;
}

/* Shell */
.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}
.sidenav {
  padding: 16px 10px;
  border-right: 1px solid var(--line);
  background: #ebebeb;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow: auto;
}
.sidenav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 550;
}
.sidenav a:hover {
  background: #e0e0e0;
  text-decoration: none;
}
.sidenav a.active {
  background: #fff;
  box-shadow: var(--shadow);
}
.sidenav .group {
  margin: 14px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidenav .sub {
  padding-left: 22px;
  font-weight: 500;
}
.count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: #d4d4d4;
  color: #303030;
}
.count.hot {
  background: #ffd79d;
}
.content {
  padding: 24px 28px 64px;
  max-width: 1280px;
  width: 100%;
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidenav {
    position: static;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidenav .group {
    display: none;
  }
  .content {
    padding: 16px;
  }
  .search {
    display: none;
  }
}

/* Page header */
.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head .spacer {
  flex: 1;
}
.crumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.crumbs a {
  color: var(--muted);
}
.subtitle {
  color: var(--muted);
  font-size: 13px;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card > .card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.card > .card-head .spacer {
  flex: 1;
}
.card > .card-body {
  padding: 16px;
}
.card > .card-body.tight {
  padding: 0;
}
.card .card-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1100px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* KPI tiles */
.kpi {
  padding: 14px 16px;
}
.kpi .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.kpi .value {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.kpi .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.tile-link {
  display: block;
  color: inherit;
}
.tile-link:hover {
  text-decoration: none;
  box-shadow: 0 0 0 2px var(--line-strong);
  border-radius: var(--radius);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafafa;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
td.muted {
  color: var(--muted);
}
tr.done td {
  color: var(--faint);
}
tr.done td .name {
  text-decoration: line-through;
}
.row-link {
  color: inherit;
  font-weight: 600;
}
.nowrap {
  white-space: nowrap;
}
.table-wrap {
  overflow-x: auto;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: #e3e3e3;
  color: #303030;
}
.badge.neutral {
  background: #e3e3e3;
}
.badge.info {
  background: #e0f0ff;
  color: #00527c;
}
.badge.success {
  background: #cdfee1;
  color: #0c5132;
}
.badge.warning {
  background: #ffef9d;
  color: #4f4700;
}
.badge.attention {
  background: #e4e1fc;
  color: #3b2e8a;
}
.badge.critical {
  background: #fed1d7;
  color: #8e1f0b;
}
.badge.outline {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--muted);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Buttons & forms */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.primary:hover {
  background: var(--primary-hover);
}
.btn.danger {
  color: #8e1f0b;
  border-color: #e0b3b3;
}
.btn.danger:hover {
  background: #fff1f1;
}
.btn.sm {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
input[type="text"],
input[type="search"],
input[type="password"],
input[type="date"],
input[type="email"],
select,
textarea {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  font: inherit;
  color: var(--text);
}
textarea {
  height: auto;
  padding: 8px 10px;
  resize: vertical;
  min-height: 64px;
  width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #6b9cff;
  outline-offset: -1px;
}
label.field {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.filters .tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #e3e3e3;
  border-radius: 10px;
}
.filters .tabs a {
  padding: 5px 11px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 550;
  font-size: 13px;
}
.filters .tabs a.active {
  background: #fff;
  box-shadow: var(--shadow);
}
.filters .tabs a:hover {
  text-decoration: none;
}
.inline-form {
  display: inline;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #303030;
  cursor: pointer;
}

/* Definition lists */
.dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  font-size: 13.5px;
}
.dl dt {
  color: var(--muted);
}
.dl dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.stack > * + * {
  margin-top: 10px;
}
.addr {
  white-space: pre-line;
  line-height: 1.4;
}

/* Flash */
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 550;
}
.flash.ok {
  background: #cdfee1;
  color: #0c5132;
}
.flash.error {
  background: #fed1d7;
  color: #8e1f0b;
}
.banner {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fff4e5;
  color: #5f3b00;
  border: 1px solid #ffd79d;
  margin-bottom: 16px;
}
.banner.critical {
  background: #fff1f1;
  color: #8e1f0b;
  border-color: #f3b4b4;
}

/* Card proofs */
.proofs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.proof {
  text-align: center;
}
.proof img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  background: #fff;
}
.proof .cap {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 10px;
}
.proof .missing {
  aspect-ratio: 5 / 7;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--faint);
  font-size: 12px;
  padding: 12px;
}
.photo-thumb {
  max-height: 160px;
  max-width: 100%;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.card-text {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.card-text dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  margin-top: 8px;
}
.card-text dt:first-child {
  margin-top: 0;
}
.card-text dd {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

/* Progress */
.progress {
  height: 6px;
  border-radius: 999px;
  background: #e3e3e3;
  overflow: hidden;
  display: flex;
  min-width: 80px;
}
.progress .mailed {
  background: var(--ok);
  height: 100%;
}
.progress .printed {
  background: #6b9cff;
  height: 100%;
}
.progress-text {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.timeline li:last-child {
  border-bottom: 0;
}
.timeline .tdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c9c9c9;
  margin-top: 5px;
}
.timeline .tdot.payment {
  background: #29845a;
}
.timeline .tdot.status {
  background: #005bd3;
}
.timeline .tdot.email {
  background: #8a8a8a;
}
.timeline .tdot.note {
  background: #e5a500;
}
.timeline .tdot.review {
  background: #d72c0d;
}
.timeline .tdot.fulfillment {
  background: #7b61ff;
}
.timeline .tdot.render {
  background: #00a0ac;
}
.timeline .when {
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}
.timeline .note-body {
  white-space: pre-wrap;
  background: #fff8e1;
  padding: 8px 10px;
  border-radius: 8px;
}
.timeline .by {
  font-size: 11px;
  color: var(--faint);
  margin-left: 6px;
}

/* Chart */
.chart {
  width: 100%;
  height: 140px;
  display: block;
}
.chart rect {
  fill: #303030;
}
.chart rect:hover {
  fill: #005bd3;
}
.chart .axis {
  font-size: 10px;
  fill: var(--faint);
}

/* Materials */
.tally {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.tally:last-child {
  border-bottom: 0;
}
.tally b {
  font-variant-numeric: tabular-nums;
}
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  vertical-align: -1px;
  margin-right: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* Empty states */
.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}
.empty b {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 4px;
}

/* Pagination */
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
}

/* Login */
.login {
  max-width: 360px;
  margin: 10vh auto;
}
.login h1 {
  margin-bottom: 4px;
}
.login .card-body {
  display: grid;
  gap: 12px;
}

/* Helpers */
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.small {
  font-size: 12px;
}
.right {
  text-align: right;
}
.wrap {
  overflow-wrap: anywhere;
}
.mt {
  margin-top: 12px;
}
.mb {
  margin-bottom: 12px;
}
.copy {
  cursor: pointer;
  border-bottom: 1px dotted var(--line-strong);
}
.copy:hover {
  color: var(--link);
}
