/* Golden Field – trang thông tin cư dân */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(16, 33, 63, .97); color: #fff;
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.topbar .logo-text span { color: var(--gold-400); opacity: 1; }
.topnav { display: none; gap: .25rem; margin-left: auto; }
.topnav a {
  display: inline-flex; align-items: center; gap: .45rem;
  color: rgba(255,255,255,.82); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: .5rem .8rem; border-radius: 9px;
}
.topnav a:hover, .topnav a.active { background: rgba(255,255,255,.08); color: #fff; }
.top-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.topnav + .top-actions { margin-left: 0; }
.top-btn {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: 0 .75rem;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px; cursor: pointer; text-decoration: none; font-size: .875rem; font-weight: 600;
}
.top-btn:hover { background: rgba(255,255,255,.14); }
.top-btn .lbl { display: none; }
@media (min-width: 900px) {
  .topnav { display: flex; }
  .top-btn .lbl { display: inline; }
}

/* ---------- Urgent bar ---------- */
.alert-bar { background: var(--red-600); color: #fff; }
.alert-bar a { color: #fff; text-decoration: none; display: flex; align-items: center; gap: .7rem; padding: .7rem 0; font-weight: 500; }
.alert-bar a:hover .alert-title { text-decoration: underline; }
.alert-bar .tag { background: #fff; color: var(--red-600); font-weight: 700; font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; flex-shrink: 0; text-transform: uppercase; letter-spacing: .03em; }
.alert-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-bar .more { flex-shrink: 0; font-size: .875rem; opacity: .9; display: none; }
@media (min-width: 640px) { .alert-bar .more { display: inline-flex; align-items: center; gap: .2rem; } }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex-shrink: 0; box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(220,185,75,.22), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #fff; overflow: hidden;
}
.hero-inner { display: grid; gap: 1.5rem; padding: 2rem 0 5rem; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: .45rem; color: var(--gold-400); font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.hero h1 { color: #fff; font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 700; margin: .5rem 0 .75rem; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--gold-400); }
.hero p { color: rgba(255,255,255,.8); margin: 0; max-width: 560px; font-size: 1.02rem; }
.hero-address { display: inline-flex; align-items: center; gap: .45rem; margin-top: 1rem !important; color: rgba(255,255,255,.9) !important; font-size: .95rem !important; }
.hero-facts { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.fact { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: .55rem .9rem; }
.fact b { display: block; font-size: 1.15rem; color: var(--gold-400); line-height: 1.2; }
.fact span { font-size: .78rem; color: rgba(255,255,255,.75); }
.hero-art { display: none; justify-self: center; width: 100%; max-width: 300px; }
@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.4fr 1fr; padding: 3rem 0 6rem; }
  .hero-art { display: block; }
}

/* ---------- Quick tiles ---------- */
.quick { margin-top: -3.25rem; position: relative; z-index: 2; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 768px) { .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }
.tile {
  display: flex; align-items: center; gap: .8rem; padding: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); text-decoration: none; color: var(--text); cursor: pointer; text-align: left;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--gold-400); }
.tile-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.tile-ico .icon { width: 22px; height: 22px; }
.tile b { display: block; font-size: .95rem; line-height: 1.3; }
.tile small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; margin-top: .1rem; }

/* ---------- Layout ---------- */
.layout { display: grid; gap: 1.5rem; padding-top: 2rem; padding-bottom: 3rem; }
@media (min-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; } }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-title h2 { font-size: 1.3rem; display: flex; align-items: center; gap: .5rem; }
.section-title h2 .icon { color: var(--gold-500); }

/* ---------- Feed toolbar ---------- */
.feed-toolbar { display: flex; flex-direction: column; gap: .85rem; margin-bottom: 1.25rem; }
.chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; flex-shrink: 0;
  min-height: 40px; padding: .4rem .9rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  font-size: .9rem; font-weight: 500; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--navy-700); color: var(--navy-900); }
.chip[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip .count { font-size: .75rem; background: rgba(0,0,0,.07); border-radius: 999px; padding: 0 .45rem; }
.chip[aria-pressed="true"] .count { background: rgba(255,255,255,.18); }

/* ---------- Pinned ---------- */
.pinned-grid { display: grid; gap: 1rem; margin-bottom: 1.75rem; }
@media (min-width: 700px) { .pinned-grid { grid-template-columns: repeat(2, 1fr); } }
.pin-card {
  position: relative; display: flex; flex-direction: column; gap: .55rem;
  padding: 1.15rem 1.2rem; border-radius: var(--radius-lg); text-decoration: none; color: var(--text);
  background: linear-gradient(160deg, var(--gold-50), #fff 70%); border: 1px solid var(--gold-100);
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.pin-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pin-card.urgent { background: linear-gradient(160deg, #fff1f1, #fff 70%); border-color: #f6c9c9; }
.pin-card h3 { font-size: 1.08rem; }
.pin-card p { margin: 0; color: var(--text-2); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pin-card .event-chip { align-self: flex-start; }

/* ---------- Post card ---------- */
.feed { display: flex; flex-direction: column; gap: .85rem; }
.post-card {
  display: flex; gap: 1rem; padding: 1rem; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
  position: relative;
}
.post-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.post-card.unread::before {
  content: ''; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 4px;
  background: var(--gold-500); border-radius: 0 4px 4px 0;
}
.post-thumb {
  width: 72px; height: 72px; border-radius: 14px; flex-shrink: 0; overflow: hidden;
  display: grid; place-items: center;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb .icon { width: 28px; height: 28px; }
@media (min-width: 640px) { .post-thumb { width: 112px; height: 84px; } }
.post-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.post-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.cat-label { font-size: .78rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.post-card h3 { font-size: 1.05rem; font-weight: 650; }
.post-card p { margin: 0; color: var(--text-2); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.post-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.event-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 600; color: var(--navy-800); background: var(--navy-100); padding: .2rem .6rem; border-radius: 8px; }

.load-more { display: flex; justify-content: center; margin-top: 1.25rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.empty .icon { width: 40px; height: 40px; color: var(--border-strong); margin-bottom: .5rem; }
.empty b { display: block; color: var(--text); font-size: 1.05rem; }

/* ---------- Sidebar ---------- */
.side-col { display: flex; flex-direction: column; gap: 1.25rem; }
.side-card { padding: 1.15rem 1.2rem; scroll-margin-top: 90px; }
.side-card h3 { font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.side-card h3 .icon { color: var(--gold-500); }

.events { display: flex; flex-direction: column; gap: .7rem; }
.event { display: flex; gap: .8rem; text-decoration: none; color: var(--text); padding: .35rem; margin: -.35rem; border-radius: 10px; }
.event:hover { background: var(--surface-2); }
.event-date { width: 54px; flex-shrink: 0; text-align: center; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.event-date .m { display: block; background: var(--navy-800); color: #fff; font-size: .68rem; font-weight: 600; padding: .1rem 0; text-transform: uppercase; }
.event-date .d { display: block; font-size: 1.3rem; font-weight: 700; color: var(--navy-900); line-height: 1.5; }
.event-info { min-width: 0; }
.event-info b { display: block; font-size: .92rem; font-weight: 600; line-height: 1.35; }
.event-info small { color: var(--muted); font-size: .8rem; }
.event-soon .event-date .m { background: var(--red-600); }

.hotlines { display: flex; flex-direction: column; gap: .5rem; }
.hotline { display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.hotline:hover { border-color: var(--gold-400); }
.hotline-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--green-50); color: var(--green-600); display: grid; place-items: center; flex-shrink: 0; }
.hotline.emergency .hotline-ico { background: var(--red-50); color: var(--red-600); }
.hotline-info { flex: 1; min-width: 0; }
.hotline-info span { display: block; font-size: .82rem; color: var(--muted); line-height: 1.3; }
.hotline-info b { font-size: 1.02rem; letter-spacing: .01em; }
.contact-extra { margin-top: .9rem; font-size: .88rem; color: var(--text-2); display: flex; flex-direction: column; gap: .35rem; }
.contact-extra span { display: flex; gap: .5rem; align-items: flex-start; }
.contact-extra .icon { color: var(--muted); margin-top: .2rem; }

.docs { display: flex; flex-direction: column; }
.doc { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-top: 1px solid var(--border); text-decoration: none; color: var(--text); }
.doc:first-child { border-top: 0; padding-top: 0; }
.doc-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--blue-50); color: var(--blue-600); display: grid; place-items: center; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-info b { display: block; font-size: .9rem; font-weight: 600; line-height: 1.35; }
.doc-info small { color: var(--muted); font-size: .78rem; }
.doc > .icon { color: var(--muted); }
.doc:hover b { color: var(--navy-700); text-decoration: underline; }

.building-card { overflow: hidden; padding: 0; }
.building-card .bc-art { background: linear-gradient(180deg, var(--navy-900), var(--navy-700)); padding: 1rem 1rem 0; display: flex; justify-content: center; }
.building-card .bc-art img { width: 150px; }
.building-card .bc-body { padding: 1rem 1.2rem 1.2rem; }
.building-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .8rem 0 0; }
.building-card dt { font-size: .75rem; color: var(--muted); }
.building-card dd { margin: 0; font-weight: 700; color: var(--navy-900); }

/* ---------- Article view ---------- */
.article-wrap { max-width: 820px; padding-top: 1.5rem; padding-bottom: 3rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; font-weight: 600; color: var(--navy-700); padding: .4rem .2rem; margin-bottom: .75rem; }
.back-link:hover { text-decoration: underline; }
.article { padding: 0; overflow: hidden; }
.article-cover { aspect-ratio: 16 / 7; background: var(--navy-100); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-inner { padding: 1.5rem 1.25rem 2rem; }
@media (min-width: 700px) { .article-inner { padding: 2rem 2.5rem 2.5rem; } }
.article h1 { font-size: clamp(1.45rem, 3.5vw, 2rem); margin: .7rem 0 .8rem; letter-spacing: -.01em; }
.article-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--muted); font-size: .88rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.article-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.event-box { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border-radius: 14px; background: var(--navy-100); margin-bottom: 1.5rem; }
.event-box .icon { width: 26px; height: 26px; color: var(--navy-700); }
.event-box small { display: block; color: var(--muted); font-size: .8rem; }
.event-box b { color: var(--navy-900); font-size: 1.05rem; }
.event-box.urgent { background: var(--red-50); }
.event-box.urgent .icon { color: var(--red-600); }
.article-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.related { margin-top: 2rem; }
.related h2 { font-size: 1.15rem; margin-bottom: .9rem; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-950); color: rgba(255,255,255,.7); font-size: .88rem; padding: 2rem 0 6rem; }
@media (min-width: 900px) { .footer { padding-bottom: 2rem; } }
.footer-inner { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 768px) { .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; } }
.footer .logo-text strong { color: #fff; }
.footer a { color: var(--gold-400); }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(16,33,63,.06);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem 0 .5rem; font-size: .72rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.bottomnav a .icon { width: 22px; height: 22px; }
.bottomnav a.active { color: var(--navy-800); }
.bottomnav a.active .icon { color: var(--gold-600); }
@media (min-width: 900px) { .bottomnav { display: none; } }

@media print {
  .topbar, .alert-bar, .bottomnav, .footer, .back-link, .article-actions, .related { display: none !important; }
  body { background: #fff; }
  .article { border: 0; box-shadow: none; }
}

/* ---------- Tài khoản cư dân ---------- */
.resident-area { display: flex; align-items: center; gap: .4rem; }
.resident-chip { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: 0 .75rem 0 .35rem; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600; }
.resident-chip:hover { background: rgba(255,255,255,.14); }
.resident-chip .av { width: 30px; height: 30px; border-radius: 50%; background: var(--gold-500); color: var(--navy-950); display: grid; place-items: center; font-weight: 800; }
.resident-chip .apt { color: var(--gold-400); font-weight: 600; }
@media (max-width: 560px) { .resident-chip .nm { display: none; } }
.top-btn.gold { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-950); }
.top-btn.gold:hover { background: var(--gold-400); }

.resident-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: 1rem 1.15rem; margin-bottom: 1.5rem;
  border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--navy-100), #fff 80%); border: 1px solid var(--border); }
.resident-banner .icon { width: 28px; height: 28px; color: var(--navy-700); }
.resident-banner .txt { flex: 1; min-width: 220px; }
.resident-banner .txt b { display: block; color: var(--navy-900); }
.resident-banner .txt span { font-size: .9rem; color: var(--text-2); }
.resident-banner .acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.badge-resident { background: var(--navy-100); color: var(--navy-700); }

.auth-wrap { max-width: 560px; padding-top: 2rem; padding-bottom: 3rem; }
.auth-card { padding: 1.75rem 1.5rem; }
@media (min-width: 640px) { .auth-card { padding: 2rem 2.25rem; } }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .35rem; }
.auth-card > p.lead { color: var(--text-2); margin: 0 0 1.5rem; }
.auth-card .btn-block { margin-top: 1.25rem; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 1.25rem; font-size: .92rem; }
.auth-links a { color: var(--navy-700); font-weight: 600; }
.form-error { color: var(--red-600); font-size: .9rem; margin-top: .75rem; }
.form-ok { background: var(--green-50); color: var(--green-600); border-radius: 10px; padding: .75rem 1rem; font-size: .92rem; margin-bottom: 1rem; }
.steps { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-direction: column; gap: .75rem; counter-reset: step; }
.steps li { display: flex; gap: .75rem; align-items: flex-start; font-size: .95rem; color: var(--text-2); }
.steps li::before { counter-increment: step; content: counter(step); flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-100); color: var(--gold-600); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.steps li b { color: var(--navy-900); }
.zalo-btn { display: inline-flex; align-items: center; gap: .5rem; margin-top: .5rem; background: #0068ff; color: #fff; border-radius: 10px;
  padding: .55rem 1rem; font-weight: 700; text-decoration: none; font-size: .9rem; }
.zalo-btn:hover { background: #0057d6; }
.consent { display: flex; gap: .65rem; align-items: flex-start; margin-top: 1.25rem; font-size: .9rem; color: var(--text-2); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin-top: .15rem; flex-shrink: 0; accent-color: var(--navy-800); }
.consent-details { margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.consent-details summary { cursor: pointer; color: var(--navy-700); font-weight: 600; }
.row-2 { display: grid; gap: 1rem; }
.row-2 .field + .field { margin-top: 0; }
@media (min-width: 560px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.row-2 + .field, .field + .row-2 { margin-top: 1rem; }
.acct-info { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0 0 1.5rem; font-size: .95rem; }
.acct-info dt { color: var(--muted); }
.acct-info dd { margin: 0; font-weight: 600; color: var(--navy-900); }
.acct-section { border-top: 1px solid var(--border); padding-top: 1.25rem; margin-top: 1.5rem; }
.acct-section h2 { font-size: 1.1rem; margin-bottom: .75rem; }
.danger-text { color: var(--red-600); }
.locked-post { text-align: center; padding: 2.5rem 1.5rem; }
.locked-post .icon { width: 44px; height: 44px; color: var(--navy-700); margin-bottom: .75rem; }
.locked-post h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.locked-post p { color: var(--text-2); margin: 0 0 1.25rem; }
.locked-post .acts { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
