:root {
  --red: #d90429;
  --red-dark: #97001b;
  --ink: #171717;
  --muted: #747474;
  --line: #ededed;
  --surface: #ffffff;
  --soft: #f8f8f8;
  --shadow: 0 18px 38px rgba(217, 4, 41, .18);
}

* { box-sizing: border-box; }
* { scrollbar-width: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
html { min-height: 100%; background: var(--surface); }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #fff 0%, #fff 55%, #fafafa 100%);
}
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.app-shell { min-height: 100vh; padding-bottom: 96px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px 7px;
  background: rgba(16,16,18,.78);
  backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 50%; background: #fff; }
.brand strong { display: block; font-size: 14px; letter-spacing: 0; color: #fff; }
.brand span { display: block; max-width: 230px; color: rgba(255,255,255,.72); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-search {
  flex: 1 1 520px;
  max-width: 640px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; background: radial-gradient(circle at 35% 28%, #ff667a, var(--red) 55%, var(--red-dark));
  box-shadow: 0 10px 18px rgba(217,4,41,.26), inset 0 1px 0 rgba(255,255,255,.45);
  overflow: hidden;
}
.icon-btn.has-photo {
  background: #fff;
  box-shadow: 0 10px 18px rgba(0,0,0,.08);
}
.icon-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.chip-shell {
  position: sticky;
  top: 50px;
  z-index: 9;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: rgba(16,16,18,.78);
  backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.chipbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.chipbar::-webkit-scrollbar { display: none; }
.chip-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 18px rgba(0,0,0,.12);
}
.chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 15px;
  font-size: 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 18px rgba(0,0,0,.1);
  white-space: nowrap;
}
.chip.active {
  color: #fff;
  border-color: var(--red);
  background: linear-gradient(180deg, #ff304f, var(--red) 62%, var(--red-dark));
  box-shadow: var(--shadow);
}

main { width: min(980px, 100%); margin: 0 auto; padding: 16px; }
.hero-strip {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding: 14px 0 18px;
}
.eyebrow { color: var(--red); font-weight: 700; font-size: 12px; }
h1 { margin: 4px 0 0; font-size: 30px; line-height: 1.05; letter-spacing: 0; }
.filter-summary { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.pill-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #ff304f, var(--red) 62%, var(--red-dark));
  box-shadow: 0 12px 20px rgba(217,4,41,.22), inset 0 1px 0 rgba(255,255,255,.45);
  white-space: nowrap;
}
.pill-3d:disabled { cursor: wait; opacity: .86; }
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  animation: spin .75s linear infinite;
}
.secondary-action {
  min-height: 40px;
  border-radius: 999px;
  color: var(--red);
  background: #fff4f6;
  font-weight: 800;
}
.secondary-action .spinner {
  display: inline-block;
  border-color: rgba(217,4,41,.22);
  border-top-color: var(--red);
}
@keyframes spin { to { transform: rotate(360deg); } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.stat b { display: block; font-size: 19px; }
.stat span { color: var(--muted); font-size: 12px; }
.toolbar { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-bottom: 12px; }
.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.08);
}
.searchbox input { width: 100%; border: 0; outline: 0; background: transparent; color: #fff; }
.searchbox input::placeholder { color: rgba(255,255,255,.72); }

.feed { display: grid; gap: 10px; }
.row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 4, 41, .08);
  border-radius: 28px;
  background: linear-gradient(180deg, #fff 0%, #fff9fb 100%);
  box-shadow: 0 14px 26px rgba(0,0,0,.045), inset 0 1px 0 rgba(255,255,255,.9);
}
.avatar {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  color: var(--red); background: #fff4f6; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 8px 16px rgba(217,4,41,.08);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.row h3 { margin: 0; font-size: 15px; line-height: 1.2; }
.row p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mini {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--red); background: #fff4f6;
}
.badge { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #f2f2f2; color: #555; }
.badge.pending { background: #fff1d6; color: #8a5700; }
.badge.verifying { background: #e9f2ff; color: #145197; }
.badge.confirmed { background: #e8f7ee; color: #14753b; }
.badge.rejected { background: #ffe7ec; color: #a00022; }
.load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 14px 0 0;
  padding: 13px;
  border-radius: 999px;
  color: var(--red);
  background: #fff4f6;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: min(340px, calc(100% - 54px));
  padding: 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(16,16,18,.82);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 20px 40px rgba(0,0,0,.28);
}
.bottom-nav button { display: grid; place-items: center; gap: 1px; color: rgba(255,255,255,.72); background: transparent; border-radius: 999px; padding: 6px; font-size: 10px; }
.bottom-nav i { font-size: 15px; }
.bottom-nav .active, .bottom-nav .center.active { color: #fff; background: var(--red); }

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 29;
  background: rgba(23,23,23,.32);
  backdrop-filter: blur(0);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.bottom-sheet {
  position: fixed; left: 50%; right: auto; bottom: 0; z-index: 30;
  width: 100%;
  max-height: 86vh; overflow: auto;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -30px 60px rgba(0,0,0,.16);
  transform: translate(-50%, 105%);
  transition: transform .22s ease;
}
.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
.sheet-open.sheet-lock .sheet-backdrop { backdrop-filter: blur(8px); }
.sheet-open .bottom-sheet { transform: translate(-50%, 0); }
.sheet-handle { width: 44px; height: 5px; margin: 4px auto 14px; border-radius: 999px; background: #ddd; }
.sheet-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-title h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.sheet-title.centered { justify-content: center; text-align: center; padding: 0 44px; position: relative; }
.sheet-title.centered .mini { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.sheet-section-title { margin: 16px 0 8px; font-size: 15px; }
.sheet-copy { margin: -2px auto 14px; max-width: 460px; color: var(--muted); font-size: 13px; line-height: 1.45; text-align: center; }
.form-grid { display: grid; gap: 10px; }
.form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: 0;
  background: #fff;
  color: var(--ink);
}
.form-grid textarea { min-height: 90px; resize: vertical; }
.native-select-hidden { display: none; }
.dropdown {
  position: relative;
}
.dropdown-control {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.dropdown-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 36;
  display: none;
  max-height: 230px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  color: #fff;
  background: rgba(16,16,18,.94);
  box-shadow: 0 18px 36px rgba(0,0,0,.28);
  backdrop-filter: blur(18px) saturate(130%);
}
.dropdown.open .dropdown-menu { display: grid; gap: 4px; }
.dropdown-option {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink);
  color: #fff;
  background: transparent;
  text-align: left;
}
.dropdown-option:hover, .dropdown-option.active { color: var(--red); background: #fff4f6; }
.suggest-wrap { position: relative; }
.suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 37;
  display: none;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  color: #fff;
  background: rgba(16,16,18,.94);
  box-shadow: 0 18px 36px rgba(0,0,0,.28);
  backdrop-filter: blur(18px) saturate(130%);
}
.suggest-list.show { display: grid; gap: 4px; }
.suggest-item {
  display: grid;
  gap: 2px;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #fff;
  background: transparent;
  text-align: left;
}
.suggest-item:hover { background: rgba(255,255,255,.08); }
.suggest-item strong { font-size: 13px; color: #fff; }
.suggest-item span { font-size: 11px; color: rgba(255,255,255,.72); }
.dropzone {
  min-height: 138px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1.5px dashed #ff8fa0;
  border-radius: 8px;
  color: var(--red);
  background: #fff8fa;
  padding: 16px;
}
.dropzone.dragging { background: #ffe5eb; }
.upload-field {
  display: grid;
  gap: 8px;
}
.upload-field > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.upload-field .dropzone {
  width: 100%;
  cursor: pointer;
}
.media-preview-shell {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
}
.preview-arrow {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--red);
  background: #fff;
}
.media-preview-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  padding: 3px 0;
}
.media-preview-track::-webkit-scrollbar { display: none; }
.media-preview {
  position: relative;
  flex: 0 0 118px;
  height: 112px;
  display: grid;
  grid-template-rows: 78px 1fr;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  cursor: pointer;
}
.media-preview img,
.media-preview video {
  width: 100%;
  height: 78px;
  object-fit: cover;
  border-radius: 7px;
  background: #fff4f6;
}
.media-preview span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.preview-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--red);
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 16px rgba(0,0,0,.12);
}
.doc-preview {
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--red);
  background: #fff4f6;
}
.doc-preview i { font-size: 30px; }
.profile-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.profile-panel h3 { margin: 0; font-size: 16px; }
.profile-panel p { margin: 3px 0; color: var(--muted); font-size: 13px; }
.tenant-detail { display: grid; gap: 12px; }
.tenant-detail h3 { margin: 0; font-size: 20px; }
.tenant-detail-card {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff8fa;
}
.tenant-detail-photo {
  width: 100%;
  max-height: 310px;
  display: grid;
  place-items: center;
  object-fit: cover;
}
.tenant-detail-photo.empty { min-height: 190px; color: var(--red); font-size: 44px; }
.detail-grid { display: grid; gap: 8px; }
.detail-grid div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.detail-grid span, .detail-grid small { color: var(--muted); font-size: 12px; }
.detail-grid strong { font-size: 14px; }
.flash-backdrop {
  position: fixed; inset: 0; z-index: 39;
  background: rgba(23,23,23,.28);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.flash-backdrop.show { opacity: 1; pointer-events: auto; }
.flash-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%) scale(.98);
  z-index: 40;
  width: min(420px, calc(100% - 28px));
  padding: 14px 16px;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
  border: 1px solid var(--line);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s ease, opacity .2s ease;
}
.flash-modal.show { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.flash-modal.success { border-color: #bfe8cf; }
.flash-modal.error { border-color: #ffb3c0; }
.flash-modal p { margin: 0 0 12px; color: var(--muted); }
.action-list { display: grid; gap: 8px; margin: 4px 0 12px; }
.action-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.action-row:hover { background: #fff8fa; border-color: #ffd7df; }
.action-row strong { display: block; color: var(--ink); font-size: 14px; }
.action-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.flash-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.flash-action {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-weight: 800;
}
.flash-action.ghost { color: var(--muted); background: var(--soft); }
.flash-action.danger { color: #fff; background: var(--red-dark); }

@media (max-width: 680px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .brand > div { display: none; }
  .brand img { width: 38px; height: 38px; }
  .top-actions { margin-left: auto; gap: 7px; }
  .icon-btn { width: 36px; height: 36px; font-size: 14px; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .chip-shell { top: 91px; padding-left: 8px; padding-right: 8px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1fr; }
  .hero-strip { justify-items: center; }
  h1 { font-size: 26px; }
  .row { grid-template-columns: 46px minmax(0, 1fr) auto; border-radius: 22px; padding: 12px; }
  .row p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row .actions { grid-column: auto; justify-content: flex-end; align-self: start; flex-wrap: nowrap; }
  .payment-row {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: start;
  }
  .payment-row p {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .payment-row .actions {
    grid-column: auto;
    justify-content: flex-end;
    align-self: start;
    flex-wrap: nowrap;
  }
  .payment-row .badge { white-space: nowrap; }
  .avatar { width: 46px; height: 46px; border-radius: 15px; }
}

@media (min-width: 681px) and (max-width: 1024px) {
  .brand > div { display: none; }
  .top-actions { margin-left: auto; gap: 8px; }
  .icon-btn { width: 40px; height: 40px; }
  .header-search { flex-basis: 460px; max-width: 560px; }
}

@media (min-width: 681px) {
  .bottom-sheet { width: min(700px, calc(100% - 32px)); }
}
