/* AssetStak — mobile-first, no build step. */
:root {
  /* Brand: navy #0B2236 + teal #00C9A7 (from the AssetStak logo) */
  --bg: #f5f7f9; --card: #fff; --ink: #0b2236; --muted: #55657a; --line: #dde3ea;
  --brand: #0b2236; --brand-ink: #fff; --teal: #00c9a7; --teal-soft: #e0f7f2; --teal-ink: #007a66;
  --ok: #1d7a46; --warn: #a15c00; --bad: #b42318;
  --ok-bg: #e7f5ec; --warn-bg: #fff4e0; --bad-bg: #fdecea; --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
h1 { font-size: 1.4rem; margin: .2rem 0 .8rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* top bar */
.topbar { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar .inner { display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; }
.topbar a { color: var(--ink); text-decoration: none; }
.brand { display: inline-flex; align-items: center; margin-right: auto; }
.brand img { height: 30px; width: auto; display: block; }
.nav { display: flex; gap: .2rem; flex-wrap: nowrap; width: 100%; order: 3; overflow-x: auto; }
.nav a { padding: .4rem .7rem; border-radius: 6px; font-size: .925rem; font-weight: 600; white-space: nowrap; }
.nav a:hover { background: #eef2f6; }
.nav a.active { background: var(--teal-soft); color: var(--teal-ink); box-shadow: inset 0 -2px 0 var(--teal); }
.topbar .who { font-size: .85rem; color: var(--muted); }
.topbar .who a, .topbar .who .linkbtn { color: var(--ink); }
.topbar form { display: inline; }
.linkbtn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
@media (min-width: 860px) { .nav { width: auto; order: 0; } .brand { margin-right: .5rem; } .topbar .who { margin-left: auto; } }

main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* stats */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; text-decoration: none; color: inherit; display: block; }
.stat .n { font-size: 1.6rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .875rem; }
.stat.warn .n { color: var(--warn); }

/* key/value list */
dl.kv { display: grid; grid-template-columns: minmax(8rem, 35%) 1fr; gap: .35rem .8rem; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .9rem; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .925rem; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* forms */
label { display: block; font-size: .9rem; font-weight: 600; margin: .6rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: .65rem .7rem; border: 1px solid #c5ccd6; border-radius: 8px; font: inherit; background: #fff; min-height: 44px;
}
textarea { min-height: 5rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 10rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .6rem 1rem; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.ok { background: var(--teal); border-color: var(--teal); color: var(--brand); }
.btn:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.btn.block { width: 100%; }
.actions { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); margin: .5rem 0 1rem; }

/* badges and alerts */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef1f5; color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert ul { margin: .2rem 0 0; padding-left: 1.2rem; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -8px; top: .35rem; width: 13px; height: 13px; border-radius: 50%; background: var(--teal); }
.timeline li.warn::before { background: var(--warn); }
.timeline .when { font-size: .8rem; color: var(--muted); }

.asset-head { display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; }
.asset-head .num { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.5rem; font-weight: 700; }
details summary { cursor: pointer; font-weight: 600; }
.pager { margin-top: 1rem; }
.pager nav { display: flex; gap: .3rem; flex-wrap: wrap; }

/* auth pages */
.auth-card { max-width: 27rem; margin: 2rem auto; }
.auth-card.wide { max-width: 34rem; }
.auth-logo { text-align: center; margin: .5rem 0 1rem; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.org-switch { display: inline; }
.org-switch select { min-height: 32px; width: auto; padding: .2rem .4rem; font-size: .85rem; }
.linkbtn.danger { color: var(--bad); }
.copy-box { border-color: var(--teal); background: var(--teal-soft); }

/* onboarding */
.onboarding .steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .7rem; }
.onboarding .steps li > * { display: block; }
.onboarding .steps li.done { color: var(--muted); }
.onboarding .steps li.done strong { text-decoration: line-through; }
.onboarding .steps li.done::marker { content: "✓  "; color: var(--ok); font-weight: 700; }

/* plans (billing) */
.meter { height: 6px; background: #eef1f5; border-radius: 4px; margin-top: .4rem; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--teal); }
.plans { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin-bottom: 1rem; }
.plan { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.plan h3 { margin: .2rem 0 0; }
.plan .price { font-size: 1.5rem; font-weight: 800; }
.plan ul { margin: 0 0 .6rem; padding-left: 1.1rem; flex: 1; }
.plan.featured { border: 2px solid var(--teal); }
.plan.current { background: var(--teal-soft); }
.plan.suggested { box-shadow: 0 0 0 3px var(--teal); }
.plan .ribbon { position: absolute; top: -11px; left: 1rem; background: var(--teal); color: var(--brand); font-size: .75rem; font-weight: 800; padding: .1rem .6rem; border-radius: 999px; }
.quote-form { display: flex; gap: .4rem; align-items: center; margin-top: .3rem; }
.quote-form select { min-height: 32px; width: auto; padding: .15rem .4rem; font-size: .85rem; }

/* tables that become cards on phones */
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.stack td { border: 0; padding: .25rem .6rem; text-align: left; }
  table.stack td.num { text-align: left; }
  table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
}

/* Dashboard: actionable exceptions and simple bars (M6) */
.exceptions { padding: .4rem .6rem; }
.exception { display: flex; align-items: center; gap: .8rem; padding: .6rem .4rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.exception:last-of-type { border-bottom: 0; }
.exception:hover { background: #f6f8fa; }
.exception .count { min-width: 3.2rem; text-align: right; font-size: 1.3rem; font-weight: 700; color: var(--warn); font-variant-numeric: tabular-nums; }
.exception .what { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.exception .what .small { font-weight: 400; }
.exception .go { color: var(--muted); }
.bar-row { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr auto; gap: .6rem; align-items: center; margin: .35rem 0; font-size: .9rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: .8rem; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar-n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-list { list-style: none; padding: 0; margin: 0; }
.report-list li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.report-list li:last-child { border-bottom: 0; }
label.check { font-weight: 400; display: flex; gap: .5rem; align-items: center; }
