:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #6c7772;
  --line: rgba(20, 48, 40, 0.12);
  --mac-line: rgba(255, 255, 255, 0.28);
  --soft: #f3f5f1;
  --paper: #ffffff;
  --green: #0b4638;
  --green-2: #14634f;
  --green-3: #061f1a;
  --brass: #d4b66a;
  --brass-dark: #a98943;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --blue: #285f99;
  --danger: #a33d32;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #071d19;
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.login-page {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(115deg, rgba(212, 182, 106, 0.16), transparent 34%),
    linear-gradient(155deg, transparent 0 38%, rgba(255, 255, 255, 0.1) 39% 42%, transparent 43%),
    linear-gradient(35deg, #061a17 0%, #0d3129 46%, #101917 100%);
}

.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  inset: auto;
  pointer-events: none;
}

.login-page::before {
  width: min(82vw, 920px);
  height: min(82vw, 920px);
  left: -16%;
  top: -24%;
  border-radius: 38% 62% 58% 42%;
  background:
    linear-gradient(140deg, rgba(212, 182, 106, 0.36), transparent 32%),
    linear-gradient(40deg, rgba(30, 115, 92, 0.34), rgba(255, 255, 255, 0.04));
  filter: blur(10px);
  opacity: 0.72;
  transform: rotate(-18deg);
}

.login-page::after {
  width: min(74vw, 760px);
  height: min(74vw, 760px);
  right: -20%;
  bottom: -28%;
  border-radius: 56% 44% 42% 58%;
  background:
    linear-gradient(225deg, rgba(31, 92, 74, 0.66), transparent 48%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.14), transparent 58%);
  filter: blur(12px);
  opacity: 0.75;
  transform: rotate(12deg);
}

.login-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 410px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08)),
    rgba(8, 30, 26, 0.62);
  padding: 34px;
  box-shadow:
    0 34px 120px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(26px) saturate(142%);
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 27px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.2), transparent 42%);
  pointer-events: none;
}

.brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  margin-bottom: 28px;
}

.login-brand {
  justify-content: center;
  margin: 4px 0 36px;
}

.brand strong {
  display: block;
  font-size: 1.05rem;
}

.brand span {
  color: var(--muted);
  font-size: 0.88rem;
}

.logo-wordmark {
  display: inline-flex;
  align-items: baseline;
  border-radius: 16px;
  background: linear-gradient(145deg, #0c4b3c, #07382e);
  color: #fff;
  font-size: clamp(2.1rem, 8vw, 3rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  padding: 18px 20px 17px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 18px 36px rgba(0, 0, 0, 0.18);
}

.login-panel .logo-wordmark {
  background: transparent;
  padding: 0;
  box-shadow: none;
  font-size: clamp(2.7rem, 12vw, 3.65rem);
}

.logo-wordmark span:first-child {
  color: #fff;
}

.logo-wordmark span:nth-child(2) {
  color: var(--brass);
}

.logo-wordmark em {
  margin-left: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.34em;
  font-style: normal;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.logo-wordmark.compact {
  background: transparent;
  color: var(--green);
  font-size: 1.5rem;
  padding: 0;
  box-shadow: none;
}

.logo-wordmark.compact span:first-child {
  color: var(--green);
}

.logo-wordmark.compact span:nth-child(2) {
  color: var(--brass-dark);
}

.logo-wordmark.compact em {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.login-panel .field span {
  color: rgba(255, 255, 255, 0.72);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(20, 48, 40, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  color: var(--ink);
  outline: none;
}

.login-panel .field input {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 28px rgba(0, 0, 0, 0.12);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
  border-color: rgba(24, 92, 72, 0.58);
  box-shadow: 0 0 0 4px rgba(24, 92, 72, 0.1);
}

.login-panel .field input:focus {
  border-color: rgba(212, 182, 106, 0.72);
  box-shadow:
    0 0 0 4px rgba(212, 182, 106, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 42px;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 760;
}

.primary-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent),
    linear-gradient(135deg, var(--green-2), var(--green));
  color: #fff;
  box-shadow:
    0 14px 28px rgba(15, 75, 61, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.primary-btn:hover {
  background: var(--green-2);
}

.login-panel .primary-btn {
  width: 100%;
  margin-top: 8px;
  border-color: rgba(212, 182, 106, 0.28);
}

.secondary-btn {
  border: 1px solid rgba(20, 48, 40, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ghost-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.hint {
  margin-top: 16px;
  border-left: 3px solid var(--brass);
  padding: 10px 12px;
  background: rgba(182, 139, 69, 0.08);
  color: #6c5a36;
  font-size: 0.88rem;
  line-height: 1.5;
}

.app-shell {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 18px;
  background:
    linear-gradient(120deg, rgba(212, 182, 106, 0.12), transparent 30%),
    linear-gradient(160deg, transparent 0 42%, rgba(255, 255, 255, 0.08) 43% 46%, transparent 47%),
    linear-gradient(35deg, #061a17 0%, #0c352c 46%, #111917 100%);
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 58vh;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.13), transparent 44%),
    linear-gradient(30deg, rgba(212, 182, 106, 0.18), transparent 58%);
  filter: blur(12px);
  opacity: 0.68;
  pointer-events: none;
}

.desktop-frame {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 36px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18)),
    rgba(244, 248, 245, 0.42);
  box-shadow:
    0 36px 110px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(28px) saturate(135%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2));
  padding: 16px clamp(16px, 3vw, 34px);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(24px) saturate(145%);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar .brand {
  margin-bottom: 0;
}

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

.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  padding: 24px clamp(16px, 3vw, 34px);
}

.sidebar,
.content-card {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.5)),
    rgba(255, 255, 255, 0.58);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px) saturate(135%);
}

.sidebar {
  align-self: start;
  padding: 18px;
}

.sidebar-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  margin-bottom: 8px;
}

.metric {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid rgba(20, 48, 40, 0.1);
  padding: 14px 0;
}

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

.metric strong {
  font-size: 1.58rem;
  letter-spacing: 0;
}

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

.content-card {
  overflow: hidden;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  border-bottom: 1px solid rgba(20, 48, 40, 0.1);
  padding: 16px;
}

.toolbar input,
.toolbar select {
  min-height: 42px;
  border: 1px solid rgba(20, 48, 40, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

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

.lead-table th,
.lead-table td {
  border-bottom: 1px solid rgba(20, 48, 40, 0.1);
  padding: 16px 18px;
  text-align: left;
  vertical-align: top;
}

.lead-table th {
  background: rgba(255, 255, 255, 0.42);
  color: var(--muted);
  font-size: 0.78rem;
}

.lead-table tbody tr {
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.lead-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.4);
}

.lead-name {
  font-weight: 780;
}

.lead-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.status {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 780;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.status.new,
.status.contacted {
  background: rgba(40, 95, 153, 0.1);
  color: var(--blue);
}

.status.waiting,
.status.quoted,
.status.sample {
  background: rgba(182, 139, 69, 0.13);
  color: #80602b;
}

.status.bulk,
.status.won {
  background: rgba(24, 92, 72, 0.12);
  color: var(--green);
}

.status.lost {
  background: rgba(163, 61, 50, 0.1);
  color: var(--danger);
}

.empty {
  padding: 42px 18px;
  color: var(--muted);
  text-align: center;
}

.drawer {
  position: fixed;
  inset: 0;
  display: grid;
  justify-items: end;
  background: rgba(5, 18, 15, 0.5);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.drawer[hidden] {
  display: none;
}

.drawer-panel {
  width: min(100%, 620px);
  height: 100%;
  overflow: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.38);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.76)),
    rgba(255, 255, 255, 0.84);
  padding: 22px;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(22px) saturate(135%);
}

.drawer-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.drawer-header h2 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

  .lead-table {
    min-width: 780px;
  }

  .table-scroll {
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0;
  }

  .desktop-frame {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-left {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

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