/* ==========================================================================
   BioSync Admin — design system
   A cohesive, enterprise SaaS look: calm neutrals, one confident brand accent,
   accessible contrast, full light/dark support.
   ========================================================================== */

:root {
  --brand: #5b5bd6;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-soft: #eef2ff;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --border: #e6e8ef;
  --text: #1a1c25;
  --text-muted: #6b7180;
  --text-faint: #9aa0ad;

  --ok: #16a34a;   --ok-soft: #e7f6ec;
  --warn: #d97706; --warn-soft: #fdf1e3;
  --err: #dc2626;  --err-soft: #fdeaea;
  --info: #2563eb; --info-soft: #e8f0fe;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 244px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1017; --surface: #171a23; --surface-2: #1c1f2a;
    --border: #262a37; --text: #e8eaf0; --text-muted: #9aa0ad; --text-faint: #6b7180;
    --brand-soft: #1e1f45;
    --ok-soft: #10241a; --warn-soft: #2a1e0d; --err-soft: #2a1213; --info-soft: #0f1c33;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 4px 12px rgba(0,0,0,.45);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1017; --surface: #171a23; --surface-2: #1c1f2a;
  --border: #262a37; --text: #e8eaf0; --text-muted: #9aa0ad; --text-faint: #6b7180;
  --brand-soft: #1e1f45;
  --ok-soft: #10241a; --warn-soft: #2a1e0d; --err-soft: #2a1213; --info-soft: #0f1c33;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 4px 12px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.5;
}
a { color: var(--brand-600); text-decoration: none; }
h1,h2,h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(91,91,214,.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(37,99,235,.14), transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px;
}
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-card h1 { font-size: 20px; }
.login-sub { color: var(--text-muted); margin: 4px 0 24px; font-size: 13px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--info)); color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.logo-text { font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px;
  color: var(--text-muted); cursor: pointer; font-weight: 550; font-size: 13.5px; user-select: none;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-700); border-color: color-mix(in srgb, var(--brand) 18%, transparent); }
.nav-item .ico { width: 18px; height: 18px; flex: none; }
.nav-spacer { flex: 1; }
.side-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-700);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}

/* ---------- Topbar + content ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px; display: flex; align-items: center; gap: 16px; padding: 0 26px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 17px; }
.topbar .spacer { flex: 1; }
.content { padding: 26px; max-width: 1280px; width: 100%; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1080px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 720px) { .app { grid-template-columns: 1fr; } .sidebar { display: none; } .cols-4,.cols-3,.cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; }
.card-head .spacer { flex: 1; }

/* KPI stat */
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.stat .label { color: var(--text-muted); font-size: 12.5px; font-weight: 600; letter-spacing: .01em; }
.stat .value { font-size: 30px; font-weight: 720; letter-spacing: -.02em; line-height: 1; }
.stat .foot { font-size: 12px; color: var(--text-faint); display:flex; align-items:center; gap:6px; }
.stat .ico-wrap { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; padding: 11px 16px; color: var(--text-muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.t-mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.t-strong { font-weight: 600; }
.empty { padding: 40px; text-align: center; color: var(--text-faint); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.err { color: var(--err); background: var(--err-soft); }
.badge.info { color: var(--info); background: var(--info-soft); }
.badge.muted { color: var(--text-muted); background: var(--surface-2); }

/* ---------- Buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 9px 15px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: .12s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn.primary:hover { background: var(--brand-700); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(10,12,20,.5); display: grid; place-items: center;
  z-index: 50; padding: 20px; backdrop-filter: blur(2px);
}
.modal {
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; } .modal-head .spacer { flex: 1; }
.modal-body { padding: 22px; } .modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.x-btn { cursor: pointer; color: var(--text-faint); font-size: 20px; line-height: 1; background: none; border: none; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start;
  animation: slidein .18s ease; font-size: 13px;
}
.toast .bar { width: 3px; border-radius: 3px; align-self: stretch; }
.toast.ok .bar { background: var(--ok); } .toast.err .bar { background: var(--err); } .toast.info .bar { background: var(--info); }
.toast.warn .bar { background: var(--warn); }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Devices console ---------- */
.dev-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.dev-toolbar .spacer { flex: 1; }
.dev-kpis {
  display: flex; align-items: stretch; gap: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.dev-kpi { padding: 10px 18px; border-right: 1px solid var(--border); min-width: 84px; }
.dev-kpi:last-child { border-right: none; }
.dev-kpi .n { font-size: 20px; font-weight: 720; letter-spacing: -.02em; line-height: 1.1; }
.dev-kpi .n.ok { color: var(--ok); } .dev-kpi .n.err { color: var(--err); }
.dev-kpi .l { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.dev-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px;
  transition: box-shadow .15s, border-color .15s;
}
.dev-card:hover { box-shadow: var(--shadow-md); }
.dev-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dev-ident { display: flex; align-items: center; gap: 11px; cursor: pointer; min-width: 0; }
.dev-glyph {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.dev-glyph .ico { width: 20px; height: 20px; }
.dev-glyph.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.dev-glyph.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.dev-glyph.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.dev-name { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; flex: none; white-space: nowrap;
}
.status-pill.ok { color: var(--ok); background: var(--ok-soft); }
.status-pill.err { color: var(--err); background: var(--err-soft); }
.status-pill.warn { color: var(--warn); background: var(--warn-soft); }
.status-pill.muted { color: var(--text-muted); background: var(--surface-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; position: relative; }
.status-pill.ok .live-dot { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.dev-meta { display: grid; gap: 7px; }
.dev-meta .mrow, .detail-grid .mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.dev-meta .k, .detail-grid .k { color: var(--text-muted); font-weight: 600; }
.dev-meta .v, .detail-grid .v { color: var(--text); font-weight: 550; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dev-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.dev-stat { text-align: center; }
.dev-stat .n { font-size: 19px; font-weight: 720; letter-spacing: -.02em; line-height: 1.1; }
.dev-stat .n .u { font-size: 11px; font-weight: 600; color: var(--text-faint); margin-left: 1px; }
.dev-stat .l { font-size: 10.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-top: 3px; }

.dev-foot { display: flex; align-items: center; gap: 8px; }
.dev-foot .btn.primary { flex: 1; }
.btn.icon-only { padding: 6px 8px; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; min-width: 214px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 6px; display: flex; flex-direction: column; gap: 1px;
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none;
  padding: 8px 10px; border-radius: 7px; cursor: pointer; color: var(--text); font: inherit; font-size: 13px; font-weight: 550;
}
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--err); }
.menu button.danger:hover { background: var(--err-soft); }
.menu button svg { flex: none; color: var(--text-muted); }
.menu button.danger svg { color: var(--err); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 2px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; padding: 14px 0; border-top: 1px solid var(--border); }
.detail-h { font-size: 13px; font-weight: 650; margin: 18px 0 10px; color: var(--text); }

@media (max-width: 560px) { .dev-grid { grid-template-columns: 1fr; } .dev-kpis { width: 100%; } .detail-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Employee form (branded teal card) — ported from the P266 design.
   Deliberately light-themed and self-contained under .emp-card / .emp-overlay.
   ========================================================================== */
.emp-overlay {
  position: fixed; inset: 0; background: rgba(10,12,20,.55); z-index: 60;
  overflow: auto; padding: 28px 16px; backdrop-filter: blur(2px);
}
.emp-card {
  --app-dark:#157370; --app-mid:#1d9490; --app-teal:#1e8a6e; --app-teal-light:#e8f5f1;
  --app-teal-border:#b2ddd0; --app-text:#1a2e28; --app-muted:#5a7a70; --app-bg:#f3f7f5;
  --app-white:#fff; --app-border:#d4e8e0; --app-red:#dc3545;
  max-width: 900px; margin: 0 auto; background: var(--app-white);
  border-radius: 14px; border: 1px solid var(--app-border);
  overflow: hidden; font-family: 'Segoe UI', system-ui, sans-serif; color: var(--app-text);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.emp-header {
  background: linear-gradient(135deg, var(--app-dark) 0%, var(--app-mid) 100%);
  padding: 1.5rem 1.75rem; display: flex; align-items: center; gap: 14px;
}
.emp-header-icon {
  width: 48px; height: 48px; background: rgba(255,255,255,0.12);
  border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.emp-header h2 { color: #fff; font-size: 18px; font-weight: 700; margin: 0; }
.emp-header p  { color: rgba(255,255,255,0.72); font-size: 12.5px; margin: 3px 0 0; }

.emp-body { padding: 1.75rem; display: flex; flex-direction: column; gap: 1.5rem; }
.emp-section { display: flex; flex-direction: column; gap: 1rem; }
.emp-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .9px;
  color: var(--app-teal); padding-bottom: .5rem; border-bottom: 2px solid var(--app-teal-light);
  display: flex; align-items: center; gap: 7px;
}
.emp-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.emp-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.emp-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1rem; }
.emp-field { display: flex; flex-direction: column; gap: .45rem; }
.emp-label { font-size: 13px; font-weight: 600; color: var(--app-text); }
.emp-label .req { color: var(--app-red); margin-left: 2px; }
.emp-hint { font-size: 11.5px; color: var(--app-muted); line-height: 1.5; margin-top: 2px; }

.emp-card input[type="text"], .emp-card input[type="number"], .emp-card input[type="email"],
.emp-card input[type="password"], .emp-card input[type="date"], .emp-card select, .emp-card textarea {
  width: 100%; height: 40px; border: 1.5px solid var(--app-border);
  border-radius: 8px; padding: 0 12px; font-size: 13.5px; color: var(--app-text);
  background: var(--app-white); outline: none; appearance: none;
  font-family: 'Segoe UI', system-ui, sans-serif; transition: border-color .2s, box-shadow .2s; box-sizing: border-box;
}
.emp-card textarea { height: 80px; padding: 10px 12px; resize: vertical; }
.emp-card input:focus, .emp-card select:focus, .emp-card textarea:focus {
  border-color: var(--app-teal); box-shadow: 0 0 0 3px rgba(30,138,110,.12);
}
.emp-card ::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }

.emp-time-row { display: flex; gap: 6px; align-items: center; }
.emp-time-row select { flex: 1; }
.emp-time-sep { color: var(--app-muted); font-weight: 700; flex-shrink: 0; }

.emp-yn-row { display: flex; gap: .5rem; }
.emp-yn-btn {
  flex: 1; height: 38px; border-radius: 8px; border: 1.5px solid var(--app-border);
  background: var(--app-white); font-size: 13px; font-weight: 600; color: var(--app-muted);
  cursor: pointer; transition: all .2s;
}
.emp-yn-btn:disabled { opacity: .4; cursor: not-allowed; }
.emp-yn-yes.emp-yn-sel { border-color: #b8ddc7; background: #f0faf4; color: #1a7a3a; }
.emp-yn-no.emp-yn-sel  { border-color: #f0c4c4; background: #fff5f5; color: #b84040; }

.emp-conditional { overflow: hidden; transition: max-height .35s ease, opacity .35s ease; max-height: 0; opacity: 0; pointer-events: none; }
.emp-conditional.emp-visible { max-height: 200px; opacity: 1; pointer-events: all; }

.emp-img-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px;
  border: 2px dashed var(--app-border); border-radius: 12px; background: var(--app-bg); cursor: pointer; transition: all .2s;
}
.emp-img-wrap:hover { border-color: var(--app-teal); background: var(--app-teal-light); }
.emp-img-preview { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid var(--app-teal-border); display: none; }
.emp-img-placeholder { width: 90px; height: 90px; border-radius: 50%; background: var(--app-teal-light); border: 3px solid var(--app-teal-border); display: flex; align-items: center; justify-content: center; }
.emp-img-wrap input[type="file"] { display: none; }
.emp-img-label { font-size: 12.5px; font-weight: 600; color: var(--app-teal); cursor: pointer; }
.emp-img-sub { font-size: 11px; color: var(--app-muted); }

.emp-policy-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.emp-policy-found { background: #e8f5f1; color: #157370; }
.emp-policy-none  { background: #f1f1f1; color: #8a95a3; }

.emp-divider { border: none; border-top: 1px solid var(--app-border); margin: .25rem 0; }
.emp-footer { padding: 1.25rem 1.75rem; background: var(--app-bg); border-top: 1px solid var(--app-border); display: flex; justify-content: flex-end; gap: .75rem; align-items: center; }
.emp-btn-cancel { height: 40px; padding: 0 22px; border-radius: 8px; border: 1.5px solid var(--app-border); background: var(--app-white); color: var(--app-muted); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .2s; }
.emp-btn-cancel:hover { border-color: #aaa; color: var(--app-text); }
.emp-btn-save { height: 40px; padding: 0 28px; border-radius: 8px; border: none; background: linear-gradient(135deg, var(--app-dark) 0%, var(--app-mid) 100%); color: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: all .2s; }
.emp-btn-save:hover { opacity: .9; }
.emp-btn-save:disabled { opacity: .55; cursor: not-allowed; }

.password-strength { margin-top: 8px; }
.strength-meter { height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.strength-meter-fill { height: 100%; width: 0%; transition: all .3s ease; border-radius: 3px; }
.strength-text { font-size: 12px; margin-top: 5px; font-weight: 600; }
.strength-weak { background: #dc3545; } .strength-normal { background: #ffc107; } .strength-strong { background: #28a745; }
.password-requirements { margin-top: 10px; padding: 10px; background: #f8f9fa; border-radius: 6px; font-size: 12px; border-left: 3px solid #dee2e6; }
.password-requirements strong { display: block; margin-bottom: 8px; color: #333; }
.password-requirements ul { margin: 0; padding-left: 20px; }
.password-requirements li { margin: 4px 0; color: #dc3545; transition: all .2s ease; }
.password-requirements li.valid { color: #28a745; text-decoration: line-through; }

@media (max-width: 720px) {
  .emp-row-2, .emp-row-3, .emp-row-4 { grid-template-columns: 1fr; }
}

/* ---------- Misc ---------- */
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; color: var(--text-muted); border: 1px solid transparent; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.muted { color: var(--text-muted); }
.flex { display: flex; align-items: center; gap: 10px; }
.mt-4 { margin-top: 16px; } .mb-3 { margin-bottom: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid color-mix(in srgb, var(--brand) 30%, transparent); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: grid; place-items: center; padding: 60px; }
.pill-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.pill-tabs button { border: none; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--text-muted); font-weight: 600; font-size: 12.5px; }
.pill-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Integration / API settings ---------- */
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; font-size: 12.5px; }

.int-top {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border);
}

/* Toggle switch — a two-state setting reads better as a switch than a Yes/No dropdown. */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative; width: 38px; height: 21px; border-radius: 999px;
  background: var(--border); transition: background .18s ease; flex: none;
}
.switch-knob {
  position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .18s ease;
}
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.switch-label { font-size: 13px; font-weight: 600; color: var(--text); }

.api-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; background: var(--surface-2); }
.api-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.api-group-head > span:first-child { font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.api-group-sub { font-size: 12px; color: var(--text-faint); }
.api-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 12px 0 0; }
.api-note code, .probe-keys code {
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px;
}

.api-row { padding: 11px 0; border-top: 1px solid var(--border); }
.api-row:first-of-type { border-top: none; padding-top: 0; }
.api-row-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 7px; flex-wrap: wrap; }
.api-name { font-size: 13px; font-weight: 650; }
.api-hint { font-size: 12px; color: var(--text-faint); }

/* HTTP verb chips — which endpoints BioSync reads from vs. writes to, at a glance. */
.method {
  font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 5px; border: 1px solid currentColor; flex: none;
}
.m-get { color: var(--ok); background: var(--ok-soft); }
.m-post { color: var(--info); background: var(--info-soft); }
.m-delete { color: var(--err); background: var(--err-soft); }

.api-res {
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--text-faint);
  margin-top: 5px; word-break: break-all;
}
.api-res-warn { color: var(--warn); }
.api-probe { margin-top: 7px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.probe-msg { font-size: 12px; color: var(--text-muted); }
.probe-keys { flex-basis: 100%; font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

.probe-pill {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  font-family: ui-monospace, Consolas, monospace;
}
.probe-pill.ok { color: var(--ok); background: var(--ok-soft); }
.probe-pill.err { color: var(--err); background: var(--err-soft); }
.probe-pill.info { color: var(--info); background: var(--info-soft); }
.probe-pill.muted { color: var(--text-muted); background: var(--surface-2); }

.int-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.int-actions .spacer { flex: 1; }

.probe-panel { margin-top: 16px; border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface-2); }
.probe-panel.ok { border-left-color: var(--ok); }
.probe-panel.warn { border-left-color: var(--warn); }
.probe-panel.err { border-left-color: var(--err); }
.probe-panel.info { border-left-color: var(--info); }
.probe-headline { font-size: 13px; font-weight: 650; margin-bottom: 10px; }
/* Fixed layout: resolved URLs are long enough to push the Result/Detail columns off-screen otherwise. */
.probe-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12.5px; }
.probe-table th:nth-child(1), .probe-table td:nth-child(1) { width: 74px; }
.probe-table th:nth-child(3), .probe-table td:nth-child(3) { width: 118px; }
.probe-table th:nth-child(4), .probe-table td:nth-child(4) { width: 32%; }
.probe-table td:nth-child(2) { word-break: break-word; }
.probe-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-faint); font-weight: 700; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--border);
}
.probe-table td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.probe-table tr:last-child td { border-bottom: none; }
.probe-url { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--text-faint); margin-top: 3px; word-break: break-all; }
.probe-detail { color: var(--text-muted); word-break: break-word; }

@media (max-width: 720px) {
  .int-top { align-items: flex-start; }
  .probe-table, .probe-table tbody { display: block; }
  .probe-table thead { display: none; }
  .probe-table td, .probe-table td:nth-child(n) { display: block; width: auto; padding: 3px 0; border: none; }
  .probe-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
}

/* ---------- Biometric enrollment: hand diagram ---------- */
/* The terminal shows two hands and asks you to tap a finger; mirroring that here means an operator who
   knows the machine needs no explanation. Colour alone never carries the state — every finger also has a
   title tooltip, and the picked list below the hands names each one in words. */

/* Enough gap that the two inward-pointing thumbs do not touch — palms face the viewer, so they meet in
   the middle exactly as they do on the terminal's own diagram. */
.fp-hands { display: flex; gap: 20px; justify-content: center; padding: 6px 0 2px; }
.fp-hand-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fp-hand-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.fp-hand { max-width: 100%; height: auto; }

/* Filled with --surface, not --surface-2: the picker panel is already --surface-2, and matching it made
   the hand disappear into its own background. */
.fp-palm { fill: var(--surface); stroke: var(--border); stroke-width: 2; }
.fp-finger {
  fill: var(--surface); stroke: var(--border); stroke-width: 2;
  transition: fill .15s, stroke .15s;
}
.fp-hand.interactive .fp-finger { cursor: pointer; }
.fp-hand.interactive .fp-finger:hover { fill: var(--info-soft); stroke: var(--info); }

.fp-finger.enrolled { fill: var(--ok-soft); stroke: var(--ok); }
.fp-finger.selected { fill: color-mix(in srgb, var(--brand) 18%, transparent); stroke: var(--brand); }
.fp-finger.pending  { fill: var(--warn-soft); stroke: var(--warn); animation: fp-wait 1.4s ease-in-out infinite; }
@keyframes fp-wait { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .fp-finger.pending { animation: none; } }

.fp-legend { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 10px;
  font-size: 12px; color: var(--text-muted); }
.fp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fp-key { width: 11px; height: 11px; border-radius: 3px; background: var(--surface-2);
  border: 1.5px solid var(--border); display: inline-block; }
.fp-key.enrolled { background: var(--ok-soft); border-color: var(--ok); }
.fp-key.pending  { background: var(--warn-soft); border-color: var(--warn); }
.fp-key.selected { background: color-mix(in srgb, var(--brand) 18%, transparent); border-color: var(--brand); }

.fp-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px; }
.fp-picked { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 12px; min-height: 24px; }
.fp-chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }

/* Ten dots in device finger order — a whole-hand summary compact enough for a table cell. */
.fp-pips { display: inline-flex; align-items: center; gap: 3px; }
.fp-pip { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2);
  border: 1.5px solid var(--border); display: inline-block; }
.fp-pip.enrolled { background: var(--ok); border-color: var(--ok); }
.fp-pip.pending { background: var(--warn); border-color: var(--warn); }

/* ---------- Bulk registration ---------- */
.bio-toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.bio-field { display: flex; flex-direction: column; gap: 5px; }
.bio-field > span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.bio-field select, .bio-field input { min-width: 190px; }
.bio-grow { flex: 1; min-width: 200px; }
.bio-grow input { width: 100%; }

.bio-split { display: grid; grid-template-columns: 344px 1fr; gap: 22px; align-items: start; }
.bio-picker { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface-2); }
.bio-table-wrap { max-height: 460px; overflow-y: auto; }
.bio-sel { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.bio-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px;
  padding-top: 16px; border-top: 1px solid var(--border); }
.bio-actions .spacer { flex: 1; }

.emp-fp { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface-2); }

@media (max-width: 900px) {
  .bio-split { grid-template-columns: 1fr; }
  .bio-table-wrap { max-height: none; }
}
