/* Thu Trọ — theo thiết kế vàng trên canvas: vàng nắng + xanh than, Baloo 2 + Be Vietnam Pro */
:root {
  --sun: #FFC93C; --sun-soft: #FFF4D1; --navy: #1D2B4F; --navy-2: #33426A; --ink: #1D2B4F; --muted: #4A5573;
  --line: #E6E9F0; --soft: #F2F4F8; --bg: #F7F8FB; --white: #FFFFFF;
  --green: #14532D; --green-bg: #E5F3EB; --red: #7A1C17; --red-bg: #FDE2E1; --blue: #1D3A8A; --blue-bg: #E8EEFB;
  --r: 20px; --shadow: 0 3px 0 var(--navy);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Be Vietnam Pro', system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--ink); }
h1, h2, h3, .display { font-family: 'Baloo 2', sans-serif; font-weight: 800; line-height: 1.1; margin: 0; }
h1 { font-size: 32px; } h2 { font-size: 22px; } h3 { font-size: 18px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- khung app ---------- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 0 0 236px; background: var(--navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; color: #fff; text-decoration: none; }
.logo { width: 36px; height: 36px; border-radius: 12px; background: var(--sun); display: inline-flex; align-items: center; justify-content: center; transform: rotate(-6deg); flex: none; }
.side .brand span { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 20px; }
.side nav a { display: block; padding: 11px 14px; border-radius: 14px; color: #C8D0E4; text-decoration: none; font-weight: 600; }
.side nav a:hover { background: var(--navy-2); color: #fff; }
.side nav a.on { background: var(--sun); color: var(--navy); }
.side .who { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--navy-2); font-size: 13px; color: #C8D0E4; }
.side .who button { background: none; border: 0; color: #fff; font: inherit; font-weight: 700; padding: 6px 0; cursor: pointer; }
main.page { flex: 1 1 640px; min-width: 0; padding: 24px 32px; display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.head .sub { font-size: 14px; color: var(--muted); }
/* menu đáy cho điện thoại */
.bnav { display: none; }
@media (max-width: 760px) {
  body { font-size: 15px; }
  input, select, textarea { font-size: 16px; } /* tránh iOS tự phóng to */
  .side { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 6px; position: sticky; top: 0; z-index: 50; }
  .side .brand { padding: 0; }
  .side nav { display: none; }
  .side .who { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side .who .name { display: none; }
  .menu-open .side nav { display: flex; flex-direction: column; flex: 1 1 100%; order: 3; max-height: calc(100vh - 140px); overflow-y: auto; padding-bottom: 8px; }
  .menu-open .side nav .grp { display: block; }
  main.page { padding: 16px 14px 96px; }
  h1 { font-size: 26px; }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--white); border-top: 2px solid var(--navy);
          padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bnav a, .bnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; font-size: 11px; font-weight: 700;
          color: var(--muted); text-decoration: none; background: none; border: 0; padding: 4px 0; border-radius: 14px; cursor: pointer; }
  .bnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .bnav .on { color: var(--navy); background: var(--sun); }
  .head .row .btn { padding: 10px 14px; }
  .table-wrap table { font-size: 13px; }
}

/* ---------- thành phần ---------- */
.card { background: var(--white); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.card.pop { border: 2px solid var(--navy); box-shadow: 0 4px 0 var(--navy); }
.card.sun { background: var(--sun-soft); }
.card.dark { background: var(--navy); color: #fff; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .main { flex: 2 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split > .aside { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; }

.stat { padding: 18px; border-radius: 22px; background: var(--white); display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: 'Baloo 2', sans-serif; font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 13px; font-weight: 600; opacity: .85; }
.stat.sun { background: var(--sun); } .stat.dark { background: var(--navy); color: #fff; } .stat.red { background: var(--red-bg); color: var(--red); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 999px; border: 0; font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; background: var(--soft); color: var(--ink); white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn.sun { background: var(--sun); font-weight: 800; box-shadow: var(--shadow); }
.btn.dark { background: var(--navy); color: #fff; }
.btn.line { background: var(--white); border: 2px solid var(--navy); padding: 9px 16px; }
.btn.red { background: var(--red-bg); color: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.icon { width: 38px; height: 38px; padding: 0; font-size: 18px; }
.pill { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--white); font-weight: 700; font-size: 14px; text-decoration: none; }
.pill.on { background: var(--navy); color: #fff; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.b-green { background: var(--green-bg); color: var(--green); } .b-red { background: var(--red-bg); color: var(--red); }
.b-blue { background: var(--blue-bg); color: var(--blue); } .b-sun { background: var(--sun); color: var(--navy); } .b-gray { background: var(--soft); color: var(--muted); }

/* ---------- form: một mẫu cho mọi ô nhập (không dùng giao diện mặc định của trình duyệt) ---------- */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
input, select, textarea {
  font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); line-height: 1.3;
  width: 100%; min-width: 0; min-height: 46px; padding: 11px 14px;
  background: var(--soft); border: 1.5px solid transparent; border-radius: 14px;
  -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
textarea { min-height: 88px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #8C97B5; font-weight: 400; }
input:hover, select:hover, textarea:hover { border-color: #D3D9E6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); background-color: var(--white); box-shadow: 0 0 0 4px rgba(255, 201, 60, .55); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { color: var(--muted); cursor: default; }
input:disabled, select:disabled { opacity: .7; }
input:user-invalid, select:user-invalid { border-color: #E5484D; }
/* ô chọn: mũi tên riêng */
select {
  padding-right: 42px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231D2B4F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
}
select::-ms-expand { display: none; }
/* ngày tháng */
input[type=date] { min-height: 46px; display: block; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .75; filter: invert(13%) sepia(30%) saturate(1500%) hue-rotate(195deg); }
/* ô tích + nút chọn */
input[type=checkbox], input[type=radio] {
  flex: none; width: 22px; height: 22px; min-height: 0; padding: 0; margin: 0; cursor: pointer;
  background: var(--white); border: 2px solid var(--navy); box-shadow: none;
}
input[type=checkbox] { border-radius: 7px; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:checked {
  background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFC93C' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat;
}
input[type=radio]:checked { background: var(--white); box-shadow: inset 0 0 0 5px var(--navy); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { box-shadow: 0 0 0 4px rgba(255, 201, 60, .55); }
input[type=radio]:checked:focus-visible { box-shadow: inset 0 0 0 5px var(--navy), 0 0 0 4px rgba(255, 201, 60, .55); }
/* chọn file: ô thả ảnh nét đứt + nút cùng kiểu */
input[type=file] { padding: 10px; background: var(--white); border: 1.5px dashed #B9C1D3; cursor: pointer; font-size: 14px; color: var(--muted); }
input[type=file]:hover { border-color: var(--navy); }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 700; font-size: 13px; color: var(--white); background: var(--navy);
  border: 0; border-radius: 999px; padding: 8px 14px; margin-right: 12px; cursor: pointer;
}
/* trên nền vàng thì ô nhập nền trắng, còn lại giống nhau */
.card.sun input:not([type=checkbox]):not([type=radio]):not([type=file]), .card.sun select, .card.sun textarea { background-color: var(--white); }

/* bảng giá dịch vụ: mỗi dịch vụ một khối, ô đủ rộng */
.svc { display: flex; flex-direction: column; gap: 10px; }
.svc-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, .8fr); gap: 10px;
  padding: 14px; border: 1.5px solid var(--line); border-radius: 18px; align-items: end; }
.svc-row label.f { font-size: 12px; color: var(--muted); gap: 4px; }
.svc-row .svc-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.svc-row .svc-foot .row { margin-left: auto; }
@media (max-width: 640px) { .svc-row { grid-template-columns: 1fr 1fr; } .svc-row > label.f:nth-of-type(-n+2) { grid-column: 1 / -1; } }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.35; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.choice { display: flex; gap: 10px; padding: 14px; border-radius: 18px; border: 2px solid var(--line); background: var(--white); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--navy); background: var(--sun-soft); box-shadow: var(--shadow); }
.choice small { display: block; color: var(--muted); font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
details > summary { cursor: pointer; font-weight: 700; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* ---------- bảng ---------- */
.table-wrap { background: var(--white); border-radius: 24px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 16px; background: var(--soft); font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid #EEF0F5; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.room, .room-name { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 18px; }
tr.todo td { background: #FFFBEB; } tr.saved td { background: var(--green-bg); transition: background 1.5s; }
tr.late td { background: #FFF8F7; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #DDE2EC; font-size: 14px; }
.kv:last-child { border-bottom: 0; } .kv span:first-child { color: var(--muted); }

/* ---------- sơ đồ phòng ---------- */
.rooms { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.rm { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 18px; text-decoration: none; border: 2px solid transparent; background: var(--soft); }
.rm b { font-family: 'Baloo 2', sans-serif; font-size: 20px; font-weight: 800; line-height: 1; }
.rm small { font-size: 12px; opacity: .85; }
.rm.VACANT { background: var(--sun); border-color: var(--navy); }
.rm.debt { background: var(--red-bg); color: var(--red); }
.rm.MAINTENANCE, .rm.RESERVED { background: var(--blue-bg); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 5px; }

.bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding: 10px 6px 0; border-bottom: 2px solid var(--navy); }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; max-width: 60px; margin: 0 auto; }
.bars .b i { display: block; } .bars .b i.svc { background: var(--sun); border-radius: 10px 10px 0 0; } .bars .b i.rent { background: var(--navy); }
.bars-x { display: flex; gap: 14px; padding: 0 6px; } .bars-x span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.progress { flex: 1 1 200px; height: 12px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--sun); border-radius: 999px; }

.flash { padding: 12px 16px; border-radius: 16px; font-weight: 600; font-size: 14px; }
.flash.ok { background: var(--green-bg); color: var(--green); }
.flash.err { background: var(--red-bg); color: var(--red); }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.squiggle { position: relative; display: inline-block; }
.squiggle svg { position: absolute; left: 0; bottom: -6px; width: 100%; height: 14px; }

/* ---------- trang công khai ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth .art { flex: 1 1 380px; background: var(--sun); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.auth .art h1 { font-size: 48px; max-width: 460px; }
.auth .form { flex: 1 1 420px; padding: 40px 24px; display: flex; align-items: center; justify-content: center; background: #fff; }
.auth form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.tag { display: inline-block; padding: 8px 14px; border-radius: 14px; background: #fff; font-family: 'Baloo 2', sans-serif; font-weight: 800; box-shadow: var(--shadow); }
.bill { max-width: 440px; margin: 0 auto; padding: 18px 16px 32px; display: flex; flex-direction: column; gap: 14px; }
.bill-bg { background: var(--sun); min-height: 100vh; }
.qr { width: 180px; height: auto; border-radius: 12px; background: #fff; }

/* ---------- in ---------- */
.print-page { max-width: 800px; margin: 0 auto; padding: 32px; background: #fff; color: #000; font-size: 14px; }
.print-page h1 { font-size: 26px; text-align: center; }
.print-page table td, .print-page table th { border: 1px solid #999; background: #fff; color: #000; }
.no-print { margin: 16px auto; max-width: 800px; display: flex; gap: 8px; }
@media print {
  body { background: #fff; }
  .no-print, .side { display: none !important; }
  .print-page { padding: 0; }
}

[x-cloak] { display: none !important; }

/* ---------- menu app: nhóm ---------- */
.side nav .grp { display: block; padding: 14px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8C97B5; }


/* ---------- sàn công khai ---------- */
body.site { background: #FFFBF0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.top { background: #fff; border-bottom: 2px solid var(--navy); position: sticky; top: 0; z-index: 1000; }
.top-in { display: flex; align-items: center; gap: 14px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand-pub { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand-pub span { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 22px; }
.top-nav { display: flex; gap: 4px; flex: 1 1 auto; overflow-x: auto; }
.top-nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.top-nav a:hover { background: var(--sun-soft); }
.top-act { display: flex; gap: 8px; margin-left: auto; }
.pill.line { border: 2px solid var(--navy); background: #fff; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px; }
.region { position: relative; }
.region .menu { max-height: 70vh; overflow-y: auto; position: absolute; top: calc(100% + 6px); left: 0; background: #fff; border: 2px solid var(--navy); border-radius: 18px; box-shadow: 0 4px 0 var(--navy); padding: 6px; min-width: 220px; z-index: 1100; display: flex; flex-direction: column; }
.region .menu a { padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.region .menu a:hover, .region .menu a.on { background: var(--sun-soft); }
.region .menu small { color: var(--muted); font-weight: 500; }
@media (max-width: 760px) {
  .top-nav { order: 3; flex-basis: 100%; }
  .brand-pub span { font-size: 18px; }
}
main.pub { display: flex; flex-direction: column; gap: 22px; padding-top: 22px; padding-bottom: 48px; min-height: 60vh; }
.foot { background: var(--navy); padding: 32px 0; margin-top: 24px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }

.hero { background: var(--sun); border-radius: 32px; padding: 32px 28px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.hero h1 { font-size: 44px; max-width: 760px; }
@media (max-width: 760px) { .hero { padding: 22px 18px; border-radius: 24px; } .hero h1 { font-size: 30px; } }
.intent { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.intent a { background: #fff; border: 2px solid var(--navy); border-radius: 20px; padding: 14px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 3px 0 var(--navy); transition: transform .1s; }
.intent a:hover { transform: translateY(-2px); }
.intent a b { font-family: 'Baloo 2', sans-serif; font-size: 20px; font-weight: 800; }
.intent a small { color: var(--muted); }
.intent a i { font-style: normal; font-size: 22px; }
.searchbar { display: flex; gap: 8px; flex-wrap: wrap; background: #fff; padding: 8px; border-radius: 22px; border: 2px solid var(--navy); }
.searchbar input, .searchbar select { flex: 1 1 160px; background-color: var(--soft); }
.searchbar .btn { flex: 0 0 auto; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; color: var(--ink); }
.chip.on, .chip:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip input { display: none; }
.chip small { opacity: .7; }

.lgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.lc { background: #fff; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; border: 1.5px solid var(--line); }
.lc:hover { border-color: var(--navy); }
.lc-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--sun-soft); }
.lc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-img .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 20px; color: var(--navy); opacity: .45; }
.lc-tag { position: absolute; left: 10px; top: 10px; }
.lc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lc-price { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 22px; color: #B42318; line-height: 1.1; }
.lc-title { font-weight: 700; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-meta { display: flex; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lc-foot { margin-top: auto; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.cmp { width: 34px; height: 34px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; font-weight: 800; color: var(--navy); flex: none; }
.cmp.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.lrow { display: flex; gap: 14px; background: #fff; border-radius: 22px; padding: 12px; border: 1.5px solid var(--line); }
.lrow .lc-img { flex: 0 0 240px; border-radius: 16px; overflow: hidden; aspect-ratio: auto; min-height: 170px; }
.lrow .lc-body { padding: 4px 4px 4px 0; }
@media (max-width: 640px) { .lrow { flex-direction: column; } .lrow .lc-img { flex-basis: auto; aspect-ratio: 4/3; } }

.filters { background: #fff; border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 1.5px solid var(--line); }
.filters .form-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.map { height: 460px; border-radius: 24px; overflow: hidden; border: 2px solid var(--navy); z-index: 1; background: var(--soft); }
.map.tall { height: 70vh; min-height: 420px; }
.map.small { height: 300px; }
.pin span { display: inline-block; transform: translate(-50%, -100%); background: var(--navy); color: #fff; font-weight: 800; font-size: 12px; padding: 4px 9px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 0 var(--sun); }
.pin.me span { background: var(--sun); color: var(--navy); box-shadow: 0 2px 0 var(--navy); }
.mpop { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); width: 200px; }
.mpop img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; }
.mpop strong { color: #B42318; font-size: 15px; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.gallery { display: grid; gap: 8px; grid-template-columns: 2fr 1fr; border-radius: 24px; overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.gallery .main-img { grid-row: span 2; aspect-ratio: 4 / 3; }
.gallery .thumbs { display: grid; gap: 8px; grid-template-rows: 1fr 1fr; }
.gallery .more { position: relative; }
.gallery .more span { position: absolute; inset: 0; background: rgba(29,43,79,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; pointer-events: none; }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr; } .gallery .thumbs { display: none; } }
.lightbox { position: fixed; inset: 0; background: rgba(10,16,30,.92); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 12px; }
.lightbox button { position: absolute; background: #fff; border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 20px; cursor: pointer; }
.specs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.specs div { background: var(--soft); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; }
.specs span { font-size: 12px; color: var(--muted); font-weight: 600; }
.specs b { font-size: 16px; }
.contact { position: sticky; top: 84px; }
.desc { white-space: pre-line; }
.notice { background: var(--sun-soft); border-radius: 18px; padding: 12px 14px; font-size: 13px; }

.cmp-table th { position: sticky; left: 0; background: var(--soft); z-index: 1; min-width: 130px; }
.cmp-table td { min-width: 200px; vertical-align: top; }
.cmp-table img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; }
.best { background: var(--green-bg); color: var(--green); border-radius: 8px; padding: 1px 6px; font-size: 12px; font-weight: 700; }

.tray { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 1500; background: #fff; border: 2px solid var(--navy); box-shadow: 0 4px 0 var(--navy); border-radius: 22px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: calc(100% - 24px); }
.tray .chip { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.imgs { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.imgs figure { margin: 0; position: relative; }
.imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; display: block; }
.imgs button { position: absolute; top: 6px; right: 6px; }
.lthumb { width: 84px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--sun-soft); display: block; }
.card.prose { display: block; max-width: 820px; width: 100%; margin: 0 auto; padding: 28px 32px; line-height: 1.65; }
.prose h1 { margin: 0 0 14px; } .prose h2 { font-size: 21px; margin: 26px 0 8px; } .prose p { margin: 0 0 10px; }
.prose ul { margin: 0; padding-left: 22px; } .prose li { margin: 6px 0; }
@media (max-width: 640px) { .card.prose { padding: 20px 18px; } }

/* ---------- chốt điện nước trên điện thoại ---------- */
.mrow { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr) minmax(0,1.2fr) minmax(0,.8fr) minmax(0,1fr) 150px; gap: 10px; align-items: center; padding: 8px 16px; }
.mhead { padding: 12px 16px; }
.cam { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: var(--soft); cursor: pointer; font-size: 18px; flex: none; }
.cam.has { background: var(--green-bg); }
.cam input { display: none; }
.mphoto { width: 38px; height: 38px; object-fit: cover; border-radius: 10px; display: block; }
@media (max-width: 640px) {
  .mhead { display: none !important; }
  .mrow { grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px 14px; }
  .mrow > .mroom { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; }
  .mrow > .mroom br { display: none; }
  .mrow input[name=current] { font-size: 20px; padding: 14px 12px; }
  .mrow > .mact { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
}

/* ---------- trang giới thiệu, cổng khách ---------- */
.landing { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 28px; }
.feat { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .feat { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feat div { background: #fff; border-radius: 22px; padding: 18px; border: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.feat b { font-family: 'Baloo 2', sans-serif; font-size: 20px; }
.feat i { font-style: normal; font-size: 26px; }
.portal { max-width: 560px; margin: 0 auto; padding: 16px 14px 40px; display: flex; flex-direction: column; gap: 14px; }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; text-align: center; font-size: 12px; font-weight: 700; padding: 6px; border-radius: 10px; background: var(--soft); color: var(--muted); }
.steps span.on { background: var(--navy); color: #fff; }
.task { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--soft); text-decoration: none; }
.task b { font-family: 'Baloo 2', sans-serif; font-size: 24px; min-width: 34px; text-align: center; }
.task.hot { background: var(--red-bg); color: var(--red); }
.task.warn { background: var(--sun-soft); }
.task small { display: block; color: var(--muted); }
.mlabel { display: none; }
@media (max-width: 640px) { .mlabel { display: block; font-size: 11px; } }

@media (max-width: 640px) {
  .grid:has(> .stat) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; border-radius: 18px; }
  .stat b { font-size: 21px; }
  .feat { grid-template-columns: 1fr 1fr; gap: 10px; }
  .feat div { padding: 14px; }
  .feat b { font-size: 16px; line-height: 1.2; }
  .feat span { font-size: 13px; }
  .landing .hero h1 { font-size: 28px; }
}

/* nút mời chủ trọ ở đầu trang: nổi bật, nói rõ dùng để làm gì */
.top-act { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.link-login { font-weight: 700; font-size: 14px; text-decoration: none; padding: 8px 6px; }
.link-login:hover { text-decoration: underline; }
.cta-manage { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--navy); color: #fff;
  text-decoration: none; box-shadow: 0 3px 0 var(--sun); transition: transform .1s; }
.cta-manage:hover { transform: translateY(-1px); }
.cta-manage .logo { width: 34px; height: 34px; border-radius: 50%; transform: none; }
.cta-manage span { display: flex; flex-direction: column; line-height: 1.15; }
.cta-manage b { font-size: 14px; }
.cta-manage small { font-size: 11px; color: #C8D0E4; font-weight: 500; }
@media (max-width: 640px) {
  .cta-manage small { display: none; }
  .cta-manage { padding-right: 12px; }
  .top-act .btn.line { display: none; }
}
.mact { justify-content: flex-end; }
.hero-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.hero-split .mock { display: flex; flex-direction: column; }
@media (max-width: 900px) { .hero-split { grid-template-columns: 1fr; } .hero-split .mock { display: none; } }

/* biểu tượng nét vẽ */
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.intent a i { width: 42px; height: 42px; border-radius: 12px; background: var(--sun); display: inline-flex; align-items: center; justify-content: center; transform: rotate(-4deg); }
.intent a i .ico { width: 24px; height: 24px; }
.cam .ico { width: 20px; height: 20px; }

/* trang giới thiệu: trước kia / bây giờ */
.ba { background: #fff; border-radius: 28px; padding: 8px 24px 16px; border: 2px solid var(--navy); box-shadow: 0 4px 0 var(--navy); }
.ba-head, .ba-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; align-items: baseline; }
.ba-head { padding: 18px 0 12px; border-bottom: 2px solid var(--navy); }
.ba-head h2 { font-size: 24px; }
.ba-col { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.ba-row { padding: 16px 0; border-bottom: 1px dashed #D5DAE5; }
.ba-row:last-child { border-bottom: 0; }
.ba-row b { font-family: 'Baloo 2', sans-serif; font-size: 19px; }
.ba-row .was { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(229, 72, 77, .55); text-decoration-thickness: 2px; }
.ba-row .now { font-weight: 600; color: var(--navy); }
@media (max-width: 760px) {
  .ba { padding: 6px 16px 12px; }
  .ba-head { grid-template-columns: 1fr; } .ba-head .ba-col { display: none; }
  .ba-row { grid-template-columns: 1fr; gap: 4px; }
  .ba-row .was::before { content: "Trước: "; text-decoration: none; display: inline; }
}

.onboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 28px; align-items: start; padding: 28px; }
@media (max-width: 900px) { .onboard { grid-template-columns: 1fr; padding: 20px; } }
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps-list li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--soft); }
.steps-list li.on { background: var(--sun-soft); border: 2px solid var(--navy); }
.steps-list li b { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--white); border: 2px solid var(--navy); display: flex; align-items: center; justify-content: center; font-family: 'Baloo 2', sans-serif; font-size: 18px; }
.steps-list li.on b { background: var(--navy); color: var(--sun); }
.steps-list li span { flex: 1; display: flex; flex-direction: column; }
.steps-list li small { color: var(--muted); }
@media (max-width: 640px) { .steps-list li { flex-wrap: wrap; } .steps-list li .btn { margin-left: 50px; } }

/* ---------- ô chọn tự vẽ (máy tính) ---------- */
.xsel { position: relative; width: 100%; min-width: 0; }
.xsel-native { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; }
.xsel-btn {
  width: 100%; min-height: 46px; display: flex; align-items: center; text-align: left; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--ink);
  padding: 11px 42px 11px 14px; background: var(--soft); border: 1.5px solid transparent; border-radius: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231D2B4F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.xsel-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xsel-btn.placeholder { color: #8C97B5; }
.xsel-btn:hover { border-color: #D3D9E6; }
.xsel-btn:focus-visible, .xsel.open .xsel-btn { outline: none; border-color: var(--navy); background-color: var(--white); box-shadow: 0 0 0 4px rgba(255, 201, 60, .55); }
.xsel.open .xsel-btn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231D2B4F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15l6-6 6 6'/%3E%3C/svg%3E"); }
.xsel-btn:disabled { opacity: .6; cursor: default; }
.card.sun .xsel-btn { background-color: var(--white); }
.xsel-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 2000; margin: 0; padding: 6px; list-style: none;
  min-width: 200px; max-height: 300px; overflow-y: auto; background: var(--white);
  border: 2px solid var(--navy); border-radius: 16px; box-shadow: 0 4px 0 var(--navy), 0 14px 30px rgba(29, 43, 79, .16);
}
.xsel.up .xsel-list { top: auto; bottom: calc(100% + 6px); }
.xsel-list li { padding: 10px 12px 10px 34px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; position: relative; line-height: 1.3; }
.xsel-list li.active { background: var(--sun-soft); }
.xsel-list li.sel { font-weight: 800; }
.xsel-list li.sel::before {
  content: ""; position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231D2B4F' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.xsel-list li.off { opacity: .45; cursor: default; }

/* khu quản trị: tách riêng, màu khác để không nhầm với app chủ trọ */
.admin-side { background: #11182B; }
.admin-side .brand span { display: flex; flex-direction: column; line-height: 1; }
.admin-side .brand small { font-family: 'Be Vietnam Pro', sans-serif; font-size: 12px; font-weight: 600; color: #8C97B5; margin-top: 4px; }
.admin-side nav a.on { background: #fff; color: #11182B; }
.admin-body { background: #EEF0F5; }
.side nav a.to-admin { margin-top: 14px; border: 1.5px dashed #4A5573; color: #C8D0E4; font-size: 14px; }
.side .ver { font-size: 10px; color: #6B7591; margin-top: 4px; }
.as-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 16px; background: #11182B; color: #fff; font-size: 14px; }
.admin-side nav a { padding: 9px 14px; }

/* trang pháp lý (điều khoản, quyền riêng tư, xoá tài khoản) */
.legal-nav { max-width: 820px; width: 100%; margin: 0 auto; }
.legal-nav .chip { text-decoration: none; }
.legal-nav .chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.prose .updated { color: var(--muted); font-size: 14px; margin-top: -6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 15px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--soft); font-weight: 600; }
.prose .tbl { overflow-x: auto; }
.legal-contact { display: flex; flex-direction: column; gap: 4px; background: var(--sun-soft); border-radius: 16px; padding: 14px 16px; margin: 6px 0 4px; }
.prose .note { background: var(--soft); border-radius: 14px; padding: 12px 14px; }
@media (max-width: 640px) {
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose tr:first-child { display: none; } /* hàng tiêu đề */
  .prose tr { border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; margin-bottom: 10px; }
  .prose td { border: 0; padding: 3px 0; }
  .prose td:first-child { font-weight: 700; color: var(--navy); }
}
/* Thông báo */
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--sun); color: var(--navy); font-size: 11px; font-weight: 800; margin-left: 6px; }
.bnav button { position: relative; }
.bnav .dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 9px; height: 9px; border-radius: 50%; background: #E5484D; border: 2px solid #fff; }
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.notif { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 12px 14px; border-bottom: 1px solid var(--line, #E6E9F0); position: relative; }
.notif:last-child { border-bottom: 0; }
.notif .nk { font-size: 12px; color: var(--muted); font-weight: 600; }
.notif.unread::before { content: ""; position: absolute; left: 0; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--sun-deep, #E0A800); }
.notif a { color: inherit; }
