/* Tra cứu quy hoạch — UI clone theo Guland/ThongTin.land */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --acc: #006aff;        /* xanh chủ đạo — theo dautudatnongnghiep.com */
  --acc-d: #0051d5;
  --ink: #1f2937;
  --mut: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --shadow: 0 2px 14px rgba(0,0,0,.14);
  --r: 10px;
}
html, body { height: 100%; font: 14px/1.45 'Roboto', 'Lexend', system-ui, -apple-system, sans-serif; color: var(--ink); overflow: hidden; }
#map { position: fixed; inset: 0; }
button { font: inherit; cursor: pointer; }

/* ============ TOPBAR ============ */
.tb {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: var(--card);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 6px rgba(0,0,0,.07);
  --ctl-h: 36px; /* mọi control header cùng chiều cao */
}
.tb-brand { display: flex; align-items: center; gap: 8px; padding-right: 6px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.tb-brand .lg { width: 28px; height: 28px; border-radius: 7px; display: block; }
.tb-brand .bt { display: flex; flex-direction: column; font-weight: 700; font-size: 13px; letter-spacing: .02em; line-height: 1.1; }
.tb-brand .bt b { color: var(--acc); display: inline; }
.tb-brand small { font-weight: 500; color: var(--mut); font-size: 10px; }

.tb-sel {
  max-width: 150px; height: var(--ctl-h); padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  background: #f9fafb; font-size: 13px; color: var(--ink); flex-shrink: 1; min-width: 0;
}
.tb-sel:focus { outline: 2px solid var(--acc); border-color: var(--acc); }

/* ============ nút chọn vị trí + panel tỉnh × xã ============ */
.loc-pick {
  display: flex; align-items: center; gap: 7px; height: var(--ctl-h); padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #f9fafb;
  max-width: 220px; min-width: 0; color: var(--ink);
}
.loc-pick:hover { border-color: var(--acc); }
.loc-pick:focus { outline: 2px solid var(--acc); border-color: var(--acc); }
.lp-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; text-align: left; }
.lp-txt b { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-txt small { font-size: 10px; color: var(--mut); }
.lp-car { color: var(--mut); font-size: 10px; }
.lp-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.lp-dot.ok { background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.lp-dot.none { background: #d1d5db; }

.loc-panel {
  position: fixed; top: calc(var(--tb-h, 52px) + 6px); left: 8px; z-index: 45;
  width: min(600px, 96vw); max-height: min(72vh, 560px);
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.loc-panel[hidden] { display: none; }
.lp-search { padding: 8px; border-bottom: 1px solid var(--line); }
.lp-search input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.lp-search input:focus { outline: 2px solid var(--acc); border-color: var(--acc); }
.lp-cols { display: flex; min-height: 0; flex: 1; }
.lp-provs { flex: 0 0 36%; overflow-y: auto; border-right: 1px solid var(--line); background: #fafbfc; }
.lp-areas { flex: 1; overflow-y: auto; }
.lp-p { padding: 9px 10px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.lp-p small { color: var(--mut); font-weight: 500; font-size: 10px; }
.lp-p:hover { background: #e0f2ff; }
.lp-p.on { background: #e0f2ff; color: var(--acc); }
.lp-p.dim { color: var(--mut); }
.lp-g { position: sticky; top: 0; padding: 6px 10px 4px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); background: #f6f8fa; border-bottom: 1px solid #f3f4f6; z-index: 1; }
.lp-a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; cursor: pointer; }
.lp-a:hover { background: #e0f2ff; }
.lp-a.on { background: #e0f2ff; font-weight: 700; }
.lp-a small { margin-left: auto; color: var(--mut); }
.lp-empty { padding: 14px; font-size: 12px; color: var(--mut); }

/* thanh search 1 hàng: tab nằm trong thanh, cùng chiều cao --ctl-h với mọi control */
.search-box { position: relative; flex: 2 1 320px; display: flex; max-width: 620px; min-width: 120px;
  height: var(--ctl-h); align-items: stretch;
  border: 1px solid var(--line); border-radius: 9px; background: #f9fafb; }
.search-box:focus-within { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc); }
.q-tabs { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; padding: 0 3px; border-right: 1px solid var(--line); }
.q-tab {
  padding: 4px 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--mut); font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.q-tab.on { background: var(--acc); color: #fff; }
.q-tab:hover:not(.on) { background: #eef2f5; color: var(--ink); }
.tb-search {
  flex: 1; min-width: 0; padding: 0 10px; border: 0; border-radius: 0;
  font-size: 13px; background: transparent; overflow: hidden; text-overflow: ellipsis;
}
.tb-search:focus { outline: none; }
.tb-go {
  padding: 0 14px; border: 0; margin: -1px -1px -1px 0; border-radius: 0 8px 8px 0;
  background: var(--acc); color: #fff; font-size: 14px;
}
.tb-go:hover { background: var(--acc-d); }

.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  display: none; max-height: 320px; overflow: auto;
}
.search-results.on { display: block; }
.sr-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover { background: #e0f2ff; }
.sr-item .t { color: var(--mut); font-size: 11px; }
.sr-item.muted { color: var(--mut); cursor: default; }
.sr-sec {
  padding: 6px 12px 4px; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--mut); background: #f6f8fa;
  border-bottom: 1px solid #f3f4f6; position: sticky; top: 0;
}

.tb-actions { display: flex; gap: 6px; margin-left: auto; }
.tb-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: var(--ctl-h); padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap;
}
.tb-btn:hover { border-color: var(--acc); color: var(--acc); }
.tb-btn[hidden] { display: none; } /* inline-flex override [hidden] của browser → khai lại */
.tb-btn.pri { background: var(--acc); border-color: var(--acc); color: #fff; }
.tb-btn.pri:hover { background: var(--acc-d); }

/* ============ PILLS (hàng lọc nhanh) ============ */
.pills {
  position: fixed; top: calc(var(--tb-h, 50px) + 6px); left: 50%; transform: translateX(-50%); z-index: 25;
  display: flex; gap: 6px; padding: 4px; max-width: 96vw; overflow-x: auto;
  background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.pills:empty { display: none; }
.pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 13px;
  border: 0; border-radius: 999px; background: transparent; font-size: 12.5px; font-weight: 600;
  color: var(--ink); white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; }
.pill.active { background: var(--acc); color: #fff; }
.pill.active .dot { background: #fff; }
.pill.off { opacity: .45; }
.pill:hover:not(.active) { background: #e0f2ff; }

/* ============ RIGHT TOOLBAR ============ */
.rtb {
  position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 25;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 4px;
}
.rtb-b {
  width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent;
  font-size: 17px; color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.rtb-b:hover { background: #e0f2ff; color: var(--acc); }
.rtb-b.off { opacity: .38; filter: grayscale(1); }
.rtb-b.busy { animation: rtbPulse 1s ease-in-out infinite; color: var(--acc); }
@keyframes rtbPulse { 50% { opacity: .35; transform: scale(.92); } }
.rtb-pct { font-size: 10px; color: var(--mut); font-weight: 700; padding: 1px 0; font-variant-numeric: tabular-nums; }
.rtb-sep { width: 24px; height: 1px; background: var(--line); margin: 3px 0; }

/* ============ BOTTOM CENTER BAR ============ */
.bottombar {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 25;
  display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none;
}
.locbar {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  background: rgba(17,24,39,.88); color: #fff; padding: 7px 16px; border-radius: 999px;
  font-size: 12.5px; cursor: pointer; box-shadow: var(--shadow); max-width: 92vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#loc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
#loc-ll { color: #a5f3c0; font-variant-numeric: tabular-nums; }
.old-admin { color: #d1d5db; font-weight: 400; }
.loc-actions { pointer-events: auto; display: flex; gap: 6px; }
.loc-actions button {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 12px; font-weight: 600; box-shadow: var(--shadow);
}
.loc-actions button:hover { border-color: var(--acc); color: var(--acc); }

/* chip góc trái dưới: đếm ô QH / thửa trong khung + báo ra khỏi vùng dữ liệu */
.map-chip {
  position: fixed; bottom: 12px; left: 10px; z-index: 25;
  background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 11px; font-size: 12px; color: var(--ink);
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
}
.map-chip.warn { color: #8a5a00; background: #fdf6e5; border-color: #f0dfb0; cursor: pointer; }
.map-chip.warn:hover { background: #fbeed0; }

/* ============ LEFT DRAWER (danh mục lớp) ============ */
.panel {
  position: fixed; top: 52px; left: 0; bottom: 0; width: 342px; z-index: 28;
  background: #fff; border-right: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transform: translateX(-105%); transition: transform .22s ease;
}
.panel.open { transform: none; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px; border-bottom: 1px solid var(--line);
}
.panel-head h1 { font-size: 16px; }
.panel-x { border: 0; background: transparent; font-size: 16px; color: var(--mut); }
.panel-x:hover { color: var(--ink); }
.panel-scroll { overflow-y: auto; padding: 10px 14px 20px; flex: 1; }
.panel-loc { font-size: 12px; font-weight: 700; color: var(--acc); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }

.pending-note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: #92400e; margin-bottom: 8px; }
.sec-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); margin: 14px 0 6px; display: flex; align-items: center; justify-content: space-between; }
.lg-all { border: 0; background: none; color: var(--acc); font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.lg-all:hover { text-decoration: underline; }

.map-item { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 7px; cursor: pointer; transition: border-color .15s; }
.map-item:hover { border-color: var(--acc); }
.map-item.active { border-color: var(--acc); background: #e0f2ff; }
.head-row { display: flex; gap: 9px; align-items: flex-start; }
.head-row input[type=checkbox] { margin-top: 3px; accent-color: var(--acc); }
.map-item .t { font-weight: 650; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.map-item .d { color: var(--mut); font-size: 11.5px; margin-top: 2px; }
.map-item .meta { color: #92400e; font-size: 11px; margin-top: 3px; }
.badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.badge.ok { background: #bfe0ff; color: #166534; }
.badge.offline { background: #fee2e2; color: #b91c1c; }
.badge.empty { background: #f3f4f6; color: #6b7280; }
.badge.digitized { background: #fef9c3; color: #854d0e; }
.badge.legal { background: #dbeafe; color: #1d4ed8; }
.sublayers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; padding-left: 24px; }
.sublayers label { font-size: 12px; color: var(--mut); display: flex; gap: 4px; align-items: center; }
.sublayers input { accent-color: var(--acc); }

#land-filter { width: 100%; margin-top: 12px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; background: #f9fafb; }
.layer-row { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.layer-row input { accent-color: var(--acc); }
.opacity-wrap { margin-top: 10px; font-size: 12px; color: var(--mut); }
.opacity-wrap input { width: 100%; accent-color: var(--acc); }
.legend { display: flex; flex-wrap: wrap; gap: 5px; }
.lg-row { display: flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 8px; background: #f9fafb; border: 1px solid var(--line); border-radius: 999px; }
.lg-row .sw { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); }
.lg-row .code { font-weight: 700; }
.credit { margin-top: 16px; font-size: 10.5px; color: #9ca3af; line-height: 1.5; }

/* ============ MODALS ============ */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); width: min(560px, 94vw); max-height: 84vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; }
.modal-x { border: 0; background: transparent; font-size: 16px; color: var(--mut); }
.modal-x:hover { color: var(--ink); }
.modal-body { overflow-y: auto; padding: 12px 18px; }
.modal-foot { padding: 10px 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--mut); }
.guide p { margin-bottom: 9px; font-size: 13px; }
.guide code { background: #f3f4f6; padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.guide .warn { color: #92400e; background: #fffbeb; padding: 8px 10px; border-radius: 8px; }
.kh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 5px; }
.kh-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; }
.kh-item .sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); flex-shrink: 0; }
.kh-item b { font-size: 11px; }
.kh-item small { color: var(--mut); display: block; line-height: 1.2; }

/* ============ hint / loading ============ */
.hint {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); z-index: 40;
  background: rgba(17,24,39,.9); color: #fff; font-size: 12.5px; padding: 8px 16px; border-radius: 999px;
  pointer-events: none; transition: opacity .4s; white-space: nowrap;
}
.hint.hide { opacity: 0; }
.parcel-loading {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); z-index: 40;
  background: var(--acc); color: #fff; font-size: 12px; padding: 6px 14px; border-radius: 999px; font-weight: 600;
}

/* ============ map popup phụ (tọa độ/WMS) ============ */
.qh-popup .maplibregl-popup-content { border-radius: 10px; padding: 0; overflow: hidden; box-shadow: var(--shadow); }
.qh-popup .head { background: var(--acc); color: #fff; font-weight: 700; padding: 8px 12px; font-size: 13px; }
.qh-popup .src { padding: 4px 12px 0; font-size: 10.5px; color: var(--mut); }
.qh-popup .body { padding: 8px 12px 10px; }
.qh-popup .row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 2px 0; }
.qh-popup .row span { color: var(--mut); }



/* ============ responsive ============ */
/* tablet + mobile (≤900px) */
@media (max-width: 900px) {
  .tb { flex-wrap: wrap; padding: 6px 8px; gap: 6px; }
  .tb-brand .bt small { display: none; }
  .tb-brand .bt { font-size: 12px; }
  .tb-sel { max-width: 128px; font-size: 12px; padding: 0 6px; }
  .search-box { order: 3; flex-basis: 100%; max-width: none; }
  .tb-btn span { display: none; }
  .tb-btn { padding: 0 9px; font-size: 14px; }
  .pills { left: 8px; right: 8px; transform: none; max-width: none;
    border-radius: 14px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 99%);
    mask-image: linear-gradient(90deg, #000 88%, transparent 99%); }
  .pills::-webkit-scrollbar { display: none; }
  .pill { padding: 5px 11px; font-size: 12px; }
  .rtb { right: 8px; }
  .loc-actions { display: none; }
  .panel { width: min(340px, 88vw); top: var(--tb-h, 52px); }
  .bottombar { bottom: 8px; }
  .loc-pick { max-width: 170px; }
  .loc-panel { left: 8px; right: 8px; width: auto; }
}

/* điện thoại (≤640px): panel = overlay toàn màn hình, không chồng lấn map/toolbar */

/* điện thoại (≤640px): panel = overlay toàn màn hình, không chồng lấn map/toolbar */
@media (max-width: 640px) {
  .panel { width: 100vw; top: 0; bottom: 0; z-index: 35; border-right: 0; }
  .panel-head { padding-top: 10px; }
  .tb-sel { flex: 1 1 0; max-width: none; } /* 2 select chia đều hàng */
  .loc-pick { flex: 1 1 0; max-width: none; }
  .lp-txt small { display: none; }
  .loc-panel { left: 0; right: 0; width: auto; max-height: 76vh; }
  .rtb { right: 6px; padding: 3px; }
  .rtb-b { width: 34px; height: 34px; font-size: 15px; }
  .hint, .parcel-loading { max-width: 92vw; white-space: normal; text-align: center; }
  .locbar { max-width: 96vw; padding: 6px 12px; font-size: 11.5px; gap: 7px; }
  .map-chip { bottom: 56px; left: 8px; } /* nhường chỗ cho locbar dưới đáy */
  .modal-card { width: 96vw; max-height: 88vh; }
  .search-results { max-height: 46vh; }
  .kh-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* điện thoại nhỏ (≤400px): co brand + nút hành động */
@media (max-width: 400px) {
  .tb { gap: 5px; padding: 5px 7px; }
  .tb-brand .bt { font-size: 11px; }
  .tb-sel { font-size: 11.5px; padding: 0 4px; }
  .tb-btn { padding: 0 8px; }
  .pill { padding: 5px 9px; font-size: 11.5px; }
  .q-tab { font-size: 10.5px; padding: 3px 6px; }
  .tb-search { font-size: 12px; padding: 0 8px; }
}

/* ============ thẳng hàng tuyệt đối: brand + input search cùng hàng 36px ============ */
.tb-brand { height: var(--ctl-h); }
.tb-search { align-self: stretch; }

/* ============ né layout: các khối fixed không đè nhau ============ */
/* panel chọn tỉnh/xã mở → giấu pills (picker là overlay độc lập) */
body.loc-open .pills { display: none; }
@media (min-width: 901px) {
  /* drawer lớp 342px trái + report 418px phải → dịch pills vào vùng trống */
  body.panel-open .pills { left: calc(50% + 171px); max-width: calc(100vw - 460px); }
  body.report-open .pills { left: calc(50% - 209px); max-width: calc(100vw - 460px); }
  body.panel-open.report-open .pills { left: calc(50% - 38px); max-width: calc(100vw - 790px); }
  /* chip góc trái dưới bị panel che → đẩy sang phải mép panel */
  body.panel-open .map-chip { left: 352px; }
}

/* ============ tài khoản + địa điểm đã lưu ============ */
.auth-menu {
  position: fixed; top: calc(var(--tb-h, 52px) + 6px); right: 12px; z-index: 46;
  width: 284px; max-height: min(70vh, 480px); overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 8px;
}
.auth-menu[hidden] { display: none; }
.am-user { padding: 6px 8px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.am-user b { font-size: 13px; }
.am-user small { font-size: 11px; color: var(--mut); }
.am-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.am-item:hover { background: #e0f2ff; }
.am-out { color: #b91c1c; }
.am-sec { padding: 8px 8px 4px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
.am-list { max-height: 220px; overflow-y: auto; }
.am-fav { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.am-fav:hover { background: #e0f2ff; }
.am-fav .fav-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.am-fav b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-fav small { font-size: 10.5px; color: var(--mut); }
.fav-x { border: 0; background: transparent; color: var(--mut); font-size: 12px; padding: 4px; border-radius: 6px; opacity: 0; }
.am-fav:hover .fav-x { opacity: 1; }
.fav-x:hover { color: #b91c1c; }
.am-empty { padding: 10px 8px; font-size: 12px; color: var(--mut); }
.am-save { display: flex; gap: 6px; padding: 6px 4px; }
.am-save[hidden] { display: none; }
.am-save input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; }
.am-save input:focus { outline: 2px solid var(--acc); border-color: var(--acc); }
.am-save button { padding: 7px 12px; border: 0; border-radius: 8px; background: var(--acc); color: #fff; font-size: 12.5px; font-weight: 700; }

.auth-card { width: min(360px, 94vw); }
.auth-tabs { display: flex; gap: 4px; background: #f3f4f6; border-radius: 9px; padding: 3px; margin-bottom: 12px; }
.auth-tab { flex: 1; border: 0; border-radius: 7px; padding: 7px; font-size: 13px; font-weight: 600; color: var(--mut); background: transparent; }
.auth-tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-lb { display: block; font-size: 12px; font-weight: 600; color: var(--mut); margin-bottom: 10px; }
.auth-lb input { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.auth-lb input:focus { outline: 2px solid var(--acc); border-color: var(--acc); }
.auth-err { font-size: 12px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 7px 10px; margin-bottom: 10px; }
.auth-submit { width: 100%; padding: 10px; border: 0; border-radius: 9px; background: var(--acc); color: #fff; font-size: 14px; font-weight: 700; }
.auth-submit:hover { background: var(--acc-d); }
.auth-submit:disabled { opacity: .6; }
.auth-forgot { display: block; margin: 8px auto 0; border: 0; background: transparent; font-size: 12px; color: var(--acc); }
.auth-note { margin-top: 10px; font-size: 11px; color: var(--mut); text-align: center; }

/* loc-panel: nhóm cấp đơn vị hành chính + meta huyện cũ */
.lp-g small { font-weight: 600; color: #b6bdc9; letter-spacing: 0; text-transform: none; }
.lp-a .lp-n { flex: 1; min-width: 0; }
