/* Site Visits list: one row per AMC branch (Ali, 6 Nov 2026). Wide list (55em and up): a table. Narrower, and on phones: compact cards, same kit as the Complaints list. */
.page-count { white-space: nowrap; font: 500 1rem Barlow, sans-serif; margin-left: 6px; }
.sv-sum { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.sv-sum-main, .sv-chipf { background: #fff; border: 1px solid #E1E6EC; border-radius: 10px; padding: 10px 14px; text-align: left; font: inherit; color: inherit; }
.sv-sum-main { display: grid; gap: 2px; align-content: start; }
.sv-sum-main b, .sv-chipf b { font: 600 1.625rem/1.1 "Barlow Semi Condensed", Barlow, sans-serif; }
.sv-gauge { display: block; height: 5px; border-radius: 3px; background: #EEF1F5; margin-top: 6px; overflow: hidden; } .sv-gauge i { display: block; height: 100%; background: #1B7A3E; }
.sv-chipf { cursor: pointer; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; } .sv-chipf i { grid-row: span 2; width: 10px; height: 10px; border-radius: 50%; background: #9AA5B4; }
.sv-chipf.late i { background: #E1251B; } .sv-chipf.soon i { background: #D98A0B; } .sv-chipf .short { display: none; } .sv-chipf span { color: #5A6677; font-size: 0.8125rem; }
.sv-chipf.late b { color: #E1251B; } .sv-chipf.on { border-color: #1F5FD1; background: #EEF4FD; }
#f-sv-customer, #f-sv-who { width: 176px; }

/* the rows (narrow: cards) */
ul.sv-tb { list-style: none; margin: 0; padding: 0; container: svl / inline-size; }
.sv-tb > .ls-head.sv-head { display: none; }
.sv-br { background: #fff; border: 1px solid #E1E6EC; border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.sv-main { display: grid; width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; min-height: 52px; padding: 10px 12px;
  grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name name days" "last open who"; row-gap: 4px; column-gap: 10px; align-items: center; }
.sv-main:hover, .sv-br.open { background: var(--row-hover); }
.sv-cust { grid-area: name; overflow-wrap: anywhere; font-weight: 600; } .sv-chev { display: none; }

.sv-last { grid-area: last; color: #5A6677; font-size: 0.84rem; } .sv-last.has::before { content: "Last visit "; }
.sv-days { grid-area: days; justify-self: end; font-size: 0.95rem; display: flex; gap: 6px; align-items: baseline; }
.sv-days.ok { color: #1B7A3E; font-weight: 600; } .sv-days.soon { color: #9A6200; font-weight: 600; } .sv-days.late span:first-child { color: #E1251B; font-weight: 600; }
.sv-who { grid-area: who; justify-self: end; } .sv-who-in > span:last-child { display: none; } .d-short { display: inline; } .d-full { display: none; } .sv-who > .muted { font-size: 0.84rem; } .sv-open-n { grid-area: open; justify-self: start; font-size: 0.84rem; } .sv-open-n small { color: #5A6677; } .sv-cmp-n { display: none; }
.sv-who-in { display: inline-flex; align-items: center; gap: 8px; min-width: 0; } .sv-who-in .av { flex: none; }
.sv-ob { display: inline-block; min-width: 22px; text-align: center; border-radius: 6px; background: #E8EFFB; color: #1F5FD1; font-weight: 600; padding: 0 6px; } .sv-ob.z { background: #EEF1F5; color: #5A6677; }
.sv-ex { padding: 2px 12px 12px; border-top: 1px solid #EEF1F5; }
.sv-vrow { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "date state" "who pts" "btns btns"; row-gap: 4px; column-gap: 10px; padding: 8px 0; min-height: 44px; align-items: center; border-bottom: 1px solid #EEF1F5; }
.sv-v-date { grid-area: date; font-weight: 600; } .sv-v-state { grid-area: state; justify-self: end; } .sv-v-who { grid-area: who; } .sv-v-pts { grid-area: pts; justify-self: end; font-size: 0.84rem; }
.sv-v-btns { grid-area: btns; display: flex; gap: 6px; } .sv-v-btns .btn { flex: 1; min-height: 36px; }
.sv-ex-foot { display: flex; flex-direction: column-reverse; gap: 8px; margin-top: 10px; } .sv-ex-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .sv-ex-btns .btn { min-height: 44px; justify-content: center; }
.sv-more, .sv-note { text-align: center; margin: 12px 0; }
.sv-hist-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.sv-hist-tiles > div { background: #fff; border: 1px solid #E1E6EC; border-radius: 10px; padding: 8px 10px; display: grid; } .sv-hist-tiles b { font: 600 1.125rem "Barlow Semi Condensed", Barlow, sans-serif; }
.sv-hist { background: #fff; border: 1px solid #E1E6EC; border-radius: 10px; padding: 0 12px; } .sv-hist .sv-vrow:last-child { border-bottom: 0; }
.sv-hist-bar { margin-top: 12px; }

/* the table (wide) */
@container svl (min-width: 55em) {
  .sv-head, .sv-main { grid-template-columns: 24px minmax(0, 1fr) 130px 130px 160px 90px 110px; grid-template-areas: none; column-gap: 10px; align-items: center; }
  .sv-tb > .ls-head.sv-head { display: grid; padding: 8px 14px; border: 1px solid #E1E6EC; border-radius: 10px 10px 0 0; }
  .sv-tb > .ls-sortbox { display: none; }
  .sv-br { margin: 0; border-radius: 0; border-top: 0; } .sv-br:last-of-type { border-radius: 0 0 10px 10px; }
  .d-short { display: none; } .d-full { display: inline; } .sv-who-in > span:last-child { display: inline; } .sv-br { box-shadow: none !important; }
  .sv-main > * { grid-area: auto; justify-self: start; } .sv-cmp-n { display: block; } .sv-last.has::before { content: none; } .sv-open-n, .sv-days { font-size: inherit; }
  .sv-main { padding: 10px 14px; row-gap: 0; }
  .sv-chev { display: block; width: 7px; height: 7px; margin-left: 6px; border-right: 2px solid #5A6677; border-bottom: 2px solid #5A6677; transform: rotate(-45deg); transition: transform 120ms ease-out; }
  .sv-br.open .sv-chev { transform: rotate(45deg); }
  .sv-ex { padding: 2px 14px 12px 48px; }
  .sv-vrow { grid-template-columns: 130px 160px minmax(0, 1fr) 110px auto; grid-template-areas: none; }
  .sv-vrow > * { grid-area: auto; justify-self: start; } .sv-v-btns { justify-self: end; } .sv-v-btns .btn { flex: none; }
  .sv-ex-foot { flex-direction: row; justify-content: space-between; align-items: center; } .sv-ex-btns { display: flex; align-items: center; } .sv-ex-btns .btn { min-height: 0; }
}
@media (min-width: 701px) {
  .sv-hist-tiles > div { padding: 10px 14px; } .sv-hist-tiles b { font-size: 1.5rem; } .sv-hist { padding: 0 14px; }
  .sv-vrow { grid-template-columns: 130px 160px minmax(0, 1fr) 110px auto; grid-template-areas: none; } .sv-vrow > * { grid-area: auto; justify-self: start; } .sv-v-btns { justify-self: end; } .sv-v-btns .btn { flex: none; }
}
@media (max-width: 700px) {
  .sv-sum { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 12px; background: #fff; border: 1px solid #E1E6EC; border-radius: 10px; }
  .sv-sum-main { grid-column: 1 / -1; border: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; } .sv-sum-main b { font-size: 1.375rem; } .sv-gauge { flex: 1 1 100%; }
  .sv-chipf { min-height: 36px; border-radius: 999px; padding: 4px 8px; display: flex; justify-content: center; align-items: center; gap: 5px; } .sv-chipf i { width: 8px; height: 8px; } .sv-chipf b { font: 600 0.875rem Barlow, sans-serif; }
  .sv-chipf .full { display: none; } .sv-chipf .short { display: inline; font-weight: 600; color: inherit; }
  .page-head:has(#new-visit) { flex-wrap: nowrap; align-items: center; } .page-head:has(#new-visit) > div > p { display: none; }
  .page-head:has(#new-visit) .head-btns { width: auto; flex-wrap: nowrap; justify-content: flex-end; } .page-head:has(#new-visit) .head-btns .btn { flex: none; padding: 0 12px; }
  #weekly { min-height: 36px; font-size: 0.875rem; } #new-visit { min-height: 44px; } .hide-s { display: none; }
}

/* the visit page: points as one table per group, the same look as the list (Ali, 6 Nov 2026); a Complaint button on every point */
.sv-section h2 { font: 600 1rem/1.2 "Barlow Semi Condensed", Barlow, sans-serif; color: #0D1B2A; }
ul.sv-pts { display: block; background: #fff; border: 1px solid #E1E6EC; border-radius: 10px; overflow: hidden; padding: 0; margin: 0; }
.sv-pts > li { display: grid; grid-template-columns: minmax(0, 1fr); border-bottom: 1px solid #EEF1F5; }
.sv-pts > li:last-child { border-bottom: 0; }
.sv-pts .sv-row2 { border: 0; border-radius: 0; background: none; min-height: 60px; padding: 8px 12px; }
.sv-pts .sv-row2:hover { background: #F8FAFD; } .sv-pts .sv-row2.need { background: none; } .sv-pts .sv-row2.invalid { box-shadow: inset 0 0 0 2px #E1251B; }
.sv-pts .sv-st .tag, .sv-pts .sv-st .status-pill { max-width: 100%; }
.sv-cx { display: flex; align-items: center; gap: 8px; padding: 0 12px 10px 66px; min-width: 0; } .sv-cx .btn { min-height: 36px; } .sv-ref { font-family: "Barlow Semi Condensed", Barlow, sans-serif; color: #1F5FD1; }
.sv-pts > li.sv-phead { display: none; } .sv-pts > li.need { background: #FFF7E8; }
@media (min-width: 701px) {
  .sv-pts > li { grid-template-columns: minmax(0, 1fr) 190px; align-items: center; }
  .sv-pts .sv-row2 { grid-template-columns: 44px minmax(0, 1fr) 210px; grid-template-areas: "th tx st"; min-height: 64px; } .sv-pts .sv-go { display: none; } .sv-pts .sv-st { justify-self: start; max-width: 210px; }
  .sv-cx { padding: 0 14px 0 0; } .sv-cx .btn { min-height: 32px; }
  .sv-pts > li.sv-phead { display: grid; grid-template-columns: 54px minmax(0, 1fr) 210px 190px; column-gap: 10px; padding: 7px 12px; background: #FAFBFC; border-bottom: 1px solid #E1E6EC; font: 600 0.78rem Barlow, sans-serif; color: #5A6677; }
  .sv-phead span:first-child { grid-column: 1 / 3; }
}
.sv-todo { border-radius: 10px; } .sv-branch { border-radius: 10px; }
@media (max-width: 700px) { .sv-pt.need .sv-cx { display: none; } }

/* press feedback and hover (Ali's press rule, emil review 6 Nov 2026): a pressed row or chip sinks a little; hover only where there is a mouse */
.sv-main, .sv-chipf, .sv-pts .sv-row2 { transition: transform 120ms ease-out, background-color 120ms ease-out; }
.sv-main:active, .sv-chipf:active, .sv-pts .sv-row2:active { transform: scale(0.99); }
@media (hover: none) { .sv-main:hover, .sv-pts .sv-row2:hover { background: none; } .sv-br.open > .sv-main:hover { background: #F8FAFD; } }
.sv-main:focus-visible, .sv-chipf:focus-visible, .sv-pts .sv-row2:focus-visible { outline: 2px solid #1F5FD1; outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .sv-main, .sv-chipf, .sv-pts .sv-row2 { transition: none; } .sv-main:active, .sv-chipf:active, .sv-pts .sv-row2:active { transform: none; } }

.sv-cx .btn.icon-only { min-width: 44px; min-height: 36px; } @media (min-width: 701px) { .sv-cx .btn.icon-only { min-width: 36px; min-height: 32px; } }

/* Confirm Complaint on a point: the equipment warning and the tick box (Ali, 6 Nov 2026) */
.sv-eqwarn { background: #FFF4DC; border: 1px solid #F5D9A0; color: #8A5A00; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 0.875rem; }
.check.sv-send { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #C6D7F5; background: #EEF4FD; border-radius: 10px; padding: 10px 12px; margin-top: 10px; min-height: 44px; }
.check.sv-send input { margin-top: 3px; } .check.sv-send span { display: grid; gap: 2px; }

/* the narrow card is as compact as a Complaints card (Ali, 6 Nov 2026): the name and the age on line one, the last visit, open points and the inspector's photo on line two; a late branch keeps a red edge, a due one an amber edge */
.sv-br:has(.sv-days.late) { box-shadow: inset 4px 0 0 #E1251B; } .sv-br:has(.sv-days.soon) { box-shadow: inset 4px 0 0 #D98A0B; }
.sv-main .sv-who-in .av { width: 26px; height: 26px; font-size: 10px; }

/* the visit page on a phone is as compact as the list (Ali, 6 Nov 2026): the Link Complaint icon sits on the status line at the right instead of a line of its own, no arrow, one line of text under the name */
@media (max-width: 700px) {
  .sv-pt { position: relative; }
  .sv-pts .sv-row2 { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "th tx" "th st"; padding: 8px 12px; min-height: 0; }
  .sv-pts .sv-go { display: none; }
  .sv-pts:not(.sv-earlier) .sv-tx { padding-right: 52px; } .sv-pts:not(.sv-earlier) .sv-tx > span { -webkit-line-clamp: 1; }
  .sv-pt > .sv-cx { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 0; }
  .sv-pt.need > .sv-cx { display: none; }
  .sv-pts .sv-th { width: 40px; height: 40px; }
}
.sv-cx-btns { display: grid; gap: 10px; margin: 10px 0 4px; } .sv-cx-btns .btn { min-height: 48px; justify-content: center; font-size: 1rem; }

/* the opened branch: each visit is its own white line on a tinted panel (Ali, 7 Nov 2026) */
.sv-br .sv-ex { background: #F3F5F8; padding-top: 10px; }
.sv-br .sv-ex .sv-vrow { background: #fff; border: 1px solid #E1E6EC; border-left: 3px solid #1F5FD1; border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.sv-br .sv-ex .sv-ex-foot { margin-top: 8px; }
.sv-vrow[data-open] { cursor: pointer; transition: background-color 120ms ease-out; }
@media (hover: hover) { .sv-vrow[data-open]:hover { background: var(--row-hover); border-color: var(--line-strong); } }
.sv-vrow[data-open]:focus-visible { outline: 2px solid #1F5FD1; outline-offset: -2px; }
