/* The private admin page. No external files (the page's CSP allows only its own origin), no
   inline styles. A NEW request is red AND carries a "New" badge, so colour is never the only cue. */
:root { color-scheme: light; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  background-color: #f4f4f2;
}

.top { padding: 1rem 1rem 0; max-width: 60rem; margin: 0 auto; }
main { padding: 0 1rem 3rem; max-width: 60rem; margin: 0 auto; }
h1 { margin: 0 0 .5rem; font-size: 1.5rem; }
h2 { margin: 1.5rem 0 .5rem; font-size: 1.15rem; }

/* The two-page nav (requests, cars). The current page is bold and underlined as well as darker, so colour is not its only cue. */
.nav { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0 0 .5rem; }
.nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .75rem; color: #0b4fa8; border-bottom: 3px solid transparent; text-decoration: underline; }
.nav a[aria-current="page"] { color: #1a1a1a; font-weight: 700; text-decoration: none; border-bottom: 3px solid #1a1a1a; }

#message { min-height: 1.5rem; margin: .5rem 0; font-weight: 600; }

.counts { background-color: #ffffff; border: 1px solid #c9c9c4; border-radius: 6px; padding: 0 1rem 1rem; }
.counts h3 { margin: 1rem 0 .25rem; font-size: 1rem; }
.counts ul { margin: 0; padding-left: 1.25rem; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }

.request {
  background-color: #ffffff;
  color: #1a1a1a;
  border: 1px solid #c9c9c4;
  border-left: 8px solid #8a8a85;
  border-radius: 6px;
  padding: .75rem 1rem;
}

/* A new request: red tint, dark red text (well over 4.5:1) and a thick red edge. */
.is-new {
  background-color: #fde8e8;
  color: #5c0a0a;
  border-left: 8px solid #c62828;
}

/* A row with nothing to act on (request_type none): quieter, never red. Lighter colours, NOT opacity:
   #5f5f5a on #efefec is 5.57:1, and opacity would pull every child (link, flags) below 4.5:1. */
.is-muted {
  color: #5f5f5a;
  background-color: #efefec;
}

.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.kind { font-weight: 700; }
.who { font-weight: 600; }
.when { margin-left: auto; font-size: .9rem; }

.badge-new {
  display: inline-block;
  padding: .05rem .5rem;
  border-radius: 4px;
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background-color: #b00020;
  color: #ffffff;
}

.phone { font-weight: 700; color: inherit; }

.details { margin: .5rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: .15rem .75rem; }
.details dt { font-weight: 600; }
.details dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

.vin-warning {
  display: inline-block;
  margin-left: .5rem;
  padding: 0 .4rem;
  border: 2px solid currentColor;
  border-radius: 4px;
  font-weight: 700;
}

/* A car that has left the site's list. Text plus a border, so colour is not its only cue. */
.no-longer-listed {
  display: inline-block;
  margin-left: .5rem;
  padding: 0 .4rem;
  border: 2px solid currentColor;
  border-radius: 4px;
  font-weight: 700;
}

.flags { margin: .5rem 0 0; font-weight: 600; }

.actions { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.actions button {
  font: inherit;
  min-height: 2.75rem;
  padding: .25rem .9rem;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1a1a1a;
  cursor: pointer;
}
.actions button[aria-pressed="true"] { background-color: #1a1a1a; color: #ffffff; }
.actions button:focus-visible { outline: 3px solid #0b63ce; outline-offset: 2px; }
.actions button:disabled { opacity: .6; cursor: progress; }

.older { margin: 1rem 0 0; }
.older button {
  font: inherit;
  min-height: 2.75rem;
  padding: .25rem 1.25rem;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1a1a1a;
  cursor: pointer;
}
.older button:focus-visible { outline: 3px solid #0b63ce; outline-offset: 2px; }
.older button:disabled { cursor: progress; }
