:root {
  --green-50: #eaf3de;
  --green-100: #c0dd97;
  --green-600: #3b6d11;
  --green-700: #27500a;
  --amber-50: #faeeda;
  --amber-100: #fac775;
  --amber-400: #ba7517;
  --amber-600: #854f0b;
  --gray-50: #f1efe8;
  --gray-100: #d3d1c7;
  --gray-200: #b4b2a9;
  --gray-600: #5f5e5a;
  --gray-800: #444441;
  --error-red: #e24b4a;
  --error-red-bg: #fcebeb;
  --info-blue: #185fa5;
  --info-blue-bg: #e6f1fb;
  --border: #d3d1c7;
}

body {
  background: #e8e6df;
  color: var(--gray-800);
}

[x-cloak] {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--gray-50);
}

.login-card {
  width: 380px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 34px 36px;
  box-shadow: 0 16px 40px rgba(68, 68, 65, .08);
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--green-600);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 22px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--gray-600);
  font-size: 12px;
}

.form-input,
.form-select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0 11px;
  font-size: 13px;
  outline: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(59, 109, 17, .12);
}

.btn {
  height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green-600);
  color: #fff;
}

.btn-primary:hover {
  background: var(--green-700);
}

.btn-secondary {
  background: #fff;
  color: var(--green-600);
  border-color: var(--green-600);
}

.btn-muted {
  background: var(--gray-50);
  color: var(--gray-800);
  border-color: var(--border);
}

.btn-danger {
  background: var(--error-red-bg);
  color: var(--error-red);
  border-color: rgba(226, 75, 74, .25);
}

.app-shell {
  min-width: 1180px;
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 208px;
  flex: 0 0 208px;
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 18px 14px;
}

.nav-item {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-600);
  font-size: 13px;
}

.nav-item.active {
  background: var(--green-50);
  color: var(--green-700);
  font-weight: 600;
}

.content {
  flex: 1;
  padding: 22px 24px 32px;
  min-width: 0;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 500;
  height: 42px;
  padding: 0 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

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

.truncate-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}

.badge-green {
  background: var(--green-50);
  color: var(--green-700);
  border-color: var(--green-100);
}

.badge-amber {
  background: var(--amber-50);
  color: var(--amber-600);
  border-color: var(--amber-100);
}

.badge-red {
  background: var(--error-red-bg);
  color: var(--error-red);
  border-color: rgba(226, 75, 74, .25);
}

.badge-blue {
  background: var(--info-blue-bg);
  color: var(--info-blue);
  border-color: rgba(24, 95, 165, .18);
}

.badge-gray {
  background: var(--gray-50);
  color: var(--gray-600);
  border-color: var(--border);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  width: 420px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .18);
}

.code-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--gray-50);
}
