/* Nook admin. The tokens are the website's (Frontend/Website/index.html) and the app's (NookTheme.kt):
   Floral White and Carbon Black neutrals, Hunter Green accent, Manrope headings, DM Sans body. */
:root {
  --canvas: #F8F5EA;
  --page: #FFFDF5;
  --surface: #FFFFFC;
  --surface-2: #F3F0E4;
  --hover: #F1EDE0;
  --hairline: #E7E2D2;
  --strong: #D4CEBC;
  --text: #1B1A18;
  --text-2: #605C52;
  --text-3: #8F8A7D;
  --accent: #446D49;
  --accent-soft: rgba(68, 109, 73, 0.12);
  --red: #B3453B;
  --red-soft: #F6E3E0;
  --lavender-ink: #805D93;
  --lavender-soft: #EEE7F2;
  /* Chart marks: the brand green and lavender one step deeper, so they clear the chart checks
     (chroma, contrast, colour-blind separation) against the card. De-emphasis is a warm grey. */
  --series-1: #36733D;
  --series-2: #816AB9;
  --series-muted: #D4CEBC;
  --shadow: 0 30px 80px -30px rgba(27, 26, 24, 0.28), 0 2px 6px rgba(27, 26, 24, 0.05);
  --shadow-tip: 0 12px 32px -12px rgba(27, 26, 24, 0.3), 0 1px 3px rgba(27, 26, 24, 0.08);
  --heading: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #151412;
    --page: #1B1A18;
    --surface: #242320;
    --surface-2: #2B2A26;
    --hover: #2C2B27;
    --hairline: #363530;
    --strong: #4A4843;
    --text: #F2EFE6;
    --text-2: #A9A59A;
    --text-3: #75716A;
    --accent: #7FAE85;
    --accent-soft: rgba(127, 174, 133, 0.16);
    --red: #E07A6F;
    --red-soft: #3A2523;
    --lavender-ink: #B69AC6;
    --lavender-soft: #2E2634;
    --series-1: #609D65;
    --series-2: #8C78C1;
    --series-muted: #4A4843;
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.25);
    --shadow-tip: 0 12px 32px -12px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--canvas); }
html { scrollbar-gutter: stable; }
body {
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--heading); margin: 0; text-wrap: balance; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mono { font-family: var(--mono); letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Buttons, as on the website. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 9px;
  font-family: var(--body); font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn-dark { background: var(--text); color: var(--page); }
.btn-dark:hover { background: color-mix(in srgb, var(--text) 86%, var(--page)); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--hairline); }
.btn-ghost:hover { background: var(--hover); }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* Sign in. */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(100%, 380px); padding: 36px 32px 32px; border-radius: 16px;
  background: var(--page); border: 1px solid var(--hairline); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.login-mark { width: 40px; height: 40px; margin-bottom: 24px; }
.login h1 { font-weight: 800; font-size: 28px; letter-spacing: -0.03em; line-height: 1.05; }
.login .lead { margin: 8px 0 24px; color: var(--text-2); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.field input {
  height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--text); font: 15px var(--body); letter-spacing: -0.01em;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { min-height: 20px; margin: 12px 0 0; font-size: 13px; color: var(--red); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.wallet-list { display: flex; flex-direction: column; gap: 8px; }
.wallet-list .btn { justify-content: center; gap: 10px; }
.wallet-list .btn img { width: 20px; height: 20px; border-radius: 5px; flex: none; }
.login .hint { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-3); }
.login .hint b { color: var(--text-2); font-weight: 500; }
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0; font-size: 12px; color: var(--text-3); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* The frame: a sidebar on the canvas colour, the page on Floral White, as in the app. */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 20px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 8px; text-decoration: none; color: var(--text); }
.brand-mark { width: 28px; height: 28px; flex: none; }
.wordmark { width: 40px; height: 14px; flex: none; }
.brand-tag {
  margin-left: 2px; padding: 2px 7px; border-radius: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--hairline);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-link {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-2); text-decoration: none;
  background: none; border: 0; cursor: pointer; text-align: left; width: 100%;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.side-nav svg, .side-link svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a:hover, .side-link:hover { background: var(--hover); color: var(--text); }
.side-nav a.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--hairline); }
.side-nav .count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums;
  background: var(--accent-soft); color: var(--accent);
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.demo-pill {
  align-self: flex-start; margin: 0 10px; padding: 3px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; background: var(--lavender-soft); color: var(--lavender-ink);
}

.main {
  margin: 8px 8px 8px 0; padding: 40px clamp(20px, 4vw, 48px) 64px;
  background: var(--page); border: 1px solid var(--hairline); border-radius: 16px;
  min-width: 0;
}
.page { max-width: 1120px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-weight: 800; font-size: 32px; letter-spacing: -0.03em; line-height: 1; }
.page-head .sub { margin: 10px 0 0; color: var(--text-2); max-width: 620px; }

/* Segmented control: ranges and filters. */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--hairline); }
.seg button {
  height: 30px; padding: 0 12px; border-radius: 7px; border: 0; background: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(27, 26, 24, 0.08), 0 0 0 1px var(--hairline); }
.seg .n { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Cards. */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; padding: 20px 22px 22px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card h2 { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; line-height: 1.3; }
.card .note { margin: 3px 0 0; font-size: 13px; color: var(--text-3); }
.usage-body { display: flex; flex-direction: column; gap: 16px; transition: opacity 0.2s ease; }
.usage-body.loading, .feedback-list.loading { opacity: 0.55; pointer-events: none; }

/* Stat tiles. Values in proportional figures; the delta says what it is compared with. */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px 20px; }
.kpi .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.kpi .value { margin-top: 10px; font-family: var(--heading); font-weight: 700; font-size: 36px; letter-spacing: -0.03em; line-height: 1; }
.kpi .value small { font-size: 18px; font-weight: 600; color: var(--text-3); letter-spacing: -0.02em; margin-left: 2px; }
.kpi .delta { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.kpi .delta b { font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi .delta.up b { color: var(--accent); }
.kpi .delta.down b { color: var(--red); }
.kpi .delta svg { display: inline-block; vertical-align: -1px; margin-right: 4px; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi .delta.up svg { color: var(--accent); }
.kpi .delta.down svg { color: var(--red); }

/* The daily chart. */
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend .s1 { background: var(--series-1); }
.legend .s2 { background: var(--series-2); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.chart .grid line { stroke: var(--hairline); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis text { fill: var(--text-3); font-size: 11px; font-family: var(--body); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.chart .ret { fill: var(--series-1); }
.chart .new { fill: var(--series-2); }
.chart .col { transition: opacity 0.12s ease; }
.chart.hovering .col { opacity: 0.45; }
.chart.hovering .col.on { opacity: 1; }
.chart .cap { fill: var(--text-2); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.empty { padding: 36px 16px; text-align: center; color: var(--text-3); font-size: 14px; }
.empty strong { display: block; margin-bottom: 4px; color: var(--text-2); font-weight: 500; }

.table-view { margin-top: 12px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.table-view summary { cursor: pointer; font-size: 13px; color: var(--text-2); width: max-content; }
.table-view summary:hover { color: var(--text); }
.table-scroll { max-height: 280px; overflow: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--text-3); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--hairline); position: sticky; top: 0; background: var(--surface); }
td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--hairline); color: var(--text-2); font-variant-numeric: tabular-nums; }
th.num, td.num { text-align: right; }
tr:last-child td { border-bottom: 0; }

/* Breakdowns: one row per class, the bar under its label, the value at the right. */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: baseline; }
.bar-label { font-size: 14px; color: var(--text); min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
.bar-value { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-value span { color: var(--text-3); }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 2px; background: var(--surface-2); }
.bar-fill { display: block; height: 8px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--series-1); transition: filter 0.15s ease; }
.bar-fill.muted { background: var(--series-muted); }
.bar-row:hover .bar-fill { filter: brightness(1.12); }
.chip { padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 500; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.chip.warn { background: rgba(217, 119, 87, 0.16); color: #9A4B2E; }
@media (prefers-color-scheme: dark) { .chip.warn { background: rgba(217, 119, 87, 0.22); color: #E8A184; } }
.foot-note { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--hairline); font-size: 13px; color: var(--text-3); }

/* Invites. */
.inv-stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-bottom: 18px; }
.inv-stats div { display: flex; flex-direction: column; gap: 2px; }
.inv-stats b { font-family: var(--heading); font-weight: 700; font-size: 24px; letter-spacing: -0.03em; line-height: 1.1; }
.inv-stats span { font-size: 13px; color: var(--text-3); }
.inv-sub { margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.ok-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.ok-line svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Feedback. */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.feedback-list { display: flex; flex-direction: column; gap: 12px; transition: opacity 0.2s ease; }
.fb { padding: 18px 20px; }
.fb-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500;
}
.tag svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tag-bug { background: var(--red-soft); color: var(--red); }
.tag-feedback { background: var(--lavender-soft); color: var(--lavender-ink); }
.fb-time { font-size: 13px; color: var(--text-3); }
.fb-msg { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font-size: 15px; line-height: 1.55; }
.fb-msg.clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.more { margin-top: 6px; padding: 0; border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.fb-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.fb-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-3); min-width: 0; }
.fb-meta .mono { font-size: 12px; }
.fb-actions { display: flex; gap: 8px; }

/* Tooltip: the value first, the series second, line keys. */
.tip {
  position: fixed; z-index: 50; pointer-events: none; min-width: 150px;
  padding: 10px 12px; border-radius: 10px; background: var(--page); border: 1px solid var(--hairline);
  box-shadow: var(--shadow-tip); font-size: 13px;
}
.tip .t-date { color: var(--text-3); font-size: 12px; margin-bottom: 4px; }
.tip .t-total { font-family: var(--heading); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; margin-bottom: 6px; }
.tip .t-total span { font-family: var(--body); font-weight: 400; font-size: 13px; color: var(--text-2); letter-spacing: -0.01em; margin-left: 4px; }
.tip .t-row { display: flex; align-items: center; gap: 8px; color: var(--text-2); line-height: 1.7; }
.tip .t-row i { width: 12px; height: 2px; border-radius: 1px; }
.tip .s1 { background: var(--series-1); }
.tip .s2 { background: var(--series-2); }
.tip .none { background: var(--hairline); }
.tip .t-row b { color: var(--text); font-weight: 500; min-width: 22px; font-variant-numeric: tabular-nums; }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trio { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 12px;
    padding: 10px 16px; background: color-mix(in srgb, var(--canvas) 88%, transparent);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--hairline);
  }
  .brand { padding: 0; }
  .brand .wordmark, .brand-tag { display: none; }
  .side-nav { flex-direction: row; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .demo-pill { margin: 0; }
  .side-link { width: auto; }
  .main { margin: 0; border: 0; border-radius: 0; padding: 28px 16px 48px; }
}
@media (max-width: 560px) {
  .kpis { gap: 10px; }
  .kpi { padding: 14px 14px 16px; }
  .kpi .value { font-size: 30px; }
  .side-link .label, .demo-pill { display: none; }
  .side { gap: 6px; }
  .side-nav a { padding: 0 8px; }
  .page-head h1 { font-size: 28px; }
  .card { padding: 16px; }
  .side-foot .side-link { padding: 0 8px; }
}
