:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --ink: #111518;
  --muted: #66736f;
  --line: #e2e8e4;
  --lime: #d7ff20;
  --green: #1d8f5b;
  --red: #d8432f;
  --blue: #315dff;
  --shadow: 0 18px 44px rgba(17, 21, 24, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #101413;
}

.login-card {
  width: min(440px, 100%);
  border-radius: 8px;
  padding: 32px;
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  background: var(--lime);
  color: var(--ink);
  font-weight: 950;
}

.login-card h1 {
  margin: 0 0 24px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.login-card label {
  display: block;
  margin-bottom: 16px;
}

.login-card label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.login-card input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #f8faf8;
  outline: none;
}

.login-card input:focus {
  border-color: #a3c400;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(215, 255, 32, 0.2);
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.admin-shell {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #121615;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--lime);
  color: #111518;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-link {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.side-link svg,
.primary-btn svg,
.ghost-btn svg,
.queue-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
}

.side-link.is-active {
  color: #111518;
  background: var(--lime);
}

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

.workspace-topbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.workspace-topbar {
  margin-bottom: 28px;
}

.workspace-topbar h1,
.section-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.workspace-topbar h1 {
  font-size: 30px;
  line-height: 1.15;
}

.section-head {
  margin: 28px 0 16px;
}

.section-head h2 {
  font-size: 22px;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: #1d5c3f;
  background: #e5f8ed;
  font-size: 13px;
  font-weight: 900;
}

.admin-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 900;
}

.admin-pill svg {
  width: 17px;
  height: 17px;
  color: var(--green);
}

.admin-pill small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.primary-btn,
.ghost-btn,
.table-action {
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.primary-btn {
  min-height: 40px;
  padding: 0 16px;
  color: #111518;
  background: var(--lime);
}

.ghost-btn {
  min-height: 40px;
  padding: 0 16px;
  color: var(--ink);
  background: #e8eeea;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.metric-grid,
.queue-grid,
.plan-grid,
.settings-grid {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card,
.queue-item,
.plan-card,
.setting-card,
.policy-block,
.table-wrap {
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 128px;
  padding: 18px;
}

.metric-card span,
.queue-item span,
.plan-card span,
.setting-card p,
.policy-block p {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 12px 0 6px;
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  color: var(--green);
  font-weight: 900;
}

.queue-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.queue-item {
  min-height: 120px;
  padding: 18px;
}

.queue-item svg {
  color: var(--blue);
}

.queue-item strong {
  display: block;
  margin: 12px 0 4px;
  font-size: 32px;
}

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

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

.records-table {
  min-width: 1180px;
}

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

th {
  color: #5f6a67;
  background: #f7faf8;
  font-size: 12px;
  font-weight: 900;
}

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

.status {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status.pending {
  color: #8b5a00;
  background: #fff1cb;
}

.status.pass,
.status.paid,
.status.approved,
.status.completed {
  color: #176241;
  background: #dcf6e8;
}

.status.review,
.status.rejected,
.status.incomplete {
  color: #9b3122;
  background: #fde2dc;
}

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

.table-action {
  min-height: 32px;
  padding: 0 12px;
  color: var(--ink);
  background: #eef3ef;
  font-size: 12px;
}

.table-action.primary {
  background: var(--lime);
}

.record-thumb {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  object-fit: cover;
  background: #edf2ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.record-title,
.record-suggestion {
  display: block;
}

.record-title {
  max-width: 220px;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.35;
}

.record-suggestion {
  max-width: 300px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.plan-card {
  padding: 18px;
}

.plan-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.plan-price {
  display: block;
  margin-top: 14px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
}

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

.setting-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

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

.setting-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.switch {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  position: relative;
  background: #d5ded9;
}

.switch::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 21, 24, 0.18);
}

.switch.is-on {
  background: var(--lime);
}

.switch.is-on::after {
  left: 26px;
}

.switch.is-locked {
  background: #e6e9e7;
}

.policy-block {
  margin-top: 18px;
  padding: 20px;
}

.empty-admin-card {
  min-height: 260px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 32px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.empty-admin-card svg {
  width: 42px;
  height: 42px;
  color: var(--blue);
}

.empty-admin-card strong {
  font-size: 18px;
}

.empty-admin-card span {
  color: var(--muted);
}

.policy-block h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.policy-block p {
  margin: 0;
  line-height: 1.7;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  min-height: 42px;
  display: none;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 21, 24, 0.92);
  font-size: 14px;
  font-weight: 800;
}

.toast.is-visible {
  display: flex;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .side-link {
    justify-content: center;
  }

  .side-link span {
    display: none;
  }

  .metric-grid,
  .plan-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 20px;
  }

  .workspace-topbar,
  .section-head,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .queue-grid,
  .plan-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
