:root {
  font-family: Inter, "Microsoft YaHei", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.hidden {
  display: none !important;
}
button,
input,
select {
  font: inherit;
}
button {
  border: 0;
  border-radius: 8px;
  background: #1358d5;
  color: white;
  padding: 10px 16px;
  cursor: pointer;
}
button:hover {
  filter: brightness(0.96);
}
button.secondary {
  background: #edf3ff;
  color: #164dab;
  border: 1px solid #cbdaf8;
}
.ghost,
.link {
  background: transparent;
  color: #52627a;
  padding: 7px 10px;
}
.link {
  color: #1358d5;
  padding: 4px 0;
}
.full {
  width: 100%;
  margin-bottom: 12px;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 10%, #d9eaff, transparent 35%),
    linear-gradient(135deg, #f7faff, #e9f1ff);
}
.login-card {
  width: min(420px, 90vw);
  background: white;
  padding: 38px;
  border-radius: 18px;
  box-shadow: 0 24px 60px #17315d20;
}
.login-card h1 {
  margin: 18px 0 6px;
}
.login-card p {
  color: #718097;
  margin: 0 0 24px;
}
.login-card label {
  display: block;
  margin: 16px 0;
  color: #536179;
  font-size: 14px;
}
.login-card input {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
}
.login-card button {
  width: 100%;
  margin-top: 8px;
}
.brand {
  color: #2563eb;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.error {
  color: #c72c41;
  margin-top: 12px;
  font-size: 14px;
}
.topbar {
  height: 68px;
  background: white;
  border-bottom: 1px solid #e4eaf3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar strong {
  margin-left: 20px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #e63946;
  color: #fff;
  margin-left: 4px;
  font-size: 12px;
}
main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 26px 3vw;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.stats article {
  background: white;
  border: 1px solid #e3e9f2;
  border-radius: 12px;
  padding: 18px;
}
.stats span {
  color: #6b7890;
  font-size: 14px;
}
.stats strong {
  display: block;
  font-size: 28px;
  margin-top: 10px;
}
.quote-card .upload {
  display: inline-block;
  background: #1358d5;
  color: #fff;
  padding: 8px 12px;
  border-radius: 7px;
  margin: 10px 10px 0 0;
  cursor: pointer;
}
.upload input {
  display: none;
}
.panel {
  background: white;
  border: 1px solid #e3e9f2;
  border-radius: 14px;
  padding: 20px;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel h2 {
  margin: 0;
}
.panel p {
  margin: 5px 0;
  color: #728097;
}
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.filters input,
.filters select {
  width: 100%;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 10px;
  background: white;
}
.filters label {
  font-size: 12px;
  color: #68758c;
}
.filters label input {
  margin-top: 3px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid #edf0f5;
  font-size: 14px;
}
th {
  color: #657289;
  font-weight: 600;
  background: #f8fafd;
}
.status {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 12px;
}
.pending {
  background: #fff1d6;
  color: #945d00;
}
.following {
  background: #ddecff;
  color: #1656aa;
}
.won {
  background: #dcf7e8;
  color: #177747;
}
.closed {
  background: #eceff4;
  color: #606a7a;
}
.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.message {
  padding: 12px;
  border-radius: 8px;
  background: #fff0f0;
  color: #b52938;
  margin-bottom: 12px;
}
.overlay {
  position: fixed;
  inset: 0;
  background: #10182c88;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
}
.overlay aside {
  width: min(430px, 92vw);
  background: white;
  height: 100%;
  padding: 22px;
  overflow: auto;
}
.modal {
  width: min(850px, 92vw);
  max-height: 90vh;
  margin: auto;
  background: white;
  border-radius: 14px;
  padding: 24px;
  overflow: auto;
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e8edf4;
  margin-bottom: 16px;
}
.notification {
  padding: 13px;
  border-bottom: 1px solid #edf0f5;
  cursor: pointer;
}
.notification.unread {
  background: #eef5ff;
}
.notification p {
  margin: 5px 0;
  color: #58667c;
}
.notification small {
  color: #8791a2;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.detail-field {
  background: #f7f9fc;
  padding: 12px;
  border-radius: 8px;
}
.detail-field span {
  display: block;
  color: #78859a;
  font-size: 12px;
  margin-bottom: 5px;
}
.detail-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
}
.factory-image {
  max-width: 100%;
  max-height: 380px;
  border-radius: 10px;
  border: 1px solid #ddd;
  cursor: zoom-in;
}
.image-modal {
  margin: auto;
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
}
.image-modal img {
  max-width: 95vw;
  max-height: 90vh;
  display: block;
}
.close-image {
  position: absolute;
  right: 0;
  top: -44px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #17325f;
  color: #fff;
  padding: 12px 18px;
  border-radius: 9px;
  z-index: 40;
}
.history {
  font-size: 13px;
  color: #617087;
  margin-top: 16px;
}
@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .filters {
    grid-template-columns: repeat(2, 1fr);
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .topbar strong,
  #admin-name {
    display: none;
  }
  .stats,
  .filters {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 12px;
  }
}
