/* =========================================================
   Gharwala — inner pages (login, post, dashboard, admin, property)
   Builds on the tokens in styles.css
   ========================================================= */
.page { padding: 40px 0 96px; background: var(--tint); min-height: calc(100vh - 72px); }
.container--narrow { max-width: 860px; }
.page-head { margin-bottom: 28px; }
.page-head.row { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; }
.page-head p { color: var(--ink-2); margin-top: 6px; }
.back { display: inline-flex; gap: 6px; font-weight: 600; color: var(--ink-3); margin-bottom: 16px; font-size: 14px; }
.back:hover { color: var(--brand); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; }
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 18px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.panel h2 .n { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-size: 14px; }

/* ---------- Form controls ---------- */
.f { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.f > span { font-size: 14px; font-weight: 700; color: var(--ink); }
.f > span em { font-style: normal; font-weight: 500; color: var(--ink-3); }
.f input, .f select, .f textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.f textarea { resize: vertical; min-height: 120px; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.f small { color: var(--ink-3); font-size: 13px; }
.f .preview { color: var(--brand); font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.fgroup { margin-bottom: 20px; }
.fgroup[hidden], .f[hidden] { display: none; }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-block; padding: 10px 18px; border: 1.5px solid var(--line); border-radius: 99px; font-weight: 600; font-size: 14px; cursor: pointer; transition: .15s; background: #fff; }
.opt span:hover { border-color: var(--ink-3); }
.opt input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.opt input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

.checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer; }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; border: 2px dashed #c9d2dc; border-radius: var(--radius); text-align: center; cursor: pointer; transition: .2s; background: #fbfcfc; }
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--brand-50); }
.drop__ico { font-size: 34px; }
.drop b { font-size: 16px; }
.drop small { color: var(--ink-3); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 16px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--tint); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(15, 27, 45, .75); color: #fff; font-size: 16px; line-height: 1; }
.thumb button:hover { background: #c0392b; }
.thumb .cover { position: absolute; left: 6px; bottom: 6px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }

.form-error { background: #fdecea; color: #a93226; border-radius: 10px; padding: 12px 14px; font-size: 14px; font-weight: 600; margin: 0 0 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .6; pointer-events: none; }
.btn--danger { color: #c0392b; border: 1px solid #f3c6c0; background: #fff; }
.btn--danger:hover { background: #fdecea; }
.btn--xs { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 440px; margin: 0 auto; }
.auth { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.auth__intro { color: var(--ink-2); margin-bottom: 18px; }
.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--tint); border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.auth__tab { padding: 10px; border-radius: 9px; font-weight: 700; color: var(--ink-3); }
.auth__tab.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.auth__fine { display: block; text-align: center; color: var(--ink-3); margin-top: 12px; font-size: 12px; }

/* ---------- Status badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; text-transform: capitalize; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--pending { background: #fff4dc; color: #a26a00; }
.badge--approved { background: #e7f6ee; color: #15803d; }
.badge--rejected { background: #fdecea; color: #c0392b; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 12px 16px; font-weight: 700; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.is-active { color: var(--brand); border-color: var(--brand); }
.tab .count { background: var(--line); color: var(--ink-2); border-radius: 99px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }
.tab.is-active .count { background: var(--brand); color: #fff; }

/* ---------- Owner listing rows ---------- */
.mlist { display: grid; gap: 14px; }
.mrow { display: grid; grid-template-columns: 140px 1fr auto; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.mrow__img { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--tint); }
.mrow__img img { width: 100%; height: 100%; object-fit: cover; }
.mrow__title { font-weight: 700; font-size: 16px; }
.mrow__title:hover { color: var(--brand); }
.mrow__sub { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.mrow__line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.mrow__price { font-weight: 800; }
.mrow__reason { margin-top: 8px; font-size: 13px; color: #a93226; background: #fdecea; padding: 6px 10px; border-radius: 8px; }
.mrow__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 12px 16px; background: #fafbfb; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--ink-3); font-size: 13px; }
.t-prop { display: flex; gap: 12px; align-items: center; min-width: 260px; }
.t-prop img, .t-prop .ph { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--tint); flex-shrink: 0; }
.t-prop a { font-weight: 700; }
.t-prop a:hover { color: var(--brand); }
.t-actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 220px; }

/* ---------- Admin ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 28px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.stat--alert { border-color: #f5d48a; background: #fffaf0; }
.filters { margin-bottom: 16px; }

.muted-box { text-align: center; padding: 48px 20px; background: #fff; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--ink-3); }
.muted-box b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.muted-box .btn { margin-top: 16px; }

/* ---------- Admin: API connection ---------- */
.api-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.api-status { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { width: 48px; height: 28px; border-radius: 99px; background: #cfd6de; position: relative; transition: background .2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.switch b { min-width: 24px; }
.keyrow { display: flex; gap: 8px; align-items: center; }
.keyrow input { flex: 1; min-width: 0; }
.mapgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.mapgrid .f > span { font-size: 13px; }
.mapgrid .f input { padding: 10px 12px; font-size: 14px; font-family: ui-monospace, Consolas, monospace; }
.test-result { border-radius: var(--radius); padding: 18px 20px; margin-top: 20px; border: 1px solid; }
.test-result.is-ok { background: #f0faf6; border-color: #bfe5d7; }
.test-result.is-warn { background: #fffaf0; border-color: #f5d48a; }
.test-result p { color: var(--ink-2); margin-top: 6px; font-size: 14px; }
.test-result summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--brand); }
.test-result pre, code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.test-result pre { background: #0f1b2d; color: #ffd9ec; padding: 14px; border-radius: 10px; overflow: auto; max-height: 360px; margin: 10px 0 0; }
code { background: var(--tint); padding: 1px 6px; border-radius: 5px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-left: 4px; vertical-align: middle; }
.live-dot[hidden] { display: none; }
.src-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .05em; background: #eef0ff; color: #4b4bc4; padding: 2px 6px; border-radius: 5px; }
.badge--archived { background: #eceff3; color: var(--ink-3); }

/* ---------- Admin: announcement bar ---------- */
.ann-preview { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.ann-preview .announce__inner { padding-inline: 16px; }
.ann-templates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.ann-themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.ann-theme { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 13px; }
.ann-theme input { position: absolute; opacity: 0; pointer-events: none; }
.ann-theme:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.ann-theme:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.ann-swatch { display: block; height: 30px; border-radius: 8px; }
.ann-swatch::before, .ann-swatch::after { display: none; }
.ann-icons { display: flex; flex-wrap: wrap; gap: 6px; }
.ann-icons button { min-width: 40px; height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 18px; background: #fff; }
.ann-icons button:hover { border-color: var(--brand); }
.ann-icons button[data-clear] { font-size: 13px; font-weight: 600; color: var(--ink-3); }

/* ---------- Property detail ---------- */
.pd { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.gallery { display: grid; gap: 10px; }
.gallery__main { aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: linear-gradient(135deg, #f9d3e5, #f8eaf1); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.gallery__thumbs button { flex: 0 0 96px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 2px solid transparent; opacity: .7; transition: .15s; }
.gallery__thumbs button.is-active, .gallery__thumbs button:hover { border-color: var(--brand); opacity: 1; }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd__head { margin: 24px 0 8px; }
.pd__tags { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.pd__price { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.pd__price small { font-size: 16px; color: var(--ink-3); font-weight: 600; }
.pd h1 { font-size: 24px; margin: 4px 0; }
.pd__loc { color: var(--ink-3); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.fact { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.fact span { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.fact b { font-size: 16px; }
.pd__section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 16px; }
.pd__section h2 { font-size: 18px; margin-bottom: 12px; }
.pd__section p { color: var(--ink-2); white-space: pre-line; }
.amen { display: flex; flex-wrap: wrap; gap: 8px; }
.amen span { padding: 8px 14px; background: var(--tint); border-radius: 99px; font-size: 14px; font-weight: 600; }
.amen span::before { content: "✓ "; color: var(--brand); }
.contact { position: sticky; top: 92px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.contact__owner { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.contact__owner .avatar { --c: var(--brand); }
.contact__owner small { display: block; color: var(--brand); font-weight: 700; font-size: 12px; }
.contact h3 { font-size: 17px; margin-bottom: 14px; }
.reveal-phone { text-align: center; padding: 18px; background: var(--brand-50); border-radius: 14px; }
.reveal-phone a { display: block; font-size: 24px; font-weight: 800; color: var(--brand); margin: 6px 0 2px; }
.banner { padding: 14px 18px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.banner--pending { background: #fff4dc; color: #7a5200; }
.banner--rejected { background: #fdecea; color: #a93226; }

/* ---------- Done state ---------- */
.done { text-align: center; padding: 56px 28px; }
.done__ico { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-size: 34px; }
.done h2 { justify-content: center; font-size: 24px; margin-bottom: 8px; }
.done p { color: var(--ink-2); max-width: 460px; margin: 0 auto 24px; }
.done .btn-row { justify-content: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .pd { grid-template-columns: 1fr; }
  .contact { position: static; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .page { padding: 24px 0 110px; }
  .panel { padding: 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .checks { grid-template-columns: repeat(2, 1fr); }
  .mapgrid { grid-template-columns: 1fr 1fr; }
  .ann-themes { grid-template-columns: repeat(2, 1fr); }
  .api-head { flex-direction: column; }
  .mrow { grid-template-columns: 96px 1fr; }
  .mrow__actions { grid-column: 1 / -1; justify-content: flex-start; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-actions .btn { flex: 1; }
}
