@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --bg: #F2F5F9;
  --bg2: #FFFFFF;
  --card: #FFFFFF;
  --card2: #F8FAFC;
  --border: #D4D9E4;
  --gold: #1B3FAB;
  --gold-light: #2952C4;
  --gold-dim: rgba(27, 63, 171, 0.08);
  --text: #0A0A0F;
  --text2: #374151;
  --text3: #6B7280;
  --green: #0D7A4E;
  --green-dim: rgba(13, 122, 78, 0.10);
  --red: #C41230;
  --red-dim: rgba(196, 18, 48, 0.10);
  --orange: #B45309;
  --orange-dim: rgba(180, 83, 9, 0.10);
  --blue: #2563EB;
  --blue-dim: rgba(37, 99, 235, 0.10);
  --sidebar-w: 240px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.dark-mode {
  --bg: #060B18;
  --bg2: #0C1527;
  --card: #111E35;
  --card2: #1A2C4A;
  --border: #1E3058;
  --text: #FFFFFF;
  --text2: #C8D3E8;
  --text3: #7A92B8;
  --gold: #4A7AFF;
  --gold-light: #6B96FF;
  --gold-dim: rgba(74, 122, 255, 0.12);
  --red: #E02040;
  --red-dim: rgba(224, 32, 64, 0.12);
  --green: #10C472;
  --green-dim: rgba(16, 196, 114, 0.12);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  height: -webkit-fill-available;
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
}


/* ── LOCK SCREEN ────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lineReveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
}

/* LEFT PANEL */
.lock-left {
  flex: 1;
  background: linear-gradient(160deg, #07152B 0%, #0B2545 60%, #081B36 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 64px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

@keyframes svgPulse {
  0% {
    filter: drop-shadow(0 0 2px rgba(30, 64, 175, 0.1));
    opacity: 0.8;
  }

  50% {
    filter: drop-shadow(0 0 12px rgba(30, 64, 175, 0.3));
    opacity: 1;
  }

  100% {
    filter: drop-shadow(0 0 2px rgba(30, 64, 175, 0.1));
    opacity: 0.8;
  }
}

.lock-geo-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lineReveal 1.2s ease forwards, svgPulse 6s infinite ease-in-out;
}

.lock-geo-art svg {
  width: 100%;
  height: 100%;
}

.lock-brand {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  animation: fadeUp 0.6s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lock-brand .brand-ao {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: #1E40AF;
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(30, 64, 175, 0.4);
}

.lock-brand h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 12px 0;
  line-height: 1.1;
}

.lock-brand p {
  font-size: 0.75rem;
  letter-spacing: 6px;
  text-transform: uppercase;
  font-weight: 500;
  color: #94A3B8;
  margin: 0;
}

.brand-motto {
  margin-top: 24px;
  font-size: 0.6rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: rgba(30, 64, 175, 0.65);
  font-weight: 600;
}

.lock-footer {
  position: relative;
  z-index: 2;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(141, 169, 196, 0.4);
}

/* RIGHT PANEL */
.lock-right {
  width: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #ffffff, #F3F5F9);
  padding: 40px;
  flex-shrink: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
}

.lock-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMSIgY3k9IjEiIHI9IjEiIGZpbGw9InJnYmEoMCwwLDAsMC4wMykiLz48L3N2Zz4=');
  opacity: 0.5;
  pointer-events: none;
}

.lock-form-container {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
  background: #ffffff;
  padding: 44px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.6);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.lock-form-container h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.6rem;
  color: #0A0A0F;
  margin: 0 0 10px 0;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.lock-form-container>p {
  color: #6B7280;
  font-size: 0.9rem;
  margin-bottom: 36px;
  line-height: 1.6;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group input[type="text"],
.input-group input[type="password"] {
  padding: 16px 20px;
  font-size: 0.95rem;
  width: 100%;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  background: #F9FAFB;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #111827;
  font-weight: 500;
  font-family: 'Roboto', sans-serif;
}

.input-group input[type="text"]:focus,
.input-group input[type="password"]:focus {
  background: #ffffff;
  border-color: #1E40AF;
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.15);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper input {
  padding-right: 48px !important;
}

.password-toggle {
  position: absolute;
  right: 14px;
  color: #9CA3AF;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.password-toggle:hover {
  color: #0B2545;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.remember-me-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #6B7280;
  cursor: pointer;
  user-select: none;
}

.remember-me-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: #0B2545;
}

.input-group button {
  background: #1B3FAB;
  color: #ffffff;
  border: none;
  padding: 18px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  box-shadow: 0 4px 14px rgba(27, 63, 171, 0.3);
  margin-top: 8px;
}

.input-group button:hover {
  background: #2952C4;
  box-shadow: 0 6px 20px rgba(27, 63, 171, 0.4);
  transform: translateY(-1px);
}

.input-group button:active {
  transform: translateY(0);
}

.login-footer-links {
  text-align: center;
  margin-top: 8px;
}

.forgot-link {
  font-size: 0.75rem;
  color: #6B7280;
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: #0B2545;
  text-decoration: underline;
}

.secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  color: #9CA3AF;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding-top: 24px;
  border-top: 1px solid #F3F4F6;
}

.secure-badge svg {
  opacity: 0.7;
}

.pin-error {
  color: #DC2626;
  font-size: 0.85rem;
  margin-top: 10px;
  min-height: 18px;
  font-weight: 500;
  text-align: center;
}

/* Dark mode lock screen */
.dark-mode .lock-right {
  background: #0F172A;
  border-left-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .lock-form-container {
  background: #111E35;
  border-color: rgba(255, 255, 255, 0.06);
}

.dark-mode .lock-form-container h3 {
  color: #FFFFFF;
}

.dark-mode .lock-form-container>p {
  color: #7A92B8;
}

.dark-mode .input-group input[type="text"],
.dark-mode .input-group input[type="password"] {
  background: #0C1527;
  border-color: #1E3058;
  color: #FFFFFF;
}

.dark-mode .input-group input:focus {
  border-color: #4A7AFF;
  box-shadow: 0 0 0 3px rgba(74, 122, 255, 0.15);
}

.dark-mode .remember-me-label {
  color: #7A92B8;
}

.dark-mode .input-group button {
  background: #2952C4;
  color: #ffffff;
}

.dark-mode .input-group button:hover {
  background: #4A7AFF;
}

.dark-mode .forgot-link:hover {
  color: #4A7AFF;
}

/* MOBILE LOCK SCREEN */
@media (max-width: 900px) {
  #lock-screen {
    flex-direction: column;
    background: linear-gradient(160deg, #07152B 0%, #0B2545 60%, #0E2F57 100%);
  }

  .lock-left {
    flex: none;
    padding: 40px 28px 28px;
    background: transparent;
    align-items: center;
    text-align: center;
    justify-content: flex-end;
  }

  .lock-geo-art {
    opacity: 0.6;
  }

  .lock-brand {
    align-items: center;
  }

  .lock-brand .brand-ao {
    border-bottom: 1px solid rgba(30, 64, 175, 0.4);
    padding-bottom: 8px;
    margin-bottom: 14px;
  }

  .lock-brand h2 {
    font-size: 1.9rem;
    letter-spacing: 4px;
  }

  .lock-brand p {
    font-size: 0.6rem;
    letter-spacing: 3px;
  }

  .brand-motto {
    margin-top: 14px;
  }

  .lock-footer {
    display: none;
  }

  .lock-right {
    flex: 1;
    width: 100%;
    padding: 28px 20px;
    background: #F5F7FA;
    border-left: none;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.3);
    align-items: flex-start;
    justify-content: center;
  }

  .dark-mode .lock-right {
    background: #0F172A;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  }

  .lock-form-container {
    max-width: 100%;
  }

  .lock-form-container h3 {
    font-size: 1.4rem;
  }
}


/* ── APP SHELL ────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
}

#app.hidden {
  display: none;
}

/* ── SIDEBAR ──────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 28px 20px 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--gold);
}

.sidebar-brand span {
  font-size: 0.7rem;
  color: var(--text3);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.sidebar-section {
  padding: 16px 12px 8px;
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all .2s;
  border: 1px solid transparent;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--card);
  color: var(--text);
}

.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(201, 151, 58, 0.2);
}

.mobile-only {
  display: none;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer .nav-item {
  margin: 0;
}

/* ── MAIN CONTENT ─────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
}

.topbar-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  color: var(--text2);
  font-size: 0.8rem;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ── PAGES ────────────────────────────────────────── */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeUp .25s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ── STAT CARDS ───────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: radial-gradient(120% 120% at 50% 0%, var(--card2) 0%, var(--card) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 12px 32px rgba(0, 0, 0, 0.15);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.stat-card.gold::before { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.stat-card.green::before { background: linear-gradient(90deg, var(--green), #34D399); }
.stat-card.red::before { background: linear-gradient(90deg, var(--red), #F87171); }
.stat-card.blue::before { background: linear-gradient(90deg, var(--blue), #60A5FA); }

.stat-icon-bg {
  position: absolute;
  right: -10px;
  bottom: -20px;
  width: 100px;
  height: 100px;
  opacity: 0.04;
  color: currentColor;
  pointer-events: none;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text3);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  position: relative;
  z-index: 1;
}

.stat-value.gold {
  color: var(--gold);
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 4px;
}

.stat-icon {
  position: absolute;
  right: 16px;
  top: 16px;
  opacity: 0.1;
}

.stat-icon svg {
  width: 40px;
  height: 40px;
}

/* ── DASHBOARD GRID ───────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.dash-grid-full {
  grid-column: 1 / -1;
}

/* ── SKELETON LOADING ─────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--card2) 50%, var(--bg) 75%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
  min-height: 20px;
}
.skeleton-circle {
  border-radius: 50%;
}

@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.badge-premium {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 196, 114, 0.2);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-premium.inactive {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text3);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

/* ── FORMS ────────────────────────────────────────── */
/* ── CARDS ────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── TABLE ────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--text);
  font-size: 0.875rem;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

/* ── BADGES ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-green {
  background: var(--green-dim);
  color: var(--green);
}

.badge-red {
  background: var(--red-dim);
  color: var(--red);
}

.badge-orange {
  background: var(--orange-dim);
  color: var(--orange);
}

.badge-gold {
  background: var(--gold-dim);
  color: var(--gold);
}

.badge-blue {
  background: var(--blue-dim);
  color: var(--blue);
}

.badge-gray {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text2);
}

/* ── BUTTONS ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: 'Roboto', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.96);
}

.btn-gold {
  background: var(--gold);
  color: #FFFFFF;
  border-color: var(--gold);
}

.btn-gold:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text2);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

.btn-red {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}

.btn-red:hover {
  background: var(--red-dim);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-icon {
  padding: 7px;
  border-radius: var(--radius-sm);
}

.btn svg {
  width: 15px;
  height: 15px;
}

/* ── UNITS GRID ───────────────────────────────────── */
.units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.unit-card {
  background: linear-gradient(180deg, var(--card) 0%, var(--card2) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.unit-card:hover {
  border-color: var(--gold-light);
  transform: translateY(-3px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 8px 24px rgba(0, 0, 0, 0.12);
}

.unit-card.occupied {
  border-color: rgba(46, 204, 113, 0.3);
}

.unit-card.vacant {
  border-color: rgba(0, 0, 0, 0.08);
}

.unit-card.maintenance {
  border-color: rgba(230, 126, 34, 0.3);
}

.unit-num {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--gold);
}

.unit-type {
  font-size: 0.72rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 4px 0 10px;
}

.unit-rent {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.unit-tenant {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-status-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.unit-status-dot.occupied {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.unit-status-dot.vacant {
  background: var(--text3);
}

.unit-status-dot.maintenance {
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}

/* ── TENANT CARDS ─────────────────────────────────── */
.tenant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tenant-card {
  background: linear-gradient(180deg, var(--card) 0%, var(--card2) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.tenant-card:hover {
  border-color: var(--gold-light);
  transform: translateY(-3px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 8px 24px rgba(0, 0, 0, 0.12);
}

.tenant-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 4px 12px var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  color: #FFFFFF;
  flex-shrink: 0;
}

.tenant-info {
  flex: 1;
  min-width: 0;
}

.tenant-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-unit {
  font-size: 0.8rem;
  color: var(--gold);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.tenant-phone {
  font-size: 0.85rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tenant-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── FILTER BAR ───────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: 'Roboto', sans-serif;
}

.filter-tab.active {
  background: var(--gold-dim);
  border-color: rgba(201, 151, 58, 0.4);
  color: var(--gold);
}

.search-wrap {
  flex: 1;
  position: relative;
  max-width: 300px;
}

.search-wrap input {
  width: 100%;
}

.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text3);
  pointer-events: none;
}

.search-wrap input {
  padding-left: 34px !important;
}

/* ── FORM / INPUT ─────────────────────────────────── */
input,
select,
textarea {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Roboto', sans-serif;
  font-size: 0.875rem;
  padding: 10px 14px;
  width: 100%;
  transition: border-color .2s;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

select option {
  background: var(--card2);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-group {
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ── MODAL ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform .2s;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

.modal-header h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  cursor: pointer;
  color: var(--text3);
}

.modal-close:hover {
  color: var(--text);
}

/* ── FLOATING ACTION BUTTON (FAB) ─────────────────── */
.fab-container {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1000;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 12px;
}

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s;
}

.fab-main.active {
  transform: rotate(45deg);
  background: var(--red);
}

.fab-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s;
}

.fab-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.fab-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.fab-label {
  background: var(--card);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fab-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 1.2rem;
}

/* ── MOBILE APP LAYOUT OVERRIDES ──────────────────── */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 9998;
}

@media (max-width: 900px) {
  html, body {
    overflow-y: auto !important;
    height: auto !important;
  }
  
  #app {
    display: block !important;
    height: auto !important;
  }

  .main {
    overflow-y: visible !important;
    padding-bottom: 0;
  }

  .fab-container {
    display: flex;
  }

  /* Premium Off-Canvas Sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100dvh;
    width: 280px;
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.1);
  }

  .sidebar.mobile-open {
    transform: translateX(280px);
  }

  .mobile-overlay.active {
    display: block;
    animation: fadeUp 0.3s ease;
  }

  .sidebar-brand,
  .sidebar-section,
  .sidebar-footer {
    display: flex;
  }

  #main-nav {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
  }

  .nav-item {
    flex-direction: row;
    gap: 12px;
    padding: 12px 16px;
    margin: 4px 16px;
    font-size: 0.95rem;
    border-radius: var(--radius);
    justify-content: flex-start;
  }

  .mobile-only {
    display: flex;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
  }

  .content {
    padding: 16px;
    padding-bottom: 100px;
  }

  .topbar {
    padding: 0 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 16px 14px;
    border-radius: 10px;
  }

  .stat-value {
    font-size: 1.6rem;
    letter-spacing: -0.5px;
  }

  .stat-label {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
  }

  .stat-sub {
    font-size: 0.65rem;
  }

  .stat-icon-bg {
    width: 64px;
    height: 64px;
    right: -8px;
    bottom: -12px;
  }

  /* Mobile Data Tables → Card stack */
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }

  tr {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }

  td {
    padding: 7px 0;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
  }
  td:last-child { border-bottom: none; padding-bottom: 0; }
  td:first-child { padding-top: 0; }

  /* Show column label before each cell value */
  td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text3);
    flex-shrink: 0;
    margin-right: 12px;
  }

  /* Better tap targets for buttons */
  .btn, button, .nav-item, .card-action-btn {
    min-height: 44px;
  }

  .modal-content {
    width: 96%;
    max-height: 92vh;
    border-radius: 16px;
    padding: 20px 16px;
  }
  .modal-header { padding: 0 0 16px; }
  .modal-body { padding: 0; }
  .modal-footer { padding: 16px 0 0; }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Topbar search hidden on mobile — too cramped */
  .topbar-search { display: none; }

  /* FAB stays visible */
  .fab-container { display: flex; }

  /* Card grids */
  .tenant-grid, .units-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Chart bars smaller on mobile */
  .chart-bar-wrap { min-width: 30px; }
}


.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── MESSAGES ─────────────────────────────────────── */
.msg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color .2s;
}

.msg-card:hover {
  border-color: var(--border);
}

.msg-card.confirmation {
  border-left: 3px solid var(--green);
}

.msg-card.reminder_1 {
  border-left: 3px solid var(--gold);
}

.msg-card.reminder_2 {
  border-left: 3px solid var(--orange);
}

.msg-card.reminder_3 {
  border-left: 3px solid var(--red);
}

.msg-card.final_warning {
  border-left: 3px solid var(--red);
  background: rgba(231, 76, 60, 0.04);
}

.msg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.msg-tenant {
  font-weight: 600;
  font-size: 0.9rem;
}

.msg-time {
  font-size: 0.75rem;
  color: var(--text3);
}

.msg-subject {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 8px;
}

.msg-body {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.7;
  background: var(--card);
  padding: 12px;
  border-radius: var(--radius-sm);
  display: none;
}

.msg-body.visible {
  display: block;
}

.msg-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* ── CHART ────────────────────────────────────────── */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 10px;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  background: var(--gold-dim);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height .6s ease;
  position: relative;
  cursor: pointer;
}

.chart-bar:hover {
  background: var(--gold);
}

.chart-bar-label {
  font-size: 0.65rem;
  color: var(--text3);
  text-align: center;
}

.chart-bar-val {
  font-size: 0.65rem;
  color: var(--gold);
  text-align: center;
}

/* ── OCCUPANCY RING ───────────────────────────────── */
.occ-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 180px;
}

.occ-ring {
  position: relative;
  width: 140px;
  height: 140px;
}

.occ-ring svg {
  transform: rotate(-90deg);
}

.occ-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.occ-ring-pct {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
}

.occ-ring-sub {
  font-size: 0.7rem;
  color: var(--text3);
}

.occ-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.occ-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text2);
}

.occ-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── SETTINGS ─────────────────────────────────────── */
.settings-section {
  margin-bottom: 32px;
}

.settings-section h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── TOAST ────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  animation: slideIn .3s ease;
}

.toast.success {
  border-left: 3px solid var(--green);
}

.toast.error {
  border-left: 3px solid var(--red);
}

.toast.info {
  border-left: 3px solid var(--blue);
}

.toast-msg {
  font-size: 0.85rem;
  flex: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

/* ── PAGE HEADER ──────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
}

.page-header p {
  color: var(--text2);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* ── EMPTY STATE ──────────────────────────────────── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}

.empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty p {
  font-size: 0.9rem;
}

/* ── SCROLLBAR ────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text3);
}

/* ── DIVIDER ──────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── REPORT ───────────────────────────────────────── */
.report-header {
  background: linear-gradient(135deg, var(--gold-dim), transparent);
  border: 1px solid rgba(201, 151, 58, 0.2);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.report-header h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--gold);
}

.report-stats {
  display: flex;
  gap: 32px;
  margin-top: 14px;
}

.r-stat span {
  display: block;
  font-size: 0.7rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.r-stat strong {
  font-size: 1.2rem;
  font-weight: 700;
}

/* ── UNIT CARD ACTION BUTTONS ─────────────────────── */
.unit-card {
  position: relative;
}

.unit-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.unit-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card2);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
}

.unit-action-btn:hover {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: var(--gold);
}

.unit-action-del:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red);
}

/* ── CONFIRM DIALOG (native override hint) ────────── */
.btn-red {
  background: var(--red);
  color: #fff;
  border: none;
}

.btn-red:hover {
  background: #b91c1c;
}

/* ── HELP PAGE ────────────────────────────────────── */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.help-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.help-card:hover {
  box-shadow: 0 4px 20px rgba(27, 63, 171, 0.1);
  border-color: var(--gold);
}

.help-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.help-card-header svg {
  stroke: var(--gold);
  flex-shrink: 0;
}

.help-card-header h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.2px;
}

.help-steps, .help-list {
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.help-steps li {
  display: flex;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.5;
  counter-increment: step-counter;
}

.help-steps {
  counter-reset: step-counter;
}

.help-steps li::before {
  content: counter(step-counter);
  min-width: 24px;
  height: 24px;
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.help-list li {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.5;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  transition: border-color 0.2s;
}

.help-list li:hover {
  border-left-color: var(--gold);
}

.help-list li strong {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 900px) {
  .help-grid {
    grid-template-columns: 1fr;
  }
}