/* Legacy compatibility file.
   The admin list theme now lives in app.css and is fully token-driven.
   This file intentionally stays minimal so older page includes do not
   override the global design token system with stale hardcoded values. */

/* ── Invoice document-history ledger (Admin/Invoices/Details) ──────────────
   Moved out of the page's inline <style> so the ledger's amount column and
   header typography stay in lockstep with record-row.css (A-V14). */
.invoice-document-history .record-row__amount {
  display: flex;
  justify-content: flex-start;
  text-align: left;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  align-self: center;
  font-variant-numeric: tabular-nums;
}

.invoice-detail-page .invoice-detail-form,
.invoice-detail-page .invoice-detail-form .field-input {
  width: 100%;
  max-width: none;
}

.auction-house-active-field .field-check {
  min-height: 46px;
}

@container record-list (min-width: 640px) {
  .invoice-linked-requests .record-row__badge,
  .invoice-linked-requests .record-row:not(.record-row--header) .record-row__badge,
  .invoice-linked-requests .record-row:not(.record-row--header) .record-row__badge:has(.status-pill + .status-pill),
  .customer-history-list .record-row__badge,
  .customer-history-list .record-row:not(.record-row--header) .record-row__badge,
  .customer-history-list .record-row:not(.record-row--header) .record-row__badge:has(.status-pill + .status-pill),
  .invoice-document-history .record-row__badge,
  .invoice-document-history .record-row:not(.record-row--header) .record-row__badge {
    justify-content: flex-start;
    align-items: flex-start;
  }
}

.invoice-document-history .record-row:not(.record-row--header) .record-row__inner:not(:has(.record-row__tap-area)) {
  grid-template-areas:
    "primary badge"
    "meta-1 badge"
    "meta-2 badge"
    "amount badge";
}

.invoice-document-history .record-row:not(.record-row--header) .record-row__inner:not(:has(.record-row__tap-area)) > .record-row__amount {
  grid-area: amount;
}

@container record-list (min-width: 640px) {
  .invoice-document-history .record-row:not(.record-row--header) .record-row__inner:not(:has(.record-row__tap-area)) {
    grid-template-areas: none;
  }

  /* The narrow layout's named area must go too: with no areas defined it sent the amount to an extra
     column at the end, so every cell after it sat one heading to the left. */
  .invoice-document-history .record-row:not(.record-row--header) .record-row__inner:not(:has(.record-row__tap-area)) > .record-row__amount {
    grid-area: auto;
  }

  .invoice-document-history .record-row:not(.record-row--header) .record-row__amount {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
}

/* Admin → Background Jobs: three panels one under another, on a normally scrolling page. */
.background-jobs-page > .table-wrap + .table-wrap { margin-top: var(--space-lg); }

/* Admin → Closures form */
.closure-choice { display:flex; flex-wrap:wrap; gap:8px; }
.closure-house-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap:8px;
}
.closure-house-tools {
  display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin-bottom:8px;
}
.closure-house-search {
  flex:1 1 240px; min-width:0; min-height:44px; padding:8px 12px;
  font:inherit; font-size:var(--font-size-base); color:var(--color-text-primary);
  background:var(--field-fill); border:1px solid var(--color-border); border-radius:var(--radius-md);
}
.closure-house-search:focus { outline:none; border-color:var(--field-focus-border); box-shadow:var(--field-focus-ring); }
.closure-house-only {
  display:inline-flex; align-items:center; gap:8px; min-height:44px; cursor:pointer;
  font-size:var(--font-size-sm); color:var(--color-text-secondary);
}
.closure-house-count { font-size:var(--font-size-sm); font-weight:var(--font-weight-semibold); color:var(--color-text-secondary); font-variant-numeric:tabular-nums; }
.closure-house-picked { margin-bottom:8px; font-size:var(--font-size-sm); color:var(--color-text-primary); line-height:1.45; }
.closure-house-picked[hidden], .closure-house-none[hidden], .closure-house-grid [hidden] { display:none; }
/* A bounded, scrolling list: every house stays reachable without a 3,700px page on a phone. */
.closure-house-grid {
  max-height:min(360px, 55dvh); overflow-y:auto; overscroll-behavior:contain;
  padding:2px; border-radius:var(--radius-md);
}
.closure-house-none { margin:8px 0 0; font-size:var(--font-size-sm); color:var(--color-text-secondary); }
.closure-hint {
  font-size:var(--font-size-sm);
  color:var(--color-text-secondary);
  align-self:center;
}
/* Under a field (a column), centring pushed the hint into the middle of the line. */
.field > .closure-hint { align-self:stretch; }

/* Admin → Notices form */
.notice-guide-gist {
  display:block; margin-top:2px; font-weight:var(--font-weight-regular);
  font-size:var(--font-size-sm); color:var(--color-text-secondary);
}
.notice-guide[open] .notice-guide-gist { display:none; }
.notice-options { display:grid; gap:8px; }
.notice-options--style { grid-template-columns:repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.notice-options--colors { display:flex; flex-wrap:wrap; }
.notice-option {
  display:flex; align-items:flex-start; gap:10px; cursor:pointer;
  border:1px solid var(--color-border); border-radius:var(--radius-md); padding:12px;
  background:var(--color-surface);
}
.notice-option:has(input:checked) { border-color:var(--color-primary); box-shadow:0 0 0 1px var(--color-primary); }
.notice-option input { margin-top:3px; flex:none; }
.notice-option strong { display:block; font-size:var(--font-size-sm); }
.notice-option small { display:block; color:var(--color-text-secondary); line-height:1.4; margin-top:2px; }
.notice-option--color { align-items:center; padding:8px 12px; }
.notice-option--color input { margin-top:0; }
.notice-swatch {
  display:inline-grid; place-items:center; width:34px; height:28px; border-radius:var(--radius-sm);
  font-weight:800; font-size:13px; border:1px solid var(--sn-line);
}
.notice-custom-row { display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; }
.notice-color-pick { display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-weight:600; }
.notice-color-pick input[type="color"] {
  width:48px; height:40px; padding:2px; border:1px solid var(--color-border); border-radius:var(--radius-sm); background:var(--color-surface); cursor:pointer;
}
.notice-contrast { font-size:var(--font-size-sm); font-weight:600; color:var(--color-success); }
.notice-contrast.is-bad { color:var(--color-error); }
.notice-image-row { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.notice-image-row input[type="file"] { flex:1 1 240px; }
.notice-image-thumb { width:96px; height:64px; object-fit:cover; border-radius:var(--radius-sm); border:1px solid var(--color-border); }
.notice-image-thumb[hidden] { display:none; }
.notice-photo-advice {
  font-size:var(--font-size-sm); line-height:1.45; color:var(--color-text-primary);
  padding:8px 12px; border-radius:var(--radius-md); border-left:3px solid var(--color-primary);
  background:color-mix(in srgb, var(--color-primary) 6%, var(--color-surface));
}
.notice-photo-advice:empty { display:none; }
.notice-count { margin-top:4px; font-size:12.5px; color:var(--color-text-secondary); font-variant-numeric:tabular-nums; }
.notice-count.is-long { color:var(--color-warning); font-weight:600; }

/* The form in four steps, in the order a promotion is designed */
.notice-step { padding:16px; }
.notice-step-title {
  display:flex; align-items:center; gap:10px; margin:0 0 14px;
  font-size:var(--font-size-base); font-weight:700; color:var(--color-text-primary);
}
.notice-step-num {
  flex:none; display:grid; place-items:center; width:26px; height:26px; border-radius:50%;
  background:var(--color-primary); color:var(--color-text-inverse); font-size:13px; font-weight:800;
}
.notice-actions { display:flex; flex-wrap:wrap; gap:10px; }

.notice-guide {
  border:1px solid var(--color-border); border-radius:var(--radius-lg); background:var(--color-surface);
}
.notice-guide > summary {
  cursor:pointer; padding:12px 16px; font-weight:700; color:var(--color-text-primary); min-height:44px;
}
.notice-guide > summary:focus-visible { outline:2px solid var(--color-primary); outline-offset:-2px; border-radius:var(--radius-lg); }
.notice-guide-list {
  margin:0; padding:0 16px 14px 36px; display:grid; gap:8px;
  font-size:var(--font-size-sm); line-height:1.5; color:var(--color-text-secondary); max-width:80ch;
}
.notice-guide-list strong { color:var(--color-text-primary); }

.notice-preview { padding:0 16px 20px; }
.notice-preview--banner .site-notice { margin-bottom:0; }
.notice-preview--toast { display:flex; justify-content:flex-end; }

/* ── Admin → Partner Inbox ── */
.inbox-paused {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 16px; border-radius:var(--radius-md);
  background:var(--color-warning-bg); color:var(--color-text-primary);
  border:1px solid color-mix(in srgb, var(--color-warning) 40%, transparent);
}
.inbox-paused strong { display:block; }
.inbox-layout { display:grid; gap:16px; grid-template-columns:minmax(0, 1fr); align-items:start; }
@media (min-width: 1100px) { .inbox-layout { grid-template-columns:minmax(0, 5fr) minmax(0, 6fr); } }
@media (min-width: 1100px) { .inbox-email { position:sticky; top:16px; } }
.inbox-email-body {
  margin:0; padding:12px 16px 16px; white-space:pre-wrap; overflow-wrap:anywhere;
  font-family:inherit; font-size:14.5px; line-height:1.65; color:var(--color-text-primary);
  max-height:70vh; overflow:auto;
}
.inbox-notice { padding:16px; display:flex; flex-direction:column; gap:10px; }
.inbox-notice-head { display:flex; flex-wrap:wrap; gap:6px; }
.inbox-notice-summary { margin:0; font-weight:600; color:var(--color-text-primary); }
.inbox-facts { display:grid; grid-template-columns:max-content minmax(0, 1fr); gap:4px 12px; margin:0; font-size:14px; }
.inbox-facts dt { color:var(--color-text-secondary); font-weight:600; }
.inbox-facts dd { margin:0; color:var(--color-text-primary); }
.inbox-quote {
  margin:0; padding:8px 12px; border-left:3px solid var(--color-border);
  color:var(--color-text-secondary); font-size:14px; white-space:pre-wrap;
}
.inbox-checks { margin:0; padding-left:18px; font-size:14px; color:var(--color-text-secondary); display:grid; gap:4px; }
.inbox-checks .is-must-fix { color:var(--color-error); font-weight:600; }
.inbox-affected { font-size:14px; color:var(--color-text-primary); }
.inbox-affected ul { margin:4px 0 0; padding-left:18px; }
.inbox-apply { display:flex; flex-direction:column; gap:10px; padding-top:10px; border-top:1px solid var(--color-border-light); }
.inbox-edit summary { cursor:pointer; font-size:14px; font-weight:600; color:var(--color-primary); min-height:32px; display:flex; align-items:center; }
.inbox-outcome { margin:0; font-size:14px; color:var(--color-text-primary); }
/* Day · house · button: wraps to the next line instead of squeezing (a date box will not shrink below its
   own width, so fixed thirds overlapped the house list on an iPad Air). */
.opening-form { display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px; }
.opening-form > div { flex:1 1 200px; min-width:0; }
.opening-form > .opening-form-action { flex:0 0 auto; }
.opening-form .field-input { width:100%; }
.opening-list { list-style:none; margin:0; display:grid; gap:6px; }
.opening-list li { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:8px 0; border-top:1px solid var(--color-border-light); font-size:14px; }

