:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-strong: #f0f4ef;
  --ink: #1e2420;
  --muted: #66716b;
  --line: #dfe5df;
  --primary: #16615a;
  --primary-deep: #0e4742;
  --accent: #c45434;
  --amber: #c7831e;
  --green: #2f7d54;
  --red: #b14242;
  --blue: #2d5f9a;
  --shadow: 0 18px 45px rgba(36, 43, 38, 0.1);
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(22, 97, 90, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(22, 97, 90, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  color: #fff;
  background: #123936;
}

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

.brand-mark,
.login-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #f3c95f;
  color: #102e2b;
}

.brand-mark svg,
.login-mark svg,
.icon-button svg,
.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.brand p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.account-panel {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.account-panel strong,
.account-panel span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-panel span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

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

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  text-align: left;
}

.nav-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-button.active,
.nav-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

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

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

.topbar h2,
.login-card h1 {
  margin: 0;
  line-height: 1.16;
}

.topbar h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.topbar p,
.login-card p,
.muted {
  color: var(--muted);
}

.topbar p,
.login-card p {
  margin: 8px 0 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.btn,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 8px;
  font-weight: 700;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.btn {
  padding: 0 14px;
}

.btn:active,
.icon-button:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 18px rgba(22, 97, 90, 0.18);
}

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

.btn-secondary {
  color: var(--ink);
  background: var(--surface-strong);
}

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

.icon-button {
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: var(--surface-strong);
}

.icon-button[title] {
  position: relative;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: 1 / -1;
}

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

.panel {
  padding: 18px;
}

.stat {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.stat-value {
  font-size: 32px;
  font-weight: 800;
}

.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: var(--primary);
}

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

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #47524b;
  font-size: 13px;
  font-weight: 700;
}

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

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 97, 90, 0.12);
}

.auth-form {
  margin-top: 18px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.segmented button {
  min-height: 38px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

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

.notice,
.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  line-height: 1.55;
  font-size: 14px;
}

.notice {
  color: #4c3908;
  background: #fff3cc;
}

.alert {
  color: #823434;
  background: #f9dddd;
}

.notice svg,
.alert svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

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

th {
  color: #59645e;
  font-size: 12px;
  font-weight: 800;
  background: #f8faf7;
}

td {
  font-size: 14px;
}

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-draft {
  color: #5e6470;
  background: #eceff3;
}

.status-admin1 {
  color: #77500f;
  background: #fff1cf;
}

.status-admin2 {
  color: #7a481c;
  background: #fde4d5;
}

.status-approved {
  color: #236344;
  background: #dcf1e6;
}

.status-rejected {
  color: #873232;
  background: #f8dddd;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.timeline-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfb;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 560px) minmax(0, 1fr);
}

.login-card {
  align-self: center;
  margin: 28px;
  padding: 34px;
}

.login-card h1 {
  margin-top: 18px;
  font-size: clamp(30px, 5vw, 46px);
}

.login-art {
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: 48px;
  color: #fff;
  background:
    linear-gradient(rgba(18, 57, 54, 0.82), rgba(18, 57, 54, 0.82)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='960' height='1080' viewBox='0 0 960 1080'%3E%3Crect width='960' height='1080' fill='%23123936'/%3E%3Cg fill='none' stroke='%23f3c95f' stroke-width='3' opacity='.35'%3E%3Cpath d='M90 180h780v620H90z'/%3E%3Cpath d='M160 260h640M160 360h640M160 460h640M160 560h640M160 660h640'/%3E%3Cpath d='M270 180v620M480 180v620M690 180v620'/%3E%3C/g%3E%3Cg fill='%23ffffff' opacity='.16'%3E%3Crect x='210' y='310' width='170' height='50' rx='8'/%3E%3Crect x='510' y='410' width='230' height='50' rx='8'/%3E%3Crect x='180' y='610' width='250' height='50' rx='8'/%3E%3C/g%3E%3Cg fill='%23f3c95f' opacity='.9'%3E%3Ccircle cx='720' cy='300' r='14'/%3E%3Ccircle cx='300' cy='500' r='14'/%3E%3Ccircle cx='610' cy='700' r='14'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.login-art h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1.1;
}

.login-art p {
  max-width: 520px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  line-height: 1.8;
}

.login-users {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.user-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.user-option:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(22, 97, 90, 0.12);
}

.user-option small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.mobile-topbar {
  display: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 8px;
  color: #fff;
  background: #1e2420;
  box-shadow: var(--shadow);
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .main {
    padding: 18px;
  }

  .login-art {
    min-height: 320px;
    order: -1;
  }

  .login-card {
    margin: 18px;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-7,
  .span-8 {
    grid-column: span 6;
  }
}

@media (max-width: 700px) {
  .topbar,
  .section-title,
  .stat-line,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .btn {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: 1 / -1;
  }

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