:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #16181d; --muted: #666e78;
  --rule: #dde1e6; --accent: #1f3a5f; --good: #1d6b3f; --bad: #9b2226; --warn: #8a6d1f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; background: var(--bg);
  color: var(--ink); font-size: 14px; }
a { color: var(--accent); }
main { max-width: 1280px; margin: 0 auto; padding: 20px 18px 60px; }
.topbar { display: flex; align-items: center; gap: 18px; background: var(--accent);
  color: #fff; padding: 10px 18px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; }
.brand .ver { font-weight: 400; opacity: .7; font-size: 12px; }
.hub { color: #fff; text-decoration: none; font-size: 13px; opacity: .85; padding-right: 18px; border-right: 1px solid rgba(255,255,255,.35); }
.hub:hover { opacity: 1; text-decoration: underline; }
.topbar .notice { font-size: 11px; letter-spacing: .08em; opacity: .85; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: 8px;
  padding: 16px 18px; margin-bottom: 18px; }
h1 { font-size: 19px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 18px 0 8px; }
h3 { font-size: 15px; margin: 0 0 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
label.check { display: flex; align-items: center; gap: 7px; color: var(--ink);
  font-size: 13px; }
input, select { width: 100%; padding: 6px 8px; font-size: 13px; border: 1px solid var(--rule);
  border-radius: 5px; background: #fff; color: var(--ink); margin-top: 3px; }
label.check input { width: auto; margin: 0; }
.field-row { display: flex; gap: 12px; }
.field-row > label { flex: 1; }
fieldset { border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px;
  margin: 0 0 12px; }
legend { font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; padding: 0 4px; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 8px 16px; font-size: 13px; cursor: pointer; }
button:hover { filter: brightness(1.15); }
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: 7px 14px; border-radius: 6px; font-size: 13px; }
.btn-small { display: inline-block; border: 1px solid var(--rule); border-radius: 5px;
  padding: 3px 9px; font-size: 12px; text-decoration: none; color: var(--accent);
  background: #fff; cursor: pointer; }
.hint { font-size: 12px; color: var(--muted); margin: -4px 0 10px; }
.hint-line { display: none; }
.hint-line:first-of-type { display: inline; }

.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums;
  font-family: Consolas, Menlo, monospace; }
code { font-family: Consolas, Menlo, monospace; font-size: 12px; }

table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); border-bottom: 1.5px solid var(--ink);
  padding: 6px 7px; }
table.list td { border-bottom: 1px solid var(--rule); padding: 6px 7px; vertical-align: top; }
tr.bad-row td { background: #fdf1f1; }

.job { border: 1px solid var(--rule); border-radius: 6px; padding: 12px; }
.job-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.badge { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 7px; border-radius: 10px; background: var(--rule); color: var(--ink); }
.badge.done { background: #dff0e4; color: var(--good); }
.badge.error { background: #fadedd; color: var(--bad); }
.badge.warn { background: #f7eed2; color: var(--warn); }
.badge.running, .badge.queued { background: #dde7f5; color: var(--accent); }
.error { color: var(--bad); }

.panel { background: #eef1f4; border-left: 3px solid var(--accent); padding: 9px 12px;
  border-radius: 0 5px 5px 0; margin: 10px 0; font-size: 13px; }
.panel.warn { background: #fbf5e3; border-left-color: var(--warn); }

.pkg-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; }
.stats { display: flex; gap: 28px; margin-top: 12px; }
.stats .stat { display: block; font-size: 21px; font-weight: 700; }
.stats .stat.bad { color: var(--bad); }
.stats .label { font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; }
.filters { display: flex; gap: 14px; align-items: flex-end; }
.filters label { margin: 0; min-width: 190px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px; margin-bottom: 18px; }
.thumb { margin: 0; background: var(--card); border: 1px solid var(--rule);
  border-radius: 7px; overflow: hidden; }
.thumb.flagged { border-color: #d8a3a3; }
.thumb img { width: 100%; height: 210px; object-fit: cover; object-position: top;
  display: block; background: #fff; }
.thumb .no-image { height: 210px; display: grid; place-items: center; color: var(--muted);
  font-size: 12px; }
figcaption { padding: 8px 10px 10px; }
.thumb-title { font-size: 12.5px; font-weight: 600; word-break: break-word; }
.flag { font-size: 11px; color: var(--bad); margin: 4px 0; }
figcaption .btn-small { margin-top: 6px; }
.doc-detail { font-size: 13px; }

/* The generation form carries a 28-row checklist, so it gets the wider column. */
.grid-form { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px;
  align-items: start; }
@media (max-width: 1100px) { .grid-form { grid-template-columns: 1fr; } }

/* ---- Personal / Corporate tabs ------------------------------------------
   Pure CSS: the radio inputs are hidden and their :checked state reveals the
   matching panel, so switching tabs needs no JavaScript. Fields in the hidden
   panel still submit, which is the point - the corporation settings survive a
   trip through the personal tab. */
.tabs { margin-bottom: 14px; }
.tabs > .tab-radio { position: absolute; opacity: 0; pointer-events: none; }
.tab-bar { display: flex; gap: 4px; border-bottom: 1.5px solid var(--rule); }
.tab-bar .tab { display: inline-block; margin: 0; padding: 7px 16px; cursor: pointer;
  font-size: 13px; color: var(--muted); border: 1px solid transparent;
  border-bottom: 0; border-radius: 6px 6px 0 0; }
.tabs > .tab-panel { display: none; padding: 14px 0 0; }
#tab-personal:checked ~ .tab-panel[data-tab="personal"],
#tab-corporate:checked ~ .tab-panel[data-tab="corporate"] { display: block; }
#tab-personal:checked ~ .tab-bar .tab[for="tab-personal"],
#tab-corporate:checked ~ .tab-bar .tab[for="tab-corporate"] {
  color: var(--ink); font-weight: 600; background: var(--card);
  border-color: var(--rule); margin-bottom: -1.5px; }

/* ---- Preset row --------------------------------------------------------- */
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 12px; }
.preset-label { font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; margin-right: 4px; }
/* The generic button:hover brightness filter washes out a light border to nothing, so
   the small outline buttons get a hover state of their own. */
button.btn-small:hover, a.btn-small:hover { filter: none; background: #eef2f7;
  border-color: var(--accent); }

/* ---- Document checklist -------------------------------------------------- */
fieldset.doclist { padding-top: 6px; }
.doclist-row { display: grid; grid-template-columns: 1fr 4.5em 15.5em;
  align-items: center; gap: 8px; padding: 3px 0; }
.doclist-row + .doclist-row { border-top: 1px solid var(--rule); }
.doclist-row label.check { margin: 0; }
.doclist-count { width: 4.5em; margin: 0; text-align: right; }
span.doclist-count { text-align: right; padding-right: 9px; }
.doclist-opts { display: flex; gap: 6px; }
.doclist-opts select { width: auto; margin: 0; font-size: 11.5px; padding: 3px 6px; }
.doclist-hint { grid-column: 1 / -1; font-size: 11px; color: var(--muted);
  margin: -2px 0 3px 24px; }

/* ---- Job card: requested / made / delivered ------------------------------ */
table.list.requested { margin: 10px 0 4px; }
table.list.requested td, table.list.requested th { padding: 3px 7px; font-size: 12px; }
ul.error-list { margin: 6px 0 0 18px; padding: 0; font-size: 12.5px; color: var(--bad); }
