:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #251629;
  background: #f7f4f8;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1180px;
  margin: 0;
  background: #f7f4f8;
}

.hidden {
  display: none !important;
}

.auth-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px;
}

.auth-card,
.modal-card {
  width: 420px;
  padding: 28px;
  border: 1px solid #eee4f2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(52, 33, 60, 0.08);
}

.auth-brand {
  padding: 0 0 24px;
}

.auth-card h1 {
  margin-bottom: 8px;
}

.auth-card p {
  margin-bottom: 22px;
  color: #7f7287;
  font-size: 14px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  color: #5e5066;
  font-size: 13px;
  font-weight: 600;
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #e6dcef;
  border-radius: 8px;
  color: #251629;
  font-size: 14px;
  outline: none;
}

.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e6dcef;
  border-radius: 8px;
  color: #251629;
  font: inherit;
  outline: none;
}

.field select {
  height: 42px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #8b58d4;
  box-shadow: 0 0 0 3px rgba(139, 88, 212, 0.12);
}

.primary-action,
.ghost-action,
.text-action {
  height: 40px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.primary-action {
  width: 100%;
  color: #fff;
  font-weight: 700;
  background: #7d4dcc;
}

.ghost-action {
  padding: 0 14px;
  color: #5d2ca0;
  background: #f1e8ff;
}

.ghost-action.danger {
  color: #9d3154;
  background: #fff0f5;
}

.text-action {
  height: auto;
  color: #7d4dcc;
  background: transparent;
}

.form-message {
  min-height: 20px;
  margin-top: 14px;
  color: #4f7d43;
  font-size: 13px;
}

.form-message.error {
  color: #b43a52;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(37, 22, 41, 0.32);
}

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

.settings-card {
  padding: 18px;
  border: 1px solid #f0e9f3;
  border-radius: 8px;
  background: #faf8fb;
}

.settings-card h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

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

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

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

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5e5066;
  font-size: 13px;
}

.code-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 24px 18px;
  border-right: 1px solid #ece3ef;
  background: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 6px 24px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 44px;
  text-align: center;
  background: #8b58d4;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 4px;
  color: #806f89;
  font-size: 12px;
}

.module-nav {
  display: grid;
  gap: 6px;
}

.module-item {
  padding: 12px 14px;
  border-radius: 8px;
  color: #5e5066;
  font-size: 14px;
  background: transparent;
}

.module-item.active {
  color: #5d2ca0;
  font-weight: 700;
  background: #f1e8ff;
}

.main {
  margin-left: 248px;
  padding: 28px 32px 40px;
}

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

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  letter-spacing: 0;
}

.topbar p {
  margin-top: 8px;
  color: #7f7287;
  font-size: 14px;
}

.env-pill {
  padding: 10px 14px;
  border: 1px solid #e6dcef;
  border-radius: 8px;
  color: #65436d;
  background: #fff;
}

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

.metric {
  min-height: 112px;
  padding: 18px;
  border: 1px solid #eee4f2;
  border-radius: 8px;
  background: #fff;
}

.metric-label {
  color: #7f7287;
  font-size: 13px;
}

.metric-value {
  margin-top: 18px;
  font-size: 28px;
  font-weight: 700;
}

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

.panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid #eee4f2;
  border-radius: 8px;
  background: #fff;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-header h2 {
  font-size: 18px;
}

.panel-header span {
  color: #92859b;
  font-size: 12px;
}

.funnel {
  display: grid;
  gap: 10px;
}

.funnel-row,
.queue-item,
.record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #faf8fb;
}

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

.record-list {
  display: grid;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #f0e9f3;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #75667e;
  font-weight: 600;
  background: #faf8fb;
}

.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  color: #5d2ca0;
  background: #f1e8ff;
}
