:root {
  color-scheme: light;
  --navy: #102d47;
  --deep-navy: #142b40;
  --text: #182d3e;
  --muted: #576b7e;
  --border: #e0e6eb;
  --surface: #fff;
  --canvas: #f4f6f8;
  --focus: #376b9a;
  --gold: #f0d098;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--canvas); }
p, h1, h2, dl, dd { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.header { color: white; background: var(--deep-navy); }
.header-inner {
  max-width: 1472px;
  min-height: 68px;
  margin: 0 auto;
  padding-inline: 32px;
  display: flex;
  align-items: stretch;
  gap: 40px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; white-space: nowrap; }
.brand-logo { display: block; width: 132px; height: auto; }
.brand small { color: #c6d2df; font-size: 11px; }
.header nav { display: flex; align-items: stretch; }
.header nav a {
  display: grid;
  padding-inline: 9px;
  place-items: center;
  border-bottom: 2px solid var(--gold);
  color: #f9ead0;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.operator {
  align-self: center;
  margin-left: auto;
  color: #d2dfeb;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}
.workspace { width: min(1472px, 100%); margin: 0 auto; padding: 34px 32px 52px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
h1 { font-size: 30px; letter-spacing: -.005em; line-height: 1.35; }
h2 { font-size: 19px; line-height: 1.4; }
.page-heading p, .directory-heading p { color: var(--muted); margin-top: 7px; line-height: 1.5; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric { padding: 17px 19px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.metric dt { color: var(--muted); font-size: 13px; font-weight: 550; }
.metric dd { margin-top: 7px; font-size: 29px; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric-primary { background: #eef3f8; border-color: #d7e4ef; }
.metric-primary dd { color: #164a73; }

.directory { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.directory-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 19px 20px 16px; }
.directory-heading p { font-size: 13px; }
.filters {
  display: grid;
  gap: 12px;
  align-items: end;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(92px, 135px)) minmax(153px, 168px) auto;
  padding: 0 20px 17px;
}
.filters label { display: grid; gap: 6px; min-width: 0; font-size: 13px; font-weight: 600; }
.filters input, .filters select, .button {
  min-height: 38px;
  padding: 7px 11px;
  color: var(--text);
  border: 1px solid #ced8e1;
  border-radius: 6px;
  background: white;
  font-size: 13px;
}
.filters input::placeholder { color: #637688; }
.form-buttons, .pagination { display: flex; gap: 8px; }
.button { white-space: nowrap; font-weight: 600; }
.button:not(:disabled):hover { background: #eef3f7; }
.button:disabled { color: #708194; background: #f6f8fa; }
.button-primary { background: var(--navy); color: white; border-color: var(--navy); }
.button-primary:not(:disabled):hover { background: #244b6b; }

.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline-offset: -3px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
thead { background: #f6f8fa; }
th, td { padding: 12px 11px; border-top: 1px solid var(--border); }
th { color: #3a5267; font-weight: 600; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td:not(:first-child) { white-space: nowrap; }
tbody tr:hover { background: #f9fbfd; }
.account-cell { min-width: 185px; max-width: 258px; overflow-wrap: anywhere; }
.account-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #164a73;
  font-size: inherit;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.account-cell small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.tag + .tag { margin-left: 4px; }
.neutral { background: #eef1f4; color: #4d5e70; }
.counselor { background: #e9f1fa; color: #164c7a; }
.client { background: #f1ebf7; color: #62417b; }
.verified { background: #e8f3ed; color: #235e3d; }
.pending { background: #f7f0e3; color: #74501c; }
.quiet { color: var(--muted); }
.feedback { padding: 36px 20px; text-align: center; color: var(--muted); }
.feedback.error { color: #8c3338; }
.directory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.account-detail {
  width: min(460px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}
.account-detail::backdrop { background: rgb(16 45 71 / 44%); }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 20px;
  font-size: 14px;
}
.detail-fields dt { color: var(--muted); }
.detail-fields dd { overflow-wrap: anywhere; }

.sign-in { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.sign-in-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}
.sign-in-logo { display: block; width: 153px; max-width: 100%; height: auto; margin-bottom: 16px; }
.sign-in-card .sign-in-error { color: #8c3338; margin: 14px 0 0; }
.sign-in-form { display: grid; gap: 16px; margin-top: 20px; }
.sign-in-form label { display: grid; gap: 6px; font-weight: 600; }
.sign-in-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ced8e1;
  border-radius: 6px;
  font: inherit;
}

@media (max-width: 980px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .search { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .header-inner { padding-inline: 14px; gap: 14px; }
  .brand-logo { width: 104px; }
  .brand small { display: none; }
  .header nav a { font-size: 13px; }
  .operator { font-size: 11px; }
  .workspace { padding: 23px 13px 30px; }
  .page-heading { align-items: flex-start; }
  h1 { font-size: 24px; }
  .page-heading p { font-size: 13px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: 12px; }
  .metric dd { font-size: 24px; }
  .directory-heading, .directory-footer { padding-inline: 12px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 12px; gap: 10px; }
}
