:root {
  color-scheme: light;
  --ink: #20302d;
  --muted: #6d7975;
  --line: #d9dfdc;
  --line-strong: #c8d0cc;
  --surface: #ffffff;
  --canvas: #f1f4f2;
  --green: #18685e;
  --green-dark: #124d47;
  --coral: #c35f4e;
  --gold: #a77722;
  --blue: #3b6f9d;
  --violet: #745d91;
  --danger: #b44343;
  --shadow: 0 18px 45px rgba(31, 50, 45, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  background: var(--canvas);
}

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

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

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(24, 104, 94, 0.2);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(217, 223, 220, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-weight: 800;
  background: var(--green);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
}

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

.topbar-actions form {
  margin: 0;
}

.blog-link,
.quiet-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: #43514e;
  font-size: 0.9rem;
  font-weight: 700;
}

.blog-link:hover,
.quiet-link:hover {
  background: #edf3f0;
  color: var(--green);
}

.user-name {
  max-width: 150px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #44534f;
  background: #fff;
  font-size: 1.25rem;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: #f7f9f8;
}

.flash-region {
  position: fixed;
  z-index: 80;
  top: 82px;
  left: 50%;
  width: min(440px, calc(100% - 32px));
  transform: translateX(-50%);
}

.flash {
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
}

.flash-error {
  border-color: #e7b9b6;
  color: #923d3d;
  background: #fff6f5;
}

.flash-success {
  border-color: #b8d7cf;
  color: #1f675c;
  background: #f3fbf8;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.primary-button {
  padding: 0 18px;
  border: 1px solid var(--green);
  color: #fff;
  background: var(--green);
}

.primary-button:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
  transform: translateY(-1px);
}

.secondary-button {
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: #fff;
}

.secondary-button:hover {
  background: #f5f7f6;
}

.danger-button {
  padding: 0 18px;
  border: 1px solid var(--danger);
  color: #fff;
  background: var(--danger);
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--green);
  background: transparent;
}

.full-button {
  width: 100%;
}

/* Authentication */
.auth-page {
  background: #edf1ef;
}

.auth-main {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(380px, 0.75fr);
  width: min(1180px, calc(100% - 40px));
  min-height: 650px;
  margin: 42px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 7vw, 88px);
  color: #fff;
  background: #1d514a;
  overflow: hidden;
}

.auth-intro::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: 58px;
  width: 300px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-right: 0;
  transform: rotate(-8deg);
}

.auth-intro .eyebrow {
  color: #a9d2ca;
}

.auth-intro h1 {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin-bottom: 54px;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 1.25;
}

.auth-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 560px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-stats span {
  padding-top: 18px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.88rem;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 64px);
}

.panel-heading h2 {
  margin-bottom: 30px;
  font-size: 1.9rem;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-form label > span,
.form-grid label > span {
  display: block;
  margin-bottom: 7px;
  color: #52605c;
  font-size: 0.83rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

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

input::placeholder,
textarea::placeholder {
  color: #9aa4a0;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.check-row span {
  margin: 0 !important;
}

.auth-switch {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.auth-switch a {
  color: var(--green);
  font-weight: 800;
}

/* Profile */
.profile-shell {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0 48px;
}

.profile-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.profile-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.profile-heading p:last-child,
.profile-card-heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.profile-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.profile-heading-actions {
  display: flex;
  gap: 10px;
}

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

.profile-summary div {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.profile-summary span,
.profile-summary strong {
  display: block;
}

.profile-summary span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-summary strong {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.profile-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(24, 49, 42, 0.05);
}

.profile-card-heading {
  margin-bottom: 22px;
}

.profile-card-heading h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.profile-form {
  display: grid;
  gap: 16px;
}

.profile-form label > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-form .primary-button {
  width: fit-content;
  margin-top: 4px;
}

/* Email sync */
.email-sync-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0 48px;
}

.email-sync-heading,
.email-sync-card-heading,
.sync-event-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.email-sync-heading {
  align-items: flex-end;
  margin-bottom: 28px;
}

.email-sync-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.email-sync-heading p:last-child,
.sync-address-note,
.rule-help,
.provider-guide p,
.sync-empty-copy {
  margin: 0;
  color: var(--muted);
}

.email-sync-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.email-sync-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(24, 49, 42, 0.05);
}

.email-sync-readiness {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid #ead89d;
  border-radius: 7px;
  color: #685317;
  background: #fff8df;
  font-size: 0.82rem;
}

.email-sync-readiness strong {
  flex: 0 0 auto;
}

.email-sync-card-heading {
  margin-bottom: 20px;
}

.email-sync-card-heading h2,
.email-sync-setup h2 {
  margin-bottom: 7px;
  font-size: 1.3rem;
}

.email-sync-setup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.sync-address-card {
  margin-bottom: 16px;
}

.sync-state,
.event-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.sync-state.is-enabled,
.event-status.status-applied {
  color: #17613f;
  background: #e7f5ed;
}

.sync-state.is-disabled,
.event-status.status-ignored,
.event-status.status-failed {
  color: #7b4c48;
  background: #f7e8e6;
}

.event-status.status-pending {
  color: #775c14;
  background: #fff3cf;
}

.event-status.status-unmatched {
  color: #53605d;
  background: #edf1ef;
}

.sync-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}

.sync-address-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sync-settings-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: 20px;
}

.sync-threshold-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.sync-threshold-field input {
  width: 84px;
}

.regenerate-address {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.regenerate-address summary {
  width: fit-content;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.regenerate-address form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.regenerate-address label span,
.rule-form label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.provider-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.provider-guide strong {
  display: block;
  margin-bottom: 8px;
}

.provider-guide p {
  font-size: 0.83rem;
  line-height: 1.65;
}

.email-sync-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.rule-help {
  margin-bottom: 18px;
  font-size: 0.82rem;
  line-height: 1.65;
}

.rule-help code {
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--green-dark);
  background: #eef4f1;
}

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

.rule-span-two {
  grid-column: 1 / -1;
}

.sync-rule-list,
.sync-event-list {
  display: grid;
  gap: 10px;
}

.sync-rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sync-rule-item.is-disabled {
  opacity: 0.55;
}

.sync-rule-item strong,
.sync-rule-item span {
  display: block;
}

.sync-rule-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.sync-rule-actions {
  display: flex;
  gap: 10px;
}

.sync-rule-actions form {
  margin: 0;
}

.danger-text {
  color: var(--danger);
}

.event-card {
  margin-bottom: 18px;
}

.sync-event-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fcfdfc;
}

.sync-event-summary strong,
.sync-event-summary span,
.sync-event-match span {
  display: block;
}

.sync-event-summary > div:first-child > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.sync-event-summary-controls {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
}

.sync-event-summary-controls form {
  margin: 0;
}

.sync-event-item > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 14px 0;
  color: #4e5b58;
  font-size: 0.84rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.sync-event-match {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--muted);
  font-size: 0.75rem;
}

.sync-event-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sync-event-actions form:first-child {
  display: flex;
  flex: 1;
  gap: 8px;
}

.sync-event-actions select {
  min-width: 0;
}

.sync-create-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) 120px auto;
  gap: 8px;
  margin-top: 10px;
}

/* Dashboard */
.dashboard-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0 36px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.dashboard-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.15;
}

.date-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 38px;
}

.metric {
  min-width: 0;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  border-radius: 6px;
  background: var(--surface);
}

.metric-active {
  border-top-color: var(--blue);
}

.metric-interview {
  border-top-color: var(--violet);
}

.metric-offer {
  border-top-color: var(--gold);
}

.metric-follow-up,
.metric-next-step {
  border-top-color: var(--coral);
}

.metric-trash {
  border-top-color: #7b8581;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric span {
  font-size: 0.82rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  min-height: 49px;
  margin-top: 7px;
  font-size: 2.15rem;
  line-height: 1.35;
}

.metric small {
  font-size: 0.74rem;
}

.workspace {
  padding-top: 2px;
}

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

.workspace-toolbar h2,
.aside-heading h2 {
  margin: 0;
  font-size: 1.45rem;
}

.workspace-title-row,
.workspace-view-switch {
  display: flex;
  align-items: center;
}

.workspace-title-row {
  flex-wrap: wrap;
  gap: 12px 18px;
}

.workspace-view-switch {
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f6f4;
}

.workspace-view-button {
  min-height: 32px;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 800;
}

.workspace-view-button.is-active {
  color: var(--green-dark);
  background: #fff;
  box-shadow: 0 2px 7px rgba(24, 49, 42, 0.1);
}

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

.filters input {
  width: min(290px, 32vw);
}

.filters select {
  min-width: 130px;
}

.export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  white-space: nowrap;
}

.records-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
  align-items: start;
}

.record-table-wrap,
.pipeline {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.record-table-wrap {
  min-width: 0;
  overflow: hidden;
}

.record-table-head,
.application-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.7fr) minmax(105px, 0.85fr) minmax(88px, 0.7fr) minmax(90px, 0.8fr) minmax(88px, 0.75fr) 152px;
  gap: 12px;
  align-items: center;
}

.record-table-head {
  min-height: 42px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: #7e8985;
  background: #f7f9f8;
  font-size: 0.74rem;
  font-weight: 800;
}

.application-row {
  min-height: 96px;
  padding: 14px 18px;
  border-bottom: 1px solid #e8ecea;
}

.application-row:last-child {
  border-bottom: 0;
}

.application-row:hover {
  background: #fbfcfb;
}

.application-main {
  min-width: 0;
}

.application-main strong,
.application-main span,
.application-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-main strong {
  font-size: 0.96rem;
}

.company-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.company-line strong {
  min-width: 0;
}

.priority-dot {
  display: block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca7a3;
}

.priority-dot.priority-high {
  background: var(--coral);
}

.priority-dot.priority-low {
  background: #7aa3c5;
}

.application-main span,
.cell-muted {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.79rem;
}

.application-main .company-position-count,
.application-main .row-next-step {
  margin-top: 5px;
  color: var(--green);
  font-size: 0.69rem;
  font-weight: 700;
}

.application-main .row-next-step {
  color: var(--coral);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #31504a;
  background: #e6f0ed;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-interview,
.status-written_test {
  color: #634f78;
  background: #eee9f3;
}

.status-offer {
  color: #765817;
  background: #f5ecd6;
}

.status-rejected,
.status-withdrawn {
  color: #8a4a44;
  background: #f5e7e5;
}

.status-wishlist {
  color: #5e6764;
  background: #ecefed;
}

.status-cell {
  min-width: 0;
}

.quick-status {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 28px 0 9px;
  border-color: transparent;
  border-radius: 6px;
  color: #31504a;
  background-color: #e6f0ed;
  font-size: 0.74rem;
  font-weight: 800;
}

.quick-status:hover,
.quick-status:focus {
  border-color: #b8cbc5;
}

.quick-status:disabled {
  cursor: wait;
  opacity: 0.65;
}

.record-link-cell {
  min-width: 0;
  font-size: 0.78rem;
}

.record-link-cell a {
  display: inline-block;
  overflow: hidden;
  color: var(--green);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-link-cell a:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.row-actions button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #52615d;
  background: #fff;
}

.row-actions button:hover {
  border-color: var(--line-strong);
  background: #f3f6f4;
}

.row-actions .delete-record:hover {
  color: var(--danger);
  background: #fff5f4;
}

.mobile-label {
  display: none;
}

.company-table-head,
.company-application-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.75fr) minmax(0, 3fr) 92px;
  gap: 16px;
  align-items: start;
}

.company-table-head {
  min-height: 42px;
  padding: 0 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: #7e8985;
  background: #f7f9f8;
  font-size: 0.74rem;
  font-weight: 800;
}

.company-application-row {
  padding: 18px;
  border-bottom: 1px solid #e8ecea;
}

.company-application-row:last-child {
  border-bottom: 0;
}

.company-application-row:hover {
  background: #fbfcfb;
}

.company-summary {
  min-width: 0;
  padding-top: 8px;
}

.company-summary strong,
.company-summary em,
.company-summary span,
.company-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-summary .company-nature-badge {
  width: fit-content;
  margin-top: 7px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #624f77;
  background: #eee9f3;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 800;
}

.company-summary strong {
  font-size: 0.98rem;
}

.company-summary span {
  margin-top: 7px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
}

.company-summary small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.company-position-list {
  min-width: 0;
  border: 1px solid #e2e7e4;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.company-position-row {
  display: grid;
  grid-template-columns: minmax(155px, 1.5fr) 112px 82px 88px;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px 12px;
  border-bottom: 1px solid #e8ecea;
}

.company-position-row:last-child {
  border-bottom: 0;
}

.position-row-identity {
  min-width: 0;
}

.position-row-identity strong,
.position-row-identity span,
.position-row-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position-row-identity strong {
  font-size: 0.84rem;
}

.position-row-identity span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.position-row-identity small {
  margin-top: 4px;
  color: var(--coral);
  font-size: 0.66rem;
}

.company-position-row > time,
.position-row-link {
  color: var(--muted);
  font-size: 0.7rem;
}

.position-row-link a {
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.position-row-link {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.company-actions {
  display: grid;
  grid-template-columns: repeat(2, 34px);
  justify-content: end;
  gap: 6px;
  padding-top: 7px;
}

.company-dialog {
  width: min(980px, calc(100% - 32px));
}

.position-editor {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.position-editor-heading,
.position-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.position-editor-heading {
  margin-bottom: 14px;
}

.position-editor-heading h3 {
  margin: 0;
  font-size: 1.1rem;
}

.position-form-list {
  display: grid;
  gap: 14px;
}

.position-form-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafcfb;
}

.position-form-heading {
  margin-bottom: 14px;
}

.position-form-heading strong {
  color: var(--green);
  font-size: 0.88rem;
}

.remove-position {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--danger);
  background: #fff;
  font-size: 1.15rem;
}

.remove-position:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

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

.position-fields label > span {
  display: block;
  margin-bottom: 7px;
  color: #52605c;
  font-size: 0.8rem;
  font-weight: 700;
}

.position-span-two {
  grid-column: 1 / -1;
}

.position-location-fieldset,
.position-next-step-fieldset {
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.position-location-fieldset legend,
.position-next-step-fieldset legend {
  padding: 0 6px;
  color: #52605c;
  font-size: 0.8rem;
  font-weight: 700;
}

.position-location-selects,
.position-next-step-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.detail-positions {
  margin-top: 22px;
}

.detail-positions > h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.detail-position-list {
  display: grid;
  gap: 10px;
}

.detail-position-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

.detail-position-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-position-heading strong {
  font-size: 0.9rem;
}

.detail-position-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 13px 0 0;
}

.detail-position-card dt,
.detail-position-card dd {
  margin: 0;
}

.detail-position-card dt {
  color: #818b87;
  font-size: 0.68rem;
  font-weight: 800;
}

.detail-position-card dd {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 0.76rem;
}

.detail-position-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 13px;
}

.detail-position-actions a,
.detail-position-actions button {
  padding: 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 800;
}

.empty-state {
  padding: 72px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin: 20px 0 2px;
  color: var(--ink);
  font-size: 1rem;
}

.empty-visual {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  height: 58px;
}

.empty-visual span {
  display: block;
  width: 15px;
  border-radius: 3px 3px 0 0;
  background: #c7d9d4;
}

.empty-visual span:nth-child(1) {
  height: 25px;
}

.empty-visual span:nth-child(2) {
  height: 45px;
  background: #7faf9f;
}

.empty-visual span:nth-child(3) {
  height: 34px;
  background: #d4ad68;
}

.pipeline {
  padding: 20px;
}

.pipeline-list {
  display: grid;
  gap: 17px;
  margin-top: 25px;
}

.pipeline-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  align-items: center;
  font-size: 0.82rem;
}

.pipeline-item strong {
  font-size: 0.8rem;
}

.pipeline-track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 3px;
  background: #edf0ee;
  overflow: hidden;
}

.pipeline-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.pipeline-item:nth-child(2) .pipeline-fill {
  background: var(--blue);
}

.pipeline-item:nth-child(3) .pipeline-fill,
.pipeline-item:nth-child(4) .pipeline-fill {
  background: var(--violet);
}

.pipeline-item:nth-child(5) .pipeline-fill {
  background: var(--gold);
}

.insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  margin-top: 38px;
}

.insights-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.follow-up-panel,
.next-step-panel,
.source-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.next-step-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.next-step-item {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 7px 12px;
  align-items: center;
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid #e3e8e5;
  border-radius: 6px;
  color: var(--ink);
  background: #fbfcfb;
  text-align: left;
}

.next-step-item:hover {
  border-color: #b8cbc5;
  background: #f5f9f7;
}

.next-step-item.is-overdue {
  border-left: 3px solid var(--coral);
}

.next-step-item time {
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.next-step-item span,
.next-step-item strong,
.next-step-item small {
  display: block;
  min-width: 0;
}

.next-step-item strong,
.next-step-item small,
.next-step-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-step-item strong {
  font-size: 0.8rem;
}

.next-step-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.next-step-item em {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
}

.next-step-item.is-overdue em {
  color: var(--coral);
  font-weight: 800;
}

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

.insight-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.overdue-count {
  padding: 5px 8px;
  border-radius: 999px;
  color: #984f48;
  background: #f7e8e5;
  font-size: 0.72rem;
  font-weight: 800;
}

.follow-up-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.follow-up-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #e3e8e5;
  border-radius: 6px;
  color: var(--ink);
  background: #fbfcfb;
  text-align: left;
}

.follow-up-item:hover {
  border-color: #b8cbc5;
  background: #f5f9f7;
}

.follow-up-item.is-overdue {
  border-left: 3px solid var(--coral);
}

.follow-up-item time {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
}

.follow-up-item span,
.follow-up-item strong,
.follow-up-item small {
  display: block;
  min-width: 0;
}

.follow-up-item strong,
.follow-up-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follow-up-item strong {
  font-size: 0.82rem;
}

.follow-up-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.follow-up-item em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  white-space: nowrap;
}

.follow-up-item.is-overdue em {
  color: var(--coral);
  font-weight: 800;
}

.source-list {
  display: grid;
  gap: 14px;
}

.source-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  font-size: 0.78rem;
}

.source-item > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-item strong {
  font-size: 0.75rem;
}

.source-track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 3px;
  background: #edf0ee;
  overflow: hidden;
}

.source-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.insight-empty {
  margin: 0;
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.application-dialog,
.confirm-dialog,
.detail-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 30px 90px rgba(24, 40, 35, 0.28);
}

.application-dialog::backdrop,
.confirm-dialog::backdrop,
.detail-dialog::backdrop {
  background: rgba(21, 32, 29, 0.58);
  backdrop-filter: blur(3px);
}

.application-dialog form {
  padding: 24px;
}

.application-dialog {
  overflow: auto;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.dialog-heading h2,
.confirm-content h2 {
  margin: 0;
  font-size: 1.45rem;
}

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

.location-fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.next-step-fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.location-fieldset legend {
  padding: 0 6px;
  color: #52605c;
  font-size: 0.83rem;
  font-weight: 700;
}

.next-step-fieldset legend {
  padding: 0 6px;
  color: #52605c;
  font-size: 0.83rem;
  font-weight: 700;
}

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

.next-step-fields {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 12px;
}

.span-two {
  grid-column: 1 / -1;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.confirm-dialog {
  width: min(430px, calc(100% - 32px));
}

.confirm-content {
  padding: 26px;
}

.confirm-content p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.detail-dialog {
  width: min(820px, calc(100% - 32px));
  overflow: auto;
}

.detail-content {
  padding: 26px;
}

.detail-position {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-priority {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #596560;
  background: #ecefed;
  font-size: 0.72rem;
  font-weight: 800;
}

.detail-priority.priority-high {
  color: #914c45;
  background: #f5e6e3;
}

.detail-priority.priority-low {
  color: #486b89;
  background: #e7eff5;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.detail-grid > div {
  min-width: 0;
  min-height: 76px;
  padding: 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-grid dt,
.detail-grid dd {
  margin: 0;
}

.detail-grid dt,
.detail-notes > span {
  color: #818b87;
  font-size: 0.7rem;
  font-weight: 800;
}

.detail-grid dd {
  margin-top: 7px;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.detail-grid a {
  color: var(--green);
  font-weight: 800;
}

.detail-notes {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.detail-notes p {
  margin: 7px 0 0;
  color: #4f5d59;
  font-size: 0.82rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.history-section {
  padding-top: 20px;
}

.history-section h3 {
  margin-bottom: 14px;
  font-size: 1rem;
}

.history-list {
  position: relative;
}

.history-list article {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 128px;
  gap: 12px;
  padding: 0 0 18px;
}

.history-list article:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 11px;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
}

.history-list article > i {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 3px;
  border: 3px solid #d7e7e2;
  border-radius: 50%;
  background: var(--green);
}

.history-list strong,
.history-list span {
  display: block;
}

.history-list strong {
  font-size: 0.8rem;
}

.history-list span,
.history-list time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.history-list time {
  margin-top: 0;
  text-align: right;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100% - 44px));
  padding: 12px 16px;
  border: 1px solid #b8d7cf;
  border-radius: 6px;
  color: #1f675c;
  background: #f3fbf8;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.toast.error {
  border-color: #e7b9b6;
  color: #923d3d;
  background: #fff6f5;
}

/* Admin user management */
.admin-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0 40px;
}

.admin-heading,
.admin-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.admin-heading {
  margin-bottom: 28px;
}

.admin-heading h1 {
  margin-bottom: 7px;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.admin-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 38px;
}

.admin-metrics article {
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  background: #fff;
}

.admin-metrics article:nth-child(2) {
  border-left-color: var(--blue);
}

.admin-metrics article:nth-child(3) {
  border-left-color: var(--violet);
}

.admin-metrics article:nth-child(4) {
  border-left-color: var(--gold);
}

.admin-metrics span,
.admin-metrics strong {
  display: block;
}

.admin-metrics span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.admin-metrics strong {
  margin-top: 8px;
  font-size: 2rem;
}

.admin-users {
  margin-bottom: 42px;
}

.admin-toolbar {
  margin-bottom: 18px;
}

.admin-toolbar h2,
.audit-section h2 {
  margin: 0;
  font-size: 1.45rem;
}

.admin-filters {
  display: flex;
  align-items: center;
  gap: 9px;
}

.admin-filters input {
  width: min(260px, 26vw);
}

.admin-filters select {
  min-width: 116px;
}

.filter-clear {
  padding: 0 5px;
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-table-head,
.admin-user-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.8fr) minmax(86px, 0.7fr) minmax(80px, 0.65fr) minmax(60px, 0.5fr) minmax(175px, 1.25fr) 56px;
  gap: 14px;
  align-items: center;
}

.admin-table-head {
  min-height: 42px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: #7e8985;
  background: #f7f9f8;
  font-size: 0.74rem;
  font-weight: 800;
}

.admin-user-row {
  position: relative;
  min-height: 88px;
  padding: 14px 18px;
  border-bottom: 1px solid #e8ecea;
}

.admin-user-row:last-child {
  border-bottom: 0;
}

.admin-user-row:hover {
  z-index: 3;
  background: #fbfcfb;
}

.admin-user-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--green-dark);
  background: #e0ece8;
  font-size: 0.88rem;
  font-weight: 900;
}

.admin-user-identity > span:last-child {
  min-width: 0;
}

.admin-user-identity strong,
.admin-user-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-identity strong {
  font-size: 0.91rem;
}

.admin-user-identity strong small {
  display: inline-flex;
  margin-left: 7px;
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--green);
  background: #e8f2ef;
  font-size: 0.62rem;
  vertical-align: middle;
}

.admin-user-identity > span > small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.role-badge,
.account-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.role-user {
  color: #53615d;
  background: #ecefed;
}

.role-admin {
  color: #624f77;
  background: #eee9f3;
}

.account-status {
  gap: 6px;
  padding: 0;
  background: transparent;
}

.account-status i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.account-status.is-active {
  color: var(--green);
}

.account-status.is-active i {
  background: #2d967f;
}

.account-status.is-disabled {
  color: #9a5550;
}

.account-status.is-disabled i {
  background: #c96b62;
}

.admin-application-count strong {
  font-size: 1.05rem;
}

.admin-application-count small {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-dates {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-dates span {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 5px;
}

.admin-dates b {
  color: #7e8985;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
}

.action-menu {
  position: relative;
}

.action-menu summary {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #51605c;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu[open] summary,
.action-menu summary:hover {
  border-color: var(--line-strong);
  background: #f3f6f4;
}

.action-menu-popover {
  position: absolute;
  z-index: 20;
  top: 42px;
  right: 0;
  width: 176px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.action-menu-popover form {
  margin: 0;
}

.menu-button,
.menu-note {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  color: #35433f;
  background: transparent;
  font-size: 0.78rem;
  text-align: left;
}

.menu-button:hover {
  background: #eef3f1;
}

.menu-danger {
  color: var(--danger);
}

.menu-danger:hover {
  background: #fff0ee;
}

.menu-note {
  min-height: 0;
  color: #8b9591;
  line-height: 1.55;
}

.admin-empty {
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 66px 20px;
  color: var(--muted);
}

.admin-empty strong {
  color: var(--ink);
}

.admin-empty a {
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 800;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
  font-size: 0.82rem;
}

.pagination a {
  color: var(--green);
  font-weight: 800;
}

.pagination span {
  color: #a3aca8;
}

.audit-section {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.audit-list {
  border-top: 1px solid var(--line);
}

.audit-list article {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 128px;
  gap: 14px;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.audit-list p {
  margin: 0;
  color: #4d5b57;
}

.audit-action {
  color: var(--green);
  font-weight: 800;
}

.audit-list time {
  color: var(--muted);
  text-align: right;
}

.audit-empty {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-confirm-dialog,
.reset-password-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 30px 90px rgba(24, 40, 35, 0.28);
}

.admin-confirm-dialog::backdrop,
.reset-password-dialog::backdrop {
  background: rgba(21, 32, 29, 0.58);
  backdrop-filter: blur(3px);
}

.admin-confirm-dialog > div,
.reset-password-dialog form {
  padding: 26px;
}

.admin-confirm-dialog h2,
.reset-password-dialog h2 {
  margin: 0;
  font-size: 1.35rem;
}

.admin-confirm-dialog > div > p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.reset-password-fields {
  display: grid;
  gap: 16px;
}

.reset-password-fields label > span {
  display: block;
  margin-bottom: 7px;
  color: #52605c;
  font-size: 0.83rem;
  font-weight: 700;
}

.simple-shell,
.error-page {
  width: min(900px, calc(100% - 40px));
  min-height: 52vh;
  margin: 0 auto;
  padding: 70px 0;
}

.simple-shell h1,
.error-page h1 {
  font-size: 2.6rem;
}

.admin-placeholder {
  display: flex;
  gap: 16px;
  margin-top: 30px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-placeholder span {
  color: var(--muted);
}

.error-page {
  text-align: center;
}

.error-page > strong {
  color: var(--green);
  font-size: 5rem;
}

.error-page a {
  color: var(--green);
  font-weight: 800;
}

/* Preserved site footer */
.footer-wrap {
  position: relative;
  z-index: 2;
  padding: 24px clamp(12px, 3vw, 28px) 18px;
}

.footer-card {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 24px 16px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 10px;
  color: rgba(35, 49, 61, 0.66);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.62)),
    radial-gradient(circle at 20% 0%, rgba(39, 143, 149, 0.1), transparent 34%),
    radial-gradient(circle at 84% 100%, rgba(201, 111, 131, 0.1), transparent 30%);
  box-shadow: 0 18px 56px rgba(35, 49, 61, 0.12);
  backdrop-filter: blur(24px);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  flex-wrap: wrap;
}

.footer-top {
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: 0.96rem;
}

.footer-quote,
.copyright {
  margin: 0;
}

.footer-quote {
  font-style: italic;
}

.record-row {
  justify-content: flex-start;
  margin-top: 14px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.record-row a,
.record-row span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.record-row a {
  transition: color 160ms ease;
}

.record-row a:hover {
  color: #397fbd;
}

.record-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 0;
  object-fit: contain;
}

.record-row strong {
  color: #52606c;
  font-weight: 700;
}

.footer-bottom {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(76, 91, 105, 0.15);
  color: rgba(35, 49, 61, 0.38);
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: 0.9rem;
}

.petal {
  color: #c96f83;
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 980px) {
  .auth-main {
    grid-template-columns: 1fr 390px;
  }

  .auth-intro {
    padding: 42px;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .records-layout {
    grid-template-columns: 1fr;
  }

  .pipeline {
    order: -1;
  }

  .pipeline-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 130px 130px auto auto;
  }

  .admin-filters input {
    width: 100%;
  }

  .audit-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    width: min(100% - 28px, 1180px);
  }

  .brand small,
  .user-name {
    display: none;
  }

  .auth-main {
    display: block;
    width: min(100% - 28px, 560px);
    min-height: 0;
    margin: 24px auto;
  }

  .auth-intro {
    min-height: 260px;
    padding: 34px;
  }

  .auth-intro h1 {
    margin-bottom: 32px;
    font-size: 2.45rem;
  }

  .auth-intro::after {
    width: 180px;
    height: 110px;
    bottom: 28px;
  }

  .auth-panel {
    padding: 34px;
  }

  .dashboard-shell {
    width: calc(100% - 28px);
    padding-top: 30px;
  }

  .profile-shell {
    width: calc(100% - 28px);
    padding-top: 30px;
  }

  .profile-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-heading-actions {
    flex-direction: column;
  }

  .profile-summary,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-back,
  .profile-form .primary-button {
    width: 100%;
  }

  .email-sync-shell {
    width: calc(100% - 28px);
    padding-top: 30px;
  }

  .email-sync-heading,
  .email-sync-setup,
  .sync-event-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-event-summary-controls {
    align-items: flex-start;
  }

  .email-sync-back,
  .email-sync-setup .primary-button {
    width: 100%;
  }

  .provider-guide-grid,
  .email-sync-grid,
  .rule-form {
    grid-template-columns: 1fr;
  }

  .rule-span-two {
    grid-column: auto;
  }

  .sync-address-row,
  .sync-event-actions form:first-child {
    grid-template-columns: 1fr;
  }

  .sync-address-row {
    display: grid;
  }

  .sync-settings-form,
  .regenerate-address form,
  .sync-event-actions,
  .sync-event-actions form:first-child {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-threshold-field {
    justify-content: space-between;
  }

  .sync-event-actions form:first-child {
    display: flex;
  }

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

  .dashboard-heading,
  .workspace-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-heading .primary-button {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px 130px;
  }

  .filters input {
    width: 100%;
  }

  .record-table-head {
    display: none;
  }

  .company-application-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .company-summary {
    padding-top: 0;
  }

  .company-actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 0;
  }

  .company-position-row {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .position-row-identity {
    grid-column: 1 / -1;
  }

  .detail-position-card dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .application-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    padding: 18px;
  }

  .application-main,
  .row-actions {
    grid-column: 1 / -1;
  }

  .mobile-label {
    display: block;
    margin-bottom: 5px;
    color: #8b9591;
    font-size: 0.7rem;
    font-weight: 800;
  }

  .row-actions {
    justify-content: flex-start;
    padding-top: 2px;
  }

  .pipeline-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .follow-up-list,
  .next-step-list {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shell {
    width: calc(100% - 28px);
    padding-top: 30px;
  }

  .admin-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-heading .button-link {
    width: 100%;
  }

  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-filters {
    grid-template-columns: 1fr 1fr;
  }

  .admin-filters label:first-child {
    grid-column: 1 / -1;
  }

  .admin-table-head {
    display: none;
  }

  .admin-user-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    padding: 18px;
  }

  .admin-user-identity,
  .admin-dates,
  .admin-actions {
    grid-column: 1 / -1;
  }

  .admin-dates {
    padding-top: 2px;
  }

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

  .action-menu-popover {
    right: auto;
    left: 0;
  }

  .audit-list article {
    grid-template-columns: 82px minmax(0, 1fr);
    padding: 10px 0;
  }

  .audit-list time {
    grid-column: 2;
    text-align: left;
  }

  .footer-card {
    padding: 16px 16px 15px;
    border-radius: 10px;
  }

  .footer-row {
    justify-content: flex-start;
  }

  .footer-top,
  .record-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .topbar-actions {
    gap: 4px;
  }

  .blog-link,
  .quiet-link {
    padding: 0 8px;
  }

  .auth-intro,
  .auth-panel {
    padding: 28px 24px;
  }

  .auth-intro h1 {
    font-size: 2.05rem;
  }

  .auth-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 0;
  }

  .metrics-grid {
    gap: 9px;
  }

  .metric {
    padding: 14px;
  }

  .metric strong {
    min-height: 43px;
    font-size: 1.85rem;
  }

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

  .filters select {
    width: 100%;
  }

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

  .location-selects {
    grid-template-columns: 1fr;
  }

  .next-step-fields {
    grid-template-columns: 1fr;
  }

  .position-fields,
  .position-location-selects,
  .position-next-step-fields,
  .detail-position-card dl {
    grid-template-columns: 1fr;
  }

  .position-span-two {
    grid-column: auto;
  }

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

  .history-list article {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .history-list time {
    grid-column: 2;
    text-align: left;
  }

  .follow-up-item {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .follow-up-item em {
    grid-column: 2;
  }

  .next-step-item {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .admin-filters {
    grid-template-columns: 1fr;
  }

  .admin-filters label:first-child {
    grid-column: auto;
  }

  .admin-metrics {
    gap: 9px;
  }

  .admin-metrics article {
    padding: 14px;
  }

  .span-two {
    grid-column: auto;
  }

  .application-dialog form {
    padding: 20px;
  }

  .footer-wrap {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
