@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --black: #000;
  --white: #fff;
  --gray-50:  #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --gray-950: #0a0a0a;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Bricolage Grotesque', sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--gray-950);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform .3s;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand img { height: 32px; width: auto; filter: brightness(0) invert(1); }
.sidebar-brand span { font-size: 13px; font-weight: 800; letter-spacing: 2px; color: var(--white); }
.sidebar-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; color: rgba(255,255,255,.25);
  padding: 20px 20px 8px;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  transition: color .2s, background .2s;
  text-decoration: none;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .6; }
.nav-item:hover { color: var(--white); background: rgba(255,255,255,.05); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { color: var(--white); background: rgba(255,255,255,.1); }
.nav-item.active svg { opacity: 1; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.35);
  text-decoration: none; transition: color .2s;
}
.sidebar-footer a:hover { color: var(--white); }
.sidebar-footer a svg { width: 14px; height: 14px; }

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0;
  left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  transition: left .3s;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-title { font-size: 15px; font-weight: 800; color: var(--gray-900); letter-spacing: -.3px; }
.topbar-sub  { font-size: 12px; color: var(--gray-400); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.hamburger-admin {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger-admin span {
  display: block; width: 20px; height: 2px;
  background: var(--gray-800); border-radius: 2px; transition: .3s;
}

/* ── MAIN ── */
.main { margin-left: var(--sidebar-w); padding-top: var(--topbar-h); min-height: 100vh; transition: margin-left .3s; }
.main-inner { padding: 28px; }

/* ── STATS ── */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.stat-box {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
}
.stat-box-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gray-400); margin-bottom: 8px; }
.stat-box-value { font-size: 32px; font-weight: 800; color: var(--gray-950); letter-spacing: -1px; line-height: 1; }
.stat-box-sub { font-size: 11px; color: var(--gray-400); margin-top: 5px; font-weight: 500; }

/* ── CARD ── */
.card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap; gap: 12px;
}
.card-title { font-size: 14px; font-weight: 800; color: var(--gray-900); letter-spacing: -.2px; }

/* ── TOOLBAR ── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 11px; width: 14px; height: 14px; color: var(--gray-400); pointer-events: none; }
.search-input {
  padding: 9px 14px 9px 34px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--gray-50); color: var(--gray-900);
  width: 240px; transition: all .18s; outline: none;
}
.search-input:focus { border-color: var(--gray-800); background: var(--white); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.search-input::placeholder { color: var(--gray-400); }
.filter-select {
  padding: 9px 32px 9px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background: var(--gray-50); color: var(--gray-700);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  cursor: pointer; outline: none; transition: border-color .18s;
}
.filter-select:focus { border-color: var(--gray-800); }
.btn-icon {
  padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 7px;
  font-family: inherit; transition: all .18s; letter-spacing: .01em; text-decoration: none;
}
.btn-dark { background: var(--gray-950); color: var(--white); }
.btn-dark:hover { background: var(--gray-800); }
.btn-outline-sm { background: var(--white); color: var(--gray-700); border: 1.5px solid var(--gray-200); }
.btn-outline-sm:hover { border-color: var(--gray-800); color: var(--gray-900); }
.btn-red { background: #fee2e2; color: #b91c1c; border: 1.5px solid #fecaca; }
.btn-red:hover { background: #fecaca; }
.btn-amber { background: #fef3c7; color: #92400e; border: 1.5px solid #fde68a; }
.btn-amber:hover { background: #fde68a; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1.5px solid var(--gray-100); }
thead th { padding: 11px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gray-400); text-align: left; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--gray-100); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 13px 16px; font-size: 13px; color: var(--gray-700); vertical-align: middle; white-space: nowrap; }
.td-name { font-weight: 700; color: var(--gray-900); }
.td-code { font-size: 11px; font-weight: 700; background: var(--gray-100); color: var(--gray-600); padding: 3px 9px; border-radius: 20px; display: inline-block; }
.td-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--gray-200); border: 1.5px solid var(--gray-200); }
.td-avatar-placeholder { width: 34px; height: 34px; border-radius: 50%; background: var(--gray-200); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--gray-500); border: 1.5px solid var(--gray-200); }
.badge-live { display: inline-block; font-size: 10px; font-weight: 700; background: var(--gray-950); color: var(--white); padding: 3px 10px; border-radius: 20px; letter-spacing: .5px; }
.action-btns { display: flex; gap: 6px; }
.act-btn { padding: 6px 12px; font-size: 11px; font-weight: 700; border-radius: 6px; border: none; cursor: pointer; font-family: inherit; transition: all .15s; display: inline-flex; align-items: center; gap: 4px; }
.act-view  { background: var(--gray-100); color: var(--gray-700); }
.act-view:hover  { background: var(--gray-200); color: var(--gray-900); }
.act-edit  { background: #fef3c7; color: #92400e; }
.act-edit:hover  { background: #fde68a; }
.act-del   { background: #fee2e2; color: #b91c1c; }
.act-del:hover   { background: #fecaca; }

/* ── EMPTY / LOADING ── */
.table-state { padding: 60px 20px; text-align: center; color: var(--gray-400); font-size: 13px; font-weight: 500; }
.table-state svg { display: block; margin: 0 auto 12px; opacity: .3; }
.spinner-ring { width: 32px; height: 32px; border: 3px solid var(--gray-200); border-top-color: var(--gray-800); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-top: 1px solid var(--gray-100); font-size: 12px; color: var(--gray-500); font-weight: 500; flex-wrap: wrap; gap: 10px; }
.page-btns { display: flex; gap: 6px; }
.page-btn { padding: 6px 12px; border-radius: 7px; border: 1.5px solid var(--gray-200); background: var(--white); color: var(--gray-600); font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all .15s; }
.page-btn:hover:not(:disabled) { border-color: var(--gray-800); color: var(--gray-900); }
.page-btn.active { background: var(--gray-950); color: var(--white); border-color: var(--gray-950); }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ── MODAL BASE ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 500; padding: 20px; }
.modal-overlay.active { display: flex; }
@keyframes modal-in { from { opacity: 0; transform: scale(.9) translateY(16px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ── VIEW DETAIL MODAL ── */
.modal { background: var(--white); border-radius: 18px; max-width: 860px; width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.22); animation: modal-in .3s cubic-bezier(.34,1.56,.64,1); }
.modal-head { display: flex; align-items: center; gap: 16px; padding: 22px 26px; background: var(--gray-950); border-radius: 18px 18px 0 0; position: sticky; top: 0; z-index: 10; }
.modal-avatar { width: 60px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--gray-800); border: 2px solid rgba(255,255,255,.15); }
.modal-avatar-ph { width: 60px; height: 72px; border-radius: 10px; background: var(--gray-800); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: rgba(255,255,255,.4); border: 2px solid rgba(255,255,255,.1); }
.modal-head-text { flex: 1; }
.modal-head-text h3 { font-size: 18px; font-weight: 800; color: var(--white); letter-spacing: -.3px; }
.modal-head-text p { font-size: 12px; color: rgba(255,255,255,.45); margin-top: 3px; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.1); border: none; color: rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; flex-shrink: 0; }
.modal-close:hover { background: rgba(255,255,255,.2); color: var(--white); }
.modal-body { padding: 24px 26px; }
.detail-section { margin-bottom: 24px; }
.detail-section-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--gray-400); padding-bottom: 8px; border-bottom: 1px solid var(--gray-100); margin-bottom: 14px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-400); margin-bottom: 3px; }
.detail-item-value { font-size: 13px; font-weight: 600; color: var(--gray-900); word-break: break-word; }
.detail-item-value.addr { font-size: 12px; line-height: 1.6; white-space: normal; }
.image-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.img-cell { text-align: center; }
.img-cell-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--gray-400); margin-bottom: 6px; }
.img-cell img { width: 100%; border-radius: 8px; border: 1.5px solid var(--gray-200); object-fit: contain; background: var(--gray-50); aspect-ratio: 1; cursor: pointer; transition: border-color .2s; }
.img-cell img:hover { border-color: var(--gray-800); }
.img-cell .img-na { width: 100%; aspect-ratio: 1; border-radius: 8px; border: 1.5px dashed var(--gray-200); background: var(--gray-50); display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--gray-300); font-weight: 600; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--gray-100); background: var(--gray-50); border-radius: 0 0 18px 18px; }

/* ── EDIT MODAL ── */
.edit-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 600; padding: 16px; overflow-y: auto; }
.edit-modal-overlay.active { display: flex; align-items: flex-start; }
.edit-modal {
  background: var(--white); border-radius: 18px;
  max-width: 780px; width: 100%;
  margin: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  animation: modal-in .3s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}
.edit-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 26px;
  background: var(--gray-950);
  position: sticky; top: 0; z-index: 10;
}
.edit-modal-head h3 { font-size: 16px; font-weight: 800; color: var(--white); letter-spacing: -.2px; }
.edit-modal-head p  { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 2px; }
.edit-modal-body { padding: 24px 26px; max-height: calc(90vh - 130px); overflow-y: auto; }
.edit-section { margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--gray-100); }
.edit-section:last-child { border-bottom: none; margin-bottom: 0; }
.edit-section-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--gray-400); padding-bottom: 10px; border-bottom: 1px solid var(--gray-100); margin-bottom: 14px; }
.edit-grid { display: grid; gap: 14px; margin-bottom: 12px; }
.edit-grid:last-child { margin-bottom: 0; }
.edit-two   { grid-template-columns: 1fr 1fr; }
.edit-three { grid-template-columns: 1fr 1fr 1fr; }
.edit-one   { grid-template-columns: 1fr; }
.edit-field { display: flex; flex-direction: column; gap: 5px; }
.edit-field label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-500); }
.edit-field input,
.edit-field select,
.edit-field textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; color: var(--gray-900);
  background: var(--gray-50); outline: none; transition: all .18s;
  appearance: none; -webkit-appearance: none;
}
.edit-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; cursor: pointer;
}
.edit-field textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.edit-field input:focus,
.edit-field select:focus,
.edit-field textarea:focus { border-color: var(--gray-800); background: var(--white); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.edit-field input::placeholder,
.edit-field textarea::placeholder { color: var(--gray-300); }

/* Image upload in edit */
.edit-img-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.edit-img-cell { text-align: center; }
.edit-img-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--gray-400); margin-bottom: 6px; }
.edit-img-upload {
  border: 1.5px dashed var(--gray-300); border-radius: 8px;
  background: var(--gray-50); cursor: pointer;
  aspect-ratio: 1; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s; position: relative;
}
.edit-img-upload:hover { border-color: var(--gray-800); background: var(--white); }
.edit-img-upload img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.edit-img-upload .upload-ph { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--gray-400); font-size: 10px; font-weight: 600; }
.edit-img-upload .upload-ph svg { opacity: .4; }

.edit-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

/* ── CONFIRM DELETE MODAL ── */
.confirm-modal { background: var(--white); border-radius: 16px; max-width: 380px; width: 100%; padding: 32px 28px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.22); animation: modal-in .3s cubic-bezier(.34,1.56,.64,1); }
.confirm-icon { width: 56px; height: 56px; border-radius: 50%; background: #fee2e2; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.confirm-icon svg { width: 24px; height: 24px; stroke: #b91c1c; }
.confirm-modal h3 { font-size: 17px; font-weight: 800; color: var(--gray-900); margin-bottom: 8px; }
.confirm-modal p { font-size: 13px; color: var(--gray-500); margin-bottom: 22px; line-height: 1.6; }
.confirm-btns { display: flex; gap: 10px; }
.confirm-btns button { flex: 1; }

/* ── LIGHTBOX ── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: none; align-items: center; justify-content: center; z-index: 900; cursor: zoom-out; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 10px; object-fit: contain; }
.lightbox-close { position: absolute; top: 20px; right: 24px; background: rgba(255,255,255,.1); border: none; color: var(--white); border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 20px; font-weight: 700; transition: background .2s; }
.lightbox-close:hover { background: rgba(255,255,255,.25); }

/* ── TOAST ── */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { background: var(--gray-950); color: var(--white); padding: 12px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 9px; box-shadow: 0 4px 18px rgba(0,0,0,.25); animation: toast-in .3s ease; max-width: 320px; }
.toast.toast-err { background: #b91c1c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── SIDEBAR OVERLAY ── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 190; }
.sidebar-overlay.active { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; }
  .main { margin-left: 0; }
  .hamburger-admin { display: flex; }
  .image-strip { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .edit-img-grid { grid-template-columns: repeat(2, 1fr); }
  .edit-two, .edit-three { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .main-inner { padding: 16px; }
  .search-input { width: 100%; }
  .toolbar { width: 100%; }
  .search-wrap { width: 100%; }
  .stat-box-value { font-size: 26px; }
  .edit-modal-body { padding: 16px; }
}

/* ── VIEW DETAIL MODAL – override to wider ── */
.modal { 
  background: var(--white); border-radius: 18px; 
  max-width: 860px; width: 100%; 
  max-height: 92vh; overflow-y: auto; 
  box-shadow: 0 24px 60px rgba(0,0,0,.22); 
  animation: modal-in .3s cubic-bezier(.34,1.56,.64,1); 
}

/* ── PROFILE LAYOUT ── */
.profile-hero {
  background: var(--gray-950);
  padding: 28px 30px;
  display: flex; gap: 22px; align-items: flex-start;
}
.profile-photo {
  width: 88px; height: 104px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.18);
  background: var(--gray-800);
}
.profile-photo-ph {
  width: 88px; height: 104px; border-radius: 12px;
  background: var(--gray-800); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: rgba(255,255,255,.35);
  border: 2px solid rgba(255,255,255,.1);
}
.profile-hero-info { flex: 1; }
.profile-hero-info h2 {
  font-size: 22px; font-weight: 800; color: var(--white);
  letter-spacing: -.4px; line-height: 1.15; margin-bottom: 4px;
}
.profile-hero-info .profile-desig {
  font-size: 13px; color: rgba(255,255,255,.55); font-weight: 600; margin-bottom: 12px;
}
.profile-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.profile-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.7); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px; letter-spacing: .3px;
}
.profile-tag svg { width: 11px; height: 11px; opacity: .7; }
.profile-hero-codes { flex-shrink: 0; text-align: right; }
.profile-code-box {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 8px;
}
.profile-code-box .code-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.3); margin-bottom: 3px; }
.profile-code-box .code-val { font-size: 15px; font-weight: 800; color: var(--white); letter-spacing: .5px; }

.profile-body { padding: 24px 30px; }
.profile-section { margin-bottom: 24px; }
.profile-section:last-child { margin-bottom: 0; }
.profile-section-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px;
  color: var(--gray-400); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--gray-100);
}
.profile-section-head svg { width: 13px; height: 13px; opacity: .5; }

.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.profile-grid-2 { grid-template-columns: repeat(2, 1fr); }
.profile-field {}
.pf-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gray-400); margin-bottom: 3px; }
.pf-value { font-size: 13px; font-weight: 600; color: var(--gray-900); line-height: 1.5; word-break: break-word; }
.pf-value.multiline { white-space: pre-line; font-size: 12px; }

.profile-divider { height: 1px; background: var(--gray-100); margin: 20px 0; }

/* Biometrics strip */
.bio-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.bio-cell { text-align: center; }
.bio-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--gray-400); margin-bottom: 6px; }
.bio-img {
  width: 100%; aspect-ratio: 1; border-radius: 8px;
  border: 1.5px solid var(--gray-200); object-fit: cover;
  background: var(--gray-50); cursor: pointer; display: block;
  transition: border-color .2s, transform .2s;
}
.bio-img:hover { border-color: var(--gray-800); transform: scale(1.03); }
.bio-img-cover { object-fit: cover; }
.bio-na {
  width: 100%; aspect-ratio: 1; border-radius: 8px;
  border: 1.5px dashed var(--gray-200); background: var(--gray-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--gray-300); font-weight: 600;
}

/* ── PDF / PRINT LAYOUT ── */
#pdfFrame {
  position: fixed; left: -9999px; top: 0;
  width: 210mm; background: white;
  font-family: 'Bricolage Grotesque', sans-serif;
  visibility: hidden;
}

@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea {
    display: block !important;
    position: fixed; inset: 0;
    background: white; z-index: 99999;
    padding: 0; margin: 0;
  }
  @page { size: A4; margin: 0; }
}

#printArea { display: none; }
#printArea.printing { display: block; }

.print-doc {
  width: 210mm; min-height: 297mm;
  background: #fff; font-family: 'Bricolage Grotesque', Arial, sans-serif;
  font-size: 11pt; color: #111; line-height: 1.5;
  padding: 0; margin: 0 auto;
}
.print-header {
  background: #0a0a0a; padding: 20mm 16mm 14mm;
  display: flex; gap: 14mm; align-items: flex-start;
}
.print-photo {
  width: 28mm; height: 34mm; border-radius: 4mm;
  object-fit: cover; border: 1px solid rgba(255,255,255,.2);
  flex-shrink: 0; background: #333;
}
.print-photo-ph {
  width: 28mm; height: 34mm; border-radius: 4mm;
  background: #333; flex-shrink: 0; border: 1px solid rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18pt; font-weight: 800; color: rgba(255,255,255,.3);
}
.print-header-info { flex: 1; }
.print-header-info h1 { font-size: 20pt; font-weight: 800; color: #fff; letter-spacing: -.5px; margin-bottom: 2mm; line-height: 1.1; }
.print-header-info .ph-desig { font-size: 10pt; color: rgba(255,255,255,.55); margin-bottom: 4mm; }
.print-tags { display: flex; flex-wrap: wrap; gap: 3mm; }
.print-tag { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.7); font-size: 7.5pt; font-weight: 700; padding: 1.5mm 3.5mm; border-radius: 20mm; }
.print-header-codes { flex-shrink: 0; text-align: right; }
.print-code-box { margin-bottom: 3mm; }
.print-code-box .pcl { font-size: 6.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.3); margin-bottom: 1mm; }
.print-code-box .pcv { font-size: 12pt; font-weight: 800; color: #fff; }
.print-body { padding: 8mm 16mm 12mm; }
.print-section { margin-bottom: 7mm; page-break-inside: avoid; }
.print-section-title {
  font-size: 7pt; font-weight: 800; text-transform: uppercase; letter-spacing: 2px;
  color: #888; border-bottom: 1px solid #e5e5e5; padding-bottom: 2mm; margin-bottom: 4mm;
}
.print-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm 6mm; }
.print-grid-2 { grid-template-columns: repeat(2, 1fr); }
.print-field {}
.print-fl { font-size: 6.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #888; margin-bottom: 1mm; }
.print-fv { font-size: 9pt; font-weight: 600; color: #111; line-height: 1.4; }
.print-fv.addr { font-size: 8.5pt; }
.print-bio { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3mm; margin-top: 2mm; }
.print-bio-cell { text-align: center; }
.print-bio-label { font-size: 6pt; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #888; margin-bottom: 2mm; }
.print-bio-img { width: 100%; aspect-ratio: 1; border-radius: 3mm; object-fit: cover; border: 1px solid #e5e5e5; background: #f5f5f5; display: block; }
.print-bio-img-sig { object-fit: contain !important; }
.print-bio-na { width: 100%; aspect-ratio: 1; border-radius: 3mm; border: 1px dashed #ddd; background: #fafafa; display: flex; align-items: center; justify-content: center; font-size: 7pt; color: #ccc; }
.print-footer {
  margin-top: 8mm; padding-top: 4mm; border-top: 1px solid #e5e5e5;
  display: flex; justify-content: space-between; align-items: center;
}
.print-footer-left { font-size: 7pt; color: #aaa; }
.print-footer-right { font-size: 7pt; color: #aaa; text-align: right; }
.print-sig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; margin-top: 6mm; }
.print-sig-box { text-align: center; }
.print-sig-img { height: 16mm; max-width: 100%; object-fit: contain; display: block; margin: 0 auto 2mm; }
.print-sig-line { border-top: 1px solid #333; margin: 2mm 0; }
.print-sig-label { font-size: 7pt; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #555; }
.print-watermark {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-35deg);
  font-size: 60pt; font-weight: 900; color: rgba(0,0,0,.03);
  letter-spacing: 4px; text-transform: uppercase; pointer-events: none;
  white-space: nowrap; z-index: 0;
}

@media (max-width: 720px) {
  .profile-grid { grid-template-columns: repeat(2, 1fr); }
  .bio-strip { grid-template-columns: repeat(3, 1fr); }
  .profile-hero { flex-wrap: wrap; }
  .profile-hero-codes { width: 100%; display: flex; gap: 10px; text-align: left; }
}
@media (max-width: 500px) {
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .bio-strip { grid-template-columns: repeat(2, 1fr); }
}
