/* eny Analytics. Same palette and parts as the POS (hospitality/pos/public/pos.css):
   dark, high contrast, big targets. Chart colours validated for the dark panel
   with the dataviz palette checker: current #3da35d solid, previous #6f8fd6
   dashed (dash is the secondary encoding), target amber dashed. */

:root {
  --bg: #14171a;
  --panel: #1d2226;
  --panel-2: #252b31;
  --line: #333b42;
  --ink: #f2f5f7;
  --muted: #98a4ae;
  --accent: #3da35d;
  --accent-ink: #0d1a11;
  --prev: #6f8fd6;
  --warn: #d9822b;
  --bad: #c8553d;
  --tap: 48px;
  --radius: 10px;
  font-size: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--ink); }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
code { background: var(--panel-2); padding: 0 .3em; border-radius: 4px; }

/* --- trial banner + bar --- */
.banner { margin: 0; padding: .45rem .8rem; background: #2a2418; border-bottom: 1px solid #5a4424; color: #f0c08a; font-size: .85rem; text-align: center; }
.banner a { color: #f7d3a6; }
.bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .5rem .8rem; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.bar nav { display: flex; gap: .2rem; margin-left: auto; flex-wrap: wrap; }
.bar nav a { white-space: nowrap; color: var(--muted); text-decoration: none; padding: .45rem .7rem; border-radius: var(--radius); }
.bar nav a:hover, .bar nav a:focus-visible { background: var(--panel-2); color: var(--ink); }
.who { display: flex; align-items: center; gap: .5rem; }
.who span { color: var(--muted); font-size: .85rem; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who button, .quiet {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .35rem .7rem;
}
.quiet:hover { color: var(--ink); border-color: var(--bad); }

main { padding: 1rem; }
.page { max-width: 1120px; margin: 0 auto; }
.narrowish { max-width: 720px; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }
.foot a { color: var(--muted); }

/* --- messages --- */
.error, .ok, .warn { padding: .6rem .8rem; border-radius: var(--radius); }
.error { background: rgba(200, 85, 61, .15); border: 1px solid var(--bad); color: #ffb3a3; }
.ok { background: rgba(61, 163, 93, .12); border: 1px solid var(--accent); color: #b9e6c6; }

/* --- forms and cards --- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin: 1rem 0; }
.narrow { max-width: 460px; margin: 6vh auto; }
.card label, .toolbar label { display: grid; gap: .3rem; color: var(--muted); font-size: .9rem; margin-bottom: .8rem; }
input:not([type=checkbox]), select {
  width: 100%; padding: .65rem .7rem; min-height: var(--tap);
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex !important; gap: .6rem; align-items: flex-start; color: var(--ink) !important; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; accent-color: var(--accent); flex: none; }
.cf-turnstile { margin: .4rem 0 1rem; min-height: 65px; }
.primary, .button, .btn-bad, .toolbar button, .demo button {
  display: inline-block; min-height: var(--tap); padding: .7rem 1.1rem;
  border: 0; border-radius: var(--radius); font-weight: 700; text-decoration: none; text-align: center;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.button, .toolbar button, .demo button { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn-bad { background: var(--bad); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
.fields { display: grid; gap: 0 .8rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.two { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
.demo { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding: .6rem 0; border-top: 1px solid var(--line); }
.demo div { display: grid; }
.danger { border-color: #5c2c22; }

/* --- landing --- */
.hero { max-width: 720px; margin: 10vh auto; }
.hero h1 { font-size: 2.1rem; line-height: 1.2; margin-bottom: 1.2rem; }
.hero p { font-size: 1.1rem; color: var(--muted); margin: .4rem 0; }
.actions { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-top: 1.6rem !important; }
.actions a:not(.primary) { color: var(--muted); }
.prose { max-width: 720px; margin: 0 auto; }
.prose p, .prose li { color: #d5dce1; }
.prose h2 { margin-top: 1.6rem; }

/* --- tables --- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .85rem; }
th, td { padding: .5rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.list { margin: .5rem 0 1rem; }
.list td form { margin: 0; text-align: right; }

/* --- dashboard --- */
.toolbar { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.toolbar label { margin: 0; min-width: 200px; }
.toolbar .grow { flex: 1; }
.alerts { background: var(--panel); border: 1px solid #5c2c22; border-radius: var(--radius); padding: .8rem 1rem; margin: 1rem 0; }
.alerts ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.alerts h2 { margin-bottom: .4rem; }
.pill { justify-self: start; display: inline-block; line-height: 1.5; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.pill.bad { background: rgba(200, 85, 61, .2); color: #ffb3a3; border: 1px solid var(--bad); }
.pill.good { background: rgba(61, 163, 93, .15); color: #b9e6c6; border: 1px solid var(--accent); }
.tiles { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 1rem 0; }
.tile {
  display: grid; gap: .25rem; align-content: start; padding: 1rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none;
}
.tile:hover { border-color: var(--muted); }
.tile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tile strong { font-size: 1.9rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile .delta { color: var(--ink); font-variant-numeric: tabular-nums; font-size: .9rem; }
.tile .muted { font-size: .9rem; }
.focus { display: grid; gap: 1rem; }
.chart { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem .6rem; }
.chart figcaption { margin-bottom: .5rem; display: flex; gap: .4rem 1rem; flex-wrap: wrap; align-items: baseline; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { margin-left: auto; color: var(--muted); font-size: .85rem; display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--accent); margin-left: .6rem; }
.key.prev { border-top: 2px dashed var(--prev); }
.key.tgt { border-top: 2px dashed var(--warn); }
.grid { stroke: var(--line); stroke-width: 1; }
.axis, .label, .value { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.label { fill: var(--ink); font-size: 13px; }
.value { fill: var(--ink); }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line.cur { stroke: var(--accent); }
.line.prev { stroke: var(--prev); stroke-dasharray: 5 4; }
.dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.target { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 3 4; }
.bar { fill: var(--accent); }
.bar.below { fill: var(--bad); }
.hit { fill: transparent; }
.hit:hover { fill: rgba(255, 255, 255, .05); }
details summary { cursor: pointer; color: var(--muted); padding: .3rem 0; }
.empty { text-align: center; padding: 2.5rem 1rem; }
.full { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 2rem; }
.disabled {
  display: grid; gap: .2rem; padding: .9rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); opacity: .75;
}
.disabled strong { color: var(--ink); }
.disabled em { font-style: normal; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--warn); }

@media (max-width: 600px) {
  main { padding: .7rem; }
  .hero { margin: 4vh auto; }
  .hero h1 { font-size: 1.6rem; }
  .bar nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .toolbar label { min-width: 0; flex: 1 1 140px; }
  .tile strong { font-size: 1.6rem; }
  .list .small { display: none; }
}
