/* Client portal: the portal design, re-coloured with the client's own branding. */
.brand img { max-height: 30px; max-width: 180px; object-fit: contain; display: block }
.brand .chip { background: #fff; border-radius: 8px; padding: 6px 10px; display: inline-block }
.banner { background: var(--warn); color: var(--warn-t); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px }
.items { margin: 0; padding: 0; list-style: none; font-size: 13px } .items li + li { margin-top: 2px }
.st { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; background: #eceee9 }
.st.Requested, .st.Received, .st.Low { background: var(--warn); color: var(--warn-t) }
.st.Approved, .st.Dispatched, .st.Part { background: #e3ecff; color: #1d3a8a }
.st.Refunded, .st.Delivered, .st.In { background: var(--good); color: var(--good-t) }
.st.Cancelled, .st.Closed, .st.Out { background: var(--bad); color: var(--bad-t) }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 180px; padding: 8px 0 0 }
.bars div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: 11px; color: var(--muted) }
.bars i { display: block; width: 100%; background: var(--dark); border-radius: 6px 6px 0 0; min-height: 2px } .bars div:last-child i { background: var(--acc) }
.mono { font-family: ui-monospace, monospace; font-size: 13px }
.empty { padding: 30px; text-align: center; color: var(--muted) }
td.mono { white-space: nowrap }
.st.New { background: var(--acc); color: var(--acc-ink, #0d0f10) }
#nav .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--acc); color: var(--acc-ink, #0d0f10); font-size: 12px; font-weight: 700; text-align: center }
#nav button[aria-current="page"] .count { background: var(--dark); color: #fff }
.st.Tip { background: #fff3c4; color: #6a4b00 }
.insight .ihead { display: flex; gap: 10px; align-items: center; margin-bottom: 4px } .insight .ihead h2 { margin: 0 }
/* The sidebar takes the client's main colour, so its text follows whichever ink reads on it. */
.side { color: var(--side-ink, #cfd3cb) } .side .brand, .side .who { color: var(--side-ink, #fff) } .side .who { opacity: .75 }
nav button:hover:not([aria-current="page"]) { background: color-mix(in srgb, var(--side-ink, #fff) 12%, transparent) }
.toggle { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 15px; padding: 10px 0; border-bottom: 1px solid var(--line) } .toggle:last-child { border-bottom: 0 }
.toggle input { width: 20px; height: 20px; min-height: 0 }

/* Reports, queries, statements, API access */
.btn.sm { padding: 5px 12px; font-size: 13px; min-height: 0 }
.small { font-size: 13px }
.up { color: var(--good-t); font-weight: 600 } .down { color: var(--bad-t); font-weight: 600 }
tr.click { cursor: pointer } tr.click:hover td { background: color-mix(in srgb, var(--acc) 12%, transparent) }
.form { display: grid; grid-template-columns: 1fr; gap: 10px; max-width: 640px } .form label { display: flex; flex-direction: column; gap: 4px } .form label[hidden] { display: none } .form textarea, .card textarea { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 10px }
.thread { display: grid; gap: 10px; margin: 0 0 16px; max-width: 760px }
.msg { border-radius: 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--line) }
.msg.staff { background: color-mix(in srgb, var(--acc) 18%, #fff); margin-left: 40px } .msg.client { margin-right: 40px }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px } .msg .body { white-space: pre-wrap; font-size: 15px }
.keybox { border: 2px solid var(--acc) } .keybox input { flex: 1; min-width: 280px }
pre.code { background: #0d0f10; color: #e9ece6; border-radius: 10px; padding: 12px; overflow-x: auto; font-size: 13px }
.st.Revoked { background: var(--bad); color: var(--bad-t) }
.statement h3 { font-size: 15px; margin: 18px 0 6px }
@media print {
  .side, .noprint, .banner, .toast { display: none !important }
  body { display: block !important; background: #fff } main { padding: 0 !important } .card { border: 0; box-shadow: none }
}
.st.Awaiting { background: #fff3c4; color: #6a4b00 } .st.Declined { background: var(--bad); color: var(--bad-t) }
.decide { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; min-width: 180px } .decide .why { flex-basis: 100%; display: grid; gap: 6px } .decide .why[hidden] { display: none }
.decide textarea { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px }
.waitcard { border: 2px solid #f2c94c }
.who-tells { display: grid; gap: 4px; font-size: 13px } .who-tells label { flex-direction: row; align-items: center; gap: 6px; color: var(--text) } .who-tells input { width: auto; min-height: 0 }
.selfmail { border: 2px solid var(--acc) }
.navgroup { font-size: 11px; font-weight: 700; letter-spacing: .02em; opacity: .6; padding: 14px 12px 4px; color: var(--side-ink, #fff) } .navgroup:first-child { padding-top: 4px }
@media (max-width: 760px) { .navgroup { display: none } }

/* Type-ahead results under an input */
.tahead:empty { display: none }
.tahead { margin-top: 4px; border: 1px solid var(--line, #e3e5df); border-radius: 10px; background: #fff; max-height: 260px; overflow: auto; box-shadow: 0 8px 24px rgba(0,0,0,.08) }
.tahead button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line, #e3e5df); padding: 8px 10px; font: inherit; cursor: pointer; color: inherit }
.tahead button:hover, .tahead button:focus-visible { background: rgba(0,0,0,.04) }


/* Branded loading screen (splash.js paints it with the client's logo and colours) */
.splash { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--dark, #0d0f10); color: #fff; transition: opacity .25s ease }
.splash.is-done { opacity: 0; pointer-events: none }
.splash__mark { font-weight: 800; font-size: 22px; letter-spacing: .04em; opacity: 0; transition: opacity .2s ease } .splash.is-branded .splash__mark, .splash__mark:not(:empty) { opacity: 1 }
.splash__chip { display: inline-flex; background: #fff; border-radius: 14px; padding: 14px 22px; box-shadow: 0 10px 30px rgba(0,0,0,.18) } .splash__chip img { display: block; max-height: 56px; max-width: 220px }
.splash__dots { display: flex; gap: 8px } .splash__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--acc, #c6ff00); animation: ssdot 1s ease-in-out infinite } .splash__dots i:nth-child(2) { animation-delay: .15s } .splash__dots i:nth-child(3) { animation-delay: .3s }
@keyframes ssdot { 0%, 80%, 100% { transform: scale(.6); opacity: .5 } 40% { transform: scale(1); opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .splash__dots i { animation: none } .splash { transition: none } }
.splash__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0) }

/* Standard product table (Products, New products, Insights, My range): fixed columns so every list lines up */
.ptable { table-layout: fixed; width: 100%; min-width: 820px }
.ptable col.c-act { width: 100px } .ptable col.c-lk { width: 30px } .ptable col.c-cat { width: 140px } .ptable col.c-money { width: 84px }
.ptable col.c-stock { width: 104px } .ptable col.c-added { width: 64px } .ptable col.c-due { width: 124px }
.ptable td { padding-top: 8px; padding-bottom: 8px; vertical-align: middle } .ptable td.pcell { line-height: 1.35 }
.pcell b { font-weight: 600 } .pcell .var { color: var(--muted) } .pcell .st { margin-left: 4px }
.pcell .ids { display: block; font: 11.5px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.ptable td.lk { padding-left: 0; padding-right: 0; text-align: center } .ptable .sub { display: block; font-size: 12px; color: var(--muted) }
.ptable .pickbtn, .ptable [data-rm] { min-width: 84px; justify-content: center }
a.view { display: inline-flex; padding: 4px; border-radius: 6px; color: var(--muted) } a.view:hover, a.view:focus-visible { color: var(--text); background: rgba(0,0,0,.06) }

/* Overview */
.attn ul { list-style: none; margin: 0; padding: 0 } .attn li button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 2px; font: inherit; color: inherit; cursor: pointer }
.attn li:first-child button { border-top: 0 } .attn li button:hover, .attn li button:focus-visible { background: rgba(0,0,0,.03) }
.attn .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #8a8f86 } .attn .bad .dot { background: #c62828 } .attn .warn .dot { background: #e08a00 } .attn .arr { margin-left: auto; color: var(--muted) }
.kpi.click { cursor: pointer } .kpi.click:hover, .kpi.click:focus-visible { border-color: var(--dark); outline: none }
.kpi .up { color: #2f7a1f } .kpi .down { color: #b3261e }
.linkbtn { background: none; border: 0; padding: 0; margin-top: 10px; font: inherit; font-weight: 600; font-size: 13px; color: var(--text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px }
ul.plain { list-style: none; margin: 0; padding: 0 } ul.plain li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px } ul.plain li:first-child { border-top: 0 }

/* Standard cells */
td.nw, td .nw { white-space: nowrap } td.pcell b { font-weight: 600; display: block }

/* Pop-up forms (start a return) */
dialog.modal { border: 0; border-radius: 16px; padding: 20px 22px; width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25) }
dialog.modal::backdrop { background: rgba(13,15,16,.45) } dialog.modal h2 { margin: 0 0 12px }
dialog.modal label { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0 } dialog.modal label.tog { flex-direction: row; align-items: flex-start; gap: 10px }
dialog.modal label.tog input { width: 18px; height: 18px; margin-top: 2px; flex: none } dialog.modal input:not([type=radio]):not([type=checkbox]), dialog.modal select { width: 100% }
dialog.modal .err { color: #b3261e; min-height: 1em; margin: 8px 0 0 } dialog.modal fieldset.opts { border: 0; padding: 0; margin: 12px 0 0 } dialog.modal legend { font-weight: 600; font-size: 14px; padding: 0 }
.rtable td { vertical-align: middle } .rtable .sub { display: block; font-size: 12px; color: var(--muted) } .rtable select[data-q] { width: 80px } .rtable select[data-r] { min-width: 200px }
td.acts { white-space: nowrap } td.acts .btn + .btn { margin-left: 6px }

/* Week bar charts: every column has the same label height, so bars share one baseline */
.bars div { justify-content: flex-end } .bars .wk { display: flex; flex-direction: column; align-items: center; line-height: 1.15; height: 28px; white-space: nowrap; font-size: 11px }
.bars .wk b { font-weight: 600; color: var(--text) } .bars .v { line-height: 1.2 }
.bars.tall { height: auto; flex: 1 1 260px; min-height: 260px } .bars.tall div { min-height: 0 } .bars.tall i { flex: 0 0 auto; min-height: 2px }
.two > .card { display: flex; flex-direction: column } .two > .card > .linkbtn { margin-top: auto; padding-top: 12px; align-self: flex-start }

/* Queries */
.qhead { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap } .qhead h1 { margin-bottom: 4px }
.thread .evt { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0 }
.pills .n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: rgba(0,0,0,.08); font-size: 11px; line-height: 18px }
