/* PEPD. Plain CSS, no build step. Mobile first (spec 8: mobile-friendly). */

:root {
  --ink: #1b2430;
  --muted: #5b6b7c;
  --line: #d9e0e7;
  --bg: #f6f8fa;
  --panel: #ffffff;
  --accent: #15507d;
  --error: #a32020;
  --error-bg: #fdeceb;
  --warn-bg: #fff6e0;
  --ok-bg: #e9f5ec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

main { padding: 16px; max-width: 1200px; margin: 0 auto; }

h1 { font-size: 1.4rem; margin: 0 0 12px; }

.muted { color: var(--muted); }

/* --- top bar --- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; color: var(--accent); text-decoration: none; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 14px; flex: 1; }
.topbar nav a { color: var(--ink); text-decoration: none; }
.topbar nav a:hover { color: var(--accent); text-decoration: underline; }
.topbar .user { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .9rem; }

/* --- cards and forms --- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
}
.card-narrow { max-width: 380px; margin: 48px auto; }

label { display: block; margin-bottom: 12px; font-weight: 600; }
label.inline { font-weight: 400; display: flex; gap: 8px; align-items: center; }

input[type="text"], input[type="email"], input[type="password"], select, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }

.field-error { color: var(--error); margin: -8px 0 12px; font-size: .9rem; }

/* --- flashes --- */
.flashes { list-style: none; padding: 0; margin: 0 0 16px; }
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 8px; }
.flash-error { background: var(--error-bg); color: var(--error); }
.flash-warning { background: var(--warn-bg); }
.flash-info, .flash-message { background: var(--ok-bg); }

/* --- tables, badges and progress --- */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
a.button { display: inline-block; padding: 9px 16px; background: var(--accent); color: #fff;
           border-radius: 4px; text-decoration: none; font-weight: 600; }

.table { width: 100%; border-collapse: collapse; background: var(--panel); margin-bottom: 16px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: .92rem; }
.table th { background: #eef2f5; font-weight: 600; }
.table .truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .8rem;
         background: #e7edf2; color: var(--ink); white-space: nowrap; }
.badge-parsed, .badge-header, .badge-ok { background: var(--ok-bg); }
.badge-needs_assist, .badge-content, .badge-content-neighbour { background: var(--warn-bg); }
.badge-failed { background: var(--error-bg); color: var(--error); }

.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0; max-width: 420px; }
.bar-fill { height: 100%; background: var(--accent); transition: width .3s; }

.small { font-size: .85rem; }
code { background: #eef2f5; padding: 1px 5px; border-radius: 3px; font-size: .9em; }

/* --- review --- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px;
        border-bottom: 1px solid var(--line); }
.tab { padding: 8px 14px; text-decoration: none; color: var(--ink);
       border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; }
.tab:hover { background: #eef2f5; }
.tab-on { background: var(--panel); border-color: var(--line); font-weight: 600; }

.badge-error { background: var(--error-bg); color: var(--error); }
.badge-warn { background: var(--warn-bg); }
.badge-info { background: #e7edf2; }

tr.approved { background: #f4faf5; }
.big-change { color: var(--error); font-weight: 600; }

.suggestion { padding: 2px 0; font-size: .88rem; }
.suggestion.confirmed { opacity: .7; }
button.link { background: none; border: 0; color: var(--accent); padding: 0 4px;
              font: inherit; cursor: pointer; text-decoration: underline; }
button.secondary { background: #5b6b7c; margin-left: 8px; }

.signoff { list-style: none; padding: 0; font-size: 1.05rem; }
.signoff li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* --- how-to guide (main.guide) --- */
.guide-section { margin-bottom: 16px; }
.guide-section h2 {
  font-size: 1.15rem;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.guide-section h3 { font-size: 1rem; margin: 20px 0 6px; }
.guide-section p, .guide-section li { max-width: 68ch; }
.guide-section table { margin: 12px 0; }

.guide-toc { margin-bottom: 16px; }
.guide-toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; }
.guide-toc li { break-inside: avoid; }

.guide-points { padding-left: 20px; }
.guide-points li { margin-bottom: 10px; }

/* An instruction worth not skimming past. */
.guide-note {
  background: var(--ok-bg);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
}

/* The deactivate file: forgetting it leaves hidden products on the site. */
.guide-warn {
  background: var(--warn-bg);
  border-left: 3px solid #c08a1e;
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
}
.guide-warn p:last-child { margin-bottom: 0; }

/* Wording quoted from a screen, so it is recognisable when it appears. */
.guide-quote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 700px) {
  .guide-toc ol { columns: 1; }
}
