/* =====================================================================
   BLF Factory Portal — "Factory Atlas" design system
   Tokens from the design handoff, primary changed to the client colour.
   No Bootstrap: plain CSS + CSS variables; light / dark via [data-theme].
   ===================================================================== */
:root {
  --bg: #f4f5f7;  --surface: #ffffff;  --subtle: #fafbfc;
  --border: #e1e4ea;  --row-border: #eceef2;  --input-border: #d3d8e0;
  --ink: #151a22;  --muted: #5b6472;  --faint: #7d8593;
  --primary: #056ac8;  --primary-hover: #0459a8;  --soft: #e6f0fb;  --hover-row: #f2f7fd;
  --ok-fg: #0d7a4f; --ok-bg: #e3f3ea;  --warn-fg: #9a5b0b; --warn-bg: #fbefdc;  --bad-fg: #b3261e; --bad-bg: #fbe4e2;
  --info-fg: #056ac8; --info-bg: #e6f0fb;
  --rmg: #1279ff; --tan: #4a6887; --lgf: #d96913;
  --shadow: 0 2px 10px rgba(20,30,25,.08);  --shadow-drawer: 4px 0 16px rgba(20,30,25,.08);
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --header-h: 56px;
}
[data-theme="dark"] {
  --bg: #0f1218;  --surface: #171b23;  --subtle: #1c212b;
  --border: #2a303b;  --row-border: #222833;  --input-border: #343b48;
  --ink: #e6e9ef;  --muted: #9aa3b2;  --faint: #7a8392;
  --primary: #3d8ff0;  --primary-hover: #2f7ce0;  --soft: #15283f;  --hover-row: #1e2532;
  --ok-fg: #5fd39a; --ok-bg: #15301f;  --warn-fg: #f0b45a; --warn-bg: #33260f;  --bad-fg: #ff8a80; --bad-bg: #3a1c1a;
  --info-fg: #8ab4ff; --info-bg: #15283f;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; } a:hover { color: var(--primary-hover); text-decoration: underline; }
button { font-family: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- app shell ---------- */
.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.app.scroll { overflow: auto; }
.header { height: var(--header-h); flex: none; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 500; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none !important; }

/*

.brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--primary); display: grid; place-items: center; flex: none; }
.brand .mark i { width: 10px; height: 10px; border-radius: 50%; background: #e8483b; box-shadow: 0 0 0 3px var(--primary), 0 0 0 4px var(--surface); }

-- new rule apply
.brand .mark { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; flex: none; overflow: hidden; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; display: block; }

.brand .t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand .t b { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand .t span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

*/

.brand { display: flex; align-items: center; 
        height: var(--header-h); padding: 8px 0; flex: none; min-width: 0; color: inherit; 
        text-decoration: none !important; }
.brand img { height: 100%; width: auto; max-width: 220px; object-fit: contain; display: block; }


.tabs { display: flex; gap: 2px; margin-left: 12px; height: 100%; align-items: stretch; }
.tabs a { display: flex; align-items: center; padding: 0 12px; font: 500 13px var(--font); color: var(--muted); white-space: nowrap; text-decoration: none !important; box-shadow: inset 0 -2px 0 transparent; transition: color .15s; }
.tabs a:hover { color: var(--ink); } .tabs a.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--primary); }
.header .grow { flex: 1; }
.sync { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #1f9d55; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--primary); font: 600 12px var(--font); display: grid; place-items: center; }
.menu { position: relative; }
.menu > button { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); }
.menu .dd { position: absolute; right: 0; top: 40px; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 600; }
.menu.open .dd { display: block; }
.menu .dd a, .menu .dd button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ink); background: none; border: 0; font: 13px var(--font); cursor: pointer; text-decoration: none !important; }
.menu .dd a:hover, .menu .dd button:hover { background: var(--hover-row); }
.menu .dd .who { padding: 6px 10px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--row-border); margin-bottom: 4px; }

/* ---------- buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--input-border); background: var(--surface); color: var(--ink); font: 500 13px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--hover-row); color: var(--ink); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; } .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.danger { color: var(--bad-fg); border-color: var(--bad-fg); } .btn.danger:hover { background: var(--bad-bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 11px; border-radius: 6px; }
.btn.link { border: 0; background: none; color: var(--primary); padding: 0 4px; } .btn.link:hover { text-decoration: underline; background: none; }
.btn.block { width: 100%; height: 44px; font-size: 14px; font-weight: 600; }
.btn[disabled] { opacity: .45; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--input-border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; height: 32px; padding: 0 10px; font: 500 12px var(--font); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--soft); color: var(--primary); }
.seg button + button { border-left: 1px solid var(--input-border); }
.input, .select, textarea.input { width: 100%; height: 38px; border-radius: 8px; border: 1px solid var(--input-border); background: var(--surface); color: var(--ink); padding: 0 10px; font: 13px var(--font); outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--soft); }
.select { height: 34px; border-radius: 7px; appearance: none; -webkit-appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%235b6472' stroke-width='1.5'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.input.sm, .select.sm { height: 30px; font-size: 12px; }
.lbl { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 0; }
.lbl .input, .lbl .select { text-transform: none; letter-spacing: 0; font-weight: 400; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.check input { accent-color: var(--primary); width: 15px; height: 15px; }
.is-invalid { border-color: var(--bad-fg) !important; }
.err { color: var(--bad-fg); font-size: 12px; margin-top: 4px; }

/* ---------- pills / dots ---------- */
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill.ok { color: var(--ok-fg); background: var(--ok-bg); } .pill.warn { color: var(--warn-fg); background: var(--warn-bg); }
.pill.bad { color: var(--bad-fg); background: var(--bad-bg); } .pill.info { color: var(--info-fg); background: var(--info-bg); }
.pill.gray { color: var(--muted); background: var(--subtle); border: 1px solid var(--border); }
.pill.sector { color: #fff; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.yes { color: var(--ok-fg); font-weight: 600; } .no { color: var(--faint); } .na { color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 10px; border-radius: 99px; background: var(--soft); color: var(--primary); font-size: 12px; }
.chip b { font-weight: 600; } .chip a { color: inherit; opacity: .7; text-decoration: none !important; } .chip a:hover { opacity: 1; }

/* ---------- cards / pages ---------- */
.page { flex: 1; overflow: auto; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 24px 20px; } .wrap.wide { max-width: 1480px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.page-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.card .hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--row-border); font-weight: 600; font-size: 14px; }
.card .hd .meta { font-size: 11px; color: var(--muted); font-weight: 400; text-transform: uppercase; letter-spacing: .04em; }
.card .bd { padding: 16px; }
.grid { display: grid; gap: 14px; }
.grid.kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none !important; transition: border-color .12s, box-shadow .12s; }
.kpi-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.kpi-card .l { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.kpi-card .v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.kpi-card .s { font-size: 12px; color: var(--muted); }
.kpi-card.accent { border-top: 3px solid var(--primary); }

/* bars */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar { display: grid; grid-template-columns: 150px 1fr 110px; align-items: center; gap: 12px; font-size: 13px; }
.bar .track { height: 10px; border-radius: 99px; background: var(--row-border); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar .val { text-align: right; font-variant-numeric: tabular-nums; } .bar .val span { color: var(--muted); }
.stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--row-border); }
.stack i { display: block; height: 100%; }
/* donut */
.donut { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.donut .hole { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .hole b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; } .donut .hole span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; }
.legend div span:last-child { font-variant-numeric: tabular-nums; } .legend div span:last-child i { font-style: normal; color: var(--muted); margin-left: 4px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; padding: 9px 12px; background: var(--subtle); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--row-border); vertical-align: middle; }
.tbl tbody tr:nth-child(even) td { background: var(--subtle); }
.tbl tbody tr:hover td { background: var(--hover-row); }
.tbl tr.click { cursor: pointer; }
.tbl th a { color: inherit; text-decoration: none !important; display: inline-flex; align-items: center; gap: 4px; }
.tbl th a.sorted { color: var(--primary); }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl .sticky th { position: sticky; top: 0; z-index: 2; }
.table-scroll { overflow: auto; }
.tfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--row-border); font-size: 13px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 4px; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--input-border); background: var(--surface); color: var(--ink); font-size: 12px; text-decoration: none !important; }
.pager a:hover { background: var(--hover-row); }
.pager .on { background: var(--primary); border-color: var(--primary); color: #fff; } .pager .dis { opacity: .4; pointer-events: none; } .pager .dots { border: 0; }
.rank-list div { display: grid; grid-template-columns: 24px 10px 1fr auto; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--row-border); cursor: pointer; }
.rank-list div:hover { background: var(--hover-row); }
.rank-list .r { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.rank-list .n b { display: block; font-weight: 500; } .rank-list .n span { font-size: 12px; color: var(--muted); }
.rank-list .w { font-variant-numeric: tabular-nums; font-weight: 600; }

/* alerts */
.alert { padding: 10px 14px; border-radius: 10px; border: 1px solid; margin-bottom: 14px; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.alert-success { background: var(--ok-bg); border-color: #bfe3cf; color: var(--ok-fg); }
.alert-info { background: var(--info-bg); border-color: #bcd7f5; color: var(--info-fg); }
.alert-warning { background: var(--warn-bg); border-color: #f1d8ad; color: var(--warn-fg); }
.alert-danger { background: var(--bad-bg); border-color: #f1b8b4; color: var(--bad-fg); }
.alert .close { background: none; border: 0; cursor: pointer; color: inherit; font-size: 16px; line-height: 1; }
.alert code { font-family: var(--mono); font-size: 12px; background: rgba(0,0,0,.06); padding: 2px 6px; border-radius: 4px; word-break: break-all; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art { background: #0b3a6b; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 12px, transparent 12px 24px); color: #fff; padding: 36px 44px; display: flex; flex-direction: column; justify-content: space-between; }
.login .art h1 { font-size: 40px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin: 0 0 14px; max-width: 520px; }
.login .art p { font-size: 15px; color: #cfdcf3; max-width: 480px; margin: 0; }
.login .stats { display: flex; gap: 36px; } .login .stats b { display: block; font-size: 22px; font-weight: 600; } .login .stats span { font-size: 12px; color: #cfdcf3; }
.login .form { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login .box { width: 100%; max-width: 360px; } .login .box h2 { font-size: 24px; font-weight: 600; margin: 0 0 4px; } .login .box .sub { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.login .box .input { height: 42px; margin-top: 4px; }
.login .box .lbl { margin-bottom: 14px; } .login .box .lbl .row { display: flex; justify-content: space-between; }
.login .box .foot { font-size: 12px; color: var(--faint); margin-top: 18px; text-align: center; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login .art { display: none; } }

/* ---------- map explorer ---------- */
.explorer { flex: 1; display: flex; min-height: 0; position: relative; }
.panel { width: 380px; flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.panel .filters { padding: 12px 16px 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--row-border); }
.panel .filters .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.panel .toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--subtle); border-bottom: 1px solid var(--row-border); font-size: 12px; color: var(--muted); }
.panel .toolbar strong { color: var(--ink); font-size: 13px; }
.panel .toolbar .select { height: 28px; width: auto; font-size: 12px; padding-right: 24px; }
.panel .list { flex: 1; overflow: auto; }
.row-f { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; padding: 11px 16px; border-bottom: 1px solid var(--row-border); cursor: pointer; transition: background .12s; }
.row-f:hover { background: var(--hover-row); } .row-f.sel { background: var(--soft); box-shadow: inset 3px 0 0 var(--primary); }
.row-f .dot { margin-top: 5px; }
.row-f .nm { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-f .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-f .id { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.row-f .rt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row-f .rt span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.more { padding: 12px 16px; text-align: center; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.mapwrap { flex: 1; position: relative; min-width: 0; background: #e9ece8; }
#map { position: absolute; inset: 0; }
.map-stats { position: absolute; top: 12px; left: 12px; display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; z-index: 5; }
.map-stats div { padding: 8px 14px; border-right: 1px solid var(--row-border); display: flex; flex-direction: column; } .map-stats div:last-child { border-right: 0; }
.map-stats span { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.map-stats b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.map-ctl { position: absolute; top: 12px; right: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; z-index: 5; }
.map-ctl .btn, .map-ctl .seg { box-shadow: var(--shadow); }
.map-legend { position: absolute; left: 12px; bottom: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 10px; z-index: 5; min-width: 200px; }
.map-legend .hd2 { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.map-legend button.lg { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 4px 2px; font: 12px var(--font); color: var(--ink); cursor: pointer; text-align: left; border-radius: 4px; }
.map-legend button.lg:hover { background: var(--hover-row); } .map-legend button.lg.off { opacity: .35; }
.map-legend button.lg span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); }
.map-legend .lrow { display: flex; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--row-border); }
.map-legend .lrow .btn { flex: 1; }
.map-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 20px; }
/* drawer */
.drawer { position: absolute; top: 0; left: 0; bottom: 0; width: 380px; background: var(--surface); box-shadow: var(--shadow-drawer); z-index: 20; display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.drawer.open { transform: none; }
.drawer .photo { height: 150px; flex: none; background: var(--primary); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 10px, transparent 10px 20px); position: relative; color: #fff; }
.drawer .photo .back { position: absolute; top: 10px; left: 10px; } .drawer .photo .x { position: absolute; top: 10px; right: 10px; width: 30px; padding: 0; }
.drawer .photo .pill { position: absolute; left: 14px; bottom: 12px; }
.drawer .photo .cap { position: absolute; right: 14px; bottom: 12px; font-size: 11px; opacity: .8; }
.drawer .body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.drawer .id { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.drawer h2 { font-size: 19px; font-weight: 600; margin: 2px 0; letter-spacing: -.01em; }
.drawer .sec { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.strip div { padding: 10px 12px; border-right: 1px solid var(--row-border); } .strip div:last-child { border-right: 0; }
.strip span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.strip b { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.sect .h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.sect .kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; } .sect .kv span:nth-child(odd) { color: var(--muted); }
.coord { display: flex; align-items: center; gap: 8px; margin-top: 6px; } .coord code { font-family: var(--mono); font-size: 12px; background: var(--subtle); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.near .nr { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--row-border); cursor: pointer; font-size: 13px; }
.near .nr:hover { color: var(--primary); } .near .nr span:last-child { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.flags { display: flex; flex-wrap: wrap; gap: 6px; } .flags span { font-size: 11px; border-radius: 6px; padding: 3px 8px; background: var(--subtle); color: var(--faint); border: 1px solid var(--border); text-decoration: line-through; }
.flags span.on { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; text-decoration: none; }
.mobile-bar { display: none; }

/* google maps tweaks */
.gm-style .gm-style-iw-c { border-radius: 10px; padding: 0 !important; box-shadow: var(--shadow); }
.gm-style .gm-style-iw-d { overflow: hidden !important; }
.iw { padding: 10px 14px; font: 13px var(--font); color: #151a22; min-width: 220px; } .iw b { display: block; font-size: 14px; } .iw span { color: #5b6472; font-size: 12px; }

/* ---------- report ---------- */
.filter-card .bd { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.filter-card .bd .span2 { grid-column: span 2; }
.filter-card .ft { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--row-border); }
.summary { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; margin: 14px 0; }
.summary div { padding: 12px 16px; border-right: 1px solid var(--row-border); } .summary div:last-child { border-right: 0; }
.summary span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.summary b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.tbl.report { min-width: 1080px; } .tbl.report td { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl.report tr.cf th { padding: 4px 8px; background: var(--surface); } .tbl.report tr.cf .input { height: 28px; font-size: 12px; min-width: 70px; }
.col-picker { position: absolute; right: 0; top: 40px; width: 300px; max-height: 380px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 14px; z-index: 50; display: none; }
.col-picker.open { display: block; } .col-picker .g { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 8px 0 2px; }
.col-picker label { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 2px 0; }
.collapse-body { display: none; } .collapse-body.open { display: block; }

/* ---------- detail page ---------- */
.hero { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-bottom: 14px; border-top: 4px solid var(--primary); }
.hero h1 { font-size: 22px; margin: 0 0 4px; } .hero .meta { font-size: 13px; color: var(--muted); }
.hero .kpis { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 14px; width: 100%; }
.hero .kpis div b { display: block; font-size: 20px; font-weight: 600; } .hero .kpis div span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 24px; }
.dl div { padding: 7px 0; border-bottom: 1px dashed var(--row-border); } .dl .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; } .dl .v { font-size: 13px; word-break: break-word; }
#mini-map { height: 300px; border-radius: 10px; }

/* ---------- raw / users ---------- */
.status-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.status-pills a { border-radius: 99px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .grid.kpi { grid-template-columns: repeat(2, 1fr); } .grid.two, .grid.three { grid-template-columns: 1fr; } .summary { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) {
  /* .header { gap: 8px; padding: 0 10px; } .sync { display: none; } .brand .t { display: none; } */
  .header { gap: 8px; padding: 0 10px; } .sync { display: none; } .brand img { max-width: 120px; }
  .tabs { margin-left: 0; overflow-x: auto; scrollbar-width: none; flex: 1; } .tabs::-webkit-scrollbar { display: none; } .tabs a { padding: 0 9px; font-size: 12px; }
  .header .grow { display: none; } #theme-toggle span { display: none; }
  .explorer { flex-direction: column; }
  .panel { width: 100%; position: absolute; inset: 0 0 56px; z-index: 10; display: none; } .explorer.show-list .panel { display: flex; }
  .mapwrap { position: absolute; inset: 0 0 56px; }
  .drawer { width: 100%; bottom: 56px; z-index: 30; }
  .mobile-bar { display: flex; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: var(--surface); border-top: 1px solid var(--border); z-index: 40; }
  .mobile-bar button { flex: 1; border: 0; background: none; font: 500 13px var(--font); color: var(--muted); } .mobile-bar button.on { color: var(--primary); box-shadow: inset 0 2px 0 var(--primary); }
  .map-stats { display: none; } .map-legend { display: none; }
  .wrap { padding: 16px 12px; } .page-head h1 { font-size: 19px; }
  .grid.kpi { grid-template-columns: 1fr 1fr; } .summary { grid-template-columns: repeat(2, 1fr); }
  .bar { grid-template-columns: 100px 1fr 90px; }
}
@media (max-width: 520px) { .grid.kpi { grid-template-columns: 1fr; } .actions .btn span { display: none; } }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 24px; }
.footer-in { max-width: 1480px; margin: 0 auto; padding: 14px 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.footer a { color: var(--primary); }
@media print { .footer { display: none; } }
