:root {
  --bg: #f6f6f3; --surface: #ffffff; --text: #1f1f1d; --muted: #6b6a65; --border: #e2e0d8;
  --accent: #3c3489; --accent-soft: #eeedfe; --ok: #0f6e56; --ok-soft: #e1f5ee;
  --warn: #854f0b; --warn-soft: #faeeda; --err: #a32d2d; --err-soft: #fcebeb;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 16px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 6px; }

.top { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 6px; }
.top nav a.active, .top nav a:hover { background: var(--accent-soft); color: var(--accent); }
.right { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
main { max-width: 1280px; margin: 0 auto; padding: 24px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.center { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login { width: min(360px, 92vw); }
.err { color: var(--err); margin: 12px 0 0; }

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], input:not([type]), select, input[type=file] {
  width: 100%; padding: 9px 10px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
button { font: inherit; cursor: pointer; border-radius: 8px; padding: 9px 14px; border: 1px solid var(--border); background: #fff; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); margin-top: 16px; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
button:disabled { opacity: .5; cursor: default; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-decoration: none; color: var(--text); position: relative; }
a.tile:hover { border-color: var(--accent); }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile.soon { opacity: .6; }
.badge { position: absolute; top: 12px; right: 12px; font-size: 11px; background: var(--border); border-radius: 99px; padding: 2px 8px; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.notes { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }

.status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar { flex: 1; min-width: 200px; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }

.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.filters label { margin: 0 0 4px; }
.filters .f input, .filters .f select { width: 170px; }
.filters .check { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; padding-bottom: 9px; }
.actions { display: flex; gap: 8px; margin-left: auto; }
.count { color: var(--muted); font-size: 13px; margin: 12px 0 8px; }

.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 12px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #fafaf7; font-weight: 600; position: sticky; top: 0; }
td.num { font-variant-numeric: tabular-nums; }
td.up { color: var(--ok); }
td.down { color: var(--err); }
td.flag { color: var(--muted); }
tr:last-child td { border-bottom: 0; }

.runs td a { text-decoration: none; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.running, .pill.queued { background: var(--accent-soft); color: var(--accent); }
.pill.failed, .pill.interrupted { background: var(--err-soft); color: var(--err); }

.picker-actions { display: flex; gap: 8px; margin: 8px 0 12px; }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.col { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-weight: 500; cursor: pointer; }
.col:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.col.disabled { cursor: default; opacity: .7; }
.col .hint { margin: 0 0 0 auto; font-weight: 400; }

.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead h1 { margin: 0; }
.btn { display: inline-block; text-decoration: none; color: var(--text); border: 1px solid var(--border); background: #fff;
  border-radius: 8px; padding: 9px 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.filters .f.grow { flex: 1; min-width: 240px; }
.filters .f.grow input { width: 100%; }
table.contacts td.long { min-width: 220px; max-width: 320px; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 16px 0; }
.formgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.formgrid .full { grid-column: 1 / -1; }
textarea { width: 100%; padding: 9px 10px; font: inherit; border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
.formactions { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.formactions .primary { margin-top: 0; }
form.inline { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
button.danger { color: var(--err); border-color: var(--err-soft); background: var(--err-soft); }
input[type=radio] { margin: 0; }

.searchrow { display: flex; gap: 8px; flex-wrap: wrap; }
.searchrow input { flex: 1; min-width: 240px; }
.searchrow select { width: auto; }
.georow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.georow .geo { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 99px; font-weight: 600; font-size: 13px; cursor: pointer; background: #fff; }
.georow .geo.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.georow .geo.none { font-weight: 500; color: var(--muted); }
.georow .geo .n { font-weight: 400; color: var(--muted); font-size: 12px; }
.georow .geo input { margin: 0; }
.filterrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.filterrow select, .filterrow input { width: auto; min-width: 150px; }
.filterbar { display: flex; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.colpick { position: relative; margin-left: auto; }
.colpick summary { cursor: pointer; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; list-style: none; }
.colpick[open] #colList { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; min-width: 220px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.colpick .check { padding: 4px 0; font-weight: 500; }
.selbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 8px; }
.selbar .count { margin: 0; }
.selbar .actions { flex-wrap: wrap; }
button.primarybtn { background: var(--accent); color: #fff; border-color: var(--accent); }
th.selcol, td.selcol { width: 36px; padding-left: 12px; padding-right: 4px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
tr.picked td { background: var(--accent-soft); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.pager .pinfo { margin-right: auto; }
.pager .view { width: auto; }
.sentinel { height: 1px; }
.quickrow { display: flex; gap: 8px; flex-wrap: wrap; }
.quickrow input[type=text] { flex: 1; min-width: 220px; }
.quickrow input.selsearch { flex: 0 0 150px; min-width: 0; }
.quickrow select { width: auto; }
.card h2 { margin-bottom: 10px; }
.topscroll { overflow-x: auto; overflow-y: hidden; height: 14px; margin-bottom: 6px; }
.topscroll > div { height: 1px; }
/* always-visible scrollbars on wide tables (also on systems that hide them until you scroll) */
.topscroll, .tablewrap { scrollbar-width: thin; scrollbar-color: #b9b6aa transparent; }
.topscroll::-webkit-scrollbar, .tablewrap::-webkit-scrollbar { height: 12px; }
.topscroll::-webkit-scrollbar-thumb, .tablewrap::-webkit-scrollbar-thumb { background: #c9c6bb; border-radius: 99px; border: 3px solid var(--bg); }
.topscroll::-webkit-scrollbar-thumb:hover, .tablewrap::-webkit-scrollbar-thumb:hover { background: #a9a69b; }
.topscroll::-webkit-scrollbar-track, .tablewrap::-webkit-scrollbar-track { background: transparent; }

.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.warn a { color: var(--warn); font-weight: 600; }
.duplist { margin: 6px 0; padding-left: 18px; }
.dup { display: inline-block; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--border);
  border-radius: 99px; padding: 1px 7px; vertical-align: middle; }
.filterbar .check { margin: 0; }

.summary { font-size: 15px; margin: 0 0 12px; }
table.report td { white-space: normal; }
table.report td.old { color: var(--err); text-decoration: line-through; }
table.report td.new { color: var(--ok); font-weight: 600; }
.reportlist { margin: 12px 0; }
.reportlist summary { cursor: pointer; font-weight: 600; }
.reportlist ul { margin: 8px 0; padding-left: 20px; max-height: 320px; overflow: auto; }

.maprows { display: grid; gap: 8px; margin-bottom: 12px; }
.maprow { display: grid; grid-template-columns: minmax(140px, 220px) minmax(100px, 1fr) 20px minmax(180px, 260px); align-items: center; gap: 10px; }
.maprow .mapsrc { font-weight: 600; }
#addPanel h2 { margin-top: 8px; }

@media (max-width: 700px) {
  .maprow { grid-template-columns: 1fr; }
  .colpick { margin-left: 0; }
  .formgrid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; }
  main { padding: 16px; }
  .actions { margin-left: 0; }
}

/* full-width pages (Contacted websites, scan results): the table uses the whole screen */
main.wide { max-width: none; padding: 20px 24px; }
table.contacts { font-size: 13.5px; }
table.contacts th, table.contacts td { padding: 6px 9px; }
table.contacts th { white-space: normal; min-width: 56px; line-height: 1.25; }
table.contacts td.mid { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
table.contacts th.sortable { min-width: 64px; }
.credit { margin: 8px 0 0; font-size: 12px; }

/* scan forms: which checks to run */
.checks { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; flex-basis: 100%; margin-top: 10px; }
.checks .check { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: 14px; }
.addcheck { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.addcheck + .addcheck { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.addcheck select { width: auto; }
@media (max-width: 700px) { main.wide { padding: 16px; } }

/* Contacted websites: site opens in a new tab, Edit button next to it */
.sitecell .editbtn { display: inline-block; margin-left: 8px; font-size: 12px; padding: 1px 8px; border: 1px solid var(--border);
  border-radius: 6px; text-decoration: none; color: var(--muted); background: #fff; vertical-align: middle; }
.sitecell .editbtn:hover { color: var(--accent); border-color: var(--accent); }
.bulkrep { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 10px; font-weight: 500; font-size: 13px; }

/* Orders and Clients */
.orderlayout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.orderlayout .card h2 { margin-top: 18px; }
.orderlayout .card h2:first-child { margin-top: 0; }
.sidecard { position: sticky; top: 12px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.timeline li { margin: 0 0 10px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 7px; width: 9px; height: 9px; border-radius: 99px; background: var(--accent); }
.st { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.st-live { background: var(--ok-soft); color: var(--ok); }
.st-fell-through, .st-cancelled, .st-problem { background: var(--err-soft); color: var(--err); }
.st-sent-to-wm, .st-sent-to-client, .st-content-sent-to-client { background: var(--warn-soft); color: var(--warn); }
.fl { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; margin: 1px 0; cursor: help; white-space: nowrap; }
.fl-overdue, .fl-replace { background: var(--err-soft); color: var(--err); }
.fl-delayed, .fl-payment { background: var(--warn-soft); color: var(--warn); }
.fl-dup { background: var(--border); color: var(--muted); }
.flagcell { white-space: normal; min-width: 110px; }
.small { font-size: 11px; }
table.orders td { vertical-align: middle; }
.inlineedit { display: flex; gap: 6px; flex-wrap: wrap; }
.inlineedit input { width: auto; flex: 1; min-width: 140px; padding: 6px 8px; }
.inlineedit button { padding: 6px 10px; }
.inline-form { display: inline; margin-left: 8px; }
tr.skipped td { color: var(--muted); text-decoration: line-through; }
@media (max-width: 1000px) { .orderlayout { grid-template-columns: 1fr; } .sidecard { position: static; } }

/* Find sites for a client / brand */
.fitrow { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-top: 10px; }
.fitrow > label:first-child { margin: 0; font-weight: 600; font-size: 13px; }
.fitrow select { width: auto; min-width: 240px; }
.fitrow .check { margin: 0; font-weight: 500; }
.filters .fitrow.full { flex-basis: 100%; margin-top: 0; }
.reqrow { display: flex; gap: 8px; flex-wrap: wrap; }
.reqin { width: 120px !important; flex: 0 0 auto; }
.inlineedit .reqin { width: 92px !important; min-width: 0 !important; }
.rejform textarea { margin-bottom: 8px; }
.reqlbl { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.inlineedit .reqlbl { font-weight: 500; }
.known { color: var(--muted); border-bottom: 1px dotted var(--muted); cursor: help; }
.addchecks { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 12px 16px; }
.addchecks .addcheck { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0; border: 0; }
.addchecks .addcheck + .addcheck { margin: 0; padding: 0; border: 0; }
.addchecks select { width: auto; max-width: 220px; }
.addchecks .scope { margin-left: 4px; }
.selsearch { width: 150px !important; flex: 0 0 auto; padding: 8px 10px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: #fff; margin-right: 6px; }
.grid2 .selsearch { width: 100% !important; margin: 0 0 6px; }

/* Orders: spreadsheet grid */
table.grid td { padding: 2px 3px; white-space: nowrap; }
table.grid input[data-f], table.grid select[data-f] { font: inherit; font-size: 13px; color: inherit; background: transparent;
  border: 1px solid transparent; border-radius: 4px; padding: 3px 4px; margin: 0; min-width: 0; height: 28px; }
table.grid input[data-f]:hover, table.grid select[data-f]:hover { border-color: var(--border); }
table.grid input[data-f]:focus, table.grid select[data-f]:focus { border-color: var(--accent); background: var(--surface); outline: none; }
table.grid .w-month { width: 128px; } table.grid .w-client { width: 130px; } table.grid .w-brand { width: 120px; }
table.grid .w-site { width: 170px; } table.grid .w-wm { width: 190px; } table.grid .w-type { width: 56px; }
table.grid .w-link { width: 120px; } table.grid .w-price { width: 78px; text-align: right; } table.grid .w-cur { width: 52px; }
table.grid .w-user { width: 92px; } table.grid .w-status { width: 150px; } table.grid .w-date { width: 134px; }
table.grid .w-appr { width: 150px; } table.grid .w-text { width: 140px; } table.grid .w-notes { width: 180px; }
table.grid select.st { font-weight: 600; }
table.grid .go { margin: 0 2px; text-decoration: none; font-size: 13px; }
table.grid .sitecell2 .editbtn { margin-left: 2px; padding: 0 6px; }
table.grid .saving { opacity: .5; } table.grid .saved { border-color: var(--ok) !important; } table.grid .bad { border-color: var(--err) !important; }
table.grid tr.off td { opacity: .45; } table.grid tr.done td { background: var(--ok-soft) !important; }
table.grid tr.fresh td { background: var(--warn-soft) !important; }
.sttip { position: absolute; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.15); padding: 8px 10px; font-size: 13px; min-width: 280px; pointer-events: none; }
.sttip div { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; color: var(--muted); }
.sttip div.now { color: inherit; font-weight: 600; }
.addgrid { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.addgrid label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; gap: 4px; }
.addgrid select, .addgrid input { min-width: 180px; }
#addPanel textarea { width: 100%; font-family: inherit; margin: 4px 0 10px; }
.pagehead .actions { align-items: center; }

/* Orders grid: calmer cells, colors per client and status */
table.grid select[data-f] { -webkit-appearance: none; appearance: none; padding-right: 16px; background-repeat: no-repeat;
  background-position: right 4px center; background-size: 9px; }
table.grid select[data-f]:hover, table.grid select[data-f]:focus {      /* a small arrow drawn with gradients (allowed by the CSP) */
  background-image: linear-gradient(45deg, transparent 50%, #6b6a65 50%), linear-gradient(135deg, #6b6a65 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 5px) 55%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
table.grid input[type=date]:not(:hover):not(:focus)::-webkit-calendar-picker-indicator,
table.grid input[type=month]:not(:hover):not(:focus)::-webkit-calendar-picker-indicator { opacity: 0; }
table.grid tbody tr[data-id] td:first-child { box-shadow: inset 4px 0 0 var(--cc, transparent); }
table.grid tbody tr[data-id]:hover td { background: var(--cbg, #fafaf8); }
table.grid tbody tr[data-id]:nth-child(even) td { background-color: rgba(0,0,0,.012); }
.cdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 2px; vertical-align: middle; }
table.grid .w-client { font-weight: 600; }
/* status pills (also used in group headers) */
.pill { border-radius: 999px !important; font-weight: 600; }
table.grid select.pill { text-align: center; text-align-last: center; padding-left: 8px; }
.s-client-approved, .s-accepted-by-client { background-color: #eceef3 !important; color: #4a5068 !important; }
.s-brief-received { background-color: #e3eefc !important; color: #1f5fae !important; }
.s-content-ordered { background-color: #e9e7fb !important; color: #4a3fb0 !important; }
.s-content-ready { background-color: #f1e5fa !important; color: #7a35a8 !important; }
.s-sent-to-client, .s-content-sent-to-client, .s-content-sent-to-client-for-review { background-color: #fdf0d9 !important; color: #8a5a00 !important; }
.s-content-approved { background-color: #dcf3f1 !important; color: #126b63 !important; }
.s-sent-to-wm { background-color: #ffe7d6 !important; color: #a5480c !important; }
.s-live { background-color: #dcf4e4 !important; color: #17703c !important; }
.s-fell-through { background-color: #fde2e2 !important; color: #a32d2d !important; }
.s-cancelled { background-color: #ececea !important; color: #77756f !important; text-decoration: line-through; }
.a-approved { background-color: #dcf4e4 !important; color: #17703c !important; }
.a-not-indexed, .a-problem-with-content { background-color: #fde2e2 !important; color: #a32d2d !important; }
table.grid .tag { font-weight: 700; font-size: 12px; text-align: center; text-align-last: center; }
.t-link-insertion { color: #a5480c !important; } .t-guest-post { color: #1f5fae !important; }
/* client group headers */
table.grid tr.grp td { background: var(--cbg); border-top: 2px solid var(--cc); cursor: pointer; padding: 8px 10px;
  position: sticky; left: 0; font-size: 14px; }
table.grid tr.grp b { color: var(--cc); margin-right: 10px; }
table.grid tr.grp .caret { display: inline-block; width: 16px; color: var(--cc); }
table.grid tr.grp .gmeta { color: var(--muted); margin-right: 14px; font-size: 13px; }
table.grid tr.grp .gbar .pill { display: inline-block; font-size: 11px; padding: 1px 8px; margin-right: 4px; }
table.grid tr.grp td { text-align: left; }
table.grid select.todo { color: var(--warn); font-style: italic; }
/* compact column widths (v4.10) */
table.grid { font-size: 12.5px; }
table.grid th { font-size: 12px; padding: 6px 4px; }
table.grid td { padding: 1px 2px; }
table.grid input[data-f], table.grid select[data-f] { font-size: 12.5px; height: 26px; padding: 2px 3px; }
table.grid select[data-f] { padding-right: 12px; }
table.grid .w-month { width: 58px; } table.grid .w-client { width: 100px; } table.grid .w-brand { width: 92px; }
table.grid .w-site { width: 145px; } table.grid .w-wm { width: 150px; } table.grid .w-type { width: 36px; }
table.grid .w-link { width: 74px; } table.grid .w-price { width: 56px; } table.grid .w-cur { width: 30px; padding-right: 3px !important; }
table.grid .w-user { width: 66px; } table.grid .w-status { width: 124px; } table.grid .w-date { width: 64px; }
table.grid .w-appr { width: 104px; } table.grid .w-text { width: 96px; } table.grid .w-notes { width: 130px; }
table.grid .go { margin: 0 1px; } table.grid .sitecell2 .editbtn { margin-left: 0; padding: 0 4px; }
table.grid input[type=number]::-webkit-inner-spin-button { display: none; }
table.grid input[type=number] { -moz-appearance: textfield; }
table.grid tr.grp .gbar .pill { padding: 0 6px; }
table.grid input[data-f]::placeholder { color: transparent; }
table.grid input[data-f]:hover::placeholder, table.grid input[data-f]:focus::placeholder { color: var(--muted); opacity: .7; }
/* page-top buttons: a link-button and a real button look identical */
.pagehead .actions .btn, .pagehead .actions button { margin: 0; padding: 8px 14px; font-size: 14px; line-height: 20px; border-radius: 8px; }

/* v5: checklist dropdowns, line panel, paste boxes */
.dd { position: relative; display: inline-block; }
.ddbtn { white-space: nowrap; min-width: 150px; text-align: left; }
.ddbtn.on { border-color: var(--accent); color: var(--accent); }
.ddpanel { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.14); padding: 10px; min-width: 240px; }
.ddpanel.right { left: auto; right: 0; }
.ddpanel input[type=search] { width: 100%; margin-bottom: 6px; }
.ddlinks { font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.ddlist { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; }
.ddrow { display: flex; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 6px; font-size: 14px; font-weight: 400; margin: 0; cursor: pointer; }
.ddrow:hover { background: var(--accent-soft); }
.ddrow input { margin: 0; }
.pastegrid { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr 1fr; gap: 10px; }
.pastegrid label { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.pastegrid textarea { width: 100%; font: 13px/1.5 ui-monospace, monospace; white-space: pre; overflow-x: auto; }
@media (max-width: 900px) { .pastegrid { grid-template-columns: 1fr 1fr; } }
.modalback { position: fixed; inset: 0; background: rgba(20,20,18,.35); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow-y: auto; }
.modalback[hidden] { display: none; }
.modal { width: min(760px, 100%); margin: 0; }
.modalhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.modalhead h2 { margin: 0 0 12px; font-size: 17px; overflow-wrap: anywhere; }
.modal .actions { margin-left: 0; align-items: center; }
table.grid .lpopen { font-size: 12px; padding: 0 6px; height: 22px; line-height: 20px; border-radius: 6px; background: transparent; }
table.grid tr.closed td { opacity: .55; }
table.grid tr.carried td:nth-child(2) select { color: var(--warn); font-weight: 600; }
.s-cancelled { text-decoration: line-through; }
.a-missing-links, .a-other { background-color: #fdf0d9 !important; color: #8a5a00 !important; }
.ddpanel[hidden] { display: none !important; }
.ddpanel { display: block; }
table.grid .w-status { width: 136px; }
td.topmiss { color: var(--warn); font-weight: 600; }
td.topmiss::after { content: " ⚑"; }

/* notifications */
.bell { position: relative; text-decoration: none; font-size: 17px; padding: 4px 8px; border-radius: 8px; }
.bell:hover, .bell.active { background: var(--accent-soft); }
.bellcount { position: absolute; top: -4px; right: -6px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 0 5px; min-width: 16px; text-align: center; line-height: 16px; }
.notiflist { list-style: none; margin: 0; padding: 0; }
.notiflist li { display: flex; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.notiflist li.unread { background: var(--accent-soft); border-radius: 8px; }
.notiflist li.unread .ntext { font-weight: 600; }
.notiflist .ntext { flex: 1; } .notiflist .ntext a { color: inherit; text-decoration: none; } .notiflist .ntext a:hover { text-decoration: underline; }
.nicon { width: 24px; text-align: center; }
/* price changes */
.pricebox h2 { margin-top: 0; }
.pdecide { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.pdecide input { flex: 1; min-width: 200px; }
.phist { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.pstat { font-weight: 600; } .ps-approved { color: var(--ok); } .ps-rejected { color: var(--err); } .ps-pending { color: var(--warn); }
.fl-price { background: var(--warn-soft); color: var(--warn); }
table.grid .preq { display: inline-block; font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft);
  border-radius: 999px; padding: 0 6px; margin-left: 2px; text-decoration: none; white-space: nowrap; }
.modal.small { width: min(520px, 100%); }
.amtable { width: auto; min-width: 560px; } .amtable td, .amtable th { padding: 8px 14px; } .amtable select { min-width: 200px; }
label.check.small { font-size: 13px; font-weight: 400; color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; max-width: min(640px, calc(100% - 32px));
  padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); font-size: 14px; }
.toast.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }
.toast.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.toast[hidden] { display: none; }
.selwarn { color: var(--warn); }
table.grid .w-status { width: 152px; }
.lpprice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
table.grid .repl { color: var(--accent); font-weight: 700; margin-right: 2px; cursor: help; }
table.grid .repl.done { color: var(--muted); margin: 0 2px; }
.replbox { border-top: 1px solid var(--border); padding-top: 10px; }
.replbox h3 { margin: 0 0 4px; font-size: 15px; }
#lpReplForm input { flex: 1; min-width: 200px; }
table.grid .w-status { width: 176px; }
#fpReason { width: 100%; }
#fellPanel .check { margin: 8px 0 4px; font-weight: 400; }
/* client icons */
.cicon { width: 16px; height: 16px; border-radius: 3px; vertical-align: -3px; margin-right: 6px; object-fit: contain; }
.cicon.none { display: inline-block; background: var(--border); }
.cicon.big { width: 26px; height: 26px; vertical-align: -5px; margin-right: 10px; }
.cicon.huge { width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--border); }
.cicon.none.big { display: none; }
.iconrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.iconrow form { margin: 0; } .iconup { display: flex; gap: 8px; align-items: center; }
.pagehead .actions form { margin: 0; }
table.grid tr.grp .cicon { margin-right: 6px; }
table.grid .pkind { display: inline-block; font-size: 10px; font-weight: 700; color: #7a35a8; background: #f1e5fa; border-radius: 4px; padding: 0 4px; margin-left: 2px; }
#ckind { max-width: 260px; }
table.grid .w-wm { width: 185px; }
table.grid .norate { display: inline-block; font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-soft);
  border-radius: 4px; padding: 0 5px; margin-left: 2px; white-space: nowrap; }
.inlineedit .kindsel { width: auto !important; min-width: 0 !important; }
.kindok { font-size: 12px; margin: 0 4px; white-space: nowrap; } .kindok.ok { color: var(--ok); } .kindok.bad { color: var(--err); }
.ps-withdrawn { color: var(--muted); }
.notiflist li { align-items: flex-start; }
.ncheck { margin-top: 4px; }
.nbtn { font-size: 12px; padding: 3px 10px; white-space: nowrap; align-self: center; }
.nbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ntabs { display: flex; gap: 4px; margin-right: auto; }
.ntabs a { text-decoration: none; padding: 4px 10px; border-radius: 6px; color: var(--muted); }
.ntabs a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* send to webmaster / invoice windows */
.modal.wide { width: min(980px, 100%); }
.spcard { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 12px 0; background: var(--surface); }
.sphead { margin-bottom: 6px; }
.sprow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.splabel { width: 56px; color: var(--muted); font-size: 13px; }
.spsubj { flex: 1; min-width: 240px; }
.spbody { width: 100%; font: 13px/1.5 system-ui, sans-serif; margin: 6px 0; }
.warnline { color: var(--warn); font-size: 13px; margin: 4px 0; }
.spsettings { margin: 4px 0 8px; } .spsettings summary { cursor: pointer; color: var(--accent); }
.spsettings .formgrid { margin: 10px 0; }
.invprev { overflow-x: auto; }
.runshead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.runsearch { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.runsearch input { min-width: 280px; }
.pager { display: flex; gap: 16px; align-items: center; margin: 10px 0; }
/* brands inside a client */
.brandcell .bdot, tr.bgrp .bdot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--bc); margin-right: 4px; vertical-align: middle; }
table.grid .brandcell select { color: var(--bc); font-weight: 600; }
table.grid tr.bgrp td { background: var(--surface); border-top: 1px dashed var(--border); padding: 4px 10px 4px 22px; font-size: 12.5px;
  font-weight: 600; color: var(--bc); text-align: left; box-shadow: inset 4px 0 0 var(--bc); }
table.grid tr.bgrp .gmeta { font-weight: 400; margin-left: 8px; }
/* client price history */
table.grid td.pdiff input[data-f="client_price"] { border-color: var(--warn); }
table.grid .pdifftag { font-size: 10px; font-weight: 700; color: var(--warn); margin-left: 2px; }
table.grid .lastp { font-size: 11px; padding: 0 6px; height: 20px; line-height: 18px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); border-color: transparent; margin-left: 2px; }
/* tasks */
.ttabs { margin-bottom: 10px; }
.tfilters input[type=search] { flex: 1; }
.tst { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; }
.tst.big { font-size: 14px; padding: 4px 14px; }
.st-new { background: #e3eefc; color: #1f5fae; } .st-in-progress { background: #fdf0d9; color: #8a5a00; }
.st-blocked { background: #fde2e2; color: #a32d2d; } .st-completed { background: #dcf4e4; color: #17703c; }
.tpri { font-size: 12px; font-weight: 600; } .pri-urgent { color: var(--err); } .pri-low { color: var(--muted); }
table.tasks tr.tnew td { background: var(--accent-soft); font-weight: 600; }
td.overdue, b.overdue { color: var(--err); font-weight: 700; }
.tdesc { white-space: normal; line-height: 1.6; }
.thread { list-style: none; margin: 0 0 12px; padding: 0; }
.thread li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.thread li.ev-status, .thread li.ev-assign, .thread li.ev-edit, .thread li.ev-created { color: var(--muted); font-size: 13px; padding: 6px 0; }
.thread li.ev-status .evtext, .thread li.ev-assign .evtext, .thread li.ev-edit .evtext, .thread li.ev-created .evtext { display: inline; margin-left: 6px; }
.thread li.ev-status .evhead, .thread li.ev-assign .evhead, .thread li.ev-edit .evhead, .thread li.ev-created .evhead { display: inline; }
.evtext { margin-top: 4px; line-height: 1.55; overflow-wrap: anywhere; }
.tcomment textarea { width: 100%; }
.tdel { margin-top: 12px; }
.ntabs.ttabs a { padding: 6px 12px; }
.okline { color: var(--ok); font-weight: 600; font-size: 14px; }
.cctable td { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.cctable td.cccomment { max-width: 380px; }
.inlineedit .tplin { width: 150px !important; min-width: 0 !important; }
.cctable td[contenteditable] { cursor: text; }
.cctable td[contenteditable]:hover { background: rgba(80, 70, 180, .06); }
.cctable td[contenteditable]:focus { white-space: normal; overflow: visible; max-width: 380px; outline: 2px solid #4b3fb0; outline-offset: -2px; background: #fff; }
.cctable td.ccedited { background: #fff7d6; }
table.grid input[type="date"].w-date { width: 122px !important; padding: 2px 4px; font-size: 12.5px; }
.rangebox { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted, #666); }
.rangebox input[type="month"] { width: 150px; }
#clText { width: 100%; font-family: ui-monospace, monospace; font-size: 12.5px; }
.cltable td { font-size: 12.5px; vertical-align: middle; } .cltable select { max-width: 420px; font-size: 12.5px; }
.cltable tr.clok td:first-child { box-shadow: inset 3px 0 #2e9d5b; } .cltable tr.clwarn td:first-child { box-shadow: inset 3px 0 #d39b1d; }
.cltable tr.clbad td:first-child { box-shadow: inset 3px 0 #c8443c; } .cltable tr.clbad td { color: #8a2f2a; }
/* notes conversation */
.notecell .ntopen { all: unset; cursor: pointer; display: block; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; padding: 2px 4px; border-radius: 6px; }
.notecell .ntopen:hover { background: rgba(80, 70, 180, .08); }
.notecell .ntopen.urg { background: #fde3e1; color: #9b1c14; }
.nthread { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px; background: #f6f6fa; border-radius: 10px; margin-bottom: 10px; }
.nthread.static { max-height: none; margin-bottom: 6px; }
.nmsg { max-width: 80%; background: #fff; border: 1px solid #e3e3ec; border-radius: 10px; padding: 7px 10px; font-size: 13.5px; align-self: flex-start; }
.nmsg.mine { align-self: flex-end; background: #ecebff; border-color: #d6d3fb; }
.nmsg.urgent { border-color: #e0574d; box-shadow: inset 3px 0 #e0574d; }
.nmsg .nwho { margin-bottom: 2px; font-size: 12.5px; }
#ntText { width: 100%; }
.urgentbtn { background: #fff1f0; border-color: #e0a19b; color: #a3241b; }
.urgentbtn:hover { background: #fde3e1; }
/* urgent alerts */
.urgtop { all: unset; cursor: pointer; font-size: 17px; padding: 2px 6px; border-radius: 8px; margin-right: 6px; opacity: .75; }
.urgtop:hover { opacity: 1; background: #fde3e1; }
.bell.hasurgent { background: #e0574d; border-radius: 8px; animation: urgpulse 1.6s ease-in-out infinite; }
@keyframes urgpulse { 50% { box-shadow: 0 0 0 5px rgba(224, 87, 77, .25); } }
.urgentbar { position: sticky; top: 0; z-index: 60; background: #c8382e; color: #fff; padding: 6px 16px; display: flex; flex-direction: column; gap: 4px; }
.urgentbar[hidden] { display: none !important; }
.urgentbar .urow { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.urgentbar .utext { flex: 1; font-weight: 600; white-space: pre-wrap; }
.urgentbar .uwhen { opacity: .85; font-size: 12.5px; }
.urgentbar .ubtn { background: #fff; color: #a3241b; border: 0; border-radius: 6px; padding: 3px 10px; font-size: 13px; cursor: pointer; text-decoration: none; font-weight: 600; }
.modalback textarea { width: 100%; }
/* type tabs (notifications, tasks) */
.ctabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.ctab { --nc: #444; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; text-decoration: none;
  color: var(--nc); background: color-mix(in srgb, var(--nc) 9%, white); border: 1px solid color-mix(in srgb, var(--nc) 30%, white); font-size: 13.5px; font-weight: 600; }
.ctab b { background: var(--nc); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }
.ctab.on { background: var(--nc); color: #fff; } .ctab.on b { background: #fff; color: var(--nc); }
.ctab.ctadd { --nc: #888; font-weight: 400; }
.notiflist li { box-shadow: inset 4px 0 var(--nc, transparent); }
table.tasks tr[style*="--tc"] td:first-child { box-shadow: inset 4px 0 var(--tc); }
.ttype { color: var(--tc); background: color-mix(in srgb, var(--tc) 10%, white); border-radius: 999px; padding: 1px 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.autofilled { background: #e8f6ec !important; transition: background .3s; }
table.grid input[type="date"].w-date:invalid:not(:focus) { color: transparent; }
.invcell .invd { color: #2e7d4f; font-size: 12.5px; white-space: nowrap; font-weight: 600; }
.fl-invoice { background: #e7f0ff; color: #2459b3; }
.tfiles { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tfiles li { display: flex; align-items: center; gap: 10px; }
.tfiles li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tthumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.tficon { width: 56px; height: 56px; border-radius: 6px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--accent, #4b3fb0); flex: none; }
.tcomment input[type=file] { font-size: 13px; }
.spcheck { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; margin-right: 10px; font-size: 13px; cursor: pointer; background: #fff; }
.spcard.spsent { border-color: #7cc49a; background: #f3fbf6; }
.spcard.spsent .spcheck { border-color: #2e9d5b; color: #1f7a45; font-weight: 600; }
.spam { margin-left: 8px; font-size: 12.5px; background: var(--accent-soft); color: var(--accent, #4b3fb0); border-radius: 999px; padding: 1px 9px; font-weight: 600; }
.s-prepay { background-color: #fff3c4 !important; color: #8a6a00 !important; }
.paytask { font-size: 12.5px; white-space: nowrap; text-decoration: none; border-radius: 999px; padding: 1px 8px; background: #e3eefc; color: #1f5fae; }
.paytask.pt-completed { background: #dcf4e4; color: #17703c; } .paytask.pt-blocked { background: #fde2e2; color: #a32d2d; }
.paytask.pt-in-progress { background: #fdf0d9; color: #8a5a00; } .paytask.pt-deleted { background: #eee; color: #777; }
.ptcard { display: flex; flex-direction: column; gap: 6px; }
.ptcard .pttitle, .ptcard input[type=url] { width: 100%; }
.ptrow { display: flex; align-items: center; gap: 8px; font-size: 13px; }
#ptPanel .filterrow label { display: inline-flex; align-items: center; gap: 6px; }
.paycell .payrow { display: flex; align-items: center; gap: 3px; }
.paybtn { all: unset; cursor: pointer; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border); background: #fff; text-align: center; line-height: 19px; font-size: 13px; color: var(--accent, #4b3fb0); flex: none; }
.paybtn:hover { background: var(--accent-soft); }
.payextra { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.payfiles { all: unset; cursor: pointer; font-size: 12px; border-radius: 999px; padding: 0 7px; background: #eef0f5; }
.paymenu { position: absolute; z-index: 90; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px; display: flex; flex-direction: column; min-width: 210px; }
.paymenu[hidden] { display: none !important; }
.paymenu button { all: unset; cursor: pointer; padding: 8px 12px; border-radius: 7px; font-size: 14px; }
.paymenu button:hover { background: var(--accent-soft); }
.ptstatic { padding: 8px 0; font-size: 14px; }
.ptform input[type=text], .ptform input[type=url], .ptform textarea { width: 100%; }
