/* ============================================================
   Green House PG — Design System with Animation.mp4 Aesthetics
   Royal Green + Ivory + Gold palette + Marquee & Featured Slider
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
  /* Green palette */
  --c-forest:      #1A3C2A;
  --c-forest-mid:  #2D6A4F;
  --c-sage:        #52B788;
  --c-mint:        #95D5B2;
  --c-pale:        #D8F3DC;
  --c-pale-light:  #EDFAEF;

  /* Gold palette */
  --c-gold:        #C9A84C;
  --c-gold-light:  #E8CF8A;
  --c-gold-pale:   #FDF6E3;

  /* Neutrals */
  --c-ivory:       #F6F2EB;
  --c-cream:       #FAF8F3;
  --c-white:       #FFFFFF;
  --c-charcoal:    #1A2B22;
  --c-slate:       #3D5247;
  --c-muted:       #7B9485;
  --c-border:      #D8D4C9;
  --c-border-l:    #EDE9E2;

  /* Semantic */
  --c-success:     #27AE60;
  --c-success-bg:  #E8F5E9;
  --c-warning:     #E67E22;
  --c-warning-bg:  #FFF3E0;
  --c-danger:      #C0392B;
  --c-danger-bg:   #FFEBEE;
  --c-info:        #2980B9;
  --c-info-bg:     #E3F2FD;

  /* Typography */
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;

  /* Radii */
  --r-xs:   6px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  28px;
  --r-pill: 100px;

  /* Shadows */
  --sh-xs:  0 1px 4px rgba(26,60,42,0.07);
  --sh-sm:  0 2px 8px rgba(26,60,42,0.10);
  --sh-md:  0 4px 16px rgba(26,60,42,0.13);
  --sh-lg:  0 8px 28px rgba(26,60,42,0.17);
  --sh-xl:  0 16px 48px rgba(26,60,42,0.22);

  /* Layout */
  --header-h: 64px;
  --nav-h:    70px;
  --max-w:    480px;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--c-ivory);
  color: var(--c-charcoal);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* ─── App Shell ─────────────────────────────────────────── */
#app {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--c-cream);
  box-shadow: 0 0 60px rgba(0,0,0,0.08);
}

/* ─── Header ─────────────────────────────────────────────  */
#app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--header-h);
  background: linear-gradient(135deg, var(--c-forest) 0%, #1F4A35 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-md);
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
#app-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.5), transparent);
}

.header-left { display: flex; align-items: center; gap: var(--sp-sm); flex: 1; min-width: 0; }
.header-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--c-gold) 0%, #A0813A 100%);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(201,168,76,0.4);
  flex-shrink: 0;
  animation: logoPulse 4s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); box-shadow: 0 4px 14px rgba(201,168,76,0.6); }
}

.header-text { min-width: 0; }
.header-title {
  font-family: var(--font-display);
  color: var(--c-white);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-subtitle { color: var(--c-mint); font-size: 0.68rem; letter-spacing: 0.05em; margin-top: 1px; }

#btn-back {
  background: rgba(255,255,255,0.12);
  border-radius: var(--r-sm);
  color: white;
  padding: 7px 12px;
  display: flex; align-items: center; gap: 5px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.2s;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
#btn-back:active { background: rgba(255,255,255,0.22); }

#header-actions { display: flex; gap: var(--sp-xs); flex-shrink: 0; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: white;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.9rem;
  transition: background 0.2s;
  cursor: pointer;
}
.icon-btn:active { background: rgba(255,255,255,0.2); }

/* ─── Animated Marquee Ticker (From animation.mp4) ──────── */
.marquee-ticker {
  background: linear-gradient(90deg, #C9A84C 0%, #E8CF8A 50%, #C9A84C 100%);
  color: var(--c-forest);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 6px 0;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: var(--sp-md);
  border-radius: var(--r-sm);
  position: relative;
}
.marquee-track {
  display: inline-block;
  white-space: nowrap;
  animation: marqueeScroll 22s linear infinite;
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ─── Featured Locations Slider (From animation.mp4) ────── */
.featured-slider-container {
  margin-bottom: var(--sp-lg);
  position: relative;
}
.featured-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--sp-sm);
}
.featured-title {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  color: var(--c-charcoal);
}
.slider-arrows { display: flex; gap: 6px; }
.slider-arrow {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-white); border: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: var(--c-forest); cursor: pointer;
  box-shadow: var(--sh-xs); transition: all 0.2s;
}
.slider-arrow:active { transform: scale(0.92); background: var(--c-pale); }

.featured-track {
  display: flex; gap: var(--sp-md);
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.featured-track::-webkit-scrollbar { display: none; }

.featured-card {
  flex: 0 0 82%; scroll-snap-align: start;
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  height: 180px;
  box-shadow: var(--sh-md);
  background: #1A3C2A;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  cursor: pointer;
}
.featured-card:active { transform: scale(0.97); }
.featured-card img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.85; transition: transform 0.4s ease;
}
.featured-card:hover img { transform: scale(1.05); }
.featured-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,60,42,0.92) 0%, rgba(26,60,42,0.3) 60%, transparent 100%);
  padding: var(--sp-md);
  display: flex; flex-direction: column; justify-content: space-between;
}
.featured-badge {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--c-gold) 0%, #A0813A 100%);
  color: white; font-size: 0.65rem; font-weight: 700;
  padding: 4px 10px; border-radius: var(--r-pill);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.featured-card-title {
  color: white; font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700; margin-bottom: 2px;
}
.featured-card-sub {
  color: var(--c-mint); font-size: 0.75rem; display: flex; align-items: center; gap: 4px;
}

/* ─── Floating Emblem Badge (From animation.mp4) ────────── */
.floating-emblem-badge {
  position: absolute; top: var(--sp-md); right: var(--sp-md);
  width: 58px; height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c-gold-light) 0%, var(--c-gold) 100%);
  color: var(--c-forest);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.55rem; font-weight: 800; text-align: center; text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(201,168,76,0.5);
  border: 2px solid white;
  animation: badgeRotate 12s linear infinite;
  z-index: 10;
}
@keyframes badgeRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ─── Main Content ──────────────────────────────────────── */
#app-content {
  flex: 1;
  margin-top: var(--header-h);
  margin-bottom: var(--nav-h);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
#app-content > .view { padding: var(--sp-md); }

/* ─── Views ─────────────────────────────────────────────── */
.view { display: none; }
.view.active {
  display: block;
  animation: viewIn 0.32s cubic-bezier(0.4,0,0.2,1);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.slide-in-right { animation: slideRight 0.32s cubic-bezier(0.4,0,0.2,1) !important; }
@keyframes slideRight {
  from { opacity: 0.7; transform: translateX(30px); }
  to   { opacity: 1;   transform: translateX(0); }
}
.slide-in-left { animation: slideLeft 0.32s cubic-bezier(0.4,0,0.2,1) !important; }
@keyframes slideLeft {
  from { opacity: 0.7; transform: translateX(-30px); }
  to   { opacity: 1;   transform: translateX(0); }
}

/* ─── Bottom Navigation ─────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--nav-h);
  background: var(--c-white);
  border-top: 1px solid var(--c-border-l);
  display: flex;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(26,60,42,0.07);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  padding: 8px;
  color: var(--c-muted);
  transition: color 0.2s;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.nav-item.active { color: var(--c-forest); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: linear-gradient(90deg, var(--c-forest), var(--c-sage));
  border-radius: 0 0 var(--r-pill) var(--r-pill);
}
.nav-icon { font-size: 1.3rem; line-height: 1; transition: transform 0.2s; }
.nav-item.active .nav-icon { transform: scale(1.1); }
.nav-label { font-size: 0.67rem; font-weight: 600; letter-spacing: 0.03em; }

/* ─── Stats Strip ────────────────────────────────────────── */
.stats-strip {
  background: linear-gradient(135deg, var(--c-forest) 0%, var(--c-forest-mid) 100%);
  border-radius: var(--r-2xl);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  position: relative;
  overflow: hidden;
}
.stats-strip::before {
  content: '';
  position: absolute; top: -24px; right: -24px;
  width: 110px; height: 110px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.stats-strip::after {
  content: '';
  position: absolute; bottom: -36px; left: 48px;
  width: 150px; height: 150px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.stat-item { position: relative; z-index: 1; }
.stat-label { color: var(--c-mint); font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 4px; }
.stat-value { color: var(--c-white); font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; line-height: 1; }
.stat-sub { color: rgba(255,255,255,0.55); font-size: 0.68rem; margin-top: 4px; }

/* ─── Section Header ─────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-md);
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 600;
  color: var(--c-charcoal);
}
.section-count {
  background: var(--c-pale);
  color: var(--c-forest-mid);
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

/* ─── Flat Card ─────────────────────────────────────────── */
.flat-card {
  background: var(--c-white);
  border-radius: var(--r-lg);
  padding: var(--sp-md) var(--sp-md) var(--sp-md) calc(var(--sp-md) + 8px);
  margin-bottom: var(--sp-md);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--c-border-l);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  position: relative;
  overflow: hidden;
}
.flat-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(to bottom, var(--c-forest), var(--c-sage));
  border-radius: 5px 0 0 5px;
}
.flat-card:active { transform: scale(0.985); box-shadow: var(--sh-xs); }
.flat-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--sp-md);
}
.flat-name {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 600;
  color: var(--c-charcoal);
}
.flat-date { color: var(--c-muted); font-size: 0.72rem; margin-top: 3px; }
.flat-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.flat-badge {
  background: var(--c-pale); color: var(--c-forest-mid);
  font-size: 0.68rem; padding: 3px 9px;
  border-radius: var(--r-pill); font-weight: 700;
  white-space: nowrap;
}
.badge-notice { background: var(--c-warning-bg); color: var(--c-warning); }
.flat-stats { display: flex; gap: var(--sp-md); }
.flat-stat-label { color: var(--c-muted); font-size: 0.68rem; margin-bottom: 2px; }
.flat-stat-value { color: var(--c-charcoal); font-size: 0.88rem; font-weight: 600; }
.flat-stat-value.income { color: var(--c-success); }
.flat-arrow {
  position: absolute; right: var(--sp-md); top: 50%;
  transform: translateY(-50%);
  color: var(--c-border); font-size: 1rem;
}

/* ─── Tenant Card ────────────────────────────────────────── */
.tenant-card {
  background: var(--c-white);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  margin-bottom: 10px;
  box-shadow: var(--sh-xs);
  border: 1px solid var(--c-border-l);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex; align-items: center; gap: var(--sp-md);
}
.tenant-card:active { transform: scale(0.985); }
.tenant-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--c-forest) 0%, var(--c-sage) 100%);
  box-shadow: 0 2px 8px rgba(26,60,42,0.2);
}
.tenant-info { flex: 1; min-width: 0; }
.tenant-name { font-weight: 600; font-size: 0.92rem; color: var(--c-charcoal); }
.tenant-meta { color: var(--c-muted); font-size: 0.75rem; margin-top: 3px; }
.tenant-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Status badges */
.status-badge {
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 0.68rem; font-weight: 700; white-space: nowrap;
}
.status-active   { background: var(--c-success-bg); color: var(--c-success); }
.status-vacated  { background: var(--c-danger-bg);  color: var(--c-danger); }
.status-notice   { background: var(--c-warning-bg); color: var(--c-warning); }

/* ─── FAB ───────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: max(16px, calc(50% - var(--max-w)/2 + 16px));
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--c-forest) 0%, var(--c-forest-mid) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.6rem; font-weight: 300;
  box-shadow: var(--sh-lg), 0 0 0 0 rgba(45,106,79,0);
  cursor: pointer;
  z-index: 90;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  animation: fabPulse 2.5s ease-in-out infinite;
}
@keyframes fabPulse {
  0%, 100% { box-shadow: var(--sh-lg), 0 0 0 0 rgba(45,106,79,0.3); }
  50%       { box-shadow: var(--sh-lg), 0 0 0 10px rgba(45,106,79,0); }
}
.fab:active { transform: scale(0.91); animation: none; }

/* ─── Modal ─────────────────────────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#modal-overlay.active { display: flex; animation: overlayIn 0.22s ease; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--c-white);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  width: 100%; max-width: var(--max-w);
  max-height: 93vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: modalUp 0.36s cubic-bezier(0.34,1.06,0.64,1);
  padding: var(--sp-md) var(--sp-lg) calc(var(--sp-lg) + env(safe-area-inset-bottom, 0));
}
@keyframes modalUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--c-border);
  border-radius: var(--r-pill);
  margin: 0 auto var(--sp-lg);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 600;
  color: var(--c-charcoal);
  margin-bottom: var(--sp-lg);
}

/* ─── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-md); }
.form-label {
  display: block;
  font-size: 0.72rem; font-weight: 600;
  color: var(--c-slate);
  margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--c-ivory);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px var(--sp-md);
  font-size: 0.92rem;
  color: var(--c-charcoal);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--c-forest-mid);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.14);
  outline: none;
  background: var(--c-white);
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%237B9485' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 20px;
  padding-right: 40px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-sm); }
.form-hint { font-size: 0.72rem; color: var(--c-muted); margin-top: 4px; }

/* ─── Toggle Group ───────────────────────────────────────── */
.toggle-group { display: flex; gap: var(--sp-xs); margin-bottom: var(--sp-md); }
.toggle-btn {
  flex: 1; padding: 10px 8px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--c-border);
  background: var(--c-ivory);
  color: var(--c-muted);
  font-size: 0.82rem; font-weight: 500;
  transition: all 0.2s; cursor: pointer; text-align: center;
}
.toggle-btn.active {
  background: var(--c-forest); border-color: var(--c-forest);
  color: white; font-weight: 600;
  box-shadow: var(--sh-sm);
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 13px var(--sp-lg);
  border-radius: var(--r-md);
  font-size: 0.92rem; font-weight: 600;
  transition: all 0.18s; cursor: pointer; border: none; line-height: 1;
}
.btn-primary {
  background: linear-gradient(135deg, var(--c-forest) 0%, var(--c-forest-mid) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(26,60,42,0.25);
}
.btn-primary:active { transform: scale(0.97); box-shadow: var(--sh-sm); }
.btn-secondary {
  background: var(--c-ivory); color: var(--c-slate);
  border: 1.5px solid var(--c-border);
}
.btn-secondary:active { background: var(--c-pale-light); }
.btn-danger { background: var(--c-danger-bg); color: var(--c-danger); border: 1.5px solid #FFCDD2; }
.btn-gold {
  background: linear-gradient(135deg, var(--c-gold) 0%, #A0813A 100%);
  color: white; box-shadow: 0 4px 12px rgba(201,168,76,0.3);
}
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; border-radius: var(--r-sm); }
.btn-row { display: flex; gap: var(--sp-sm); margin-top: var(--sp-md); }
.btn-row .btn { flex: 1; }

/* ─── Receipt Card ───────────────────────────────────────── */
.receipt-card {
  background: var(--c-white);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  margin-bottom: 10px;
  border: 1px solid var(--c-border-l);
  box-shadow: var(--sh-xs);
  position: relative;
  overflow: hidden;
}
.receipt-card.fraudulent { border-color: #FFCC80; background: #FFFDE7; }
.receipt-top { display: flex; justify-content: space-between; align-items: flex-start; }
.receipt-no { font-size: 0.72rem; color: var(--c-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.receipt-amount {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700;
  color: var(--c-success);
}
.receipt-amount.partial { color: #D9534F; }
.receipt-card.part-pay-card {
  border-left: 4px solid #D9534F;
  background: #FFF8F8;
}
.receipt-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; margin-top: 10px;
}
.receipt-item-label { color: var(--c-muted); font-size: 0.68rem; margin-bottom: 2px; }
.receipt-item-value { color: var(--c-charcoal); font-size: 0.82rem; font-weight: 500; }
.receipt-actions {
  display: flex; gap: var(--sp-xs); margin-top: 10px;
  border-top: 1px solid var(--c-border-l); padding-top: 10px;
}
.fraud-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--c-warning-bg); color: var(--c-warning);
  font-size: 0.68rem; font-weight: 700; padding: 2px 7px;
  border-radius: var(--r-pill); margin-bottom: 6px;
}

/* Payment mode badges */
.pay-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: var(--r-pill);
  font-size: 0.7rem; font-weight: 600;
}
.pay-cash   { background: #E8F5E9; color: #2E7D32; }
.pay-upi    { background: #E3F2FD; color: #1565C0; }
.pay-bank   { background: #F3E5F5; color: #6A1B9A; }
.pay-cheque { background: #FFF3E0; color: #E65100; }
.pay-online { background: #E0F2F1; color: #00695C; }

/* ─── Document Grid ───────────────────────────────────────  */
.doc-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm); margin-bottom: var(--sp-md);
}
.doc-item {
  background: var(--c-ivory); border: 1.5px dashed var(--c-border);
  border-radius: var(--r-md); aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; transition: all 0.2s; overflow: hidden; position: relative;
}
.doc-item:active { border-color: var(--c-forest); background: var(--c-pale-light); transform: scale(0.96); }
.doc-item.has-file { border-style: solid; border-color: var(--c-sage); }
.doc-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.doc-overlay {
  position: absolute; inset: 0;
  background: rgba(26,60,42,0.65);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; opacity: 0; transition: opacity 0.2s;
}
.doc-item.has-file:active .doc-overlay { opacity: 1; }
.doc-overlay-text { color: white; font-size: 0.65rem; font-weight: 600; }
.doc-add-icon { font-size: 1.5rem; color: var(--c-muted); }
.doc-add-label { font-size: 0.65rem; color: var(--c-muted); text-align: center; padding: 0 4px; }
.doc-type-badge {
  position: absolute; bottom: 4px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.65); color: white;
  font-size: 0.58rem; padding: 1px 5px;
  border-radius: var(--r-pill); white-space: nowrap;
}

/* ─── Tenant Detail Sections ──────────────────────────────  */
.detail-section {
  background: var(--c-white);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-md);
  overflow: hidden;
  border: 1px solid var(--c-border-l);
  box-shadow: var(--sh-xs);
}
.detail-section-hdr {
  background: var(--c-pale-light);
  padding: 12px var(--sp-md);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.detail-section-hdr-left {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--c-forest); font-size: 0.88rem;
}
.detail-section-hdr-icon { font-size: 1rem; }
.section-chevron { color: var(--c-muted); transition: transform 0.22s; font-size: 0.8rem; }
.section-chevron.open { transform: rotate(180deg); }
.detail-section-body { padding: var(--sp-md); }
.detail-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 9px 0; border-bottom: 1px solid var(--c-border-l);
}
.detail-row:last-child { border-bottom: none; }
.detail-row-key { color: var(--c-muted); font-size: 0.78rem; flex-shrink: 0; min-width: 120px; }
.detail-row-val { color: var(--c-charcoal); font-size: 0.85rem; font-weight: 500; text-align: right; }

/* ─── Dashboard ─────────────────────────────────────────── */
.dash-tabs {
  display: flex; background: var(--c-white);
  border-radius: var(--r-lg); padding: 4px;
  margin-bottom: var(--sp-lg);
  box-shadow: var(--sh-xs); border: 1px solid var(--c-border-l);
}
.dash-tab {
  flex: 1; padding: 10px 4px;
  border-radius: var(--r-md); text-align: center;
  font-size: 0.82rem; font-weight: 500; color: var(--c-muted);
  cursor: pointer; transition: all 0.2s;
}
.dash-tab.active {
  background: linear-gradient(135deg, var(--c-forest) 0%, var(--c-forest-mid) 100%);
  color: white; box-shadow: var(--sh-sm); font-weight: 600;
}

.date-nav-row {
  display: flex; gap: var(--sp-sm); align-items: center;
  margin-bottom: var(--sp-md);
}
.date-nav-btn {
  width: 38px; height: 38px;
  background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; flex-shrink: 0; transition: background 0.15s;
}
.date-nav-btn:active { background: var(--c-pale-light); }
.date-display {
  flex: 1; background: var(--c-white); border: 1px solid var(--c-border);
  border-radius: var(--r-md); padding: 10px;
  text-align: center; font-weight: 600; font-size: 0.88rem;
  color: var(--c-charcoal);
}

.total-card {
  background: linear-gradient(135deg, var(--c-forest) 0%, var(--c-forest-mid) 100%);
  border-radius: var(--r-xl); padding: var(--sp-lg);
  margin-bottom: var(--sp-lg); text-align: center;
  position: relative; overflow: hidden;
}
.total-card::before {
  content: ''; position: absolute; top: -32px; right: -32px;
  width: 130px; height: 130px;
  background: rgba(255,255,255,0.07); border-radius: 50%;
}
.total-card::after {
  content: ''; position: absolute; bottom: -40px; left: 20px;
  width: 110px; height: 110px;
  background: rgba(255,255,255,0.05); border-radius: 50%;
}
.total-label {
  color: var(--c-mint); font-size: 0.72rem; letter-spacing: 0.09em;
  text-transform: uppercase; margin-bottom: 8px; position: relative; z-index: 1;
}
.total-amount {
  font-family: var(--font-display); font-size: 2.1rem; font-weight: 700;
  color: var(--c-white); position: relative; z-index: 1;
}
.total-sub {
  color: rgba(255,255,255,0.6); font-size: 0.75rem; margin-top: 5px;
  position: relative; z-index: 1;
}

.owner-card {
  background: var(--c-white); border-radius: var(--r-lg);
  padding: var(--sp-md); border: 1px solid var(--c-border-l);
  box-shadow: var(--sh-xs);
  display: flex; align-items: center; gap: var(--sp-md);
  margin-bottom: 10px;
}
.owner-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700; color: white; flex-shrink: 0;
}
.owner-info { flex: 1; min-width: 0; }
.owner-name { font-weight: 600; font-size: 0.92rem; color: var(--c-charcoal); }
.owner-amount {
  font-family: var(--font-display); font-size: 1.05rem;
  color: var(--c-success); font-weight: 700; margin-top: 2px;
}
.owner-sub { color: var(--c-muted); font-size: 0.72rem; margin-top: 2px; }
.owner-pct { text-align: right; }
.owner-pct-val { font-size: 1rem; font-weight: 700; color: var(--c-charcoal); }
.owner-pct-bar {
  width: 60px; height: 4px;
  background: var(--c-border-l); border-radius: var(--r-pill);
  margin-top: 6px; overflow: hidden;
}
.owner-pct-fill { height: 100%; border-radius: var(--r-pill); transition: width 0.6s ease; }

/* ─── Fraud Alert ─────────────────────────────────────────  */
.fraud-section-hdr {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: var(--sp-sm);
}
.fraud-section-title { font-weight: 700; font-size: 0.88rem; color: var(--c-warning); }
.fraud-alert-card {
  background: #FFF8E1; border: 1.5px solid #FFE082;
  border-radius: var(--r-md); padding: 12px var(--sp-md);
  margin-bottom: 8px;
}
.fraud-alert-title { color: #E65100; font-weight: 700; font-size: 0.82rem; }
.fraud-alert-desc { color: #BF360C; font-size: 0.78rem; margin-top: 3px; }
.no-fraud {
  background: var(--c-success-bg); border: 1px solid #C8E6C9;
  border-radius: var(--r-md); padding: 12px;
  display: flex; align-items: center; gap: 8px;
  color: var(--c-success); font-size: 0.85rem; font-weight: 500;
}

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: var(--sp-2xl) var(--sp-lg);
  color: var(--c-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: var(--sp-md); opacity: 0.7; }
.empty-title {
  font-family: var(--font-display); font-size: 1.05rem;
  color: var(--c-slate); margin-bottom: 6px; font-weight: 600;
}
.empty-desc { font-size: 0.82rem; line-height: 1.5; }

/* ─── Toast ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: calc(var(--header-h) + 10px);
  left: 50%; transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 32px); max-width: calc(var(--max-w) - 32px);
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--c-charcoal); color: white;
  padding: 11px var(--sp-md); border-radius: var(--r-md);
  font-size: 0.84rem; font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(0.34,1.06,0.64,1);
  box-shadow: var(--sh-lg);
  display: flex; align-items: center; gap: 8px;
}
.toast.success { background: #1B5E20; }
.toast.error   { background: #B71C1C; }
.toast.warning { background: #E65100; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to   { opacity: 0; transform: translateY(-8px) scale(0.97); }
}

/* ─── Stagger Animations ─────────────────────────────────── */
.stagger > *:nth-child(1)  { animation: staggerIn 0.38s ease both; animation-delay: 0ms; }
.stagger > *:nth-child(2)  { animation: staggerIn 0.38s ease both; animation-delay: 55ms; }
.stagger > *:nth-child(3)  { animation: staggerIn 0.38s ease both; animation-delay: 110ms; }
.stagger > *:nth-child(4)  { animation: staggerIn 0.38s ease both; animation-delay: 165ms; }
.stagger > *:nth-child(5)  { animation: staggerIn 0.38s ease both; animation-delay: 220ms; }
.stagger > *:nth-child(6)  { animation: staggerIn 0.38s ease both; animation-delay: 275ms; }
.stagger > *:nth-child(7)  { animation: staggerIn 0.38s ease both; animation-delay: 330ms; }
.stagger > *:nth-child(8)  { animation: staggerIn 0.38s ease both; animation-delay: 385ms; }
@keyframes staggerIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Settings ───────────────────────────────────────────── */
.settings-section { margin-bottom: var(--sp-lg); }
.settings-section-title {
  font-size: 0.72rem; font-weight: 700; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: var(--sp-sm); padding: 0 var(--sp-xs);
}
.settings-card {
  background: var(--c-white); border-radius: var(--r-lg);
  border: 1px solid var(--c-border-l); box-shadow: var(--sh-xs);
  overflow: hidden;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--sp-md); border-bottom: 1px solid var(--c-border-l);
  cursor: pointer; transition: background 0.15s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:active { background: var(--c-pale-light); }
.settings-row-label { font-size: 0.88rem; font-weight: 500; color: var(--c-charcoal); }
.settings-row-value { font-size: 0.82rem; color: var(--c-muted); }
.settings-row-arrow { color: var(--c-border); font-size: 0.8rem; }

/* App info card */
.app-info-card {
  background: linear-gradient(135deg, var(--c-forest) 0%, var(--c-forest-mid) 100%);
  border-radius: var(--r-xl); padding: var(--sp-lg);
  text-align: center; margin-bottom: var(--sp-lg);
  position: relative; overflow: hidden;
}
.app-info-logo {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--c-gold) 0%, #A0813A 100%);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin: 0 auto var(--sp-md);
  box-shadow: 0 4px 16px rgba(201,168,76,0.4);
}
.app-info-name {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
  color: white; margin-bottom: 4px;
}
.app-info-tagline { color: var(--c-mint); font-size: 0.8rem; }

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }

/* ─── Utilities ─────────────────────────────────────────── */
.text-muted   { color: var(--c-muted) !important; }
.text-success { color: var(--c-success) !important; }
.text-danger  { color: var(--c-danger) !important; }
.text-warning { color: var(--c-warning) !important; }
.text-gold    { color: var(--c-gold) !important; }
.text-sm      { font-size: 0.82rem !important; }
.text-xs      { font-size: 0.72rem !important; }
.font-display { font-family: var(--font-display) !important; }
.fw-700       { font-weight: 700 !important; }
.mt-sm        { margin-top: var(--sp-sm) !important; }
.mt-md        { margin-top: var(--sp-md) !important; }
.mb-md        { margin-bottom: var(--sp-md) !important; }
.divider      { height: 1px; background: var(--c-border-l); margin: var(--sp-md) 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.pill-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 0.72rem; font-weight: 600;
}

/* Responsive tweaks */
@media (max-width: 360px) {
  .form-row { grid-template-columns: 1fr; }
  .receipt-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.3rem; }
}
