:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #26333a;
  background: #f5f7f8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
input, select {
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  color: #26333a;
  background: #fff;
  border: 1px solid #ccd6d8;
  border-radius: 5px;
  outline: none;
}
input:focus, select:focus { border-color: #128b70; box-shadow: 0 0 0 3px #128b7026; }
label { display: block; margin-bottom: 6px; color: #516169; font-size: 12px; font-weight: 600; }
.primary-button, .secondary-button {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 5px;
  font-weight: 600;
  white-space: nowrap;
}
.primary-button { color: #fff; background: #087f63; border: 1px solid #087f63; }
.primary-button:hover:not(:disabled) { background: #066f57; }
.secondary-button { color: #35464e; background: #fff; border: 1px solid #cbd6d8; }
.secondary-button:hover:not(:disabled) { border-color: #789497; background: #f8fbfb; }
.text-button { padding: 7px 8px; color: #41616b; background: none; border: 0; border-radius: 4px; }
.text-button:hover { background: #e9f0f0; }

.auth-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.auth-panel { width: min(100%, 370px); padding: 30px; background: #fff; border: 1px solid #dce5e6; border-radius: 8px; box-shadow: 0 16px 48px #1b37380c; }
.auth-brand, .app-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.auth-brand { font-size: 16px; }
.brand-mark { display: inline-grid; width: 29px; height: 29px; place-items: center; color: #fff; background: #087f63; border-radius: 6px; font-size: 17px; font-weight: 800; }
.auth-panel h1 { margin: 29px 0 22px; font-size: 23px; font-weight: 650; }
.auth-panel input, .password-dialog input { width: 100%; margin-bottom: 18px; }
.auth-panel .primary-button, .password-dialog .primary-button { width: 100%; }
.form-error { margin: -2px 0 14px; color: #bc4040; font-size: 12px; }

.app-header { height: 61px; background: #fff; border-bottom: 1px solid #dde6e6; }
.header-inner { display: flex; align-items: center; justify-content: space-between; width: min(100%, 1700px); height: 100%; margin: auto; padding: 0 28px; }
.app-brand strong { font-size: 15px; }
.brand-code { padding-left: 8px; color: #8b9b9d; border-left: 1px solid #d5dfdf; font-size: 11px; font-weight: 700; }
.account-actions { display: flex; align-items: center; gap: 10px; }
.account-name { margin-right: 10px; color: #334c54; font-weight: 600; }
.workspace { width: min(100%, 1700px); margin: 0 auto; padding: 27px 28px 42px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 19px; }
.page-heading h1 { margin: 0; font-size: 21px; font-weight: 650; }
.page-indicator { color: #859296; font-size: 12px; }
.filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 19px 0 22px; border-top: 1px solid #dce4e5; border-bottom: 1px solid #dce4e5; }
.filter-field { width: 145px; }
.filter-field.phone-field { width: clamp(220px, 23vw, 330px); }
.filter-field.size-field { width: 100px; }
.filter-field input, .filter-field select { width: 100%; }
.filter-actions { display: flex; gap: 8px; margin-left: 3px; }
.results { padding-top: 22px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.results-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.results-head span { color: #78888d; font-size: 12px; }
.table-scroll { overflow-x: auto; background: #fff; border: 1px solid #dbe4e5; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { height: 43px; padding: 0 13px; color: #667980; background: #f9fbfb; border-bottom: 1px solid #e0e7e7; font-size: 12px; font-weight: 650; text-align: left; white-space: nowrap; }
td { height: 51px; padding: 9px 13px; border-bottom: 1px solid #edf1f1; color: #43535b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fbfa; }
th:first-child { width: 185px; }
th:nth-child(2) { width: 95px; }
th:nth-child(3) { width: 110px; }
th:nth-child(4) { width: 120px; }
th:nth-child(5) { width: 180px; }
th:nth-child(6), th:nth-child(7) { width: 145px; }
th:last-child { width: 80px; }
.phone-text { color: #1b3c4c; font-weight: 650; font-variant-numeric: tabular-nums; }
.status-tag, .type-tag { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.status-tag.developed { color: #077657; background: #e7f5ef; }
.status-tag.undeveloped { color: #966416; background: #fff4df; }
.type-tag.a { color: #b0394a; background: #fcebee; }
.type-tag.c, .type-tag.d { color: #8f641a; background: #fff4df; }
.type-tag.lead { color: #12619a; background: #e8f3fb; }
.view-button { padding: 5px 6px; color: #087f63; background: none; border: 0; font-weight: 600; }
.view-button:hover { text-decoration: underline; }
.empty-state { padding: 86px 16px; color: #8b999b; background: #fff; border: 1px solid #dbe4e5; border-radius: 6px; text-align: center; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 13px; margin-top: 17px; }
.pagination span { color: #697b80; font-size: 12px; }

.detail-overlay { position: fixed; inset: 0; z-index: 20; background: #122f3591; }
.detail-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 21; width: min(100%, 550px); background: #fff; box-shadow: -14px 0 42px #16313820; overflow-y: auto; }
.detail-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 25px 25px 20px; border-bottom: 1px solid #e5ebeb; }
.detail-eyebrow { color: #71848a; font-size: 12px; }
.detail-heading h2 { margin: 5px 0 0; color: #1e373f; font-size: 20px; font-variant-numeric: tabular-nums; }
.detail-content { padding: 7px 25px 32px; }
.detail-section { padding: 18px 0 8px; border-bottom: 1px solid #e9eeee; }
.detail-section:last-child { border-bottom: 0; }
.detail-section h3 { margin: 0 0 13px; color: #22383e; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: minmax(105px, 38%) minmax(0, 1fr); gap: 11px 14px; margin: 0; }
.detail-grid dt { color: #78878b; }
.detail-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: #2b3c42; }
.password-dialog { width: min(420px, calc(100% - 28px)); padding: 24px; border: 1px solid #dce5e6; border-radius: 8px; box-shadow: 0 25px 70px #0d2a3152; }
.password-dialog::backdrop { background: #122f3591; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.dialog-heading h2 { margin: 0; font-size: 18px; }
.dialog-note { color: #a3601a; }
.password-rule { margin: -7px 0 17px; color: #839196; font-size: 12px; }
.toast { position: fixed; bottom: 22px; left: 50%; z-index: 40; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 16px; color: #fff; background: #273a41; border-radius: 5px; box-shadow: 0 9px 30px #19323933; }

@media (max-width: 1020px) {
  .optional-column { display: none; }
  table th:nth-child(5), table th:nth-child(6), table td:nth-child(5), table td:nth-child(6) { display: none; }
}
@media (max-width: 670px) {
  .header-inner { padding: 0 14px; }
  .brand-code, .account-name { display: none; }
  .account-actions { gap: 3px; }
  .workspace { padding: 22px 14px 35px; }
  .filters { gap: 11px; }
  .filter-field.phone-field { width: 100%; }
  .filter-field { flex: 1 1 130px; }
  .filter-field.size-field { flex: 0 1 100px; }
  .filter-actions { width: 100%; margin-left: 0; }
  .filter-actions button { flex: 1; }
  .date-column, table td:nth-child(7) { display: none; }
  table { min-width: 560px; }
  .detail-heading, .detail-content { padding-left: 18px; padding-right: 18px; }
}
