/* ==========================================================================
   PetID — Design tokens & shared components
   ========================================================================== */

:root {
  --bg: #FBF3E9;
  --bg-grad: linear-gradient(180deg, #FDF8F1 0%, #FBEFDF 100%);
  --card: #FFFFFF;
  --ink: #2A2119;
  --ink-soft: #6F6459;
  --ink-faint: #A69C90;
  --line: #EFE4D6;
  --primary: #E8834E;
  --primary-dark: #D66E37;
  --primary-tint: #FCE7D8;
  --green: #3FA36B;
  --green-tint: #E4F5EB;
  --red: #C0392B;
  --red-tint: #FBEAEA;
  --blue: #3B6FE0;
  --blue-tint: #E8EEFC;
  --purple: #7C5CE0;
  --purple-tint: #ECE6FB;
  --coral: #FF6B6B;
  --coral-tint: #FFE7E7;
  --sky: #3F9BDC;
  --sky-tint: #E3F2FC;
  --sun: #F5B942;
  --sun-tint: #FFF3DA;
  --mint: #2FBF8F;
  --mint-tint: #E1F8EF;
  --ink-900: #1E1712;
  --radius-lg: 28px;
  --radius-xl: 34px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 45px -18px rgba(60, 34, 10, 0.28);
  --shadow-sm: 0 8px 20px -10px rgba(60, 34, 10, 0.2);
  --shadow-lg: 0 30px 60px -20px rgba(50, 28, 8, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Decorative blobs (modern organic-shape trend) ---------- */
.blob-field { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob-field span { position: absolute; border-radius: 50%; filter: blur(38px); opacity: 0.55; }
.blob-field .b1 { width: 190px; height: 190px; background: var(--sun-tint); top: -70px; right: -50px; }
.blob-field .b2 { width: 150px; height: 150px; background: var(--coral-tint); top: 40px; left: -60px; }
.blob-field .b3 { width: 130px; height: 130px; background: var(--mint-tint); bottom: 60px; right: -40px; opacity: 0.4; }
.paw-pattern {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.07;
  background-image: radial-gradient(circle at 4px 4px, var(--ink) 2.4px, transparent 2.6px);
  background-size: 34px 34px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg-grad);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ---------- App frame (mobile-first, centered on desktop) ---------- */
.app-root {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-grad);
  position: relative;
  display: flex;
  flex-direction: column;
}
@media (min-width: 900px) {
  body { background: #F1E7DA; }
  .app-root {
    min-height: 92vh;
    margin: 4vh auto;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 30px 80px -30px rgba(40, 25, 10, 0.4);
    border: 10px solid #1C1712;
  }
}

/* ---------- Status bar (decorative) ---------- */
.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 6px;
}
.topbar h1 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}
.topbar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.topbar-icon-btn svg { width: 18px; height: 18px; stroke: var(--ink); }
.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--card);
}

/* ---------- Scroll area ---------- */
.screen {
  flex: 1;
  overflow-y: auto;
  padding: 4px 18px 100px;
}
.screen::-webkit-scrollbar { display: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}
.card-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* ---------- Badges / pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.pill-primary { background: var(--primary-tint); color: var(--primary-dark); }
.pill-green { background: var(--green-tint); color: var(--green); }
.pill-red { background: var(--red-tint); color: var(--red); }
.pill-blue { background: var(--blue-tint); color: var(--blue); }
.pill-purple { background: var(--purple-tint); color: var(--purple); }
.pill-muted { background: #F1EAE1; color: var(--ink-soft); }

/* ---------- Profile hero ---------- */
.hero-card {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.hero-avatar-wrap { position: relative; flex: none; }
.hero-avatar {
  width: 78px;
  height: 78px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--card);
  background: linear-gradient(135deg, var(--sun-tint), var(--coral-tint));
}
.hero-avatar-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.hero-avatar-badge svg { width: 11px; height: 11px; stroke: #fff; }
.hero-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 8px; font-weight: 600; }
.edit-fab {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.edit-fab svg { width: 15px; height: 15px; }

/* ---------- Segmented tab pills (screen-level) ---------- */
.seg-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  position: relative;
  z-index: 1;
}
.seg-tabs::-webkit-scrollbar { display: none; }
.seg-tab {
  flex: none;
  padding: 8px 15px 8px 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: transform 0.15s;
}
.seg-tab:active { transform: scale(0.96); }
.seg-tab .seg-ic {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #F1EAE1; color: var(--ink-soft); flex: none;
}
.seg-tab .seg-ic svg { width: 12px; height: 12px; }
.seg-tab.active { background: var(--ink-900); color: #fff; box-shadow: var(--shadow); }
.seg-tab.active .seg-ic { background: var(--primary); color: #fff; }
.seg-tab svg { width: 14px; height: 14px; }

/* ---------- Info grid (basic info rows) ---------- */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--ink-soft); }
.info-row span:last-child { font-weight: 700; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat-box {
  text-align: center;
  background: #FAF4EC;
  border-radius: var(--radius-md);
  padding: 12px 6px;
}
.stat-box svg { width: 18px; height: 18px; margin: 0 auto 6px; stroke: var(--primary); }
.stat-val { font-size: 15px; font-weight: 800; }
.stat-label { font-size: 10.5px; color: var(--ink-soft); }

/* ---------- List rows (vaccine/exam schedule, notifications, settings) ---------- */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }
.list-row-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.list-row-icon svg { width: 17px; height: 17px; }
.list-row-body { flex: 1; min-width: 0; }
.list-row-title { font-size: 13.5px; font-weight: 700; margin: 0 0 2px; }
.list-row-sub { font-size: 12px; color: var(--ink-soft); margin: 0; }
.list-row-trail { flex: none; }
.chevron { width: 16px; height: 16px; stroke: var(--ink-faint); }

/* ---------- Lost mode banner (dashboard) ---------- */
.lost-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-tint);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  margin-bottom: 14px;
}
.lost-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.lost-banner-icon svg { width: 17px; height: 17px; stroke: var(--primary-dark); }
.lost-banner-text { flex: 1; font-size: 12.5px; font-weight: 700; color: var(--primary-dark); }
.lost-banner-sub { font-weight: 500; color: #A85F30; font-size: 11.5px; }
.lost-banner-cta { font-size: 12px; font-weight: 800; color: var(--primary-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
}
.btn svg, .card-link svg, .list-row-title svg, .contact-phone svg, .post-text svg { width: 15px; height: 15px; flex: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 12px 24px -10px rgba(232,131,78,0.6); }
.btn-danger { background: var(--red); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-sm { padding: 9px 14px; font-size: 12.5px; border-radius: 12px; width: auto; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- Form fields ---------- */
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: #FCF8F2;
  font-size: 13.5px;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* ---------- Photo grid (Album) ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: #EEE3D5;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .dur {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}
.photo-tile .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-tile .play svg { width: 26px; height: 26px; fill: #fff; opacity: 0.9; }

/* ---------- Moments timeline ---------- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.timeline-group { margin-bottom: 20px; }
.timeline-date {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 10px;
  position: relative;
}
.timeline-date::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}
.moment-card { background: var(--card); border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.moment-title { font-size: 13.5px; font-weight: 700; margin: 0 0 8px; }
.moment-photos { display: flex; gap: 6px; margin-bottom: 8px; }
.moment-photos img { flex: 1; height: 96px; object-fit: cover; border-radius: 12px; }
.moment-caption { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 8px; }
.moment-meta { display: flex; gap: 14px; font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.moment-meta span { display: flex; align-items: center; gap: 4px; }
.moment-meta svg { width: 14px; height: 14px; }

/* ---------- Lost contact card ---------- */
.contact-card {
  background: var(--card);
  border-radius: 28px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1.5px dashed var(--primary-tint);
}
.contact-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 14px 26px -10px rgba(232,131,78,0.6);
}
.contact-badge svg { width: 30px; height: 30px; stroke: #fff; }
.contact-title { color: var(--primary-dark); font-weight: 800; font-size: 15px; margin: 0 0 2px; }
.contact-sub { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 16px; }
.contact-owner { font-size: 15px; font-weight: 800; margin: 0 0 2px; }
.contact-role { font-size: 12px; color: var(--ink-soft); margin: 0 0 14px; }
.contact-phone { font-size: 16px; font-weight: 800; margin: 0 0 14px; }
.contact-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; }
.round-action {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.round-action svg { width: 19px; height: 19px; stroke: #fff; }
.qr-box { padding: 14px; background: #fff; border-radius: 16px; display: inline-block; box-shadow: var(--shadow-sm); }
.qr-box img, .qr-box canvas { width: 150px; height: 150px; }
.contact-id { font-size: 11px; color: var(--ink-faint); font-weight: 700; margin-top: 10px; letter-spacing: 0.04em; }

/* ---------- Feature list grid (Tinh nang khac) ---------- */
.feature-row {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}
.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.feature-icon svg { width: 19px; height: 19px; }
.feature-body { flex: 1; }
.feature-title { font-size: 13.5px; font-weight: 700; margin: 0 0 2px; }
.feature-sub { font-size: 11.5px; color: var(--ink-soft); margin: 0; }

/* ---------- Community feed ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 16px;
  padding: 11px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.search-bar svg { width: 16px; height: 16px; stroke: var(--ink-faint); }
.search-bar input { flex: 1; border: none; background: none; font-size: 13.5px; }
.post-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  border: 1px solid rgba(0,0,0,0.02);
}
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-avatar { width: 40px; height: 40px; border-radius: 14px; object-fit: cover; box-shadow: var(--shadow-sm); }
.post-author { font-size: 13.5px; font-weight: 800; margin: 0; }
.post-meta { font-size: 11.5px; color: var(--ink-soft); margin: 0; font-weight: 600; }
.post-badge { margin-left: auto; }
.post-text { font-size: 13px; margin: 0 0 10px; line-height: 1.55; }
.post-photos { display: flex; gap: 6px; margin-bottom: 10px; position: relative; }
.post-photos img { flex: 1; height: 130px; object-fit: cover; border-radius: 16px; }
.img-heart-btn {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}
.img-heart-btn svg { width: 14px; height: 14px; }
.post-actions { display: flex; align-items: center; gap: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.post-action { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.post-action svg { width: 16px; height: 16px; }
.post-action.liked { color: var(--coral); }

/* ---------- Bottom nav (floating pill, modern) ---------- */
.bottom-nav-wrap { position: sticky; bottom: 0; left: 0; right: 0; padding: 0 14px calc(14px + env(safe-area-inset-bottom)); z-index: 5; }
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 26px;
  padding: 9px 8px;
  box-shadow: var(--shadow-lg);
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-faint); flex: 1; padding: 5px 0; border-radius: 14px; transition: background 0.15s, color 0.15s; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item span { font-size: 9.5px; font-weight: 700; }
.nav-item.active { color: var(--primary-dark); background: var(--primary-tint); }
.nav-fab {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 28px -10px rgba(232,131,78,0.75);
  margin-top: -30px;
  border: 4px solid var(--bg);
}
.nav-fab svg { width: 22px; height: 22px; stroke: #fff; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 20px 10px; color: var(--ink-soft); font-size: 12.5px; }

/* ---------- Auth screen ---------- */
.auth-hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 54px 22px 34px; background: linear-gradient(160deg, #2A1F16 0%, #4A3221 60%, var(--primary-dark) 130%);
  border-radius: 0 0 40px 40px; color: #fff;
}
.auth-hero .paw-pattern { opacity: 0.12; background-image: radial-gradient(circle at 4px 4px, #fff 2.4px, transparent 2.6px); }
.auth-logo {
  width: 64px; height: 64px; border-radius: 22px; background: var(--primary); margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center; position: relative; z-index: 1;
  box-shadow: 0 16px 30px -8px rgba(0,0,0,0.5);
}
.auth-logo svg { width: 30px; height: 30px; stroke: #fff; }
.auth-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; position: relative; z-index: 1; }
.auth-sub { font-size: 13px; color: rgba(255,255,255,0.7); margin: 0; position: relative; z-index: 1; }
.auth-wrap { padding: 0 20px; margin-top: -26px; text-align: center; position: relative; z-index: 2; }
.auth-card { background: var(--card); border-radius: var(--radius-xl); padding: 22px; box-shadow: var(--shadow-lg); text-align: left; }
.auth-switch { margin-top: 16px; font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.auth-switch b { color: var(--primary-dark); }
.error-text { color: var(--red); font-size: 12px; font-weight: 700; margin: 8px 0 0; }
.success-text { color: var(--green); font-size: 12px; font-weight: 700; margin: 8px 0 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* ---------- Section heading ---------- */
.section-title { font-size: 15px; font-weight: 800; margin: 4px 0 12px; }

/* ---------- Modal / sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(20,14,8,0.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 1000;
}
.sheet {
  width: 100%; max-width: 480px; background: #fff;
  border-radius: 26px 26px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 85vh; overflow-y: auto;
}
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 16px; }
.sheet-title { font-size: 16px; font-weight: 800; margin: 0 0 16px; }
.sheet-close { position: absolute; top: 18px; right: 18px; }

/* ---------- Admin (desktop layout) ---------- */
.admin-body { font-family: var(--font); background: #F4F1EC; color: var(--ink); margin: 0; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: #1C1712; color: #EFE7DC; padding: 24px 16px; flex: none;
  display: flex; flex-direction: column; gap: 4px;
}
.admin-logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.admin-logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); display: flex; align-items: center; justify-content: center; }
.admin-logo-mark svg { width: 16px; height: 16px; stroke: #fff; }
.admin-logo b { font-size: 14.5px; }
.admin-logo small { display: block; font-size: 10.5px; color: #9C9186; }
.admin-nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px;
  font-size: 13px; font-weight: 600; color: #C9C0B5;
}
.admin-nav-item svg { width: 17px; height: 17px; }
.admin-nav-item.active { background: rgba(232,131,78,0.16); color: #F3B487; }
.admin-nav-item:hover { background: rgba(255,255,255,0.06); }
.admin-main { flex: 1; padding: 28px 34px; overflow-y: auto; max-height: 100vh; }
.admin-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.admin-h1 { font-size: 21px; font-weight: 800; margin: 0; }
.admin-sub { font-size: 12.5px; color: var(--ink-soft); margin: 2px 0 0; }
.admin-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.admin-kpi-card { background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow-sm); }
.admin-kpi-label { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; margin: 0 0 8px; }
.admin-kpi-val { font-size: 25px; font-weight: 800; margin: 0; }
.admin-kpi-trend { font-size: 11.5px; font-weight: 700; color: var(--green); margin-top: 4px; }
.admin-panel { background: #fff; border-radius: 18px; padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); padding: 8px 10px; border-bottom: 1.5px solid var(--line); }
.admin-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; margin-right: 8px; vertical-align: middle; }
.admin-search { display: flex; align-items: center; gap: 8px; background: #F4F1EC; border-radius: 12px; padding: 9px 13px; width: 260px; }
.admin-search input { border: none; background: none; flex: 1; font-size: 13px; }
.admin-search svg { width: 15px; height: 15px; stroke: var(--ink-faint); }
.admin-badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #F4F1EC; }
.admin-login-card { width: 360px; background: #fff; border-radius: 22px; padding: 30px; box-shadow: var(--shadow); }
.icon-btn-sm { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: #F4F1EC; }
.icon-btn-sm svg { width: 14px; height: 14px; }
.admin-empty { text-align: center; padding: 30px; color: var(--ink-soft); font-size: 13px; }

/* ---------- Vital badges (blood type / health condition on scan page) ---------- */
.vital-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 2px; }
.vital-box { border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.vital-box svg { width: 18px; height: 18px; }
.vital-label { font-size: 10.5px; font-weight: 700; opacity: 0.75; margin: 0; }
.vital-val { font-size: 13.5px; font-weight: 800; margin: 0; }

/* ---------- Chip-session manage card (scan.html) ---------- */
.chip-card { background: var(--card); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); text-align: center; }
.chip-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--sky-tint); color: var(--sky); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.chip-icon svg { width: 21px; height: 21px; }
.chip-status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-bottom: 10px; }
.chip-status-pill svg { width: 11px; height: 11px; }

@media (max-width: 820px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; padding: 12px; }
  .admin-logo { padding: 0 12px 0 0; }
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-main { padding: 18px; }
}
