:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #e6eaf0;
  --text: #1f2937;
  --muted: #64748b;
  --primary: #1677ff;
  --accent: #20a56b;
  --danger: #e5484d;
  --dark: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

.guest-landing {
  min-height: 100vh;
  padding: 26px 28px;
  background: #f4f7fb;
}

.guest-hero {
  width: min(680px, calc(100vw - 36px));
  margin: clamp(90px, 18vh, 170px) auto 0;
  text-align: center;
}

.guest-hero h1 {
  margin: 0;
  color: #2b2f36;
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.18;
  font-weight: 900;
}

.guest-hero h1 span {
  color: var(--primary);
}

.guest-hero p {
  width: min(560px, 100%);
  margin: 26px auto 0;
  color: #5f6b7a;
  font-size: 17px;
  line-height: 1.8;
}

.guest-hero button {
  height: 48px;
  margin-top: 26px;
  border-radius: 7px;
  padding: 0 34px;
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.24);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 64px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 8px;
}

.brand {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
}

.brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav {
  width: 48px;
  height: 52px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 2px;
  color: #48627f;
  padding: 6px 0;
}

.nav.active {
  background: #e8f2ff;
  color: var(--primary);
}

.nav span {
  font-size: 18px;
  line-height: 1;
}

.nav small {
  font-size: 11px;
  line-height: 1;
}

.shell {
  margin-left: 64px;
  padding: 14px 18px 18px;
}

.topbar,
.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 10px 18px;
}

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

.admin-link {
  height: 32px;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 13px;
}

.admin-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.user-name-button,
.user-name-button:hover {
  border-color: #d7dde8;
  color: var(--text);
}

.user-name-button::after,
.account-trigger::after {
  content: "▾";
  margin-left: 6px;
  color: #7b8495;
  font-size: 11px;
}

.logout-link:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.breadcrumb {
  color: var(--muted);
  font-size: 13px;
}

h1 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.15;
}

.member {
  border: 1px solid #f6b94c;
  border-radius: 6px;
  color: #b76e00;
  background: #fff8e8;
  padding: 6px 10px;
  font-size: 13px;
}

.account-menu-wrap {
  position: relative;
  display: inline-flex;
}

.account-trigger {
  min-height: 32px;
  font: inherit;
  cursor: pointer;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 112px;
  padding: 6px;
  border: 1px solid #dfe5ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.account-menu button {
  width: 100%;
  height: 32px;
  justify-content: flex-start;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
  text-align: left;
}

.account-menu button:hover {
  background: #f5f7fb;
}

.account-menu button.danger {
  color: var(--danger);
}

.toolbar {
  margin-top: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.add-form {
  display: flex;
  flex: 1 1 420px;
  gap: 10px;
}

.search {
  flex: 0 1 220px;
}

input,
select {
  width: 100%;
  height: 36px;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}

select {
  width: auto;
  min-width: 126px;
  background: #ffffff;
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

button,
.button {
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.secondary-button {
  border: 1px solid #d7dde8;
  background: #ffffff;
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.group-manager {
  position: relative;
  flex: 0 0 auto;
}

.group-menu-button {
  min-width: 154px;
  border: 1px solid #d7dde8;
  background: #ffffff;
  color: var(--text);
  justify-content: space-between;
  gap: 10px;
}

.group-menu-button:hover,
.group-menu-button[aria-expanded="true"] {
  border-color: var(--primary);
  color: var(--primary);
}

.group-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: 210px;
  padding: 6px;
  border: 1px solid #d7dde8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.group-menu[hidden] {
  display: none;
}

.group-menu-item,
.group-menu-action {
  width: 100%;
  height: 34px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  justify-content: space-between;
  padding: 0 10px;
  font-size: 14px;
}

.group-menu-item:hover,
.group-menu-action:hover {
  background: #eef5ff;
  color: var(--primary);
}

.group-menu-item.active {
  background: #e8f2ff;
  color: var(--primary);
  font-weight: 700;
}

.group-menu-item strong {
  font-size: 13px;
}

.group-menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

.group-menu-action {
  justify-content: flex-start;
}

.group-menu-action.danger {
  color: var(--danger);
}

.group-menu-action:disabled {
  color: #a8b1c0;
  background: transparent;
}

.favorite-priority {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.favorite-priority input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.status {
  margin: 8px 0;
  color: var(--muted);
  min-height: 0;
}

.product-summary {
  margin: 10px 0 -2px;
  color: #41516a;
  font-size: 13px;
  font-weight: 700;
}

.status:empty {
  display: none;
}

.auth-required .sidebar,
.auth-required .shell,
.auth-required .toolbar,
.auth-required .grid,
.auth-required .pagination {
  display: none;
}

.grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.status:not(:empty) + .grid {
  margin-top: 0;
}

.pagination {
  margin: 18px 0 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icp-footer {
  margin: 18px 0 4px;
  color: #8a94a6;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.icp-footer a {
  color: inherit;
  text-decoration: none;
}

.icp-footer a:hover {
  color: var(--primary);
}

.guest-icp {
  position: fixed;
  right: 0;
  bottom: 18px;
  left: 0;
  margin: 0;
}

.admin-icp {
  margin-top: 20px;
}

.compliance-note {
  color: #98a2b3;
}

.auth-note {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.auth-note a,
.legal-shell a {
  color: var(--primary);
  text-decoration: none;
}

.auth-note a:hover,
.legal-shell a:hover {
  text-decoration: underline;
}

.legal-page {
  background: #f6f8fb;
}

.legal-shell {
  width: min(880px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.legal-head,
.legal-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.legal-head {
  padding: 26px 30px;
}

.legal-head h1 {
  margin: 16px 0 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.legal-head p,
.legal-section p {
  color: #526070;
  line-height: 1.9;
}

.legal-section {
  margin-top: 14px;
  padding: 26px 30px;
}

.legal-section h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.legal-section h3 {
  margin: 22px 0 8px;
  font-size: 16px;
}

.page-button {
  min-width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 9px;
  font-size: 14px;
}

.page-button:hover:not(:disabled),
.page-button.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff;
}

.page-button:disabled {
  color: #b7c0cc;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--muted);
  padding: 0 2px;
}

.page-size-select {
  height: 32px;
  min-width: 112px;
  border-radius: 6px;
  border: 1px solid #d7dde8;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.favorite-card {
  border-color: #f6b94c;
  box-shadow: 0 0 0 2px rgba(246, 185, 76, 0.18);
}

.highlight-card {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.2);
}

.cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #edf1f6;
  display: block;
}

.body {
  padding: 10px 12px 12px;
}

.title {
  min-height: 40px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.title span:first-child {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: start;
}

.meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 6px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
}

.price {
  color: var(--danger);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.shop-link {
  color: var(--muted);
  text-decoration: none;
  display: inline-grid;
  grid-template-columns: 22px minmax(0, auto) 14px;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  width: fit-content;
  min-height: 24px;
  padding: 2px 4px 2px 0;
}

.product-link:hover,
.shop-link:hover {
  color: var(--primary);
}

.shop-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef2f7;
}

.fallback-avatar {
  display: inline-grid;
  place-items: center;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.shop-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-placeholder {
  color: var(--muted);
}

.freshness {
  color: #8a94a6;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.freshness.error {
  color: var(--danger);
}

.card-submeta {
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.group-select {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.group-select select {
  width: 106px;
  min-width: 0;
  max-width: 106px;
  height: 26px;
  padding: 0 7px;
  font-size: 12px;
  border-radius: 999px;
  background: #f8fafc;
}

.external-icon {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.metrics {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.metric {
  background: #f7f9fc;
  border-radius: 6px;
  padding: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--accent);
}

.actions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--line);
  background: var(--dark);
  height: 44px;
}

.actions button,
.actions a {
  height: 44px;
  border-radius: 0;
  background: transparent;
  color: white;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.16s ease, color 0.16s ease;
}

.actions button:last-child {
  color: #ff5b64;
  border-right: 0;
}

.actions button:hover,
.actions a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.actions .active-fav {
  color: #f6b94c;
}

.qr-dialog,
.group-dialog,
.wide-dialog,
.trend-dialog {
  width: min(360px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 22px;
}

.trend-dialog {
  width: min(860px, calc(100vw - 32px));
}

.wide-dialog {
  width: min(620px, calc(100vw - 32px));
}

.qr-dialog::backdrop,
.group-dialog::backdrop,
.wide-dialog::backdrop,
.trend-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.qr-dialog h2,
.group-dialog h2,
.wide-dialog h2,
.trend-dialog h2 {
  margin: 0 0 14px;
  font-size: 18px;
  padding-right: 36px;
}

.group-dialog {
  padding: 18px;
}

.group-form {
  display: grid;
  gap: 14px;
}

.group-form input {
  height: 36px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-hint {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.dialog-hint strong {
  color: var(--text);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.auth-tabs button {
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.support-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: center;
}

.support-panel strong {
  display: block;
  margin-bottom: 8px;
}

.support-panel p {
  margin: 0 0 10px;
  color: var(--muted);
}

.support-panel img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.member-benefits {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #f2cf73;
  border-radius: 8px;
  background: #fff4c7;
  color: #9a5b00;
}

.member-benefits strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.member-benefits ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.admin-table code {
  color: var(--primary);
  font-weight: 700;
}

.qr-dialog img {
  display: block;
  width: 220px;
  height: 220px;
  margin: 0 auto 14px;
}

.close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  padding: 0;
  background: #eef2f7;
  color: var(--text);
}

.trend-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.trend-mode {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  margin-bottom: 12px;
}

.trend-mode button {
  height: 32px;
  border-radius: 0;
  background: #ffffff;
  color: var(--text);
  padding: 0 14px;
}

.trend-mode button + button {
  border-left: 1px solid #d7dde8;
}

.trend-mode button.active {
  background: var(--primary);
  color: #ffffff;
}

.trend-chart {
  min-height: 360px;
}

.trend-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.trend-chart .axis {
  stroke: #d7dde8;
  stroke-width: 1;
}

.trend-chart .trend-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
}

.trend-chart circle {
  fill: var(--primary);
}

.trend-chart text {
  fill: #8a94a6;
  font-size: 13px;
}

.chart-label {
  font-weight: 700;
}

.empty-chart {
  min-height: 300px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f7f9fc;
  border: 1px dashed #d7dde8;
  border-radius: 8px;
  text-align: center;
  padding: 24px;
}

.trend-dialog {
  width: min(920px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  background: #ffffff;
}

.trend-dialog .close {
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.trend-head {
  padding: 22px 76px 22px 28px;
  background: linear-gradient(135deg, #ff5058 0%, #ff7478 100%);
  color: #ffffff;
}

.trend-dialog h2 {
  margin: 0 0 8px;
  padding: 0;
  font-size: 19px;
  line-height: 1.35;
}

.trend-head .trend-meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.trend-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 14px 28px 0;
}

.trend-dialog .trend-mode {
  margin: 0;
  border-color: #eef1f6;
  background: #f8fafc;
}

.trend-dialog .trend-mode button {
  height: 30px;
  color: #677084;
  font-size: 12px;
  font-weight: 700;
}

.trend-dialog .trend-mode button.active {
  background: #111827;
  color: #ffffff;
}

.trend-chart {
  min-height: 360px;
  padding: 16px 28px 24px;
}

.trend-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.trend-stat {
  min-height: 82px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 1px solid #f0f2f6;
  border-radius: 8px;
  background: #fbfcfe;
}

.trend-stat span {
  color: #98a1b2;
  font-size: 12px;
  font-weight: 700;
}

.trend-stat strong {
  color: #262b36;
  font-size: 22px;
  line-height: 1;
}

.trend-stat em {
  color: #ff5a5f;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.trend-graph {
  border-top: 1px solid #f0f2f6;
  border-bottom: 1px solid #f0f2f6;
  padding: 14px 0 10px;
}

.trend-chart .grid-line {
  stroke: #edf0f5;
  stroke-width: 1;
}

.trend-chart .trend-area {
  fill: url(#trendFill);
}

.trend-chart .trend-line {
  fill: none;
  stroke: #ff5a5f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.trend-chart circle {
  fill: #ff5a5f;
  stroke: #ffffff;
  stroke-width: 2;
}

.trend-chart text {
  fill: #9aa3b2;
  font-size: 12px;
}

.trend-chart .point-label {
  fill: #ff5a5f;
  font-size: 12px;
  font-weight: 800;
}

.trend-chart .low-label {
  text-anchor: start;
}

.trend-chart .high-label {
  text-anchor: end;
}

.trend-detail {
  padding-top: 18px;
}

.trend-detail h3 {
  margin: 0 0 10px;
  color: #1f2937;
  font-size: 14px;
}

.trend-detail table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.trend-detail th {
  height: 34px;
  background: #f8fafc;
  color: #687386;
  font-weight: 800;
  text-align: left;
}

.trend-detail th,
.trend-detail td {
  border-bottom: 1px solid #eef1f6;
  padding: 0 12px;
}

.trend-detail td {
  height: 34px;
  color: #293241;
  font-weight: 700;
}

.growth-badge {
  display: inline-grid;
  min-width: 42px;
  height: 22px;
  place-items: center;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
}

.growth-badge.up {
  background: #fff0f1;
  color: #ff5a5f;
}

.growth-badge.down {
  background: #eef8f1;
  color: #16a34a;
}

.growth-badge.neutral {
  min-width: 24px;
  background: #f2f4f7;
  color: #9aa3b2;
}

@media (max-width: 720px) {
  .trend-head {
    padding: 18px 58px 18px 18px;
  }

  .trend-toolbar,
  .trend-chart {
    padding-left: 18px;
    padding-right: 18px;
  }

  .trend-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

.admin-shell {
  padding: 14px 18px 18px;
}

.admin-login-panel {
  min-height: 420px;
  display: grid;
  place-items: center;
}

.admin-login-form {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-login-form h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.admin-login-form input {
  height: 38px;
}

.admin-login-status {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.admin-stat,
.admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-stat {
  padding: 14px;
}

.admin-stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.admin-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 22px;
}

.admin-panel {
  overflow: hidden;
  margin-top: 12px;
}

.admin-panel > .admin-section {
  border-top: 1px solid var(--line);
}

.admin-panel-head {
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.admin-panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.admin-tabs {
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-tab {
  height: 32px;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.admin-tab.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff4f3;
  font-weight: 700;
}

.admin-section[hidden] {
  display: none;
}

.admin-section-head {
  min-height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fcfdff;
  border-bottom: 1px solid var(--line);
}

.admin-section-head h3 {
  margin: 0;
  font-size: 15px;
}

.admin-section-head > span,
.admin-section-actions > span {
  color: var(--muted);
  font-size: 13px;
}

.admin-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-section-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-section-actions select {
  height: 30px;
  min-width: 112px;
}

.admin-table-wrap {
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  background: #f8fafc;
  font-weight: 700;
}

.admin-table a {
  color: var(--text);
  text-decoration: none;
}

.admin-table a:hover {
  color: var(--primary);
}

.admin-settings {
  padding: 14px;
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-settings label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-settings select {
  min-width: 120px;
}

.admin-settings.compact {
  padding: 10px 14px;
}

.admin-settings .wide-field {
  min-width: min(320px, 100%);
  flex: 1;
}

.admin-qr-preview {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.file-upload-control {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.file-upload-control input[type="file"] {
  display: none;
}

.file-upload-button {
  height: 32px;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.file-upload-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.file-upload-name {
  max-width: 120px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.mini-button {
  height: 28px;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  padding: 0 9px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.mini-button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.mini-button.danger:hover:not(:disabled) {
  border-color: #d64545;
  color: #d64545;
}

.mini-button.danger.solid {
  border-color: #d64545;
  color: #fff;
  background: #d64545;
}

.mini-button.danger.solid:hover:not(:disabled) {
  border-color: #b42318;
  color: #fff;
  background: #b42318;
}

.mini-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.success {
  color: #12743b;
  background: #e9f8ef;
}

.status-badge.warning {
  color: #9a5a00;
  background: #fff3d8;
}

.status-badge.danger {
  color: #b42318;
  background: #ffe7e4;
}

@media (max-width: 760px) {
  .guest-landing {
    padding: 20px;
  }

  .guest-hero {
    margin-top: 76px;
  }

  .guest-hero p {
    font-size: 15px;
  }

  .legal-shell {
    width: min(100% - 24px, 880px);
    padding: 18px 0 28px;
  }

  .legal-head,
  .legal-section {
    padding: 20px;
  }

  .sidebar {
    display: none;
  }

  .shell {
    margin-left: 0;
    padding: 14px;
  }

  .add-form {
    flex-direction: column;
    flex-basis: 100%;
  }

  .search,
  .sort-select,
  .group-manager,
  .secondary-button,
  .favorite-priority {
    width: 100%;
    flex: 1 1 100%;
  }

  .group-menu-button,
  .group-menu {
    width: 100%;
  }

}
