* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #FBC7D4;
  --primary-dark: #E8A5B8;
  --primary-light: #FFF0F5;
  --accent: #FFE4A8;
  --success: #22c55e;
  --warning: #d97706;
  --danger: #ef4444;
  --text-main: #6b5a4a;
  --text-sub: #c9b8a8;
  --bg: #FFF8E7;
  --card-bg: #ffffff;
  --border: #FDEEF4;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #FFF8E7 0%, #FDEEF4 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.navbar {
  background: linear-gradient(135deg, #FFE4A8 0%, #FBC7D4 100%);
  color: #6b5a4a;
  padding: 0 32px;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 20px rgba(251, 199, 212, 0.4);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .logo {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}
.navbar .logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.navbar .right {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
}
.navbar .time { color: #6b5a4a; opacity: 0.75; }
.navbar .logout {
  padding: 8px 18px;
  background: rgba(255,255,255,0.5);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  color: #6b5a4a;
  font-weight: 500;
}
.navbar .logout:hover { background: rgba(255,255,255,0.75); }

.container {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 220px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
}
.menu-item {
  padding: 13px 24px;
  margin: 2px 12px;
  font-size: 14px;
  color: #8a7a6a;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
}
.menu-item:hover {
  background: #FFF0F5;
  color: #d97a92;
}
.menu-item.active {
  background: linear-gradient(135deg, #FFE4A8 0%, #FBC7D4 100%);
  color: #6b5a4a;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(251, 199, 212, 0.5);
}
.menu-icon { font-size: 18px; }
.menu-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.menu-item.active .menu-badge {
  background: rgba(255,255,255,0.7);
  color: #d97a92;
}

.main {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
}
.page-header { margin-bottom: 24px; }
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #6b5a4a;
  margin-bottom: 4px;
}
.page-sub {
  font-size: 13px;
  color: #c9b8a8;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 4px 20px rgba(251, 199, 212, 0.25);
  border: 1px solid var(--border);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(251, 199, 212, 0.4);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, #FFE4A8, #FBC7D4);
  border-radius: 4px 0 0 4px;
}
.stat-card.green::before { background: linear-gradient(180deg, #86efac, #22c55e); }
.stat-card.orange::before { background: linear-gradient(180deg, #fcd34d, #d97706); }
.stat-card.red::before { background: linear-gradient(180deg, #fca5a5, #ef4444); }

.stat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.stat-label {
  font-size: 13px;
  color: #c9b8a8;
  font-weight: 500;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #FFF8E7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.stat-card.green .stat-icon { background: #dcfce7; }
.stat-card.orange .stat-icon { background: #fef3c7; }
.stat-card.red .stat-icon { background: #fee2e2; }

.stat-num {
  font-size: 32px;
  font-weight: 700;
  color: #6b5a4a;
  line-height: 1.1;
}
.stat-num.green { color: var(--success); }
.stat-num.orange { color: var(--warning); }
.stat-num.red { color: var(--danger); }
.stat-unit {
  font-size: 13px;
  color: #c9b8a8;
  margin-left: 4px;
  font-weight: 400;
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(251, 199, 212, 0.25);
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: #6b5a4a;
}
.chart-sub {
  font-size: 12px;
  color: #c9b8a8;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 200px;
  gap: 12px;
  padding-top: 20px;
}
.bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}
.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: #d97a92;
}
.bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(180deg, #FFE4A8 0%, #FBC7D4 100%);
  border-radius: 8px 8px 0 0;
  transition: all 0.3s;
  min-height: 4px;
}
.bar-wrap:hover .bar {
  background: linear-gradient(180deg, #FFD88A 0%, #F8B5C7 100%);
}
.bar-label {
  font-size: 11px;
  color: #c9b8a8;
  white-space: nowrap;
}

.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
}
.donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.donut-inner {
  width: 110px;
  height: 110px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 8px rgba(251, 199, 212, 0.2);
}
.donut-num {
  font-size: 28px;
  font-weight: 700;
  color: #6b5a4a;
  line-height: 1;
}
.donut-label {
  font-size: 11px;
  color: #c9b8a8;
  margin-top: 4px;
}

.table-wrap {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(251, 199, 212, 0.25);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 14px 18px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
th {
  background: #FFF8E7;
  color: #8a7a6a;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: #FFF8E7; }

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.tag.pass { background: #d1fae5; color: #059669; }
.tag.reject { background: #fee2e2; color: #dc2626; }
.tag.pending { background: #fef3c7; color: #d97706; }
.tag.black { background: #fee2e2; color: #dc2626; }
.tag.normal { background: #d1fae5; color: #059669; }

.btn {
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.btn-pass { background: var(--success); color: #fff; }
.btn-pass:hover { background: #059669; }
.btn-reject { background: var(--danger); color: #fff; }
.btn-reject:hover { background: #dc2626; }
.btn-black { background: #8a7a6a; color: #fff; }
.btn-black:hover { background: #6b5a4a; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(251, 199, 212, 0.25);
  transition: all 0.25s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(251, 199, 212, 0.4);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #6b5a4a;
}
.card-score {
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
}
.card-row {
  font-size: 13px;
  color: #8a7a6a;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
}
.card-row .label { color: #c9b8a8; min-width: 60px; }
.card-row .value { color: #6b5a4a; flex: 1; word-break: break-all; }
.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin: 12px 0;
  cursor: zoom-in;
  border: 1px solid var(--border);
}
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.card-actions .btn { flex: 1; padding: 10px; }

.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.search-bar input {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  background: #fff;
  color: #6b5a4a;
}
.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(251, 199, 212, 0.25);
}
.search-bar button {
  padding: 12px 28px;
  background: linear-gradient(135deg, #FFE4A8 0%, #FBC7D4 100%);
  color: #6b5a4a;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(251, 199, 212, 0.5);
}
.search-bar button:hover {
  box-shadow: 0 6px 20px rgba(251, 199, 212, 0.7);
  transform: translateY(-1px);
}

.empty {
  text-align: center;
  padding: 80px 20px;
  color: #c9b8a8;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(251, 199, 212, 0.25);
}
.empty-icon { font-size: 60px; margin-bottom: 16px; opacity: 0.6; }
.empty-text { font-size: 14px; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.pagination button {
  padding: 9px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #6b5a4a;
  transition: all 0.2s;
}
.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: #d97a92;
  background: #FFF8E7;
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination .page-info {
  font-size: 13px;
  color: #c9b8a8;
  padding: 0 8px;
}

.login-page {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #FFF8E7 0%, #FDEEF4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: linear-gradient(135deg, #FFE4A8, #FBC7D4);
  opacity: 0.4;
  border-radius: 50%;
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -100px;
  width: 500px; height: 500px;
  background: linear-gradient(135deg, #FBC7D4, #FFE4A8);
  opacity: 0.35;
  border-radius: 50%;
}
.login-box {
  background: #fff;
  border-radius: 24px;
  padding: 56px 48px;
  width: 420px;
  box-shadow: 0 24px 80px rgba(251, 199, 212, 0.5);
  position: relative;
  z-index: 1;
}
.login-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #FFE4A8, #FBC7D4);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(251, 199, 212, 0.6);
}
.login-box h2 {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #6b5a4a;
  margin-bottom: 6px;
}
.login-box .sub {
  text-align: center;
  font-size: 13px;
  color: #c9b8a8;
  margin-bottom: 36px;
}
.login-box input {
  width: 100%;
  padding: 15px 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  transition: all 0.2s;
  background: #FFFAF0;
  color: #6b5a4a;
}
.login-box input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(251, 199, 212, 0.25);
}
.login-box .btn-login {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #FFE4A8 0%, #FBC7D4 100%);
  color: #6b5a4a;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(251, 199, 212, 0.6);
  letter-spacing: 2px;
}
.login-box .btn-login:hover {
  box-shadow: 0 8px 28px rgba(251, 199, 212, 0.8);
  transform: translateY(-1px);
}
.login-box .error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
  min-height: 18px;
}

.toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  padding: 14px 28px;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  z-index: 99999;
  transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 8px 28px rgba(251, 199, 212, 0.5);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(107, 90, 74, 0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.modal.show { display: flex; }
.modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}