@font-face {
  font-family: DM;
  src: url(/assets/dm-sans.ttf) format("truetype");
  font-weight: 400 499;
  font-display: swap;
}
@font-face {
  font-family: DM;
  src: url(/assets/dm-sans-semibold.ttf) format("truetype");
  font-weight: 500 900;
  font-display: swap;
}
:root {
  --ink: #18213c;
  --muted: #626c83;
  --violet: #6950c9;
  --nav: #0b1739;
  --blue: #497ee6;
  --line: #e2e6ee;
  --bg: #f5f6fa;
  --pale: #eeebfa;
  --green: #197758;
  --shadow: 0 3px 12px rgba(28, 33, 65, 0.035);
  font-family: DM, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button,
a,
input,
select,
textarea,
summary {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #a99ae9;
}
button {
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.62;
  cursor: wait;
}
button[aria-busy="true"]::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
a {
  color: var(--violet);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
strong,
b,
th {
  font-weight: 600;
}
h1 {
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: -0.055em;
}
h2 {
  font-size: 1.17rem;
  letter-spacing: -0.035em;
  line-height: 1.28;
}
h3 {
  font-size: 1rem;
}
p {
  line-height: 1.55;
}
.icon {
  display: inline-block;
  flex: none;
  vertical-align: middle;
}
.loading {
  padding: 3rem;
}
.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  padding: 0 !important;
}
.btn,
.primary,
.link,
.mini,
.side-out,
.prompt,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  line-height: 1.25;
  min-height: 40px;
  font-weight: 600;
  border-radius: 9px;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.btn,
.primary,
.danger,
.prompt {
  padding: 0.67rem 1rem;
}
.btn {
  background: #fff;
  border: 1px solid #d9dce7;
  color: #36405b;
}
.btn:hover {
  background: #f7f6fc;
}
.primary {
  color: white;
  background: #6750c8;
  border: 1px solid #6650c7;
  box-shadow: 0 3px 8px #4936a81c;
}
.primary:hover {
  background: #533aad;
}
.compact {
  min-height: 34px;
  padding: 0.42rem 0.72rem;
}
.mini {
  width: 35px;
  height: 35px;
  min-height: 35px;
  color: #68718a;
}
.mini:hover {
  background: #eceaf5;
}
.link {
  min-height: 34px;
  color: #6448bc;
  padding: 0.2rem 0.4rem;
}
.link:hover {
  background: #f4f0ff;
}
.danger {
  color: #ac3b3d;
  background: #fff3f1;
}
.btn small,
.primary small {
  font-size: inherit;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.46rem;
  font-size: 0.88rem;
  font-weight: 600;
}
input,
select,
textarea {
  border: 1px solid #cfd3e1;
  background: white;
  border-radius: 8px;
  min-height: 42px;
  padding: 0.64rem 0.76rem;
  max-width: 100%;
  min-width: 0;
  font-size: 0.96rem;
  font-weight: 400;
}
textarea {
  resize: vertical;
}
select {
  padding-right: 1.75rem;
}
input::placeholder,
textarea::placeholder {
  color: #8790a1;
}
input[type="file"] {
  font-size: 0.85rem;
  padding: 0.45rem;
  background: transparent;
  border: 0;
}
input::file-selector-button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.4rem;
  color: #424b66;
  cursor: pointer;
}
input[type="number"] {
  font-variant-numeric: tabular-nums;
}
small {
  color: var(--muted);
  font-size: 0.79rem;
}
.brand-mark {
  display: block;
  position: relative;
  width: 86px;
  height: 35px;
  overflow: hidden;
  flex: none;
}
.brand-mark img {
  position: absolute;
  width: 109px;
  height: 109px;
  max-width: none;
  left: -11px;
  top: -35px;
  mix-blend-mode: lighten;
}
.muted-text {
  color: var(--muted);
  font-size: 0.91rem;
}
.login-page {
  min-height: 100dvh;
  background: white;
  display: grid;
  grid-template-columns: minmax(390px, 1.03fr) minmax(390px, 0.97fr);
  padding: 14px;
}
.login-art {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 650px;
  border-radius: 23px;
  background:
    radial-gradient(at 100% 40%, #302565 0%, transparent 58%),
    radial-gradient(at 14% 100%, #182d64 0%, transparent 56%), #101b3f;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(35px, 5vw, 90px);
  color: #fff;
}
.art-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  background-image:
    linear-gradient(#9ca9ed18 1px, transparent 1px),
    linear-gradient(90deg, #9ca9ed18 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(130deg, rgba(0, 0, 0, 0.2), #000);
}
.login-art::after {
  position: absolute;
  content: "";
  width: 430px;
  height: 430px;
  right: -320px;
  top: 28%;
  border: 1px solid #b9aff839;
  box-shadow:
    0 0 0 34px #c0bdf507,
    0 0 0 70px #c0bdf507,
    0 0 0 108px #c0bdf507,
    0 0 0 149px #c0bdf507;
  border-radius: 50%;
  z-index: -1;
}
.hero-brand {
  position: absolute;
  top: clamp(28px, 4vw, 53px);
  left: clamp(32px, 5vw, 90px);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero-brand > span:last-child,
.mobile-brand > span:last-child {
  padding-left: 1rem;
  border-left: 1px solid #ffffff4b;
  font-size: 0.93rem;
  font-weight: 500;
  color: #eef0ff;
}
.art-heading,
.art-card {
  width: min(100%, 438px);
}
.art-heading {
  margin-top: 70px;
}
.kicker {
  color: #cfc9fb;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.kicker i {
  width: 23px;
  height: 2px;
  background: #a495f2;
}
.art-heading h2 {
  font-size: clamp(2.5rem, 4.65vw, 4.8rem);
  line-height: 1.03;
  letter-spacing: -0.068em;
  margin: 1.32rem 0 2rem;
}
.art-heading h2 em {
  font-style: normal;
  color: #b8a5ff;
}
.art-card {
  background: linear-gradient(113deg, #ffffff12, #ffffff08);
  border: 1px solid #d8dafb37;
  border-radius: 18px;
  padding: clamp(20px, 2.5vw, 34px);
  box-shadow: 0 20px 45px #05081922;
  backdrop-filter: blur(4px);
}
.art-card-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #e8e8ff;
  font-size: 0.88rem;
}
.art-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  background: #b8b4ff20;
  border-radius: 8px;
  color: #d9d3ff;
}
.example-tag {
  margin-left: auto;
  font-size: 0.72rem;
  border: 1px solid #aab3dd52;
  border-radius: 99px;
  padding: 0.2rem 0.55rem;
  color: #d8def6;
}
.art-card > strong {
  display: block;
  font-size: clamp(2.1rem, 3.3vw, 3.5rem);
  letter-spacing: -0.055em;
  margin: 0.5rem 0 0.9rem;
}
.art-card > strong span {
  font-size: 0.63em;
  color: #c8c7e2;
}
.art-legend,
.art-legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.art-legend {
  gap: 1rem;
  color: #d4d7ec;
  font-size: 0.73rem;
}
.art-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b5a3ff;
}
.art-legend span:nth-child(2) i {
  background: #6dc5d2;
}
.art-chart {
  margin-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 3%;
  background: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent 29px,
    #e8ebff12 29px,
    #e8ebff12 30px
  );
  border-radius: 3px;
}
.art-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.art-bar > div {
  display: flex;
  width: 65%;
  height: 91px;
  gap: 3px;
  align-items: flex-end;
}
.art-bar i,
.art-bar b {
  flex: 1;
  background: linear-gradient(0deg, #8c73dc, #bdafff);
  border-radius: 3px 3px 0 0;
}
.art-bar b {
  background: linear-gradient(0deg, #4d98a6, #79c9d2);
}
.art-bar small {
  color: #bec7e2;
  padding-top: 4px;
  font-size: 0.7rem;
}
.login-main {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 58px 9%;
}
.login-inner {
  width: min(100%, 380px);
}
.login-icon,
.icon-tile {
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--pale);
  color: var(--violet);
  width: 41px;
  height: 41px;
  flex: none;
}
.login-icon {
  width: 53px;
  height: 53px;
  border: 1px solid #e5def9;
  background: #f3effc;
  margin-bottom: 1.5rem;
  border-radius: 15px;
}
.login-inner h1 {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  margin-bottom: 0.7rem;
}
.login-inner > p {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}
.login-btn,
.demo-btn {
  width: 100%;
  min-height: 46px;
}
.login-btn {
  margin-top: 1.25rem;
}
.login-links {
  display: flex;
  justify-content: space-between;
}
.divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.84rem;
  margin: 1.35rem 0;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}
.sample-hint {
  display: block;
  text-align: center;
  margin: 0.55rem auto;
  color: #737b8e;
}
.login-footer {
  position: absolute;
  bottom: 32px;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #6d768c;
}
.mobile-brand {
  display: none;
}
.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
}
.sidebar {
  background: linear-gradient(168deg, #111e46, #0c1839 72%, #182345);
  color: #dce0f3;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 28px 15px 16px;
  overflow-y: auto;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 7px 23px;
}
.side-brand b {
  font-size: 0.86rem;
  line-height: 1.13;
  border-left: 1px solid #8190bc5c;
  padding-left: 11px;
  letter-spacing: -0.01em;
  color: #e4e7f5;
}
.side-divider {
  height: 1px;
  background: #9ca8ce24;
  margin: 0 6px;
}
.sidebar nav section {
  margin-top: 1.38rem;
}
.sidebar nav section > p {
  text-transform: uppercase;
  font-size: 0.68rem;
  color: #a4afd0;
  letter-spacing: 0.12em;
  padding: 0 14px;
  margin-bottom: 0.48rem;
  font-weight: 600;
}
.nav-item {
  width: 100%;
  text-align: left;
  display: flex;
  gap: 0.78rem;
  min-height: 41px;
  align-items: center;
  color: #ccd5ed;
  font-size: 0.9rem;
  margin: 2px 0;
  padding: 9px 13px;
  border-radius: 8px;
}
.nav-item .icon {
  color: #b5c0dd;
}
.nav-item:hover,
.side-out:hover {
  background: #ffffff0e;
}
.nav-item.active {
  color: #fff;
  background: #6a59ab50;
  box-shadow: inset 3px 0 #a995ff;
}
.nav-item.active .icon {
  color: #d4c8ff;
}
.side-bottom {
  margin-top: auto;
  padding-top: 30px;
}
.side-user {
  display: flex;
  align-items: center;
  gap: 0.67rem;
  border-top: 1px solid #99a4c92e;
  padding: 16px 6px 8px;
}
.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #6855a8;
  color: white;
  flex: none;
}
.side-user > div {
  min-width: 0;
}
.side-user strong,
.side-user small,
.family-list strong,
.family-list small {
  display: block;
}
.side-user strong {
  font-size: 0.91rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-user small {
  color: #b7bfd7;
  font-size: 0.77rem;
}
.side-out {
  color: #bfc9e3;
  min-height: 32px;
  padding: 4px 6px;
  justify-content: flex-start;
  font-size: 0.81rem;
}
.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 3.1vw, 52px);
  gap: 12px;
}
.bread,
.family-chip,
.period,
.page-tools,
.cell-title,
.tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.bread {
  font-size: 0.86rem;
  color: var(--muted);
}
.bread span {
  color: #a7adbd;
}
.bread b {
  font-weight: 400;
  color: #465069;
}
.family-chip {
  font-size: 0.85rem;
  font-weight: 600;
  background: #f7f7fb;
  border: 1px solid #e4e6ee;
  border-radius: 99px;
  padding: 0.45rem 0.7rem;
  min-width: 0;
}
.family-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 192px;
}
.family-chip .icon {
  color: var(--violet);
}
.mobile-menu,
.shade {
  display: none;
}
#workspace-main {
  max-width: 1700px;
  margin: auto;
  padding: clamp(20px, 2.6vw, 40px) clamp(18px, 3.1vw, 52px) 50px;
}
.demo-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  color: #67599a;
  margin: 0 0 18px;
  background: #eeebf8;
  border: 1px solid #e5dff4;
  border-radius: 8px;
  padding: 3px 10px;
}
.demo-bar .link {
  margin-left: auto;
  font-size: 0.79rem;
  min-height: 28px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.55rem;
}
.page-header p,
.card-head p,
.record > p,
.pantry-intro p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.37rem;
}
.page-tools {
  gap: 0.6rem;
  flex-wrap: wrap;
}
.period {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 0 0.5rem 0 0.7rem;
  font-size: 0.88rem;
  color: #47506a;
  gap: 5px;
}
.period select {
  border: 0;
  padding: 0.45rem 0;
  min-height: 40px;
  background: none;
  font-size: 0.87rem;
  font-weight: 600;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpis.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.kpi,
.card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 15px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.kpi {
  padding: 18px 18px 15px;
  position: relative;
  overflow: hidden;
}
.k-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  font-size: 0.87rem;
  color: #4f5973;
  font-weight: 600;
}
.k-title span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--pale);
  color: var(--violet);
}
.k-value {
  font-size: clamp(1.35rem, 2.1vw, 2.45rem);
  line-height: 1.2;
  letter-spacing: -0.05em;
  margin: 0.85rem 0 0.25rem;
  font-variant-numeric: tabular-nums;
}
.k-foot {
  font-size: 0.78rem;
  color: #69738a;
}
.kpi.dark {
  color: #fff;
  background: linear-gradient(115deg, #17264e, #24275e);
  border-color: #242a55;
}
.kpi.dark:after {
  pointer-events: none;
  position: absolute;
  content: "";
  right: -62px;
  bottom: -105px;
  width: 155px;
  height: 155px;
  border: 1px solid #b3a1e92e;
  border-radius: 50%;
  box-shadow:
    0 0 0 12px #b4a2e709,
    0 0 0 25px #b4a2e709,
    0 0 0 40px #b4a2e709;
}
.dark .k-title,
.dark .k-foot {
  color: #e1e2f5;
}
.dark .k-title span {
  color: #d8c8ff;
  background: #bd9ef72b;
}
.green .k-title span,
.t-green {
  color: #267960 !important;
  background: #e1f4ec !important;
}
.coral .k-title span,
.t-peach {
  color: #bc6852 !important;
  background: #fcebe4 !important;
}
.t-lilac {
  background: #eeeafa !important;
  color: #7560ba !important;
}
.charts {
  display: grid;
  grid-template-columns: 1.28fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 21px 22px 16px;
}
.card-head p {
  font-size: 0.82rem;
}
.card-head .icon-tile {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.legend {
  display: flex;
  gap: 1rem;
  padding: 0 22px 9px;
}
.legend button {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  padding: 2px 0;
}
.legend .muted {
  opacity: 0.42;
}
.dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  flex: none;
  border-radius: 3px;
}
.violet {
  background: #8268d9;
}
.teal {
  background: #58b8c0;
}
.barchart {
  display: flex;
  padding: 0 22px 19px;
  gap: 8px;
}
.axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 24px;
  text-align: right;
  color: var(--muted);
  font-size: 0.68rem;
}
.graph {
  min-width: 0;
  flex: 1;
  padding-top: 4px;
}
.plot {
  height: 144px;
  display: flex;
  justify-content: space-around;
  background: repeating-linear-gradient(
    to top,
    #dce1ee 0,
    #dce1ee 1px,
    transparent 1px,
    transparent 25%
  );
}
.bar-pair {
  display: flex;
  padding: 0 4px;
  align-items: end;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.bar-pair:hover {
  background: #8c80cb10;
}
.bar {
  width: min(28%, 23px);
  border-radius: 4px 4px 0 0;
}
.bar.inc {
  background: #8268d9;
}
.bar.exp {
  background: #58b8c0;
}
.bar-labels {
  display: flex;
  justify-content: space-around;
  margin-top: 6px;
}
.bar-labels span {
  flex: 1;
  text-align: center;
  font-size: 0.69rem;
  color: #69738a;
  overflow: hidden;
}
.donut-row {
  display: flex;
  gap: clamp(12px, 2vw, 35px);
  align-items: center;
  justify-content: space-evenly;
  padding: 12px 22px 22px;
}
.ring {
  display: grid;
  place-items: center;
  width: clamp(90px, 10vw, 150px);
  aspect-ratio: 1;
  border-radius: 50%;
  flex: none;
}
.ring > div {
  width: 71%;
  height: 71%;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.ring strong {
  font-size: 1.7rem;
  line-height: 1.1;
}
.ring small {
  font-size: 0.73rem;
}
.category-key {
  min-width: 0;
  flex: 1;
}
.category-key button {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.79rem;
  text-align: left;
  width: 100%;
  padding: 0.34rem 0;
}
.category-key button span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-key button b {
  color: #526078;
  font-size: 0.78rem;
}
.category-key button:hover {
  background: #f7f6fc;
}
.table-scroll {
  overflow: auto;
  width: 100%;
  border-radius: 0 0 15px 15px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}
td,
th {
  padding: 12px 16px;
  white-space: nowrap;
}
th {
  font-size: 0.73rem;
  color: #626d84;
  background: #f8f9fc;
  font-weight: 600;
  border-top: 1px solid #e9ebf1;
  border-bottom: 1px solid #e9ebf1;
}
td {
  border-bottom: 1px solid #eef0f5;
  color: #576078;
}
tr:last-child td {
  border-bottom: 0;
}
th:first-child,
td:first-child {
  padding-left: 22px;
}
.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
td.num {
  font-weight: 600;
  color: #2e3855;
}
.pos,
.pos.num {
  color: #28775c;
}
.cell-title {
  color: var(--ink);
  font-weight: 600;
}
.table-ico {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  flex: none;
}
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  gap: 0.55rem;
  padding: 2.1rem 1.25rem;
}
.empty .icon-tile {
  margin-bottom: 0.2rem;
}
.empty p {
  color: var(--muted);
  font-size: 0.9rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 22px 18px;
}
.filters select,
.search input {
  min-height: 37px;
  font-size: 0.85rem;
}
.search {
  flex: 1;
  min-width: 150px;
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  border: 1px solid #cfd3e1;
  border-radius: 8px;
  padding: 0 10px;
  color: #727a90;
}
.search input {
  border: 0;
  padding: 4px;
  flex: 1;
}
.records,
.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 16px;
}
.wide {
  grid-column: 1/-1;
}
.record {
  padding: 20px;
}
.record .card-head {
  padding: 0 0 16px;
}
.record-value {
  font-size: 1.8rem;
  letter-spacing: -0.05em;
}
.record-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 0.85rem;
  margin-top: 0.7rem;
}
.record-line > span {
  color: var(--muted);
}
.record-date {
  margin-top: 17px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.79rem;
  color: #656f86;
  display: flex;
  align-items: center;
  gap: 6px;
}
.record-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  flex-wrap: wrap;
}
.progress {
  height: 7px;
  border-radius: 6px;
  background: #eeecf5;
  margin: 14px 0;
}
.progress i {
  height: 100%;
  background: #8065d2;
  display: block;
  border-radius: 6px;
}
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  color: #624ca2;
  background: #eeeafa;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
}
.family-list {
  padding: 0 22px 12px;
}
.family-list > div,
.category-list > div {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 13px 0;
}
.family-list > div > strong,
.family-list > div > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.family-list .tag,
.family-list .btn,
.category-list .mini {
  margin-left: auto;
}
.category-list {
  max-height: 330px;
  overflow: auto;
}
.pantry-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.pantry-intro .icon-tile {
  width: 47px;
  height: 47px;
}
.tools {
  margin-bottom: 10px;
}
.detail-title {
  margin-top: 0.5rem;
}
.plan-totals {
  display: flex;
  gap: clamp(16px, 4vw, 65px);
  padding: 0 22px 20px;
  flex-wrap: wrap;
}
.plan-totals b,
.plan-totals small {
  display: block;
}
.plan-totals b {
  font-size: 1.3rem;
  letter-spacing: -0.04em;
}
.card + .card {
  margin-top: 16px;
}
.charts .card + .card,
.records .card + .card,
.family-grid .card + .card {
  margin-top: 0;
}
.inset {
  padding: 0 22px 20px;
}
.offer-summary p {
  font-size: 0.85rem;
}
.store {
  border-top: 1px solid var(--line);
  padding: 12px 22px;
  font-size: 0.9rem;
}
.store summary {
  font-weight: 600;
}
.store ul {
  padding: 0;
}
.store li {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 0;
  align-items: center;
}
.inline-link {
  display: inline-flex;
  margin: 14px 22px;
}
.chat-stream {
  padding: 0 22px 20px;
  min-height: 230px;
  max-height: 55dvh;
  overflow: auto;
}
.chat-welcome {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 28px 10px;
}
.chat-welcome p,
.bubble b {
  font-size: 0.85rem;
  color: var(--muted);
}
.chat-welcome > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 0.7rem;
}
.prompt {
  font-size: 0.8rem;
  border: 1px solid #e1dbf5;
  background: #f7f5fd;
  color: #584497;
}
.chat-card form {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 16px 20px;
}
.chat-card textarea {
  flex: 1;
  min-width: 0;
}
.bubble {
  margin: 10px 0;
  background: #f3f2f9;
  border-radius: 10px;
  padding: 12px 14px;
  max-width: 90%;
}
.bubble.user {
  margin-left: auto;
  background: #eeebfb;
}
.bubble p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 15px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
dialog {
  border: 1px solid #e1dfee;
  border-radius: 16px;
  width: min(470px, calc(100vw - 24px));
  max-height: 90dvh;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 70px #0c173642;
}
dialog.large {
  width: min(640px, calc(100vw - 24px));
}
dialog::backdrop {
  background: #0c173681;
  backdrop-filter: blur(3px);
}
body:has(dialog[open]) {
  overflow: hidden;
}
.modal-body {
  padding: 20px;
}
.modal-body form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  flex-wrap: wrap;
}
.form-actions .danger {
  margin-right: auto;
}
.form-msg {
  font-size: 0.88rem;
  color: #a33438;
  padding: 8px 12px;
  background: #fff0ed;
  border-radius: 8px;
  margin: 10px 0;
}
.attachment,
.ai-box,
.item-row,
.receipt-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fafafd;
  min-width: 0;
  margin: 0;
}
.attachment small {
  display: block;
  margin-top: 6px;
}
.ai-box summary {
  color: var(--violet);
  font-weight: 600;
  cursor: pointer;
}
.ai-box[open] > *,
.item-row > * + *,
.receipt-row > * + * {
  margin-top: 10px;
}
.ai-box[open] summary {
  margin-top: 0;
}
.form-head,
.row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.item-row + .item-row,
.receipt-row + .receipt-row {
  margin-top: 10px;
}
.row-title .link {
  min-height: 25px;
  font-size: 0.8rem;
}
.attachment .btn {
  margin-top: 0.5rem;
}
.modal-body .category-list + form {
  margin-top: 18px;
}
#toast {
  position: fixed;
  z-index: 10;
  right: 18px;
  bottom: 18px;
  max-width: min(90vw, 430px);
  border-radius: 10px;
  background: #192a46;
  color: white;
  box-shadow: 0 5px 20px #192a4630;
  padding: 12px 16px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 0.2s;
}
#toast.on {
  opacity: 1;
  transform: translateY(0);
}
#toast.error {
  background: #7c3944;
}
@media (min-width: 1600px) {
  .shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }
  .art-bar > div {
    height: 124px;
  }
  .plot {
    height: 184px;
  }
}
@media (max-width: 1200px) {
  .shell {
    grid-template-columns: 198px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 10px;
    padding-right: 10px;
  }
  .kpi {
    padding: 15px;
  }
  .charts {
    grid-template-columns: 1.08fr 1fr;
  }
  .donut-row {
    gap: 12px;
    padding: 9px 15px 18px;
  }
  .page-header {
    align-items: flex-start;
  }
  .kpis {
    gap: 10px;
  }
  .card-head {
    padding: 18px;
  }
  .k-title {
    font-size: 0.8rem;
  }
}
@media (max-width: 990px) {
  .shell {
    grid-template-columns: 173px minmax(0, 1fr);
  }
  .side-brand {
    gap: 5px;
    padding-left: 0;
  }
  .side-brand b {
    font-size: 0.75rem;
    padding-left: 6px;
  }
  .nav-item {
    font-size: 0.84rem;
    padding-left: 10px;
    gap: 0.55rem;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi .k-value {
    font-size: 1.75rem;
  }
  .page-header {
    flex-wrap: wrap;
  }
  .charts {
    grid-template-columns: 1fr;
  }
  .donut-row {
    justify-content: flex-start;
  }
  .category-key {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 12px;
  }
  .charts .card-head {
    padding-bottom: 12px;
  }
  .login-art {
    padding: 32px;
  }
  .art-heading {
    margin-top: 90px;
  }
  .login-main {
    padding: 60px 9%;
  }
}
@media (max-width: 760px) {
  .login-page {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #fff;
  }
  .login-art {
    display: none;
  }
  .login-main {
    flex: 1;
    min-height: 100dvh;
    flex-direction: column;
    padding: 26px 24px 68px;
    justify-content: center;
  }
  .mobile-brand {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    padding: 0 24px;
    background: var(--nav);
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .login-inner {
    margin-top: 58px;
  }
  .login-footer {
    bottom: 20px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    z-index: 5;
    left: 0;
    top: 0;
    width: 235px;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .nav-open .sidebar {
    transform: translateX(0);
  }
  .nav-open .shade {
    display: block;
    position: fixed;
    inset: 0;
    background: #101c3f65;
    z-index: 4;
  }
  .mobile-menu {
    display: flex;
  }
  .topbar {
    height: 55px;
    padding: 0 14px;
  }
  .topbar .bread > .icon,
  .bread > span {
    display: none;
  }
  .bread {
    gap: 0.25rem;
  }
  .family-chip {
    padding: 0.36rem 0.55rem;
  }
  .side-brand {
    padding-left: 8px;
  }
  .side-brand b {
    font-size: 0.88rem;
  }
  .nav-item {
    font-size: 0.93rem;
    min-height: 43px;
  }
  .charts {
    gap: 12px;
  }
  .page-header {
    gap: 0.8rem;
    margin-bottom: 15px;
  }
  .page-header p {
    font-size: 0.87rem;
  }
  .kpis {
    gap: 9px;
    margin-bottom: 12px;
  }
  .kpis.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .three .k-title span {
    display: none;
  }
  .three .kpi {
    padding: 12px;
  }
  .three .k-value {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }
  .card-head {
    padding: 16px;
  }
  .barchart {
    padding: 0 16px 16px;
  }
  .legend {
    padding-left: 16px;
  }
  .page-tools {
    width: 100%;
  }
  .page-tools .primary {
    margin-left: auto;
  }
  .filters {
    padding: 0 16px 16px;
  }
  .demo-bar {
    margin-bottom: 13px;
  }
  .ring {
    width: 106px;
  }
  .side-user {
    padding-left: 8px;
  }
  .cell-title {
    gap: 7px;
  }
  .form-actions {
    gap: 5px;
  }
  .family-chip span {
    max-width: 145px;
  }
  .chat-stream {
    padding: 0 14px 14px;
  }
  .chat-card form {
    padding: 12px;
  }
  .record + .record {
    margin-top: 0;
  }
  .topbar .bread b {
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 440px) {
  #workspace-main {
    padding: 18px 12px 36px;
  }
  .demo-bar {
    gap: 3px;
    font-size: 0.71rem;
  }
  .demo-bar .link {
    font-size: 0.71rem;
  }
  .page-tools .btn,
  .page-tools .primary {
    padding: 0.6rem 0.7rem;
    font-size: 0.81rem;
  }
  .kpi {
    padding: 12px;
  }
  .k-title span {
    width: 26px;
    height: 26px;
  }
  .kpi .k-value {
    font-size: 1.46rem;
  }
  .k-foot {
    font-size: 0.73rem;
  }
  .kpis.three {
    grid-template-columns: 1fr 1fr;
  }
  .three .kpi:first-child {
    grid-column: 1/-1;
  }
  .donut-row {
    gap: 14px;
  }
  .category-key {
    grid-template-columns: 1fr;
  }
  .family-grid {
    grid-template-columns: 1fr;
  }
  .filters select {
    max-width: 48%;
    flex: 1;
  }
  .filters .search {
    flex: 1 0 100%;
  }
  .modal-body {
    padding: 15px;
  }
  .form-grid {
    gap: 8px;
  }
  .card-head .btn,
  .card-head .primary {
    font-size: 0.78rem;
    padding: 7px 8px;
  }
  .plan-totals {
    gap: 12px;
  }
  .plan-totals b {
    font-size: 1.05rem;
  }
  .family-chip {
    font-size: 0.76rem;
  }
  .k-title {
    font-size: 0.78rem;
  }
  .topbar .bread {
    font-size: 0.8rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

.period {
  flex-direction: row;
}
.brand-mark {
  height: 30px;
  mix-blend-mode: lighten;
}
