:root {
  --ink: #142028;
  --muted: #5d6b73;
  --teal: #267b7b;
  --teal-deep: #064c55;
  --gold: rgb(248, 198, 63);
  --line: #d5e2df;
  --panel: #ffffff;
  --surface: #f4f8f6;
  --danger: #b84c35;
  --shadow: 0 18px 42px rgba(15, 34, 40, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(230, 246, 245, 0.88), rgba(255, 255, 255, 0.96)),
    #f7faf8;
  font-family:
    Inter,
    "PingFang SC",
    "Microsoft YaHei",
    Arial,
    sans-serif;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.admin-shell {
  min-height: 100vh;
  padding: clamp(18px, 4vw, 52px);
}

.hidden,
.visually-hidden {
  display: none !important;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 36px;
  align-items: center;
  max-width: 980px;
  min-height: calc(100vh - 104px);
  margin: 0 auto;
}

.login-panel h1,
.topbar h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel h1 {
  font-size: clamp(34px, 6vw, 58px);
}

.login-panel p {
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.login-form,
.panel,
.stats-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-form {
  display: grid;
  gap: 16px;
  padding: 26px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #40545d;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bdd1ce;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

input,
select {
  min-height: 44px;
  padding: 0 13px;
}

textarea {
  min-height: 104px;
  padding: 12px 13px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(38, 123, 123, 0.14);
}

.primary-button,
.ghost-button,
.text-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 850;
}

.primary-button {
  background: var(--gold);
  border-color: var(--gold);
  color: #15262c;
  box-shadow: 0 12px 26px rgba(225, 177, 73, 0.2);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: rgb(255, 211, 82);
  border-color: rgb(255, 211, 82);
}

.ghost-button,
.text-button {
  background: white;
  border-color: var(--line);
  color: var(--teal-deep);
}

.danger-button {
  background: #fff6f3;
  border-color: #f0c5bb;
  color: var(--danger);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dashboard {
  max-width: 1480px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stats-grid article {
  padding: 18px;
}

.stats-grid span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stats-grid strong {
  display: block;
  color: var(--teal-deep);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.86fr) minmax(520px, 1.14fr);
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

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

.job-form .panel-heading,
.wide-field,
.form-actions {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: #e8f3f1;
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 850;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f2f8f6;
  color: #40545d;
}

td small {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.status-open {
  background: #e8f5ec;
  color: #166534;
}

.status-verifying {
  background: #e8f2f5;
  color: #075985;
}

.status-closing {
  background: #fff4d7;
  color: #8a5a00;
}

.status-closed {
  background: #f4e7e4;
  color: #9a3412;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-panel {
  margin-top: 20px;
}

.lead-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lead-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.lead-item strong {
  display: block;
  margin-bottom: 7px;
}

.lead-item small,
.lead-item p {
  color: var(--muted);
}

.lead-item p {
  margin: 8px 0 0;
  line-height: 1.65;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  transform: translateY(12px);
  max-width: min(380px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1100px) {
  .login-panel,
  .workspace,
  .stats-grid,
  .lead-list {
    grid-template-columns: 1fr;
  }

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

  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .admin-shell {
    padding: 14px;
  }

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

  .panel,
  .login-form {
    padding: 16px;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }
}
