@font-face {
  font-family: "TASA Explorer";
  src: url("../fonts/TASAExplorer-Regular.woff2") format("woff2"),
       url("../fonts/TASAExplorer-Regular.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #e87b2f;
  --primary-light: #f5a623;
  --primary-dark: #c96521;
  --primary-glow: rgba(232,123,47,0.18);
  --primary-subtle: rgba(232,123,47,0.08);
  --navy: #0a1628;
  --navy-light: #0f1d32;
  --navy-mid: #162a46;
  --navy-soft: #1e3a5f;
  --white: #ffffff;
  --bg: #f4f1ed;
  --bg-warm: #faf8f5;
  --card: #ffffff;
  --border: #e5ddd3;
  --border-light: #f0ebe4;
  --text: #0f172a;
  --text-secondary: #374151;
  --text-muted: #8b7e74;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(10,22,40,.06), 0 6px 20px rgba(10,22,40,.06);
  --shadow-lg: 0 8px 32px rgba(10,22,40,.12);
  --shadow-glow: 0 4px 16px rgba(232,123,47,.2);
}
html { scroll-behavior: smooth; }
body {
  font-family: "TASA Explorer", -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-light) 100%);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform .3s;
  border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand img {
  height: 38px; width: auto;
  border-radius: 8px;
}
.sidebar-brand span {
  font-size: 12px; font-weight: 800; letter-spacing: 2.5px;
  color: var(--white);
  text-transform: uppercase;
}
.sidebar-label {
  font-size: 9px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 2.5px; color: rgba(255,255,255,.2);
  padding: 22px 22px 8px;
}
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 16px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  border: none; background: none; width: 100%; text-align: left;
  border-left: 3px solid transparent;
  font-family: inherit;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .5; }
.nav-item:hover {
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.05);
  border-left-color: rgba(232,123,47,.3);
}
.nav-item:hover svg { opacity: .9; }
.nav-item.active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(232,123,47,.15) 0%, transparent 100%);
  border-left-color: var(--primary);
}
.nav-item.active svg { opacity: 1; stroke: var(--primary-light); }
.sidebar-footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,.3);
  text-decoration: none; transition: color .2s;
}
.sidebar-footer a:hover { color: var(--primary-light); }
.sidebar-footer a svg { width: 13px; height: 13px; }

/* sidebar divider */
.sidebar-nav .sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 8px 22px;
}

/* ══════════════════════════════════════
   TOPBAR
══════════════════════════════════════ */
.topbar {
  position: fixed; top: 0;
  left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
  transition: left .3s;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title {
  font-size: 16px; font-weight: 800; color: var(--navy);
  letter-spacing: -.3px;
}
.topbar-sub {
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  margin-top: 1px;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }

.hamburger-admin {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger-admin span {
  display: block; width: 20px; height: 2px;
  background: var(--navy); border-radius: 2px; transition: .3s;
}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  transition: margin-left .3s;
}
.main-inner { padding: 28px 32px; max-width: 1400px; }

/* ══════════════════════════════════════
   STATS CARDS
══════════════════════════════════════ */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px; margin-bottom: 28px;
}
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.stat-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--primary-light));
  border-radius: 0 4px 4px 0;
}
.stat-box-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.8px; color: var(--text-muted); margin-bottom: 10px;
}
.stat-box-value {
  font-size: 36px; font-weight: 800; color: var(--navy);
  letter-spacing: -1.5px; line-height: 1;
}
.stat-box-sub {
  font-size: 11px; color: var(--text-muted); margin-top: 6px;
  font-weight: 500;
}

/* ══════════════════════════════════════
   CARD
══════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap; gap: 14px;
  background: var(--bg-warm);
}
.card-title {
  font-size: 15px; font-weight: 800; color: var(--navy);
  letter-spacing: -.2px;
}

/* ══════════════════════════════════════
   TOOLBAR / SEARCH / FILTERS
══════════════════════════════════════ */
.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: 12px;
  width: 14px; height: 14px; color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  padding: 10px 14px 10px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit;
  background: var(--white); color: var(--text);
  width: 260px; transition: all .18s; outline: none;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.search-input::placeholder { color: #c4b8ac; }
.filter-select {
  padding: 10px 34px 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit;
  background: var(--white); color: var(--text-secondary);
  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='%238b7e74' 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 11px center;
  cursor: pointer; outline: none; transition: border-color .18s;
}
.filter-select:focus { border-color: var(--primary); }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn-icon {
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; transition: all .18s;
  letter-spacing: .01em; text-decoration: none;
}
.btn-dark {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(10,22,40,.2);
}
.btn-dark:hover {
  background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy-soft) 100%);
  box-shadow: 0 4px 16px rgba(10,22,40,.3);
  transform: translateY(-1px);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  color: var(--white);
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(232,123,47,.35);
  transform: translateY(-1px);
}
.btn-outline-sm {
  background: var(--white);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-outline-sm:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-subtle);
}
.btn-red {
  background: var(--red-bg);
  color: #b91c1c;
  border: 1.5px solid var(--red-border);
}
.btn-red:hover { background: #fecaca; }
.btn-amber {
  background: #fffbeb;
  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: 2px solid var(--border-light); }
thead th {
  padding: 12px 18px; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); text-align: left; white-space: nowrap;
  background: var(--bg-warm);
}
tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fdf8f3; }
tbody td {
  padding: 14px 18px; font-size: 13px;
  color: var(--text-secondary); vertical-align: middle;
  white-space: nowrap;
}
.td-name { font-weight: 700; color: var(--navy); }
.td-code {
  font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: var(--primary-light);
  padding: 3px 10px; border-radius: 20px;
  display: inline-block; letter-spacing: .3px;
}
.td-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  object-fit: cover; background: var(--border);
  border: 2px solid var(--border);
}
.td-avatar-placeholder {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--primary-light);
  border: 2px solid var(--border);
}
.badge-live {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700;
  background: var(--green-bg);
  color: var(--green);
  padding: 4px 12px; border-radius: 20px;
  letter-spacing: .3px;
  border: 1px solid rgba(16,185,129,.2);
}
.badge-live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.7); }
}
.action-btns { display: flex; gap: 6px; }
.act-btn {
  padding: 6px 13px; font-size: 11px; font-weight: 700;
  border-radius: 7px; border: none; cursor: pointer;
  font-family: inherit; transition: all .15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.act-view {
  background: var(--primary-subtle);
  color: var(--primary-dark);
  border: 1px solid rgba(232,123,47,.15);
}
.act-view:hover { background: rgba(232,123,47,.2); color: var(--primary); }
.act-edit {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.act-edit:hover { background: #fde68a; }
.act-del {
  background: var(--red-bg);
  color: #b91c1c;
  border: 1px solid var(--red-border);
}
.act-del:hover { background: #fecaca; }

/* ══════════════════════════════════════
   EMPTY / LOADING STATES
══════════════════════════════════════ */
.table-state {
  padding: 60px 20px; text-align: center;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
}
.table-state svg { display: block; margin: 0 auto 12px; opacity: .3; }
.spinner-ring {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   PAGINATION
══════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-top: 1px solid var(--border-light);
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  flex-wrap: wrap; gap: 10px;
  background: var(--bg-warm);
}
.page-btns { display: flex; gap: 6px; }
.page-btn {
  padding: 7px 14px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white); color: var(--text-secondary);
  font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-subtle);
}
.page-btn.active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  color: var(--white);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}
.page-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ══════════════════════════════════════
   MODAL BASE
══════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,22,40,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  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(.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ══════════════════════════════════════
   VIEW DETAIL MODAL
══════════════════════════════════════ */
.modal {
  background: var(--white); border-radius: 20px;
  max-width: 880px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 32px 80px rgba(10,22,40,.3);
  animation: modal-in .35s cubic-bezier(.34,1.56,.64,1);
}
.modal-head {
  display: flex; align-items: center; gap: 16px;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: 20px 20px 0 0;
  position: sticky; top: 0; z-index: 10;
}
.modal-avatar {
  width: 62px; height: 74px; border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.18);
  background: var(--navy-light);
}
.modal-avatar-ph {
  width: 62px; height: 74px; border-radius: 12px;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--primary-light);
  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: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  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(232,123,47,.2);
  border-color: rgba(232,123,47,.4);
  color: var(--primary-light);
}
.modal-body { padding: 24px 28px; }
.detail-section { margin-bottom: 24px; }
.detail-section-title {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 2px; color: var(--text-muted);
  padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
  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(--text-muted); margin-bottom: 3px;
}
.detail-item-value {
  font-size: 13px; font-weight: 600; color: var(--text);
  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(--text-muted); margin-bottom: 6px;
}
.img-cell img {
  width: 100%; border-radius: 10px;
  border: 1.5px solid var(--border);
  object-fit: contain; background: var(--bg-warm);
  aspect-ratio: 1; cursor: pointer; transition: all .2s;
}
.img-cell img:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}
.img-cell .img-na {
  width: 100%; aspect-ratio: 1; border-radius: 10px;
  border: 1.5px dashed var(--border);
  background: var(--bg-warm);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #c4b8ac; font-weight: 600;
}
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 28px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-warm);
  border-radius: 0 0 20px 20px;
}

/* ══════════════════════════════════════
   EDIT MODAL
══════════════════════════════════════ */
.edit-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,22,40,.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  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: 20px;
  max-width: 800px; width: 100%;
  margin: auto;
  box-shadow: 0 32px 80px rgba(10,22,40,.35);
  animation: modal-in .35s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}
.edit-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  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 28px;
  max-height: calc(90vh - 140px); overflow-y: auto;
}
.edit-section {
  margin-bottom: 24px; padding-bottom: 22px;
  border-bottom: 1px solid var(--border-light);
}
.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(--text-muted);
  padding-bottom: 10px; border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}
.edit-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.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(--text-muted);
}
.edit-field input,
.edit-field select,
.edit-field textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--bg-warm); 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='%238b7e74' 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 11px center;
  padding-right: 34px; cursor: pointer;
}
.edit-field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.edit-field input:focus,
.edit-field select:focus,
.edit-field textarea:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.edit-field input::placeholder,
.edit-field textarea::placeholder { color: #c4b8ac; }

/* edit image grid */
.edit-img-grid { display: grid; grid-template-columns: repeat(5, 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(--text-muted); margin-bottom: 6px;
}
.edit-img-upload {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-warm); cursor: pointer;
  aspect-ratio: 1; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; position: relative;
}
.edit-img-upload:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
}
.edit-img-upload img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 8px;
}
.edit-img-upload .upload-ph {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--text-muted); font-size: 10px; font-weight: 600;
}
.edit-img-upload .upload-ph svg { opacity: .35; }

.edit-modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 28px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-warm);
}

/* ══════════════════════════════════════
   CONFIRM DELETE MODAL
══════════════════════════════════════ */
.confirm-modal {
  background: var(--white); border-radius: 20px;
  max-width: 400px; width: 100%;
  padding: 36px 30px; text-align: center;
  box-shadow: 0 32px 80px rgba(10,22,40,.3);
  animation: modal-in .35s cubic-bezier(.34,1.56,.64,1);
}
.confirm-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--red-bg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  border: 2px solid var(--red-border);
}
.confirm-icon svg { width: 26px; height: 26px; stroke: #b91c1c; }
.confirm-modal h3 {
  font-size: 18px; font-weight: 800; color: var(--navy);
  margin-bottom: 8px;
}
.confirm-modal p {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 24px; line-height: 1.6;
}
.confirm-btns { display: flex; gap: 10px; }
.confirm-btns button { flex: 1; }

/* ══════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(10,22,40,.92);
  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: 12px; object-fit: contain;
  box-shadow: 0 16px 48px rgba(0,0,0,.4);
}
.lightbox-close {
  position: absolute; top: 24px; right: 28px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  color: var(--white); border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 20px; font-weight: 700;
  transition: all .2s;
}
.lightbox-close:hover {
  background: rgba(232,123,47,.3);
  border-color: var(--primary);
}

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast-wrap {
  position: fixed; bottom: 28px; right: 28px;
  display: flex; flex-direction: column; gap: 10px; z-index: 1000;
}
.toast {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: var(--white); padding: 14px 20px;
  border-radius: 12px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 28px rgba(10,22,40,.35);
  animation: toast-in .3s ease; max-width: 360px;
  border: 1px solid rgba(255,255,255,.08);
}
.toast.toast-err {
  background: linear-gradient(135deg, #991b1b, #b91c1c);
  border-color: rgba(255,255,255,.1);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ══════════════════════════════════════
   SIDEBAR OVERLAY (mobile)
══════════════════════════════════════ */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(10,22,40,.6); z-index: 190;
  backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }

/* ══════════════════════════════════════
   PROFILE LAYOUT (View Detail)
══════════════════════════════════════ */
.profile-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-light) 100%);
  padding: 30px 32px;
  display: flex; gap: 24px; align-items: flex-start;
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(232,123,47,.1) 0%, transparent 70%);
  pointer-events: none;
}
.profile-photo {
  width: 92px; height: 110px; border-radius: 14px;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.18);
  background: var(--navy-light);
  position: relative; z-index: 1;
}
.profile-photo-ph {
  width: 92px; height: 110px; border-radius: 14px;
  background: rgba(255,255,255,.08); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: var(--primary-light);
  border: 2px solid rgba(255,255,255,.1);
  position: relative; z-index: 1;
}
.profile-hero-info { flex: 1; position: relative; z-index: 1; }
.profile-hero-info h2 {
  font-size: 24px; font-weight: 800; color: var(--white);
  letter-spacing: -.5px; line-height: 1.15; margin-bottom: 4px;
}
.profile-hero-info .profile-desig {
  font-size: 13px; color: rgba(255,255,255,.5); font-weight: 600;
  margin-bottom: 14px;
}
.profile-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.profile-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(232,123,47,.12);
  border: 1px solid rgba(232,123,47,.25);
  color: var(--primary-light); font-size: 11px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; letter-spacing: .3px;
}
.profile-tag svg { width: 11px; height: 11px; opacity: .7; }
.profile-hero-codes { flex-shrink: 0; text-align: right; position: relative; z-index: 1; }
.profile-code-box {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 10px 18px; 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: 26px 32px; }
.profile-section { margin-bottom: 26px; }
.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(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border-light);
}
.profile-section-head svg { width: 14px; height: 14px; opacity: .5; stroke: var(--primary); }

.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.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(--text-muted); margin-bottom: 4px;
}
.pf-value {
  font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.5; word-break: break-word;
}
.pf-value.multiline { white-space: pre-line; font-size: 12px; }

.profile-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 22px 0;
}

/* Biometrics strip */
.bio-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.bio-cell { text-align: center; }
.bio-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted); margin-bottom: 6px;
}
.bio-img {
  width: 100%; aspect-ratio: 1; border-radius: 10px;
  border: 1.5px solid var(--border);
  object-fit: cover; background: var(--bg-warm);
  cursor: pointer; display: block;
  transition: all .2s;
}
.bio-img:hover {
  border-color: var(--primary);
  transform: scale(1.03);
  box-shadow: var(--shadow-glow);
}
.bio-img-contain { object-fit: contain !important; }
.bio-na {
  width: 100%; aspect-ratio: 1; border-radius: 10px;
  border: 1.5px dashed var(--border);
  background: var(--bg-warm);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #c4b8ac; font-weight: 600;
}

/* ══════════════════════════════════════
   STATUS TOGGLE & INACTIVE BADGE
══════════════════════════════════════ */
.status-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.status-toggle-track {
  width: 36px; height: 20px; border-radius: 12px;
  background: #d1d5db; position: relative;
  transition: background .25s; flex-shrink: 0;
}
.status-toggle-track.active { background: var(--green); }
.status-toggle-track.inactive { background: var(--red); }
.status-toggle-knob {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--white); position: absolute; top: 2px; left: 2px;
  transition: transform .25s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.status-toggle-track.active .status-toggle-knob { transform: translateX(16px); }
.status-toggle-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px;
}
.status-toggle-label.lbl-active { color: var(--green); }
.status-toggle-label.lbl-inactive { color: var(--red); }
.badge-inactive {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700;
  background: var(--red-bg); color: var(--red);
  padding: 4px 12px; border-radius: 20px;
  letter-spacing: .3px;
  border: 1px solid rgba(239,68,68,.2);
}
.badge-inactive::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
}

/* ══════════════════════════════════════
   PDF / PRINT
══════════════════════════════════════ */
#pdfFrame {
  position: fixed; left: -9999px; top: 0;
  width: 210mm; background: white;
  visibility: hidden;
}
@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea {
    display: block !important;
    position: fixed; inset: 0;
    background: white; z-index: 99999;
  }
  @page { size: A4; margin: 0; }
}
#printArea { display: none; }
#printArea.printing { display: block; }
