body {
    font-family: system-ui, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #eef7fc;
    color: #222;
}

.NavBar {
    background-color: #d0eaff;
    padding: 0.75em 1em;
    border-bottom: 2px solid #b0d4ec;
    text-align: center;
}

.NavBar a {
    color: #0366a8;
    text-decoration: none;
    margin: 0 0.75em;
    font-weight: bold;
}

.NavBar a:hover {
    text-decoration: underline;
}

.PageWrapper {
    max-width: 900px;
    margin: 2em auto;
    padding: 1em;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.PagePanel {
    margin-bottom: 1.5em;
    padding: 1em;
    background-color: #f3faff;
    border: 1px solid #cde5f6;
    border-radius: 6px;
}

.fix {
    font-size: 0.85em;
    text-align: right;
    color: #555;
}

/* i18n locale toggle (in nav bar, and floating on login page) */
.NavLocaleToggle {
    display: inline-block;
    margin: 0;
    padding: 0;
}
.NavLocaleToggle.NavLocaleToggleLogin {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
}
.NavLocaleBtn {
    background: transparent;
    border: 1px solid transparent;
    color: inherit;
    font: inherit;
    padding: 0 0.3em;
    cursor: pointer;
    opacity: 0.6;
}
.NavLocaleBtn.is-active {
    opacity: 1;
    font-weight: bold;
    border-bottom: 2px solid currentColor;
}

/* Stock listing table — 7 columns since the lot/expiry redesign. */
.PageWrapper.WidePage,
.PageWrapper:has(.ProductTable) {
    max-width: 1180px;
}
.ProductTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    margin-top: 0.5em;
}
.ProductTable th,
.ProductTable td {
    padding: 0.4em 0.6em;
    border-bottom: 1px solid #d8e8f1;
    text-align: left;
    vertical-align: top;
}
.ProductTable th {
    background: #e6f1f8;
    font-weight: 600;
}
.ProductTable td.num,
.ProductTable th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.ProductTable .ProductLink {
    display: block;
    text-decoration: none;
    color: inherit;
}
.ProductTable .ProductLink:hover .ProductName {
    text-decoration: underline;
    color: #0366a8;
}
.ProductTable .ProductName {
    display: block;
    font-weight: 500;
}
.ProductTable .ProductCode {
    display: block;
    font-size: 0.85em;
    color: #666;
    font-family: ui-monospace, monospace;
}
.ProductTable .LotHint {
    color: #666;
    font-size: 0.85em;
    margin-left: 0.3em;
}

.StockToggles {
    display: flex;
    gap: 1em;
    margin: 0.5em 0;
    font-size: 0.9em;
    color: #444;
}
.StockToggles label {
    cursor: pointer;
}

.StatusChip {
    display: inline-block;
    padding: 0.1em 0.5em;
    border-radius: 0.8em;
    font-size: 0.85em;
    white-space: nowrap;
}
.StatusChipExpired {
    background: #fde2e2;
    color: #8a1c1c;
    border: 1px solid #f5b8b8;
}
.StatusChipWarning {
    background: #fff4d6;
    color: #7a5a00;
    border: 1px solid #f0d68a;
}
.SharedBadge {
    display: inline-block;
    padding: 0.1em 0.5em;
    border-radius: 0.8em;
    font-size: 0.85em;
    background: #e8e2f5;
    color: #553a8a;
    border: 1px solid #c8b8e8;
    cursor: help;
    white-space: nowrap;
}
.StatusChipHealthy {
    background: #e2f5e6;
    color: #1c5a2a;
    border: 1px solid #a8d8b3;
}

/* Product detail page (/products/{article_code}). */
.ProductDetailBack {
    margin: 0 0 0.5em 0;
    font-size: 0.95em;
}
.ProductDetailHeader {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1em;
}
.ProductDetailHeader h1 {
    margin: 0 0 0.3em 0;
}
.ProductDetailCodes {
    margin: 0;
    color: #444;
}
.ProductDetailLabel {
    color: #666;
    font-size: 0.9em;
    margin-right: 0.3em;
}
.ProductDetailDivider {
    color: #999;
    margin: 0 0.5em;
}
.ProductDetailCodes code {
    font-family: ui-monospace, monospace;
    background: #f0f6fa;
    padding: 0.05em 0.4em;
    border-radius: 0.3em;
}
.OrderCta {
    display: inline-block;
    padding: 0.5em 1em;
    background: #0366a8;
    color: #fff;
    border-radius: 0.4em;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}
.OrderCta:hover {
    background: #024c7d;
    text-decoration: none;
}

.SharedNotice {
    border-color: #c8b8e8;
    background: #f5f0fc;
}
.SharedNotice h2 {
    color: #553a8a;
    margin-top: 0;
}

.StockSummaryTable,
.LotsTable,
.InboundTable,
.PastOrdersTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    margin-top: 0.5em;
}
.StockSummaryTable th,
.StockSummaryTable td,
.LotsTable th,
.LotsTable td,
.InboundTable th,
.InboundTable td,
.PastOrdersTable th,
.PastOrdersTable td {
    padding: 0.4em 0.6em;
    border-bottom: 1px solid #d8e8f1;
    text-align: left;
    vertical-align: top;
}
.LotsTable th,
.InboundTable th,
.PastOrdersTable th {
    background: #e6f1f8;
    font-weight: 600;
}
.StockSummaryTable th {
    background: transparent;
    color: #555;
    font-weight: 500;
    text-align: right;
    width: 1px;
    white-space: nowrap;
}
.StockSummaryTable td.num,
.LotsTable td.num,
.LotsTable th.num,
.InboundTable td.num,
.InboundTable th.num,
.PastOrdersTable td.num,
.PastOrdersTable th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.LotsTable code,
.InboundTable code,
.PastOrdersTable code {
    font-family: ui-monospace, monospace;
    font-size: 0.9em;
}
.LotChipSummary {
    margin: 0.8em 0 0.2em 0;
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}
.LotPinItem {
    display: inline-block;
    margin-right: 0.4em;
}
.LotPinNone {
    color: #888;
}

/* Single-product order form (/orders/new). */
.OrderNewForm {
    max-width: 720px;
}
.OrderNewField {
    display: block;
    margin: 0.5em 0;
}
.OrderNewLabel {
    display: block;
    font-weight: 500;
    margin-bottom: 0.2em;
    color: #444;
}
.OrderNewField select,
.OrderNewField input[type="number"] {
    width: 100%;
    max-width: 480px;
    padding: 0.4em 0.5em;
    font-size: 1em;
    border: 1px solid #b0d4ec;
    border-radius: 0.3em;
    background: #fff;
}
.OrderNewField input[type="number"] {
    max-width: 120px;
}
.OrderNewLotHelp {
    font-size: 0.85em;
    color: #555;
    margin: 0.3em 0 0 0;
    max-width: 480px;
}
.OrderNewSharedHint {
    color: #553a8a;
    background: #f5f0fc;
    border: 1px solid #c8b8e8;
    padding: 0.5em 0.8em;
    border-radius: 0.4em;
    font-size: 0.95em;
}
.OrderNewLotFull {
    color: #8a1c1c;
    background: #fde2e2;
    border: 1px solid #f5b8b8;
    padding: 0.5em 0.8em;
    border-radius: 0.4em;
    font-size: 0.95em;
    max-width: 480px;
    margin: 0.3em 0 0 0;
}
.OrderNewSubmit {
    padding: 0.6em 1.4em;
    background: #0366a8;
    color: #fff;
    border: none;
    border-radius: 0.4em;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
}
.OrderNewSubmit:hover {
    background: #024c7d;
}
.OrderNewSubmit:disabled {
    opacity: 0.5;
    cursor: wait;
}
.OrderNewStatus {
    margin-left: 1em;
    font-size: 0.95em;
}
.OrderNewStatus.is-pending { color: #555; }
.OrderNewStatus.is-ok      { color: #1c5a2a; font-weight: 600; }
.OrderNewStatus.is-error   { color: #8a1c1c; font-weight: 600; }

.OrderNewRecipientFixed,
.OrderNewRecipientPicker {
    display: flex;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
}
.OrderNewRecipientText {
    padding: 0.4em 0.6em;
    background: #f0f6fa;
    border: 1px solid #cde5f6;
    border-radius: 0.3em;
    flex: 1 1 auto;
    min-width: 280px;
}
.OrderNewAddRecipient {
    font-size: 0.95em;
    white-space: nowrap;
}

/* Order detail page (/orders/{code}). Mirrors product-detail layout. */
.OrderDetailBack {
    margin: 0 0 0.5em 0;
    font-size: 0.95em;
}
.OrderDetailHeader h1 {
    margin: 0 0 0.5em 0;
}
.OrderDetailCodes {
    margin: 0;
    color: #444;
}
.OrderDetailLabel {
    color: #666;
    font-size: 0.9em;
    margin-right: 0.3em;
}
.OrderDetailDivider {
    color: #999;
    margin: 0 0.5em;
}
.OrderDetailCodes code {
    font-family: ui-monospace, monospace;
    background: #f0f6fa;
    padding: 0.05em 0.4em;
    border-radius: 0.3em;
}

.OrderDetailSummary,
.OrderDetailLines {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    margin-top: 0.5em;
}
.OrderDetailSummary th,
.OrderDetailSummary td,
.OrderDetailLines th,
.OrderDetailLines td {
    padding: 0.4em 0.6em;
    border-bottom: 1px solid #d8e8f1;
    text-align: left;
    vertical-align: top;
}
.OrderDetailSummary th {
    background: transparent;
    color: #555;
    font-weight: 500;
    text-align: right;
    width: 1px;
    white-space: nowrap;
}
.OrderDetailLines th {
    background: #e6f1f8;
    font-weight: 600;
}
.OrderDetailSummary td.num,
.OrderDetailLines td.num,
.OrderDetailLines th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.OrderDetailLines code,
.OrderDetailSummary code {
    font-family: ui-monospace, monospace;
    font-size: 0.9em;
}
.OrderDetailArticleName {
    color: #666;
    font-size: 0.9em;
}

/* Cancel button — destructive, red. Disabled state grays it out. */
.OrderDetailActions {
    display: flex;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
}
.CancelOrderBtn {
    padding: 0.6em 1.4em;
    background: #b22b2b;
    color: #fff;
    border: none;
    border-radius: 0.4em;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
}
.CancelOrderBtn:hover:not(:disabled) {
    background: #8a1c1c;
}
.CancelOrderBtn:disabled {
    background: #c8b0b0;
    color: #f0e0e0;
    cursor: not-allowed;
}
.CancelOrderDisabledReason {
    color: #666;
    font-size: 0.95em;
    font-style: italic;
}
.CancelOrderStatus {
    font-size: 0.95em;
}
.CancelOrderStatus.is-pending { color: #555; }
.CancelOrderStatus.is-ok      { color: #1c5a2a; font-weight: 600; }
.CancelOrderStatus.is-error   { color: #8a1c1c; font-weight: 600; }

/* Confirmation dialog. <dialog> default styling is bare; we layer on a
   panel look + room for the caveats list. */
.CancelOrderConfirm {
    border: 1px solid #f5b8b8;
    border-radius: 0.5em;
    padding: 1.2em 1.4em;
    max-width: 520px;
    background: #fff;
    color: #222;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}
.CancelOrderConfirm::backdrop {
    background: rgba(0, 0, 0, 0.4);
}
.CancelOrderConfirm h2 {
    margin: 0 0 0.5em 0;
    color: #8a1c1c;
}
.CancelOrderCaveatsIntro {
    margin: 0.4em 0 0.3em 0;
    color: #444;
}
.CancelOrderCaveats {
    margin: 0 0 1em 0;
    padding-left: 1.2em;
    color: #333;
    font-size: 0.95em;
    line-height: 1.5;
}
.CancelOrderCaveats li {
    margin-bottom: 0.3em;
}
.CancelOrderConfirmActions {
    display: flex;
    gap: 0.6em;
    flex-wrap: wrap;
    margin-top: 0.4em;
}
.CancelOrderConfirmYes {
    padding: 0.5em 1.2em;
    background: #b22b2b;
    color: #fff;
    border: none;
    border-radius: 0.4em;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
}
.CancelOrderConfirmYes:hover:not(:disabled) { background: #8a1c1c; }
.CancelOrderConfirmYes:disabled { opacity: 0.5; cursor: wait; }
.CancelOrderConfirmNo {
    padding: 0.5em 1.2em;
    background: #fff;
    color: #444;
    border: 1px solid #ccc;
    border-radius: 0.4em;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
}
.CancelOrderConfirmNo:hover:not(:disabled) { background: #f5f5f5; }
.CancelOrderConfirmNo:disabled { opacity: 0.5; cursor: wait; }
