.employee-tools {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.employee-tools small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.employee-tools input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.employee-tools button,
.employee-pages button {
  border: 0;
  background: var(--brand);
  color: white;
  padding: 10px 13px;
  border-radius: 9px;
  cursor: pointer;
}

.employee-pages {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.employee-pages button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.employee-quick-access {
  display: none;
}

.employee-status-filters {
  width: fit-content;
  margin: 0 0 14px;
}

.employee-data-row td:nth-child(2) {
  font-weight: 700;
  color: #071b35;
  letter-spacing: -.01em;
}

.employee-card .record-summary small {
  font-weight: 700;
  color: #071b35;
  font-size: 14px;
}

/* Primary employee actions stay as one compact, predictable group. */
.employee-action-bar {
  display: grid;
  grid-template-columns: minmax(96px,1.2fr) minmax(82px,1fr) 56px 76px;
  gap: 6px;
  align-items: center;
  width: min(100%, 340px);
  margin-left: auto;
}

.employee-action-bar > button,
.employee-more-toggle,
.employee-more-menu button {
  min-height: 36px;
  border: 1px solid #d8e2eb;
  border-radius: 9px;
  background: #fff;
  color: #153c63;
  padding: 7px 9px;
  font-size: .86rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.employee-action-bar > button:first-child {
  background: #0b5cad;
  border-color: #0b5cad;
  color: #fff;
}

.employee-action-bar > button:disabled {
  opacity: .42;
  cursor: not-allowed;
  background: #f4f6f8;
  color: #7e8b97;
}

.employee-more { position: relative; min-width: 0; }
.employee-more-toggle { display: inline-flex; width: 100%; align-items: center; justify-content: center; gap: 5px; }
.employee-more-toggle span { font-size: 13px; }
.employee-more-menu {
  position: absolute;
  z-index: 20;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  padding: 6px;
  border: 1px solid #d8e2eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15,37,61,.16);
}
.employee-more-menu[hidden] { display: none; }
.employee-more-menu button { display: block; width: 100%; text-align: left; margin: 0; border: 0; }
.employee-more-menu button:hover { background: #f3f7fb; }
.employee-more-menu button.danger { color: #b4232d; background: #fff7f7; }

@media (min-width: 651px) {
  .table-wrap.has-mobile-cards { overflow-x: auto; }
  .table-wrap.has-mobile-cards table { width: 100%; min-width: 1080px; table-layout: fixed; }
  .table-wrap.has-mobile-cards th,
  .table-wrap.has-mobile-cards td { overflow-wrap: anywhere; }
  .employee-data-row td {
    padding-top: 14px;
    padding-bottom: 14px;
    vertical-align: middle;
  }
  .employee-data-row td:nth-child(2) { font-size: 15px; }
  .employee-data-row td:last-child,
  .table-wrap.has-mobile-cards th:last-child { width: 350px; min-width: 350px; }
  .table-wrap.has-mobile-cards th:nth-child(1){width:8%}
  .table-wrap.has-mobile-cards th:nth-child(2){width:12%}
  .table-wrap.has-mobile-cards th:nth-child(3){width:13%}
  .table-wrap.has-mobile-cards th:nth-child(4){width:11%}
  .table-wrap.has-mobile-cards th:nth-child(5){width:10%}
  .table-wrap.has-mobile-cards th:nth-child(6){width:9%}
  .table-wrap.has-mobile-cards th:nth-child(7){width:8%}
  .table-wrap.has-mobile-cards th:nth-child(8){width:8%}
}

@media (max-width: 1180px) and (min-width: 651px) {
  .employee-action-bar {
    grid-template-columns: minmax(92px,1.2fr) minmax(78px,1fr) 52px 72px;
    width: 320px;
    gap: 5px;
  }
  .employee-action-bar > button,
  .employee-more-toggle { padding: 7px 7px; font-size: .82rem; }
  .employee-data-row td:last-child,
  .table-wrap.has-mobile-cards th:last-child { width: 330px; min-width: 330px; }
}

@media (max-width: 760px) {
  .employee-tools { grid-template-columns: 1fr; }
  .employee-status-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }
}

@media (max-width: 650px) {
  .employee-quick-access {
    display: grid;
    gap: 6px;
    margin: 0 0 12px;
    color: var(--ink);
    font-weight: 700;
  }
  .employee-quick-access select {
    width: 100%;
    min-height: 44px;
    padding: 9px 38px 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font: inherit;
  }
  .employee-mobile-records, .employee-card, .employee-card .record-summary,
  .employee-card .record-summary > div { min-width: 0; max-width: 100%; }
  .employee-card { overflow: visible; }
  .employee-card .record-summary strong, .employee-card .record-summary small,
  .employee-card-fields span { overflow-wrap: anywhere; word-break: break-word; }
  .employee-card-fields { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 10px; color: var(--muted); font-size: 12px; }
  .employee-card-fields span { min-width: 0; }
  .employee-card-fields span:not(:last-child)::after { content: "\00a0\00b7"; color: #a7b2b8; }
  .employee-action-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    justify-content: stretch;
    margin-top: 12px;
  }
  .employee-action-bar > button, .employee-more, .employee-more-toggle { width: 100%; min-width: 0; }
  .employee-action-bar > button, .employee-more-toggle, .employee-more-menu button {
    min-height: 44px;
    padding: 8px 7px;
    text-align: center;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .employee-more-menu {
    right: 0;
    top: auto;
    bottom: calc(100% + 6px);
    width: min(220px, 100%);
  }
  .employee-more-menu button { text-align: left; }
}
