:root { --ink: #1c1f24; --muted: #5b6470; --line: #d9dee5; --bg: #f5f7fa; --card: #fff; --accent: #1f5fbf; --danger: #b3261e; --ok: #2e7d32; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.topbar nav a { color: var(--ink); text-decoration: none; padding: 6px 4px; border-bottom: 2px solid transparent; }
.topbar nav a.active { border-color: var(--accent); }
.menu { position: relative; } .menu summary { cursor: pointer; list-style: none; padding: 6px 4px; }
.menu-items { position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 0; min-width: 220px; display: flex; flex-direction: column; z-index: 5; }
.menu-items a, .menu-items span, .menu-items form { padding: 6px 14px; }
.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
h1 { font-size: 1.6rem; margin: 0 0 12px; } h2 { font-size: 1.15rem; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin: 16px 0; }
.narrow { max-width: 480px; }
label { display: block; font-weight: 600; margin: 14px 0 4px; } label.inline { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
label small, .inherit { font-weight: 400; color: var(--muted); } .inherit { display: block; margin-top: 2px; }
input:not([type=checkbox]):not([type=radio]), textarea, select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 14px 0; } legend { font-weight: 600; }
button, .button { display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; cursor: pointer; text-decoration: none; margin-top: 12px; }
button.secondary, .button.secondary { background: #fff; color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; margin: 0; text-decoration: underline; }
.danger, button.link.danger { color: var(--danger); } button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.actions { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; } th { font-size: .85rem; color: var(--muted); }
.row-actions { display: flex; gap: 12px; align-items: center; } .row-actions form { display: inline; }
.flash { padding: 10px 14px; border-radius: 6px; background: #e6f4ea; color: var(--ok); border: 1px solid #b7dfc0; }
.flash.error { background: #fdecea; color: var(--danger); border-color: #f2b8b5; } .flash ul { margin: 0; padding-left: 18px; }
.muted, .empty { color: var(--muted); }
.workflow { display: flex; gap: 8px; list-style: none; padding: 0; margin: 8px 0 16px; flex-wrap: wrap; }
.workflow li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .9rem; }
.workflow li.done { border-color: var(--ok); color: var(--ok); } .workflow li.current { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.workflow li.later { color: var(--muted); } .workflow .num { display: inline-block; width: 1.4em; text-align: center; border-radius: 50%; background: var(--bg); margin-right: 4px; }
.workflow small { margin-left: 6px; }
dl.grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; } dt { color: var(--muted); } dd { margin: 0; }
.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 8px; } .filters label { margin: 0 0 4px; } .filters button { margin: 0; }
.report { background: #fbfbe6; border: 1px solid #e9e5a3; border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; }
details.advanced { margin-top: 14px; } details.advanced summary { cursor: pointer; font-weight: 600; }
code { background: var(--bg); padding: 1px 4px; border-radius: 4px; }
/* Narrow screens: hide secondary columns but always keep the last (actions) column. */
@media (max-width: 640px) { .topbar { padding: 10px 16px; } th:nth-child(n+3):not(:last-child), td:nth-child(n+3):not(:last-child) { display: none; } .row-actions { display: flex; flex-direction: column; gap: 6px; } }
.qr svg { width: 200px; height: 200px; display: block; margin: 8px 0; }
.codes { columns: 2; list-style: none; padding: 0; max-width: 420px; }
.inline-form { display: inline-block; margin-right: 12px; }
.preview-frame { width: 100%; height: 75vh; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
