/* Giao diện các trang người dùng */
.user-page { padding-top: 20px; padding-bottom: 40px; }
.user-page h1 { font-size: 1.5rem; margin: 0 0 12px; }
.user-page h2 { font-size: 1.1rem; margin: 0 0 12px; }
.user-page .card { padding: 16px; margin-bottom: 16px; }
.center { text-align: center; }
.pad { padding: 16px; }
.neg { color: #dc2626; }
.pos { color: #16a34a; }
.num { text-align: right; white-space: nowrap; }
.btn-block { display: block; width: 100%; }
.notice { background: #fef3c7; color: #92400e; padding: 10px 14px; border-radius: 8px; margin: 0 0 14px; }
.form-error { background: #fee2e2; color: #b91c1c; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: .95rem; }
.form-error[hidden] { display: none; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: #e5e7eb; color: #374151; }
.badge-vip { background: #fce7f3; color: #be185d; }

/* thanh điều hướng */
.user-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.user-nav .tabs { overflow-x: auto; overflow-y: hidden; flex: 1 1 auto; min-width: 0; white-space: nowrap; scrollbar-width: none; }
.user-nav .tabs::-webkit-scrollbar { display: none; }
.user-nav .tab { text-decoration: none; display: inline-block; }

.empty-state { text-align: center; padding: 40px 16px !important; }
.empty-icon { font-size: 2.5rem; margin-bottom: 8px; }
.empty-state p { margin: 0 0 14px; color: #6b7280; }

/* đăng nhập */
.auth-wrap { display: flex; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 24px; }
.auth-card h1 { margin: 0 0 4px; font-size: 1.5rem; }
.auth-switch { text-align: center; margin: 14px 0 0; }

/* form đăng tin */
.post-form .form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.post-form .form-grid.two { grid-template-columns: repeat(2, 1fr); }
.amenity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.amenity-group + .amenity-group { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e5e7eb; }
.amenity-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: normal; }
.check input { width: auto; margin: 0; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 8px; }
.img-item, .img-add { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #f3f4f6; }
.img-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-main { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: .7rem; padding: 2px 6px; border-radius: 4px; }
.img-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.img-del:hover { background: #dc2626; }
.img-add { border: 2px dashed #cbd5e1; color: #64748b; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .85rem; background: transparent; }
.img-add span { font-size: 1.8rem; line-height: 1; }
.img-add:hover { border-color: #2563eb; color: #2563eb; }
.img-loading { display: flex; align-items: center; justify-content: center; }
.spinner { width: 24px; height: 24px; border: 3px solid #cbd5e1; border-top-color: #2563eb; border-radius: 50%; animation: u-spin .8s linear infinite; }
@keyframes u-spin { to { transform: rotate(360deg); } }
.pick-map { height: 340px; border-radius: 8px; z-index: 0; border: 1px solid #e5e7eb; }
.map-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; font-size: .9rem; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.field-msg { font-size: .85rem; margin-top: 4px; color: #b91c1c; min-height: 0; }
.field-msg[hidden] { display: none; }
.field input.invalid { border-color: #dc2626 !important; }
.field input.valid { border-color: #16a34a !important; }

/* tin của tôi */
.balance-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.my-item { display: flex; gap: 14px; }
.my-thumb { flex: 0 0 140px; height: 105px; border-radius: 8px; overflow: hidden; background: #f3f4f6; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.my-thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-body { flex: 1; min-width: 0; }
.my-title { font-weight: 600; margin-bottom: 4px; overflow-wrap: anywhere; }
.my-title a { color: inherit; text-decoration: none; }
.my-title a:hover { text-decoration: underline; }
.my-meta { font-size: .92rem; margin-bottom: 6px; }
.my-meta .price { color: #dc2626; }
.my-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.reject-reason { background: #fee2e2; color: #b91c1c; padding: 6px 10px; border-radius: 6px; font-size: .9rem; margin-bottom: 6px; }
.my-stats { font-size: .85rem; margin-bottom: 8px; }
.my-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* modal VIP */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1000; }
.modal { width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; background: #fff; margin: 0 !important; }
.modal h2 { margin-bottom: 4px; }
.vip-options { display: grid; gap: 8px; margin: 12px 0; }
.vip-opt { display: flex; align-items: center; gap: 10px; border: 1px solid #d1d5db; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.vip-opt:has(input:checked) { border-color: #2563eb; background: #eff6ff; }
.vip-opt input { width: auto; margin: 0; }
.vip-opt span { display: flex; justify-content: space-between; flex: 1; gap: 8px; }
.vip-opt small { color: #6b7280; }
.vip-total { background: #f9fafb; padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.vip-total .total { font-size: 1.2rem; color: #dc2626; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* tin nhắn */
.msg.unread { border-left: 4px solid #f59e0b; }
.msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-time { margin-left: auto; font-size: .85rem; }
.msg-phone { margin: 4px 0; }
.msg-phone a { font-weight: 600; text-decoration: none; }
.msg-content { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-listing { font-size: .9rem; }

/* ví */
.wallet-top { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.wallet-balance .big { font-size: 1.8rem; font-weight: 700; color: #16a34a; margin-top: 4px; }
.topup-steps { padding-left: 20px; color: #4b5563; font-size: .92rem; }
.bank-info { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; background: #f9fafb; padding: 12px; border-radius: 8px; margin: 12px 0; }
.bank-info dt { color: #6b7280; }
.bank-info dd { margin: 0; overflow-wrap: anywhere; }
.bank-info .code { color: #dc2626; }
.topup-form .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }

/* hồ sơ */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.logout-row { text-align: right; }

@media (max-width: 760px) {
  .post-form .form-grid, .post-form .form-grid.two { grid-template-columns: 1fr; }
  .wallet-top, .profile-grid { grid-template-columns: 1fr; }
  .user-page .card { padding: 14px; }
  .my-item { gap: 12px; }
  .my-thumb { flex: 0 0 88px; height: 70px; font-size: 1.5rem; }
  .pick-map { height: 280px; }
  .bank-info { grid-template-columns: 100px 1fr; }
}
