body.admin { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; align-self: start; height: 100vh; padding: 1.25rem 1rem; background: var(--ink); color: #fff; display: flex; flex-direction: column; gap: .15rem; }
.side .title { font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.side .muted { color: #a9b6b1; }
.side ul { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .15rem; }
.side a { display: block; padding: .5rem .7rem; border-radius: 6px; color: #fff; text-decoration: none; font-weight: 500; }
.side a:hover { background: rgb(255 255 255 / .1); }
.side a[aria-current] { background: #fff; color: var(--ink); font-weight: 700; }
.side-foot { margin-top: auto; }
.side-foot a { text-decoration: underline; text-underline-offset: 2px; padding-left: 0; }
.side :focus-visible { outline-color: #fff; }

.main { padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 5rem; min-width: 0; outline: none; }
.main > h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 6px solid var(--ink); }
.main section { margin-top: 2rem; }
.main h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: .6rem; padding-bottom: .3rem; border-bottom: 3px solid var(--ink); }
.main a { color: var(--brand); }
.main a.primary { color: #fff; text-decoration: none; display: inline-block; }
.main a.ghost { color: var(--ink); text-decoration: none; display: inline-block; }
.main .grid .th { padding: .55rem .7rem; font-weight: 700; position: static; }
.main .grid tr.dim { opacity: .55; }
.main input:not([type="checkbox"]), .main select { padding: .45rem .6rem; border: 1px solid #9aa7a2; border-radius: 6px; background: #fff; font: inherit; color: inherit; max-width: 100%; }
.main td input:not([type="checkbox"]):not([type="date"]) { width: 100%; min-width: 5rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin: 0; border-bottom: 1px solid var(--ink); }
.stat { padding: .7rem 1rem .8rem 0; }
.stat dt { color: var(--muted); font-size: .9rem; }
.stat dd { margin: 0; font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.15; }
.stat dd small { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.steps li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: .6rem; align-items: start; max-width: 60rem; }
.steps li button { margin-left: .5rem; }
.mark { flex: none; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border: 2px solid var(--ink); border-radius: 50%; font-weight: 800; font-size: .85rem; }
.steps .done .mark { background: var(--better); border-color: var(--better); color: #fff; }

.coverage { display: grid; gap: .2rem; max-width: 46rem; margin-top: .75rem; }
.crow { display: grid; grid-template-columns: 13rem minmax(0, 1fr) 4rem; gap: .75rem; align-items: center; font-size: .9rem; }
.ctrack { height: .7rem; background: var(--rule); border-radius: 2px; overflow: hidden; }
.cbar { display: block; height: 100%; width: var(--w); background: var(--brand); }
.crow .num { text-align: right; font-variant-numeric: tabular-nums; }

.tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .9rem; }
.tools.tight { margin: 0; flex-wrap: nowrap; }
.tools .grow { flex: 1; }
.tools input[type="search"] { flex: 1 1 16rem; max-width: 26rem; }
.tools.sticky { position: sticky; bottom: 0; margin: 1.5rem 0 0; padding: .9rem 0; background: var(--paper); border-top: 3px solid var(--ink); }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; }
.danger { color: #a3261a; }
.pill { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--rule); }
.pill.paid { background: var(--better-bg); color: var(--better); }
.pill.failed, .pill.cancelled { background: #fbe9e1; color: #a3261a; }
.toast.bad { background: #a3261a; }

.editor fieldset { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .9rem 1.25rem; margin: 1.75rem 0 0; padding: 0; border: 0; border-top: 3px solid var(--ink); }
.editor legend { padding: 0 .6rem 0 0; font-weight: 800; font-size: 1.1rem; float: left; width: 100%; margin: .6rem 0 .2rem; grid-column: 1 / -1; }
.editor label { display: grid; gap: .25rem; font-weight: 500; align-content: start; }
.editor label.check { display: flex; align-items: center; gap: .45rem; }
.editor .wide { grid-column: 1 / -1; }
.editor .checks-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.editor fieldset.nutrients { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .6rem 1.25rem; }
.editor fieldset.lookup { display: block; padding: .25rem 1rem 1rem; background: var(--brand-soft); border: 0; border-left: 4px solid var(--brand); }
.editor fieldset.lookup legend { float: none; width: auto; }
.editor fieldset.lookup .tools { margin: .6rem 0 0; }

@media (max-width: 860px) {
  body.admin { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; }
  .side ul { display: flex; flex-wrap: wrap; margin-top: .75rem; }
  .side-foot { margin-top: .75rem; }
  .crow { grid-template-columns: 9rem minmax(0, 1fr) 3rem; }
}
