/* Note Metric admin. Light, table-first layout (28 October 2026, the owner's reference: a detailed view with a
   filter bar and rows that open in place). Colours are the web app's light theme; pink stays for the logo. */
@font-face { font-family: 'NM Poppins'; src: url(/site/fonts/poppins-400.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'NM Poppins'; src: url(/site/fonts/poppins-500.woff2) format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'NM Poppins'; src: url(/site/fonts/poppins-600.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #F4F6F9; --surface: #FFFFFF; --raised: #F7F9FC; --text: #0B1726; --ink: #0F2A44; --muted: #5A6878; --faint: #8A97A6;
  --line: #E3E8EF; --line-2: #D3DBE5; --primary: #0B2F5E; --accent: #1B5FA0; --accent-soft: #E3EEF9;
  --ok: #1F7A45; --ok-fill: #23A15A; --ok-soft: #E2F4E9; --amber: #B45309; --amber-dot: #E58A00; --amber-soft: #FDF1E2;
  --bad: #C62828; --bad-soft: #FBE8E8; --pink: #FF00B8; --grey-soft: #EEF1F5;
  --font: 'NM Poppins', Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }

/* ---------- top bar ---------- */
.appbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.appbar-in { max-width: 1280px; margin: 0 auto; padding: 0 28px; height: 68px; display: flex; align-items: center; gap: 34px; }
.logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.logo-svg { height: 30px; width: auto; display: block; }
.logo-tag { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.mainnav { display: flex; gap: 26px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav button { background: none; border: 0; padding: 22px 0; color: var(--ink); font-size: 14.5px; font-weight: 400; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.mainnav button:hover { color: var(--accent); }
.mainnav button.on { color: var(--accent); font-weight: 500; border-bottom-color: var(--accent); }
.who { flex: none; }
details.menu { position: relative; }
details.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; padding: 8px 0; }
details.menu summary::-webkit-details-marker { display: none; }
details.menu summary .avatar { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-size: 10px; font-weight: 600; }
details.menu summary::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg) translateY(-3px); margin-left: 2px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px -12px rgba(15,42,68,.25); padding: 6px; min-width: 200px; display: flex; flex-direction: column; }
.menu-pop button { background: none; border: 0; text-align: left; padding: 9px 12px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.menu-pop button:hover { background: var(--raised); }
.menu-pop .menu-note { padding: 8px 12px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- page ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 26px 28px 80px; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 6px 0 22px; }
.pagehead h1 { font-size: 22px; font-weight: 600; margin: 0; color: var(--text); letter-spacing: -.01em; }
.pagehead .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.linkbtn { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 0; font-size: 14.5px; white-space: nowrap; }
.linkbtn:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 13px; margin: 30px 0 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
h3 { font-size: 16px; margin: 0 0 10px; font-weight: 600; color: var(--text); }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; }
.err { color: var(--bad); } .ok { color: var(--ok); }
code { background: var(--grey-soft); padding: 2px 6px; border-radius: 5px; font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; color: var(--ink); }

/* processing strip */
.strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-radius: var(--radius); padding: 10px 16px; margin-bottom: 18px; border: 1px solid var(--line); background: var(--surface); }
.strip b { font-size: 14px; font-weight: 600; }
.strip.on b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-fill); margin-right: 8px; vertical-align: 1px; }
.strip.off { background: var(--bad-soft); border-color: #F2C4C4; } .strip.off b { color: var(--bad); }

/* ---------- shared controls ---------- */
.btn { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 500; line-height: 1.3; }
.btn:hover { background: var(--raised); }
.btn.p { background: var(--primary); border-color: var(--primary); color: #fff; } .btn.p:hover { background: #082448; }
.btn.d { color: var(--bad); border-color: #F0C9C9; background: var(--surface); } .btn.d:hover { background: var(--bad-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.stop { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; } .btn.go { background: var(--ok-fill); border-color: var(--ok-fill); color: #fff; font-weight: 600; }
.btn:disabled { opacity: .55; cursor: default; }
input, select { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 9px 12px; min-width: 0; font-size: 14px; }
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; overflow-x: auto; }
td select { max-width: 240px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile b { display: block; font-size: 22px; font-weight: 600; margin-top: 2px; color: var(--text); }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; font-size: 13px; }
tr.detail td { background: var(--raised); }
.card table { background: transparent; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--grey-soft); color: var(--ink); font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.pending { background: var(--amber-soft); color: var(--amber); } .tag.approved, .tag.active { background: var(--ok-soft); color: var(--ok); }
.tag.declined, .tag.disabled { background: var(--bad-soft); color: var(--bad); } .tag.sso { background: var(--accent-soft); color: var(--accent); }
.login { max-width: 420px; margin: 60px auto; } .login .card { padding: 28px; }
.note { border-left: 3px solid var(--accent); padding: 10px 14px; background: var(--accent-soft); border-radius: 6px; margin: 10px 0 16px; color: var(--ink); }
.warn { border-left: 3px solid var(--amber-dot); padding: 10px 14px; background: var(--amber-soft); border-radius: 6px; margin: 10px 0; color: var(--ink); }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 18px; letter-spacing: .06em; background: var(--grey-soft); padding: 10px 14px; border-radius: 6px; display: inline-block; }

/* ---------- usage: filter bar ---------- */
.filters { display: grid; grid-template-columns: minmax(250px, 1.5fr) repeat(4, minmax(150px, 1fr)); gap: 22px; align-items: end; margin-bottom: 30px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > span { font-size: 14px; color: var(--ink); }
.field select, .field input { width: 100%; height: 46px; }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); padding: 3px; height: 46px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 4px; color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; padding: 0 14px; font-size: 14px; }
.seg button.on { background: var(--primary); color: #fff; }
.search { position: relative; }
.search input { padding-right: 40px; }
.search::after { content: ''; position: absolute; right: 15px; top: 50%; width: 11px; height: 11px; border: 1.6px solid var(--muted); border-radius: 50%; transform: translateY(-62%); pointer-events: none; }
.search::before { content: ''; position: absolute; right: 12px; top: 50%; width: 6px; height: 1.6px; background: var(--muted); transform: translateY(5px) rotate(45deg); pointer-events: none; }

.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: -8px 0 28px; }
.summary div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.summary span { display: block; color: var(--muted); font-size: 12.5px; }
.summary b { font-size: 19px; font-weight: 600; }
.summary b.bad { color: var(--bad); } .summary b.amber { color: var(--amber); }

/* ---------- usage: the table ---------- */
.ptable { --cols: minmax(220px, 2.1fr) minmax(90px, .8fr) minmax(120px, 1fr) minmax(130px, 1fr) minmax(90px, .7fr) minmax(150px, 1fr); }
.phead, .prow-main { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 12px; }
.phead { padding: 0 24px 16px 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.phead button { background: none; border: 0; padding: 0; color: var(--ink); font-size: 14.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; justify-self: start; white-space: nowrap; }
.phead button.end { justify-self: end; }
.phead button::after { content: ''; border: 4.5px solid transparent; border-bottom: 5px solid #C4CCD6; border-top: 0; margin-top: -1px; }
.phead button.asc::after { border-bottom-color: var(--ink); }
.phead button.desc::after { border-top: 5px solid var(--ink); border-bottom: 0; }
.prow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.prow-main { padding: 16px 24px 16px 18px; cursor: pointer; min-height: 60px; }
.prow-main:hover { background: #FBFCFE; border-radius: var(--radius); }
.prow.open .prow-main { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.who-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chev { width: 9px; height: 9px; border-right: 1.8px solid var(--ink); border-bottom: 1.8px solid var(--ink); transform: rotate(45deg) translate(-2px, -2px); flex: none; margin: 0 6px 0 4px; transition: transform .15s ease; }
.prow.open .chev { transform: rotate(-135deg) translate(-2px, -2px); }
.who-cell .names { min-width: 0; }
.who-cell .nm { font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.who-cell .em { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.badge-new { background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: 13px; padding: 4px 10px; border-radius: 4px; flex: none; }
.cell-plan { color: var(--ink); text-transform: capitalize; }
.cell-spend b { font-weight: 500; font-size: 15px; } .cell-spend span { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.level { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14.5px; }
.level i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; display: inline-block; }
.level i.off { opacity: .18; }
.level i:first-of-type { margin-left: 4px; }
.level.none { color: var(--faint); font-weight: 500; } .level.low { color: var(--ok-fill); } .level.medium { color: var(--amber-dot); } .level.high { color: var(--bad); }
.cell-num { text-align: center; font-size: 15px; }
.pill { justify-self: end; padding: 5px 10px; border-radius: 4px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.near { background: var(--amber-soft); color: var(--amber); }
.pill.over { background: var(--bad-soft); color: var(--bad); } .pill.capped { background: var(--bad); color: #fff; }
.pill.idle, .pill.inactive, .pill.deleted { background: var(--grey-soft); color: var(--muted); }
.pill.on-device, .pill.own-key, .pill.used { background: var(--accent-soft); color: var(--accent); } .pill.refused { background: var(--amber-soft); color: var(--amber); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- usage: the open row ---------- */
.panel { padding: 26px 28px 30px; }
.panel section { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.panel section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.panel h4 { margin: 0 0 14px; font-size: 16px; font-weight: 600; color: var(--text); }
.panel p { margin: 0 0 10px; font-size: 14.5px; color: var(--ink); }
.meter { position: relative; height: 40px; margin: 6px 0 2px; }
.meter .track { position: absolute; left: 0; right: 0; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 3px; background: #E7F3EC; }
.meter .fill { position: absolute; left: 0; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 3px; background: var(--ok-fill); }
.meter .flag { position: absolute; top: 50%; transform: translate(var(--shift), -50%); background: var(--ok-fill); color: #fff; font-weight: 600; font-size: 14px; padding: 5px 10px; border-radius: 4px; white-space: nowrap; }
.meter.near .track { background: #FBEBD6; } .meter.near .fill, .meter.near .flag { background: var(--amber-dot); }
.meter.over .track, .meter.capped .track { background: #F7DADA; } .meter.over .fill, .meter.over .flag, .meter.capped .fill, .meter.capped .flag { background: var(--bad); }
.meter.idle .track, .meter.past .track, .meter.inactive .track, .meter.on-device .track, .meter.own-key .track { background: var(--grey-soft); }
.meter.idle .fill, .meter.idle .flag, .meter.past .fill, .meter.past .flag, .meter.inactive .fill, .meter.inactive .flag, .meter.on-device .fill, .meter.on-device .flag, .meter.own-key .fill, .meter.own-key .flag { background: var(--accent); }
.meter-ends { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 14px; margin-top: 4px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats .s span { display: block; font-size: 14.5px; color: var(--ink); margin-bottom: 8px; }
.stats .s b { font-size: 15px; font-weight: 600; }
.stats .s b.bad { color: var(--bad); } .stats .s b.bad::before { content: '\2197'; margin-right: 6px; font-weight: 700; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; padding-top: 4px; border-bottom: 1px solid var(--line); }
.bars i { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 1px; opacity: .85; }
.bars i.zero { background: var(--line); opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }
.mini th { background: none; } .mini td, .mini th { padding: 9px 10px; } .mini td.num, .mini th.num { text-align: right; white-space: nowrap; }
.problems { margin: 10px 0 0; padding: 0; list-style: none; }
.problems li { font-size: 13.5px; color: var(--ink); padding: 4px 0 4px 18px; position: relative; }
.problems li::before { content: ''; position: absolute; left: 2px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber-dot); }
.problems li.refused::before { background: var(--bad); }
.controls { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.controls input { width: 130px; } .controls select { min-width: 220px; }
.profile { font-size: 14.5px; color: var(--ink); }
.footnote, .panel p.footnote { color: var(--muted); font-size: 12.5px; margin: 12px 0 0; }

@media (max-width: 1080px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .field:first-child { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
}
@media (max-width: 760px) {
  .appbar-in { height: auto; flex-wrap: wrap; gap: 0 16px; padding: 10px 16px 0; }
  .logo { order: 1; } .who { order: 2; margin-left: auto; } .mainnav { order: 3; flex-basis: 100%; gap: 22px; }
  .mainnav button { padding: 12px 0 13px; }
  .wrap { padding: 18px 14px 60px; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .ptable { --cols: minmax(0, 1fr) auto; }
  .phead { display: none; }
  .prow-main { padding: 14px 16px 14px 12px; row-gap: 6px; }
  .prow-main > .cell-plan, .prow-main > .cell-num { display: none; }
  .prow-main > .cell-spend { grid-column: 1; padding-left: 31px; }
  .prow-main > .level { grid-column: 2; grid-row: 2; justify-self: end; }
  .prow-main > .pill { grid-column: 2; grid-row: 1; }
  .panel { padding: 20px 16px 24px; }
  .mini { display: block; overflow-x: auto; }
  table { display: block; overflow-x: auto; }
}
