/* FieldMatch review page: one stylesheet, laptop first. */
:root {
  --ink: #1d2730;
  --muted: #5b6770;
  --line: #d9dee2;
  --bg: #f5f7f8;
  --card: #ffffff;
  --accent: #0b6e4f;
  --accent-ink: #ffffff;
  --warn-bg: #fff6db;
  --warn-line: #e3b341;
  --error-bg: #fde8e7;
  --error-line: #c9372c;
  --ok-bg: #e5f5ec;
  --ok-line: #2f8f5b;
  --info-bg: #e8f1fb;
  --info-line: #3b78c3;
}

* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
main { max-width: 1400px; margin: 0 auto; padding: 20px 24px 60px; }
h1 { font-size: 1.6rem; margin: 0.2em 0 0.4em; }
h2 { font-size: 1.15rem; margin: 0 0 0.6em; }
a { color: var(--accent); }
code { background: #eef1f3; padding: 0 4px; border-radius: 3px; }

.topbar { display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: var(--ink); color: #fff; }
.topbar a { color: #fff; text-decoration: none; }
.topbar .brand { font-weight: 700; font-size: 1.1rem; }
.topbar nav { display: flex; gap: 16px; }
.topbar .who { margin-left: auto; color: #c7d0d6; }
.topbar .link { color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; margin-bottom: 20px; }
.card.narrow { max-width: 480px; margin: 40px auto; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; }
.hint, .small { color: var(--muted); font-size: 0.88rem; }
.crumbs { margin: 0; }

label { display: block; font-weight: 600; margin: 10px 0 4px; }
input[type="text"], input[type="password"], input[type="search"] { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; font: inherit; }
input[type="file"] { display: block; margin-bottom: 10px; }
button, .button { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { border-color: var(--muted); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--error-line); }
button.link { border: 0; background: none; padding: 0; text-decoration: underline; }
form.inline { display: inline; }
form button { margin-top: 10px; }
form.inline button, .toolbar button, .actions button { margin-top: 0; }

.message { padding: 10px 14px; border-left: 4px solid; border-radius: 4px; margin: 0 0 12px; }
.message.success { background: var(--ok-bg); border-color: var(--ok-line); }
.message.error, .message.conflict { background: var(--error-bg); border-color: var(--error-line); }
.message.warning { background: var(--warn-bg); border-color: var(--warn-line); }
.message.info { background: var(--info-bg); border-color: var(--info-line); }
.message ul { margin: 6px 0 0; }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); font-weight: 600; background: #fafbfc; }
td.num, th.num { text-align: right; white-space: nowrap; }
table.rows tr.highlight td { background: #fff8f0; }
table.rows tr.highlight td:first-child { box-shadow: inset 4px 0 0 var(--warn-line); }

.status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.85rem; background: #eef1f3; }
.status.needs_review { background: var(--warn-bg); }
.status.completed, .status.confirmed, .status.auto_matched { background: var(--ok-bg); }
.status.failed { background: var(--error-bg); }
.status.matching, .status.pending { background: var(--info-bg); }
h1 .status { font-size: 0.9rem; vertical-align: middle; }

.counts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0; }
.counts li { padding: 4px 12px; border-radius: 14px; }

.flag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 0.8rem; font-weight: 600; cursor: help; margin: 0 4px 4px 0; }
.flag.invalid_price { background: var(--error-bg); color: #8a1f17; border: 1px solid var(--error-line); }
.flag.duplicate_target { background: var(--warn-bg); color: #7a5500; border: 1px solid var(--warn-line); }

.filters { display: flex; gap: 6px; margin: 16px 0 10px; flex-wrap: wrap; }
.filters a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-decoration: none; color: var(--ink); }
.filters a.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; }
.pages { display: flex; gap: 16px; justify-content: center; margin: 16px 0; }

.actions { min-width: 240px; }
.map-form { position: relative; display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px; }
.map-form input[type="search"] { flex: 1; min-width: 150px; }
.map-form .results { position: absolute; top: 36px; left: 0; right: 0; z-index: 5; margin: 0; padding: 0; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); max-height: 260px; overflow-y: auto; }
.map-form .results button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; }
.map-form .results button:hover, .map-form .results button:focus { background: var(--info-bg); }
.map-form .results .empty { padding: 7px 14px; color: var(--muted); }

.reveal { position: relative; }
.reveal input { padding-right: 62px; }
.reveal .toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; margin: 0; padding: 0 11px; border: 0; border-left: 1px solid var(--line); border-radius: 0 4px 4px 0; background: #fff; color: var(--accent); font-size: 0.88rem; }
.reveal .toggle:hover { background: var(--bg); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
