/* Spot Admin Panel: additions on top of the Client Portal design system (portal.css, auth.css). */

[data-accent="mydrayspot"] { --accent: #5e2ced; --accent-strong: #5e2ced; --accent-ink: #5e2ced; --accent-soft: #efeafd; --accent-line: #cdbff9; --accent-on: #ffffff; }
:root.dark[data-accent="mydrayspot"] { --accent: #a48cf5; --accent-strong: #6f42f0; --accent-ink: #c2b2f9; --accent-soft: rgba(164, 140, 245, .15); --accent-line: rgba(164, 140, 245, .42); }
[data-accent="civspot"] { --accent: #3c2bd5; --accent-strong: #3c2bd5; --accent-ink: #3c2bd5; --accent-soft: #eceafb; --accent-line: #c8c3f3; --accent-on: #ffffff; }
:root.dark[data-accent="civspot"] { --accent: #8d81f2; --accent-strong: #5546e6; --accent-ink: #b3abf7; --accent-soft: rgba(141, 129, 242, .15); --accent-line: rgba(141, 129, 242, .42); }

.brand-logo { height: 34px; width: auto; }
.dark .brand-logo { filter: brightness(0) invert(1); }
.auth-logo .brand-logo { height: 40px; }
.auth-stage { display: grid; place-items: center; }
.auth-card-stack { display: grid; gap: 12px; width: min(380px, 80%); }
.auth-card-stack .plane { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.user-menu { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--plane-2); border: 1px solid var(--line); }
.user-menu strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu small { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.user-menu > div { min-width: 0; flex: 1; }
.nav a.disabled { color: var(--faint); }
.nav .soon { margin-left: auto; font-size: 11px; color: var(--faint); }

select.input.city-select { width: auto; min-width: 150px; }
.period-row .row { flex-wrap: nowrap; }
.period-row .search .input { min-width: 260px; }
.period-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.stat-hero { padding: 26px; display: flex; flex-direction: column; gap: 18px; }
.stat-hero .big { font: 500 52px/1 var(--font); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-hero .cap { color: var(--muted); margin-top: 8px; }
.stat-minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: auto; }
.stat-minis .v { font: 500 20px/1 var(--font); font-variant-numeric: tabular-nums; }
.stat-minis .l { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

.bars { display: grid; gap: 2px; padding: 4px 20px 18px; }
.bar-row { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr) 40px; gap: 12px; align-items: center; min-height: 32px; font-size: 13.5px; border-radius: 6px; }
.bar-row:hover { background: var(--plane-2); }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; }
.bar-fill { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--accent); }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.crit { background: var(--crit); }
.bar-fill.muted { background: var(--faint); }
.bar-row .val { text-align: right; font: 500 12.5px var(--mono); color: var(--ink-2); }

.chart-wrap { position: relative; padding: 0 20px 16px; }
.chart-wrap svg { display: block; width: 100%; height: 220px; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--plate); color: var(--plate-ink); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow-3); white-space: nowrap; transform: translate(-50%, -100%); }
.chart-tip[hidden] { display: none; }
.chart-axis { font: 400 11px var(--mono); fill: var(--muted); }
.chart-grid { stroke: var(--line); stroke-width: 1; }

.segmented button[aria-pressed="true"] { background: var(--accent-strong); color: var(--accent-on); }
.segmented button[aria-pressed="true"] .n { color: var(--accent-on); opacity: .8; }
.segmented .n:empty { display: none; }
.filter-scroll { overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.filter-scroll .segmented { white-space: nowrap; }
dialog.panel-sheet { margin: 0 0 0 auto; padding: 0; width: min(560px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid var(--line); background: var(--plane); color: var(--ink); box-shadow: var(--shadow-3); }
dialog.panel-sheet[open] { display: flex; flex-direction: column; }
dialog.panel-sheet::backdrop { background: rgba(11, 14, 18, .45); }
dialog.panel-sheet .modal-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
dialog.panel-sheet .modal-foot { justify-content: space-between; border-radius: 0; }
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px; display: grid; gap: 16px; align-content: start; }
dialog.panel-confirm { padding: 0; width: min(440px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--plane); color: var(--ink); box-shadow: var(--shadow-3); }
dialog.panel-confirm::backdrop { background: rgba(11, 14, 18, .45); }
dialog.panel-confirm .modal-head { padding-bottom: 18px; }
.btn.danger-fill { background: var(--crit); border-color: var(--crit); color: #fff; }
.dark .btn.danger-fill { color: #1a0b09; }
.btn.danger-fill:hover { background: color-mix(in srgb, var(--crit) 88%, #000); }
.wrap-cell { min-width: 220px; max-width: 560px; white-space: normal; overflow-wrap: anywhere; }
.msg-list { display: grid; }
.msg-item { padding: 16px 20px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.msg-item:last-child { border-bottom: 0; }
.msg-body { display: grid; gap: 10px; min-width: 0; }
.msg-item.with-pic { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-item.with-pic img { display: block; width: 96px; height: 72px; object-fit: cover; border-radius: var(--r-1); }
.msg-item p { overflow-wrap: anywhere; white-space: pre-line; }
.msg-item p.clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.cat-main .cell-title { font-weight: 600; }
.cat-arrow { display: inline-block; width: 16px; color: var(--muted); }
.cat-count { padding-left: 16px; }
.cat-sum { display: flex; gap: 10px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cell-title.indent { padding-left: 18px; font-weight: 400; color: var(--ink-2); }
.pin-map { height: 240px; border-radius: var(--r-1); border: 1px solid var(--line-2); overflow: hidden; background: var(--plane-2); }
.leaflet-marker-icon.map-cluster { display: flex; align-items: center; justify-content: center; border: 3px solid #fff; border-radius: 50%; background: var(--accent); color: var(--accent-on); font: 600 13px/1 var(--font); box-shadow: var(--shadow-2); box-sizing: border-box; }
.map-pin { background: var(--accent); border: 3px solid #fff; border-radius: 50%; box-shadow: var(--shadow-2); }
.thumb { width: 96px; height: 72px; object-fit: cover; border-radius: var(--r-1); }
.report-video { width: 100%; max-height: 260px; border-radius: var(--r-1); background: #000; }
.view-row { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; min-width: 0; flex-wrap: wrap; }
.view-row .filter-scroll { margin-bottom: 0; min-width: 0; flex: 1 1 320px; }
.work-map { height: 62vh; min-height: 420px; border-radius: var(--r-2) var(--r-2) 0 0; overflow: hidden; z-index: 0; }
.map-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; padding: 12px 20px; font-size: 13px; }
.pin-pop { display: grid; gap: 6px; min-width: 190px; font: 13px/1.4 var(--font); }
.pin-pop .row { gap: 6px; margin-top: 4px; }
.cat-tag { display: inline-flex; align-items: center; gap: 10px; }
.cat-tag img, .cat-tag-none { flex: none; width: 32px; height: 32px; border-radius: var(--r-1); object-fit: contain; }
.cat-tag-none { background: var(--plane-3); }
.wo-title { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.wo-title img { flex: none; width: 44px; height: 44px; border-radius: var(--r-1); object-fit: contain; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--plane); color: var(--ink); }
.pin-pop a.btn { color: var(--ink); }
.street-frame { display: block; width: 100%; height: 280px; border: 0; border-radius: var(--r-1); margin-bottom: 8px; }
/* The page fills the window, and the bar above it only holds controls. */
.content { max-width: none; }
.topbar { height: 48px; }
.hello { display: flex; align-items: center; gap: 24px; padding: 18px 22px; margin-bottom: 16px; flex-wrap: wrap; }
.hello h1 { font-size: 26px; letter-spacing: -.03em; }
.hello > div:first-child { flex: 1 1 200px; }
.hello .next-plate { flex: 1 1 320px; width: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; }
.kpi .v { font: 500 32px/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 8px; }
.kpi .h { color: var(--faint); font-size: 12px; margin-top: 2px; }
.date-range { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-range[hidden] { display: none; }
.date-range .input { width: 150px; height: 34px; }
.gb-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 200px; padding-left: 28px; border-bottom: 1px solid var(--line-2); }
.gb-max { position: absolute; left: 0; top: 0; font: 400 11px var(--mono); color: var(--muted); }
.gb { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-radius: 4px 4px 0 0; }
.gb:hover { background: var(--plane-2); }
.gb i { flex: 0 1 12px; min-width: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.gb i.done { background: var(--ink-2); }
.gb-axis { display: flex; justify-content: space-between; padding: 6px 0 0 28px; font: 400 11px var(--mono); color: var(--muted); }
.pipe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 0 20px 18px; }
.pipe a { display: grid; gap: 4px; padding: 14px 16px; background: var(--plane-2); color: inherit; text-decoration: none; }
.pipe a:first-child { border-radius: var(--r-1) 0 0 var(--r-1); }
.pipe a:last-child { border-radius: 0 var(--r-1) var(--r-1) 0; }
.pipe a:hover { background: var(--plane-3); }
.pipe .v { font: 500 22px/1 var(--font); font-variant-numeric: tabular-nums; }
.pipe .l { color: var(--muted); font-size: 12.5px; }
.pref-row { padding: 2px 10px 10px; }
.pref-row .segmented { display: flex; }
.pref-row .segmented button { flex: 1; justify-content: center; }
.pref-swatches { display: flex; gap: 8px; padding: 4px 10px 12px; flex-wrap: wrap; }
.pref-swatch { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; }
.pref-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--plane), 0 0 0 4px var(--ink-2); }
@media (max-width: 960px) {
	.topbar .top-actions { margin-left: auto; }
	.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
	.pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pipe a, .pipe a:first-child, .pipe a:last-child { border-radius: var(--r-1); }
	.date-range .input { width: 100%; flex: 1 1 130px; }
}
dialog.panel-sheet.wide { width: min(920px, 100vw); }
.wo-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.wo-col { display: grid; gap: 16px; min-width: 0; }
.panel-sheet.wide .street-frame { height: 340px; }
@media (max-width: 760px) { .wo-grid { grid-template-columns: minmax(0, 1fr); } }
:root { --st-open: #1f5fd9; --st-inreview: #b7791f; --st-reviewed: #00908a; --st-assigned: #7c4dd8; --st-started: #c0359a; --st-complete: #18794e; --st-overdue: #b42318; --st-rejected: #6b7280; }
:root.dark { --st-open: #6a8ff2; --st-inreview: #c4861c; --st-reviewed: #00a78e; --st-assigned: #9570ee; --st-started: #e0509c; --st-complete: #2a9f68; --st-overdue: #ec5a48; --st-rejected: #8f98a6; }
.st-open { --st: var(--st-open); }
.st-inreview { --st: var(--st-inreview); }
.st-reviewed { --st: var(--st-reviewed); }
.st-assigned { --st: var(--st-assigned); }
.st-started { --st: var(--st-started); }
.st-complete { --st: var(--st-complete); }
.st-overdue { --st: var(--st-overdue); }
.st-rejected { --st: var(--st-rejected); }
.status[class*="st-"]::before { background: var(--st); }
.map-pin[class*="st-"] { background: var(--st); }
.map-pin.st-overdue { box-shadow: 0 0 0 4px color-mix(in srgb, var(--st-overdue) 30%, transparent); }
dialog.panel-sheet.wo { width: min(1040px, 100vw); }
.wo-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 400px minmax(0, 1fr); }
.wo-side { display: flex; flex-direction: column; min-height: 0; background: var(--plane-2); border-right: 1px solid var(--line); }
.wo-side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px; display: grid; gap: 14px; align-content: start; }
.wo-side-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--plane-2); }
.wo-side-foot .row { gap: 6px; }
.wo-fields { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px 12px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.wo-fields .input { background-color: var(--plane); }
.wo-rule { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
.wo-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.wo-filters .field { flex: 0 1 180px; min-width: 130px; gap: 4px; }
.wo-filters label { font-size: 12.5px; color: var(--muted); }
.wo-filters .input { height: 34px; }
.wo-filters .btn[hidden] { display: none; }
.due { font-weight: 550; }
.due.late { color: var(--crit); }
.due.soon { color: var(--warn); }
.due.done { color: var(--muted); font-weight: 400; }
.show-sm { display: none; }
.wo-tabs { align-self: flex-start; margin: 14px 24px 0; flex: none; }
.wo-compose[hidden], .thread[hidden] { display: none; }
.hint-line { font-size: 12.5px; color: var(--muted); margin: 0; }
.wo-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.wo-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; display: grid; gap: 16px; align-content: start; }
.wo-desc { padding-bottom: 16px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.eyebrow { font-size: 12px; font-weight: 550; color: var(--muted); }
.wo-thread .bubble { overflow-wrap: anywhere; white-space: pre-line; }
.wo-compose { padding: 14px 24px 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; background: var(--plane); }
.wo-compose .row { gap: 16px; }
.wo-compose textarea.input { min-height: 78px; }
.wo .edit-box { background: var(--plane); }
.wo .street-frame { height: 240px; }
@media (max-width: 860px) {
	.wo-split { display: block; overflow-y: auto; }
	.wo-side { border-right: 0; border-bottom: 1px solid var(--line); }
	.wo-side-body, .wo-thread { overflow: visible; }
}
.brand-logo.on-dark { display: none; }
.dark .brand-logo.on-light { display: none; }
.dark .brand-logo.on-dark { display: block; filter: none; }
.note-list { display: grid; gap: 10px; }
.note { padding: 10px 12px; border-radius: var(--r-1); background: var(--plane-2); overflow-wrap: anywhere; }
.note p { margin-top: 4px; }
.edit-box { border: 1px solid var(--line); border-radius: var(--r-1); padding: 10px 12px; }
.edit-box summary { cursor: pointer; font-weight: 550; font-size: 13.5px; }
.edit-box[open] summary { margin-bottom: 14px; }
.file-input { height: auto; padding: 8px 12px; }
.head-tools { align-items: center; }
.row-end { display: inline-flex; gap: 6px; justify-content: flex-end; }
.plain-set { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 16px; }
.field[hidden], .city-select[hidden] { display: none; }
.check-list { display: grid; gap: 8px; max-height: 200px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; }
.photo-row { display: flex; gap: 8px; overflow-x: auto; min-height: 100px; }
.photo-row img { display: block; width: 132px; height: 100px; object-fit: cover; border-radius: var(--r-1); }
.photo-btn { flex: none; padding: 0; border: 0; background: none; border-radius: var(--r-1); cursor: zoom-in; }
.photo-btn:hover img { opacity: .85; }
.photo-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
dialog.photo-view { position: fixed; inset: 0; margin: 0; padding: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; background: rgba(11, 14, 18, .94); color: #fff; overflow: hidden; }
dialog.photo-view::backdrop { background: transparent; }
.pv-head { position: absolute; z-index: 2; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 14px; pointer-events: none; }
.pv-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none; }
.pv-track::-webkit-scrollbar { display: none; }
.pv-slide { flex: 0 0 100%; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; padding: 64px 72px; box-sizing: border-box; scroll-snap-align: center; scroll-snap-stop: always; }
.pv-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-1); }
.pv-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; pointer-events: auto; }
.pv-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .26); }
.pv-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pv-btn:disabled { opacity: .3; cursor: default; }
.pv-btn svg { width: 22px; height: 22px; }
.pv-prev, .pv-next { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); }
.pv-prev { left: 14px; }
.pv-prev svg { transform: rotate(180deg); }
.pv-next { right: 14px; }
@media (max-width: 600px) {
	.pv-slide { padding: 64px 0; }
	.pv-prev, .pv-next { top: auto; bottom: 12px; transform: none; }
}
dl.kv { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; font-size: 13.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.mobile-menu { display: none; }
@media (max-width: 960px) {
	.mobile-menu { display: inline-flex; }
	.shell { grid-template-columns: minmax(0, 1fr); }
	.rail { position: fixed; z-index: 40; left: 0; top: 0; width: 272px; background: var(--ground); box-shadow: var(--shadow-3); transform: translateX(-100%); transition: transform .28s var(--ease-out); }
	.shell.rail-open .rail { transform: none; }
	.topbar { padding: 0 16px; }
	.content { padding: 8px 16px 40px; }
	.dash-top, .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
	.bar-row { grid-template-columns: minmax(84px, 38%) minmax(0, 1fr) 34px; gap: 8px; }
	.hide-sm { display: none; }
	.show-sm { display: block; }
	.period-row .row { flex-wrap: wrap; width: 100%; }
	.period-row .search { flex: 1 1 100%; }
	.period-row .search .input { width: 100%; min-width: 0; }
	select.input.city-select { width: 100%; }
	.page-head .search, .page-head .search .input { width: 100%; min-width: 0; }
	.stat-hero .big { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) { .rail { transition: none; } }
