* { box-sizing: border-box; }
body {
    font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: #f4f6f8;
    color: #1f2937;
}
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 24px; background: #111827; color: white;
}
.topbar .brand a { color: white; font-weight: 600; text-decoration: none; }
.topbar nav a, .topbar nav button.link {
    color: #cbd5e1; margin-left: 18px; text-decoration: none;
    background: none; border: none; cursor: pointer; font: inherit;
}
.topbar nav a:hover, .topbar nav button.link:hover { color: white; }
main { max-width: 1100px; margin: 24px auto; padding: 0 24px; }
h1 { margin-top: 0; }
.card {
    background: white; padding: 20px; border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 24px;
}
.card.narrow { max-width: 380px; margin: 60px auto; }
form label { display: block; margin-bottom: 12px; }
form input, form select, form textarea {
    display: block; width: 100%; padding: 8px 10px;
    border: 1px solid #d1d5db; border-radius: 6px; font: inherit;
    margin-top: 4px; background: white;
}
form textarea { font-family: ui-monospace, Menlo, monospace; }
button {
    padding: 8px 16px; background: #2563eb; color: white;
    border: none; border-radius: 6px; cursor: pointer; font: inherit;
}
button:hover { background: #1d4ed8; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }
form.inline { display: inline; }
table.grid {
    width: 100%; border-collapse: collapse; background: white;
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
table.grid th, table.grid td {
    text-align: left; padding: 10px 12px; border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}
table.grid th { background: #f9fafb; font-weight: 600; }
table.grid td.actions { white-space: nowrap; }
table.grid td.actions form { margin-right: 4px; }
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    background: #e5e7eb; font-size: 12px;
}
.badge.status-delivered { background: #d1fae5; color: #065f46; }
.badge.status-received  { background: #dbeafe; color: #1e40af; }
.badge.status-no-endpoints { background: #fef3c7; color: #92400e; }
.muted { color: #6b7280; }
.error { color: #dc2626; }
pre {
    background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 6px;
    overflow: auto; font-size: 12.5px;
}
pre.tight { padding: 6px 8px; font-size: 12px; margin: 0; max-height: 200px; }
code { background: #eef2ff; padding: 1px 4px; border-radius: 4px; font-size: 12.5px; }
.orders-form .row { display: flex; gap: 16px; }
.orders-form .row .col { flex: 1; }
button.big {
    display: block; width: 100%; padding: 16px 24px;
    font-size: 16px; font-weight: 600; margin-top: 8px;
}
.orders-form .row.actions { margin-top: 8px; }
.orders-form .row.actions button.big { margin-top: 0; }
button.secondary { background: #0f766e; }
button.secondary:hover { background: #115e59; }
.orders-picker {
    border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 8px 12px; margin-bottom: 12px; background: #f9fafb;
    max-height: 260px; overflow-y: auto;
}
.orders-picker .picker-header {
    font-weight: 600; color: #374151; margin: 6px 0 4px;
}
.orders-picker .picker-header:first-child { margin-top: 0; }
.orders-picker .picker-row {
    display: flex; gap: 8px; align-items: center;
    padding: 4px 0; margin: 0; cursor: pointer;
}
.orders-picker .picker-row input[type=checkbox] {
    width: auto; margin: 0;
}
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
textarea.result-box {
    width: 100%; font-family: ui-monospace, Menlo, monospace;
    background: #0f172a; color: #e2e8f0; border-color: #0f172a;
    padding: 12px; border-radius: 6px; font-size: 13px; line-height: 1.45;
    resize: vertical;
}
