:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --text: #17202a;
  --muted: #667085;
  --line: #d9e1e8;
  --accent: #147c72;
  --accent-strong: #0f665f;
  --danger: #ba3434;
  --shadow: 0 12px 32px rgba(24, 39, 75, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  background: #9aa8b5;
  cursor: not-allowed;
}

input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 8px;
  background: #fff;
  color: var(--text);
}

input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(20, 124, 114, 0.16);
}

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

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

.topbar h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.ghost-btn {
  background: var(--surface-2);
  color: var(--text);
}

.ghost-btn:hover {
  background: #dfe8ef;
}

.icon-btn {
  min-width: 72px;
}

.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-form {
  max-width: 460px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.login-row input {
  flex: 1;
}

.admin-view {
  display: grid;
  gap: 14px;
}

.toolbar {
  justify-content: flex-start;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #edf3f2;
  color: #283943;
  font-size: 13px;
  font-weight: 700;
}

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

.code-input {
  text-transform: uppercase;
}

.check-cell {
  text-align: center;
}

.check-cell input {
  width: 20px;
  min-height: 20px;
}

.danger-btn {
  background: #f4e7e7;
  color: var(--danger);
}

.danger-btn:hover {
  background: #ecd4d4;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .toolbar,
  .login-row {
    width: 100%;
  }

  .toolbar button,
  .login-row button {
    flex: 1;
  }
}
