:root {
  --gm-bg: #f3f5f4;
  --gm-surface: #ffffff;
  --gm-surface-muted: #f7f9f8;
  --gm-ink: #14201b;
  --gm-muted: #65726c;
  --gm-line: #d8dfdb;
  --gm-line-strong: #bec9c3;
  --gm-primary: #137456;
  --gm-primary-hover: #0d6047;
  --gm-primary-soft: #e8f4ef;
  --gm-blue: #286a9f;
  --gm-blue-soft: #eaf2f8;
  --gm-amber: #9a6411;
  --gm-amber-soft: #fff4dc;
  --gm-red: #a43b35;
  --gm-red-soft: #fbeceb;
  --gm-sidebar: #1c2521;
  --gm-sidebar-muted: #aeb9b4;
  --gm-shadow: 0 10px 28px rgba(20, 32, 27, 0.08);
  --gm-radius: 6px;
  --gm-sidebar-width: 248px;
  --gm-topbar-height: 64px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--gm-ink);
  background: var(--gm-bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--gm-bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--gm-ink);
  background: var(--gm-bg);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--gm-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  border: 0;
}

[hidden] {
  display: none !important;
}

.gm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gm-app {
  min-height: 100vh;
}

.gm-sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: var(--gm-sidebar-width);
  display: flex;
  flex-direction: column;
  color: #ffffff;
  background: var(--gm-sidebar);
  border-right: 1px solid #303c36;
}

.gm-brand {
  min-height: var(--gm-topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #35413b;
}

.gm-brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  color: #ffffff;
  background: var(--gm-primary);
  border-radius: 5px;
  font-size: 18px;
  font-weight: 800;
}

.gm-brand__text {
  min-width: 0;
}

.gm-brand__text strong,
.gm-brand__text span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-brand__text strong {
  font-size: 15px;
}

.gm-brand__text span {
  color: var(--gm-sidebar-muted);
  font-size: 12px;
}

.gm-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
}

.gm-nav__label {
  display: block;
  padding: 10px 10px 6px;
  color: #87958e;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.gm-nav__item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  margin: 2px 0;
  color: #ced7d2;
  background: transparent;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
}

.gm-nav__item:hover {
  color: #ffffff;
  background: #29342f;
}

.gm-nav__item.is-active {
  color: #ffffff;
  background: var(--gm-primary);
}

.gm-nav__icon {
  width: 22px;
  min-width: 22px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
}

.gm-sidebar__footer {
  padding: 14px 18px;
  border-top: 1px solid #35413b;
  color: var(--gm-sidebar-muted);
  font-size: 12px;
}

.gm-workspace {
  min-height: 100vh;
  margin-left: var(--gm-sidebar-width);
}

.gm-topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: var(--gm-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--gm-line);
  backdrop-filter: blur(8px);
}

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

.gm-topbar__title {
  min-width: 0;
}

.gm-topbar__title strong,
.gm-topbar__title span {
  display: block;
}

.gm-topbar__title strong {
  font-size: 15px;
}

.gm-topbar__title span {
  color: var(--gm-muted);
  font-size: 12px;
}

.gm-menu-button {
  display: none;
}

.gm-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: var(--gm-muted);
  background: var(--gm-surface-muted);
  border: 1px solid var(--gm-line);
  border-radius: 5px;
  white-space: nowrap;
}

.gm-status__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: var(--gm-primary);
  border-radius: 50%;
}

.gm-user {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.gm-user__avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  color: #ffffff;
  background: var(--gm-blue);
  border-radius: 50%;
  font-weight: 800;
}

.gm-user__text strong,
.gm-user__text span {
  display: block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-user__text span {
  color: var(--gm-muted);
  font-size: 12px;
}

.gm-main {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 24px;
}

.gm-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.gm-page-header h1,
.gm-section-heading h2,
.gm-modal__title {
  margin: 0;
  color: var(--gm-ink);
  letter-spacing: 0;
}

.gm-page-header h1 {
  font-size: 24px;
  line-height: 1.25;
}

.gm-page-header p,
.gm-section-heading p {
  margin: 5px 0 0;
  color: var(--gm-muted);
}

.gm-tab {
  display: none;
}

.gm-tab.is-active {
  display: block;
}

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

.gm-stat {
  min-height: 116px;
  padding: 18px;
  background: var(--gm-surface);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
}

.gm-stat__label,
.gm-stat__meta {
  color: var(--gm-muted);
}

.gm-stat__value {
  display: block;
  margin: 10px 0 3px;
  font-size: 25px;
  line-height: 1.1;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.gm-stat__meta {
  font-size: 12px;
}

.gm-stat--green {
  border-top: 3px solid var(--gm-primary);
}

.gm-stat--blue {
  border-top: 3px solid var(--gm-blue);
}

.gm-stat--amber {
  border-top: 3px solid var(--gm-amber);
}

.gm-stat--red {
  border-top: 3px solid var(--gm-red);
}

.gm-grid {
  display: grid;
  gap: 18px;
}

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

.gm-grid--aside {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.gm-panel {
  min-width: 0;
  background: var(--gm-surface);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  box-shadow: 0 1px 2px rgba(20, 32, 27, 0.03);
}

.gm-panel__header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gm-line);
}

.gm-panel__title {
  min-width: 0;
}

.gm-panel__title strong,
.gm-panel__title span {
  display: block;
}

.gm-panel__title strong {
  font-size: 15px;
}

.gm-panel__title span {
  margin-top: 2px;
  color: var(--gm-muted);
  font-size: 12px;
}

.gm-panel__body {
  padding: 18px;
}

.gm-panel__body--flush {
  padding: 0;
}

.gm-section-heading {
  margin: 24px 0 14px;
}

.gm-section-heading:first-child {
  margin-top: 0;
}

.gm-section-heading h2 {
  font-size: 17px;
}

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

.gm-form-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gm-field {
  min-width: 0;
}

.gm-field--full {
  grid-column: 1 / -1;
}

.gm-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--gm-ink);
  font-weight: 700;
}

.gm-label__hint,
.gm-help {
  color: var(--gm-muted);
  font-size: 12px;
  font-weight: 400;
}

.gm-input,
.gm-select,
.gm-textarea {
  width: 100%;
  color: var(--gm-ink);
  background: var(--gm-surface);
  border: 1px solid var(--gm-line-strong);
  border-radius: 5px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.gm-input,
.gm-select {
  height: 42px;
  padding: 0 11px;
}

.gm-textarea {
  min-height: 100px;
  padding: 10px 11px;
  resize: vertical;
}

.gm-input:hover,
.gm-select:hover,
.gm-textarea:hover {
  border-color: #9eaaa4;
}

.gm-input:focus,
.gm-select:focus,
.gm-textarea:focus {
  border-color: var(--gm-primary);
  box-shadow: 0 0 0 3px rgba(19, 116, 86, 0.14);
}

.gm-input:disabled,
.gm-select:disabled,
.gm-textarea:disabled {
  color: #87928d;
  background: #eef1ef;
  cursor: not-allowed;
}

.gm-input[aria-invalid="true"] {
  border-color: var(--gm-red);
}

.gm-input-group {
  position: relative;
}

.gm-input-group .gm-input {
  padding-right: 42px;
}

.gm-input-action {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--gm-muted);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
}

.gm-input-action:hover {
  color: var(--gm-ink);
  background: var(--gm-surface-muted);
}

.gm-check {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.gm-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--gm-primary);
}

.gm-button,
.gm-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--gm-ink);
  background: var(--gm-surface);
  border: 1px solid var(--gm-line-strong);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.gm-button {
  min-height: 38px;
  padding: 8px 13px;
}

.gm-button:hover,
.gm-icon-button:hover {
  color: var(--gm-ink);
  background: var(--gm-surface-muted);
  border-color: #9eaaa4;
  text-decoration: none;
}

.gm-button--primary {
  color: #ffffff;
  background: var(--gm-primary);
  border-color: var(--gm-primary);
}

.gm-button--primary:hover {
  color: #ffffff;
  background: var(--gm-primary-hover);
  border-color: var(--gm-primary-hover);
}

.gm-button--danger {
  color: var(--gm-red);
  border-color: #dfb6b3;
}

.gm-button--danger:hover {
  color: #ffffff;
  background: var(--gm-red);
  border-color: var(--gm-red);
}

.gm-button--small {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.gm-button:disabled,
.gm-icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gm-icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  flex: 0 0 38px;
  font-size: 17px;
}

.gm-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gm-line);
}

.gm-toolbar__search {
  width: min(360px, 100%);
}

.gm-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.gm-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

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

.gm-table th {
  color: var(--gm-muted);
  background: var(--gm-surface-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.gm-table tbody tr:hover {
  background: #fafcfb;
}

.gm-table tbody tr:last-child td {
  border-bottom: 0;
}

.gm-table strong,
.gm-table small {
  display: block;
}

.gm-table small {
  margin-top: 2px;
  color: var(--gm-muted);
}

.gm-code {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.gm-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  color: var(--gm-muted);
  background: var(--gm-surface-muted);
  border: 1px solid var(--gm-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.gm-badge--success {
  color: var(--gm-primary-hover);
  background: var(--gm-primary-soft);
  border-color: #b8dacc;
}

.gm-badge--pending {
  color: var(--gm-amber);
  background: var(--gm-amber-soft);
  border-color: #ead5a6;
}

.gm-badge--failed {
  color: var(--gm-red);
  background: var(--gm-red-soft);
  border-color: #e4bab7;
}

.gm-badge--info {
  color: var(--gm-blue);
  background: var(--gm-blue-soft);
  border-color: #bfd4e5;
}

.gm-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: var(--gm-muted);
  background: var(--gm-surface);
  border: 1px solid var(--gm-line);
  border-left-width: 4px;
  border-radius: 5px;
}

.gm-alert--success {
  color: var(--gm-primary-hover);
  background: var(--gm-primary-soft);
  border-color: #b8dacc;
  border-left-color: var(--gm-primary);
}

.gm-alert--warning {
  color: #774b08;
  background: var(--gm-amber-soft);
  border-color: #ead5a6;
  border-left-color: var(--gm-amber);
}

.gm-alert--danger {
  color: #812f2a;
  background: var(--gm-red-soft);
  border-color: #e4bab7;
  border-left-color: var(--gm-red);
}

.gm-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--gm-muted);
  text-align: center;
}

.gm-empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gm-ink);
}

.gm-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gm-list__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--gm-line);
}

.gm-list__item:first-child {
  padding-top: 0;
}

.gm-list__item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.gm-list__item strong,
.gm-list__item small {
  display: block;
}

.gm-list__item small {
  color: var(--gm-muted);
}

.gm-picker {
  position: relative;
}

.gm-picker__meta {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--gm-muted);
  font-size: 12px;
}

.gm-picker__selected {
  color: var(--gm-primary-hover);
  font-weight: 700;
}

.gm-picker__list {
  height: 250px;
  overflow-y: auto;
  background: var(--gm-surface);
  border: 1px solid var(--gm-line);
  border-radius: 5px;
}

.gm-picker__option {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  color: var(--gm-ink);
  background: var(--gm-surface);
  border-bottom: 1px solid var(--gm-line);
  cursor: pointer;
  text-align: left;
}

.gm-picker__option:last-child {
  border-bottom: 0;
}

.gm-picker__option:hover,
.gm-picker__option.is-selected {
  background: var(--gm-primary-soft);
}

.gm-picker__option.is-selected {
  box-shadow: inset 3px 0 0 var(--gm-primary);
}

.gm-picker__option strong,
.gm-picker__option small {
  display: block;
}

.gm-picker__option small {
  color: var(--gm-muted);
}

.gm-picker__id {
  color: var(--gm-muted);
  font-family: Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.gm-pagination {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--gm-line);
  color: var(--gm-muted);
}

.gm-pagination__buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gm-segmented {
  display: inline-flex;
  padding: 3px;
  background: #e9eeeb;
  border-radius: 6px;
}

.gm-segmented button {
  min-height: 32px;
  padding: 5px 11px;
  color: var(--gm-muted);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

.gm-segmented button.is-active {
  color: var(--gm-ink);
  background: var(--gm-surface);
  box-shadow: 0 1px 3px rgba(20, 32, 27, 0.12);
}

.gm-modal[hidden] {
  display: none;
}

.gm-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.gm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 15, 0.58);
}

.gm-modal__dialog {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--gm-surface);
  border: 1px solid var(--gm-line);
  border-radius: 7px;
  box-shadow: var(--gm-shadow);
}

.gm-modal__header,
.gm-modal__body,
.gm-modal__footer {
  padding: 16px 18px;
}

.gm-modal__header {
  border-bottom: 1px solid var(--gm-line);
}

.gm-modal__title {
  font-size: 17px;
}

.gm-modal__body {
  color: var(--gm-muted);
}

.gm-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--gm-line);
}

.gm-toast-region {
  position: fixed;
  z-index: 120;
  top: 16px;
  right: 16px;
  width: min(380px, calc(100% - 32px));
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.gm-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  color: var(--gm-ink);
  background: var(--gm-surface);
  border: 1px solid var(--gm-line);
  border-left: 4px solid var(--gm-blue);
  border-radius: 6px;
  box-shadow: var(--gm-shadow);
  pointer-events: auto;
  animation: gm-toast-in 160ms ease-out;
}

.gm-toast--success {
  border-left-color: var(--gm-primary);
}

.gm-toast--error {
  border-left-color: var(--gm-red);
}

.gm-toast--warning {
  border-left-color: var(--gm-amber);
}

.gm-toast__content {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.gm-toast__close {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--gm-muted);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
}

.gm-skeleton {
  min-height: 16px;
  background: #e5eae7;
  border-radius: 4px;
  animation: gm-pulse 1.2s ease-in-out infinite;
}

.gm-mobile-overlay {
  display: none;
}

body.gm-modal-open,
body.gm-nav-open {
  overflow: hidden;
}

@keyframes gm-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gm-pulse {
  0%, 100% { opacity: 0.58; }
  50% { opacity: 1; }
}

@media (max-width: 1120px) {
  .gm-stats,
  .gm-form-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gm-grid--aside {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .gm-sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.gm-nav-open .gm-sidebar {
    transform: translateX(0);
  }

  .gm-mobile-overlay {
    position: fixed;
    z-index: 35;
    inset: 0;
    background: rgba(11, 18, 15, 0.5);
  }

  body.gm-nav-open .gm-mobile-overlay {
    display: block;
  }

  .gm-workspace {
    margin-left: 0;
  }

  .gm-menu-button {
    display: inline-flex;
  }

  .gm-topbar {
    padding: 10px 14px;
  }

  .gm-status,
  .gm-user__text {
    display: none;
  }

  .gm-main {
    padding: 18px 14px 30px;
  }

  .gm-page-header,
  .gm-panel__header,
  .gm-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .gm-page-header .gm-actions,
  .gm-panel__header .gm-actions,
  .gm-toolbar .gm-actions {
    width: 100%;
  }

  .gm-toolbar__search {
    width: 100%;
  }

  .gm-grid--2,
  .gm-form-grid,
  .gm-form-grid--4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .gm-stats {
    grid-template-columns: 1fr;
  }

  .gm-stat {
    min-height: 96px;
  }

  .gm-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .gm-actions .gm-button {
    flex: 1 1 auto;
  }

  .gm-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .gm-modal {
    align-items: end;
    padding: 0;
  }

  .gm-modal__dialog {
    width: 100%;
    max-height: 90vh;
    border-radius: 7px 7px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .gm-sidebar,
  .gm-topbar,
  .gm-actions,
  .gm-toolbar,
  .gm-pagination {
    display: none !important;
  }

  .gm-workspace {
    margin: 0;
  }

  .gm-main {
    max-width: none;
    padding: 0;
  }

  .gm-panel,
  .gm-stat {
    box-shadow: none;
    break-inside: avoid;
  }
}
