/* Helpdesk additions on top of the admin portal's app.css (same look, same light/dark behaviour). */
.nowrap { white-space: nowrap; }
.stackcol { display: flex; flex-direction: column; gap: 16px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--header-muted); cursor: pointer; }
.linkbtn:hover { color: var(--header-ink); text-decoration: underline; }
.top form { margin: 0; }
.topsearch input[type=search] { min-height: 34px; padding: 5px 10px; width: 240px; max-width: 46vw; }
.filters { align-items: flex-end; }
a.tile { text-decoration: none; color: inherit; display: block; }
a.tile:hover { border-color: var(--allott-blue); text-decoration: none; }
.list form { margin: 0; }
input[type=number], input[type=date], input[type=password] { font: inherit; font-size: 14px; border: 1px solid var(--line); border-bottom: 2px solid var(--line); border-radius: 3px; padding: 9px 12px; min-height: 40px; background: var(--input-bg); color: var(--ink); width: 100%; }
textarea { resize: vertical; }
fieldset.plain { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.plain legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 4px; }
.indent { padding-left: 22px; }
.card.flush .pad { padding: 12px 18px 14px; }

/* conversation */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { border: 1px solid var(--line-soft); border-left: 4px solid var(--line); border-radius: 3px; padding: 10px 14px; background: var(--surface); }
.msg.agent { border-left-color: var(--allott-blue); }
.msg.contact { background: var(--surface-2); }
.msg.internal { background: var(--warn-bg); border-left-color: var(--warn-ink); }
.msg.system { font-size: 13px; }
.msg header { margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* AI suggestion */
.card.ai { border-top-color: #7c5cff; }
.draft { white-space: pre-wrap; overflow-wrap: anywhere; border: 1px dashed var(--line); border-radius: 3px; padding: 10px 14px; background: var(--surface-2); margin-top: 6px; }
pre.rules { white-space: pre-wrap; font: inherit; font-size: 13px; color: var(--muted); border: 1px solid var(--line-soft); border-radius: 3px; padding: 10px 14px; margin: 6px 0 0; background: var(--surface-2); }

/* opened/closed chart: two bars per day */
.chart.pair .col { justify-content: flex-end; }
.chart.pair .bars { display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 100%; justify-content: center; }
.chart.pair .bars > div { flex: 1; max-width: 16px; min-height: 2px; border-radius: 3px 3px 0 0; }
.chart .done { background: #8a94a6; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding-top: 10px; }
.legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.legend .key.ok { background: var(--allott-blue); }
.legend .key.done { background: #8a94a6; margin-left: 12px; }

/* remote access */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line); margin-right: 8px; }
.dot.on { background: #2e9e5b; }
.remote details summary { cursor: pointer; font-size: 14px; }
.remote details .stack { margin-top: 10px; font-size: 14px; }
.remote .list > div { align-items: center; }

/* remote assistance */
.login .card + .card { margin-top: 18px; }
.assist ol.steps { padding-left: 20px; display: grid; gap: 8px; font-size: 15px; }
.center { text-align: center; }
.secret.small { font-size: 15px; letter-spacing: 0; padding: 8px 12px; }
.login .who { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.login .card.staff h1 { font-size: 18px; }

/* search boxes and the new-user window */
.picker { position: relative; }
.picker.missing input.pickq { border-color: var(--bad-ink); }
.picker.chosen input.pickq { font-weight: 600; }
.picklist { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 2px); background: var(--surface); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); max-height: 320px; overflow: auto; }
.pick { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; font-size: 14px; cursor: pointer; }
.pick.at, .pick:hover { background: var(--surface-2); }
.pick.add { border-top: 1px solid var(--line-soft); color: var(--accent); font-weight: 600; }
.pick.none { cursor: default; }
html.js label.nojs { display: none; }
dialog.card { color: var(--ink); width: min(440px, 92vw); padding: 24px; border: 1px solid var(--line); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
details summary { cursor: pointer; font-size: 14px; }
details > .stack { margin-top: 10px; }
.row.tight { gap: 6px; flex-wrap: nowrap; align-items: center; } .row.tight select { min-width: 150px; }
input.pickq::-webkit-search-cancel-button { display: none; }
html.js .nojs { display: none; }

/* dashboard line chart: opened (blue) and closed (green) on the right-hand scale, total open (red) on the left */
.lc { width: 100%; height: auto; display: block; }
.lc .grid { stroke: var(--line-soft); stroke-width: 1; }
.lc .ax { font-size: 11px; fill: var(--muted); }
.lc .ax.left { text-anchor: end; } .lc .ax.right { text-anchor: start; } .lc .ax.day { text-anchor: middle; }
.lc .ax.total { fill: #e5534b; }
.lc .ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.lc .ln.opened, .lc .pt.opened { stroke: #3b82f6; } .lc .pt.opened { fill: #3b82f6; }
.lc .ln.closed, .lc .pt.closed { stroke: #2e9e5b; } .lc .pt.closed { fill: #2e9e5b; }
.lc .ln.total, .lc .pt.total { stroke: #e5534b; } .lc .pt.total { fill: #e5534b; }
.lc .pt { stroke-width: 6; stroke-opacity: 0; }
.legend .key.opened { background: #3b82f6; } .legend .key.closed { background: #2e9e5b; } .legend .key.total { background: #e5534b; }
.kpi.good { border-top-color: #2e9e5b; } .kpi.good .value { color: #2e9e5b; }
.kpi.bad { border-top-color: #e5534b; } .kpi.bad .value { color: #e5534b; }

/* movable sections */
[data-mod] { position: relative; }
.grip { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: grab; opacity: .45; }
.grip:hover, .grip:focus-visible { opacity: 1; background: var(--surface-2); }
[data-mod].dragging { opacity: .45; outline: 2px dashed var(--accent); }
[data-col] { min-height: 80px; }
.layout-hint { font-size: 13px; margin-top: 14px; }
.lc .ax.start { text-anchor: start; } .lc .ax.end { text-anchor: end; }
.lc .ax.title { font-size: 12px; font-weight: 600; }

/* the ticket clock */
.timer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.timer .clock { font-family: "Red Hat Display", ui-monospace, monospace; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 84px; }
.timer.paused .clock { color: var(--muted); }
.inlineform { display: inline; margin-left: 8px; }
.timelog > div { align-items: baseline; }
/* page header: buttons and status pills sit on one line, each at its own height */
.head .actions { align-items: center; }
.head .actions form { margin: 0; display: inline-flex; }
.head .actions .pill { align-self: center; white-space: nowrap; }

/* clickable chart legend: a key shows or hides its line; a number range goes when all its lines are hidden */
/* plain text with its coloured square, not a button-looking box */
.legend .legkey { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.legend .legkey:hover { text-decoration: underline; }
.legend .legkey:focus-visible { outline: 2px solid var(--allott-blue); outline-offset: 2px; border-radius: 2px; }
.legend .legkey.off:hover { text-decoration: line-through underline; }
.legkey.off { opacity: .45; text-decoration: line-through; }
.lc.hide-opened .opened, .lc.hide-closed .closed, .lc.hide-total .ln.total, .lc.hide-total .pt.total, .lc.hide-total .ax.total { display: none; }
.lc.hide-opened.hide-closed .perday { display: none; }

/* dashboard: two rows of tiles */
.rowhead { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 -4px; font-weight: 600; }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi.warnt { border-top-color: #f0a33a; } .kpi.warnt .value { color: #f0a33a; }
.staleinfo { font-size: 13px; margin-top: -4px; }

/* AI suggestion card: room between its parts, pills and buttons level with each other */
.card.ai { display: flex; flex-direction: column; gap: 14px; }
.card.ai > h2 { margin-bottom: 0; }
.card.ai .actions { align-items: center; gap: 10px; }
.card.ai .actions .pill { align-self: center; }
.card.ai .draft { margin-top: 8px; }
.card.ai details summary { margin-top: 2px; }
/* a closed or voided ticket: its sections are there to read, not to change */
[inert] { opacity: .55; }
.msg header .inlineform { float: right; }

/* a technician's chat with the AI */
.chatlog { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow: auto; }
.chatmsg { border-radius: 3px; padding: 8px 12px; border: 1px solid var(--line-soft); }
.chatmsg.user { background: var(--surface-2); margin-left: 12%; }
.chatmsg.assistant { border-left: 4px solid #7c5cff; margin-right: 6%; }
.chatmsg .who { font-size: 13px; margin-bottom: 2px; }
.chatmsg .body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ticket history */
.histfilter { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.histlog { max-height: 460px; overflow: auto; }
.histlog > div { align-items: baseline; }
.histlog > div[hidden] { display: none; }
.histlog > div.int { background: var(--surface-2); }

/* files on a ticket, the knowledge base */
.msgfiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msgfiles img { max-width: 220px; max-height: 160px; border: 1px solid var(--line-soft); border-radius: 3px; display: block; }
.filechip { border: 1px solid var(--line-soft); border-radius: 3px; padding: 3px 8px; text-decoration: none; }
.kbbody { line-height: 1.55; overflow-wrap: anywhere; }
.kbbody h2, .kbbody h3, .kbbody h4 { margin: 1em 0 0.3em; }
.kbbody img { max-width: 100%; border: 1px solid var(--line-soft); border-radius: 3px; }
.kbbody pre { background: var(--surface-2); padding: 10px 12px; border-radius: 3px; overflow: auto; }
.kbbody code { background: var(--surface-2); padding: 0 4px; border-radius: 2px; }
.kbbody pre code { padding: 0; }
.kbbody blockquote { border-left: 4px solid var(--line-soft); margin: 0.5em 0; padding: 2px 12px; }
.kblist > div { align-items: baseline; }

/* AI text shown formatted: paragraphs, lists, bold */
.formatted { white-space: normal; line-height: 1.5; }
.formatted p { margin: 0 0 0.7em; }
.formatted > :last-child { margin-bottom: 0; }
.formatted ul, .formatted ol { margin: 0 0 0.7em; padding-left: 1.4em; }
.formatted li { margin: 0.15em 0; }
.formatted h2, .formatted h3, .formatted h4 { font-size: 1em; margin: 0.6em 0 0.3em; }
.formatted code { background: var(--surface-2); padding: 0 4px; border-radius: 2px; }
.aisub { font-size: 1.05em; margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.draftbox { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin: 8px 0 4px; }
.draftbox .draft { align-self: stretch; margin-top: 0; }
.chatmsg .linkbtn { font-size: 13px; }

.groupticks { flex-wrap: wrap; gap: 4px 14px; align-items: center; }

/* the call bar (phone system) and a ticket's calls */
.callbar { background: #10291c; border-bottom: 2px solid #2fa66a; padding: 6px 16px; display: flex; flex-direction: column; gap: 6px; }
.callbar[hidden] { display: none; }
.callbar .call { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.callbar .call.ringing .who strong { color: #ffd166; }
.callbar .call.ended { opacity: 0.85; }
.callbar .who { min-width: 0; }
.callbar .last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70ch; }
.callbar .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.callbar .acts input[type=text] { width: 7ch; padding: 3px 6px; margin-right: 4px; }
.callbar .acts form { display: inline-flex; align-items: center; margin: 0; }
.callbar button[disabled] { opacity: 0.45; cursor: not-allowed; }
.callrow { border-top: 1px solid var(--line-soft); padding-top: 8px; }
.callrow:first-of-type { border-top: 0; padding-top: 0; }
.calllines { max-height: 320px; overflow: auto; margin-top: 6px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }

/* the site's own logo on the sign-in page */
.brandmark { display: flex; align-items: center; gap: 12px; justify-content: center; }
.brandmark .brandlogo { width: 44px; height: 44px; object-fit: contain; }

/* a logo with dark parts must stay readable on the dark banner: a light tile behind it */
.top .logo.img { background: #fff; border-radius: 8px; padding: 3px; box-sizing: border-box; }
.top .logo.img img { width: 26px; height: 26px; display: block; }
.login .brandmark img { background: #fff; border-radius: 16px; padding: 8px; box-sizing: border-box; }

/* the phone in the top banner, between the name and the search box */
.top .topcall { display: flex; flex-direction: column; gap: 4px; margin-left: 22px; min-width: 0; flex: 1 1 auto; }
.top .topcall .call { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.top .topcall .who { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46ch; }
.top .topcall .last { margin-left: 10px; font-size: 13px; color: var(--muted); font-style: italic; }
.top .topcall form { display: inline-flex; align-items: center; margin: 0; gap: 4px; }
.top .topcall input[type=text] { width: 7ch; padding: 3px 6px; }
.top .topcall button[disabled] { opacity: 0.45; cursor: not-allowed; }
.phonechip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; align-self: flex-start; }
.phonechip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #7d8590; }
.phonechip.idle::before { background: #2fa66a; }
.phonechip.live { border-color: #2fa66a; color: #7ee2a8; }
.phonechip.live::before { background: #2fa66a; box-shadow: 0 0 0 3px rgba(47, 166, 106, 0.25); }
.phonechip.ring { border-color: #d9a400; color: #ffd166; }
.phonechip.ring::before { background: #ffd166; }
.top .topcall .call .phonechip { align-self: center; }

/* a call's statistics on the ticket (closed until asked for) */
.callstats { margin-top: 6px; font-size: 14px; }
.callstats summary { cursor: pointer; color: var(--muted); }
.statgrid { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 8px 0; overflow-wrap: anywhere; }
.stattimeline { max-height: 260px; overflow: auto; }

/* every one-line field is the same height, so boxes side by side sit level whatever their labels look like */
input[type=text], input[type=email], input[type=search], input[type=number], input[type=date], input[type=password], select {
  box-sizing: border-box; height: 42px; min-height: 42px; }
.row > label { justify-content: flex-end; }
.top input[type=search], .callbar input[type=text], .top .topcall input[type=text] { height: auto; min-height: 0; }

/* reports, dashboard set-up */
.reportgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
input.narrow { width: 6ch; }

/* an open emergency: the top banner turns red for everyone */
.top.emergency { background: #8f1414; border-bottom-color: #ff5b5b; }
.top .emergencylink { flex: 1 1 auto; text-align: center; color: #fff; font-weight: 800; letter-spacing: .12em; text-decoration: none; font-size: 15px; }
.top .emergencylink:hover { text-decoration: underline; }
.emergencyflash { border-left-width: 6px; }
.btn.danger { border-color: #c0392b; color: #ffb4a8; }

/* Field labels: the space above a field belongs to the field itself, not to "between every two things in the label".
   A password manager adds an invisible element next to a field; with a gap between all children that element pushed
   the field up by a few pixels, so boxes side by side were not level. */
label { gap: 0; }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { margin-top: 4px; }
label > .muted { margin-top: 2px; }
label.inline { gap: 8px; }
label.inline > input { margin-top: 0; }
label > div[data-lastpass-icon-root], label > div[data-lastpass-root], label > com-1password-button, label > [data-bitwarden-watching] { position: absolute; }

.top .emergencylink[hidden] { display: none; }
.flash.warnflash { border-left: 4px solid #d9a400; }
.flash.warnflash .actions { margin-top: 8px; gap: 8px; }

/* tables of fields: every cell's content in the middle of its row, fields filling their cell */
table.table td { vertical-align: middle; }
table.table td > input[type=text], table.table td > select { width: 100%; margin: 0; }
table.table td > label.inline { margin: 0; }

/* lists where several can be chosen: show several rows */
select[multiple] { height: auto !important; min-height: 7em; padding: 4px; }

/* a heading with its button on the right; small forms that may wrap */
.row.spread { justify-content: space-between; align-items: flex-start; }
.row.tight.wrap { flex-wrap: wrap; align-items: flex-end; }

/* password managers that ignore the "leave this alone" marks put their icon next to a field, which pushed table cells
   out of line: whatever they put into the page is hidden */
[data-lastpass-icon-root], [data-lastpass-root], div[id^="__lpform_"], com-1password-button, [data-bitwarden-watching="true"] + span { display: none !important; }
/* a dropdown of tick boxes (several can be chosen) */
details.multiselect { position: relative; }
details.multiselect > summary { list-style: none; cursor: pointer; font-size: 14px; padding: 9px 32px 9px 12px; border: 1px solid var(--line); border-bottom: 2px solid var(--line);
  border-radius: 3px; background: var(--input-bg); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 40px; box-sizing: border-box; position: relative; }
details.multiselect > summary::-webkit-details-marker { display: none; }
details.multiselect > summary::after { content: "BE"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); opacity: .7; }
details.multiselect[open] > summary { border-bottom-color: var(--allott-blue); }
details.multiselect .multiselect-list { position: absolute; z-index: 20; left: 0; right: 0; margin-top: 4px; max-height: 260px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 6px 10px; box-shadow: var(--shadow); }
details.multiselect .multiselect-list label { display: flex; gap: 8px; align-items: center; padding: 4px 0; margin: 0; }
