/* Rentify design system – dark charcoal, white, yellow (from the original v3 design; yellow matched to the logo).
   System fonts only (fast on cheap phones, no external requests). Mobile-first. */
:root {
  --bg-base: #0a0a0a;
  --bg-elevated: #121212;
  --bg-card: #181818;
  --bg-press: #282828;
  --text: #ffffff;
  --text-2: #b3b3b3;
  --text-muted: #8a8a8a;
  --accent: #FEC204;   /* measured from the official logo */
  --accent-hover: #FFD54F;
  --accent-dim: rgba(254, 194, 4, 0.14);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.12);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.12);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.12);
  --border: #2a2a2a;
  --radius: 8px;
  --radius-lg: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg-base); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
img, video, canvas { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: rgba(10, 10, 10, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 0.85rem; color: var(--text-2); }

/* Layout */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 460px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
h1 { font-size: 1.5rem; margin: 8px 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; margin: 20px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 6px; }

/* Panels & cards */
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.card .body { padding: 12px; }
.card .thumb { aspect-ratio: 4 / 3; background: var(--bg-press); object-fit: cover; width: 100%; }

/* Forms */
label.field { display: block; }
label.field > span { display: block; font-size: 0.82rem; color: var(--text-2); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], select, textarea {
  width: 100%; background: var(--bg-press); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; min-height: 44px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.92rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }
.help { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.error-text { color: var(--danger); font-size: 0.88rem; }
.warn-text { color: var(--warning); font-size: 0.88rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-press); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text); }
.btn:hover { border-color: #444; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: #111; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.block { width: 100%; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--bg-press); color: var(--text-2); }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.warn { background: var(--warning-bg); color: var(--warning); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.accent { background: var(--accent-dim); color: var(--accent); }

/* Tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 12px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; min-height: 44px; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* Notices */
.notice { padding: 10px 12px; border-radius: var(--radius); font-size: 0.9rem; }
.notice.warn { background: var(--warning-bg); color: var(--warning); }
.notice.bad { background: var(--danger-bg); color: var(--danger); }
.notice.ok { background: var(--success-bg); color: var(--success); }
.notice.info { background: var(--info-bg); color: var(--info); }

/* Notification bell */
.bell { position: relative; }
.bell .count { position: absolute; top: -4px; right: -4px; background: var(--accent); color: #111; border-radius: 999px; font-size: 0.7rem; font-weight: 800; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.notif-list { position: absolute; right: 16px; top: 60px; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; z-index: 40; }
.notif { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.notif.unread { background: var(--accent-dim); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; padding: 16px; }
.modal.wide { max-width: 1100px; }

/* Media tiles */
.media-tile { position: relative; background: var(--bg-press); border-radius: var(--radius); overflow: hidden; }
.media-tile img, .media-tile video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media-tile .meta { padding: 8px; font-size: 0.82rem; }
.media-tile .corner { position: absolute; top: 6px; left: 6px; }

/* Photo editor */
.editor { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .editor { grid-template-columns: 1fr 260px; } }
.editor .stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; touch-action: none; }
.editor canvas { width: 100%; height: auto; cursor: crosshair; }
.editor .tools button.active { background: var(--accent); color: #111; border-color: var(--accent); }

/* Toasts */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { white-space: pre-line; background: var(--bg-press); border-left: 4px solid var(--success); padding: 10px 14px; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }

table.simple { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.simple td, table.simple th { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }

/* ───────── Renter side (Stage 3) ───────── */
.pre { white-space: pre-line; }
.row.tight { gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; border: 1px solid var(--border); color: var(--text-2); }
.hero { padding: 8px 0 4px; }
.hero h1 { font-size: clamp(1.4rem, 5vw, 2rem); margin-bottom: 4px; }
.searchbar { position: relative; display: flex; gap: 8px; margin: 12px 0; }
.searchbar input { flex: 1; min-width: 0; width: 100%; background: var(--bg-press); border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; min-height: 48px; font-size: 1rem; }
.searchbar input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.sugg { position: absolute; top: 54px; left: 0; right: 0; z-index: 35; list-style: none; margin: 0; padding: 6px 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.sugg li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; min-height: 44px; align-items: center; }
.sugg li.active, .sugg li:hover { background: var(--bg-press); }
.citybar select { width: auto; min-width: 160px; }
.arow { margin-top: 18px; }
.arow h2 { margin: 0 0 10px; }
.ascroll { display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) { .ascroll { grid-auto-columns: 170px; } }
.atile { display: block; text-decoration: none; color: var(--text); scroll-snap-align: start; }
.atile img, .atile-blank { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); background: var(--bg-press); }
.atile-blank { display: grid; place-items: center; font-size: 2.6rem; font-weight: 900; color: var(--accent); background: linear-gradient(135deg, #1f1f1f, #2b2b2b); }
.atile-text { display: grid; padding-top: 6px; line-height: 1.25; }
.atile-text strong { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.atile:hover strong { color: var(--accent); }
.mgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 12px; }
.mcard { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.mcard-photo { position: relative; display: block; }
.mcard-photo .thumb, .thumb.placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-press); }
.thumb.placeholder, .gallery-img.placeholder { display: grid; place-items: center; font-size: 2.4rem; }
.video-dot { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.7); padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; }
.mcard-body { padding: 12px; display: grid; gap: 4px; flex: 1; }
.mcard-body h3 { margin: 4px 0 0; font-size: 1.02rem; }
.mcard-body h3 a { color: var(--text); text-decoration: none; }
.mcard-body .btn { margin-top: 8px; }
.price { font-weight: 800; color: var(--accent); }
.price.big { font-size: 1.4rem; }
.filters { margin: 12px 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 14px; }
.filters summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.filter-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 10px 0; }
.empty { text-align: left; margin-top: 16px; }
.album-head { display: flex; gap: 16px; align-items: flex-end; margin: 10px 0; flex-wrap: wrap; }
.album-cover { width: 140px; height: 140px; object-fit: cover; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
@media (min-width: 700px) { .album-cover { width: 200px; height: 200px; } }
.album-head h1 { font-size: clamp(1.5rem, 6vw, 2.4rem); margin: 0; }
.detail { display: grid; gap: 16px; margin: 10px 0 16px; }
@media (min-width: 860px) { .detail { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.gallery-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); background: var(--bg-press); }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.gthumb { padding: 0; border: 2px solid transparent; border-radius: var(--radius); background: none; cursor: pointer; flex: 0 0 72px; }
.gthumb.active { border-color: var(--accent); }
.gthumb img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; }
.gallery-video { width: 100%; border-radius: var(--radius-lg); background: #000; }
section.panel { margin-top: 14px; }
section.panel h2 { margin-top: 0; }
table.specs { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.specs th { text-align: left; color: var(--text-2); font-weight: 500; padding: 6px 8px 6px 0; width: 45%; }
table.specs td { padding: 6px 0; }
table.specs tr + tr { border-top: 1px solid var(--border); }
.cal-wrap { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cal-title { font-weight: 600; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; font-size: 0.8rem; }
.cal-dow { color: var(--text-muted); }
.cal-day { padding: 6px 0; border-radius: 6px; }
.cal-day.free { background: var(--success-bg); color: var(--success); }
.cal-day.busy { background: var(--danger-bg); color: var(--danger); text-decoration: line-through; }
.cal-day.maint { background: var(--warning-bg); color: var(--warning); }
.cal-day.past { color: #555; }
.cal-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 6px; vertical-align: middle; }
.cal-key.free { background: var(--success); } .cal-key.busy { background: var(--danger); } .cal-key.maint { background: var(--warning); }
.rating + .rating { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.w-num { max-width: 100%; }
.typeahead { position: relative; }
.typeahead .sugg { top: 48px; }
.sugg-head { padding: 6px 14px; font-size: 0.8rem; color: var(--warning); cursor: default; min-height: 0; }
.sugg li.other { border-top: 1px solid var(--border); }
#query { margin-top: 14px; }
.cover-pick { width: 120px; }
.cover-pick img, .cover-pick .atile-blank { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); }
a.notif { display: block; color: inherit; text-decoration: none; }
.thread { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px 0; }
.msg { padding: 8px 10px; border-radius: var(--radius); background: var(--bg-press); max-width: 90%; }
.msg.me { background: var(--accent-dim); justify-self: end; }
.msg.note { background: var(--warning-bg); }
.contact-card .mono { word-break: break-all; }
.qrow { cursor: pointer; }
.qrow.urgent { border-left: 4px solid var(--danger); }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; }
.kpi .v { font-size: 1.3rem; font-weight: 800; }

/* WhatsApp composer + owner finder (admin) */
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: #111; }
.btn.disabled { opacity: 0.5; cursor: not-allowed; }
.ok-text { color: var(--success); }
.finder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; }
.finder-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; border-top: 1px solid var(--border, #333); padding-top: 8px; }
.finder-row .who { flex: 1 1 260px; min-width: 0; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
