:root {
  color-scheme: light;
  --ink: #1d2733;
  --muted: #687385;
  --line: #dde3ea;
  --panel: #ffffff;
  --soft: #f4f7fa;
  --mist: #edf5f4;
  --rose: #f7e8e2;
  --sky: #e8f2fb;
  --green: #1f7a5c;
  --green-strong: #126247;
  --coral: #c94f3d;
  --gold: #a36d00;
  --blue: #2767a8;
  --shadow: 0 18px 55px rgba(29, 39, 51, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 8%, rgba(31, 122, 92, 0.16), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(201, 79, 61, 0.13), transparent 26%),
    linear-gradient(180deg, #eef4f6 0%, #f8fafb 42%, #ffffff 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 28px) 32px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), #2d8d9f);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(31, 122, 92, 0.28);
}

.brand h1 {
  margin: 0;
  font-size: clamp(20px, 4vw, 28px);
  letter-spacing: 0;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 440px);
  align-items: center;
  gap: clamp(18px, 4vw, 54px);
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.login-hero {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(237, 245, 244, 0.72)),
    repeating-linear-gradient(90deg, rgba(31, 122, 92, 0.05) 0 1px, transparent 1px 22px);
  box-shadow: var(--shadow);
}

.login-brand h1 {
  font-size: clamp(24px, 4vw, 34px);
}

.hero-copy {
  max-width: 620px;
}

.hero-copy h2 {
  margin: 0;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 18px 0 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

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

.hero-stats article {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(221, 227, 234, 0.85);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.hero-stats strong {
  display: block;
  font-size: 24px;
}

.hero-stats span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.login-panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  margin-bottom: 18px;
}

.auth-switch button {
  min-height: 40px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.auth-switch button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 8px 20px rgba(29, 39, 51, 0.08);
  font-weight: 800;
}

.auth-title {
  margin-bottom: 12px;
}

.auth-form {
  gap: 12px;
}

.text-btn {
  min-height: 34px;
  padding: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
  text-align: center;
}

.demo-accounts {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(29, 39, 51, 0.06);
}

.panel {
  padding: 16px;
  backdrop-filter: blur(12px);
}

.card {
  padding: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 18px;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
}

.tab {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
}

.tab.active {
  color: #fff;
  border-color: var(--green);
  background: linear-gradient(135deg, var(--green), #2d8d9f);
  box-shadow: 0 12px 24px rgba(31, 122, 92, 0.18);
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ink), #344455);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(135deg, var(--green), #2d8d9f);
  box-shadow: 0 12px 24px rgba(31, 122, 92, 0.18);
}

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

.btn.light {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.warn {
  background: var(--coral);
}

.btn.gold {
  background: var(--gold);
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 78px;
}

.metric {
  min-height: 108px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 250, 0.96)),
    linear-gradient(135deg, var(--sky), var(--rose));
}

.metric .label {
  color: var(--muted);
  font-size: 13px;
}

.metric .value {
  font-size: 26px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.metric .sub {
  color: var(--muted);
  font-size: 12px;
}

.salary-total {
  background:
    linear-gradient(135deg, rgba(228, 242, 237, 0.95), rgba(232, 242, 251, 0.95));
  border-color: #c9dfd9;
}

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

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

.salary-breakdown-list {
  display: grid;
  gap: 8px;
}

.salary-line {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.salary-line span {
  color: var(--muted);
}

.salary-line strong {
  text-align: right;
  white-space: nowrap;
}

.assignment-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.assignment-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}

.assignment-segments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.assignment-segment {
  display: grid;
  gap: 3px;
  padding: 9px;
  border-radius: 8px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 13px;
}

.assignment-segment strong {
  color: var(--ink);
}

.stacked-cell {
  display: grid;
  gap: 4px;
}

.stacked-cell span {
  color: var(--muted);
  font-size: 13px;
}

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

th {
  color: var(--muted);
  font-weight: 700;
  background: #f8fafb;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pill.green {
  color: var(--green);
  background: #e4f2ed;
}

.pill.gold {
  color: var(--gold);
  background: #fff2d6;
}

.pill.red {
  color: var(--coral);
  background: #fde9e5;
}

.pill.role-manager {
  color: #0f766e;
  background: #ccfbf1;
}

.pill.role-employee {
  color: #2563eb;
  background: #dbeafe;
}

.pill.role-admin {
  color: #7c3aed;
  background: #ede9fe;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  background: var(--soft);
  border-radius: 8px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(21, 30, 40, 0.42);
}

.modal {
  width: min(560px, 100%);
  max-height: min(720px, 92vh);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  min-width: min(320px, calc(100vw - 28px));
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  text-align: center;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hide {
  display: none !important;
}

@media (max-width: 860px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: auto;
    gap: 34px;
  }

  .hero-copy h2 {
    font-size: clamp(31px, 10vw, 48px);
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .split,
  .filters {
    grid-template-columns: 1fr;
  }

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

  .user-chip {
    width: 100%;
    justify-content: space-between;
  }

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

  .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .login-panel,
  .panel,
  .card {
    padding: 14px;
  }

  .metric .value {
    font-size: 22px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .salary-line {
    padding: 9px 10px;
  }
}
