* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f7f5;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #e7f8ee 0%, #f7fff9 48%, #e8f4ff 100%);
}

.login-card {
  width: 380px;
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 18px 50px rgba(16, 185, 129, 0.16);
}

.login-card h1 {
  margin: 0 0 8px;
  color: #059669;
}

.login-card p {
  margin: 0 0 24px;
  color: #6b7280;
}

label {
  display: block;
  margin-bottom: 14px;
  color: #374151;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.app-view {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 220px;
  min-height: 100vh;
  padding: 22px;
  background: #0f172a;
  color: #fff;
  position: sticky;
  top: 0;
}

.brand {
  margin-bottom: 24px;
}

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

.brand span {
  margin-top: 6px;
  color: #a7f3d0;
  font-size: 13px;
}

.nav-btn,
.logout-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  text-align: left;
  color: #d1d5db;
  background: transparent;
}

.nav-btn.active,
.nav-btn:hover {
  color: #fff;
  background: #059669;
}

.logout-btn {
  margin-top: 24px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
}

.main {
  flex: 1;
  padding: 28px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head h2 {
  margin: 0 0 6px;
}

.page-head p {
  margin: 0;
  color: #6b7280;
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  color: #fff;
  background: #10b981;
}

.secondary-btn {
  color: #065f46;
  background: #d1fae5;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.card span {
  color: #6b7280;
  font-size: 13px;
}

.card strong {
  display: block;
  margin-top: 8px;
  color: #059669;
  font-size: 28px;
}

.toolbar,
.receive-panel {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar input,
.toolbar select,
.receive-panel input {
  margin-top: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 20px;
}

.table,
.detail-card,
.form-card {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f7;
}

.row:last-child {
  border-bottom: 0;
}

.row-title {
  font-weight: 700;
}

.row-meta {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  color: #065f46;
  background: #d1fae5;
  font-size: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.actions button {
  border: 0;
  border-radius: 10px;
  padding: 7px 10px;
  color: #065f46;
  background: #ecfdf5;
}

.detail-card h4 {
  margin: 0 0 12px;
}

.detail-line {
  margin: 8px 0;
  color: #4b5563;
}

.detail-line strong {
  color: #111827;
}

.inline-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
}

.muted {
  color: #6b7280;
}

.error-text {
  min-height: 20px;
  margin-top: 12px;
  color: #dc2626;
  font-size: 14px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 360px;
  border-radius: 14px;
  padding: 14px 18px;
  color: #fff;
  background: #111827;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}

@media (max-width: 980px) {
  .app-view {
    display: block;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    position: static;
  }

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

  .toolbar,
  .receive-panel {
    display: grid;
  }
}
