.bio-panel, .bio-face-dialog {
  width: min(1000px, 94vw);
  max-height: 90vh;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  padding: 24px;
  color: #1e293b;
  background: #ffffff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.bio-panel::backdrop, .bio-face-dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}
.bio-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.bio-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}
.bio-config, .bio-select, .bio-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 16px 0;
}
.bio-config label, .bio-select label {
  display: flex;
  gap: 6px;
  align-items: center;
}
.bio-panel input:not([type=checkbox]), .bio-panel select,
.bio-face-dialog input:not([type=checkbox]), .bio-face-dialog select {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  max-width: 100%;
}
.bio-member {
  min-width: 240px;
  flex: 1;
}
.bio-info {
  white-space: pre-wrap;
  background: #f1f5f9;
  padding: 14px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
}
.bio-table {
  overflow: auto;
}
.bio-panel table {
  width: 100%;
  border-collapse: collapse;
}
.bio-panel th, .bio-panel td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.bio-panel th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}
.bio-panel small {
  color: #64748b;
}
.bio-status {
  font-weight: 600;
}
.bio-message {
  min-height: 24px;
}

.bio-config input[type=checkbox] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  flex-shrink: 0;
}
.bio-config label {
  white-space: nowrap;
}
.bio-config label:has(input[type=checkbox]) {
  white-space: normal;
  max-width: 260px;
}
.bio-config input[name=ip] {
  width: 180px;
}
.bio-config input[name=port] {
  width: 90px;
}

/* Tab bar cho Modal Máy chấm công */
.bio-tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin: 16px 0 20px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.bio-tab-btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  color: #64748b;
  white-space: nowrap;
  transition: all 0.15s;
}
.bio-tab-btn:hover {
  color: #0f172a;
}
.bio-tab-btn.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.bio-tab-pane {
  display: none;
}
.bio-tab-pane.is-active {
  display: block;
}

/* ======================================================== */
/* MODAL ĐĂNG KÝ GƯƠNG MẶT (GỌN GÀNG, CHUYÊN BIỆT, MOBILE-FIRST) */
/* ======================================================== */
.bio-face-dialog {
  width: min(440px, 94vw);
  padding: 20px;
  border-radius: 18px;
  margin: auto;
}
.bio-face-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.bio-face-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bio-face-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 10px;
  font-size: 20px;
}
.bio-face-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}
.bio-face-header p {
  margin: 2px 0 0 0;
  font-size: 13px;
  color: #64748b;
}
.bio-face-close {
  background: #f1f5f9;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.15s;
}
.bio-face-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.bio-conn-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 14px;
}
.bio-conn-badge.is-online {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.bio-conn-badge.is-offline {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.bio-face-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 14px;
}
.bio-face-avatar-wrap {
  position: relative;
  width: 86px;
  height: 86px;
  flex-shrink: 0;
}
.bio-face-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: #e2e8f0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}
.bio-face-info {
  flex: 1;
  min-width: 0;
}
.bio-face-member-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bio-face-member-meta {
  font-size: 12.5px;
  color: #64748b;
  margin: 3px 0 6px 0;
}
.bio-face-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.bio-face-pill.is-present {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.bio-face-pill.is-absent {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.bio-face-change-photo-btn {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.bio-face-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bio-face-main-btn {
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  transition: all 0.15s;
  touch-action: manipulation;
}
.bio-face-main-btn:hover {
  background: #1d4ed8;
}
.bio-face-main-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.bio-face-sub-actions {
  display: flex;
  gap: 8px;
}
.bio-face-sub-actions button {
  flex: 1;
  min-height: 42px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
}
.bio-face-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  background: #f1f5f9;
  color: #475569;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.bio-face-feedback.is-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-weight: 600;
}
.bio-face-feedback.is-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 600;
}
.bio-face-feedback.is-loading {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  font-weight: 600;
}

.member-bio-card {
  padding: 20px;
  margin: 18px 0;
}
.member-bio-card p {
  margin: 8px 0;
}
.desktop-sync-status {
  padding: 10px 24px;
  background: #e6f3e9;
  color: #20553e;
  font-size: 13px;
  padding-left: 280px;
}
#attendance-home table {
  width: 100%;
  border-collapse: collapse;
}
#attendance-home td, #attendance-home th {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e0e7e2;
}

@media(max-width: 760px) {
  .desktop-sync-status {
    padding-left: 16px;
  }
}
@media(max-width: 600px) {
  .bio-panel {
    padding: 16px;
  }
  .bio-face-dialog {
    padding: 16px;
    width: 95vw;
  }
  .bio-config, .bio-select {
    align-items: stretch;
    flex-direction: column;
  }
  .bio-actions button {
    flex: 1 1 45%;
  }
}
