/* CloudFormatie Sales - zelfde kleuren als het klantportaal (theme.dart): oranje #FC8C04, blauw #0483B9. */
:root {
  --bg: #f2f3f5; --surface: #ffffff; --sunk: #eef0f3; --line: #d9dde3; --ink: #1d232b; --muted: #5d6773;
  --orange: #fc8c04; --orange-ink: #b85f00; --orange-soft: #fff1df;
  --blue: #0483b9; --blue-soft: #e3f2f9;
  --good: #1f7a4d; --good-soft: #e3f4ea; --warn: #8a5a00; --warn-soft: #fdf1d8; --bad: #b3261e; --bad-soft: #fbe4e2;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.muted { color: var(--muted); font-size: .88rem; margin: 2px 0 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.error { color: var(--bad); background: var(--bad-soft); padding: 8px 12px; border-radius: 6px; font-size: .9rem; }
.done { color: var(--good); background: var(--good-soft); padding: 10px 12px; border-radius: 6px; }

.brand { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; white-space: nowrap; }
.brand b { color: var(--orange); }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--orange); color: #fff; font-weight: 700; font-size: .8rem; }

.btn { border: 1px solid var(--blue); background: var(--surface); color: var(--blue); border-radius: 6px; padding: 8px 16px; font-weight: 600; font-size: .9rem; }
.btn:hover { background: var(--blue-soft); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: #036e9c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { border: 0; background: none; color: var(--blue); padding: 0; text-decoration: underline; }

/* Inloggen */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 6px; }
.login-card .brand { margin-bottom: 4px; }
.login-card label { font-size: .82rem; font-weight: 600; margin-top: 10px; }
.login-card input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; }
.login-card .btn { margin-top: 16px; padding: 10px; }

/* Bovenbalk */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 16px; min-height: 56px; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 17px 12px 14px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.who { font-size: .85rem; color: var(--muted); white-space: nowrap; }

.panel { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
h1 { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--orange-ink); text-wrap: balance; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 14px; font-size: .85rem; }
.chip:hover { border-color: var(--blue); }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }

.banner { border-left: 4px solid var(--blue); background: var(--blue-soft); padding: 9px 14px; border-radius: 0 6px 6px 0; font-size: .88rem; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.banner.warn { border-left-color: var(--orange); background: var(--warn-soft); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
.config { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 10px; padding: 0; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt label { display: flex; flex-direction: column; gap: 2px; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.opt label:hover { border-color: var(--blue); }
.opt input:checked + label { border-color: var(--orange); background: var(--orange-soft); box-shadow: inset 0 0 0 1px var(--orange); }
.opt input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }
.opt input:disabled + label { opacity: .55; cursor: not-allowed; }
.opt .n { font-weight: 600; font-size: .92rem; }
.opt .s { color: var(--muted); font-size: .8rem; }
.opt .p { font: 500 .86rem var(--mono); margin-top: 4px; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: .68rem; font-weight: 500; padding: 1px 7px; border-radius: 4px; background: var(--sunk); color: var(--muted); margin-left: 4px; vertical-align: 1px; }
.tag.live { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

.row { display: flex; flex-wrap: wrap; gap: 10px; }
.field { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; flex: 1 1 230px; }
.field .lbl { flex: 1; font-size: .9rem; }
.field .lbl small { display: block; color: var(--muted); font-size: .78rem; }
input[type=number], select { width: 96px; font: 500 .9rem var(--mono); text-align: right; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); }
select { width: auto; text-align: left; font-family: var(--sans); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--orange); }

.receipt { position: sticky; top: 72px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
@media (max-width: 900px) { .receipt { position: static; } }
.receipt h2 { font-size: 1rem; margin: 0; padding: 14px 18px; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; }
.receipt h2 span { font-weight: 400; font-size: .8rem; color: var(--muted); }
.lines { list-style: none; margin: 0; padding: 10px 18px; }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .86rem; }
.lines .k { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; display: block; }
.lines .v { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tot { border-top: 1px dashed var(--line); padding: 12px 18px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.tot > div:nth-child(even) { font-family: var(--mono); text-align: right; }
.tot .big { font: 600 1.5rem var(--mono); color: var(--orange-ink); }
.tot .biglbl { align-self: end; font-weight: 600; }
.tot .small { color: var(--muted); font-size: .82rem; }
.margin { margin: 0 18px 12px; padding: 10px 12px; border-radius: 6px; background: var(--sunk); font-size: .84rem; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.margin > div:nth-child(even) { font-family: var(--mono); text-align: right; }
.margin .good { color: var(--good); font-weight: 600; }
.margin .bad { color: var(--bad); font-weight: 600; }
.actions { padding: 0 18px 16px; display: flex; }
.actions .btn { flex: 1; padding: 10px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.matrix td:not(:first-child), .matrix th:not(:first-child) { text-align: center; }
.matrix .on { color: var(--good); font-weight: 700; }
.matrix .sel { background: var(--orange-soft); }

/* Prijzen */
.pricing { display: flex; flex-direction: column; gap: 22px; }
.pricing h3 { font-size: .95rem; margin: 0 0 8px; }
.pricing td input[type=text] { width: 100%; min-width: 140px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); }
.pricing td:last-child, .pricing th:last-child { text-align: right; }
.toast { min-height: 1.2em; color: var(--good); margin: 0 0 8px; font-size: .9rem; }

/* Dialoog */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20, 26, 33, .45); }
dialog form { padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; }
dialog h2 { margin: 0; font-size: 1.2rem; color: var(--orange-ink); }
dialog label { font-size: .82rem; font-weight: 600; margin-top: 10px; }
dialog input:not([type=number]), dialog textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
.search { display: flex; gap: 8px; }
.results { list-style: none; margin: 4px 0 0; padding: 0; max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.results:empty { display: none; }
.results li button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); padding: 8px 10px; }
.results li button:hover { background: var(--blue-soft); }
.results small { color: var(--muted); }
.chosen { background: var(--orange-soft); border-radius: 6px; padding: 8px 10px; margin: 6px 0 0; font-size: .9rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Offerte (winkelmandje) */
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: .72rem; line-height: 18px; text-align: center; margin-left: 4px; }
.cart td { vertical-align: top; }
.cart textarea { width: 100%; min-width: 220px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); font-size: .86rem; resize: vertical; }
.cart input[type=number] { width: 76px; }
.cart .src { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; }
.cart .tot-cell { font-family: var(--mono); white-space: nowrap; text-align: right; padding-top: 12px; }
.cart .del { border: 0; background: none; color: var(--bad); font-size: 1.1rem; padding: 6px; }
.cart .costinfo { font-size: .74rem; color: var(--muted); margin-top: 3px; }
.adders { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.addbox { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.addbox > label { font-size: .82rem; font-weight: 600; }
.addbox textarea, .addbox > input, .qform input:not([type=number]) { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.check { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); font-weight: 400 !important; }
input.text { width: 160px; text-align: left; font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); }
textarea.note { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; line-height: 1.55; }
.qform { padding: 12px 18px 4px; display: flex; flex-direction: column; gap: 4px; }
.qform label { font-size: .8rem; font-weight: 600; margin-top: 6px; }
.qform input[type=number] { width: 90px; }
.results li button .pp { float: right; font-family: var(--mono); }
.float-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: .9rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 20; margin: 0; }
.hgroups { display: flex; flex-direction: column; gap: 14px; }
.hgroup h3 { font-size: .9rem; margin: 0 0 8px; color: var(--ink); }
.hgroup .muted { margin: 0; padding: 10px 12px; background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; }
/* Lange productnamen in keuzelijsten mogen de pagina niet breder maken dan het scherm. */
.field { min-width: 0; }
.field select { max-width: 100%; min-width: 0; }
#h-ms { flex: 1; width: 100%; }

/* Instellingen */
.integrations { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.integ { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.integ h2 { font-size: 1.05rem; margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.integ .desc { margin: 0; font-size: .88rem; color: var(--muted); }
.integ label { font-size: .8rem; font-weight: 600; margin-top: 6px; }
.integ input, .integ select { width: 100%; max-width: 100%; text-align: left; font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunk); }
.integ small.help { color: var(--muted); font-size: .78rem; }
.integ .acts { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.integ .result { font-size: .86rem; margin: 0; }
.integ .result.ok { color: var(--good); }
.integ .result.bad { color: var(--bad); }
.pill { font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.pill.on { background: var(--good-soft); color: var(--good); }
.integ a.btn { text-decoration: none; display: inline-block; }
.presets a.btn { text-decoration: none; }
.results.sdc li button { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; }
.results.sdc img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 4px; }
.results.sdc .noimg { width: 44px; height: 44px; background: var(--sunk); border-radius: 4px; }
.results.sdc .pr { text-align: right; font-family: var(--mono); font-size: .84rem; white-space: nowrap; }
.results.sdc .pr small { display: block; color: var(--muted); font-family: var(--sans); }
.stock-ok { color: var(--good); }
.stock-no { color: var(--bad); }
