:root {
  --bg: #f3f2ee;
  --surface: #ffffff;
  --surface-soft: #faf9f6;
  --ink: #1d2429;
  --muted: #6f767d;
  --faint: #9ba1a7;
  --line: #e3e0d8;
  --accent: #0e7c66;
  --accent-strong: #0a5f4f;
  --accent-soft: #e3f2ec;
  --warm: #c66a3d;
  --blue: #5b6ee1;
  --danger: #b5413b;
  --shadow: 0 1px 2px rgba(29, 36, 41, 0.05), 0 10px 24px rgba(29, 36, 41, 0.05);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body.is-staff .delete-record,
body.is-staff .store-actions [data-action="edit"] {
  display: none;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(94, 126, 255, 0.75);
  outline-offset: 2px;
}

.app {
  min-height: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand-text h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 650;
}

.brand-text p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.date-nav input[type="date"] {
  width: 132px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 4px 6px;
  text-align: center;
}

.icon-btn,
.text-btn,
.icon-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.icon-btn {
  width: 34px;
  padding: 0;
}

.icon-btn svg,
.icon-text-btn svg,
.text-btn svg {
  width: 16px;
  height: 16px;
}

.text-btn {
  padding: 0 12px;
  background: transparent;
}

.icon-text-btn {
  padding: 0 12px;
}

.icon-btn:hover,
.text-btn:hover,
.icon-text-btn:hover {
  background: var(--surface-soft);
  border-color: #cfcbc1;
}

.icon-btn:active,
.text-btn:active,
.icon-text-btn:active {
  transform: translateY(1px);
}

.icon-text-btn.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.icon-text-btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 20px 32px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 0 6px;
}

.metric {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric strong {
  margin-top: 2px;
  font-size: 30px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.metric-sub {
  color: var(--faint);
  font-size: 11px;
}

.metric-accent {
  color: #fff;
  background: #14201d;
  border-color: #14201d;
}

.metric-accent .metric-label,
.metric-accent .metric-sub {
  color: rgba(255, 255, 255, 0.68);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  padding-top: 12px;
}

.stores-panel,
.side-panel {
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.panel-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 12px;
}

.store-card {
  --store-color: #0f766e;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.store-card.is-zero {
  box-shadow: none;
}

.store-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.store-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  background: var(--store-color);
  border-radius: 50%;
}

.store-title {
  min-width: 0;
}

.store-title h3 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.store-count {
  color: var(--store-color);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.store-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  min-width: 0;
  color: var(--store-color);
  background: color-mix(in srgb, var(--store-color) 11%, #fff);
  border: 1px solid color-mix(in srgb, var(--store-color) 28%, #fff);
  border-radius: 6px;
  font-weight: 650;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.quick-count svg {
  width: 17px;
  height: 17px;
}

.quick-count:hover {
  filter: brightness(0.97);
}

.quick-count:active,
.quick-count.bump {
  transform: scale(0.96);
}

.store-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
}

.store-foot strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.store-stats {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.store-stats div {
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.side-panel {
  display: flex;
  flex-direction: column;
}

.records-list {
  max-height: 420px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.record-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.record-item:last-child {
  border-bottom: 0;
}

.record-time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.record-main {
  min-width: 0;
}

.record-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 600;
}

.record-title .store-dot {
  width: 8px;
  height: 8px;
}

.record-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-count {
  min-width: 28px;
  padding: 2px 7px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.delete-record {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--faint);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.delete-record:hover {
  color: var(--danger);
  background: #fbeae9;
}

.delete-record svg {
  width: 15px;
  height: 15px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
  color: var(--faint);
  text-align: center;
}

.empty-state svg {
  width: 30px;
  height: 30px;
}

.chart-block {
  margin-top: 16px;
}

.panel-head.compact {
  margin-bottom: 8px;
}

.daily-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(10px, 1fr));
  align-items: end;
  gap: 5px;
  height: 148px;
  padding: 10px 10px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chart-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
  min-width: 0;
}

.chart-bar {
  width: 100%;
  min-height: 2px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  opacity: 0.9;
  transition: height 0.25s ease;
}

.chart-day.is-zero .chart-bar {
  background: #dedbd2;
}

.chart-value {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.chart-label {
  color: var(--faint);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
  transform: rotate(-38deg);
  transform-origin: top center;
}

.modal {
  width: min(540px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.modal-wide {
  width: min(980px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgba(21, 28, 32, 0.48);
  backdrop-filter: blur(3px);
}

.modal-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(17, 24, 29, 0.24);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.modal-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-close {
  flex: 0 0 auto;
}

.modal-body {
  display: grid;
  gap: 13px;
  padding: 16px;
  overflow: auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.field small {
  color: var(--faint);
  font-size: 11px;
}

.field input[type="text"],
.field input[type="date"],
.field input[type="time"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #d5d1c8;
  border-radius: 6px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
}

.field textarea {
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stepper {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
}

.stepper input {
  text-align: center;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 3px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}

.color-swatch.selected {
  box-shadow: 0 0 0 2px var(--ink);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  background: #cfcbc2;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.switch-row input:checked + .switch {
  background: var(--accent);
}

.switch-row input:checked + .switch::after {
  transform: translateX(16px);
}

.settings-intro {
  padding: 10px 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 12px;
}

.settings-intro p {
  margin: 0;
}

.pdd-open-block {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pdd-open-block .panel-head {
  padding: 0 0 4px;
  border-bottom: 1px solid var(--line);
}

.pdd-guide {
  padding: 10px 12px;
  background: #fffdf4;
  border: 1px solid #e5d9a8;
  border-radius: var(--radius);
}

.pdd-guide summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.pdd-guide ol {
  margin: 8px 0 10px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.pdd-guide a {
  display: inline-block;
  margin: 2px 10px 2px 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.pdd-guide a:hover {
  text-decoration: underline;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.copy-row code {
  min-width: 0;
  padding: 9px 10px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-block {
  position: relative;
}

.code-block pre {
  margin: 0;
  padding: 12px 38px 12px 12px;
  overflow: auto;
  color: #dce8e2;
  background: #182420;
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.copy-corner:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.code-chip code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-chip span {
  color: var(--faint);
  font-family: system-ui, sans-serif;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.detail-row .record-count {
  flex: 0 0 auto;
}

.manage-list {
  display: grid;
  gap: 8px;
}

.manage-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.manage-name {
  min-width: 0;
}

.manage-name strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-name span {
  color: var(--muted);
  font-size: 11px;
}

.manage-row.is-inactive {
  opacity: 0.62;
}

.manage-row .switch {
  transform: scale(0.9);
}

.chat-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-tools input[type="date"] {
  width: 138px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.chat-tools select {
  max-width: 180px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.chat-body {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: stretch;
  min-height: 420px;
  padding: 0;
}

.chat-sessions,
.chat-thread {
  min-width: 0;
  min-height: 0;
}

.chat-sessions {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.chat-pane-head {
  flex: 0 0 auto;
  padding: 10px 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}

.chat-session-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px;
  overflow: auto;
}

.chat-session-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
}

.chat-session-item:hover {
  border-color: var(--line);
}

.chat-session-item.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 34%, #fff);
}

.chat-session-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.chat-session-main strong,
.chat-session-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-session-main strong {
  font-size: 13px;
  font-weight: 650;
}

.chat-session-main small {
  color: var(--muted);
  font-size: 12px;
}

.chat-session-meta {
  display: grid;
  gap: 3px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chat-session-meta b {
  color: var(--accent);
  font-size: 11px;
}

.chat-session-meta small {
  color: var(--faint);
  font-size: 10px;
}

.chat-thread {
  display: flex;
  flex-direction: column;
}

.chat-thread-head {
  flex: 0 0 auto;
  padding: 10px 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
}

.chat-thread-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  background: #fbfaf7;
}

.chat-msg {
  display: grid;
  gap: 4px;
  max-width: 78%;
}

.chat-msg.is-in {
  align-self: flex-start;
}

.chat-msg.is-out {
  align-self: flex-end;
}

.chat-msg-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.chat-msg.is-out .chat-msg-meta {
  flex-direction: row-reverse;
}

.chat-msg-meta span {
  font-weight: 600;
}

.chat-msg-bubble {
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(29, 36, 41, 0.05);
}

.chat-msg.is-out .chat-msg-bubble {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px;
  color: #fff;
  background: #1d2824;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
  }

  .chart-block {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  .top-actions {
    width: 100%;
  }

  .date-nav {
    flex: 1 1 auto;
    min-width: 0;
  }

  .date-nav input[type="date"] {
    flex: 1 1 auto;
    width: auto;
  }

  main {
    padding: 0 14px 24px;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 14px;
  }

  .metric {
    padding: 12px;
  }

  .metric strong {
    font-size: 25px;
  }

  .side-panel {
    display: flex;
  }

  .store-grid {
    grid-template-columns: 1fr;
  }

  .records-list {
    max-height: 360px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .chat-tools input[type="date"] {
    width: auto;
  }

  .chat-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .chat-sessions {
    max-height: 280px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chat-msg {
    max-width: 90%;
  }
}

@media (max-width: 420px) {
  .icon-text-btn span {
    display: none;
  }

  .icon-text-btn {
    width: 34px;
    padding: 0;
  }

  .text-btn {
    padding: 0 8px;
  }

  .metric-label {
    font-size: 11px;
  }
}
