/* INSPEKTA v46 — final Google Stitch implementation layer.
   Loaded after all legacy styles so the Stitch information architecture wins
   without changing legacy IDs, forms, routes, Leaflet, or panorama behavior. */
:root{
  --st46-primary:#0b67b8;
  --st46-primary-strong:#00569c;
  --st46-sidebar:#2b2f35;
  --st46-surface:#ffffff;
  --st46-soft:#f5f7fb;
  --st46-line:#d9e0ea;
  --st46-text:#142139;
  --st46-muted:#68758a;
  --st46-success:#11805f;
  --st46-warning:#c56b0a;
  --st46-danger:#c3261d;
}

/* Admin: restore the exact Stitch panel-left/map-right hierarchy. */
.admin-workbench{
  grid-template-areas:"panel map"!important;
  grid-template-columns:407px minmax(0,1fr)!important;
}
.admin-left{
  grid-area:panel!important;
  order:1!important;
  background:#f7f8fc!important;
}
.admin-map-panel{
  grid-area:map!important;
  order:2!important;
}
.admin-left::before{content:none!important;display:none!important}
.admin-tab[data-panel="dashboard"]>.dashboard-intro{display:none!important}
.stitch-panel-heading{
  display:flex;
  align-items:center;
  gap:9px;
  margin:0 0 12px;
  color:var(--st46-text);
  font-size:18px;
  line-height:1.25;
  font-weight:750;
  letter-spacing:-.02em;
}
.stitch-panel-heading:not(:first-child){margin-top:22px}
.stitch-panel-heading .stitch-heading-icon{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  color:var(--st46-primary);
  font-size:17px;
}
.admin-tab[data-panel="dashboard"] .quick-grid{grid-template-columns:1fr 1fr!important}
.admin-tab[data-panel="dashboard"] .quick-card{
  min-height:84px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  text-align:center!important;
  background:#fff!important;
  border:1px solid #d8dfeb!important;
  border-radius:8px!important;
  padding:13px!important;
}
.admin-tab[data-panel="dashboard"] .quick-card strong{font-size:13px!important}
.admin-tab[data-panel="dashboard"] .quick-card span{font-size:10px!important;margin-top:5px!important}
.admin-tab[data-panel="dashboard"] .admin-note-card{margin-top:20px!important}
.dashboard-issues .simple-item{border-left:5px solid var(--st46-primary)!important}
.dashboard-issues .simple-item.qc-high{border-left-color:var(--st46-danger)!important}
.dashboard-issues .simple-item.qc-medium{border-left-color:var(--st46-warning)!important}
.dashboard-di-progress .simple-item{padding:11px 12px!important}

/* Full executive canvas for Statistics and Settings, as in the Stitch screens. */
body[data-admin-tab="statistics"] .admin-workbench,
body[data-admin-tab="settings"] .admin-workbench{
  display:block!important;
  overflow:auto!important;
  background:#f6f7fb!important;
}
body[data-admin-tab="statistics"] .admin-map-panel,
body[data-admin-tab="settings"] .admin-map-panel{display:none!important}
body[data-admin-tab="statistics"] .admin-left,
body[data-admin-tab="settings"] .admin-left{
  width:100%!important;
  height:auto!important;
  min-height:100%!important;
  max-height:none!important;
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  padding:28px!important;
  background:#f6f7fb!important;
}
body[data-admin-tab="statistics"] .admin-tab[data-panel="statistics"],
body[data-admin-tab="settings"] .admin-tab[data-panel="settings"]{max-width:1500px;margin:0 auto}
body[data-admin-tab="statistics"] .tab-head{margin-bottom:18px!important}
body[data-admin-tab="statistics"] .tab-head h2{font-size:32px!important;line-height:1.15!important}
body[data-admin-tab="statistics"] .statistics-toolbar{
  justify-content:flex-end!important;
  gap:12px!important;
  margin-top:-58px!important;
  margin-bottom:30px!important;
}
body[data-admin-tab="statistics"] .executive-kpi-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:18px!important;
  margin-bottom:22px!important;
}
body[data-admin-tab="statistics"] .executive-kpi-grid article{
  min-height:126px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  border-radius:8px!important;
  padding:22px!important;
  border-left:4px solid var(--st46-primary)!important;
}
body[data-admin-tab="statistics"] .executive-kpi-grid article:nth-child(2){border-left-color:var(--st46-success)!important}
body[data-admin-tab="statistics"] .executive-kpi-grid article:nth-child(3){border-left-color:var(--st46-warning)!important}
body[data-admin-tab="statistics"] .executive-kpi-grid article:nth-child(4){border-left-color:var(--st46-danger)!important}
body[data-admin-tab="statistics"] .executive-kpi-grid strong{font-size:38px!important;margin-top:14px}
body[data-admin-tab="statistics"] .statistics-grid{
  display:grid!important;
  grid-template-columns:minmax(300px,.92fr) minmax(520px,1.85fr)!important;
  gap:20px!important;
  align-items:stretch;
}
body[data-admin-tab="statistics"] .stat-visual-card{
  min-height:330px;
  border-radius:8px!important;
  padding:24px!important;
}
body[data-admin-tab="statistics"] .stat-visual-card.statistics-progress-card{
  grid-column:1!important;
  min-height:320px;
}
body[data-admin-tab="statistics"] .stat-visual-card.statistics-map-card{
  grid-column:2!important;
  min-height:320px;
  padding:0!important;
  overflow:hidden!important;
  position:relative;
}
.statistics-map-card .card-title{
  position:absolute;
  z-index:450;
  top:16px;
  left:50%;
  transform:translateX(-50%);
  padding:9px 14px;
  border:1px solid var(--st46-line);
  border-radius:7px;
  background:rgba(255,255,255,.96);
  box-shadow:0 8px 22px rgba(26,42,65,.12);
  white-space:nowrap;
}
.statistics-map{width:100%;height:100%;min-height:320px;background:#e8edf3}
.statistics-map-empty{height:100%;min-height:320px;display:grid;place-items:center;color:var(--st46-muted);font-size:12px}
body[data-admin-tab="statistics"] .condition-donut{width:170px!important;height:170px!important}
body[data-admin-tab="statistics"] .condition-donut::after{inset:34px!important}
body[data-admin-tab="statistics"] .anomaly-trend{height:220px!important}
body[data-admin-tab="statistics"] .statistics-di-progress>div{grid-template-columns:180px 1fr 52px!important;padding:12px 0!important}

/* Viewer institution header from the enhanced Stitch viewer. */
.viewer-brand-logos{display:flex;align-items:center;gap:7px;padding-right:16px;border-right:1px solid #d7dee8}
.viewer-brand-logos img:first-child{width:24px;height:30px;object-fit:contain}
.viewer-brand-logos img:last-child{width:83px;height:30px;object-fit:contain}
.viewer-topbar .scene-meta{min-width:0}
.viewer-topbar .scene-meta h1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:540px}

/* Login: keep operational guidance without displaying a password publicly. */
.auth-warning{line-height:1.55!important}
.auth-alert{border-radius:7px!important}

/* Mobile inspector refinements from the Stitch mobile screen. */
.inspector-form h1{font-size:28px;letter-spacing:-.035em;color:var(--st46-text);margin:2px 0 8px}
.inspector-form h2{font-size:18px;color:var(--st46-text);margin:0 0 8px}
.inspector-actions button{font-size:12px;line-height:1.55}
.inspector-header strong{color:#17253b;font-size:13px}

/* Split view toolbar stays readable on medium screens. */
.compare-toolbar{min-height:72px;height:auto!important}
.compare-selects select{min-width:0}

@media (max-width:1180px){
  .admin-workbench{grid-template-columns:370px minmax(0,1fr)!important}
  body[data-admin-tab="statistics"] .executive-kpi-grid{grid-template-columns:repeat(2,1fr)!important}
  body[data-admin-tab="statistics"] .statistics-grid{grid-template-columns:1fr 1.5fr!important}
  body[data-admin-tab="statistics"] .statistics-toolbar{margin-top:0!important;justify-content:flex-start!important}
}
@media (max-width:820px){
  .admin-workbench{grid-template-areas:"panel" "map"!important;grid-template-columns:1fr!important;overflow:auto!important}
  .admin-map-panel{min-height:620px!important}
  .viewer-brand-logos{display:none}
  body[data-admin-tab="statistics"] .admin-left,body[data-admin-tab="settings"] .admin-left{padding:18px!important}
  body[data-admin-tab="statistics"] .statistics-grid{grid-template-columns:1fr!important}
  body[data-admin-tab="statistics"] .stat-visual-card.statistics-progress-card,
  body[data-admin-tab="statistics"] .stat-visual-card.statistics-map-card{grid-column:1!important}
}
@media (max-width:600px){
  .admin-tab[data-panel="dashboard"] .quick-grid{grid-template-columns:1fr!important}
  body[data-admin-tab="statistics"] .executive-kpi-grid{grid-template-columns:1fr 1fr!important;gap:10px!important}
  body[data-admin-tab="statistics"] .executive-kpi-grid article{min-height:102px;padding:14px!important}
  body[data-admin-tab="statistics"] .executive-kpi-grid strong{font-size:28px!important}
  body[data-admin-tab="statistics"] .tab-head h2{font-size:26px!important}
}

/* Final collision fixes found during rendered-layout verification. */
body[data-admin-tab="dashboard"] .map-selection-panel{display:none!important}
.map-legend{
  top:auto!important;
  bottom:18px!important;
  height:auto!important;
  min-height:0!important;
  align-content:start!important;
  gap:7px!important;
  padding:12px!important;
}
body[data-admin-tab="statistics"] .statistics-toolbar select{
  width:auto!important;
  min-width:150px!important;
  flex:0 0 auto!important;
}
body[data-admin-tab="statistics"] .statistics-toolbar .btn{white-space:nowrap!important}
.statistics-map-card .card-title span{display:none!important}
