:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: #f3f5f8;
  color: #1f2937;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button,
a {
  border: 0;
  border-radius: 6px;
  background: #1677ff;
  color: #fff;
  cursor: pointer;
  padding: 9px 14px;
  text-decoration: none;
}

button.secondary {
  background: #6b7280;
}

button.danger {
  background: #dc2626;
}

button.warning {
  background: #f59e0b;
}

button.icon {
  background: transparent;
  color: #4b5563;
  padding: 4px 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  padding: 9px 10px;
}

label {
  display: grid;
  gap: 6px;
  color: #374151;
  font-size: 14px;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto;
}

.hidden {
  display: none !important;
}

.login {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  margin: 90px auto;
  padding: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
}

.login h1,
.topbar h1 {
  margin: 0;
  font-size: 22px;
}

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

.topbar p {
  margin: 8px 0 0;
  color: #6b7280;
}

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

.toolbar {
  margin-bottom: 12px;
}

.toolbar input {
  max-width: 360px;
}

.panel {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  border-bottom: 1px solid #eef2f7;
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

td .row-actions {
  display: flex;
  gap: 8px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
}

.status.enabled {
  background: #dcfce7;
  color: #166534;
}

.status.disabled {
  background: #fee2e2;
  color: #991b1b;
}

.message {
  min-height: 20px;
  margin: 0;
  color: #dc2626;
}

dialog {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

dialog form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

dialog header,
dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

dialog h2 {
  margin: 0;
  font-size: 20px;
}

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

@media (max-width: 720px) {
  .topbar,
  .toolbar,
  dialog header,
  dialog footer {
    align-items: stretch;
    flex-direction: column;
  }

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