:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-soft: #f8faff;
  --text: #172033;
  --muted: #718096;
  --line: #e6eaf2;
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --brand-soft: #eef2ff;
  --danger: #dc2626;
  --warning: #d97706;
  --ok: #059669;
  --sidebar: #111827;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, .04);
  --shadow: 0 16px 45px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 0, rgba(99, 102, 241, .07), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button {
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 650;
  line-height: 20px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, opacity .16s ease;
}
button:hover {
  background: var(--brand-dark);
  box-shadow: 0 8px 20px rgba(79, 70, 229, .18);
  transform: translateY(-1px);
}
button:active { transform: translateY(0); }
button:disabled {
  cursor: not-allowed;
  opacity: .48;
  box-shadow: none;
  transform: none;
}
button.secondary {
  border: 1px solid #dfe3fb;
  background: var(--brand-soft);
  color: var(--brand-dark);
}
button.secondary:hover {
  border-color: #c7d2fe;
  background: #e0e7ff;
}
button.ghost {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .06);
  color: #d1d5db;
}
button.ghost:hover {
  background: rgba(255, 255, 255, .11);
  color: #fff;
  box-shadow: none;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { min-height: 20px; color: var(--danger); }
.ok { min-height: 20px; color: var(--ok); }
code {
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #f8fafc;
  padding: 2px 7px;
  color: #475569;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}
pre {
  max-width: 440px;
  max-height: 200px;
  overflow: auto;
  margin: 0;
  border-radius: 10px;
  background: #111827;
  color: #e5e7eb;
  padding: 12px;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.login {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
}
.login::before,
.login::after {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  content: "";
  filter: blur(1px);
  pointer-events: none;
}
.login::before {
  top: -190px;
  right: -100px;
  background: rgba(99, 102, 241, .1);
}
.login::after {
  bottom: -220px;
  left: -130px;
  background: rgba(14, 165, 233, .08);
}
.login-panel {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 28px 80px rgba(51, 65, 85, .14);
  padding: 42px;
  backdrop-filter: blur(12px);
}
.login-logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 15px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  box-shadow: 0 12px 28px rgba(79, 70, 229, .26);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}
.login-panel h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -.02em;
}
.login-form {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}
.login-form button { margin-top: 4px; padding-block: 12px; }

label {
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}
input, select, textarea {
  width: 100%;
  border: 1px solid #dfe4ed;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  line-height: 20px;
  transition: border .16s ease, box-shadow .16s ease, background .16s ease;
}
input:hover, select:hover { border-color: #cbd3df; }
textarea {
  resize: vertical;
  line-height: 1.6;
}
input:hover, select:hover, textarea:hover { border-color: #cbd3df; }
input:focus, select:focus, textarea:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .11);
}
input::placeholder { color: #a0aec0; }

.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 0 0, rgba(99, 102, 241, .22), transparent 34%),
    var(--sidebar);
  color: #fff;
  padding: 24px 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 7px;
}
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  box-shadow: 0 10px 24px rgba(79, 70, 229, .3);
  font-size: 18px;
  font-weight: 800;
}
.brand strong { font-size: 16px; letter-spacing: .02em; }
.brand small {
  display: block;
  margin-top: 3px;
  color: #8f9bad;
  font-size: 12px;
}
.nav {
  display: grid;
  align-content: start;
  gap: 6px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #aeb7c6;
  padding: 10px 12px;
  text-align: left;
  font-weight: 550;
}
.nav-item:hover {
  border-color: rgba(255, 255, 255, .05);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  box-shadow: none;
}
.nav-item.active {
  border-color: rgba(129, 140, 248, .15);
  background: linear-gradient(90deg, rgba(99, 102, 241, .24), rgba(99, 102, 241, .1));
  color: #fff;
  box-shadow: inset 3px 0 #818cf8;
}
.nav-symbol {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .06);
  color: #98a5b8;
  font-size: 11px;
  font-weight: 700;
}
.nav-item.active .nav-symbol {
  background: rgba(129, 140, 248, .2);
  color: #c7d2fe;
}

.workspace {
  min-width: 0;
  padding: 28px 32px 44px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.topbar h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.refresh-btn span { font-size: 18px; line-height: 1; }
.view { display: grid; gap: 20px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 16px;
}
.stat, .panel, .table-panel, .list-toolbar {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.stat {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
}
.stat::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px;
  background: var(--stat-color, var(--brand));
  content: "";
}
.stat span {
  position: relative;
  z-index: 1;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}
.stat strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.stat small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 7px;
  color: #94a3b8;
  font-size: 12px;
}
.stat-blue { --stat-color: #4f46e5; }
.stat-violet { --stat-color: #8b5cf6; }
.stat-orange { --stat-color: #f59e0b; }
.stat-red { --stat-color: #ef4444; }
.stat-cyan { --stat-color: #0891b2; }
.stat-green { --stat-color: #10b981; }

.panel { padding: 20px; }
.panel h3, .table-panel h3 {
  margin: 0;
  color: #273247;
  font-size: 16px;
}
.health { display: grid; }
.health-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  align-items: start;
  border-left: 4px solid var(--ok);
}
.health-panel h3 { margin-bottom: 7px; }
.health-panel p { margin: 0; color: var(--muted); line-height: 1.6; }
.health-panel.ready { border-color: rgba(5, 150, 105, .5); }
.health-panel.warn { border-color: rgba(217, 119, 6, .5); }
.health-panel .missing { grid-column: 1 / -1; color: #b45309; }

.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 18px;
  align-items: start;
}
.config-grid .panel {
  display: grid;
  align-content: start;
  gap: 14px;
}
.config-grid .panel h3 {
  margin-bottom: 4px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.config-wide {
  grid-column: 1 / -1;
}
.field-help {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  background: var(--panel-soft);
  padding: 9px 11px;
}
.checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.table-panel { overflow: hidden; }
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-track { background: #f8fafc; }
.table-scroll::-webkit-scrollbar-thumb { border-radius: 8px; background: #d8dee9; }
.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 13px;
}

.recharge-editor {
  display: grid;
  gap: 18px;
}
.recharge-help p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.commerce-section {
  display: grid;
  gap: 14px;
}
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.section-title-row h3 {
  margin: 0 0 6px;
}
.edit-table {
  min-width: 920px;
}
.edit-table input,
.edit-table textarea,
.edit-table select {
  width: 100%;
  min-width: 96px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
}
.edit-table textarea {
  min-width: 180px;
  resize: vertical;
  line-height: 1.5;
}
.category-table {
  min-width: 1180px;
}
.category-table th:nth-child(2),
.category-name-cell {
  min-width: 260px;
}
.category-toolbar {
  margin-top: 2px;
  padding-left: 0;
  padding-right: 0;
}
.category-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-toggle,
.category-toggle-placeholder {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}
.category-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe3f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.category-toggle:hover {
  border-color: #a5b4fc;
  color: var(--brand);
}
.level-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 800;
}
.category-actions {
  min-width: 210px;
}
.category-parent-cell {
  min-width: 190px;
}
.category-parent-view {
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-parent-view span {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
}
.category-parent-view .tiny {
  flex: 0 0 auto;
}
.category-parent-select {
  min-width: 180px;
}
.category-disabled {
  opacity: .58;
}
.category-disabled input,
.category-disabled select {
  color: #64748b;
  background: #f8fafc;
}
.fake-grid {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.25fr);
  gap: 18px;
}
.fake-upload {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.fake-upload input[type="file"] {
  flex: 1 1 240px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
}
.fake-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.fake-image-card {
  display: grid;
  gap: 7px;
  color: var(--text);
  text-decoration: none;
}
.fake-image-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.fake-image-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.fake-image-card span {
  color: #64748b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fake-image-card small {
  font-size: 12px;
  line-height: 1.35;
}
.fake-image-card button {
  width: 100%;
}
.fake-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.fake-form label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 700;
}
.fake-form input,
.fake-form textarea,
.fake-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  box-sizing: border-box;
  font: inherit;
  color: var(--text);
  background: #fbfcfe;
}
.fake-form textarea {
  resize: vertical;
  line-height: 1.5;
}
.fake-mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fake-mini-actions .tiny {
  width: auto;
  min-width: 0;
}
.fake-wide,
.fake-form button,
.fake-form #fakeMsg {
  grid-column: 1 / -1;
}
.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--muted);
}
.mini-check input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  accent-color: var(--brand);
}
.tiny {
  padding: 8px 11px;
  font-size: 12px;
  border-radius: 9px;
}
.danger {
  color: #b42318;
  border-color: rgba(180, 35, 24, .25);
  background: rgba(254, 243, 242, .9);
}
.save-panel {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, .48);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 38px 24px;
  overflow: auto;
}
.modal-panel {
  width: min(1080px, 100%);
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
  padding: 22px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.modal-head h3 {
  margin: 0 0 7px;
  font-size: 22px;
}
.modal-head p {
  margin: 0;
  color: var(--muted);
}
.activity-modal {
  display: grid;
  gap: 16px;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(320px, 1.15fr);
  gap: 16px;
}
.detail-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}
.detail-card h4 {
  margin: 0 0 12px;
  font-size: 15px;
}
.detail-card dl {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 9px 12px;
  margin: 0;
}
.detail-card dt {
  color: var(--muted);
}
.detail-card dd {
  margin: 0;
  color: var(--text);
}
.long-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.8;
  color: var(--text);
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}
.tag-row span {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 12px;
}
.image-thumb {
  display: block;
  height: 110px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}
.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mini-list {
  display: grid;
  gap: 10px;
}
.mini-list > div {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  background: #fbfcff;
}
.mini-list strong {
  display: block;
  margin-bottom: 4px;
}
.mini-list span,
.small-empty {
  color: var(--muted);
  font-size: 13px;
}
.mini-list p {
  margin: 8px 0 0;
  line-height: 1.7;
}
.inline-table {
  min-width: 640px;
}
.inline-table-scroll {
  border: 1px solid var(--line);
  border-radius: 13px;
}
.wide-dl {
  grid-template-columns: 120px 1fr !important;
}
.detail-card code {
  word-break: break-all;
  white-space: normal;
}
.detail-card pre {
  max-height: 260px;
  overflow: auto;
  border-radius: 12px;
  background: #0f172a;
  color: #dbeafe;
  padding: 12px;
  font-size: 12px;
  line-height: 1.55;
}
.sub-h {
  margin-top: 16px !important;
}

@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .modal-mask { padding: 18px 12px; }
}
table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}
th, td {
  border-top: 1px solid var(--line);
  padding: 13px 16px;
  text-align: left;
  font-size: 13px;
  line-height: 1.55;
  vertical-align: middle;
}
th {
  background: #f8f9fc;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fafbff; }
td { color: #344054; }
.subtext {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.danger-text { color: var(--danger); }
td.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
td.actions button {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 18px;
}
td.actions button[data-status="matching"],
td.actions button[data-status="resolved"],
td.actions button[data-status="done"],
td.actions button[data-status="active"] {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}
td.actions button[data-status="reviewing"],
td.actions button[data-status="pending_payment"] {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}
td.actions button[data-status="closed"],
td.actions button[data-status="rejected"],
td.actions button[data-status="failed"],
td.actions button[data-status="banned"] {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-success { background: #ecfdf5; color: #047857; }
.pill-warning { background: #fffbeb; color: #b45309; }
.pill-danger { background: #fef2f2; color: #b91c1c; }
.pill-info { background: #eff6ff; color: #1d4ed8; }
.empty {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 14px;
}
.list-search {
  display: flex;
  gap: 8px;
  flex: 1 1 340px;
}
.list-search input { min-width: 180px; background: #fbfcfe; }
.list-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.list-filter span { color: #64748b; white-space: nowrap; }
.list-filter select { min-width: 125px; background: #fbfcfe; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}
.pagination button { min-width: 82px; }

.toast-container {
  position: fixed;
  z-index: 1000;
  top: 22px;
  right: 22px;
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.toast {
  min-width: 230px;
  max-width: 380px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 11px;
  background: #065f46;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .22);
  color: #fff;
  padding: 13px 17px;
  animation: toast-in .22s ease-out;
}
.toast.error { min-height: 0; background: #b91c1c; color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .config-grid { grid-template-columns: 1fr 1fr; }
  .config-grid .panel:last-child { grid-column: 1 / -1; }
  .fake-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    gap: 16px;
    padding: 16px;
  }
  .nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 3px;
  }
  .nav-item { flex: 0 0 auto; width: auto; }
  .nav-item.active { box-shadow: inset 0 -3px #818cf8; }
  button.ghost { width: auto; align-self: flex-start; }
  .workspace { padding: 24px; }
}

@media (max-width: 700px) {
  .workspace { padding: 20px 16px 34px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 17px 18px; }
  .stat strong { font-size: 24px; }
  .config-grid { grid-template-columns: 1fr; }
  .config-grid .panel:last-child { grid-column: auto; }
  .topbar { margin-bottom: 18px; }
  .topbar h2 { font-size: 23px; }
  .list-toolbar { align-items: stretch; }
  .list-search { flex-basis: 100%; }
  .list-filter { flex: 1 1 150px; display: grid; }
  .fake-form { grid-template-columns: 1fr; }
  .pagination { justify-content: space-between; }
  .pagination span { text-align: center; }
  .toast-container { left: 16px; right: 16px; top: 16px; }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 430px) {
  .login { padding: 16px; }
  .login-panel { padding: 30px 24px; border-radius: 16px; }
  .login-logo { width: 46px; height: 46px; margin-bottom: 18px; }
  .login-panel h1 { font-size: 26px; }
  .stats { grid-template-columns: 1fr; }
  .list-search { display: grid; grid-template-columns: 1fr auto; }
  .pagination { gap: 7px; }
  .pagination button { min-width: 72px; padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
