/* RxTech PSA. The six RxTech colors, same as the website; borders are a blend of Muted.
   Accent (royal blue, the Rx color since 2026-10-05) is only used for large things (buttons, logo,
   checkboxes, underlines), never small text: it's 3.8:1 on black, too low for small text. */

:root {
  --background: #0b0b0b; --surface: #171717; --text: #ededed; --muted: #a3a3a3; --accent: #2563eb; --on-accent: #ffffff;
  --line: color-mix(in srgb, var(--muted) 28%, var(--background));
  color-scheme: dark;
}
@font-face { font-family: 'Bruno Ace'; src: url(fonts/BrunoAce-Regular.woff2) format('woff2'); font-display: swap; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font-family: system-ui, -apple-system, 'Segoe UI', Ubuntu, sans-serif; line-height: 1.45; min-height: 100vh; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled, input:disabled { opacity: .55; cursor: not-allowed; }
.primary { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 10px; padding: 0 20px; font-weight: 600; min-height: 46px; text-decoration: none; }
.link { background: none; border: 0; padding: 4px 2px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.note { background: var(--surface); border: 2px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.note[hidden] { display: none; }

/* Top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand .logo { height: 26px; width: auto; }
.brand span { font-family: 'Bruno Ace', sans-serif; color: var(--muted); font-size: .95rem; padding-top: 6px; }
.me { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); font-size: .92rem; min-width: 0; }
.me button { white-space: nowrap; }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h1 { margin: 0; font-family: 'Bruno Ace', sans-serif; font-weight: 400; font-size: clamp(1.9rem, 7vw, 2.6rem); line-height: 1.1; }
#left { color: var(--muted); text-align: right; white-space: nowrap; }
#left b { color: var(--text); font-size: 1.5rem; margin-right: 5px; }

/* Inputs */
input[type=text], input[type=search], input[type=date], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 0 12px; min-height: 46px; max-width: 100%;
}
input[type=text], input[type=search] { padding: 12px 14px; font-size: 1.02rem; }
textarea { padding: 10px 12px; width: 100%; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: var(--text); }

.add { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.add #new { flex: 1 1 100%; min-width: 0; }
.add > * { flex: 0 1 auto; }
.add #ticketNew { max-width: 260px; }

.who { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 2px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 3px; color: var(--muted); font-size: .92rem; max-width: 100%; min-width: 0; }
.who .av { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-content: center; background: var(--text); color: var(--background); font-size: .72rem; font-weight: 700; }
.who .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed var(--line); flex: none; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who.set { color: var(--text); }
.add .who { min-height: 46px; padding-right: 16px; }

.projects { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.projects button { flex: none; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 6px 14px; font-weight: 600; color: var(--muted); }
.projects button[aria-pressed=true] { background: var(--text); border-color: var(--text); color: var(--background); }
.projects .newp { border-style: dashed; }

.filters { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.filters button { background: transparent; color: var(--muted); border: 2px solid transparent; border-radius: 999px; padding: 6px 14px; font-weight: 600; }
.filters button[aria-pressed=true] { color: var(--text); border-color: var(--text); }

/* The list */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.list > li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .body { flex: 1 1 14rem; min-width: 0; }
.list input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border: 2px solid var(--muted); border-radius: 7px; display: grid; place-content: center; cursor: pointer; }
.list input:checked { background: var(--accent); border-color: var(--accent); }
.list input:checked::after { content: ""; width: 6px; height: 11px; border: solid var(--on-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.t { background: none; border: 0; padding: 0; text-align: left; font-size: 1rem; color: var(--text); overflow-wrap: anywhere; position: relative; }
.t:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
li.done .t { color: var(--muted); text-decoration: line-through; }
.meta { font-size: .85rem; color: var(--muted); margin-top: 2px; }
a.ext { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
a.ext:hover { text-decoration-thickness: 2px; }
.hint { color: var(--muted); font-size: .8rem; }
input[type=url] { font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 46px; width: 100%; margin-top: 4px; }
input[type=url]:focus-visible { outline: 0; border-color: var(--text); }
details.notes { font-size: .88rem; color: var(--muted); margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
details.notes summary { cursor: pointer; width: max-content; }
li.done details.notes { display: none; }
button.tog { background: none; border: 0; padding: 4px 0; margin-top: 2px; color: var(--muted); font-size: .88rem; font-weight: 600; }
button.tog:hover { color: var(--text); }
.side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; max-width: 100%; }
select.pm { min-height: 34px; padding: 0 8px; border-radius: 999px; font-size: .88rem; color: var(--muted); max-width: 11rem; }
input.dd { min-height: 34px; padding: 0 8px; border-radius: 999px; font-size: .88rem; }
input.dd.none { color: var(--muted); border-style: dashed; }
input.dd.late { border-color: var(--accent); font-weight: 700; }
.list .who { min-height: 34px; }
.del { background: none; border: 0; color: var(--muted); font-size: 1.4rem; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.del:hover { color: var(--text); background: var(--background); }
.empty { padding: 26px 16px; color: var(--muted); text-align: center; display: block; width: 100%; }
@media (max-width: 560px) {
  .list .body { flex-basis: calc(100% - 48px); }
  .side { flex: 1 1 100%; margin-left: 36px; justify-content: flex-start; }
  .side .del { margin-left: auto; }
}

/* Comments: outline bubble when empty, filled with a count when there are comments */
.cbtn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 2px solid transparent; border-radius: 999px; padding: 4px 8px; color: var(--muted); min-height: 34px; font-size: .88rem; font-weight: 700; }
.cbtn svg { width: 20px; height: 20px; }
.cbtn:hover { color: var(--text); }
.cbtn.has { color: var(--text); }
.cbtn.open { border-color: var(--line); background: var(--background); }
.thread { flex: 1 1 100%; margin-left: 36px; padding: 10px 12px; background: var(--background); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.cmts { list-style: none; margin: 0 0 10px; padding: 0; }
.cmts > li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.cmts > li:last-child { border-bottom: 0; }
.chead { font-size: .85rem; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.ctext { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.cdel { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; padding: 0 2px; }
.cdel:hover { color: var(--text); }
.cform { display: flex; gap: 8px; align-items: flex-end; }
.cform textarea { flex: 1; min-height: 46px; }
.primary.small { min-height: 40px; padding: 0 14px; }
@media (max-width: 560px) { .thread { margin-left: 0; } .cform { flex-direction: column; align-items: stretch; } }

footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; min-height: 30px; }

/* Dialogs */
dialog { background: var(--surface); color: var(--text); border: 2px solid var(--line); border-radius: 14px; padding: 18px; width: min(92vw, 420px); }
dialog::backdrop { background: rgb(0 0 0 / .6); }
dialog h2 { margin: 0 0 12px; font-size: 1.15rem; }
dialog input[type=text], dialog input[type=search] { width: 100%; }
dialog label { display: block; color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
dialog label > input, dialog label > textarea, dialog label > select { margin-top: 4px; color: var(--text); }
dialog label[hidden] { display: none; }
#tTicket { width: 100%; }
.inline { display: flex; gap: 8px; margin-top: 4px; }
.inline button { background: var(--background); border: 2px solid var(--line); border-radius: 10px; padding: 0 16px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; }
#res { list-style: none; margin: 10px 0; padding: 0; max-height: 260px; overflow: auto; }
#res button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 10px; padding: 8px; text-align: left; }
#res button:hover { background: var(--background); }
#res .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-content: center; background: var(--text); color: var(--background); font-size: .75rem; font-weight: 700; flex: none; }
#res small { color: var(--muted); }

/* Sign-in page */
.signin { display: grid; place-items: center; padding: 24px 16px; }
.signin-box { width: min(100%, 420px); text-align: center; }
.signin-box .logo { width: 100%; max-width: 300px; height: auto; margin-bottom: 18px; }
.signin-box h1 { margin-bottom: 24px; }
.dev { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 12px; }
.dev button { background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 8px 14px; margin: 4px; }

/* Section links in the top bar */
.bar { flex-wrap: wrap; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1 1 auto; min-width: 0; order: 0; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a[aria-current=page] { color: var(--text); background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 760px) { .nav { order: 3; flex-basis: 100%; } }

/* PSA pages (tickets, clients, assets, invoices) */
:where(#view) a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
main.wide { max-width: 1440px; padding-left: 24px; padding-right: 24px; } /* the PSA pages use most of a wide screen */
.narrow { max-width: 640px; }
.vhead { margin-bottom: 18px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.back:hover { color: var(--text); }
.vtitle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vtitle h1 { font-size: clamp(1.4rem, 5vw, 2rem); margin-right: auto; overflow-wrap: anywhere; min-width: 0; }
.count { color: var(--muted); }
.ghost { display: inline-flex; align-items: center; background: var(--surface); color: var(--text); border: 2px solid var(--line); border-radius: 10px; padding: 0 14px; min-height: 40px; font-weight: 600; text-decoration: none; }
.ghost:hover { border-color: var(--muted); }
.danger { text-decoration-color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { flex: 1 1 14rem; min-width: 0; }
.toolbar select { min-height: 42px; }
.seg { display: inline-flex; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 2px; }
.seg button { background: none; border: 0; border-radius: 8px; padding: 6px 12px; color: var(--muted); font-weight: 600; }
.seg button[aria-pressed=true] { background: var(--text); color: var(--background); }
label.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; }

.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.rows > li { border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.rows > li.empty { padding: 20px 16px; }
.rowlink { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; width: 100%; padding: 12px 16px; color: var(--text); text-decoration: none; background: none; border: 0; text-align: left; }
.rowlink:hover { background: var(--background); }
.rmain { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
.rside { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.num { color: var(--muted); font-variant-numeric: tabular-nums; }
.amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.rside .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-content: center; background: var(--text); color: var(--background); font-size: .72rem; font-weight: 700; font-style: normal; }
.rside .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px dashed var(--line); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.badge.quiet, .badge.closed, .badge.resolved, .badge.i-void { color: var(--muted); }
.badge.open, .badge.i-sent { border-color: var(--text); }
.badge.in_progress, .badge.i-draft { background: var(--text); color: var(--background); border-color: var(--text); }
.badge.waiting { border-style: dashed; border-color: var(--muted); }
.badge.p-low { color: var(--muted); }
.badge.p-high { border: 2px solid var(--accent); }
.badge.p-urgent, .badge.late { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.badge.p-critical { background: var(--text); color: var(--background); border-color: var(--text); text-transform: uppercase; letter-spacing: .04em; } /* above Urgent: needed to go live */
.badge.i-paid { border-color: var(--muted); }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.card { margin: 18px 0 0; }
.cols .card { margin: 0; }
.chd { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.chd h2 { font-size: 1.1rem; margin: 0 auto 0 0; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); margin: 0 0 8px; }
.addr { white-space: pre-line; color: var(--muted); margin: 0 0 8px; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.fld { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .88rem; min-width: 0; }
.fld > span { font-weight: 600; }
.fld select, .fld input { width: 100%; min-height: 42px; }
.fld.wide { margin: 0 0 12px; }
.fld.check { flex-direction: row; align-items: center; align-self: end; min-height: 42px; }
.fld a, .fld.check { color: var(--text); }
.fld textarea { min-height: 70px; }
.fields .fld > a { min-height: 42px; display: flex; align-items: center; }
input[type=email], input[type=tel], input[type=number], input[type=time] { font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 0 12px; min-height: 46px; max-width: 100%; }
input[type=email]:focus-visible, input[type=tel]:focus-visible, input[type=number]:focus-visible, input[type=time]:focus-visible { outline: 0; border-color: var(--text); }
input[type=text], input[type=url] { max-width: 100%; }
.fld input[type=text] { padding: 0 12px; font-size: 1rem; }

.tablewrap { overflow-x: auto; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.tbl .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .c { text-align: center; }
.tbl td .del { font-size: 1.2rem; }
.lines input[type=text] { width: 100%; min-height: 40px; padding: 0 10px; font-size: .95rem; min-width: 12rem; }
.lines input.num { width: 6.5rem; min-width: 0; text-align: right; }
.linebar { margin: 10px 0; }
.timeform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.timeform input[type=text] { padding: 0 12px; min-height: 42px; font-size: 1rem; }
.timeform input[placeholder="What was done"] { flex: 1 1 12rem; }
.timeform input[type=date] { min-height: 42px; }
.totals { margin: 12px 0 12px auto; border-collapse: collapse; min-width: 260px; font-variant-numeric: tabular-nums; }
.totals th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 16px 4px 0; }
.totals td { text-align: right; padding: 4px 0; }
.totals .grand th, .totals .grand td { color: var(--text); font-size: 1.15rem; font-weight: 700; border-top: 2px solid var(--line); padding-top: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; color: var(--muted); }
.tile b { color: var(--text); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.tile.late { border-color: var(--accent); }

dialog select, dialog input[type=email], dialog input[type=tel], dialog input[type=date], dialog input[type=time], dialog input[type=number] { width: 100%; margin-top: 4px; }
dialog form { margin: 0; }
#fFields { max-height: min(62vh, 640px); overflow: auto; padding: 2px; }
dialog label.check { color: var(--text); margin-bottom: 12px; display: flex; }
.ferr { color: var(--text); border-left: 4px solid var(--accent); padding: 6px 10px; background: var(--background); border-radius: 6px; margin: 8px 0 0; }
.ferr[hidden] { display: none; }
main.wide .note .link { padding: 0; }

/* Printable invoice (/invoice): a white sheet on screen, just the sheet on paper. */
.print-page { background: var(--background); }
.print-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 820px; margin: 0 auto; padding: 16px; }
.paper { --text: var(--background); --muted: var(--surface); color-scheme: light; position: relative; background: var(--on-accent); color: var(--text); max-width: 820px; margin: 0 auto 40px; padding: 48px 52px; border-radius: 6px; font-size: .95rem; }
.paper .p-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.paper .p-logo { width: 260px; max-width: 100%; height: auto; display: block; margin-bottom: 12px; }
.paper .p-from { margin: 0; line-height: 1.5; }
.paper h1 { font-family: 'Bruno Ace', sans-serif; font-weight: 400; font-size: 2rem; margin: 0 0 8px; text-align: right; }
.paper .p-meta table { border-collapse: collapse; margin-left: auto; }
.paper .p-meta th { text-align: left; padding: 2px 16px 2px 0; font-weight: 600; }
.paper .p-meta td { text-align: right; }
.paper h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 4px; }
.paper .p-to p { margin: 0 0 24px; line-height: 1.5; }
.paper .p-lines { width: 100%; border-collapse: collapse; }
.paper .p-lines th { text-align: left; border-bottom: 2px solid var(--text); padding: 8px 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.paper .p-lines td { border-bottom: 1px solid color-mix(in srgb, var(--surface) 25%, var(--on-accent)); padding: 9px 6px; vertical-align: top; }
.paper .n, .paper .p-lines th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.paper .p-tot { margin: 16px 0 0 auto; border-collapse: collapse; min-width: 280px; font-variant-numeric: tabular-nums; }
.paper .p-tot th { text-align: left; font-weight: 400; padding: 4px 20px 4px 0; }
.paper .p-tot td { text-align: right; padding: 4px 6px; }
.paper .p-tot .grand th, .paper .p-tot .grand td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--text); padding-top: 8px; }
.paper .p-notes { white-space: pre-line; margin: 28px 0 0; }
.paper .p-foot { margin: 28px 0 0; padding-top: 14px; border-top: 4px solid var(--accent); }
.paper .stamp { position: absolute; top: 18px; left: 50%; transform: translateX(-50%) rotate(-4deg); margin: 0; border: 4px solid var(--accent); color: var(--text); padding: 2px 18px; font-family: 'Bruno Ace', sans-serif; font-size: 1.5rem; text-transform: uppercase; }
@media (max-width: 600px) { .paper { padding: 24px 18px; } .paper h1 { text-align: left; } .paper .p-meta table { margin-left: 0; } }
@media print {
  @page { margin: 14mm; }
  .print-page { background: var(--on-accent); }
  .print-bar { display: none; }
  .paper { margin: 0; padding: 0; max-width: none; border-radius: 0; }
}

/* Bills and chart of accounts */
.blines select { min-width: 11rem; min-height: 40px; padding: 0 8px; font-size: .92rem; }
.blines input[type=text] { min-width: 10rem; }
.tbl tr.muted td { color: var(--muted); }
.tbl td.num { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td .link { padding: 0; text-align: left; color: var(--text); }
.card .primary { min-height: 40px; }

/* To-dos on a ticket */
.todos > li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; flex-wrap: wrap; }
.todo { display: flex; align-items: center; gap: 10px; flex: 1 1 14rem; min-width: 0; cursor: pointer; overflow-wrap: anywhere; }
.todos li.done .todo span { color: var(--muted); text-decoration: line-through; }
.todos .rside { margin-left: auto; }
.timeform input[aria-label^="New to-do"] { flex: 1 1 14rem; }
.meta.lateTxt { color: var(--text); font-weight: 700; border-bottom: 2px solid var(--accent); }
/* Plan my days */
.filters #planBtn { margin-left: auto; border-radius: 10px; border-color: var(--line); color: var(--text); min-height: 36px; }
input.dd.fixed { border-style: solid; border-color: var(--text); }
.wklist { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; font-size: .9rem; }
.wklist b { display: inline-block; width: 2.6em; }
/* Over capacity: the To do page note and the assignee picker */
.note.over { border-left-color: var(--text); }
#res .pinfo { display: flex; flex-direction: column; margin-left: auto; text-align: right; }
#res small.over { color: var(--text); font-weight: 700; }
#sOut ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
#sOut li { padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: .88rem; }
#sOut li:last-child { border-bottom: 0; }
#sOut p { margin: 10px 0 0; font-size: .9rem; }
/* Task priority badge, next to the task text */
.list .body > .badge, .todo .badge { margin-left: 8px; vertical-align: 1px; }
/* Ticket link on the To do list */
a.tkt { font-size: .85rem; color: var(--muted); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a.tkt:hover { color: var(--text); }

.lines select { min-width: 9rem; min-height: 40px; padding: 0 8px; font-size: .92rem; }

.rows > li.withact { display: flex; align-items: center; gap: 8px; padding-right: 14px; }
.withact .rowlink { flex: 1; min-width: 0; }

/* Timesheet */
.week { min-width: 12rem; text-align: center; }
.ts th.today { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.ts tr.tot td { border-top: 2px solid var(--line); }
.ts td:first-child { min-width: 14rem; }

/* KBA library: the KBA's own page, shown locked down in a frame */
.kbframe { display: block; width: 100%; height: calc(100vh - 230px); min-height: 480px; border: 1px solid var(--line); border-radius: 12px; background: var(--background); }

/* Client page tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin: 4px 0 18px; }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current=page] { color: var(--text); border-bottom-color: var(--accent); }
.tbl.kv th { width: 34%; font-weight: 600; }

/* Purchase order lines: seven columns, kept within the page */
.polines input[type=text] { min-width: 8rem; }
.polines select { min-width: 0; max-width: 11rem; }
.polines td:first-child select { max-width: 8rem; }

/* Timesheet widget (Today button in the top bar) and Work hours */
.me .tsbtn { color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 4px 12px; min-height: 36px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.me .tsbtn:hover { border-color: var(--muted); }
.me .tsbtn.on { border-color: var(--accent); }
.me .tsbtn.on::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text); margin-right: 8px; vertical-align: 1px; }
dialog.tsw, dialog.wkdlg { width: min(92vw, 560px); }
.tsday { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tsday label { margin: 0; }
.tsday input { width: 100%; }
.ghost.small { min-height: 32px; padding: 0 10px; margin-top: 6px; font-size: .85rem; }
.tsw .tiles { grid-template-columns: repeat(3, 1fr); margin: 14px 0 8px; }
.tsw .tile { padding: 8px 10px; }
.tsw .tile b { font-size: 1.1rem; }
.tslist { list-style: none; margin: 10px 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; max-height: 30vh; overflow: auto; }
.tslist li { display: flex; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.tslist li:last-child { border-bottom: 0; }
.tslist a { color: var(--text); }
.tslist b { margin-left: auto; white-space: nowrap; }
.tsadd { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.tsadd select { flex: 1 1 100%; }
.tsadd input[type=text] { width: auto; }
.tsadd input[size] { flex: 0 0 6.5rem; }
.tsadd input[maxlength] { flex: 1 1 10rem; }
.tsadd label.check { margin: 0; }
.wkdays { display: grid; grid-template-columns: 1fr; gap: 6px; }
.wkdays label { display: grid; grid-template-columns: 3em 1fr; align-items: center; margin: 0; }
.wkdays label > input { margin: 0; }
.wktwo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.wktwo input { width: 100%; }
.ts tr.daylog td { color: var(--muted); font-size: .88rem; }
.ts tr.tot + tr.daylog td { border-top: 2px solid var(--line); }
.ts tr.daylog .link { padding: 0; }
@media (max-width: 560px) { .tsday, .wktwo { grid-template-columns: 1fr; } .tsw .tiles { grid-template-columns: 1fr 1fr 1fr; } }
/* Day view (Today button) */
.tsnav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tsnav h2 { margin: 0; flex: 1; text-align: center; }
.tsnav .ghost.small { margin: 0; min-width: 40px; justify-content: center; font-size: 1.1rem; }
.tsh { margin: 16px 0 6px; font-size: .95rem; }
.tsh .muted { font-weight: 400; font-size: .85rem; }
.tssched, .tsbook { list-style: none; margin: 0 0 6px; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.tssched li, .tsbook li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.tssched li:last-child, .tsbook li:last-child { border-bottom: 0; }
.tssched .tm { min-width: 10.5rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.tssched li.busy { border-left: 4px solid var(--text); }
.tssched li.work { border-left: 4px solid var(--accent); }
.tsbook a { color: var(--text); }
.tsbook b { margin-left: auto; white-space: nowrap; }
.tsbook label.check { margin: 0; flex: 1; color: var(--text); }
dialog .tsbook select { width: auto; flex: none; min-height: 32px; padding: 0 6px; margin: 0 0 0 auto; }
.tslist li { flex-wrap: wrap; }
.tslist li > a { flex: 1 1 100%; }
.tsedit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 100%; }
.tsedit input[type=text] { min-height: 34px; padding: 4px 8px; font-size: .9rem; }
.tsedit .tmin { width: 5rem; }
.tsedit .tnote { flex: 1 1 8rem; }
.tsedit label.check { margin: 0; color: var(--text); }
.tsedit .del { background: none; border: 0; color: var(--muted); font-size: 1.2rem; padding: 0 6px; }
.tsedit .del:hover { color: var(--text); }
/* Hours and minutes (ticket estimates) */
.hmbox { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.hmbox input { width: 5.5rem !important; }
.hmbox span { color: var(--muted); }
/* Small summary boxes (day view, timesheet) and the timesheet's day boxes */
.tiles.mini { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.tiles.mini .tile { padding: 8px 10px; font-size: .82rem; }
.tiles.mini .tile b { font-size: 1.05rem; }
.tile.over { border-color: var(--text); }
.dayboxes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; } /* the week in one row */
@media (max-width: 900px) { .dayboxes { grid-template-columns: 1fr; } } /* stacked on phones and small tablets */
.daybox { background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: .85rem; }
.daybox.today { border-color: var(--accent); }
.daybox h3 { margin: 0 0 2px; font-size: .95rem; }
.daybox .se { color: var(--muted); padding: 0; text-align: left; margin-bottom: 4px; font-size: .82rem; }
.daybox .dl { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); }
.daybox .dl b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.daybox .dl.over b { font-weight: 800; }
.daybox .more { margin-top: auto; padding-top: 8px; align-self: flex-start; }
/* The day in time order */
.tssched li.brk { border-left: 4px dashed var(--muted); }
.tssched li.day { border-left: 4px solid var(--muted); color: var(--muted); }
.tssched li.entry { border-left: 4px solid var(--on-accent); }
.tssched li .dur { margin-left: auto; font-size: .82rem; }
.tssched button.entry { background: none; border: 0; padding: 0; text-align: left; color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; flex: 1; }
.tssched li > b { margin-left: auto; white-space: nowrap; }
dialog.tmdlg { width: min(92vw, 480px); }
#tmTicketName { margin: 0 0 12px; }
/* Projects: the ticket tree */
.rows li.tree { display: flex; align-items: stretch; }
.rows li.tree > .rowlink { flex: 1; min-width: 0; }
button.kids { background: none; border: 0; border-right: 1px solid var(--line); color: var(--text); font-size: 1.2rem; width: 40px; flex: none; }
button.kids:hover { background: var(--background); }
/* Task timer and Claim on the task list */
.side .timer { background: var(--surface); border: 2px solid var(--line); border-radius: 999px; min-height: 34px; min-width: 34px; padding: 0 10px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.side .timer.on { border-color: var(--accent); font-weight: 700; }
.side .claim { background: none; border: 2px solid var(--line); border-radius: 999px; min-height: 34px; padding: 0 12px; font-size: .85rem; font-weight: 600; }
.side .claim:hover, .side .timer:hover { border-color: var(--muted); }
dialog.cldlg { width: min(92vw, 440px); }
#clName { font-weight: 600; margin: 0 0 10px; }
#clWho { margin: 0 0 12px; }
/* Email templates */
.fieldhelp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 12px; }
button.chipb { background: var(--background); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
button.chipb:hover { border-color: var(--muted); }
.emaillog summary { cursor: pointer; list-style: none; }
.emaillog .desc { margin: 8px 0 0; }
.fieldtables { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 0 16px; }
@media (max-width: 520px) { .fieldtables { grid-template-columns: 1fr; } }
.fieldtables code { font-size: .85rem; white-space: nowrap; }
.p-for { margin: 6px 0 0; }
/* Next / previous page under a long list (KBAs) */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.pager .ghost.small { margin: 0; }
/* Due-date filters and counts (To do, Tickets) */
.filters .fsep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.dueinfo { margin: 0 0 10px; }
/* My week */
.weekboxes .daybox { min-height: 160px; }
.wklist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wkitem { display: flex; gap: 6px; align-items: baseline; font-size: .84rem; line-height: 1.3; }
.wkitem .badge { flex: none; font-size: .68rem; }
.wktext { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wktext a { color: var(--text); }
.wkitem .amt { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.wkitem.late .wktext a { text-decoration-color: var(--text); }
.lateflag { color: var(--text); }
.kbused { margin: 0 0 12px; } .kbused summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.kblist { list-style: none; margin: -4px 0 12px; padding: 0; } .kblist li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.kblist a { color: var(--text); text-underline-offset: 3px; }
