/* @fileoverview Map data view: reuses the shell tokens (app.css, footprints-theme.css); adds layout for tiles, chips, sub-tabs, cards and the map. */
#mapstatusView .ms-subtabs{display:flex;gap:6px;border-bottom:1px solid var(--line);margin-bottom:16px;flex-wrap:wrap}
#mapstatusView .ms-subtab{background:transparent;border:0;border-bottom:3px solid transparent;padding:10px 16px;font-weight:700;color:var(--muted)}
#mapstatusView .ms-subtab:hover{color:var(--ink)}
#mapstatusView .ms-subtab.active{color:var(--forest);border-color:var(--forest-2)}
#mapstatusView .ms-kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px;margin-bottom:20px}
#mapstatusView .ms-kpi{background:white;border:1px solid var(--line);padding:14px;display:grid;gap:4px;border-radius:6px}
#mapstatusView .ms-kpi span{font:600 10px ui-monospace,SFMono-Regular,Consolas,monospace;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
#mapstatusView .ms-kpi strong{font:500 26px ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--forest)}
#mapstatusView .ms-kpi small{color:var(--muted)}
#mapstatusView .ms-kpi.ok{border-color:var(--forest-2);background:var(--mint)}
#mapstatusView .ms-kpi.warn{background:var(--amber)}
#mapstatusView .ms-block{margin-bottom:24px}
#mapstatusView .ms-block>h3{margin:0 0 8px;font-size:16px}
#mapstatusView .ms-block h4{margin:12px 0 6px;font-size:13px}
#mapstatusView .ms-facts{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px;margin:0 0 12px}
#mapstatusView .ms-facts>div{background:white;border:1px solid var(--line);padding:10px;border-radius:6px;min-width:0}
#mapstatusView .ms-facts dt{font:600 10px ui-monospace,SFMono-Regular,Consolas,monospace;text-transform:uppercase;color:var(--muted)}
#mapstatusView .ms-facts dd{margin:4px 0 0;font-weight:700;overflow-wrap:anywhere}
#mapstatusView .ms-url{font-weight:500;font-size:12px}
#mapstatusView .ms-warnings{color:var(--danger);margin:0 0 12px 18px;padding:0}
#mapstatusView .ms-layer-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px}
#mapstatusView .ms-layer,#mapstatusView .ms-source,#mapstatusView .ms-run{background:white;border:1px solid var(--line);border-radius:6px;padding:12px}
#mapstatusView .ms-layer header,#mapstatusView .ms-source header{display:flex;justify-content:space-between;align-items:center;gap:8px}
#mapstatusView .ms-layer h4,#mapstatusView .ms-source h4,#mapstatusView .ms-run h4{margin:0;font-size:14px}
#mapstatusView .ms-layer p,#mapstatusView .ms-source p{margin:6px 0 0}
#mapstatusView .ms-layer-n{font-weight:700}
#mapstatusView .ms-sources{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:12px}
#mapstatusView .ms-metrics code{font-size:11px;background:var(--paper);padding:1px 5px;border-radius:3px;display:inline-block;margin:1px 0}
#mapstatusView .ms-bar{display:grid;grid-template-columns:minmax(80px,150px) 1fr minmax(52px,auto);gap:8px;align-items:center;margin:5px 0;font-size:12px}
#mapstatusView .ms-bar span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#mapstatusView .ms-bar progress,#mapstatusView td progress{width:100%;height:10px;accent-color:var(--forest-2)}
#mapstatusView .ms-bar em{font-style:normal;text-align:right;font-variant-numeric:tabular-nums}
#mapstatusView .ms-chip{display:inline-block;padding:2px 8px;border-radius:999px;font:600 11px/16px var(--fp-font,system-ui);white-space:nowrap;background:#edf2ee;color:#424242}
#mapstatusView .ms-ok{background:#dff3e4;color:#14612b}
#mapstatusView .ms-part{background:#fff4ce;color:#6a5300}
#mapstatusView .ms-low{background:#fbe0e0;color:var(--danger)}
#mapstatusView .ms-bad{background:#fbe0e0;color:var(--danger)}
#mapstatusView .ms-going{background:#dbeafe;color:#1e4f9a;padding:2px 8px;border:0}
#mapstatusView .ms-wait{background:#ede9fe;color:#4c3a9a}
#mapstatusView .ms-mute{background:#f1f3f5;color:#616161}
#mapstatusView .ms-filters{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin-bottom:12px}
#mapstatusView .ms-search{display:grid;gap:4px;font:600 12px/16px var(--fp-font,system-ui);color:var(--fp-fg2,#424242)}
#mapstatusView .ms-search input{height:32px;min-width:220px;border:1px solid var(--line-dark);border-radius:5px;padding:0 10px}
#mapstatusView .ms-seg{display:inline-flex;border:1px solid var(--line-dark);border-radius:5px;overflow:hidden}
#mapstatusView .ms-seg-btn{background:white;border:0;border-right:1px solid var(--line-dark);padding:5px 16px;font-weight:600;min-height:32px}
#mapstatusView .ms-seg-btn:last-child{border-right:0}
#mapstatusView .ms-seg-btn.active{background:var(--fp-accent-bg2,#FEF6F1);color:var(--fp-accent-text,#B44E0F);box-shadow:inset 0 -2px var(--fp-accent,#E66414)}
#mapstatusView .ms-scroll{max-height:560px;overflow:auto;background:white;border:1px solid var(--line);margin-bottom:8px}
#mapstatusView .ms-grid{min-width:0}
#mapstatusView .ms-grid td{height:auto}
#mapstatusView .ms-grid th{position:sticky;top:0;z-index:1}
#mapstatusView .num{text-align:right;font-variant-numeric:tabular-nums}
#mapstatusView .ms-wrap{white-space:normal;word-break:break-word;max-width:420px}
#mapstatusView .ms-error{font:12px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--danger)}
#mapstatusView .ms-runid{font:11px ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--muted);word-break:break-all}
#mapstatusView .ms-clickable{cursor:pointer}
#mapstatusView .ms-clickable:hover td{background:var(--fp-row-hover,#f8fafc)}
#mapstatusView .ms-link{background:none;border:0;padding:0;color:var(--fp-accent-text,var(--forest-2));font-weight:700;text-align:left;text-decoration:underline;cursor:pointer}
#mapstatusView .ms-failed td{background:#fffafa}
#mapstatusView .ms-fixed td{color:var(--muted)}
#mapstatusView .ms-reason{font:12px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace}
#mapstatusView .ms-small{min-height:26px;padding:2px 10px;font-size:12px}
#mapstatusView .ms-live{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
#mapstatusView .ms-run{margin-bottom:10px}
#mapstatusView .ms-run>header{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:start}
#mapstatusView .ms-run-meta{display:flex;gap:10px;align-items:center}
#mapstatusView .ms-chips{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
#mapstatusView .ms-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:8px 0}
#mapstatusView .ms-chart{width:100%;height:260px;background:white;border:1px solid var(--line);margin-bottom:10px}
#mapstatusView .ms-confirm{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);width:min(480px,calc(100vw - 32px));background:white;border:1px solid var(--line-dark);border-radius:8px;box-shadow:var(--shadow);padding:16px 20px;z-index:50}
#mapstatusView .ms-confirm[hidden],#mapstatusView .ms-log[hidden]{display:none}
#mapstatusView .ms-confirm h3{margin:0 0 6px;font-size:16px}
#mapstatusView .ms-confirm .ms-actions{justify-content:flex-end}
#mapstatusView .ms-log{position:fixed;top:0;right:0;bottom:0;width:min(760px,100vw);background:white;border-left:1px solid var(--line-dark);box-shadow:var(--shadow);padding:16px 20px;z-index:40;display:flex;flex-direction:column;gap:6px}
#mapstatusView .ms-log header{display:flex;justify-content:space-between;align-items:center}
#mapstatusView .ms-log h3{margin:0;font-size:15px;overflow-wrap:anywhere}
#mapstatusView .ms-log pre{flex:1;overflow:auto;margin:0;background:#f6f7f9;border:1px solid var(--line);padding:10px;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;word-break:break-word}
#mapstatusView .ms-form{display:flex;flex-wrap:wrap;gap:12px;align-items:end;background:white;border:1px solid var(--line);padding:12px;border-radius:6px}
#mapstatusView .ms-form>label{display:grid;gap:5px;flex:1 1 200px;margin:0}
#mapstatusView .ms-form select{width:100%;height:32px}
#mapstatusView .ms-layers{display:flex;gap:14px;flex-wrap:wrap;border:0;padding:0;margin:0}
#mapstatusView .ms-layers legend{font:600 12px/16px var(--fp-font,system-ui);padding:0;margin-bottom:6px}
#mapstatusView .ms-layers label{display:flex;gap:6px;align-items:center;margin:0;font-weight:600}
#mapstatusView .ms-layers input{width:16px;height:16px;accent-color:var(--forest-2)}
#mapstatusView .ms-mapwrap{position:relative}
#mapstatusView .ms-map{width:100%;height:min(66vh,640px);min-height:340px;border:1px solid var(--line-dark);border-radius:6px;background:#e8ecef;z-index:0}
#mapstatusView .ms-legend{position:absolute;right:12px;bottom:28px;z-index:500;background:rgba(255,255,255,.94);border:1px solid var(--line-dark);border-radius:6px;padding:8px 10px;font-size:12px;display:grid;gap:3px}
#mapstatusView .ms-legend[hidden]{display:none}
#mapstatusView .ms-legend div{display:flex;gap:6px;align-items:center}
#mapstatusView .ms-legend i{width:16px;height:12px;display:inline-block;border:1px solid rgba(0,0,0,.15)}
#mapstatusView button:focus-visible,#mapstatusView input:focus-visible,#mapstatusView select:focus-visible,#mapstatusView pre:focus-visible{outline:2px solid var(--fp-accent,#E66414);outline-offset:2px}
@media (max-width:720px){
  #mapstatusView .ms-sources{grid-template-columns:1fr}
  #mapstatusView .ms-subtab{padding:8px 10px}
  #mapstatusView .ms-search input{min-width:0;width:100%}
  #mapstatusView .ms-search{flex:1 1 100%}
}
#mapstatusView .ms-stage{grid-template-columns:minmax(120px,210px) 1fr minmax(52px,auto)}
#mapstatusView .ms-stage .ms-stage-extra{grid-column:2/-1;display:flex;gap:6px;flex-wrap:wrap}

/* Admin area sub-tabs (Users | Connections | Product intake): same strip as the Map data sections */
#usersView .ms-subtabs{display:flex;gap:6px;border-bottom:1px solid var(--line);margin-bottom:16px;flex-wrap:wrap}
#usersView .ms-subtab{background:transparent;border:0;border-bottom:3px solid transparent;padding:10px 16px;font-weight:700;color:var(--muted)}
#usersView .ms-subtab:hover{color:var(--ink)}
#usersView .ms-subtab.active{color:var(--forest);border-color:var(--forest-2)}
