/* Partner Portal. Colours and base controls come from /styles.css; only layout and portal parts live here. */
.top .brand { text-decoration: none; color: inherit; }
.top .brand-ar { font-size: 15px; }

.p-login { max-width: 420px; margin: 0 auto; padding: clamp(40px, 9vw, 110px) var(--gutter) 60px; }
.p-login h1, .home h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 300; letter-spacing: -.03em; line-height: 1.15; }
[dir="rtl"] .p-login h1, [dir="rtl"] .home h1, [dir="rtl"] .p-main h2 { letter-spacing: 0; font-weight: 400; line-height: 1.35; }
.p-login > p { margin: 12px 0 30px; color: var(--muted); }
.p-login .btn { width: 100%; }

/* ---------- shell: sidebar + page ---------- */
.p-app { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); max-width: 1240px; margin: 0 auto; padding: 28px var(--gutter) 80px; align-items: start; }
.p-nav { position: sticky; top: 96px; display: grid; gap: 4px; }
.p-nav .who { padding: 0 14px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.p-nav .who b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.p-nav .who span { font-size: 13.5px; color: var(--muted); }
.p-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid transparent; background: none; color: var(--muted); font-size: 15px; text-align: start; transition: color .2s, background .2s, border-color .2s; }
.p-link svg { width: 19px; height: 19px; flex: none; }
.p-link:hover { color: var(--mint-hi); background: rgba(var(--accent-rgb), .06); }
.p-link[aria-current="page"] { background: rgba(var(--accent-rgb), .12); border-color: rgba(var(--accent-rgb), .45); color: var(--mint-hi); font-weight: 500; }
.p-link b { margin-inline-start: auto; font-weight: 500; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: rgba(var(--danger-rgb), .14); color: var(--danger); }
.p-link.help { margin-top: 14px; border-color: var(--line-2); color: var(--text); justify-content: center; }
.p-link.help:hover, .p-link.help[aria-current="page"] { border-color: var(--mint); color: var(--mint-hi); }

.p-main { min-width: 0; max-width: 820px; }
.p-main h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 300; letter-spacing: -.03em; line-height: 1.15; }
.p-main .sub { margin: 8px 0 26px; color: var(--muted); max-width: 40em; }
.p-main h3 { margin: 34px 0 6px; font-size: 18px; font-weight: 500; }
.p-main h3 + .sub { margin-bottom: 16px; font-size: 14.5px; }

/* ---------- changes waiting to go live ---------- */
.pendbar { position: sticky; top: 78px; z-index: 5; margin-bottom: 26px; padding: 14px 18px; border: 1px solid rgba(230, 167, 0, .55); border-radius: 16px; background: var(--card); box-shadow: 0 12px 34px rgba(var(--shadow-rgb), .12); }
.pendbar-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.pendbar .state { margin: 0; flex: 1 1 200px; }
.pendbar details { margin-top: 8px; font-size: 14px; }
.pendbar summary { cursor: pointer; color: var(--muted); }
.state { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .18); flex: none; }
.dot.wait { background: #e6a700; box-shadow: 0 0 0 4px rgba(230, 167, 0, .2); }
.pend { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.pend li { padding-inline-start: 14px; position: relative; overflow-wrap: anywhere; }
.pend li::before { content: ""; position: absolute; inset-inline-start: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }
.linkbtn { background: none; border: 0; padding: 6px 2px; font-size: 13.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.msg { margin-top: 10px; font-size: 14px; color: var(--danger); }
.okmsg { margin-top: 14px; color: var(--mint-hi); }

/* ---------- home ---------- */
.home .kicker { margin-bottom: 10px; }
.home .state { margin: 18px 0 4px; }
.home .state + p { color: var(--muted); font-size: 14.5px; }
.go { list-style: none; margin: 30px 0 0; padding: 0; }
.go button { display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px 4px; border: 0; border-top: 1px solid var(--line); background: none; text-align: start; transition: color .2s; }
.go li:last-child button { border-bottom: 1px solid var(--line); }
.go svg { width: 22px; height: 22px; flex: none; color: var(--mint); }
.go .t { font-size: 17px; font-weight: 500; display: block; }
.go .d { font-size: 14.5px; color: var(--muted); display: block; margin-top: 2px; }
.go .chev { margin-inline-start: auto; color: var(--faint); width: 18px; height: 18px; }
[dir="rtl"] .go .chev { transform: scaleX(-1); }
.go button:hover .t { color: var(--mint-hi); }
.hear { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hear p { flex: 1 1 260px; font-size: 14.5px; color: var(--muted); }
.told { margin-top: 26px; }
.told summary { cursor: pointer; font-weight: 500; }
.told pre, .log { margin: 12px 0 0; }
.told pre { max-height: 360px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.6 ui-monospace, Consolas, monospace; color: var(--muted); direction: ltr; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }

/* ---------- lists and forms ---------- */
.bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.bar input { flex: 1 1 200px; min-width: 0; background: var(--field); border: 1px solid var(--line-2); border-radius: 999px; padding: 11px 18px; }
.bar input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.btn.small { padding: 10px 18px; font-size: 14px; }
.count { font-size: 14px; color: var(--muted); margin: 6px 0 4px; }
.cat { margin: 26px 0 4px; font-size: 13px; font-weight: 500; color: var(--mint); }

.row { border-top: 1px solid var(--line); }
.row-top { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; background: none; border: 0; padding: 4px 0; text-align: start; }
.row-main .nm { font-weight: 500; overflow-wrap: anywhere; }
.row-main .ar { color: var(--muted); font-size: 14.5px; }
.row-main .pr { margin-inline-start: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14.5px; white-space: nowrap; }
.row.off .nm { text-decoration: line-through; color: var(--faint); }
.row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 0 0 14px; font-size: 14px; color: var(--muted); }
.row-sub .chip { padding: 7px 14px; font-size: 13.5px; }
.row-sub input[type="date"] { background: var(--field); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; font-size: 14px; }
.edit { padding: 6px 0 20px; }
.edit .field, .block .field { margin-bottom: 16px; }
.edit-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 13.5px; color: var(--muted); }
.edit .field textarea, .block .field textarea { min-height: 76px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

.switch { position: relative; flex: none; display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch i { width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(var(--shadow-rgb), .3); transition: inset-inline-start .2s; }
.switch input:checked + i { background: var(--mint); }
.switch input:checked + i::after { inset-inline-start: 21px; }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .25); }

.block { border-top: 1px solid var(--line); padding: 18px 0 6px; }
.block-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.badge { font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: rgba(var(--ink-rgb), .07); color: var(--muted); white-space: nowrap; }
.badge.run, .badge.positive { background: rgba(var(--accent-rgb), .14); color: var(--mint-hi); }
.badge.negative { background: rgba(var(--danger-rgb), .12); color: var(--danger); }
.del { margin-inline-start: auto; background: none; border: 0; padding: 6px 8px; font-size: 13.5px; color: var(--danger); text-decoration: underline; text-underline-offset: 3px; }
.check { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--mint); }
.empty { padding: 22px 0; color: var(--faint); }

/* ---------- history and calls ---------- */
.hist { list-style: none; margin: 0; padding: 0; }
.hist > li { border-top: 1px solid var(--line); padding: 16px 0; }
.hist time { font-weight: 500; }
.hist .by { color: var(--muted); font-size: 14.5px; }
.callrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; width: 100%; padding: 16px 4px; border: 0; border-top: 1px solid var(--line); background: none; text-align: start; }
.callrow .when { font-weight: 500; }
.callrow .meta { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.callrow .sum { grid-column: 1 / -1; font-size: 14.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.callrow[aria-expanded="true"] .sum { -webkit-line-clamp: unset; }
.callrow:hover .when { color: var(--mint-hi); }
.log { display: grid; gap: 8px; padding: 0 4px 22px; }
.say { max-width: 86%; padding: 9px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); font-size: 15px; line-height: 1.5; }
.say b { display: block; font-size: 12px; font-weight: 500; opacity: .7; }
.say.agent { justify-self: end; background: rgba(var(--accent-rgb), .09); border-color: rgba(var(--accent-rgb), .4); color: var(--mint-hi); }

/* ---------- live agent ---------- */
.live .chips { gap: 8px; }
.live .field { margin-bottom: 22px; }
.chip[disabled] { opacity: .38; cursor: not-allowed; }
.note-line { margin: -8px 0 18px; font-size: 13.5px; color: var(--muted); max-width: 44em; }
.live .sample { margin-bottom: 8px; }

/* ---------- requests and phone setup ---------- */
.chip small { margin-inline-start: 4px; color: var(--muted); font-size: 12.5px; }
.reqbox p { margin: 0 0 6px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.reqbox b { font-weight: 500; margin-inline-end: 6px; }
.bignum { font-size: 34px; font-weight: 300; letter-spacing: .01em; margin: 6px 0 4px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.codeline { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.codeline small { color: var(--muted); font-size: 13.5px; min-width: 5em; }
.codebox { display: inline-flex; align-items: center; gap: 12px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--field); }
.codebox code { font: 16px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .02em; overflow-wrap: anywhere; }
.msgtext { font-size: 15px; line-height: 1.65; padding: 14px; border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; }
.know { margin: 0; padding-inline-start: 20px; color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 44em; }
.know li { margin-bottom: 6px; }

/* ---------- analytics ---------- */
.an-filter { gap: 8px 10px; margin-bottom: 26px; }
.an-filter .chip { padding: 8px 14px; font-size: 14px; }
.daterange { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.daterange input { flex: none; background: var(--field); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; font-size: 14px; }
.export { margin-inline-start: auto; text-decoration: none; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px 20px; }
.tile { border-top: 2px solid var(--mint); padding-top: 14px; min-width: 0; }
.tl { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-height: 2.9em; }
.tv { font-size: 34px; font-weight: 300; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ts { font-size: 13px; color: var(--muted); margin-top: 4px; }
.chart { display: block; width: 100%; height: auto; margin-top: 10px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.base { stroke: var(--line-2); }
.chart .tick { font-size: 11.5px; fill: var(--muted); font-family: inherit; }
.chart .barmark { fill: var(--mint); }
.reasons { display: grid; gap: 12px; margin-top: 14px; }
.reason { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 3ch 4.5ch; align-items: center; gap: 14px; font-size: 15px; }
.reason .track { height: 10px; border-radius: 4px; background: rgba(var(--ink-rgb), .06); overflow: hidden; }
.reason .track i { display: block; height: 100%; border-radius: 4px; background: var(--mint); }
.reason b { font-weight: 500; text-align: end; font-variant-numeric: tabular-nums; }
.reason .share { color: var(--muted); font-size: 13.5px; text-align: end; font-variant-numeric: tabular-nums; }
.fine-note { margin-top: 18px; font-size: 13px; color: var(--faint); max-width: 46em; }
.tip { position: fixed; z-index: 50; pointer-events: none; padding: 6px 10px; border-radius: 8px; font-size: 13px; background: var(--text); color: var(--bg, #fff); box-shadow: 0 6px 18px rgba(var(--shadow-rgb), .25); white-space: nowrap; }
@media (max-width: 1080px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
@media (max-width: 560px) { .reason { grid-template-columns: minmax(0, 1fr) 3ch 4.5ch; } .reason .track { grid-column: 1 / -1; order: 2; } }

/* ---------- documents ---------- */
.doc { padding: 4px 4px 26px; }
.doc-body { max-width: 44em; text-align: left; }
.doc-body h3 { margin: 6px 0 14px; font-size: 22px; font-weight: 500; }
.doc-body h4 { margin: 24px 0 8px; font-size: 16px; font-weight: 500; }
.doc-body p, .doc-body li { font-size: 15px; line-height: 1.65; color: var(--muted); }
.doc-body p { margin: 0 0 10px; }
.doc-body ol, .doc-body ul { margin: 0 0 10px; padding-left: 22px; }
.doc-body li { margin-bottom: 6px; }
.doc-body b { color: var(--text); font-weight: 500; }
.doc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.doc-foot .btn.ghost { margin-inline-start: auto; }
@media print {
  .top, .p-nav, #bar, .backdrop, .p-main h2, .p-main > #view > .sub, .docrow, .doc-foot { display: none !important; }
  .p-app { display: block; padding: 0; }
  .doc-body p, .doc-body li { color: #000; }
}

@media (max-width: 860px) {
  .p-app { grid-template-columns: 1fr; gap: 18px; padding-top: 16px; }
  .p-nav { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .p-nav .who { display: none; }
  .p-link { width: auto; flex: none; border-radius: 999px; white-space: nowrap; }
  .p-link.help { margin-top: 0; }
  .pendbar { top: 70px; }
}
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .switch span { display: none; }
  #outBtn { padding-inline: 12px; }
  .say { max-width: 100%; }
}
