/* ============================================================
   管理后台
   ============================================================ */
.admin-body {
  background: #f3f5f3;
  color: var(--ink);
}

.layout {
  min-height: 100dvh;
  display: flex;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 120;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  background:
    radial-gradient(420px 300px at 20% 0%, rgba(30, 137, 119, 0.16), transparent 65%),
    linear-gradient(180deg, #0b2420 0%, #081d19 100%);
  color: #e5f2ed;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 22px;
  color: #fff;
  min-width: 0;
}
.sidebar-brand img {
  border-radius: 11px;
  flex: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}
.sidebar-brand-text strong {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-brand-text small {
  font-size: 10px;
  color: rgba(195, 229, 219, 0.48);
  letter-spacing: 0.09em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-close {
  display: none;
  margin-left: auto;
  border: 0;
  background: rgba(255, 255, 255, 0.07);
  color: #cfe8df;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  place-items: center;
  flex: none;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.nav-label {
  padding: 16px 12px 7px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: rgba(184, 219, 208, 0.32);
  text-transform: uppercase;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border-radius: 9px;
  color: rgba(218, 239, 232, 0.67);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  min-width: 0;
}
.nav-item svg {
  flex: none;
  opacity: 0.8;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(25, 148, 128, 0.24), rgba(25, 148, 128, 0.08));
  color: #f0fbf6;
  box-shadow: inset 0 0 0 1px rgba(90, 210, 182, 0.1);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #38c6a8;
  box-shadow: 0 0 14px rgba(56, 198, 168, 0.55);
}
.nav-item.active svg {
  color: #55d6ba;
  opacity: 1;
}
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(220, 245, 236, 0.6);
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}
.sidebar-foot {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.admin-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  transition: background 0.15s;
}
.admin-card:hover {
  background: rgba(255, 255, 255, 0.045);
}
.admin-card .avatar {
  --avatar-size: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #a7ecd9;
}
.admin-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}
.admin-card-info strong {
  font-size: 12px;
  font-weight: 600;
  color: #e7f6f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-card-info small {
  font-size: 10px;
  color: rgba(196, 230, 219, 0.42);
}
.admin-card .logout-btn {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: rgba(213, 239, 230, 0.45);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}
.admin-card .logout-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.sidebar-version {
  padding: 7px 10px 0;
  font-size: 9.5px;
  color: rgba(185, 218, 207, 0.24);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
}
.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 22, 18, 0.45);
  backdrop-filter: blur(2px);
  z-index: 110;
}

/* ============================================================
   Main / topbar
   ============================================================ */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(243, 245, 243, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(215, 224, 219, 0.7);
}
.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  place-items: center;
  color: var(--ink);
  flex: none;
}
.topbar-heading {
  min-width: 0;
}
.topbar-heading .eyebrow {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 5px;
}
.topbar-heading h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}
.topbar-clock {
  display: flex;
  flex-direction: column;
  text-align: right;
  margin-right: 6px;
  line-height: 1.35;
}
.topbar-clock strong {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.topbar-clock span {
  font-size: 10px;
  color: var(--muted-2);
}
.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 2px;
}
.topbar-user {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #cfe9e1, #a9d8cb);
  color: #0d5e54;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.page {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 26px 32px 70px;
  flex: 1;
}
.page > * {
  animation: page-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Cards / layout
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-xs);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 22px 0;
}
.card-head h3 {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.card-head p {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted-2);
}
.card-body {
  padding: 18px 22px 22px;
}
.card-link {
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.card-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   Hero
   ============================================================ */
.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 30px 32px;
  margin-bottom: 20px;
  background:
    radial-gradient(640px 340px at 88% 8%, rgba(42, 190, 158, 0.28), transparent 60%),
    radial-gradient(500px 380px at 100% 100%, rgba(120, 180, 100, 0.13), transparent 60%),
    linear-gradient(120deg, #0a2c26 0%, #0a231f 58%, #071b18 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 30px;
  min-height: 212px;
  isolation: isolate;
  border: 1px solid rgba(10, 44, 38, 0.2);
  box-shadow: 0 18px 50px rgba(10, 44, 38, 0.18);
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(100deg, transparent 20%, #000 100%);
  pointer-events: none;
  z-index: -1;
}
.hero-copy {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #b9e8d9;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.hero-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
}
.hero-copy h2 {
  margin-top: 14px;
  font-size: clamp(23px, 2.2vw, 30px);
  line-height: 1.3;
  font-weight: 720;
  letter-spacing: -0.03em;
  color: #f4fbf8;
}
.hero-copy h2 em {
  font-style: normal;
  color: #7ee0c6;
}
.hero-copy p {
  margin-top: 9px;
  font-size: 12.8px;
  color: rgba(214, 241, 231, 0.58);
  max-width: 540px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 21px;
  flex-wrap: wrap;
}
.btn-hero {
  --btn-bg: #f3fbf7;
  --btn-color: #0a3b33;
  --btn-border: #f3fbf7;
  height: 38px;
  font-size: 12.8px;
  border-radius: 9px;
}
.btn-hero:hover {
  background: #fff;
  border-color: #fff;
}
.btn-hero-ghost {
  --btn-bg: rgba(255, 255, 255, 0.07);
  --btn-color: #e3f5ee;
  --btn-border: rgba(255, 255, 255, 0.14);
  height: 38px;
  font-size: 12.8px;
  border-radius: 9px;
}
.btn-hero-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.hero-art {
  flex: none;
  width: 238px;
  height: 152px;
  position: relative;
  z-index: 1;
}
.hero-orbit {
  position: absolute;
  width: 220px;
  height: 220px;
  right: -30px;
  top: -30px;
  border: 1px solid rgba(126, 224, 198, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(126, 224, 198, 0.03), 0 0 0 68px rgba(126, 224, 198, 0.02);
}
.hero-id {
  position: absolute;
  right: 8px;
  top: 16px;
  width: 190px;
  padding: 13px;
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: rotate(3deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}
.hero-id-top {
  display: flex;
  align-items: center;
  gap: 9px;
}
.hero-id-top .avatar {
  --avatar-size: 30px;
  background: rgba(255, 255, 255, 0.15);
  color: #c9f7e8;
  border-color: rgba(255, 255, 255, 0.14);
}
.hero-id-top strong {
  display: block;
  font-size: 11.5px;
  color: #effaf6;
  line-height: 1.3;
}
.hero-id-top span {
  font-size: 8.5px;
  color: rgba(207, 238, 227, 0.48);
}
.hero-mini-qr {
  margin-top: 11px;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.hero-mini-qr i {
  background: #0c2a24;
  border-radius: 1px;
}
.hero-mini-qr i:nth-child(2),
.hero-mini-qr i:nth-child(5),
.hero-mini-qr i:nth-child(7),
.hero-mini-qr i:nth-child(15),
.hero-mini-qr i:nth-child(19),
.hero-mini-qr i:nth-child(23) {
  background: transparent;
}
.hero-chip {
  position: absolute;
  left: -8px;
  bottom: -2px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(9, 38, 32, 0.72);
  border: 1px solid rgba(110, 231, 183, 0.2);
  color: #a7f3d0;
  font-size: 9.5px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.hero-chip svg {
  color: #4ade80;
}

/* ============================================================
   Stats
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 17px 18px 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card:hover {
  border-color: #cedbd5;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.stat-icon.blue {
  background: #eff6ff;
  color: #2563eb;
}
.stat-icon.amber {
  background: #fffbeb;
  color: #d97706;
}
.stat-icon.violet {
  background: #f5f3ff;
  color: #7c3aed;
}
.stat-note {
  font-size: 10.5px;
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat-note.up {
  color: var(--ok);
}
.stat-value {
  font-size: 30px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: #132520;
}
.stat-label {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted-2);
}
.stat-spark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  opacity: 0.4;
}
.stat-spark svg {
  width: 58px;
  height: 22px;
}

/* ============================================================
   Dashboard grid / chart
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
}
.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.chart-wrap {
  padding: 10px 4px 0;
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 196px;
  padding-top: 24px;
}
.bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  position: relative;
}
.bar-value {
  font-size: 9.5px;
  font-weight: 600;
  color: #6b7b75;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.15s;
  position: absolute;
  top: 0;
}
.bar-col:hover .bar-value {
  opacity: 1;
}
.bar-track {
  width: 100%;
  max-width: 38px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  border-radius: 6px 6px 4px 4px;
  background: linear-gradient(180deg, #f4f7f5, #fafbfa);
  position: relative;
  overflow: hidden;
}
.bar-track i {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #33b39e, #0f766e);
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.bar-col.is-today .bar-track i {
  background: linear-gradient(180deg, #f3b562, #dd8a2b);
}
.bar-col.is-today .bar-value {
  opacity: 1;
  color: #a4600c;
}
.bar-label {
  font-size: 9.5px;
  color: var(--muted-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.bar-col.is-today .bar-label {
  color: #a4600c;
  font-weight: 600;
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  color: var(--muted-2);
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  margin-top: 13px;
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--brand);
}
.chart-legend i.amber {
  background: #dd8a2b;
}

/* Department */
.dept-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.dept-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dept-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.8px;
}
.dept-top span:first-child {
  color: #3d4c47;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dept-top span:last-child {
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
}
.dept-bar {
  height: 5px;
  border-radius: 99px;
  background: #eef3f0;
  overflow: hidden;
}
.dept-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6fcbb5, #0f766e);
}
.mini-empty {
  padding: 22px 0;
  text-align: center;
  color: var(--muted-2);
  font-size: 11.5px;
}

/* Activity */
.activity-list {
  display: flex;
  flex-direction: column;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #f0f4f2;
  color: inherit;
  min-width: 0;
}
.activity-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}
.activity-item:first-child {
  padding-top: 2px;
}
.activity-item:hover .activity-name {
  color: var(--brand);
}
.activity-item .avatar {
  --avatar-size: 33px;
}
.activity-info {
  min-width: 0;
  flex: 1;
  line-height: 1.4;
}
.activity-name {
  font-size: 12.3px;
  font-weight: 600;
  color: #263632;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.14s;
}
.activity-meta {
  font-size: 10px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.activity-time {
  font-size: 9.5px;
  color: #9aa8a2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Quick / onboarding */
.quick-card {
  background: linear-gradient(160deg, #f8fbf9, #f1f7f4);
  border: 1px solid #e2ece7;
  border-radius: 16px;
  padding: 19px 20px;
}
.quick-card h4 {
  font-size: 12.5px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 7px;
}
.quick-card h4 svg {
  color: var(--brand);
}
.quick-card p {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.6;
}
.quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 13px;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 550;
  color: #3d4c47;
  transition: all 0.14s;
}
.quick-link:hover {
  border-color: #b9d6cb;
  color: var(--brand);
  box-shadow: var(--shadow-xs);
}
.quick-link svg {
  color: #7c918a;
}
.quick-link:hover svg {
  color: var(--brand);
}
.quick-link.is-full {
  grid-column: 1 / -1;
}

/* Onboarding */
.onboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.onboard-step {
  background: #fff;
  padding: 18px;
}
.onboard-step b {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10.5px;
  font-family: var(--font-mono);
  margin-bottom: 10px;
}
.onboard-step h4 {
  font-size: 12px;
  font-weight: 650;
}
.onboard-step p {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 3px;
  line-height: 1.55;
}
.onboard-step a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 8px;
}

/* ============================================================
   Toolbar / table
   ============================================================ */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 250px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  height: 38px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box:focus-within {
  border-color: #65a99f;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.09);
}
.search-box svg {
  margin-left: 11px;
  color: #93a19c;
  flex: none;
}
.search-box input {
  border: 0;
  outline: none;
  background: transparent;
  height: 100%;
  width: 100%;
  padding: 0 30px 0 8px;
  font-size: 12.5px;
}
.search-box input::placeholder {
  color: #a5b1ac;
}
.search-clear {
  position: absolute;
  right: 4px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #95a39e;
  display: none;
  place-items: center;
  border-radius: 6px;
}
.search-box.has-value .search-clear {
  display: grid;
}
.search-clear:hover {
  background: #f0f4f2;
  color: var(--ink);
}
.filter-select {
  height: 38px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  padding: 0 32px 0 11px;
  font-size: 12px;
  color: #3d4c47;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%236a7a74' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  outline: none;
}
.filter-select:focus {
  border-color: #65a99f;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.09);
}
.result-count {
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
  margin-left: auto;
}

.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px;
}
.data-table th {
  height: 42px;
  padding: 0 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #7d8d87;
  background: #fafcfb;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table th:first-child,
.data-table td:first-child {
  padding-left: 20px;
}
.data-table th:last-child,
.data-table td:last-child {
  padding-right: 20px;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f4f2;
  font-size: 12.5px;
  vertical-align: middle;
  color: #35453f;
}
.data-table tbody tr {
  transition: background 0.12s;
}
.data-table tbody tr:hover {
  background: #fbfdfc;
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr.is-selected {
  background: #f3faf7;
}
.data-table .cell-actions {
  text-align: right;
  white-space: nowrap;
}
.table-check {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
  vertical-align: middle;
}
.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.person-cell .avatar {
  --avatar-size: 36px;
}
.person-cell-text {
  min-width: 0;
  line-height: 1.4;
}
.person-cell-text strong {
  display: block;
  font-size: 12.8px;
  font-weight: 600;
  color: #1d2e29;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person-cell-text span {
  display: block;
  font-size: 10.5px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.code-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #4b615a;
  background: #f3f7f5;
  border: 1px solid #e7eeeb;
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: -0.02em;
}
.code-cell svg {
  color: #93a69f;
}
.dept-cell {
  line-height: 1.45;
}
.dept-cell strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #35453f;
}
.dept-cell span {
  display: block;
  font-size: 10.5px;
  color: var(--muted-2);
}
.contact-cell {
  line-height: 1.45;
}
.contact-cell a {
  color: #35453f;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.contact-cell a:hover {
  color: var(--brand);
}
.contact-cell span {
  display: block;
  font-size: 10.5px;
  color: var(--muted-2);
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #4b5a55;
  font-variant-numeric: tabular-nums;
}
.scan-count svg {
  color: #9aaba4;
}
.time-cell {
  font-size: 10.5px;
  color: #82928c;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  justify-content: flex-end;
}
.table-empty {
  padding: 8px 0;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: #fcfdfc;
  flex-wrap: wrap;
}
.page-info {
  font-size: 10.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.page-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  font-size: 11px;
  color: #5b6b65;
  display: inline-grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.page-btn:hover:not(:disabled) {
  border-color: #b9d2c9;
  color: var(--brand);
  background: #f8fcfa;
}
.page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.page-ellipsis {
  color: #a9b6b1;
  font-size: 11px;
  padding: 0 3px;
}

/* Bulk bar */
.bulk-bar {
  position: fixed;
  left: calc(var(--sidebar-w) + 50%);
  transform: translateX(-50%);
  bottom: 22px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 16px;
  background: #102823;
  color: #eaf7f2;
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(8, 30, 25, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: bulk-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100vw - 28px);
  flex-wrap: wrap;
}
@keyframes bulk-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.bulk-count {
  font-size: 11.5px;
  color: rgba(223, 243, 235, 0.7);
  white-space: nowrap;
  margin-right: 4px;
}
.bulk-count b {
  color: #7ee0c6;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.bulk-bar .btn {
  height: 31px;
  font-size: 11.5px;
  padding: 0 10px;
  border-radius: 7px;
}
.bulk-bar .btn-bulk {
  --btn-bg: rgba(255, 255, 255, 0.09);
  --btn-color: #e8f6f1;
  --btn-border: rgba(255, 255, 255, 0.1);
}
.bulk-bar .btn-bulk:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.16);
}
.bulk-bar .btn-bulk-danger {
  --btn-bg: rgba(239, 68, 68, 0.16);
  --btn-color: #fecaca;
  --btn-border: rgba(239, 68, 68, 0.2);
}
.bulk-bar .btn-bulk-danger:hover {
  background: rgba(239, 68, 68, 0.24);
}
.bulk-close {
  border: 0;
  background: transparent;
  color: rgba(220, 242, 234, 0.55);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
}
.bulk-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ============================================================
   Drawer
   ============================================================ */
.drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  justify-content: flex-end;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 25, 21, 0.42);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s;
}
.drawer-layer.is-open .drawer-backdrop {
  opacity: 1;
}
.drawer {
  position: relative;
  width: min(720px, calc(100vw - 24px));
  height: 100%;
  background: #fff;
  box-shadow: -20px 0 60px rgba(8, 30, 25, 0.16);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-left: 1px solid rgba(255, 255, 255, 0.6);
}
.drawer-layer.is-open .drawer {
  transform: translateX(0);
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 26px 17px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer-head-text {
  flex: 1;
  min-width: 0;
}
.drawer-head h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.drawer-head p {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted-2);
}
.drawer-close {
  border: 0;
  background: #f4f7f5;
  color: #7e8f88;
  width: 33px;
  height: 33px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}
.drawer-close:hover {
  background: #eaf0ed;
  color: var(--ink);
}
.drawer-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 26px 30px;
  overscroll-behavior: contain;
}
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 26px;
  border-top: 1px solid var(--line);
  background: #fcfdfc;
  flex: none;
}
.drawer-foot .left-note {
  margin-right: auto;
  font-size: 10.5px;
  color: var(--muted-2);
}
.form-section {
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}
.form-section:last-child {
  border-bottom: 0;
}
.form-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.form-section-head h4 {
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 7px;
}
.form-section-head h4::before {
  content: "";
  width: 3px;
  height: 13px;
  background: var(--brand);
  border-radius: 2px;
}
.form-section-head p {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 3px;
}
.form-section .form-grid {
  gap: 14px;
}
.form-section .field-label {
  font-size: 11.8px;
}
.form-section .input,
.form-section .select {
  height: 39px;
  font-size: 13px;
  border-radius: 9px;
}
.form-section .textarea {
  font-size: 13px;
  min-height: 78px;
  border-radius: 9px;
}

/* Photo uploader */
.photo-uploader {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  background: #fafcfb;
  border: 1px dashed #d9e3df;
  border-radius: 12px;
}
.photo-preview {
  --avatar-size: 78px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e0f1ec, #c6e4db);
  color: #4b7f73;
  font-size: 28px;
  font-weight: 650;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.1);
  position: relative;
}
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-preview .spinner {
  color: var(--brand);
}
.photo-actions {
  min-width: 0;
}
.photo-actions h5 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
}
.photo-actions p {
  font-size: 10.5px;
  color: var(--muted-2);
  line-height: 1.5;
  margin-bottom: 8px;
}
.photo-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Custom fields */
.custom-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.custom-row {
  display: grid;
  grid-template-columns: 150px 1fr 32px;
  gap: 7px;
  align-items: center;
}
.custom-row .input {
  height: 37px;
  font-size: 12.5px;
}
.custom-empty {
  font-size: 11px;
  color: var(--muted-2);
  padding: 9px 2px;
}
.add-custom {
  align-self: flex-start;
  margin-top: 2px;
}

/* Tags */
.tag-field {
  position: relative;
}
.tag-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.tag-preview .chip {
  background: var(--brand-soft);
  color: #0b5f57;
}
.tag-preview .chip button {
  border: 0;
  background: transparent;
  color: #4e8b80;
  padding: 0 0 0 3px;
  line-height: 1;
  font-size: 13px;
}
.tag-preview .chip button:hover {
  color: var(--danger);
}

/* ============================================================
   Detail
   ============================================================ */
.detail-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 17px;
  flex-wrap: wrap;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.back-link:hover {
  color: var(--brand);
}
.detail-top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.8fr);
  gap: 16px;
  align-items: start;
}
.profile-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.profile-cover {
  height: 106px;
  background:
    radial-gradient(420px 200px at 85% 0%, rgba(63, 192, 164, 0.32), transparent 60%),
    linear-gradient(110deg, #0c332c, #0a2521);
  position: relative;
  overflow: hidden;
}
.profile-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent, #000);
}
.profile-main {
  padding: 0 24px 24px;
  position: relative;
}
.profile-avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -38px;
  gap: 14px;
}
.profile-avatar {
  --avatar-size: 82px;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(8, 30, 25, 0.12);
}
.profile-name-row {
  margin-top: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-name-row h2 {
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.profile-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}
.profile-actions {
  display: flex;
  gap: 7px;
  margin-left: auto;
  align-self: flex-end;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 22px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.info-item {
  min-width: 0;
}
.info-item label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--muted-2);
  margin-bottom: 4px;
}
.info-item label svg {
  color: #9aaba4;
}
.info-item span {
  display: block;
  font-size: 12.5px;
  color: #2b3c36;
  line-height: 1.5;
  word-break: break-word;
}
.info-item a {
  color: #2b3c36;
  font-size: 12.5px;
}
.info-item a:hover {
  color: var(--brand);
}
.info-item .mono {
  font-size: 11.5px;
}
.info-note {
  grid-column: 1 / -1;
  padding: 12px 14px;
  background: #f8faf9;
  border-radius: 10px;
  border: 1px solid #eef3f0;
}
.custom-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.custom-block h5 {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-bottom: 9px;
}
.custom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
}
.custom-grid .info-item span {
  font-size: 12px;
}

.qr-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-xs);
}
.qr-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}
.qr-panel-head h3 {
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qr-frame {
  position: relative;
  background: #f7faf8;
  border: 1px solid #e8efeb;
  border-radius: 14px;
  padding: 18px;
  display: grid;
  place-items: center;
}
.qr-frame img {
  width: 100%;
  max-width: 210px;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 7px;
}
.qr-frame::before,
.qr-frame::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-color: #0f766e;
  border-style: solid;
  opacity: 0.45;
}
.qr-frame::before {
  top: 9px;
  left: 9px;
  border-width: 2px 0 0 2px;
  border-radius: 4px 0 0 0;
}
.qr-frame::after {
  bottom: 9px;
  right: 9px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 4px 0;
}
.qr-caption {
  text-align: center;
  margin-top: 10px;
  font-size: 10px;
  color: var(--muted-2);
}
.link-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f6f9f7;
  border: 1px solid #e8efeb;
  border-radius: 8px;
  padding: 6px 7px 6px 10px;
  margin-top: 13px;
}
.link-box span {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #5c7068;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-box button {
  border: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #657a72;
  flex: none;
}
.link-box button:hover {
  color: var(--brand);
  border-color: #b9d6cb;
}
.qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 12px;
}
.qr-actions .btn {
  height: 34px;
  font-size: 11px;
  padding: 0 8px;
}
.qr-actions .btn-full {
  grid-column: 1 / -1;
}
.qr-tip {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 10px;
  color: var(--muted-2);
  line-height: 1.6;
}

.scan-card {
  margin-top: 16px;
}
.scan-list {
  display: flex;
  flex-direction: column;
}
.scan-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f4f2;
  font-size: 11.5px;
}
.scan-row:last-child {
  border-bottom: 0;
}
.scan-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #74c8b4;
  flex: none;
  box-shadow: 0 0 0 3px #edf8f4;
}
.scan-main {
  flex: 1;
  min-width: 0;
  color: #3d4c47;
}
.scan-main span {
  color: var(--muted-2);
  font-size: 10px;
}
.scan-time {
  color: #8b9a95;
  font-size: 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Scans page
   ============================================================ */
.mini-stats {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}
.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mini-stat b {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.mini-stat span {
  font-size: 9.5px;
  color: var(--muted-2);
}
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: #fcfdfc;
}
.filter-bar .field {
  gap: 4px;
}
.filter-bar .field-label {
  font-size: 10px;
  color: var(--muted-2);
  font-weight: 500;
}
.filter-bar .input,
.filter-bar .select {
  height: 35px;
  font-size: 11.5px;
  border-radius: 8px;
}
.filter-bar .input {
  width: 150px;
}
.filter-bar .search-box {
  width: 230px;
  height: 35px;
}
.filter-bar .search-box input {
  font-size: 11.5px;
}
.filter-bar .btn {
  height: 35px;
  font-size: 11.5px;
}

/* ============================================================
   Settings
   ============================================================ */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}
.settings-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.settings-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  position: sticky;
  top: 90px;
}
.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 0;
  border-bottom: 1px solid #f0f4f2;
}
.setting-row:first-child {
  padding-top: 0;
}
.setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.setting-copy {
  min-width: 0;
}
.setting-copy h4 {
  font-size: 12.5px;
  font-weight: 600;
  color: #2b3c36;
}
.setting-copy p {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 3px;
  line-height: 1.55;
  max-width: 460px;
}
.setting-control {
  flex: none;
  padding-top: 1px;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.settings-form .field-label {
  font-size: 11.8px;
}
.settings-form .input,
.settings-form .select {
  height: 39px;
  font-size: 12.5px;
  border-radius: 9px;
}
.settings-form .textarea {
  min-height: 74px;
  font-size: 12.5px;
  border-radius: 9px;
}
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-input-wrap input[type="color"] {
  width: 39px;
  height: 39px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.color-input-wrap .input {
  width: 100px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.settings-save-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 0 0;
  margin-top: -2px;
}
.settings-save-bar .save-hint {
  margin-right: auto;
  font-size: 10.5px;
  color: var(--muted-2);
}
.sys-list {
  display: flex;
  flex-direction: column;
}
.sys-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed #edf2ef;
  font-size: 11px;
}
.sys-row:last-child {
  border-bottom: 0;
}
.sys-row span {
  color: var(--muted-2);
}
.sys-row b {
  color: #3d4c47;
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: right;
  word-break: break-all;
}
.storage-bar {
  height: 6px;
  border-radius: 99px;
  background: #edf2ef;
  overflow: hidden;
  margin: 10px 0 6px;
  display: flex;
}
.storage-bar i {
  display: block;
  height: 100%;
  background: var(--brand);
}
.storage-bar i.uploads {
  background: #7dd3b8;
}
.storage-legend {
  display: flex;
  gap: 12px;
  font-size: 9.5px;
  color: var(--muted-2);
}
.storage-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.storage-legend i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--brand);
}
.storage-legend i.uploads {
  background: #7dd3b8;
}
.danger-zone {
  border-color: #f2d7d3;
}
.danger-zone .card-head h3 {
  color: #a5251b;
}
.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #f8eeec;
  flex-wrap: wrap;
}
.danger-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.danger-row h4 {
  font-size: 12px;
  font-weight: 600;
}
.danger-row p {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 2px;
}
.audit-list {
  display: flex;
  flex-direction: column;
  max-height: 350px;
  overflow-y: auto;
}
.audit-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f2f5f3;
  font-size: 10.5px;
  line-height: 1.5;
}
.audit-item:last-child {
  border-bottom: 0;
}
.audit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b7cec6;
  margin-top: 5px;
  flex: none;
}
.audit-body {
  min-width: 0;
  flex: 1;
}
.audit-body p {
  color: #4b5a55;
  word-break: break-word;
}
.audit-body span {
  color: #97a59f;
  font-size: 9.5px;
}

/* ============================================================
   QR modal / import
   ============================================================ */
.qr-modal-grid {
  display: grid;
  grid-template-columns: 212px 1fr;
  gap: 22px;
  align-items: center;
}
.qr-modal-image {
  background: #f7faf9;
  border: 1px solid #e8efeb;
  border-radius: 13px;
  padding: 14px;
}
.qr-modal-image img {
  width: 100%;
  border-radius: 6px;
  background: #fff;
}
.qr-modal-info h4 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.qr-modal-info .sub {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 3px;
}
.qr-modal-info .qr-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 17px;
}
.qr-modal-info .qr-modal-actions .btn {
  justify-content: flex-start;
  height: 37px;
  font-size: 11.5px;
}
.dropzone {
  border: 1.5px dashed #cfded8;
  border-radius: 13px;
  padding: 26px 20px;
  text-align: center;
  background: #fafcfb;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.is-drag {
  border-color: #6db3a4;
  background: #f4fbf8;
}
.dropzone svg {
  margin: 0 auto 9px;
  color: #83a29a;
}
.dropzone h4 {
  font-size: 12.5px;
  font-weight: 600;
}
.dropzone p {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 3px;
}
.dropzone .file-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: #0b5f57;
  font-size: 10.5px;
}
.import-options {
  margin-top: 16px;
}
.import-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.import-mode label {
  display: flex;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.import-mode label:has(input:checked) {
  border-color: #72b6a8;
  background: #f6fbf9;
}
.import-mode input {
  margin-top: 2px;
  accent-color: var(--brand);
}
.import-mode strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
}
.import-mode span {
  display: block;
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 1px;
}
.import-result {
  margin-top: 16px;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.result-stat {
  padding: 10px;
  border-radius: 9px;
  background: #f7faf8;
  text-align: center;
}
.result-stat b {
  display: block;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #20332c;
}
.result-stat span {
  font-size: 9.5px;
  color: var(--muted-2);
}
.result-stat.ok b { color: var(--ok); }
.result-stat.warn b { color: var(--warn); }
.result-stat.err b { color: var(--danger); }
.result-errors {
  margin-top: 12px;
  max-height: 170px;
  overflow-y: auto;
  border: 1px solid #f2e2df;
  border-radius: 9px;
  background: #fffbfa;
}
.result-error-row {
  display: flex;
  gap: 9px;
  padding: 7px 10px;
  border-bottom: 1px solid #f8eeec;
  font-size: 10.5px;
  line-height: 1.5;
}
.result-error-row:last-child {
  border-bottom: 0;
}
.result-error-row b {
  color: #a5251b;
  flex: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
}
.result-error-row span {
  color: #5b6b65;
}

/* ============================================================
   Loading placeholder
   ============================================================ */
.page-skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sk-hero {
  height: 212px;
  border-radius: 20px;
}
.sk-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.sk-stat {
  height: 110px;
  border-radius: 14px;
}
.sk-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.85fr;
  gap: 16px;
}
.sk-panel {
  height: 320px;
  border-radius: 16px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1220px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-col.side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-side {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .qr-panel {
    max-width: 420px;
  }
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 20px 0 60px rgba(8, 30, 25, 0.2);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-close {
    display: grid;
  }
  .sidebar-scrim.is-open {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .menu-btn {
    display: grid;
  }
  .topbar {
    padding: 0 20px;
    height: 68px;
  }
  .page {
    padding: 20px 20px 70px;
  }
  .hero-art {
    display: none;
  }
  .hero-card {
    padding: 26px;
    min-height: 190px;
  }
  .topbar-clock {
    display: none;
  }
  .bulk-bar {
    left: 50%;
  }
  .onboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page {
    padding: 16px 14px 80px;
  }
  .topbar {
    padding: 0 14px;
    gap: 11px;
  }
  .topbar-heading .eyebrow {
    display: none;
  }
  .topbar-heading h1 {
    font-size: 16px;
  }
  .topbar-actions .btn-label {
    display: none;
  }
  .topbar-actions .btn {
    width: 38px;
    padding: 0;
  }
  .topbar-divider,
  .topbar-user {
    display: none;
  }
  .hero-card {
    padding: 23px 21px;
    border-radius: 17px;
    min-height: auto;
  }
  .hero-copy h2 {
    font-size: 22px;
  }
  .hero-copy p {
    font-size: 11.5px;
  }
  .hero-actions {
    margin-top: 17px;
  }
  .stats-grid {
    gap: 9px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-value {
    font-size: 25px;
  }
  .stat-note {
    display: none;
  }
  .dashboard-col.side {
    display: flex;
    align-items: stretch;
  }
  .page-toolbar {
    gap: 9px;
  }
  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }
  .search-box {
    width: 100%;
    flex: 1;
  }
  .filter-select {
    flex: 1;
  }
  .toolbar-right .btn {
    flex: 1;
    padding: 0 10px;
    font-size: 11.5px;
  }
  .result-count {
    display: none;
  }
  .data-table {
    min-width: 760px;
  }
  .hide-sm {
    display: none;
  }
  .pagination {
    padding: 12px 14px;
  }
  .drawer {
    width: 100%;
  }
  .drawer-head {
    padding: 18px 18px 14px;
  }
  .drawer-body {
    padding: 4px 18px 24px;
  }
  .drawer-foot {
    padding: 12px 18px;
  }
  .custom-row {
    grid-template-columns: 1fr 1fr 32px;
  }
  .settings-side {
    display: flex;
  }
  .detail-top-actions .btn {
    padding: 0 10px;
    font-size: 11px;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .custom-grid {
    grid-template-columns: 1fr;
  }
  .profile-actions {
    width: 100%;
    margin-left: 0;
  }
  .qr-modal-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .qr-modal-image {
    max-width: 220px;
    margin: 0 auto;
  }
  .result-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .import-mode {
    grid-template-columns: 1fr;
  }
  .bulk-bar {
    bottom: 10px;
    gap: 6px;
    padding: 8px 8px 8px 12px;
  }
  .bulk-count {
    width: 100%;
    margin-bottom: 2px;
  }
  .bulk-bar .btn {
    flex: 1;
  }
  .sk-hero {
    height: 190px;
  }
  .sk-stats {
    grid-template-columns: 1fr 1fr;
  }
  .sk-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 450px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stat-icon {
    width: 30px;
    height: 30px;
  }
  .stat-icon svg {
    width: 16px;
    height: 16px;
  }
  .hero-actions .btn {
    flex: 1;
  }
  .qr-actions {
    grid-template-columns: 1fr;
  }
  .qr-actions .btn-full {
    grid-column: auto;
  }
}
/* Page banner */
.page-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  border: 1px solid #cfe3f7;
  background: #f3f9ff;
  color: #1d4d7a;
  border-radius: 11px;
  font-size: 11.5px;
  line-height: 1.5;
}
.page-banner > svg { flex: none; color: #2a6ea8; }
.page-banner > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-banner strong { font-size: 11.5px; font-weight: 650; }
.page-banner span { color: #55779a; font-size: 10.5px; margin-top: 1px; }
.page-banner.warn { border-color: #f3dfb5; background: #fffaf0; color: #88520b; }
.page-banner.warn > svg { color: #b7791f; }
.page-banner.warn span { color: #9a6b2e; }
.page-banner .btn { flex: none; height: 30px; font-size: 11px; background: #fff; }

/* Status segmented options */
.status-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.status-options > label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.status-options > label:hover { border-color: #c4d8d0; }
.status-options > label:has(input:checked) {
  border-color: #63ad9e;
  background: #f3fbf8;
  box-shadow: 0 0 0 1px #63ad9e inset;
}
.status-options input { accent-color: var(--brand); }
.status-options span { display: flex; flex-direction: column; line-height: 1.35; }
.status-options b { font-size: 12px; font-weight: 600; color: #2b3c36; }
.status-options small { font-size: 10px; color: var(--muted-2); margin-top: 1px; }
/* Mobile list/filter layout refinements */
@media (max-width: 760px) {
  .toolbar-left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .toolbar-left .search-box {
    grid-column: 1 / -1;
    width: 100%;
  }
  .toolbar-left .filter-select {
    width: 100%;
    min-width: 0;
  }
  #people-sort {
    grid-column: 1 / -1;
  }
  .data-table {
    min-width: 540px;
  }
  .filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 8px;
  }
  .filter-bar .search-box {
    grid-column: 1 / -1;
    width: 100%;
  }
  .filter-bar .field {
    min-width: 0;
  }
  .filter-bar .input {
    width: 100%;
  }
  #scan-today-btn,
  #scan-reset {
    width: 100%;
  }
  #export-scans {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0 !important;
  }
  .settings-main {
    gap: 12px;
  }
  .settings-save-bar {
    flex-wrap: wrap;
  }
  .settings-save-bar .save-hint {
    width: 100%;
    margin-right: 0;
  }
  .settings-save-bar .btn {
    width: 100%;
  }
}
