/* ===================================
   潮顺危固废智慧管家 - 危固废管理系统
   Design System & Main Styles
   =================================== */

/* ---- CSS Variables ---- */
:root {
  /* Primary: Green (环保/工业感) */
  --primary:          oklch(52% 0.18 160);
  --primary-light:    oklch(72% 0.12 160);
  --primary-dark:     oklch(36% 0.14 160);
  --primary-muted:    oklch(94% 0.04 160);
  --primary-border:   oklch(82% 0.08 160);

  /* Neutrals (cool-tinted) */
  --gray-50:   oklch(97% 0.01 250);
  --gray-100:  oklch(94% 0.01 250);
  --gray-200:  oklch(88% 0.01 250);
  --gray-300:  oklch(78% 0.01 250);
  --gray-400:  oklch(64% 0.01 250);
  --gray-500:  oklch(52% 0.01 250);
  --gray-600:  oklch(42% 0.01 250);
  --gray-700:  oklch(32% 0.01 250);
  --gray-800:  oklch(22% 0.01 250);
  --gray-900:  oklch(14% 0.01 250);

  /* Semantic */
  --success:  oklch(58% 0.18 142);
  --warning:  oklch(75% 0.16 65);
  --danger:   oklch(58% 0.22 25);
  --info:     oklch(58% 0.18 230);

  --success-bg: oklch(94% 0.05 142);
  --warning-bg: oklch(96% 0.06 65);
  --danger-bg:  oklch(95% 0.05 25);
  --info-bg:    oklch(94% 0.05 230);

  /* Surfaces */
  --surface-bg:      oklch(97.5% 0.005 250);
  --surface-card:    oklch(100% 0 0);
  --surface-sidebar: oklch(17% 0.015 250);
  --surface-topbar:  oklch(100% 0 0);

  /* Text */
  --text-primary:   oklch(14% 0.01 250);
  --text-secondary: oklch(42% 0.01 250);
  --text-muted:     oklch(64% 0.01 250);
  --text-invert:    oklch(98% 0 0);

  /* Borders */
  --border:        oklch(88% 0.01 250);
  --border-strong: oklch(78% 0.01 250);

  /* Shadows */
  --shadow-sm: 0 1px 3px oklch(14% 0.01 250 / 0.08);
  --shadow:    0 2px 8px oklch(14% 0.01 250 / 0.10);
  --shadow-md: 0 4px 16px oklch(14% 0.01 250 / 0.12);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Radius */
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --transition: 0.18s cubic-bezier(0.25, 0.8, 0.25, 1);

  /* Layout */
  --sidebar-width:  220px;
  --topbar-height:  54px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--surface-bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
ul, ol { list-style: none; }

/* ---- Utility ---- */
.hidden { display: none !important; }
.text-mono { font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace; font-size: 0.85em; }
.small { font-size: 0.8em; }

/* ===================================
   LOGIN PAGE
   =================================== */
.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(28px, 5vw, 72px);
  background: url('../assets/images/login-bg-process.jpg') center / cover no-repeat;
  z-index: 1000;
}

.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
}

.login-bg-shape {
  position: absolute;
  border-radius: 50%;
  background: white;
  opacity: 0.05;
  animation: float 8s ease-in-out infinite;
}

.shape-1 { width: 400px; height: 400px; top: -100px; right: -80px; animation-delay: 0s; }
.shape-2 { width: 250px; height: 250px; bottom: -60px; left: -40px; animation-delay: -3s; }
.shape-3 { width: 180px; height: 180px; top: 40%; left: 20%; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.login-card {
  background: oklch(100% 0 0 / 0.9);
  border: 1px solid oklch(100% 0 0 / 0.52);
  border-radius: 24px;
  padding: 48px 44px;
  width: min(480px, 100%);
  box-shadow: 0 28px 70px oklch(8% 0.03 230 / 0.28), 0 0 0 1px oklch(100% 0 0 / 0.18);
  backdrop-filter: blur(18px);
  position: relative;
  margin-right: 210px;
  animation: slideInRight 0.42s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 38px;
}

.login-logo-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
}

.login-logo-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

.login-logo-text h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.login-logo-text span {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
}

.login-form .form-group {
  margin-bottom: 24px;
}

.login-form label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .input-icon {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  height: 56px;
  padding: 0 18px 0 52px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-size: 1.08rem;
  color: var(--text-primary);
  background: oklch(98% 0.006 250);
  transition: var(--transition);
}

.input-wrap input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px oklch(52% 0.18 160 / 0.12);
}

.btn-login {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  background: var(--primary);
  color: white;
  border-radius: 14px;
  font-size: 1.08rem;
  font-weight: 600;
  margin-top: 10px;
  transition: var(--transition);
  letter-spacing: 0.5px;
}

.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px oklch(52% 0.18 160 / 0.3);
}

.btn-login:active {
  transform: translateY(0);
}

.login-footer {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 28px;
}

/* ===================================
   APP LAYOUT
   =================================== */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-height);
  background: var(--surface-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  flex-shrink: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

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

.brand-logo {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 7px;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.brand-name em {
  font-style: normal;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
  font-size: 0.85em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.topbar-btn:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.user-info:hover {
  background: var(--gray-100);
}

.user-info.open .user-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 130px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: var(--transition);
  z-index: 200;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--gray-50);
  color: var(--text-primary);
}

/* ---- Layout ---- */
.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface-sidebar);
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-md) 0;
  scrollbar-width: thin;
  scrollbar-color: oklch(30% 0.01 250) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: oklch(30% 0.01 250); border-radius: 2px; }

.sidebar-nav {
  padding: 0 10px;
}

.nav-item {
  margin-bottom: 2px;
  border-radius: var(--radius);
  overflow: hidden;
}

.nav-item-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: oklch(75% 0.01 250);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
}

.nav-item-title:hover {
  background: oklch(26% 0.015 250);
  color: oklch(92% 0 0);
}

.nav-item.active > .nav-item-title,
.nav-item-title.active-sub {
  background: var(--primary);
  color: white;
}

.nav-item.active > .nav-item-title .nav-icon,
.nav-item.active > .nav-item-title {
  color: white;
}

.nav-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: inherit;
}

.arrow-icon {
  margin-left: auto;
  transition: transform 0.2s ease;
  color: oklch(55% 0.01 250);
  flex-shrink: 0;
}

.nav-item.open > .nav-item-title > .arrow-icon {
  transform: rotate(180deg);
}

.nav-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  margin-top: 2px;
}

.nav-item.open > .nav-sub {
  max-height: 300px;
}

.nav-sub-item {
  padding: 8px 12px 8px 40px;
  font-size: 0.84rem;
  color: oklch(65% 0.01 250);
  cursor: pointer;
  border-radius: var(--radius);
  margin-bottom: 1px;
  transition: var(--transition);
}

.nav-sub-item:hover {
  background: oklch(26% 0.015 250);
  color: oklch(92% 0 0);
}

.nav-sub-item.active {
  background: oklch(24% 0.04 160);
  color: var(--primary-light);
  font-weight: 500;
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px var(--space-lg);
  background: white;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.breadcrumb > span {
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.breadcrumb > span:hover { color: var(--primary); }

.breadcrumb > span:last-child {
  color: var(--text-primary);
  font-weight: 500;
  cursor: default;
}

.breadcrumb .bc-sep::before {
  content: '/';
  color: var(--gray-300);
}

/* ---- Page Container ---- */
.page-container {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
}

.page {
  display: none;
  animation: fadeIn 0.2s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===================================
   HOME PAGE
   =================================== */
.home-plan-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) 1.4fr;
  gap: var(--space-lg);
  align-items: stretch;
  margin-bottom: var(--space-lg);
  padding: 22px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, oklch(77% 0.13 160 / 0.36), transparent 28%),
    radial-gradient(circle at 82% 8%, oklch(72% 0.16 195 / 0.28), transparent 26%),
    linear-gradient(135deg, oklch(21% 0.05 170) 0%, oklch(30% 0.07 160) 52%, oklch(18% 0.04 210) 100%);
  box-shadow: 0 18px 42px oklch(18% 0.04 190 / 0.18);
}

.home-plan-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, oklch(100% 0 0 / 0.06) 1px, transparent 1px),
    linear-gradient(0deg, oklch(100% 0 0 / 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(90deg, transparent 0%, black 28%, black 100%);
  pointer-events: none;
}

.home-plan-copy,
.home-plan-summary-grid {
  position: relative;
  z-index: 1;
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid oklch(88% 0.08 160 / 0.38);
  border-radius: 999px;
  background: oklch(100% 0 0 / 0.08);
  color: oklch(91% 0.07 160);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.home-plan-copy h2 {
  margin: 16px 0 8px;
  color: white;
  font-size: clamp(1.45rem, 2.6vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.home-plan-copy p {
  max-width: 420px;
  color: oklch(93% 0.02 170 / 0.78);
  font-size: 0.9rem;
  line-height: 1.7;
}

.home-plan-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  gap: 10px;
}

.home-summary-card {
  min-height: 112px;
  padding: 14px;
  border: 1px solid oklch(100% 0 0 / 0.16);
  border-radius: 16px;
  background: oklch(100% 0 0 / 0.1);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.home-summary-card span {
  color: oklch(94% 0.02 170 / 0.72);
  font-size: 0.78rem;
  font-weight: 500;
}

.home-summary-card strong {
  color: white;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.home-summary-card em {
  color: oklch(92% 0.06 160);
  font-size: 0.76rem;
  font-style: normal;
}

.home-summary-card.emphasis {
  background: linear-gradient(145deg, oklch(78% 0.14 160 / 0.24), oklch(100% 0 0 / 0.1));
  border-color: oklch(83% 0.11 160 / 0.4);
}

.enterprise-info-card {
  margin: var(--space-lg) 0;
  padding: 18px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.enterprise-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.enterprise-info-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.enterprise-info-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.enterprise-info-header p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.enterprise-info-status {
  flex: none;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary-muted);
  color: var(--primary-dark);
  font-size: 0.76rem;
  white-space: nowrap;
}

.enterprise-info-status.is-error {
  background: oklch(96% 0.03 25);
  color: var(--danger);
}

.enterprise-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

.enterprise-info-item {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface-card);
}

.enterprise-info-label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.enterprise-info-value {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}

.enterprise-info-empty {
  grid-column: 1 / -1;
  padding: var(--space-lg);
  background: var(--surface-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.home-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.home-section-heading h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--text-primary);
}

.home-section-heading p,
.home-section-heading span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.waste-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.waste-plan-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.waste-plan-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.waste-plan-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.waste-plan-card.is-warning::before {
  background: linear-gradient(90deg, var(--warning), oklch(82% 0.13 78));
}

.waste-plan-card.is-danger::before {
  background: linear-gradient(90deg, var(--danger), oklch(70% 0.18 35));
}

.waste-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 14px;
}

.waste-plan-code {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary-muted);
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.waste-plan-name {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 650;
}

.waste-plan-sub {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.waste-plan-rate {
  min-width: 62px;
  text-align: right;
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 750;
}

.waste-plan-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.waste-plan-metric {
  padding: 10px;
  border-radius: var(--radius);
  background: var(--gray-50);
}

.waste-plan-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.waste-plan-metric strong {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
}

.waste-plan-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--gray-100);
  overflow: hidden;
}

.waste-plan-progress-bar {
  height: 100%;
  min-width: 2px;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.waste-plan-card.is-warning .waste-plan-rate {
  color: oklch(55% 0.14 65);
}

.waste-plan-card.is-warning .waste-plan-progress-bar {
  background: linear-gradient(90deg, var(--warning), oklch(82% 0.13 78));
}

.waste-plan-card.is-danger .waste-plan-rate {
  color: var(--danger);
}

.waste-plan-card.is-danger .waste-plan-progress-bar {
  background: linear-gradient(90deg, var(--danger), oklch(70% 0.18 35));
}

.waste-plan-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.home-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-card.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: transparent;
}

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-md);
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 500;
}

.stat-icon-wrap {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.7);
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
}

.stat-number em {
  font-style: normal;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.8;
  margin-left: 3px;
}

.waste-type-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.waste-type-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-border);
  transform: translateY(-1px);
}

.waste-card-header {
  background: var(--primary-muted);
  padding: 10px var(--space-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--primary-border);
}

.waste-card-body {
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wc-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wc-value {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.wc-value b {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}

.storage-empty {
  padding: var(--space-lg);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===================================
   PAGE HEADERS
   =================================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.page-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ===================================
   CARD
   =================================== */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ===================================
   FILTER BAR
   =================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: var(--gray-50);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-group select,
.filter-group input.filter-input {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-primary);
  background: white;
  transition: var(--transition);
  min-width: 120px;
}

.filter-group select:focus,
.filter-group input.filter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px oklch(52% 0.18 160 / 0.12);
}

.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-range input {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-primary);
  background: white;
  width: 130px;
  transition: var(--transition);
}

.date-range input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px oklch(52% 0.18 160 / 0.12);
}

.date-range span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.filter-btns {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 0;
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px oklch(52% 0.18 160 / 0.3);
}

.btn-default {
  background: white;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-default:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--text-primary);
}

/* Action buttons in table */
.btn-action {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: var(--primary-muted);
  border: 1px solid var(--primary-border);
  transition: var(--transition);
  white-space: nowrap;
}

.btn-action:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-action-primary {
  color: var(--info);
  background: var(--info-bg);
  border-color: oklch(82% 0.06 230);
}

.btn-action-primary:hover {
  background: var(--info);
  color: white;
}

.btn-action-danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: oklch(84% 0.06 25);
}

.btn-action-danger:hover {
  background: var(--danger);
  color: white;
}

/* ===================================
   TABLE
   =================================== */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table thead {
  background: var(--gray-50);
  border-bottom: 1.5px solid var(--border);
}

.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

/* 企业用户列表：列标题、数据字段及操作按钮统一字号 */
#enterpriseUserTable th,
#enterpriseUserTable td,
#enterpriseUserTable .btn-action {
  font-size: 14px;
}

.data-table .check-col {
  width: 36px;
  padding-left: 16px;
}

.data-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

.action-cell {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* ===================================
   BADGES
   =================================== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: oklch(55% 0.14 65); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-gray    { background: var(--gray-100);   color: var(--gray-600); }

/* ===================================
   EMPTY STATE
   =================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  gap: 12px;
}

.empty-state svg {
  opacity: 0.3;
}

.empty-state p {
  font-size: 0.875rem;
}

/* ===================================
   TABLE FOOTER / PAGINATION
   =================================== */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gray-50);
  border-top: 1px solid var(--border);
}

.table-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  background: white;
}

.page-btn:hover:not([disabled]) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-muted);
}

.page-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-num {
  min-width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  background: white;
  transition: var(--transition);
}

.page-num.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

.page-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0 4px;
}

.page-size-select select {
  padding: 4px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: white;
}

/* ===================================
   MONTHLY REPORT
   =================================== */
.monthly-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.monthly-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.msc-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msc-icon.produce  { background: var(--primary-muted);  color: var(--primary); }
.msc-icon.inbound  { background: var(--info-bg);         color: var(--info); }
.msc-icon.outbound { background: var(--warning-bg);      color: oklch(55% 0.14 65); }
.msc-icon.balance  { background: var(--success-bg);      color: var(--success); }

.msc-info { display: flex; flex-direction: column; gap: 3px; }

.msc-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.msc-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-placeholder {
  padding: var(--space-lg);
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.chart-area {
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: white;
}

.chart-labels span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===================================
   FLOAT SERVICE BUTTON
   =================================== */
.float-service {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px oklch(52% 0.18 160 / 0.4);
  transition: var(--transition);
  z-index: 500;
}

.float-service:hover {
  background: var(--primary-dark);
  transform: scale(1.08);
  box-shadow: 0 6px 20px oklch(52% 0.18 160 / 0.5);
}

/* ===================================
   SCROLLBAR
   =================================== */
.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
.main-content::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1024px) {
  :root { --sidebar-width: 180px; }
  .home-plan-hero { grid-template-columns: 1fr; }
  .home-plan-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .monthly-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .login-page {
    justify-content: center;
    padding: 20px;
    background-position: 58% center;
  }
  .login-card {
    width: 100%;
    padding: 36px 24px;
    margin-right: 0;
  }
  .login-logo-text h1 { font-size: 1.25rem; }
  .input-wrap input,
  .btn-login {
    height: 52px;
    font-size: 1rem;
  }
  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: -100%;
    height: calc(100vh - var(--topbar-height));
    z-index: 200;
    transition: left 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  }
  .sidebar.open { left: 0; }
  .home-stats-row { grid-template-columns: 1fr; }
  .home-plan-hero { padding: 18px; }
  .home-plan-summary-grid { grid-template-columns: 1fr 1fr; }
  .enterprise-info-header { flex-direction: column; }
  .home-section-heading { align-items: flex-start; flex-direction: column; }
  .waste-plan-grid { grid-template-columns: 1fr; }
  .waste-plan-body { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .monthly-stats { grid-template-columns: 1fr 1fr; }
}
