/* Production patch: minimalist access, compact filters, sortable table headers and Agent controls */
body:has(.login-card-modern),
body:has(.auth-flow-card) {
  background: #f7f5f2;
}

.login-screen {
  position: relative;
  min-height: 100svh;
  padding: 32px;
  background: #f7f5f2;
  place-items: center;
}

.login-screen::before {
  content: "EduBroker";
  position: fixed;
  top: 24px;
  left: 42px;
  color: rgba(23, 32, 51, 0.22);
  font-size: 28px;
  font-weight: 850;
}

.login-card-modern {
  width: min(402px, calc(100vw - 44px));
  min-height: 0;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(23, 32, 51, 0.08);
}

.auth-flow-card {
  width: min(560px, calc(100vw - 44px));
  max-height: calc(100svh - 64px);
  min-height: 0;
  overflow: auto;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(23, 32, 51, 0.08);
}

.login-card-modern .login-intro {
  display: none;
}

.login-form-panel {
  display: grid;
  gap: 28px;
  padding: 34px 48px 30px;
  border: 0;
  background: #fff;
}

.auth-flow-card {
  display: grid;
  gap: 18px;
  padding: 32px 30px 28px;
}

.login-form-panel > div:first-child {
  display: grid;
  justify-items: center;
  text-align: center;
}

.auth-flow-card > div:first-child::before {
  content: "EduBroker";
  color: var(--accent);
  font-size: 16px;
  font-weight: 850;
}

.login-form-panel h1,
.auth-flow-card h1 {
  margin: 0;
  color: var(--accent);
  font-size: 16px;
  font-weight: 850;
  text-align: center;
}

.login-form-panel .muted,
.auth-flow-card .muted,
.auth-flow-card .eyebrow {
  display: none;
}

.login-form-panel .field,
.auth-flow-card .field {
  gap: 7px;
}

.login-form-panel .field label,
.auth-flow-card .field label {
  color: #8f332b;
  font-size: 13px;
  font-weight: 650;
  text-transform: none;
}

.login-form-panel input,
.auth-flow-card input {
  min-height: 42px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(23, 32, 51, 0.28);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  box-shadow: none;
}

.login-form-panel input:focus,
.auth-flow-card input:focus {
  outline: 0;
  border-bottom-color: var(--accent);
  background: transparent;
  box-shadow: 0 1px 0 var(--accent);
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 22px;
  margin-top: 2px;
}

.login-actions .primary-button,
.login-actions .text-button,
.login-forgot-button {
  width: 100%;
  min-height: 26px;
  justify-content: center;
  font-weight: 650;
}

.login-actions .primary-button,
.auth-flow-card .primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: #a24d55;
  color: #fff;
  font-size: 15px;
  font-weight: 750;
}

.login-actions .text-button,
.login-forgot-button,
.auth-flow-card .text-button {
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8f332b;
  box-shadow: none;
}

.login-forgot-button {
  justify-self: center;
  width: max-content;
  margin-top: 8px;
}

.auth-message {
  border-radius: 6px;
}

.sortable-th button,
.prod-sort-button {
  display: inline-flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.sortable-th button:hover span:first-child,
.prod-sort-button:hover span:first-child {
  color: var(--accent);
}

.sortable-th .sort-arrow {
  display: inline-flex;
  min-width: 14px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
}

.search-toolbar .search-input,
.candidate-search-row .search-input,
.admin-applications-search-row .search-input,
.study-search-row .search-input {
  min-height: 42px;
  min-width: 260px;
  font-size: 14px;
  font-weight: 650;
}

.filter-dropdown summary,
.sort-order-control select,
.multi-choice-menu label {
  font-size: 13px;
  letter-spacing: 0;
}

.candidate-filter-row,
.admin-applications-filter-row,
.study-filter-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  width: 100%;
}

.candidate-filter-row .sort-control,
.admin-applications-filter-row .sort-control,
.study-filter-row .sort-control,
.agent-list-toolbar .sort-control {
  display: grid;
  grid-column: auto;
  grid-template-columns: auto minmax(0, 1fr);
  justify-self: stretch;
  min-width: 0;
}

.candidate-filter-row .sort-order-control,
.admin-applications-filter-row .sort-order-control,
.study-filter-row .sort-order-control,
.agent-list-toolbar .sort-order-control {
  width: 100%;
  min-width: 0;
}

.candidate-filter-row .sort-order-control span,
.admin-applications-filter-row .sort-order-control span,
.study-filter-row .sort-order-control span,
.agent-list-toolbar .sort-order-control span {
  align-self: center;
  font-size: 11px;
}

.agent-admin-password-controls {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: start;
}

.agent-admin-password-controls .settings-note.full {
  grid-column: 1 / -1;
}

.agent-admin-password-controls .field {
  min-width: 0;
}

.agent-directory-table {
  min-width: 1040px;
  table-layout: fixed;
}

.agent-directory-table th:nth-child(1),
.agent-directory-table td:nth-child(1) {
  width: 26%;
}

.agent-directory-table th:nth-child(2),
.agent-directory-table td:nth-child(2) {
  width: 20%;
}

.agent-directory-table th:nth-child(3),
.agent-directory-table td:nth-child(3) {
  width: 12%;
}

.agent-directory-table th:nth-child(4),
.agent-directory-table td:nth-child(4) {
  width: 24%;
}

.agent-directory-table th:nth-child(5),
.agent-directory-table td:nth-child(5) {
  width: 18%;
}

.agent-directory-table .row-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  white-space: nowrap;
}

.agent-directory-table .row-actions .text-button {
  min-height: 32px;
  padding-inline: 9px;
}

@media (max-width: 760px) {
  .login-screen {
    align-items: center;
    padding: 18px;
  }

  .login-screen::before {
    top: 16px;
    left: 22px;
    font-size: 22px;
  }

  .login-card-modern {
    width: min(390px, 100%);
  }

  .login-form-panel {
    gap: 24px;
    padding: 30px 28px 28px;
  }

  .auth-flow-card {
    width: 100%;
    max-height: calc(100svh - 36px);
    padding: 24px 18px;
  }

  .search-toolbar .search-input,
  .candidate-search-row .search-input,
  .admin-applications-search-row .search-input,
  .study-search-row .search-input {
    min-width: 0;
    width: 100%;
  }

  .candidate-filter-row,
  .admin-applications-filter-row,
  .study-filter-row,
  .agent-admin-password-controls {
    grid-template-columns: 1fr;
  }

  .sortable-th button,
  .prod-sort-button {
    min-height: 36px;
  }
}
