:root {
  color-scheme: light;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #242038;
  background: #f7f6fb;
  --muted: #625e75;
  --border: #e7e3ef;
  --accent: #653dc4;
  --sidebar: #211b34;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 290px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 3vw, 2.8rem); line-height: 1.13; letter-spacing: -.05em; }
h2 { font-size: 1.08rem; line-height: 1.3; letter-spacing: -.02em; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
input, select, button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #a68ae8; outline-offset: 3px; }
svg { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.initial { margin: 2rem; }
.layout { display: grid; grid-template-columns: 215px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 2.4rem; padding: 1.65rem 1rem 1rem;
  color: #f8f6ff; background: radial-gradient(ellipse at 2% 2%, #3b2a57, transparent 53%), var(--sidebar);
}
.brand { display: flex; gap: .75rem; align-items: center; padding-inline: .4rem; line-height: 1.2; }
.brand strong { font-family: Georgia, serif; font-size: 1.6rem; letter-spacing: -.04em; font-weight: 500; display: block; }
.brand small { display: block; margin-top: .25rem; font-size: .73rem; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(140deg, #9e74ec, #6444ca); color: white; box-shadow: 0 6px 18px #3f21714a; }
.brand-mark svg { width: 23px; height: 23px; }
.sidebar nav, .sidebar-bottom { display: grid; gap: .28rem; }
.nav-item, .back-link, .operator, .sidebar-action {
  display: flex; align-items: center; gap: .65rem; min-height: 43px; padding: .6rem .7rem;
  border: 0; border-radius: 11px; background: transparent; color: inherit; text-decoration: none; text-align: left;
}
.nav-item { width: 100%; color: #d8cce8; font-weight: 580; }
.nav-item:hover, .sidebar .back-link:hover, .sidebar-action:hover { background: #ffffff12; color: white; }
.nav-item[aria-current] { background: #eee3ff; color: #442880; }
.sidebar-bottom { margin-top: auto; font-size: .88rem; }
.operator { border-top: 1px solid #ffffff27; border-radius: 0; color: #f7efff; overflow-wrap: anywhere; }
.sidebar .back-link, .sidebar-action { color: #dad3e8; }
.workspace { width: min(100%, 1480px); margin-inline: auto; padding: clamp(1.2rem, 3vw, 2.8rem); }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.65rem; }
.page-head h1 { margin-bottom: .35rem; }
.toolbar, .table-tools, .actions, .search, .pager { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.updated, .description, .person small, .metric small { color: var(--muted); }
.updated { font-size: .78rem; }
.description { font-size: .92rem; }
.control, input, select {
  min-height: 39px; padding: .45rem .72rem; color: #29233d; border: 1px solid var(--border); background: white; border-radius: 10px;
}
.control { font-weight: 640; }
.control:hover { filter: brightness(.97); }
.primary { color: #fff; background: #613bb9; border-color: #613bb9; }
.quiet { color: #5633a4; background: #faf8ff; }
.danger { color: #9a2641; background: #fff3f6; border-color: #f1d8df; }
.control.link { border: 0; background: transparent; padding: 0; text-align: left; color: #5633a4; }
.sidebar .sidebar-action { width: 100%; background: transparent; border: 0; padding: .6rem .7rem; color: #dad3e8; }
.notice { color: #6634a2; font-weight: 590; overflow-wrap: anywhere; }
.notice:empty { display: none; }
.workspace > .notice { margin-bottom: 1rem; }
.content[aria-busy="true"] { opacity: .72; }
.stack { display: grid; gap: 1.05rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .95rem; }
.metric, .card {
  min-width: 0; background: white; border: 1px solid var(--border); border-radius: 17px;
  box-shadow: 0 5px 16px #2c165307;
}
.metric { display: grid; gap: .35rem; padding: 1.1rem; align-content: start; }
.metric span { color: #4f4865; font-weight: 600; }
.metric strong { font-size: clamp(1.35rem, 2.5vw, 2.2rem); line-height: 1.18; letter-spacing: -.04em; overflow-wrap: anywhere; }
.metric small { font-size: .78rem; }
.metric.violet { background: linear-gradient(135deg, #eee7fc, #f8f4ff 75%); border-color: #e3d5f8; }
.metric.mint { background: #e9f8f2; border-color: #d5efe4; color: #185843; }
.metric.rose { background: #fff0f3; color: #9a2641; border-color: #f8dce2; }
.split { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr); gap: 1rem; }
.card { padding: clamp(.85rem, 2vw, 1.25rem); }
.card > :not(:first-child) { margin-top: .8rem; }
.lines { margin: 0; }
.lines > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: .65rem; padding: .53rem 0; }
.lines > div + div { border-top: 1px solid #f0edf5; }
.lines dt { color: var(--muted); }
.lines dd { margin: 0; font-weight: 680; text-align: right; }
.chart { height: 146px; display: flex; align-items: stretch; gap: 3px; border-bottom: 1px solid #e8e2f1; }
.bar { display: flex; align-items: end; flex: 1; background: #f7f4fc; min-width: 0; border-radius: 4px 4px 0 0; }
.bar i { height: var(--height); width: 100%; background: linear-gradient(#9b78e4, #6237be); border-radius: 4px 4px 0 0; }
.bar.future { background: #fbfaff; }
.bar.future i { background: #e5dfef; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.chip { display: inline-flex; background: #f0eef5; color: #554f67; border-radius: 20px; font-size: .75rem; padding: .19rem .48rem; white-space: nowrap; font-weight: 680; }
.chip.positive { color: #175c45; background: #e5f6ed; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: #534b69; background: #f6f3fb; font-weight: 640; white-space: nowrap; }
th, td { padding: .65rem .7rem; border-bottom: 1px solid #f0edf5; }
td { vertical-align: middle; }
td .actions { min-width: max-content; }
.person { display: grid; justify-items: start; gap: .15rem; overflow-wrap: anywhere; min-width: 100px; }
.person small { font-size: .77rem; }
.pager { justify-content: flex-end; color: var(--muted); }
.empty { color: var(--muted); padding: 1rem .35rem; }
.field { display: grid; align-content: start; gap: .3rem; font-size: .86rem; font-weight: 600; color: var(--muted); }
.field input { width: 100%; min-width: 0; }
.coupon-form { display: grid; grid-template-columns: minmax(10rem, 2fr) repeat(3, minmax(6rem, 1fr)) auto; align-items: end; gap: .55rem; }
.coupon-form .notice { grid-column: 1 / -1; }
.receipt { background: #eaf8f1; border: 1px solid #d5eee0; border-radius: 12px; color: #185843; padding: .65rem .8rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .65rem; }
.receipt code { font-size: 1rem; overflow-wrap: anywhere; }
.gate { display: grid; place-items: center; min-height: 100dvh; padding: 1rem;
  background: radial-gradient(ellipse at 50% 12%, #e8dbfa, transparent 58%), #f7f6fb; }
.gate-card { display: grid; gap: .9rem; width: min(100%, 410px); padding: clamp(1.2rem, 4vw, 2.15rem); background: white;
  border: 1px solid #e6dcf3; border-radius: 22px; box-shadow: 0 18px 48px #4e327b19; }
.gate-card .brand { padding: 0; margin-bottom: .75rem; }
.gate-card h1 { font-size: 1.9rem; }
.gate-card .back-link { color: #5836a7; padding-left: 0; }
.form { display: grid; gap: .65rem; }

@media (max-width: 1000px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { align-items: start; flex-wrap: wrap; }
  .coupon-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: .8rem; gap: .65rem; }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-item { gap: .35rem; padding: .35rem; font-size: .79rem; }
  .nav-item svg { width: 16px; }
  .sidebar-bottom { display: flex; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
  .sidebar-bottom .operator { margin-right: auto; border: 0; }
  .sidebar .sidebar-action { width: auto; }
  .split { grid-template-columns: 1fr; }
  .workspace { padding: .85rem; }
}
@media (max-width: 400px) {
  .nav-item { min-height: 38px; }
  .sidebar-bottom .operator { display: none; }
  .metric { padding: .75rem; }
  .search { flex-wrap: nowrap; width: 100%; }
  .search input { min-width: 0; flex: 1; }
}
