/* kam-c: KAM Requests review fixes (overview tiles, tables, request page, builders) */

/* ---------- Request-type tiles: title plus a one-line description ---------- */
.ktiles .qabtn { align-items: flex-start; }
.ktiles .qabtn .ic { margin-top: 1px; flex: none; }
.ktiles .qt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ktiles .qt > span { overflow-wrap: break-word; }
.ktiles .qt small { font-size: 0.8125rem; font-weight: 400; line-height: 1.35; color: var(--muted); overflow-wrap: break-word; }

/* ---------- Request tables ---------- */
/* Red edge only for urgent; "needs you" gets a calm blue dot by the number */
.rrow.urg { box-shadow: inset 3px 0 0 var(--red); }
.kneed { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue-btn); margin-right: 6px; vertical-align: 1px; }
.rtable .flag { white-space: nowrap; }

/* ---------- Request page ---------- */
/* Pinned question from Customer Service */
.kask { border-color: var(--blue-btn); box-shadow: inset 3px 0 0 var(--blue-btn); }
.kaskh { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; font-weight: 700; }
.kaskh .ic { width: 20px; height: 20px; color: var(--blue-btn); flex: none; }
.kaskq { margin: 8px 0 0; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--ground); white-space: normal; }
.kask .choices { margin-top: 12px; }
.kask .link.quiet { margin-top: 8px; min-height: 36px; }
.kaskact { margin-top: 12px; }
.msg.kwait .mb { box-shadow: inset 3px 0 0 var(--amber-bar); }

/* Stepper: line runs circle to circle above the labels, so a wrapping label can't break it */
.kstep li { flex-direction: column; gap: 6px; }
.kstep li::after { top: 10px; left: 28px; right: -6px; }
.kstep li span { background: none; padding-right: 4px; margin-top: 0; }
@media (max-width: 640px) {
  .kstep { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .kstep li { flex-direction: row; gap: 10px; padding-bottom: 14px; }
  .kstep li:last-child { padding-bottom: 0; }
  .kstep li::after, .kstep li:nth-child(2)::after { display: block; top: 26px; bottom: 2px; left: 10px; right: auto; width: 2px; height: auto; }
  .kstep li:last-child::after { display: none; }
  .kstep li span { margin-top: 2px; }
}

/* Sample blind diagram: room for the width and drop labels */
.kdiag .diagram, #blindprev .diagram { overflow: visible; }
.kdiag, #blindprev { padding: 8px 28px 8px 4px; }

/* ---------- Builders ---------- */
.kerrsum { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--red); border-radius: var(--r-card); background: var(--surface); box-shadow: inset 3px 0 0 var(--red); font-size: 0.875rem; }
.kerrsum:focus { outline: 2px solid var(--blue-btn); outline-offset: 2px; }
.kerrsum .link { font-size: inherit; min-height: 0; padding: 0; }
.kappr { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--blue-tint); font-size: 0.875rem; }
.kappr .ic { width: 20px; height: 20px; flex: none; color: var(--blue-btn); }
#catq-err:not([hidden]) { display: block; margin-top: 6px; }
#custq-err:not([hidden]) { display: block; margin-top: 6px; }
#catq-err, #custq-err { color: var(--red); font-size: 0.8125rem; }

/* Basket: names wrap between words, never mid-word */
.cart .nm { overflow-wrap: break-word; word-break: normal; hyphens: manual; }
@media (max-width: 640px) {
  .cart li { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "code code code" "nm step x"; row-gap: 2px; }
  .cart li .code { grid-area: code; }
  .cart li .nm { grid-area: nm; }
  .cart li .stepper { grid-area: step; }
  .cart li > .iconbtn { grid-area: x; }
}

/* Sticky "N items · Review & send" bar, phones and tablets only */
.kbar { display: none; }
@media (max-width: 1099px) {
  .kbar:not([hidden]) { display: block; position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06); }
  .kbar .btn { width: 100%; justify-content: center; }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  /* "Need you" above the tiles; tiles as a compact two-column grid */
  .kov .kneedyou { order: -1; }
  .ktiles, .ktiles.big { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ktiles .qabtn, .qagrid.big.ktiles .qabtn { flex-direction: column; gap: 6px; min-height: 0; padding: 10px 12px; font-size: 0.875rem; }
  .ktiles .qabtn .ic { width: 20px; height: 20px; }
  .ktiles .qt small { font-size: 0.75rem; }
}
@media (max-width: 899px) {
  /* Cards: label the fields that don't explain themselves, drop empty cells */
  .rrow span.l::before { content: attr(data-l) ": "; color: var(--muted); font-weight: 500; }
  .rrow span[role="cell"]:empty { display: none; }
}
@media (max-width: 899px) {
  /* Queue cards: number (and Urgent) left, customer right, as in the other lists */
  .rtable.q .rrow span[data-l]:nth-child(1) { text-align: left; }
  .rtable.q .rrow span[data-l]:nth-child(2) { text-align: right; }
}

/* ETA: quick for reps */
.etadest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.etaopt { position: relative; display: block; }
.etaopt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.etaopt > span { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 14px 16px; border: 1px solid var(--input); border-radius: 14px; background: var(--surface); }
.etaopt b { font-size: 1rem; }
.etaopt small { font-size: 0.8125rem; color: var(--muted); line-height: 1.35; }
.etaopt input:checked + span { border-color: var(--blue-btn); background: var(--blue-tint); box-shadow: inset 0 0 0 1px var(--blue-btn); }
.etaopt input:focus-visible + span { outline: 2px solid var(--blue-btn); outline-offset: 2px; }
.etamore { border-top: 1px solid var(--divider); padding-top: 12px; }
.etamore summary { cursor: pointer; font-weight: 600; color: var(--link); min-height: 44px; display: flex; align-items: center; }
.etamore[open] summary { margin-bottom: 8px; }
.eta #e-orders { font-size: 1.0625rem; }
@media (max-width: 640px) { .etadest { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Declutter pass (go-live) ---------- */

.kov { gap: 20px; }
.kov .kneedyou { padding-top: 14px; padding-bottom: 6px; }
.kov .kneedyou h2 { font-size: 0.9375rem; margin: 0 0 4px; }
.kov .attl li a { padding-top: 8px; padding-bottom: 8px; }
.kqnote { margin: 0 0 12px; }
.kqnote a { font-weight: 600; }

/* Request page: tighter headline card, one main button and a single More menu */
.ask .asktitle { font-size: 1.25rem; margin-bottom: 4px; }
.ask .asknote { margin-bottom: 8px; padding: 8px 12px; }
.ask .askgrid { margin: 8px 0 12px; gap: 8px 18px; }
.ask .askgrid:empty { display: none; }
.ask .askact { margin-top: 14px; gap: 10px; }
.kmore { position: relative; }
.kmore > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.kmore > summary::-webkit-details-marker { display: none; }
.kmore > summary .ic { width: 16px; height: 16px; }
.kmenu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 20; min-width: 220px; display: flex; flex-direction: column; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--sh-pop); }
.kmi { padding: 9px 12px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: 0.875rem; text-align: left; cursor: pointer; white-space: nowrap; }
.kmi:hover, .kmi:focus-visible { background: var(--surface2); }
.ask .inform { margin-top: 12px; }
/* Reply card: answers as compact pills on wide screens */
@media (min-width: 641px) {
  .respond .rchoices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
  .respond .rchoice { min-height: 36px; padding: 6px 14px; font-size: 0.875rem; }
}
.respond .sechd { margin-bottom: 6px; }
.sechead .small { font-weight: 500; }
@media (pointer: coarse) { .kmi { padding: 12px; } }
@media (max-width: 640px) {
  .kmenu { left: auto; right: 0; }
  .askact .kmore:first-child .kmenu { left: 0; right: auto; }
}

/* ---------- Three departments (Customer Services, POS & Marketing, IT & Business Services) ---------- */
/* Overview: every request type in three columns, one link each */
.kgroups { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px 24px; }
.kgroup { min-width: 0; }
.kgroup .sechead { margin-bottom: 4px; }
.klinks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.klink { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px; margin: 0 -8px; border-radius: var(--r-sm, 8px); color: var(--ink); font-size: var(--fs-15, 0.9375rem); font-weight: 600; text-decoration: none; }
.klink:hover { background: var(--blue-tint); color: var(--blue-ink); }
.klink:focus-visible { outline: 2px solid var(--blue-btn); outline-offset: 0; }
.klink .ic { width: 18px; height: 18px; flex: none; color: var(--blue-btn); }
.kgroups:not(.big) .kgroup:nth-child(1) .klinks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
/* New request page: one group under the other, full tiles */
.kgroups.big { grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (max-width: 899px) {
  .kgroups { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* Sample blind order: one card per order-form line */
.sbl { border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 16px 16px; margin: 0 0 12px; min-width: 0; }
.sblh { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.sblh h3 { margin: 0; font-size: var(--fs-15, 0.9375rem); font-weight: 700; }
.sblh h3 .muted { font-weight: 500; }
.sblact { display: inline-flex; gap: 16px; }
.sbl .tform { max-width: none; }
.sbchk { justify-content: flex-end; }
.sbadd { display: flex; flex-wrap: wrap; gap: 8px; }
.sbsum { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-14, 0.875rem); overflow-wrap: anywhere; }
/* Request page: the order as Customer Service keys it into Concord */
.sbline { border-top: 1px solid var(--divider); padding-top: 10px; margin-top: 10px; }
.sbline h3 { margin: 0 0 6px; font-size: var(--fs-15, 0.9375rem); font-weight: 700; }
.sbgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.sbgrid > div { min-width: 0; }
.sbgrid dt { font-size: var(--fs-12, 0.75rem); color: var(--muted); font-weight: 600; }
.sbgrid dd { margin: 0; font-size: var(--fs-14, 0.875rem); font-weight: 600; overflow-wrap: anywhere; }
.sbnotes { margin: 0; white-space: pre-wrap; font-size: var(--fs-14, 0.875rem); }
@media (max-width: 640px) {
  .sbgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sbl { padding: 10px 12px 12px; }
  /* Short choices sit two to a row on phones; text and wide fields take the full width */
  .sbl .tform { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .sbl .tform > .fld.wide, .sbl .tform > fieldset.fld { grid-column: 1 / -1; }
}

/* ---------- Agent D design pass (kam.js): parked line, request page order when the columns stack ---------- */
.kparked { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 12px 0 0; padding: 8px 12px; border-radius: var(--r-ctl, 8px); background: var(--amber-bg); color: var(--ink); font-size: var(--fs-14, 0.875rem); }
.kparked > .ic { flex: none; color: var(--amber); }
.kparked > span:first-of-type { flex: 1 1 200px; min-width: 0; }
.kparkacts { display: inline-flex; gap: 16px; }
.askact .btn .ic { margin-right: 2px; }
/* Phone and narrow screens: the summary first, then delivery and the charge account, then the rest; timeline last */
@media (max-width: 1099px) {
  .kdetail .cols { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .kdetail .cols > .stack { display: contents; }
  .kdetail .cols > .stack > * { order: 3; }
  .kdetail .cols > .stack > .kask, .kdetail .cols > .stack > .ask { order: 1; }
  .kdetail .cols > .stack > .kdeliv { order: 2; }
  .kdetail .cols > .stack > .ktl { order: 4; }
}
.kmod .subnav a .n { margin-left: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
/* Credit form: required fields */
.rqm { color: var(--red); font-weight: 700; }
.rqnote { margin: -4px 0 12px; }

/* Requests home (10 Oct 2026): start with one search box and your usual types; New request is a tidy list */
.kstart { display: flex; flex-direction: column; gap: 12px; }
.kstartrow { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.kstartq { flex: 1 1 320px; margin: 0; }
.kstartq.big { margin-bottom: 18px; max-width: 640px; }
.kallt { white-space: nowrap; }
.kquick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 40px; }
.kqlab { margin-right: 2px; }
.kqb { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill, 999px); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 0.9375rem; text-decoration: none; }
.kqb .ic { width: 18px; height: 18px; color: var(--blue-btn); }
.kqb:hover, .kqb:focus-visible, .kqb.first { border-color: var(--blue-btn); background: color-mix(in srgb, var(--blue-btn) 8%, var(--surface)); }
.kmyhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.kmyhead .sechead { margin: 0; }
.kmyq { flex: 0 1 340px; margin: 0; }
.ktgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px 28px; align-items: start; }
.ktgroup[hidden], .ktlist li[hidden] { display: none; }
.ktlist { list-style: none; margin: 8px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card, 12px); overflow: hidden; }
.ktlist li + li { border-top: 1px solid var(--line); }
.ktrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.ktrow > .ic:first-child { width: 20px; height: 20px; color: var(--blue-btn); }
.ktrow > .ic:last-child { width: 16px; height: 16px; color: var(--muted); }
.ktrow b { display: block; font-size: 0.9375rem; }
.ktrow small { display: block; color: var(--muted); font-size: 0.8125rem; margin-top: 1px; }
.ktrow:hover, .ktrow:focus-visible { background: color-mix(in srgb, var(--blue-btn) 6%, transparent); }
@media (max-width: 640px) { .kmyq { flex-basis: 100%; } }

/* Request types that are Coming soon: greyed out, tagged, not clickable */
.soontag { margin-left: auto; padding: 2px 10px; border: 1px solid var(--line); border-radius: var(--r-pill, 999px); background: var(--surface); color: var(--muted); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.ktrow.soon, .klink.soon, .kqb.soon { color: var(--muted); cursor: default; text-decoration: none; }
.ktrow.soon b, .klink.soon > span:not(.soontag), .kqb.soon > span:not(.soontag) { color: var(--muted); }
.ktrow.soon > .ic:first-child, .klink.soon .ic, .kqb.soon .ic { color: var(--muted); }
.ktrow.soon:hover, .klink.soon:hover, .kqb.soon:hover { background: none; color: var(--muted); border-color: var(--line); }

/* @ mention list under a message box */
.composer { position: relative; }
.mbox { box-sizing: border-box; position: absolute; z-index: var(--z-menu, 60); max-height: 232px; overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--input-strong); border-radius: var(--r-ctl); box-shadow: 0 8px 24px rgba(22, 35, 29, 0.18); }
.mopt { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px; border-radius: var(--r-tight); font-size: 0.875rem; color: var(--ink); cursor: pointer; }
.mopt.sel, .mopt:hover { background: var(--blue-tint); color: var(--blue-ink); }
