:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --sidebar: #172033;
  --sidebar-text: #e9eef9;
  --text: #1f2937;
  --muted: #667085;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --danger-soft: #fef2f2;
  --success-soft: #ecfdf3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 28px;
  padding: 0 8px;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu-item {
  border-radius: 8px;
  color: var(--sidebar-text);
  display: block;
  padding: 11px 12px;
  text-decoration: none;
}

.menu-item.active,
.menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.logout-form {
  margin-top: auto;
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 8px;
}

.content {
  min-width: 0;
  padding: 28px;
}

.flash-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  border-radius: 8px;
  padding: 12px 14px;
}

.flash.error {
  background: var(--danger-soft);
  color: #991b1b;
}

.flash.success {
  background: var(--success-soft);
  color: #027a48;
}

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

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0;
}

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

.table-card,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(17, 24, 39, 0.06);
}

.table-card {
  overflow-x: auto;
}

.user-table {
  border-collapse: collapse;
  min-width: 1080px;
  width: 100%;
}

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

th {
  background: #f9fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.user-cell {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 180px;
}

.avatar {
  border-radius: 50%;
  height: 44px;
  object-fit: cover;
  width: 44px;
}

.avatar.placeholder {
  align-items: center;
  background: #e0e7ff;
  color: #3730a3;
  display: flex;
  font-weight: 700;
  justify-content: center;
}

.name {
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  max-width: 220px;
  overflow-wrap: anywhere;
}

.role {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
}

.role.admin {
  background: #fff7ed;
  color: #c2410c;
}

.role.user {
  background: #eef2ff;
  color: #4338ca;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  min-height: 38px;
  padding: 0 14px;
}

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

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

.primary-button.small {
  min-width: 96px;
}

.secondary-button {
  background: #f3f4f6;
  color: #374151;
}

.login-panel {
  margin: 12vh auto 0;
  max-width: 420px;
  padding: 28px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.login-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  height: 42px;
  padding: 0 12px;
}

.empty {
  color: var(--muted);
  padding: 36px;
  text-align: center;
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .content {
    padding: 18px;
  }
}
