﻿:root {
  color-scheme: light;
  --bg: #eef3f6;
  --panel: #ffffff;
  --panel-soft: #f8fbfc;
  --text: #1f2933;
  --muted: #657482;
  --line: #d8e1e6;
  --line-strong: #b9c7d0;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-weak: #e7f7f4;
  --accent-soft: #f0fbf8;
  --ok: #16815f;
  --ok-bg: #e8f8f1;
  --warn: #b45309;
  --warn-bg: #fff4df;
  --danger: #b42318;
  --danger-bg: #fff1ef;
  --neutral: #566171;
  --neutral-bg: #eef2f6;
  --shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef7f5 0, var(--bg) 260px, var(--bg) 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

input,
textarea,
select {
  color: var(--text);
}

button {
  height: 36px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
}

button:hover,
.file-button:hover {
  filter: brightness(0.96);
}

button:active,
.file-button:active {
  transform: translateY(1px);
}

button.primary-action,
.file-button.primary-action {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

button.secondary {
  background: #fff;
  color: var(--accent);
}

button.danger-ghost,
button.icon-danger {
  border-color: #f2c4bd;
  background: #fff;
  color: var(--danger);
}

button.small-button {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-form {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.login-form input {
  min-width: 0;
  flex: 1;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 10px;
}

.login-footnote {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.small-link {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--accent);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.app-shell {
  width: min(1560px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.top-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 5px 6px 5px 10px;
  color: var(--muted);
  font-size: 13px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

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

.records-panel {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 42px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.record-toolbar {
  display: flex;
  gap: 6px;
}

.records-list {
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.record-item {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--text);
  padding: 8px;
}

.record-item.active {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.record-open {
  height: auto;
  min-width: 0;
  display: grid;
  gap: 4px;
  justify-items: start;
  align-content: center;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
  white-space: normal;
  box-shadow: none;
}

.record-open:hover {
  filter: none;
}

.record-delete {
  align-self: center;
  width: 48px;
  height: 30px;
  padding: 0;
  font-size: 12px;
}

.record-title {
  max-width: 100%;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meta,
.record-expire {
  color: var(--muted);
  font-size: 12px;
}

.record-empty {
  min-height: 90px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  display: grid;
  place-items: center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  max-width: 460px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  align-items: stretch;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(31, 41, 51, 0.04);
}

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

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

.file-button {
  height: 36px;
  min-width: 92px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}

.file-button input {
  display: none;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.metric-row div {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.metric-row strong {
  font-size: 25px;
  line-height: 1;
}

.metric-row span {
  color: var(--muted);
  font-size: 13px;
}

textarea {
  width: 100%;
  min-height: 142px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
  color: var(--text);
  background: #fff;
  line-height: 1.55;
}

#namesOutput {
  min-height: 280px;
  font-family: Consolas, "Courier New", "Microsoft YaHei UI", monospace;
  white-space: pre;
}

.hint-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px;
  border-radius: 8px 8px 0 0;
  background: #fff;
}

.tabs {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.menu-wrap {
  position: relative;
}

.tab {
  background: #fff;
  color: var(--neutral);
  border-color: var(--line-strong);
}

.tab.active {
  background: var(--accent-weak);
  color: var(--accent);
  border-color: var(--accent);
}

.action-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  width: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.action-menu button {
  width: 100%;
  height: 34px;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 700;
}

.action-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  filter: none;
}

.view.hidden,
.hidden {
  display: none !important;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 6px;
  max-height: 58vh;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1480px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th:nth-child(1),
td:nth-child(1) {
  width: 108px;
}

th:nth-child(2),
td:nth-child(2) {
  width: 150px;
}

th:nth-child(3),
td:nth-child(3) {
  width: 112px;
}

th:nth-child(4),
td:nth-child(4) {
  width: 158px;
}

th:nth-child(5),
td:nth-child(5) {
  width: 88px;
}

th:nth-child(6),
td:nth-child(6) {
  width: 168px;
}

th:nth-child(7),
td:nth-child(7) {
  width: 168px;
}

th:nth-child(8),
td:nth-child(8) {
  width: 260px;
}

th:nth-child(9),
td:nth-child(9) {
  width: 220px;
}

th:nth-child(10),
td:nth-child(10) {
  width: 260px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf7f5;
  color: #374151;
  font-weight: 700;
}

tr.row-missing td {
  background: #fffaf1;
}

tr.row-conflict td {
  background: var(--danger-bg);
}

.empty {
  color: var(--muted);
}

td.empty {
  height: 120px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge.neutral {
  background: var(--neutral-bg);
  color: var(--neutral);
}

.output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
}

.issue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.issue-grid h2 {
  margin-bottom: 8px;
}

.issue-box {
  min-height: 220px;
  max-height: 44vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfe;
  font-size: 13px;
  line-height: 1.55;
}

.issue-box div + div {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.issue-box span {
  color: var(--warn);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  min-height: 38px;
  border-radius: 6px;
  padding: 10px 14px;
  background: #20242a;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-size: 14px;
}

.admin-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 30px;
}

.admin-topbar {
  margin-bottom: 12px;
}

.admin-notice {
  margin-bottom: 12px;
  border: 1px solid #f0c46f;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.admin-layout {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-nav {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(31, 41, 51, 0.04);
}

.admin-nav button {
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: var(--neutral);
  text-align: left;
}

.admin-nav button.active,
.admin-nav button:hover {
  border-color: var(--accent);
  background: var(--accent-weak);
  color: var(--accent-strong);
  filter: none;
}

.admin-content {
  min-width: 0;
}

.admin-view {
  min-width: 0;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-metrics div,
.detail-stats div {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(31, 41, 51, 0.04);
}

.admin-metrics strong,
.detail-stats strong {
  font-size: 25px;
  line-height: 1;
}

.admin-metrics span,
.detail-stats span {
  color: var(--muted);
  font-size: 13px;
}

.admin-section {
  min-width: 0;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 14px;
  align-items: start;
}

.records-split {
  grid-template-columns: minmax(0, 0.95fr) minmax(440px, 1.05fr);
}

.admin-side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
  max-height: calc(100vh - 130px);
  overflow: auto;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.filter-bar input,
.filter-bar select {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  outline: none;
}

.field input:focus,
.field select:focus,
.filter-bar input:focus,
.filter-bar select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.11);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.admin-subsection {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-subsection h2 {
  margin-bottom: 8px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 240px) 150px 150px auto auto;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.admin-table-wrap {
  max-height: calc(100vh - 280px);
  background: #fff;
}

.admin-table {
  min-width: 760px;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  height: 42px;
  padding: 8px 9px;
}

.admin-table th:nth-child(n),
.admin-table td:nth-child(n) {
  width: auto;
}

.compact-table {
  min-width: 720px;
}

.compact-table th:nth-child(1),
.compact-table td:nth-child(1) {
  width: 150px;
}

.compact-table th:nth-child(2),
.compact-table td:nth-child(2) {
  width: 260px;
}

.compact-table th:nth-child(3),
.compact-table td:nth-child(3) {
  width: 170px;
}

.account-table {
  min-width: 860px;
}

.account-table th:nth-child(1),
.account-table td:nth-child(1) {
  width: 150px;
}

.account-table th:nth-child(2),
.account-table td:nth-child(2) {
  width: 150px;
}

.account-table th:nth-child(3),
.account-table td:nth-child(3),
.account-table th:nth-child(4),
.account-table td:nth-child(4) {
  width: 96px;
}

.account-table th:nth-child(6),
.account-table td:nth-child(6) {
  width: 86px;
}

.records-table {
  min-width: 940px;
}

.records-table th:nth-child(1),
.records-table td:nth-child(1) {
  width: 130px;
}

.records-table th:nth-child(2),
.records-table td:nth-child(2) {
  width: 130px;
}

.records-table th:nth-child(3),
.records-table td:nth-child(3) {
  width: 260px;
}

.records-table th:nth-child(4),
.records-table td:nth-child(4) {
  width: 170px;
}

.records-table th:nth-child(5),
.records-table td:nth-child(5),
.records-table th:nth-child(6),
.records-table td:nth-child(6),
.records-table th:nth-child(7),
.records-table td:nth-child(7) {
  width: 82px;
}

.selected-row td {
  background: var(--accent-soft);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.detail-stats div {
  min-height: 62px;
  box-shadow: none;
}

.detail-stats strong {
  font-size: 20px;
}

.detail-table-wrap {
  max-height: 320px;
}

.detail-table {
  min-width: 1180px;
}

.detail-table th:nth-child(1),
.detail-table td:nth-child(1) {
  width: 100px;
}

.detail-table th:nth-child(2),
.detail-table td:nth-child(2) {
  width: 150px;
}

.detail-table th:nth-child(3),
.detail-table td:nth-child(3) {
  width: 110px;
}

.detail-table th:nth-child(4),
.detail-table td:nth-child(4) {
  width: 160px;
}

.detail-table th:nth-child(5),
.detail-table td:nth-child(5) {
  width: 88px;
}

.detail-table th:nth-child(6),
.detail-table td:nth-child(6),
.detail-table th:nth-child(7),
.detail-table td:nth-child(7) {
  width: 170px;
}

.detail-table th:nth-child(8),
.detail-table td:nth-child(8) {
  width: 230px;
}

.text-snapshot {
  min-height: 120px;
  max-height: 220px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font: 13px/1.55 Consolas, "Microsoft YaHei UI", monospace;
}

.two-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}

@media (min-width: 981px) {
  .app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .workspace-grid {
    min-height: 0;
    align-items: stretch;
  }

  .records-panel {
    align-self: stretch;
    height: 100%;
    max-height: none;
  }

  .main-workspace {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .main-workspace > .view.panel {
    min-height: 0;
  }

  #tableView {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
  }

  #tableView .table-wrap {
    height: 100%;
    max-height: none;
  }

  #namesView {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  #namesOutput {
    min-height: 0;
    height: 100%;
  }

  #issuesView {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
  }

  #issuesView .issue-grid,
  #issuesView .issue-box {
    min-height: 0;
    height: 100%;
  }

  #issuesView .issue-box {
    max-height: none;
  }

  .admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .admin-layout {
    min-height: 0;
    align-items: stretch;
  }

  .admin-nav {
    align-self: start;
  }

  .admin-content,
  .admin-view {
    min-height: 0;
  }

  #recordsView {
    height: 100%;
  }

  .records-list-panel {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .records-table-wrap {
    height: 100%;
    max-height: none;
  }

  .records-table {
    min-width: 1240px;
  }

  .record-detail-view:not(.hidden) {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .record-rows-section {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .record-rows-section .subsection-head {
    margin-bottom: 8px;
  }

  .detail-table-wrap {
    height: 100%;
    max-height: none;
  }

  .record-text-section {
    margin-top: 12px;
  }

  .record-text-section .text-snapshot {
    height: 132px;
    min-height: 132px;
    max-height: 132px;
  }
}

@media (max-width: 980px) {
  .app-shell,
  .admin-shell {
    width: min(100vw - 20px, 760px);
    padding-top: 14px;
  }

  .topbar,
  .panel-head,
  .side-head {
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-items: stretch;
  }

  .user-pill {
    justify-content: space-between;
  }

  .status-pill {
    width: 100%;
    max-width: none;
  }

  .workflow-grid,
  .workspace-grid,
  .issue-grid,
  .admin-layout,
  .admin-split,
  .records-split,
  .profile-grid,
  .two-blocks {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    position: static;
    grid-template-columns: repeat(4, minmax(76px, 1fr));
    overflow-x: auto;
  }

  .admin-nav button {
    justify-content: center;
    text-align: center;
    padding: 0 10px;
  }

  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .filter-bar input[type="search"],
  .filter-bar select {
    grid-column: span 2;
  }

  .admin-side-panel {
    max-height: none;
  }

  .admin-table-wrap {
    max-height: 60vh;
  }

  .records-panel {
    position: static;
    max-height: none;
  }

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

  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs,
  .toolbar-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .menu-wrap {
    position: static;
  }

  .action-menu {
    left: 8px;
    right: 8px;
    width: auto;
  }

  .login-form {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .login-panel,
  .panel,
  .admin-side-panel {
    padding: 14px;
  }

  .topbar h1,
  .login-panel h1 {
    font-size: 20px;
  }

  .admin-metrics,
  .metric-row,
  .detail-stats,
  .filter-bar,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar input[type="search"],
  .filter-bar select {
    grid-column: auto;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-actions,
  .panel-actions {
    width: 100%;
  }

  .toolbar-actions > *,
  .panel-actions button {
    flex: 1 1 auto;
  }
}

