/* PlayOn vendor portal. Standalone — shares nothing with the staff app's CSS. */
:root {
  --navy: #0a3a5c;
  --navy-2: #134a72;
  --amber: #f4b12a;
  --sage: #6f9f85;
  --ink: #16212b;
  --muted: #5b6875;
  --line: #dde2e8;
  --bg: #f4f6f8;
  --card: #ffffff;
  --red: #b3261e;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6ebf0;
    --muted: #9aa7b4;
    --line: #2a3642;
    --bg: #0f161d;
    --card: #17212b;
    --navy-2: #6fa8d6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--navy-2); }

.topbar {
  background: var(--navy);
  color: #fff;
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.75rem; color: #fff; text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand span { font-weight: 600; opacity: 0.9; border-left: 1px solid rgba(255,255,255,0.35); padding-left: 0.75rem; }
.who { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.who .vendor { font-weight: 600; }

main { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
h1 { font-size: 1.4rem; margin: 0 0 0.25rem; }
.sub { color: var(--muted); margin: 0 0 1.25rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--amber); border-color: var(--amber); color: #1d1500; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.4); color: #fff; padding: 0.35rem 0.8rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* Sign-in */
.signin { max-width: 440px; margin: 3rem auto; }
.signin h1 { margin-bottom: 0.5rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin: 1rem 0; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input {
  font: inherit; padding: 0.6rem 0.75rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink);
}
.note { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--red); }

/* PO list */
.toolbar { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input {
  font: inherit; padding: 0.5rem 0.75rem; min-width: 0; flex: 1 1 260px; max-width: 360px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
}
.count { color: var(--muted); font-size: 0.9rem; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: color-mix(in srgb, var(--navy-2) 7%, transparent); }
td .po-no { font-weight: 600; }
td .small, td.small { color: var(--muted); font-size: 0.85rem; }
td.nowrap { white-space: nowrap; }

.pill {
  display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--ink);
}
.pill--issued { background: color-mix(in srgb, var(--amber) 28%, transparent); }
.pill--confirmed { background: color-mix(in srgb, var(--sage) 30%, transparent); }
.pill--problem { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.pill--claim { background: color-mix(in srgb, var(--navy-2) 18%, transparent); }

.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }

/* PO detail */
.back { display: inline-block; margin-bottom: 1rem; }
.detail-head { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; }
dt { color: var(--muted); font-size: 0.9rem; }
dd { margin: 0; overflow-wrap: anywhere; }
.card h2 { font-size: 1rem; margin: 0 0 0.75rem; }

/* List groups (Open / Recently completed) */
.group + .group { margin-top: 1.75rem; }
.group-title { font-size: 1rem; margin: 0 0 0.6rem; color: var(--muted); font-weight: 600; }
.tags { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.3rem; }

/* Detail: stacked cards after the grid */
#detail > .card { margin-top: 1rem; }

/* File grid (renderings, shared photos) */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.file {
  display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem; background: var(--bg);
}
.file:hover { border-color: var(--navy-2); }
.file img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; background: var(--card); }
.file-icon {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3;
  border-radius: 5px; background: var(--card); color: var(--muted); font-weight: 700; letter-spacing: 0.05em;
}
.file-name { font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Upload */
.upload { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.upload input:focus-visible + label { outline: 2px solid var(--navy-2); outline-offset: 2px; }
.is-busy { opacity: 0.6; pointer-events: none; }

@media (max-width: 640px) {
  .brand span { display: none; }
  .who { margin-left: 0; width: 100%; justify-content: space-between; }
  /* The list becomes cards: each row stacks its cells. */
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
  td { border: 0; padding: 0.25rem 0.9rem; }
  td[data-label]::before { content: attr(data-label) " · "; color: var(--muted); font-size: 0.8rem; }
}
