/* Dogs Welcome admin centre: laid out like Microsoft 365 admin (Fluent look) */
:root {
  --bg: #faf9f8; --surface: #ffffff; --ink: #242424; --muted: #616161; --line: #e0e0e0; --line2: #d1d1d1;
  --brand: #0f6cbd; --brand-dark: #115ea3; --brand-tint: #ebf3fc; --top: #0f6cbd; --top-ink: #fff;
  --nav: #f0f0f0; --nav-hover: #e6e6e6; --sel: #ebf3fc; --danger: #c50f1f; --ok: #107c10; --warn: #bc4b09;
  --shadow: 0 8px 16px rgba(0,0,0,.14), 0 0 2px rgba(0,0,0,.12);
  font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f1f1f; --surface: #292929; --ink: #f0f0f0; --muted: #adadad; --line: #3d3d3d; --line2: #525252;
    --brand: #479ef5; --brand-dark: #62abf5; --brand-tint: #1b2b3c; --top: #0c3b5e; --nav: #242424; --nav-hover: #333;
    --sel: #1b2b3c; --danger: #f1707b; --ok: #54b054; --warn: #f4a46b; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); }
h1 { font-size: 24px; font-weight: 600; margin: 4px 0 16px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.small { color: var(--muted); font-size: 13px; }
button { font: inherit; color: inherit; }

/* top bar */
.top { height: 48px; background: var(--top); color: var(--top-ink); display: flex; align-items: center; gap: 16px; padding: 0 16px; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.brand img { background: #fff; border-radius: 4px; padding: 2px; }
.brand-sub { font-weight: 400; opacity: .9; border-left: 1px solid rgba(255,255,255,.4); padding-left: 8px; }
.top-search { flex: 1; max-width: 460px; margin: 0 auto; }
.top-search input { width: 100%; height: 32px; border: 0; border-radius: 4px; padding: 0 12px; font: inherit; background: #fff; color: #242424; }
.top-right { display: flex; gap: 16px; align-items: center; white-space: nowrap; }
.top-right a, .top-right .link { color: var(--top-ink); }

/* shell */
.shell { display: flex; min-height: calc(100vh - 48px); }
.nav { width: 228px; flex: none; background: var(--nav); border-right: 1px solid var(--line); padding: 8px 0; position: sticky; top: 48px; height: calc(100vh - 48px); overflow: auto; }
.nav a, .nav .soon { display: flex; align-items: center; gap: 12px; padding: 8px 16px; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
.nav a:hover { background: var(--nav-hover); }
.nav a[aria-current="page"] { background: var(--surface); border-left-color: var(--brand); font-weight: 600; }
.nav .soon { color: var(--muted); cursor: default; }
.nav .ic { font-style: normal; width: 18px; text-align: center; }
.nav-head { font-size: 12px; color: var(--muted); padding: 14px 19px 4px; text-transform: uppercase; letter-spacing: .04em; }
.main { flex: 1; min-width: 0; padding: 20px 28px 40px; }

/* cards and tiles */
.card { background: var(--surface); border-radius: 8px; padding: 16px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 2px rgba(0,0,0,.06); }
.card.narrow { max-width: 520px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border-radius: 8px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.08); text-decoration: none; color: inherit; display: block; }
.tile b { display: block; font-size: 26px; font-weight: 600; }
.tile span { color: var(--muted); font-size: 13px; }
a.tile:hover { outline: 1px solid var(--brand); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.todo li:last-child { border-bottom: 0; }
.bar { display: grid; grid-template-columns: 140px 1fr 56px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.bar i { display: block; height: 8px; border-radius: 4px; background: var(--brand); }
.bar .t { background: var(--line); border-radius: 4px; }
.chip { display: inline-block; border-radius: 10px; padding: 0 8px; font-size: 12px; line-height: 20px; background: var(--line); }
.chip.ok { background: #dff6dd; color: #0e700e; } .chip.bad { background: #fde7e9; color: #b10e1c; } .chip.run { background: var(--brand-tint); color: var(--brand); }
.jobs td { padding: 4px 8px 4px 0; vertical-align: top; }

/* command bar, filters */
.cmdbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; background: var(--surface); border-radius: 8px 8px 0 0; padding: 4px 8px; border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.cmd { border: 0; background: transparent; padding: 6px 10px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.cmd:hover:not(:disabled) { background: var(--nav-hover); }
.cmd:disabled { color: var(--muted); opacity: .6; cursor: default; }
.cmd.danger:not(:disabled) { color: var(--danger); }
.cmd-menu { position: relative; }
.menu { position: absolute; top: 100%; left: 0; z-index: 30; background: var(--surface); box-shadow: var(--shadow); border-radius: 6px; padding: 4px 0; min-width: 220px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 14px; cursor: pointer; }
.menu button:hover { background: var(--nav-hover); }
.sep { width: 1px; height: 20px; background: var(--line2); margin: 0 6px; }
.cmd-count { margin-left: auto; color: var(--muted); font-size: 13px; padding-right: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; background: var(--surface); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.filters.tight { padding: 8px 10px; border-radius: 8px 8px 0 0; }
.filters label, .inline { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.inline { flex-direction: row; align-items: center; gap: 6px; padding: 0 6px; }
select, input[type="search"], input[type="text"], input[type="password"], input[type="url"], input[type="tel"], textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line2); border-bottom-color: #616161; border-radius: 4px; padding: 5px 8px; min-height: 32px; }
textarea { min-height: 72px; resize: vertical; width: 100%; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.link { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 6px 4px; text-decoration: underline; }
.btn { border: 1px solid var(--line2); background: var(--surface); border-radius: 4px; padding: 6px 16px; min-height: 32px; cursor: pointer; font-weight: 600; }
.btn:hover:not(:disabled) { background: var(--nav-hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-weight: 600; font-size: 13px; }
.field input, .field select, .field textarea { font-weight: 400; width: 100%; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.err { color: var(--danger); }

/* data grid */
.tablewrap { background: var(--surface); overflow: auto; box-shadow: 0 1px 2px rgba(0,0,0,.06); border-radius: 0 0 8px 8px; }
.grid { border-collapse: collapse; width: 100%; font-size: 14px; }
.grid th { text-align: left; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); cursor: default; }
.grid th[data-sort] { cursor: pointer; } .grid th[data-sort]:hover { background: var(--nav-hover); }
.grid th .arrow { color: var(--muted); font-weight: 400; }
.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tr:hover td { background: var(--nav-hover); }
.grid tr.sel td { background: var(--sel); }
.grid .ck { width: 34px; }
.grid .nm { color: var(--brand); cursor: pointer; font-weight: 600; background: none; border: 0; padding: 0; text-align: left; }
.grid .nm:hover { text-decoration: underline; }
.grid .edited { color: var(--warn); font-size: 12px; margin-left: 6px; }
.grid .det { max-width: 420px; color: var(--muted); font-size: 13px; white-space: pre-line; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 0; color: var(--muted); }

/* side panel */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 40; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 50; box-shadow: var(--shadow); transform: translateX(105%); transition: transform .18s ease; display: flex; flex-direction: column; }
.panel.open { transform: none; }
.panel header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 8px; }
.panel header h2 { font-size: 20px; margin: 0; }
.panel .x { border: 0; background: none; font-size: 18px; cursor: pointer; padding: 6px; }
.panel-body { flex: 1; overflow: auto; padding: 8px 24px 16px; }
.panel footer { padding: 12px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.note { background: var(--brand-tint); border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }

/* pins */
.pins { display: grid; grid-template-columns: 360px 1fr; gap: 16px; height: calc(100vh - 200px); min-height: 480px; }
.pins-list { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.plist { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.plist li { padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.plist li:hover { background: var(--nav-hover); } .plist li.on { background: var(--sel); }
.plist li small { display: block; color: var(--muted); }
.plist li.moved b::after { content: " · moved"; color: var(--warn); font-weight: 400; font-size: 12px; }
.pins-map { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06); overflow: hidden; }
.pin-tools { padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; position: relative; border-bottom: 1px solid var(--line); }
.pin-find { display: flex; gap: 6px; margin-left: auto; } .pin-find input { width: 280px; }
.hits { position: absolute; right: 12px; top: 48px; z-index: 1000; list-style: none; margin: 0; padding: 4px 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 6px; max-width: 460px; }
.hits li { padding: 7px 12px; cursor: pointer; font-size: 13px; } .hits li:hover { background: var(--nav-hover); }
.map { flex: 1; min-height: 300px; }
.leaflet-control-layers { border: 0 !important; box-shadow: 0 1px 4px rgba(0,0,0,.25) !important; border-radius: 10px !important; }
.leaflet-control-layers-expanded { padding: 8px 12px; font-size: .92rem; }
.leaflet-control-layers label { padding: 4px 0; }
.pin-save { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.pin-save .small { margin-right: auto; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #242424; color: #fff; padding: 10px 18px; border-radius: 6px; z-index: 60; box-shadow: var(--shadow); max-width: 90vw; }

@media (max-width: 900px) {
  .nav { width: 64px; } .nav a, .nav .soon { font-size: 0; justify-content: center; padding: 10px 0; } .nav .ic { font-size: 18px; } .nav-head { display: none; }
  .brand-sub, .top-right a { display: none; }
  .main { padding: 16px; }
  .pins { grid-template-columns: 1fr; height: auto; } .pins-list { max-height: 320px; } .map { height: 420px; }
  .pin-find input { width: 180px; }
}

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }
.ph-card { background: var(--surface); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.08); cursor: pointer; border: 0; padding: 0; text-align: left; }
.ph-card:hover { outline: 2px solid var(--brand); }
.ph-card img { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--line); }
.ph-card div { padding: 8px 10px; font-size: 13px; }
.ph-card small { color: var(--muted); display: block; }
.ph-list { display: grid; gap: 14px; }
.ph-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ph-item img { width: 100%; max-height: 260px; object-fit: cover; display: block; background: var(--line); }
.ph-item.bad img { opacity: .35; }
.ph-item .row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; font-size: 13px; }
.ph-item .row span { flex: 1; color: var(--muted); }
/* confirmations */
.st { display: inline-block; border-radius: 10px; padding: 0 8px; font-size: 12px; line-height: 20px; background: var(--line); white-space: nowrap; }
.st.inside { background: #dff6dd; color: #0e700e; } .st.outside { background: #fff4ce; color: #835b00; } .st.no, .st.closed { background: #fde7e9; color: #b10e1c; }
.st.contacted { background: var(--brand-tint); color: var(--brand); } .st.noreply { background: #f1e5fb; color: #6b2fa3; }
.applied { color: var(--ok); font-size: 12px; }
.pending { color: var(--warn); font-size: 12px; }
.stbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.stbtns button { border: 1px solid var(--line2); background: var(--surface); border-radius: 14px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.stbtns button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.contact-links a { border: 1px solid var(--line2); border-radius: 4px; padding: 5px 10px; text-decoration: none; font-weight: 600; font-size: 13px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-bottom: 10px; }
a.btn { display: inline-block; text-decoration: none; color: var(--ink); line-height: 18px; }

code { background: var(--nav); padding: 0 4px; border-radius: 3px; font-size: 12px; }
.dogq { font-size: 13px; color: var(--muted); border-left: 3px solid var(--brand); padding: 2px 8px; margin: 4px 0; }
.chip.dog { background: #dff6dd; color: #0e700e; }
.chip.pin-town { background: #fde7e9; color: #b10e1c; }
.chip.pin-street { background: #fff4d6; color: #7a5300; }
.chip.pin-area { background: #e6f0ff; color: #1f4f99; }
.im-err td { background: #fde7e9; }
.hi-files { font-size: 12px; color: var(--muted); }

/* one-tap approve / reject on suggestions */
.quick{display:inline-flex;gap:4px;margin-left:6px;vertical-align:middle}
.cmd.mini{padding:2px 9px;min-width:0}
.am-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; margin-top: 6px; }
.am-grid .check { margin-bottom: 6px; }
fieldset.field { border: 0; padding: 0; margin-inline: 0; }

/* Category order */
.or-list { list-style: none; padding: 0; margin: 12px 0; max-width: 520px; counter-reset: or; }
.or-list li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; background: var(--surface); counter-increment: or; }
.or-list li::before { content: counter(or); width: 1.6em; color: var(--muted); font-variant-numeric: tabular-nums; }
.or-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.or-name { flex: 1; }
.or-list .btn { padding: 2px 10px; }

/* clear (X) button inside search boxes */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.sx { position: relative; display: inline-flex; align-items: center; }
.sx input { padding-right: 30px !important; }
.top-search .sx, .filters .sx { display: flex; width: 100%; } .top-search .sx input, .filters .sx input { width: 100%; }
.sx-x { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #666; font-size: 18px; line-height: 24px; cursor: pointer; }
.sx-x:hover { background: rgba(0,0,0,.08); color: #242424; }
.sx-x[hidden] { display: none; }
.pin-auto { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
