/* Ai2 Trade Portal: shared look for the customer portal and the staff screens (from the approved mock-ups). */
:root {
  --deep: #0b3f9e; --peri: #5b78f2; --soft: #eef2ff; --bg: #f5f7fc; --ink: #14203a; --ink2: #4a5468; --muted: #66728c;
  --line: #dfe5f2; --grid: #e8ecf4; --side: #0e1a33; --side-on: #1d2c52; --side-ink: #b9c5e6;
  --b1: #2a78d6; --b2: #eb6834; --b3: #1baf7a; --b4: #eda100; --b5: #008300; --b6: #e34948; --gau: #6250d6; --kzn: #e87ba4;
  --good: #17804f; --good-bg: #e4f5ec; --warn: #945400; --warn-bg: #fff1da; --bad: #c0392b; --bad-bg: #fde6e3;
  --f-head: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif; --f-body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--f-body); }
h1, h2, h3 { font-family: var(--f-head); margin: 0; }
h1 { font-weight: 800; font-size: 26px; line-height: 1.15; color: var(--deep); }
h3 { font-weight: 800; font-size: 15px; }
a { color: var(--deep); }
[hidden] { display: none !important; }
.eb { font: 800 11px/1 var(--f-head); letter-spacing: .12em; color: var(--peri); text-transform: uppercase; }
.sub { color: var(--muted); font-size: 12.5px; }
.sm { color: var(--muted); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* Buttons and fields */
button, .btn { font: 800 13px/1 var(--f-body); border-radius: 9px; padding: 10px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
button.primary, .btn.primary { background: var(--deep); color: #fff; border-color: var(--deep); }
button.danger { color: var(--bad); border-color: #f1c4bd; }
button:disabled { opacity: .5; cursor: default; }
button.primary:disabled { opacity: 1; background: #c9d1e2; border-color: #c9d1e2; color: #3a4560; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--peri); outline-offset: 1px; }
input, select, textarea { font: inherit; color: var(--ink); border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
textarea { width: 100%; min-height: 60px; resize: vertical; }
.field { display: grid; gap: 4px; }
.field label { font-weight: 700; font-size: 12.5px; color: var(--ink2); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.msg { border-radius: 9px; padding: 10px 12px; font-weight: 700; font-size: 13px; margin: 10px 0; }
.msg.ok { background: var(--good-bg); color: var(--good); }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }

/* Cards, tiles, tables */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tile b { display: block; font: 800 24px/1.2 var(--f-head); font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 12px; font-weight: 700; }
.tile small { display: block; font-size: 12px; font-weight: 700; margin-top: 4px; color: var(--ink2); }
.up { color: var(--good); } .dn { color: var(--bad); } .wn { color: var(--warn); }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1.4fr 1fr; margin-bottom: 14px; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
th { font: 800 11px/1.2 var(--f-head); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 9px 10px; background: #f8faff; border-bottom: 1px solid var(--line); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th.r, td.r { text-align: right; white-space: nowrap; }
th.g { text-align: center; background: var(--soft); color: var(--deep); }
tr.brand td { background: var(--soft); font: 800 12px/1 var(--f-head); color: var(--deep); letter-spacing: .04em; padding: 9px 10px; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f8faff; }
.code { font-weight: 700; color: var(--muted); font-size: 12px; }
.tag { font-size: 11px; font-weight: 800; border-radius: 5px; padding: 3px 7px; white-space: nowrap; display: inline-block; }
.tag.ok { background: var(--good-bg); color: var(--good); } .tag.low { background: var(--warn-bg); color: var(--warn); }
.tag.out, .tag.back_order, .tag.cancelled { background: var(--bad-bg); color: var(--bad); }
.tag.tr, .tag.received, .tag.in_transit { background: var(--soft); color: var(--deep); }
.tag.accepted { background: #ece9fb; color: #4a3bb5; } .tag.picked { background: var(--warn-bg); color: var(--warn); } .tag.invoiced { background: var(--good-bg); color: var(--good); }
.st { font-weight: 700; font-size: 12px; white-space: nowrap; }
.st i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.st.ok { color: var(--good); } .st.ok i { background: var(--good); }
.st.low { color: var(--warn); } .st.low i { background: var(--warn); }
.st.out { color: var(--bad); } .st.out i { background: var(--bad); }
.qty { width: 86px; text-align: right; font-weight: 800; }
.qty.has { border-color: var(--peri); background: #f3f6ff; color: var(--deep); }
.legend { display: flex; gap: 16px; font-size: 12px; font-weight: 700; color: var(--ink2); margin: 4px 0 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
svg text { font-family: var(--f-body); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #0b3f9e 0%, #0e1a33 70%); }
.login .box { background: #fff; border-radius: 16px; padding: 28px; width: min(400px, 100%); display: grid; gap: 14px; }
.login img { width: 190px; }
.login input { width: 100%; }
.powered { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 6px; }
.powered img { height: 14px; width: auto; border-radius: 3px; }

/* Customer portal layout */
.top { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px max(16px, 2vw); flex-wrap: wrap; }
.top img.logo { height: 40px; }
.top .search { flex: 1; min-width: 200px; }
.top .search input { width: 100%; }
.pill { border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; background: #fff; }
.pnav { background: var(--deep); display: flex; gap: 2px; padding: 0 max(16px, 2vw); overflow-x: auto; }
.pnav a { color: #c9d5ff; padding: 11px 14px; font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; }
.pnav a.on { color: #fff; box-shadow: inset 0 -3px 0 #8fa8ff; }
.pwrap { padding: 20px max(16px, 2vw) 40px; max-width: 1400px; margin: 0 auto; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; background: var(--soft); color: var(--deep); font-weight: 700; border-radius: 999px; padding: 4px 11px; font-size: 12px; }
.sheetgrid { display: grid; grid-template-columns: 1fr 310px; gap: 18px; align-items: start; }
.summary { position: sticky; top: 12px; display: grid; gap: 8px; }
.summary .line { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.summary .total { border-top: 1px solid var(--line); padding-top: 10px; font: 800 19px/1.2 var(--f-head); color: var(--deep); }
.summary input, .summary select { width: 100%; }

/* Staff layout */
.app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
aside { background: var(--side); padding: 16px 12px; color: var(--side-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
aside nav { display: grid; gap: 2px; }
aside .who { margin-top: auto; }
aside .lg { background: #fff; border-radius: 9px; padding: 8px; margin-bottom: 16px; }
aside .lg img { width: 100%; display: block; }
aside a { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 8px 11px; border-radius: 8px; font-weight: 700; font-size: 13.5px; color: var(--side-ink); text-decoration: none; }
aside a:focus-visible, .mbar button:focus-visible { outline: 2px solid #8fa8ff; outline-offset: 1px; }
aside .rail-h { font: 800 10.5px/1 var(--f-head); letter-spacing: .12em; text-transform: uppercase; color: #7f8db3; padding: 14px 11px 6px; }
aside a.on, aside a:hover { background: var(--side-on); color: #fff; }
aside .who { padding: 12px 11px 4px; border-top: 1px solid #23304f; font-size: 12.5px; color: #d5ddf3; }
aside .who button { margin-top: 8px; }
main { padding: 22px 26px 40px; min-width: 0; }
.panel { margin-bottom: 14px; }
.lines-form td input, .lines-form td select { width: 100%; }
dialog { border: none; border-radius: 14px; padding: 0; width: min(860px, 94vw); box-shadow: 0 20px 60px rgba(10, 20, 50, .3); }
dialog::backdrop { background: rgba(14, 26, 51, .45); }
dialog .dhead { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
dialog .dbody { padding: 16px 18px; max-height: 75vh; overflow: auto; }

/* Printable invoice */
.invoice { background: #fff; padding: 28px; border: 1px solid var(--line); border-radius: 10px; }
.invoice .ihead { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.invoice .ihead img { width: 170px; }
.invoice h2 { font-size: 24px; text-align: right; }
.invoice .tot { margin-left: auto; width: min(320px, 100%); margin-top: 10px; }
.invoice .tot div { display: flex; justify-content: space-between; padding: 4px 0; }
.invoice .tot .grand { font-weight: 800; font-size: 16px; border-top: 1px solid var(--ink); padding-top: 8px; }
@media print {
  aside, .pnav, .top, .noprint, dialog .dhead { display: none !important; }
  .app { display: block; } main { padding: 0; } dialog { box-shadow: none; width: 100%; } .invoice { border: none; }
}
@media (max-width: 900px) {
  .sheetgrid, .grid2 { grid-template-columns: 1fr; }
  .summary { position: static; }
  main { padding: 16px; }
}
select.uom { padding: 6px 8px; font-size: 13px; max-width: 150px; }

.snap { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.slip { max-width: 100%; max-height: 60vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* Side rail on phones and small tablets: a menu button in a slim top bar slides the rail in from the left. */
.mbar { display: none; }
@media (max-width: 900px) { .top #basketPill { display: none; } }
#scrim { position: fixed; inset: 0; background: rgba(8, 16, 36, .5); z-index: 55; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .mbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40; background: var(--side); color: #fff;
          padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); }
  .mbar button.menu { background: transparent; border: 1px solid #33456f; color: #fff; font-size: 15px; padding: 10px 12px; min-height: 44px; }
  .mbar .mlogo { height: 30px; background: #fff; border-radius: 7px; padding: 3px 6px; }
  .mbar .mtitle { font: 800 15px/1.2 var(--f-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
  aside { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: min(290px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  aside.open { transform: none; }
  aside a { min-height: 44px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { aside { transition: none; } }
main.pmain { padding: 0; }

.mbar .pill { color: var(--ink); padding: 8px 10px; }
aside .lg { padding: 6px 8px; } aside .lg img { max-height: 58px; width: auto; max-width: 100%; margin: 0 auto; }
@media (min-width: 901px) { aside { padding-top: 12px; } aside a { min-height: 32px; padding: 5px 11px; } aside .rail-h { padding: 10px 11px 3px; } aside .lg { margin-bottom: 10px; } aside .lg img { max-height: 50px; } }

/* Order sheet on a phone: each product becomes a small card (name, price, stock, then order-in and quantity side by side),
   so a customer never scrolls sideways to reach the quantity box. */
@media (max-width: 700px) {
  #sheetTable, #sheetTable tbody, #sheetTable tr, #sheetTable td { display: block; }
  #sheetTable tr:first-child { display: none !important; }
  #sheetTable tr.brand td { position: sticky; top: 60px; z-index: 2; padding: 10px 14px; }
  #sheetTable tr:not(.brand) { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "prod prod" "pack price" "stock vat" "uom qty" "tot tot";
                               gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  #sheetTable tr:not(.brand) td { border: none; padding: 0; text-align: left; white-space: normal; }
  #sheetTable tr:not(.brand) td:nth-child(1) { display: none; }
  #sheetTable td:nth-child(2) { grid-area: prod; font-weight: 800; font-size: 15px; }
  #sheetTable td:nth-child(3) { grid-area: pack; }
  #sheetTable td:nth-child(4) { grid-area: price; text-align: right; font-weight: 800; }
  #sheetTable td:nth-child(5) { grid-area: vat; text-align: right; }
  #sheetTable td:nth-child(5)::before { content: "VAT "; }
  #sheetTable td:nth-child(6) { grid-area: stock; }
  #sheetTable td:nth-child(7) { grid-area: uom; }
  #sheetTable td:nth-child(8) { grid-area: qty; }
  #sheetTable td:nth-child(9) { grid-area: tot; text-align: right; font-weight: 800; }
  #sheetTable td:nth-child(9):empty, #sheetTable td:nth-child(9):only-child { display: none; }
  #sheetTable select.uom, #sheetTable input.qty { width: 100%; max-width: none; min-height: 44px; font-size: 16px; }
}

/* WhatsApp: a floating "Chat to sales" button on every customer screen, and a menu item in the rail. */
:root { --wa: #128c4a; --wa-hover: #0e7a3f; }
.wa-ico { width: 22px; height: 22px; flex: none; }
aside a.wa-rail { color: #8ee3b2; } aside a.wa-rail:hover { color: #fff; background: #13402b; } aside a.wa-rail .wa-ico { width: 18px; height: 18px; }
.wa-fab { position: fixed; z-index: 50; right: max(18px, calc(env(safe-area-inset-right, 0px) + 12px)); bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 12px));
          display: inline-flex; align-items: center; gap: 9px; min-height: 52px; padding: 0 18px 0 15px; border-radius: 999px; background: var(--wa); color: #fff;
          font: 800 14px/1 var(--f-head); text-decoration: none; box-shadow: 0 8px 22px rgba(10, 60, 30, .35); }
.wa-fab:hover { background: var(--wa-hover); }
.wa-fab:focus-visible { outline: 3px solid #8fa8ff; outline-offset: 2px; }
.wa-fab .wa-ico { width: 24px; height: 24px; }
@media (max-width: 700px) { .wa-fab { padding: 0; width: 56px; justify-content: center; } .wa-fab span { display: none; } }
@media print { .wa-fab { display: none !important; } }
@media (max-width: 900px) { .pwrap { padding-bottom: 96px; } }

/* Status dots */
.sdot { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; white-space: nowrap; color: var(--ink); }
.sdot i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.s-received i { background: #2a78d6; } .s-accepted i { background: #6250d6; } .s-picked i { background: #e08a00; }
.s-invoiced i { background: #17804f; } .s-cancelled i { background: #c0392b; } .s-to_check i { background: #e08a00; } .s-approved i { background: #17804f; }
/* Sortable headings */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--deep); }
th.sortable::after { content: " ↕"; opacity: .35; font-size: 10px; }
th[aria-sort="ascending"]::after { content: " ▲"; opacity: 1; } th[aria-sort="descending"]::after { content: " ▼"; opacity: 1; }
th.sortable:focus-visible { outline: 2px solid var(--peri); outline-offset: -2px; }
/* Filter bar above a list */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.filters .grow { flex: 1 1 220px; min-width: 0; }
.filters input[type=search] { width: 100%; }
.who2 { font-size: 12px; color: var(--muted); line-height: 1.35; }
td.nw { white-space: nowrap; }
.tile.click { cursor: pointer; } .tile.click:hover, a.tile:hover { border-color: var(--peri); }
tr.click:hover td { background: #f3f6ff; }

/* Printing a report (and saving it as PDF): no menu, buttons or filters, landscape-friendly tables. */
.printonly { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  .mbar, #scrim, .demobar, .wa-fab, .xport, .filters, .head .row, button, select, input, .sm:has(> a), #exPre { display: none !important; }
  .printonly { display: block !important; font: 800 12px/1.3 var(--f-head); color: var(--muted); margin-bottom: 6px; }
  body, main, .card { background: #fff !important; box-shadow: none !important; }
  .card { border: 1px solid #ccd; break-inside: avoid; }
  .tablewrap { overflow: visible !important; }
  table { font-size: 10.5px; } th, td { padding: 4px 6px; }
  th.sortable::after { content: "" !important; }
  .tiles { grid-template-columns: repeat(4, 1fr) !important; }
}

/* WhatsApp inbox: made to look and feel like WhatsApp itself, so staff know it at once. */
:root { --wa-head: #f0f2f5; --wa-wall: #efeae2; --wa-in: #ffffff; --wa-out: #d9fdd3; --wa-ink: #111b21; --wa-sub: #667781; --wa-line: #e9edef;
        --wa-green: #00a884; --wa-green-dk: #008069; --wa-blue: #53bdeb; --wa-sel: #f0f2f5; --wa-hover: #f5f6f6; --wa-chip: #ffffffe6; --wa-badge: #25d366; }
.nbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--wa-badge); color: #fff; font: 800 11px/20px var(--f-body); text-align: center; }
main.wa-main { padding: 0; }
.wa { display: grid; grid-template-columns: minmax(300px, 30%) 1fr; height: 100vh; background: #fff; color: var(--wa-ink); font: 14.2px/1.4 "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif; overflow: hidden; }
.wa button { font: inherit; }
.wa-list { display: flex; flex-direction: column; border-right: 1px solid var(--wa-line); min-width: 0; min-height: 0; background: #fff; }
.wa-lh { display: flex; align-items: center; gap: 8px; padding: 14px 16px 8px; }
.wa-lh h2 { font: 700 22px/1.2 "Segoe UI", system-ui, sans-serif; color: var(--wa-ink); flex: 1; }
.wa-ib { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #54656f; display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.wa-ib:hover { background: rgba(11, 20, 26, .06); } .wa-ib svg { width: 22px; height: 22px; }
.wa-ib:focus-visible, .wa-chat:focus-visible, .wa-send:focus-visible { outline: 2px solid var(--wa-green); outline-offset: -2px; }
.wa-search { padding: 0 12px 8px; display: flex; gap: 8px; }
.wa-search label { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--wa-head); border-radius: 8px; padding: 0 12px; height: 36px; color: var(--wa-sub); }
.wa-search input { flex: 1; border: 0; background: transparent; outline: none; font: inherit; color: var(--wa-ink); min-width: 0; padding: 0; height: 34px; }
.wa-search svg { width: 18px; height: 18px; flex: none; }
.wa-filt { padding: 0 12px 8px; }
.wa-filt select { height: 32px; border: 1px solid var(--wa-line); border-radius: 999px; background: #fff; padding: 0 12px; font: inherit; font-size: 14px; color: var(--wa-ink); max-width: 100%; }
.wa-warn { margin: 0 12px 8px; padding: 10px 12px; border-radius: 8px; background: #fff4cc; color: #54420a; font-size: 13px; }
.wa-warn button { margin-top: 6px; }
.wa-chats { flex: 1; overflow-y: auto; min-height: 0; }
.wa-chat { display: flex; gap: 13px; align-items: center; width: 100%; padding: 0 0 0 13px; border: 0; background: #fff; text-align: left; cursor: pointer; color: inherit; height: 72px; }
.wa-chat:hover { background: var(--wa-hover); } .wa-chat.on { background: var(--wa-sel); }
.wa-chat .wa-cb { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--wa-line); padding-right: 15px; }
.wa-chat .r1, .wa-chat .r2 { display: flex; align-items: center; gap: 6px; }
.wa-chat .nm { flex: 1; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat .tm { font-size: 12px; color: var(--wa-sub); flex: none; } .wa-chat.un .tm { color: var(--wa-green); font-weight: 600; }
.wa-chat .pv { flex: 1; font-size: 14px; color: var(--wa-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat.un .pv { color: var(--wa-ink); font-weight: 600; }
.wa-chat .ub { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--wa-badge); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; flex: none; }
.wa-chat .who { font-size: 11px; color: var(--wa-green-dk); background: #e7fce3; border-radius: 4px; padding: 0 5px; flex: none; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-av { width: 49px; height: 49px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font: 600 17px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: .02em; }
.wa-av.sm { width: 40px; height: 40px; font-size: 15px; }
.wa-av.c0 { background: #6b7c85; } .wa-av.c1 { background: #00a884; } .wa-av.c2 { background: #2a78d6; } .wa-av.c3 { background: #a5629c; } .wa-av.c4 { background: #d1814a; } .wa-av.c5 { background: #4b8a8c; } .wa-av.c6 { background: #c14a5b; }
.wa-none { padding: 40px 24px; text-align: center; color: var(--wa-sub); }
.wa-conv { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--wa-wall); }
.wa-conv::before { content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: radial-gradient(circle at 20% 30%, #d9d2c5 1.2px, transparent 1.6px), radial-gradient(circle at 70% 80%, #d9d2c5 1.2px, transparent 1.6px), radial-gradient(circle at 45% 60%, #e2dbcf 2px, transparent 2.4px);
  background-size: 46px 46px, 62px 62px, 90px 90px; }
.wa-conv > * { position: relative; }
.wa-empty { flex: 1; display: grid; place-items: center; text-align: center; background: #f0f2f5; color: var(--wa-sub); border-bottom: 6px solid var(--wa-green); }
.wa-empty h3 { font: 300 30px/1.2 "Segoe UI", system-ui, sans-serif; color: #41525d; margin: 18px 0 10px; }
.wa-empty svg { width: 90px; height: 90px; color: #b6c1c6; }
.wa-ch { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; height: 60px; background: var(--wa-head); border-left: 1px solid var(--wa-line); flex: none; }
.wa-ch .t { flex: 1; min-width: 0; cursor: pointer; }
.wa-ch .t b { display: block; font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-ch .t span { display: block; font-size: 13px; color: var(--wa-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-back { display: none; }
.wa-info { background: #fff; border-bottom: 1px solid var(--wa-line); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; font-size: 13px; flex: none; }
.wa-info .field { margin: 0; min-width: 180px; } .wa-info a { color: var(--wa-green-dk); font-weight: 600; }
.wa-msgs { flex: 1; overflow-y: auto; padding: 14px 7% 10px; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-day { align-self: center; margin: 10px 0 8px; padding: 5px 12px; border-radius: 7.5px; background: var(--wa-chip); color: #54656f; font-size: 12.5px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); text-transform: uppercase; }
.wa-sys { align-self: center; margin: 6px 0; padding: 6px 12px; border-radius: 7.5px; background: #ffeecd; color: #54656f; font-size: 12.5px; text-align: center; max-width: 80%; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.wa-b { position: relative; max-width: min(65%, 560px); padding: 6px 7px 8px 9px; border-radius: 7.5px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; margin-top: 2px; }
.wa-b.in { align-self: flex-start; background: var(--wa-in); }
.wa-b.out { align-self: flex-end; background: var(--wa-out); }
.wa-b.first { margin-top: 10px; }
.wa-b.first.in { border-top-left-radius: 0; } .wa-b.first.out { border-top-right-radius: 0; }
.wa-b.first.in::before, .wa-b.first.out::before { content: ""; position: absolute; top: 0; width: 8px; height: 13px; }
.wa-b.first.in::before { left: -8px; background: var(--wa-in); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.wa-b.first.out::before { right: -8px; background: var(--wa-out); clip-path: polygon(0 0, 100% 0, 0 100%); }
.wa-b .au { display: block; font-size: 12.8px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; }
.wa-b .au.k0 { color: #1f7aec; } .wa-b .au.k1 { color: #c2185b; } .wa-b .au.k2 { color: #00897b; } .wa-b .au.k3 { color: #e65100; } .wa-b .au.k4 { color: #6a1b9a; }
.wa-b .meta { float: right; margin: 6px 0 -5px 10px; font-size: 11px; color: var(--wa-sub); white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; position: relative; top: 4px; }
.wa-b .meta .by { color: var(--wa-green-dk); opacity: .85; }
.wa-b .tick { width: 16px; height: 11px; } .wa-b .tick.rd { color: var(--wa-blue); }
.wa-b .fail { color: #d93025; font-weight: 600; }
.wa-b .img { display: block; margin: -3px -4px 4px -6px; border-radius: 6px; max-width: 330px; width: calc(100% + 10px); min-height: 80px; background: #dfe5e7; cursor: zoom-in; }
.wa-b .doc { display: flex; align-items: center; gap: 10px; margin: -2px -3px 4px -5px; padding: 10px; border-radius: 6px; background: rgba(11, 20, 26, .05); color: inherit; text-decoration: none; min-width: 220px; white-space: normal; }
.wa-b .doc i { font-style: normal; font-size: 26px; }
.wa-b a.lnk { color: #027eb5; }
.wa-comp { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px; background: var(--wa-head); flex: none; position: relative; }
.wa-comp textarea { flex: 1; resize: none; border: 0; outline: none; border-radius: 8px; padding: 10px 12px; font: 15px/20px "Segoe UI", system-ui, sans-serif; max-height: 120px; min-height: 42px; background: #fff; color: var(--wa-ink); }
.wa-send { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; background: var(--wa-green); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.wa-send:hover { background: var(--wa-green-dk); } .wa-send:disabled { background: #b8c4c9; cursor: default; } .wa-send svg { width: 22px; height: 22px; }
.wa-menu { position: absolute; bottom: 60px; left: 12px; background: #fff; border-radius: 12px; box-shadow: 0 2px 5px rgba(11, 20, 26, .26), 0 2px 10px rgba(11, 20, 26, .16); padding: 8px 0; z-index: 5; min-width: 250px; }
.wa-menu button { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: none; padding: 9px 18px; text-align: left; cursor: pointer; color: var(--wa-ink); font-size: 14.5px; }
.wa-menu button:hover { background: var(--wa-hover); } .wa-menu .mh { padding: 6px 18px 4px; font-size: 12px; color: var(--wa-sub); }
.wa-menu i { font-style: normal; width: 22px; text-align: center; }
.wa-new { display: flex; gap: 8px; padding: 0 12px 8px; } .wa-new input { flex: 1; }
@media (max-width: 900px) {
  main.wa-main { padding: 0; }
  .wa { grid-template-columns: 1fr; height: calc(100vh - 52px); height: calc(100dvh - 52px); }
  .wa.open .wa-list { display: none; } .wa:not(.open) .wa-conv { display: none; }
  .wa-back { display: inline-grid; } .wa-msgs { padding: 10px 4%; } .wa-b { max-width: 85%; }
}
@media print { .wa { display: none; } }
