
/*
 * Giao diện theo mẫu "web app tạo hồ sơ": chữ Inter, nền xám nhạt, menu trắng gập/mở theo nhóm (biểu tượng xanh lá),
 * mục đang chọn nền xanh nhạt + vạch xanh bên phải, thẻ trắng bo 12px có bóng nhẹ, nút màu chuyển sắc nổi khi rê chuột,
 * bảng tiêu đề xanh lá chuyển sắc chữ in hoa, dòng xen màu. Chỉ đổi phần nhìn — tên lớp giữ nguyên cho mọi trang.
 */
:root {
  --bg: #f3f4f6; --page: #f4f7f6; --panel: #fff; --text: #334155; --head: #1f2937; --muted: #64748b; --line: #e2e8f0; --line2: #cbd5e1;
  --brand: #43A047; --brand-d: #2E7D32; --brand-dd: #1b5e20; --brand-l: #E8F5E9; --brand-ll: #f0fdf4;
  --ok: #2e7d32; --warn: #b45309; --err: #dc2626; --info: #0369a1;
  --radius: 12px; --side: 288px;
  --shadow: 0 2px 10px rgba(0,0,0,.05); --shadow-2: 0 4px 10px rgba(0,0,0,.15);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-d); }
a:hover { color: var(--brand-dd); }
.boot { padding: 40px; text-align: center; color: var(--muted); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* Đăng nhập */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(135deg, #f0fdf4, var(--bg)); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--radius);
  padding: 30px; box-shadow: 0 10px 30px rgba(20,60,30,.08); animation: fadeIn .3s ease-in-out; }
.auth-card h1 { font-size: 21px; margin: 0 0 4px; color: var(--head); font-weight: 800; }
.auth-card .sub { color: var(--muted); margin: 0 0 20px; }

/* Bố cục: menu trái trắng + vùng chính */
.layout { display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; overflow: hidden; transition: grid-template-columns .3s ease-in-out; }
.layout.side-closed { grid-template-columns: 0 1fr; }
.side { background: #fff; color: #4b5563; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; height: 100vh; overflow: hidden; white-space: nowrap; }
.layout.side-closed .side { border-right: 0; }
.side .brand { display: flex; align-items: center; gap: 10px; margin: 12px; padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #fff; font-weight: 800; font-size: 13.5px; white-space: normal; line-height: 1.3;
  box-shadow: 0 2px 6px rgba(46,125,50,.25); }
.side nav, .side .nav { flex: 1; overflow-y: auto; padding: 4px 0 8px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 48px; color: #4b5563; text-decoration: none; cursor: pointer;
  font-size: 13.5px; border-right: 4px solid transparent; transition: background .2s, color .2s; }
.side a:hover { background: #f3f4f6; color: var(--head); }
.side a.active { background: var(--brand-l); color: var(--brand); border-right-color: var(--brand); font-weight: 600; }
.side a.soon { opacity: .45; }
.side a.nav-home { padding-left: 20px; font-weight: 700; color: #374151; border-bottom: 1px solid #f3f4f6; }
.side a.nav-home.active { color: var(--brand); }
.side .grp { border-bottom: 1px solid #f9fafb; }
.side .grp-h { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: none; border: 0; cursor: pointer;
  font-size: 13.5px; font-weight: 700; color: #374151; text-align: left; transition: background .2s; }
.side .grp-h:hover { background: #f9fafb; }
.side .grp-h .lbl { flex: 1; }
.side .grp-h .chev { color: #9ca3af; transition: transform .3s cubic-bezier(.4,0,.2,1); }
.side .grp.open .grp-h .chev { transform: rotate(180deg); }
.side .grp-items { max-height: 0; opacity: 0; overflow: hidden; background: rgba(249,250,251,.6);
  transition: max-height .3s cubic-bezier(.4,0,.2,1), opacity .3s cubic-bezier(.4,0,.2,1); }
.side .grp.open .grp-items { opacity: 1; padding-bottom: 6px; }
.ic { display: inline-flex; width: 20px; height: 20px; flex-shrink: 0; }
.ic svg { width: 100%; height: 100%; }
.side .ic.brandc { color: var(--brand); }
.side .brand .ic { color: #fff; }
.side .me { border-top: 1px solid #e5e7eb; background: #f9fafb; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.side .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 17px;
  flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.side .me .nm { font-size: 13.5px; font-weight: 700; color: var(--head); overflow: hidden; text-overflow: ellipsis; }
.side .me .rl { font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 24px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); flex-shrink: 0; z-index: 5; }
.top .title { font-weight: 800; font-size: 17px; flex: 1; color: var(--head); text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who { color: var(--muted); font-size: 12.5px; text-align: right; padding-right: 12px; border-right: 1px solid #e5e7eb; }
.top .who b { color: var(--head); }
.dt-stats { display: flex; align-items: center; font-size: 13px; cursor: pointer; flex-shrink: 0; }
.dt-item { display: flex; align-items: center; gap: 6px; padding: 0 14px; border-right: 1px solid #e5e7eb; white-space: nowrap; }
.dt-item .ic { width: 16px; height: 16px; }
.dt-item .k { font-size: 11.5px; color: #6b7280; font-weight: 600; text-transform: uppercase; }
.xanh { color: #15803d; } .do { color: #b91c1c; }
.social { display: flex; align-items: center; gap: 2px; padding: 0 8px; }
.social a { display: inline-flex; padding: 6px; border-radius: 8px; transition: background .2s, transform .2s; }
.social a:hover { background: #f3f4f6; transform: translateY(-1px); }
.ic.logo { width: 22px; height: 22px; }
.side .me { cursor: pointer; transition: background .2s; }
.side .me:hover { background: #f0fdf4; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-lg { width: 112px; height: 112px; border-radius: 50%; background: var(--brand-l); color: var(--brand); display: grid; place-items: center;
  overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--brand), var(--shadow-2); }
.avatar-lg .ic { width: 36px; height: 36px; }
.avatar-box { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 6px 0; }
.av-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; overflow: hidden; }
.av-sm img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1200px) { .dt-item .k { display: none; } }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-left: -8px; border: 0; border-radius: 8px;
  background: none; color: #6b7280; cursor: pointer; transition: background .2s, color .2s; }
.menu-btn:hover { background: #f3f4f6; color: var(--brand); }
.content { flex: 1; overflow-y: auto; margin: 16px; padding: 16px; background: var(--page); border: 1px solid #eef0f2; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.content > * { animation: fadeIn .3s ease-in-out; }
.side-bg { display: none; }

@media (max-width: 860px) {
  .layout, .layout.side-closed { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 280px; z-index: 30; transform: translateX(-100%); transition: transform .3s ease-in-out; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .side.open + .side-bg { display: block; position: fixed; inset: 0; background: rgba(20,83,45,.45); z-index: 25; }
  .content { margin: 8px; padding: 10px; }
  .top { padding: 0 12px; }
  .top .who span.email { display: none; }
}

/* Thành phần */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: #fff; padding: 8px 16px; border-radius: 8px; cursor: pointer;
  white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text); transition: all .2s; }
.btn:hover { background: #f1f5f9; border-color: #94a3b8; transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-d)); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 2px 5px rgba(0,0,0,.1); }
.btn.primary:hover { filter: brightness(1.1); box-shadow: var(--shadow-2); }
.btn.danger { color: #b91c1c; border-color: #fca5a5; background: #fff5f5; }
.btn.danger:hover { background: #fee2e2; border-color: #f87171; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn[disabled], .btn[disabled]:hover { opacity: .55; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; color: #475569; font-weight: 600; }
.field input, .field select, .field textarea, input.search { border: 1px solid var(--line2); border-radius: 8px; padding: 9px 12px; background: #f8fafc; width: 100%;
  font-size: 13.5px; outline: none; transition: all .2s ease; }
/* Ô nhập / ô chọn nằm ngoài .field (thanh lọc, bảng…) cũng cùng kiểu */
.content select, .modal select, .content textarea, .modal textarea,
.content input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]),
.modal input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]) {
  border: 1px solid var(--line2); border-radius: 8px; padding: 8px 12px; background: #f8fafc; font-size: 13.5px; outline: none; transition: all .2s ease; max-width: 100%; }
.content select, .modal select { cursor: pointer; padding-right: 8px; }
.content select:focus, .modal select:focus, .content textarea:focus, .modal textarea:focus, .content input:focus, .modal input:focus {
  border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(67,160,71,.15); }
.field input[type=checkbox], .field input[type=radio] { width: auto; padding: 0; margin: 0; accent-color: var(--brand); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
label.row { cursor: pointer; padding: 3px 0; }
.field input:focus, .field select:focus, .field textarea:focus, input.search:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(67,160,71,.15); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.hint { font-size: 12px; color: var(--muted); }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid transparent; font-size: 13.5px; }
.msg.err { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.msg.info { background: #e0f2fe; color: var(--info); border-color: #bae6fd; }
.msg.warn { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; background: #f1f5f9; color: #475569; border: 1px solid var(--line); white-space: nowrap; }
.row.nowrap { flex-wrap: nowrap; }
.badge.ok { background: var(--brand-l); color: var(--brand-d); border-color: #c8e6c9; }
.badge.err { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.badge.warn { background: #fef3c7; color: var(--warn); border-color: #fcd34d; }
.sec-title { font-weight: 700; margin: 0 0 12px; font-size: 15px; color: var(--head); padding-left: 10px; border-left: 4px solid var(--brand); line-height: 1.25; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
@media (max-width: 900px) { .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid3, .grid4 { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; color: var(--head); }
.stat { display: inline-flex; flex-direction: column; gap: 2px; padding: 10px 16px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px;
  background: #fff; min-width: 150px; box-shadow: var(--shadow); }
.stat .k { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.stat .v { font-size: 19px; font-weight: 800; color: var(--head); }
.split { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.list-item { padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.list-item:hover, .list-item.active { background: var(--brand-ll); }
.list-item.active { box-shadow: inset 4px 0 0 var(--brand); }
.tbl tr.click { cursor: pointer; }
.chk { display: inline-flex; align-items: center; gap: 6px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.thumb { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; box-shadow: var(--shadow); transition: all .2s; }
.thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #c8e6c9; }
.thumb img { width: 100%; height: 112px; object-fit: cover; display: block; background: #f1f5f9; }
.thumb .cap { font-size: 12px; padding: 5px 8px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Khung xem ảnh toàn màn hình */
.lb { position: fixed; inset: 0; background: rgba(10,14,22,.92); z-index: 60; display: flex; flex-direction: column; user-select: none; }
.lb-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #e8edf5; font-size: 14px; }
.lb-cap { font-weight: 600; } .lb-tt { color: #9fb3d1; font-size: 13px; }
.lb-wrap { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lb-img { max-width: 92vw; max-height: calc(100vh - 110px); transition: transform .08s ease-out; transform-origin: center center; }
.lb-img.mo { filter: blur(1.5px); min-width: 50vw; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: 8px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 22px; cursor: pointer; z-index: 61; }
.lb-nav:hover { background: rgba(255,255,255,.25); } .lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-top .btn:not(.danger) { color: #1d2433; }
.lb-hint { text-align: center; color: #8a9bb5; font-size: 12px; padding: 6px 0 10px; }
.mono { font-family: Consolas, monospace; }

/* Trang Định vị: bộ lọc trái + bản đồ phải + bảng dưới (theo mẫu "Bản đồ khách hàng") */
.dv-head { padding: 10px 16px; }
.dv-count { background: var(--brand-l); color: var(--brand-d); font-weight: 800; padding: 3px 10px; border-radius: 20px; font-size: 13px; border: 1px solid #c8e6c9; }
.dv-grid { display: grid; grid-template-columns: 290px 1fr; gap: 14px; align-items: stretch; }
@media (max-width: 1000px) { .dv-grid { grid-template-columns: 1fr; } }
.dv-filter { margin-bottom: 14px; }
.dv-filter .field { margin-bottom: 9px; }
.dv-mapbox { position: relative; isolation: isolate; padding: 0; overflow: hidden; margin-bottom: 14px; min-height: 460px; }
.dv-map { position: absolute; inset: 0; background: #e2e8f0; z-index: 0; }
.dv-full { position: absolute; top: 10px; right: 10px; z-index: 500; display: flex; gap: 6px; }
.dv-full .btn { box-shadow: var(--shadow-2); }
.dv-tag { display: inline-block; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.dv-legend { margin-top: 12px; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; display: grid; gap: 5px; }
.dv-legend-t { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #475569; }
.dv-legend div { display: flex; align-items: center; gap: 8px; color: #334155; }
.dv-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 1px 2px rgba(0,0,0,.2); flex-shrink: 0; }
.dv-pop { font-family: 'Inter', sans-serif; font-size: 12.5px; display: grid; gap: 4px; min-width: 240px; }
.dv-pop .k { color: var(--muted); }
.dv-pop-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px solid var(--line); color: var(--brand-d); }
.dv-pop-a { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.dv-pop-a a.btn.primary { color: #fff; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,.15); }
.tbl tbody tr.sel td { background: #dcfce7 !important; }
.tbl tbody tr.sel td:first-child { box-shadow: inset 4px 0 0 var(--brand); }

/* Bảng: tiêu đề xanh lá chuyển sắc, dòng xen màu */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
table.tbl { width: max-content; min-width: 100%; border-collapse: collapse; } /* cột giãn theo nội dung; rộng quá thì cuộn ngang */
.tbl td { max-width: 260px; }
.tbl th, .tbl td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; color: var(--text); }
.tbl th { background: linear-gradient(to bottom, var(--brand), #388E3C); color: #fff; font-weight: 700; font-size: 11px; text-transform: uppercase;
  letter-spacing: .03em; cursor: pointer; user-select: none; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl td a { white-space: nowrap; font-weight: 700; color: var(--brand-d); text-decoration: none; }
.tbl td a:hover { color: var(--brand-dd); text-decoration: underline; }
.tbl tbody tr:nth-child(even) td { background: #f8fafc; }
.tbl tbody tr:hover td { background: var(--brand-ll); }
.tbl .empty { text-align: center; color: var(--muted); padding: 28px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 2px 2px; color: var(--muted); font-size: 12.5px; font-weight: 500; }

/* Hộp thoại & thông báo */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(1px); }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.2);
  animation: fadeIn .2s ease-out; overflow: hidden; }
.modal header { padding: 14px 20px; border-bottom: 1px solid var(--line); font-weight: 800; color: var(--head); border-top: 4px solid var(--brand); }
.modal .body { padding: 18px 20px; overflow-y: auto; }
.modal footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: #f8fafc; }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 99999; pointer-events: none; }
.toast { background: #1f2937; color: #fff; padding: 9px 20px; border-radius: 30px; max-width: 520px; font-size: 13px; font-weight: 600; text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,.2); animation: fadeIn .25s ease-out; pointer-events: auto; }
.toast.err { background: #ef4444; }
.toast.ok { background: var(--brand); }
.loading { color: var(--muted); padding: 20px; text-align: center; }

/* ============ Trang Tư vấn — theo mẫu 247_TuVan_1 (khối màu, ô nhập gọn) ============ */
.tv { font-size: 13.5px; color: #334155; }
.tv-cols { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 1440px) { .tv-cols { grid-template-columns: 1fr 1fr; } }
.tv-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tv-card { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; border-top: 4px solid var(--tv); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03); transition: all .2s ease-in-out; }
.tv-card:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04); border-color: #cbd5e1; border-top-color: var(--tv); }
.tv-head { padding: 10px 16px; display: flex; align-items: center; color: #fff; background: linear-gradient(135deg, var(--tv) 0%, var(--tv2) 100%); }
.tv-head .tv-ico { background: rgba(255,255,255,.2); backdrop-filter: blur(4px); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; margin-right: 12px; }
.tv-head .tv-ico .ic, .tv-head .tv-ico svg { width: 17px; height: 17px; }
.tv-head h2 { margin: 0; font-size: 14.4px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #fff; }
.tv-body { padding: 16px; }
.tv-c1 { --tv: #1E88E5; --tv2: #1565C0; --tvd: #0D47A1; --tvl: #E3F2FD; }
.tv-c2 { --tv: #43A047; --tv2: #2E7D32; --tvd: #1B5E20; --tvl: #E8F5E9; }
.tv-c3 { --tv: #8E24AA; --tv2: #6A1B9A; --tvd: #4A148C; --tvl: #F3E5F5; }
.tv-c4 { --tv: #FB8C00; --tv2: #EF6C00; --tvd: #E65100; --tvl: #FFF3E0; }
.tv-c5 { --tv: #546E7A; --tv2: #37474F; --tvd: #263238; --tvl: #ECEFF1; }
.tv-sub { font-weight: 700; padding: 4px 10px; border-radius: 4px; border-left: 3px solid var(--tv); background: var(--tvl); color: var(--tvd);
  margin: 12px 0 10px; display: flex; align-items: center; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .025em; }
.tv-sub:first-child { margin-top: 0; }
.tv-sub .ic, .tv-sub svg { width: 13px; height: 13px; }
.tv-row { display: grid; gap: 12px; margin-bottom: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .tv-row.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tv-row.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tv-row.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tv-row.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tv .span2 { grid-column: span 2; } .tv .span3 { grid-column: span 3; }
}
.tv-row:last-child { margin-bottom: 0; }
.tv-lb { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.6px; font-weight: 600; color: #475569; margin-bottom: 3px; }
.tv-lb .req { color: #ef4444; margin-left: 2px; }
.tv input:not([type=checkbox]), .tv select, .tv textarea { width: 100%; padding: 6px 10px; font-size: 13.2px; border: 1px solid #cbd5e1; border-radius: 6px;
  outline: none; transition: all .15s ease-in-out; background: #f8fafc; color: #1e293b; font-family: inherit; min-height: 32px; }
.tv input:focus, .tv select:focus, .tv textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); background: #fff; }
.tv input[readonly], .tv textarea[readonly], .tv .auto { background: #f1f5f9; color: #475569; font-weight: 600; }
.tv input:disabled, .tv select:disabled, .tv textarea:disabled { opacity: .75; cursor: not-allowed; }
.tv textarea { resize: vertical; min-height: 56px; line-height: 1.5; font-size: 12.5px; }
.tv .up { text-transform: uppercase; } .tv .mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
.tv .bold { font-weight: 700; } .tv .xbold { font-weight: 800; }
.tv .t-blue { color: #1d4ed8; } .tv .t-green { color: #047857; } .tv .t-purple { color: #581c87; } .tv .t-red { color: #b91c1c; } .tv .t-violet { color: #6b21a8; }
.tv .b-green { border-color: #6ee7b7; } .tv .b-purple { border-color: #d8b4fe; } .tv .b-red { border-color: #fecaca; }
.tv-hint { font-size: 10.8px; margin-top: 3px; font-weight: 700; }
.tv-hint.err { color: #ef4444; } .tv-hint.ok { color: #059669; } .tv-hint.info { color: #2563eb; }
.tv-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #475569; cursor: pointer; }
.tv-mini { font-size: 10.5px; padding: 2px 8px; border-radius: 4px; border: 0; background: #9333ea; color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tv-mini:hover { background: #7e22ce; }
.tv-stats { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 12px; padding: 12px; margin-bottom: 12px; display: flex; align-items: center; }
.tv-stats > div { text-align: center; flex: 2; position: relative; }
.tv-stats > div.nho { flex: 1; }
.tv-stats .k { font-size: 10px; color: #065f46; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; }
.tv-stats .v { font-size: 16px; font-weight: 800; color: #022c22; }
.tv-stats .v.g { color: #047857; }
.tv-stats .sep { flex: 0 0 1px; width: 1px; height: 32px; background: #a7f3d0; }
.tv-stats .dot { position: absolute; top: -4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; animation: tvBounce 1s infinite; }
@keyframes tvBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.tv-alert { margin-bottom: 12px; padding: 8px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; border: 1px dashed; }
.tv-alert.err { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; } .tv-alert.info { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.tv-sched { border: 1px solid #a7f3d0; border-radius: 12px; overflow: hidden; }
.tv-sched .hd { background: rgba(236,253,245,.9); padding: 6px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; border-bottom: 1px solid #a7f3d0; }
.tv-sched .hd b { font-weight: 800; color: #064e3b; letter-spacing: .03em; display: inline-flex; align-items: center; gap: 6px; }
.tv-sched .hd b .ic, .tv-sched .hd b svg { width: 13px; height: 13px; }
.tv-sched .hd span { font-weight: 600; color: #065f46; } .tv-sched .hd span i { font-style: normal; color: #dc2626; font-weight: 800; }
.tv-sched .wrap { max-height: 176px; overflow-y: auto; }
.tv-sched table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tv-sched th { font-size: 10px; color: #064e3b; text-transform: uppercase; background: #ecfdf5; padding: 6px 12px; text-align: left; position: sticky; top: 0; }
.tv-sched td { padding: 6px 12px; border-top: 1px solid #f1f5f9; }
.tv-sched .c { text-align: center; } .tv-sched .r { text-align: right; } .tv-sched td.r { font-weight: 700; color: #047857; }
.tv-sched td.c.days { color: #64748b; }
.tv-sched .empty { text-align: center; padding: 12px; color: #94a3b8; font-style: italic; }
.tv-kin { background: rgba(255,247,237,.7); padding: 12px; border-radius: 8px; border: 1px solid #fed7aa; }
.tv-kin .t { font-size: 10px; font-weight: 800; color: #7c2d12; text-transform: uppercase; margin-bottom: 8px; letter-spacing: .05em; display: flex; align-items: center; gap: 4px; }
.tv-kin .t .ic, .tv-kin .t svg { width: 12px; height: 12px; color: #ea580c; }
.tv-kin .tv-row { gap: 8px; }
.tv-bar { position: sticky; bottom: 0; z-index: 6; margin-top: 20px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border: 1px solid #e2e8f0;
  border-radius: 12px; box-shadow: 0 -4px 16px rgba(15,23,42,.06); padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tv-bar .gap { flex: 1; }
.tv-bar .btn { padding: 7px 13px; font-size: 12.5px; border-radius: 10px; font-weight: 700; }
.tv-bar .btn .ic, .tv-bar .btn svg { width: 14px; height: 14px; }
.tv-bar .btn.in { background: linear-gradient(135deg, #1E88E5, #1565C0); border-color: transparent; color: #fff; }
.tv-bar .btn.tao { padding: 8px 18px; font-size: 13.5px; }
.tv-tt { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; border: 1px solid; }
.tv-tt.nhap { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.tv-tt.hd { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.tv-tt.sua { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.tv-tt.xong { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
.tv-hint.warn { color: #b45309; }
/* Ô thiếu / sai khi bấm In / Tạo HĐ */
.tv input.tv-loi, .tv select.tv-loi, .tv textarea.tv-loi { border-color: #ef4444; background: #fff5f5; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.tv-loi-msg { font-size: 10.8px; margin-top: 3px; font-weight: 700; color: #dc2626; }
/* Địa chỉ Tỉnh → Xã / Phường + chi tiết */
.tv-dc { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tv-dc { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 2fr); } }
.tv-xa { position: relative; }
.tv-goiy { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 2px; max-height: 240px; overflow: auto; background: #fff;
  border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 8px 24px rgba(15,23,42,.14); }
.tv-goiy div { padding: 6px 10px; font-size: 13px; cursor: pointer; }
.tv-goiy div:hover, .tv-goiy div.on { background: #eff6ff; color: #1d4ed8; }
.tv-goiy div.rong { color: #94a3b8; font-style: italic; cursor: default; background: none; }
/* Trạng thái tự lưu */
.tv-luu { font-size: 11.5px; font-weight: 600; color: #64748b; }
.tv-luu.chua { color: #b45309; } .tv-luu.loi { color: #dc2626; }
/* Hộp "Xem lại trước khi tạo" */
.tv-xl { font-size: 13px; }
.tv-xl-tien { text-align: center; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.tv-xl-tien .k { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #991b1b; letter-spacing: .04em; }
.tv-xl-tien .v { font-size: 26px; font-weight: 800; color: #dc2626; line-height: 1.2; }
.tv-xl-tien .chu { font-size: 12.5px; font-style: italic; color: #7f1d1d; }
.tv-xl-r { display: flex; gap: 10px; padding: 5px 0; border-top: 1px solid #f1f5f9; }
.tv-xl-r span { flex: 0 0 130px; color: #64748b; }
.tv-xl-r b { flex: 1; min-width: 0; word-break: break-word; color: #1e293b; }
.tv-xl-canh { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.tv-xl-canh ul { margin: 4px 0 4px 18px; padding: 0; }

/* ============ Trang Thẩm định giá — theo mẫu hoso.dangkyoto247.com/tham-dinh-gia (3 cột: Bộ lọc · Kết quả · Ảnh) ============ */
.td-wrap { display: flex; flex-direction: column; gap: 16px; width: 100%; }
@media (min-width: 1024px) {
  .td-wrap { flex-direction: row; align-items: stretch; height: calc(100vh - 150px); min-height: 480px; }
  .td-wrap .td-loc { width: 28%; } .td-wrap .td-kq, .td-wrap .td-anh { width: 36%; }
}
.td-col { background: #fff; border: 1px solid rgba(226,232,240,.8); border-radius: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05);
  display: flex; flex-direction: column; overflow: hidden; min-height: 480px; flex-shrink: 0; position: relative; }
.td-loc { padding: 16px; overflow: visible; }
.td-h { margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #64748b; }
.td-h > span:first-child { display: flex; align-items: center; gap: 8px; }
.td-h .ic, .td-h svg { width: 16px; height: 16px; color: var(--brand); }
.td-badge { border-radius: 999px; background: var(--brand-l); color: var(--brand); padding: 2px 8px; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.td-scroll { flex: 1; overflow-y: auto; padding-right: 2px; }
.td-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.td-tools .btn { padding: 5px 10px; font-size: 11.5px; border-radius: 8px; }
.td-f { margin-bottom: 12px; }
.td-l { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; color: #334155; }
.td-in, .td-loc select { width: 100%; border-radius: 12px; border: 1px solid #e2e8f0; background: #f8fafc; padding: 8px 12px; font-size: 12px; font-weight: 500;
  outline: none; transition: all .15s; color: #1e293b; font-family: inherit; }
.td-in:focus, .td-loc select:focus { border-color: var(--brand); background: #fff; }
.td-loc select:disabled { opacity: .5; cursor: not-allowed; }
.td-ten .td-l { color: var(--brand); }
.td-ten select { border: 2px solid rgba(67,160,71,.3); background: rgba(232,245,233,.5); font-weight: 700; color: #111827; }
.td-ten select:disabled { border-color: #e2e8f0; background: #f8fafc; }
.td-search { position: relative; }
.td-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: #94a3b8; pointer-events: none; }
.td-search .td-in { padding-left: 32px; padding-right: 30px; }
.td-search .x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #94a3b8; cursor: pointer; padding: 2px; display: none; }
.td-search .x .ic { position: static; transform: none; pointer-events: auto; }
.td-dd { position: absolute; left: 0; right: 0; z-index: 20; margin-top: 4px; max-height: 256px; overflow-y: auto; border: 1px solid #e2e8f0; background: #fff;
  border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1); }
.td-dd button { display: flex; width: 100%; align-items: flex-start; justify-content: space-between; gap: 8px; border: 0; border-bottom: 1px solid #f8fafc;
  background: #fff; padding: 8px 12px; text-align: left; font-size: 12px; cursor: pointer; font-family: inherit; }
.td-dd button:last-child { border-bottom: 0; }
.td-dd button:hover { background: var(--brand-l); }
.td-dd button span:first-child { font-weight: 500; color: #1e293b; }
.td-dd button span:last-child { flex-shrink: 0; font-weight: 700; color: #dc2626; }
.td-dd p { margin: 0; padding: 12px; font-size: 12px; color: #64748b; }
.td-or { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #cbd5e1; margin: 12px 0; }
.td-or i { flex: 1; height: 1px; background: #f1f5f9; }
.td-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(248,250,252,.4); padding: 24px; text-align: center; }
.td-empty .bx { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 16px; border: 1px solid rgba(67,160,71,.2);
  background: var(--brand-l); color: var(--brand); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.td-empty .bx.xam { border-color: rgba(226,232,240,.6); background: #f1f5f9; color: #94a3b8; }
.td-empty .bx .ic, .td-empty .bx svg { width: 28px; height: 28px; }
.td-empty h3 { margin: 0 0 4px; font-size: 14px; font-weight: 800; color: #334155; }
.td-empty p { margin: 0 0 24px; max-width: 260px; font-size: 12px; line-height: 1.6; color: #64748b; }
.td-empty p:last-child { margin-bottom: 0; }
.td-empty .dash { display: flex; gap: 8px; align-items: center; width: 100%; max-width: 280px; border: 1px dashed #e2e8f0; background: #fff; border-radius: 12px;
  padding: 14px; font-size: 11px; color: #94a3b8; text-align: left; }
.td-empty .dash .ic, .td-empty .dash svg { width: 16px; height: 16px; color: var(--brand); flex-shrink: 0; }
.td-kqh { flex-shrink: 0; background: linear-gradient(to right, var(--brand), #0f766e); color: #fff; padding: 16px 20px; display: flex; gap: 10px; align-items: flex-start; }
.td-kqh > div:first-child { flex: 1; min-width: 0; }
.td-kqh .t { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #d1fae5; display: flex; gap: 4px; align-items: center; margin-bottom: 2px; }
.td-kqh .t .ic, .td-kqh .t svg { width: 12px; height: 12px; }
.td-kqh h3 { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.35; }
.td-kqh .act { display: flex; gap: 6px; flex-shrink: 0; }
.td-kqh .act button { border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.15); color: #fff; border-radius: 8px; padding: 4px 9px; font-size: 11px; font-weight: 700; cursor: pointer; }
.td-kqh .act button:hover { background: rgba(255,255,255,.3); }
.td-body { flex: 1; overflow-y: auto; background: rgba(248,250,252,.5); padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.td-k { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; margin: 0 0 4px; display: flex; align-items: center; gap: 4px; }
.td-k .ic, .td-k svg { width: 12px; height: 12px; color: var(--brand); }
.td-gia { border: 1px solid #fee2e2; background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.td-gia .v { font-size: 24px; font-weight: 800; color: #dc2626; letter-spacing: -.02em; }
.td-gia .goc { margin-top: 2px; font-size: 11px; color: #94a3b8; }
.td-chk { margin-top: 12px; display: flex; gap: 8px; font-size: 12px; color: #475569; cursor: pointer; align-items: center; }
.td-chk input { width: 16px; height: 16px; accent-color: var(--brand); }
.td-hm { margin-top: 12px; border-radius: 8px; background: rgba(232,245,233,.6); padding: 10px; font-size: 12px; color: #475569; }
.td-hm b { color: var(--brand); } .td-hm span { color: #94a3b8; } .td-hm.warn { color: #b45309; font-weight: 600; }
.td-box { min-height: 60px; white-space: pre-wrap; border: 1px solid #e2e8f0; background: #fff; border-radius: 12px; padding: 12px; font-size: 12px; line-height: 1.6;
  color: #334155; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.td-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.td-i { border: 1px solid #e2e8f0; background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.td-i .k { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; margin-bottom: 2px; }
.td-i .v { font-size: 12px; font-weight: 700; color: #1e293b; }
.td-foot { flex-shrink: 0; border-top: 1px solid #f1f5f9; background: #fff; padding: 14px; }
.td-foot button { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; background: var(--brand);
  padding: 10px; font-size: 12px; font-weight: 700; color: #fff; cursor: pointer; box-shadow: 0 4px 6px -1px rgba(0,0,0,.1); transition: background .15s; }
.td-foot button:hover { background: var(--brand-d); }
.td-foot .ic, .td-foot svg { width: 16px; height: 16px; }
.td-gh { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f5f9; background: #fff; padding: 12px 16px; }
.td-gh > span:first-child { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .03em; color: #1e293b; }
.td-gh .ic, .td-gh svg { width: 16px; height: 16px; color: #059669; }
.td-gh .n { border-radius: 999px; background: #ecfdf5; padding: 2px 10px; font-size: 10px; font-weight: 700; color: #047857; }
.td-main { position: relative; flex: 1; min-height: 240px; background: #0f172a; display: flex; align-items: center; justify-content: center; padding: 12px; cursor: zoom-in; overflow: hidden; }
.td-main img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; transition: transform .3s; }
@media (max-width: 1023px) { .td-main img { max-height: 60vh; } }
.td-main:hover img { transform: scale(1.05); }
.td-main .nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: all .15s; font-size: 18px; line-height: 1; }
.td-main:hover .nav { opacity: 1; } .td-main .nav:hover { background: #059669; }
.td-main .nav.l { left: 12px; } .td-main .nav.r { right: 12px; }
.td-main .zoom { position: absolute; bottom: 12px; right: 12px; z-index: 2; border-radius: 999px; background: rgba(2,6,23,.8); padding: 6px 12px; font-size: 10px; font-weight: 700;
  color: #fff; opacity: 0; transition: opacity .3s; }
.td-main:hover .zoom { opacity: 1; }
.td-main .wait { color: #94a3b8; font-size: 12px; }
.td-thumbs { flex-shrink: 0; height: 96px; display: flex; gap: 8px; overflow-x: auto; border-top: 1px solid #f1f5f9; background: #f8fafc; padding: 10px; }
.td-thumbs > * { height: 100%; width: 96px; flex-shrink: 0; border-radius: 12px; border: 2px solid transparent; opacity: .6; cursor: pointer; transition: all .15s; object-fit: cover; background: #e2e8f0; }
.td-thumbs > *:hover, .td-thumbs > .on { border-color: #10b981; opacity: 1; }
.td-lbx { position: fixed; inset: 0; z-index: 200; background: rgba(2,6,23,.92); display: flex; align-items: center; justify-content: center; }
.td-lbx img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; }
.td-lbx button { position: absolute; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; border-radius: 50%; width: 44px; height: 44px;
  font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.td-lbx button:hover { background: #059669; }
.td-lbx .x { top: 16px; right: 16px; } .td-lbx .l { left: 16px; top: 50%; transform: translateY(-50%); } .td-lbx .r { right: 16px; top: 50%; transform: translateY(-50%); }
.td-lbx .c { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #cbd5e1; font-size: 12px; font-weight: 700; }
