/* ---------- Back office (admin.areaconnect.uk): built for a desktop screen ---------- */
body.bo { padding: 0; }
.bo-side {
  position: fixed; top: 0; bottom: 0; left: 0; width: 232px; z-index: 5;
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px;
}
.bo-brand { display: flex; align-items: center; gap: .45rem; font-size: .95rem; font-weight: 800; color: var(--text); text-decoration: none; padding: 0 8px 18px; }
.bo-brand img { width: 28px; height: 28px; }
.bo-brand span { font-weight: 600; color: var(--muted); }
.bo-side nav { display: flex; flex-direction: column; gap: 2px; }
.bo-side nav a { padding: .55rem .8rem; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.bo-side nav a:hover { background: var(--surface-2); color: var(--text); }
.bo-side nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.bo-me { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.bo-me button { margin-top: .5rem; }
.bo-main { max-width: 1280px; margin: 0 0 0 232px; padding: 28px 36px 60px; }
body.bo.signed-out .bo-main { margin: 0 auto; max-width: 420px; }

.bo-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 18px; }
.bo-head h1 { margin: 0; font-size: 1.6rem; }
.bo-head .right { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.bo-head input[type=search] { width: 260px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.stat.warn .n { color: var(--warn); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.cols > * { min-width: 0; overflow-x: auto; }
.card h2 { display: flex; align-items: center; gap: .5rem; }

table.bo-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.bo-table th, table.bo-table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.bo-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
table.bo-table th button { all: unset; cursor: pointer; }
table.bo-table tr.link { cursor: pointer; }
table.bo-table tr.link:hover td { background: var(--accent-soft); }
table.bo-table td.num, table.bo-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.bo-table tfoot td { font-weight: 700; border-bottom: 0; }
.bo-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }

.pill { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.active { background: var(--ok-soft); color: var(--ok); }
.pill.trial { background: var(--accent-soft); color: var(--accent); }
.pill.overdue { background: #fde2e2; color: var(--danger); }
.pill.paused, .pill.cancelled { background: var(--warn-soft); color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.bo-main .btn { min-height: 38px; padding: .4rem .85rem; }
.btn.sm { min-height: 32px; padding: .25rem .65rem; font-size: .85rem; }
.empty { padding: 1rem; color: var(--muted); }

.bo-party { display: grid; gap: 4px; margin: 0 4px 14px; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.bo-party select { font-size: .95rem; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text); }
.bo-party-banner { background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: .55rem .9rem; margin-bottom: 16px; font-weight: 600; font-size: .92rem; }
pre.cmd { background: var(--surface-2); border-radius: 10px; padding: .8rem 1rem; overflow-x: auto; font-size: .85rem; margin: .4rem 0 0; user-select: all; }
.steps-list { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; }

/* Smaller screens: the menu moves to the top */
@media (max-width: 900px) {
  .bo-side { position: sticky; width: auto; bottom: auto; flex-direction: row; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; gap: .5rem; }
  .bo-brand { padding: 0 8px 0 0; white-space: nowrap; }
  .bo-brand span { display: none; }
  .bo-side nav { flex-direction: row; }
  .bo-side nav a { white-space: nowrap; }
  .bo-me { display: none; }
  .bo-party { margin: 0; flex-direction: row; display: flex; align-items: center; gap: .4rem; }
  .bo-party span { display: none; }
  .bo-main { margin: 0; padding: 18px 16px 48px; }
  .cols, .cols.wide-left, .form-grid { grid-template-columns: 1fr; }
  .bo-head input[type=search] { width: 100%; }
}
