/* pws-watch: admin review. */

/* Admin draft only; current admin retains its original dimensions and controller. */
body.admin-review main { width:calc(100% - clamp(24px,4vw,80px)); max-width:2000px; }
.review-banner { display:flex; justify-content:space-between; gap:16px; color:var(--muted); }
.review-banner a { color:var(--accent); }
.review-scope,.review-definitions { margin:18px 0; padding:16px 20px; line-height:1.6; }
.review-scope { border-left:3px solid var(--accent); }
.review-definitions p { max-width:100ch; }
.admin-review .grid { grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.admin-review .controls { align-items:end; }
.review-connection > label { display:block; margin-top:12px; }
.admin-review summary { cursor:pointer; min-height:44px; padding:10px 0; }
.admin-review summary:focus-visible { outline:2px solid var(--accent); }
.review-group { margin:16px 0; padding:12px 20px; }
.review-group > summary { font-size:20px; font-weight:750; }
.review-group > summary span { display:block; font-size:14px; font-weight:400; color:var(--muted); margin:6px 0 0 20px; }
.review-group-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding-top:12px; }
.review-event-filters { display:flex; align-items:end; gap:16px; flex-wrap:wrap; padding:14px 0; }
.review-event-filters label { display:grid; gap:6px; }
.review-event-filters p { color:var(--muted); font-size:14px; }
.admin-review .recent-events-table { table-layout:auto; min-width:720px; }
.admin-review .recent-events-table td { white-space:normal; max-width:none; overflow:visible; }
.admin-review pre { white-space:pre-wrap; overflow-wrap:anywhere; max-width:70ch; font-size:13px; }
.review-billing-scope { grid-column:1 / -1; color:var(--muted); line-height:1.6; }
.admin-review .metric-list { font-size:14px; }
@media(max-width:760px) {
 .review-group-grid { grid-template-columns:1fr; }
 .review-event-filters { align-items:stretch; }
 .review-event-filters label { flex:1 1 180px; }
 .review-banner { font-size:14px; }
}
.admin-station-map-panel { margin:18px 0; overflow:hidden; }
.admin-map-heading { padding:16px 20px; display:flex; justify-content:space-between; align-items:center; gap:16px; }
.admin-map-heading p { color:var(--muted); font-size:14px; line-height:1.5; margin:8px 0 0; max-width:100ch; }
#adminStationMap { height:360px; background:#06283c; z-index:0; }
.admin-map-carto { filter:sepia(1) saturate(4) hue-rotate(145deg) brightness(1.5); }
.admin-map-station-list { display:flex; flex-wrap:wrap; gap:12px 24px; padding:12px 20px; margin:0; list-style:none; }
.admin-map-station-list a { color:var(--accent); font-size:14px; }
.admin-review .leaflet-popup-content a { color:#00667c; }
@media(max-width:760px) { #adminStationMap { height:280px; } .admin-map-heading { align-items:flex-start; flex-direction:column; } }
/* Use the same blue, right-aligned disclosure affordance for native details and cards. */
.admin-review summary { position:relative; list-style:none; padding-right:44px; }
.admin-review summary::-webkit-details-marker { display:none; }
.admin-review summary::after {
  content:""; position:absolute; right:0; top:50%; width:30px; height:30px;
  border:1px solid var(--line); border-radius:8px;
  background:rgba(0,147,168,.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%230093a8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px 18px no-repeat;
  transform:translateY(-50%) rotate(-90deg); transition:transform 140ms ease;
}
.admin-review details[open] > summary::after { transform:translateY(-50%); }
.admin-review .review-group > summary span { margin-left:0; }
@media(prefers-reduced-motion:reduce) { .admin-review summary::after { transition:none; } }
/* Explicit paired colors avoid the shared theme's pale background/white label combination. */
.admin-review #adminMapFit {
  color:#07576a;
  background:#e7f5f8;
  border:1px solid #739eaa;
  min-height:44px;
}
.admin-review #adminMapFit:hover { background:#cce9ef; }
html[data-theme="dark"] .admin-review #adminMapFit {
  color:#bceff7;
  background:#123746;
  border-color:#408697;
}
html[data-theme="dark"] .admin-review #adminMapFit:hover { background:#1b4b5e; }
.admin-review #adminMapFit:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }

/* The operations controls stay available while tables and the station map scroll. */
html:has(body.admin-review) { scroll-padding-top:var(--sticky-header-offset, 180px); }
body.admin-review main > header {
  position:sticky;
  top:0;
  z-index:100;
  background:var(--panel);
  backdrop-filter:blur(16px);
}

/* Match the dashboard's flat surfaces and restrained corner treatment. */
body.admin-review .panel { border-radius:8px; box-shadow:none; }
body.admin-review main > header {
  border-radius:0;
  border:0;
  border-bottom:1px solid var(--line);
  box-shadow:none;
}
body.admin-review input,
body.admin-review select,
body.admin-review button { border-radius:8px; }

body.admin-review main > header { display:flex; flex-wrap:wrap; align-items:center; }
body.admin-review main > header .controls { flex:0 0 100%; order:3; }
.admin-section-navigation {
  display:flex;
  gap:24px;
  margin-left:auto;
  max-width:100%;
  overflow-x:auto;
}
@media(max-width:1100px) {
  .admin-section-navigation { width:100%; margin-left:0; }
}
.admin-section-navigation a {
  display:flex;
  align-items:center;
  min-height:44px;
  flex-shrink:0;
  color:var(--ink);
  font-size:14px;
  text-decoration:none;
}
.admin-section-navigation a:hover { color:var(--accent); text-decoration:underline; }
.admin-section-navigation a:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }

/* Collapsed headers retain useful data; expanded sections show their full breakdowns. */
.admin-review .review-section-data { color:var(--ink); font-size:14px; line-height:1.6; font-weight:500; }
.admin-review .review-group:not([open]) > summary > span:not(.review-section-data) { display:none; }
.admin-review .review-group[open] .review-section-data { display:none; }
.admin-review .admin-card:not(.collapsed) > .review-section-data { display:none; }
.admin-review .admin-card > .review-section-data { margin:8px 44px 0 0; }
