/* AgriChain MB1 风格 - 管理后台 */

/* ═══════════════════════════════════════════════════════════
   MB1 DESIGN TOKENS
═══════════════════════════════════════════════════════════ */
:root {
  /* Surfaces - 层级暗色系统 */
  --mb-surface-0: #09090b;
  --mb-surface-1: #111113;
  --mb-surface-2: #18181b;
  --mb-surface-3: #27272a;

  /* Accent - 蓝紫色系 */
  --mb-accent: #818cf8;
  --mb-accent-secondary: #a78bfa;
  --mb-accent-gradient: linear-gradient(135deg, #60a5fa 0%, #818cf8 50%, #c084fc 100%);
  --mb-accent-rgb: 129, 140, 248;

  /* 文字 */
  --mb-text-primary: #fafafa;
  --mb-text-secondary: #a1a1aa;
  --mb-text-muted: #52525b;

  /* 边框 */
  --mb-border-subtle: rgba(255,255,255,0.06);
  --mb-border-default: rgba(255,255,255,0.1);

  /* 圆角 */
  --mb-radius: 10px;

  /* 阴影 */
  --mb-shadow: 0 4px 16px rgba(0,0,0,0.3);
  --mb-shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

/* ═══════════════════════════════════════════════════════════
   BASE STYLES
═══════════════════════════════════════════════════════════ */
.mb1-body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  background: var(--mb-surface-0);
  color: var(--mb-text-primary);
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════
   ADMIN LAYOUT
═══════════════════════════════════════════════════════════ */
.mb1-admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.mb1-sidebar {
  width: 260px;
  background: var(--mb-surface-1);
  border-right: 1px solid var(--mb-border-subtle);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.mb1-logo {
  padding: 24px;
  border-bottom: 1px solid var(--mb-border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.mb1-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--mb-accent-gradient);
  border-radius: var(--mb-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

.mb1-logo-text {
  font-size: 18px;
  font-weight: 600;
  background: var(--mb-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mb1-menu {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.mb1-menu-section {
  margin-bottom: 24px;
}

.mb1-menu-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--mb-text-muted);
  padding: 8px 12px;
}

.mb1-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--mb-text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-radius: var(--mb-radius);
  transition: all 0.2s;
  margin-bottom: 4px;
}

.mb1-menu-item:hover {
  background: var(--mb-surface-2);
  color: var(--mb-text-primary);
}

.mb1-menu-item.active {
  background: linear-gradient(135deg, rgba(129,140,248,0.2), rgba(129,140,248,0.1));
  color: var(--mb-accent);
}

.mb1-menu-item i {
  font-size: 18px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mb1-sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--mb-border-subtle);
}

.mb1-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mb1-user-avatar {
  width: 40px;
  height: 40px;
  background: var(--mb-accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}

.mb1-user-name {
  font-size: 14px;
  font-weight: 500;
}

.mb1-user-role {
  font-size: 12px;
  color: var(--mb-text-muted);
}

/* 主内容区 */
.mb1-main {
  flex: 1;
  margin-left: 260px;
  padding: 24px 32px;
  background: var(--mb-surface-0);
  min-height: 100vh;
}

.mb1-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.mb1-page-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

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

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.mb1-btn {
  position: relative;
  border: none;
  border-radius: var(--mb-radius);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
}

.mb1-btn-accent {
  background: var(--mb-accent-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(129,140,248,0.3);
}

.mb1-btn-accent:hover {
  box-shadow: 0 6px 24px rgba(129,140,248,0.4);
  transform: translateY(-1px);
}

.mb1-btn-outline {
  position: relative;
  background: var(--mb-surface-1);
  color: var(--mb-text-primary);
}

.mb1-btn-outline::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--mb-radius);
  padding: 1px;
  background: var(--mb-accent-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.mb1-btn-outline:hover {
  background: var(--mb-surface-2);
  box-shadow: 0 0 16px rgba(129,140,248,0.2);
}

.mb1-btn-ghost {
  background: transparent;
  color: var(--mb-text-secondary);
}

.mb1-btn-ghost:hover {
  color: var(--mb-accent);
  background: var(--mb-surface-1);
}

/* ═══════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════ */
.mb1-card {
  background: var(--mb-surface-1);
  border: 1px solid var(--mb-border-subtle);
  border-radius: var(--mb-radius);
  padding: 24px;
  transition: all 0.3s;
}

.mb1-card:hover {
  border-color: var(--mb-border-default);
}

.mb1-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.mb1-card-title {
  font-size: 16px;
  font-weight: 600;
  background: var(--mb-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 统计卡片 */
.mb1-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.mb1-stat-card {
  background: var(--mb-surface-1);
  border: 1px solid var(--mb-border-subtle);
  border-radius: var(--mb-radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.mb1-stat-card:hover {
  border-color: var(--mb-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.mb1-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: var(--mb-accent-gradient);
  opacity: 0.05;
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.mb1-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--mb-radius);
  background: linear-gradient(135deg, rgba(129,140,248,0.2), rgba(129,140,248,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.mb1-stat-label {
  font-size: 13px;
  color: var(--mb-text-muted);
  margin-bottom: 8px;
}

.mb1-stat-value {
  font-size: 28px;
  font-weight: 700;
  background: var(--mb-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mb1-stat-change {
  font-size: 12px;
  color: #34d399;
  margin-top: 4px;
}

.mb1-stat-change.negative {
  color: #f87171;
}

/* ═══════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════ */
.mb1-table-wrapper {
  background: var(--mb-surface-1);
  border: 1px solid var(--mb-border-subtle);
  border-radius: var(--mb-radius);
  overflow: hidden;
}

.mb1-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--mb-border-subtle);
}

.mb1-table-title {
  font-size: 15px;
  font-weight: 600;
}

.mb1-table {
  width: 100%;
  border-collapse: collapse;
}

.mb1-table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--mb-border-subtle);
  background: var(--mb-surface-2);
}

.mb1-table td {
  padding: 16px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--mb-border-subtle);
}

.mb1-table tr:last-child td {
  border-bottom: none;
}

.mb1-table tr:hover td {
  background: var(--mb-surface-2);
}

/* ═══════════════════════════════════════════════════════════
   TAGS / STATUS
═══════════════════════════════════════════════════════════ */
.mb1-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
}

.mb1-tag-success {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.mb1-tag-warning {
  background: rgba(251, 188, 5, 0.15);
  color: #fbbf24;
}

.mb1-tag-danger {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.mb1-tag-info {
  background: rgba(129, 140, 248, 0.15);
  color: var(--mb-accent);
}

/* ═══════════════════════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════════════════════ */
.mb1-form-group {
  margin-bottom: 20px;
}

.mb1-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--mb-text-secondary);
  margin-bottom: 8px;
}

.mb1-form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--mb-surface-2);
  border: 1px solid var(--mb-border-default);
  border-radius: var(--mb-radius);
  font-size: 14px;
  color: var(--mb-text-primary);
  transition: all 0.2s;
}

.mb1-form-input:focus {
  outline: none;
  border-color: var(--mb-accent);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.15);
}

.mb1-form-input::placeholder {
  color: var(--mb-text-muted);
}

/* ═══════════════════════════════════════════════════════════
   CHIPS
═══════════════════════════════════════════════════════════ */
.mb1-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mb1-chip {
  position: relative;
  padding: 6px 14px;
  border-radius: var(--mb-radius);
  background: var(--mb-surface-2);
  font-size: 12px;
  color: var(--mb-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.mb1-chip:hover {
  background: var(--mb-surface-3);
  color: var(--mb-text-primary);
}

.mb1-chip.selected {
  background: linear-gradient(135deg, rgba(129,140,248,0.2), rgba(129,140,248,0.15));
  color: var(--mb-accent);
}

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════════════════ */
.mb1-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mb-surface-0);
  position: relative;
  overflow: hidden;
}

.mb1-login-page::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(129,140,248,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.mb1-login-box {
  width: 420px;
  background: var(--mb-surface-1);
  border: 1px solid var(--mb-border-subtle);
  border-radius: 16px;
  padding: 48px 40px;
  position: relative;
  z-index: 1;
}

.mb1-login-logo {
  text-align: center;
  margin-bottom: 40px;
}

.mb1-login-logo-icon {
  width: 64px;
  height: 64px;
  background: var(--mb-accent-gradient);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  margin: 0 auto 20px;
}

.mb1-login-title {
  font-size: 24px;
  font-weight: 600;
  background: var(--mb-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.mb1-login-subtitle {
  font-size: 14px;
  color: var(--mb-text-muted);
}

.mb1-login-form {
  margin-top: 32px;
}

.mb1-login-btn {
  width: 100%;
  padding: 14px;
  background: var(--mb-accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--mb-radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(129,140,248,0.35);
  transition: all 0.2s;
  margin-top: 24px;
}

.mb1-login-btn:hover {
  box-shadow: 0 6px 28px rgba(129,140,248,0.45);
  transform: translateY(-1px);
}

.mb1-login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--mb-text-muted);
}

/* ═══════════════════════════════════════════════════════════
   ACTION BUTTONS
═══════════════════════════════════════════════════════════ */
.mb1-action-btns {
  display: flex;
  gap: 8px;
}

.mb1-action-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.mb1-action-btn-primary {
  background: rgba(129,140,248,0.15);
  color: var(--mb-accent);
}

.mb1-action-btn-primary:hover {
  background: rgba(129,140,248,0.25);
}

.mb1-action-btn-danger {
  background: rgba(248,113,113,0.15);
  color: #f87171;
}

.mb1-action-btn-danger:hover {
  background: rgba(248,113,113,0.25);
}

/* ═══════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════ */
.mb1-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.mb1-badge-success { background: #34d399; }
.mb1-badge-warning { background: #fbbf24; }
.mb1-badge-danger { background: #f87171; }
.mb1-badge-info { background: var(--mb-accent); }

/* ═══════════════════════════════════════════════════════════
   BALANCE CARD
═══════════════════════════════════════════════════════════ */
.mb1-balance-card {
  background: var(--mb-accent-gradient);
  border-radius: var(--mb-radius);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.mb1-balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.mb1-balance-label {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  position: relative;
  z-index: 1;
}

.mb1-balance-value {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 1;
}

.mb1-balance-action {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}

.mb1-balance-action:hover {
  background: rgba(255,255,255,0.3);
}

/* ═══════════════════════════════════════════════════════════
   GRADIENT TEXT
═══════════════════════════════════════════════════════════ */
.mb1-gradient-text {
  background: var(--mb-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ═══════════════════════════════════════════════════════════
   LINK
═══════════════════════════════════════════════════════════ */
.mb1-link {
  color: var(--mb-accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.mb1-link:hover {
  color: var(--mb-accent-secondary);
}

/* ═══════════════════════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════════════════════ */
.mb1-progress {
  height: 8px;
  background: var(--mb-surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.mb1-progress-fill {
  height: 100%;
  background: var(--mb-accent-gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════
   SEARCH BAR
═══════════════════════════════════════════════════════════ */
.mb1-search {
  display: flex;
  align-items: center;
  background: var(--mb-surface-2);
  border: 1px solid var(--mb-border-default);
  border-radius: var(--mb-radius);
  padding: 10px 16px;
  gap: 10px;
}

.mb1-search i {
  color: var(--mb-text-muted);
  font-size: 18px;
}

.mb1-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--mb-text-primary);
}

.mb1-search input::placeholder {
  color: var(--mb-text-muted);
}

/* ═══════════════════════════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════════════════════════ */
.mb1-filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mb1-filter-item {
  padding: 8px 16px;
  background: var(--mb-surface-1);
  border: 1px solid var(--mb-border-subtle);
  border-radius: 20px;
  font-size: 13px;
  color: var(--mb-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.mb1-filter-item:hover {
  border-color: var(--mb-accent);
  color: var(--mb-accent);
}

.mb1-filter-item.active {
  background: rgba(129,140,248,0.15);
  border-color: var(--mb-accent);
  color: var(--mb-accent);
}

/* ═══════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════ */
.mb1-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 20px;
}

.mb1-page-item {
  min-width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  border-radius: var(--mb-radius);
  font-size: 13px;
  cursor: pointer;
  background: var(--mb-surface-1);
  border: 1px solid var(--mb-border-subtle);
  color: var(--mb-text-secondary);
  transition: all 0.2s;
}

.mb1-page-item:hover {
  border-color: var(--mb-accent);
  color: var(--mb-accent);
}

.mb1-page-item.active {
  background: var(--mb-accent-gradient);
  color: #fff;
  border-color: transparent;
}

/* ═══════════════════════════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════════════════════════ */
.mb1-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--mb-text-primary);
}

/* ═══════════════════════════════════════════════════════════
   AVATAR
═══════════════════════════════════════════════════════════ */
.mb1-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--mb-accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}

.mb1-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.mb1-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 24px;
}
