/* Cart Recommendations admin. Quiet, data-first: one accent, tabular numbers. */
:root {
  --bg: #F6F7F9; --panel: #FFFFFF; --ink: #1C2430; --slate: #5B6676; --line: #E1E4EA;
  --accent: #0F7B6C; --accent-soft: #E3F1EE; --warn: #B4561B; --warn-soft: #F8EBE2; --bad: #A33A3A;
  --radius: 6px;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 0 0 .75rem; }
h3 { font-size: .95rem; font-weight: 600; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; max-width: 72ch; }
.muted { color: var(--slate); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; }

/* top bar */
.bar { display: flex; align-items: center; gap: 1.25rem; padding: .6rem 1.5rem; background: var(--ink); color: #DDE3EA; flex-wrap: wrap; }
.bar .brand { color: #fff; font-weight: 650; letter-spacing: -0.01em; }
.bar nav { display: flex; gap: .2rem; flex-wrap: wrap; }
.bar nav a { color: #C3CCD6; padding: .3rem .6rem; border-radius: var(--radius); }
.bar nav a.on, .bar nav a:hover { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.bar .spacer { flex: 1; }
.bar select { background: #2A3442; color: #fff; border: 1px solid #3A4656; border-radius: var(--radius); padding: .25rem .4rem; font: inherit; }
.bar form { margin: 0; display: inline; }
.bar .link { background: none; border: 0; color: #C3CCD6; font: inherit; cursor: pointer; padding: 0; }

.page { max-width: 1240px; margin: 0 auto; padding: 1.5rem; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.head .sub { color: var(--slate); margin-top: .25rem; font-size: .9rem; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.25rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; }
.cols > .panel { margin-bottom: 0; }
.stack > * + * { margin-top: 1.25rem; }

/* funnel strip: the signature element */
.funnel { display: grid; grid-template-columns: repeat(4, 1fr) 1.15fr; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; margin-bottom: 1.25rem; }
.funnel .stage { padding: 1rem 1.1rem .9rem; position: relative; border-right: 1px solid var(--line); }
.funnel .stage .label { color: var(--slate); font-size: .85rem; }
.funnel .stage .value { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.funnel .stage .rate { font-size: .82rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.funnel .stage .meter { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.funnel .stage + .stage::before { content: ""; position: absolute; left: -7px; top: 50%; width: 12px; height: 12px; background: var(--panel);
  border-top: 1px solid var(--line); border-right: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); }
.funnel .money { background: var(--accent-soft); padding: 1rem 1.1rem; }
.funnel .money .value { font-size: 1.6rem; font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }
.funnel .money .label { color: var(--slate); font-size: .85rem; }
@media (max-width: 860px) { .funnel { grid-template-columns: 1fr 1fr; } .funnel .stage + .stage::before { display: none; } }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; color: var(--slate); padding: .45rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .45rem .5rem; border-bottom: 1px solid #EEF0F3; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.hl td { background: var(--accent-soft); }
.empty { color: var(--slate); padding: .75rem 0; }
.cart-set { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.chip { display: inline-block; padding: .05rem .45rem; border: 1px solid var(--line); border-radius: 99px; background: #FAFBFC; font-size: .82rem; white-space: nowrap; }
.arrow { color: var(--slate); padding: 0 .35rem; }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: 4px; font-size: .78rem; background: #EEF0F3; color: var(--slate); }
.tag.running, .tag.on { background: var(--accent-soft); color: var(--accent); }
.tag.paused, .tag.draft { background: var(--warn-soft); color: var(--warn); }
.tag.failed { background: #F6E3E3; color: var(--bad); }
.bar-cell { position: relative; }
.bar-cell .b { position: absolute; left: 0; top: 20%; bottom: 20%; background: var(--accent-soft); border-radius: 2px; z-index: 0; }
.bar-cell span { position: relative; z-index: 1; }

/* trend */
.trend { width: 100%; height: 160px; display: block; }
.trend .t-bar { fill: #BFDDD7; }
.trend .t-line { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.trend .t-axis { stroke: var(--line); vector-effect: non-scaling-stroke; }
.legend { display: flex; gap: 1rem; color: var(--slate); font-size: .82rem; margin-top: .4rem; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: .3rem; vertical-align: -1px; }
.legend .l-bar { background: #BFDDD7; } .legend .l-line { background: var(--ink); height: 2px; vertical-align: 3px; }

/* forms */
form.inline { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; margin: 0; }
label { display: block; font-size: .85rem; color: var(--slate); margin-bottom: .25rem; }
.field { margin-bottom: .9rem; }
.field .hint { font-size: .8rem; color: var(--slate); margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #CBD1DA; border-radius: var(--radius); padding: .42rem .55rem; width: 100%; }
input[type=number] { max-width: 9rem; }
input[type=date] { width: auto; }
textarea { min-height: 5.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1.25rem; }
.weights { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem 1rem; }
.check { display: flex; align-items: center; gap: .45rem; color: var(--ink); font-size: .92rem; }
button, .btn { font: inherit; border: 1px solid #CBD1DA; background: #fff; color: var(--ink); border-radius: var(--radius); padding: .42rem .85rem; cursor: pointer; display: inline-block; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--bad); }
button.small { padding: .2rem .55rem; font-size: .85rem; }
.btn:hover { text-decoration: none; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.actions form { margin: 0; }

.flash { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; background: var(--accent-soft); color: #0B5A4F; }
.flash.error { background: #F6E3E3; color: var(--bad); }
.callout { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: .6rem .9rem; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1rem; }

/* autocomplete */
.ac { position: relative; }
.ac-list { position: absolute; z-index: 5; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 2px; max-height: 260px; overflow: auto; box-shadow: 0 6px 18px rgba(28,36,48,.08); }
.ac-list button { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; padding: .4rem .6rem; }
.ac-list button:hover { background: var(--bg); }

/* login */
.login { max-width: 360px; margin: 12vh auto; }
.login h1 { margin-bottom: 1rem; }
svg.meter { display: block; width: 100%; height: 4px; margin-top: .35rem; }
svg.meter rect { fill: var(--accent); }
svg.mini { display: block; width: 100%; height: 3px; margin-top: 2px; }
svg.mini rect { fill: #9CCFC6; }
.funnel .stage svg.meter { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; height: 3px; }
