:root {
  --ink: #1c2127; --muted: #6b7280; --line: #e3e6ea; --bg: #f5f6f8; --card: #fff;
  --green: #1f6f43; --good: #e8f6ec; --warn: #fff8e6; --bad: #b3261e; --blue: #2f5fa8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
header { display: flex; align-items: center; gap: 14px; padding: 12px 20px;
         background: var(--green); color: #fff; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 600; font-size: 17px; }
header nav { display: flex; gap: 16px; margin-right: auto; margin-left: 10px; }
header nav a { color: #d8ece0; text-decoration: none; }
header nav a:hover { color: #fff; text-decoration: underline; }
.who { color: #d8ece0; font-size: 13px; }
.badge { background: #fff; color: var(--green); border-radius: 10px; padding: 0 6px;
         font-size: 12px; font-weight: 700; }
main { max-width: 1080px; margin: 0 auto; padding: 18px 16px 40px; }
footer { max-width: 1080px; margin: 0 auto; padding: 0 16px 26px; display: flex;
         justify-content: space-between; color: var(--muted); font-size: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
        padding: 18px 20px; margin-bottom: 16px; }
.card.narrow { max-width: 440px; margin: 36px auto; }
h1 { font-size: 20px; margin: 0 0 10px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12.5px; }
.warn { background: var(--warn); border-radius: 6px; padding: 9px 12px; }
.flash { background: #fff4f4; border: 1px solid #f3c9c9; padding: 10px 14px;
         border-radius: 6px; margin-bottom: 14px; }
label { display: block; font-weight: 600; margin: 0 0 12px; }
input[type=text], input[type=search], input[type=password], input:not([type]), textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit;
  border: 1px solid #c9d2de; border-radius: 6px; background: #fff; font-weight: 400;
}
button.primary, .primary-link {
  background: var(--green); color: #fff; border: 0; border-radius: 6px; padding: 10px 18px;
  font-size: 15px; cursor: pointer; text-decoration: none; display: inline-block;
}
button.primary:hover { background: #175734; }
button.primary:disabled { background: #9bb8a7; cursor: not-allowed; }
button.primary.small, button.link.small { padding: 5px 10px; font-size: 13px; }
button.link { background: none; border: 0; color: var(--blue); cursor: pointer;
              text-decoration: underline; font: inherit; padding: 0; }
header button.link { color: #fff; }
button.link.danger { color: var(--bad); }
form.inline { margin: 0; }
.chip { display: inline-block; background: #eef1f5; border: 1px solid var(--line);
        border-radius: 14px; padding: 4px 12px; cursor: pointer; font-size: 13px;
        text-decoration: none; color: var(--ink); }
.chip.on, .chip:hover { background: #dfe6ef; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 12px; background: #eef1f5;
        font-size: 12.5px; }
.pill.submitted, .pill.pending, .warn-pill { background: var(--warn); }
.pill.confirmed, .pill.active { background: var(--good); }
.pill.printed { background: #e4ecfa; }
.pill.cancelled, .pill.blocked { background: #fde9ec; }

table { border-collapse: collapse; width: 100%; }
table.list td, table.list th, table.lines td, table.lines th {
  padding: 8px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top;
}
table.lines thead th, table.list thead th { border-top: 0; color: var(--muted);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.wrap { white-space: pre-wrap; max-width: 280px; font-size: 13px; }
tfoot th { border-top: 2px solid var(--line); font-size: 15px; }
input.qty { width: 72px; text-align: right; padding: 5px 7px; margin: 0; display: inline-block; }
button.remove { background: none; border: 0; color: var(--bad); font-size: 19px; cursor: pointer;
                line-height: 1; }
tr.flash-row { background: #fff6d6; }
.empty { color: var(--muted); padding: 10px 0; }

.finder { margin-top: 6px; }
.results { max-height: 340px; overflow-y: auto; margin-top: 8px; }
.result { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
          padding: 7px 2px; border-top: 1px solid var(--line); }
.pname { flex: 1 1 260px; }
button.unit { background: #eef4ef; border: 1px solid #cfe0d5; border-radius: 6px;
              padding: 5px 11px; cursor: pointer; font: inherit; font-size: 13px; white-space: nowrap; }
button.unit:hover { background: var(--good); border-color: var(--green); }
a { color: var(--blue); }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
