:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #20223a;
  background: #f6f7fc;
  font-synthesis: none;
  --muted: #63677e;
  --line: #e6e8f2;
  --violet: #5943ce;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #8775f0; outline-offset: 3px; }
.shell { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 27px 17px 20px; background: #18182d; color: #c3c4d6; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; margin-bottom: 44px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #755cf0; color: white; font-size: 23px; }
.brand strong, .source strong { display: block; color: #fff; font-size: 15px; }
.brand div span, .source div span { display: block; font-size: 12px; margin-top: 3px; color: #a8a9c5; letter-spacing: .035em; }
nav { display: grid; gap: 6px; }
nav a { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; }
nav a:hover { background: #272741; color: white; }
nav a[aria-current] { color: #fff; background: #35305b; box-shadow: inset 3px 0 #a18bff; }
.icon { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.source { margin-top: auto; padding: 14px 11px; border: 1px solid #3a3b56; border-radius: 10px; display: flex; gap: 10px; align-items: flex-start; }
.source i, .legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.source i { background: #aca0fb; margin-top: 6px; }
.topbar { background: #fff; min-height: 64px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 8px clamp(18px, 3vw, 40px); color: var(--muted); font-size: 14px; }
.topbar strong { color: #252644; }
.separator { margin: 0 10px; color: #9396aa; }
.content { max-width: 1520px; padding: 29px clamp(18px, 3vw, 40px) 40px; margin-inline: auto; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(25px, 3vw, 33px); font-weight: 750; letter-spacing: -.034em; }
.heading p, .panel-head p { margin-top: 4px; color: var(--muted); }
.heading p { font-size: 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #dfe1ed; background: white; color: #33364e; border-radius: 8px; min-height: 38px; padding: 7px 12px; font-weight: 650; font-size: 14px; white-space: nowrap; }
.button:hover:enabled, a.button:hover { background: #f0eefc; }
.button.primary { color: white; background: var(--violet); border-color: var(--violet); min-height: 42px; }
.button.primary:hover:enabled { background: #4733b8; }
.filters { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; margin-bottom: 19px; }
label { display: grid; gap: 5px; color: #454962; font-size: 14px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 38px; border: 1px solid #dfe1ed; border-radius: 8px; color: #20223a; background: #fff; padding: 7px 11px; font-weight: 500; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, #6c6e84 50%), linear-gradient(135deg, #6c6e84 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat; }
.range { margin-left: auto; padding-bottom: 9px; color: var(--muted); font-size: 14px; }
.notice { margin-bottom: 16px; border: 1px solid #dedaf9; border-radius: 8px; background: #f0ecff; padding: 11px 14px; color: #403180; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric, .panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 5px #18182d06; min-width: 0; }
.metric { display: flex; flex-direction: column; align-items: flex-start; padding: 15px; gap: 5px; }
.metric:hover { border-color: #ad9df4; }
.metric-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; margin-bottom: 4px; }
.purple { background: #eee9ff; color: #5f43d3; }
.teal { background: #ddf7f0; color: #07765e; }
.gold { background: #fff0db; color: #9b5809; }
.sky { background: #e8f0ff; color: #315bb4; }
.metric > span:nth-child(2) { font-size: 14px; color: #4f526c; font-weight: 650; }
.metric > strong { font-size: clamp(18px, 2.1vw, 28px); letter-spacing: -.04em; overflow-wrap: anywhere; }
.metric small { font-size: 13px; color: var(--muted); }
.dashboard-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(240px, 1fr); gap: 16px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px 17px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 17px; font-weight: 730; }
.panel-head p { font-size: 14px; }
.chart-body { padding: 13px 16px 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 13px; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { background: #684ce2; }
.legend span + span i { background: #108a76; }
.chart { display: block; width: 100%; min-height: 170px; }
.chart text { fill: #5d617a; font-size: 14px; }
.gridline { stroke: #e8e9f3; }
.chart polyline { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart polyline.orders { stroke: #684ce2; }
.chart polyline.payments { stroke: #108a76; }
.chart circle.orders { fill: #684ce2; }
.chart circle.payments { fill: #108a76; }
.alerts { margin: 0; padding: 0 16px; list-style: none; }
.alerts li { display: flex; align-items: center; justify-content: space-between; gap: 5px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.alerts strong, .alerts small { display: block; }
.alerts strong { font-size: 14px; }
.alerts small { margin-top: 2px; font-size: 12px; color: var(--muted); }
.panel-link { display: block; padding: 10px 16px; color: #4c39ba; font-size: 14px; font-weight: 650; }
.panel-link:hover { text-decoration: underline; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { padding: 11px 17px; border-bottom: 1px solid #edf0f6; }
th { white-space: nowrap; color: #51556e; background: #fafaff; font-weight: 650; }
td { overflow-wrap: anywhere; }
.badge { display: inline-flex; border-radius: 5px; padding: 3px 7px; white-space: nowrap; font-size: 13px; font-weight: 650; }
.badge.green { background: #e4f6ed; color: #1b6748; }
.badge.amber { background: #fff2d9; color: #7c4b03; }
.badge.red { background: #fce8eb; color: #98253d; }
.badge.blue { background: #eaeefd; color: #344f9d; }
.badge.neutral { background: #eef0f7; color: #4e5370; }
.table-toolbar { justify-content: flex-start; align-items: end; }
.export { margin-left: auto; }
.pager { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 17px; font-size: 14px; color: var(--muted); }
.pager .button + .button { margin-left: 6px; }
.empty { padding: 18px; color: var(--muted); }
dialog { width: min(460px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 14px; color: inherit; padding: 20px; }
dialog::backdrop { background: #17172c85; }
dialog form { display: grid; gap: 12px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dialog-heading h2 { font-size: 20px; }
#visit-error { color: #94233b; }
@media (max-width: 1050px) {
  .shell { grid-template-columns: 184px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; }
  .brand { margin-bottom: 10px; }
  nav { display: flex; overflow: auto; padding: 4px; }
  nav a { white-space: nowrap; }
  .source { border: 0; padding: 6px 8px 0; }
  .source div { display: flex; gap: 10px; align-items: center; }
  .source div span { margin: 0; }
  .heading { align-items: flex-start; flex-direction: column; }
  .content { padding-top: 20px; }
  .range { margin-left: 0; }
}
