/* === RENTALVESTOR â€“ Fonts & Colors Refresh (Blueâ€“Teal) === */

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif; /* modern, clean */
  background: #f7fafc; /* softer background */
  color: #1e2a44;      /* professional text */
  overflow-x: hidden;
}

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

/* Navbar */
nav {
  background: linear-gradient(90deg, #0f68a9 0%, #21b6a8 100%);
  padding: 20px 20px;
  box-shadow: 0 2px 12px rgba(15,104,169,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  position: relative;
}

/* Mobile menu toggle button - HIDDEN on desktop by default */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 5px 10px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 101;
}

.nav-toggle:hover {
  opacity: 0.8;
}

.nav-link {
  text-decoration: none;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  padding: 10px 20px;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  border-radius: 8px;
  position: relative;
}

nav a {
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  padding: 10px 20px;
  border-radius: 8px;
}

/* active tab uses mint highlight instead of gold */
nav a.active {
  background-color: rgba(162, 255, 227, 0.2);
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 700;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Hero */
.hero {
  background: linear-gradient(rgba(15,104,169,0.85), rgba(33,182,168,0.85)),
    url('https://images.unsplash.com/photo-1502672023488-70e25813eb80?ixlib=rb-4.0.3&auto=format&fit=crop&w=1350&q=80');
  background-size: cover;
  background-position: center;
  color: #ffffff;
  text-align: center;
  padding: 80px 20px;
}

.hero h1 {
  font-size: 42px;
  margin-bottom: 10px;
  font-weight: 800;        /* crisper headline */
}

.hero p {
  font-size: 20px;
  opacity: 0.95;
}

/* Sections */
.calculator-section {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

.calculator-section h2 {
  text-align: center;
  color: #0f68a9; /* primary blue */
  margin-bottom: 20px;
  font-weight: 800;
}

/* Card */
.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 25px;
  box-sizing: border-box;
}

/* Form */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.field {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
}

.field label {
  font-weight: 700;
  margin-bottom: 5px;
  color: #24324d;
}

.field input {
  padding: 8px;
  border: 1px solid #cfd8e3;  /* softer border */
  border-radius: 6px;
  font-size: 14px;
}

.field input:focus {
  border-color: #21b6a8;               /* teal focus */
  outline: none;
  box-shadow: 0 0 6px rgba(33,182,168,0.3);
}

/* Buttons */
.button-row {
  text-align: center;
}

button {
  background: linear-gradient(90deg, #0f68a9 0%, #21b6a8 100%); /* blue â†’ teal */
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s;
}

button:hover {
  background: linear-gradient(90deg, #0d5e98 0%, #1ea799 100%); /* darker on hover */
  box-shadow: 0 4px 14px rgba(33,182,168,0.28);
}

.result {
  text-align: center;
  margin-top: 20px;
  color: #0f68a9; /* blue accent */
  font-weight: 800;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  background: #f0f4f9;
  color: #4b5563;
  margin-top: 40px;
}

/* Chatbot Section */
#chatbot {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 20px;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 300px;
}

#chat-box {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #1e2a44;
}

#chat-input {
  display: flex;
  gap: 8px;
}

#chat-input input {
  flex: 1;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  padding: 10px;
}

#chat-input input:focus {
  border-color: #21b6a8;
  outline: none;
  box-shadow: 0 0 6px rgba(33,182,168,0.3);
}

#chat-input button {
  background: linear-gradient(90deg, #0f68a9 0%, #21b6a8 100%);
  color: #ffffff;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

#chat-input button:hover {
  background: linear-gradient(90deg, #0d5e98 0%, #1ea799 100%);
}

iframe {
  min-height: 400px;
  max-height: 500px;
}

html {
  scroll-behavior: smooth;
}

/* Make sure sections aren't hidden under the sticky navbar */
section {
  scroll-margin-top: 120px;
}

/* NAVBAR FIX */
nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 0;
  margin: 0;
}

nav ul li { margin: 0; padding: 0; }

nav ul li a {
  text-decoration: none;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  padding: 10px 20px;
  border-radius: 8px;
}

nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateY(-1px);
}

.navbar a {
  text-decoration: none;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.auth-form input {
  padding: 10px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  margin-right: 8px;
  margin-bottom: 8px;
}

.auth-form input:focus {
  border-color: #21b6a8;
  outline: none;
  box-shadow: 0 0 6px rgba(33,182,168,0.3);
}

/* ===== Dashboard Layout ===== */
.page {
  max-width: 1100px;
  margin: 32px auto 60px;
  padding: 0 20px;
}

.page-header {
  margin-bottom: 40px;
  padding: 24px 0;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, #0f68a9, #21b6a8, transparent) 1;
}

.page-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 48px;
  margin: 0 0 12px;
  background: linear-gradient(135deg, #0f68a9 0%, #21b6a8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page-header .muted {
  color: #64748b;
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Account Widget */
.account-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 0;
}

.account-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f7fafc;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #e5e9f5;
}

.user-email {
  color: #0f68a9;
  font-weight: 600;
  font-size: 14px;
}

.account-buttons {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* Auth Modal */
.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal-content {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(16, 24, 40, .18);
  padding: 24px;
  width: 100%;
  max-width: 450px;
  border: 1px solid #eef0f5;
}

/* ===== Cards ===== */
.card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  padding: 22px;
  margin-bottom: 22px;
  border: 1px solid #eef0f5;
}

.card-title {
  font-size: 22px;
  margin: 0 0 12px;
  color: #0f68a9; /* primary blue */
  font-weight: 800;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===== Forms / Inputs / Buttons ===== */
.row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.input {
  grid-column: span 4;
  padding: 12px 14px;
  border: 1px solid #d9dee8;
  border-radius: 10px;
  background: #fbfcfe;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  color: #1e2a44;
}

.input:focus {
  border-color: #0f68a9;
  box-shadow: 0 0 0 3px rgba(15,104,169,.14);
}

.btn-row { display: flex; gap: 10px; margin: 10px 0 4px; }

.btn {
  background: linear-gradient(90deg, #0f68a9 0%, #21b6a8 100%);
  color: #ffffff;
  border: 0;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: background .25s ease;
}
.btn:hover { background: linear-gradient(90deg, #0d5e98 0%, #1ea799 100%); }
.btn:active { transform: translateY(1px); }

.btn-outline {
  background: #ffffff;
  color: #0f68a9;
  border: 2px solid #0f68a9;
}
.btn-outline:hover { background: #eef8fb; }

.btn-ghost {
  background: transparent;
  color: #0f68a9;
  border: 1px solid #dbe1f1;
}
.btn-ghost:hover { background: #f5f7fd; }

.auth-form .btn { grid-column: span 3; }
.auth-form .input { grid-column: span 4; }

.status { margin-top: 8px; color: #0f68a9; font-weight: 700; }

/* ===== Table ===== */
.table-wrap { width: 100%; overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
}

.table thead th {
  text-align: left;
  background: #f6f8fc;
  color: #374151;
  font-weight: 800;
  padding: 12px 14px;
  border-bottom: 1px solid #e9edf5;
}

.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef1f7;
  color: #1e2a44;
}

.table tbody tr:hover {
  background: #f9fbff;
}

/* Footer spacing on dashboard */
.site-footer {
  text-align: center;
  padding: 28px 20px;
  color: #6b7280;
  background: #f0f4f9;
  margin-top: 32px;
}

/* ---- nicer destructive button (Logout) ---- */
.btn-danger { background: #c92c2c; color:#fff; }
.btn-danger:hover { background:#aa2222; }

/* ---- modal ---- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(15, 23, 42, 0.5);
  z-index: 2000;
  padding: 20px;
  overflow-y: auto;
}
.modal[aria-hidden="false"] { display: flex; align-items: flex-start; justify-content: center; }

.modal-content {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(16, 24, 40, .18);
  padding: 18px;
  width: 100%;
  max-width: 720px;
  border: 1px solid #eef0f5;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content.wide { 
  max-width: 980px;
}

.modal-head, .modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.modal-head h3 { margin: 6px 0 12px; }
.modal-foot { margin-top: 12px; }
.modal-foot-buttons {
  display: flex;
  gap: 10px;
}
.save-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #059669;
}
.save-state.hidden {
  display: none !important;
}
.save-state .save-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #059669;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}
.save-state.dirty {
  color: #c92c2c;
}
.save-state.dirty .save-icon {
  display: none;
}

.icon-btn {
  background: transparent;
  color: #0f172a;
  border: 0;
  font-size: 18px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.icon-btn:hover { background: #f3f5fb; }

.card.light { background:#fbfcfe; }

/* compact table for expenses */
.table.compact thead th, .table.compact tbody td { padding: 8px 10px; }

.checkbox-wrap {
  display: flex; align-items: center; gap: 8px; padding: 8px 6px;
}

.unsaved-modal {
  z-index: 3000;
  align-items: center;
}
.unsaved-modal .modal-content {
  max-width: 420px;
  text-align: left;
}

.table-check {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* monthly totals line */
.summary {
  display: flex; gap: 24px; padding: 10px 0; font-size: 16px;
}
.summary span { font-weight: 800; color:#0f68a9; }

/* Month status pill */
.pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e6f7fb; /* soft blue pill */
  color: #0f5177;
  font-weight: 800;
}
.pill.green {
  background: #d1fae5; /* green complete */
  color: #065f46;
}

/* Dashboard preview â€“ polished band */
#dashboard-preview{
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 48px 28px;
  background: linear-gradient(180deg, rgba(15,104,169,0.15) 0%, rgba(33,182,168,0.15) 100%);
  border: 1px solid #e3eef6;
  box-shadow: 0 8px 24px rgba(15,104,169,0.08);
  animation: colorFade 10s ease-in-out infinite;
}

/* subtle ambient glow corners */
#dashboard-preview::before{
  content:"";
  position:absolute;
  inset:-1px;
  background:
    radial-gradient(1200px 300px at 8% -12%, rgba(15,104,169,0.12), transparent 60%),
    radial-gradient(1000px 260px at 108% -18%, rgba(33,182,168,0.12), transparent 60%);
  pointer-events:none;
}

#dashboard-preview h2{
  color:#0f68a9;
  margin-bottom: 12px;
  font-weight: 800;
}

#dashboard-preview p{
  color:#334155;
  font-size: 17px;
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto 22px;
}

/* CTA button stays brand-consistent */
#dashboard-preview .btn{
  background: linear-gradient(90deg, #0f68a9 0%, #21b6a8 100%);
  color:#fff;
  border:none;
  padding:12px 26px;
  font-weight:700;
  border-radius:10px;
  cursor:pointer;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
}

#dashboard-preview .btn:hover{
  transform: translateY(-2px);
  background: linear-gradient(90deg, #0d5e98 0%, #1ea799 100%);
  box-shadow:0 6px 18px rgba(33,182,168,.25);
}

/* === Tenant Portal Section styled like dashboard === */
#tenant-preview {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 48px 28px;
  background: linear-gradient(180deg, rgba(15,104,169,0.15) 0%, rgba(33,182,168,0.15) 100%);
  border: 1px solid #e3eef6;
  box-shadow: 0 8px 24px rgba(15,104,169,0.08);
  animation: colorFade 10s ease-in-out infinite;
}

#tenant-preview::before{
  content:"";
  position:absolute;
  inset:-1px;
  background:
    radial-gradient(1200px 300px at 8% -12%, rgba(15,104,169,0.12), transparent 60%),
    radial-gradient(1000px 260px at 108% -18%, rgba(33,182,168,0.12), transparent 60%);
  pointer-events:none;
  z-index: 0;
}

#tenant-preview h2{
  position: relative;
  z-index: 1;
  color:#0f68a9;
  margin-bottom: 12px;
  font-weight: 800;
}

#tenant-preview p{
  position: relative;
  z-index: 1;
  color:#334155;
  font-size: 17px;
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto 22px;
}

#tenant-preview .btn{
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, #0f68a9 0%, #21b6a8 100%);
  color:#fff;
  border:none;
  padding:12px 26px;
  font-weight:700;
  border-radius:10px;
  cursor:pointer;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
}

#tenant-preview .btn:hover{
  transform: translateY(-2px);
  background: linear-gradient(90deg, #0d5e98 0%, #1ea799 100%);
  box-shadow:0 6px 18px rgba(33,182,168,.25);
}

/* === ROE & CAP Rate sections styled like dashboard === */
#roe, #caprate {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 60px 30px;
  background: linear-gradient(180deg, rgba(15,104,169,0.15) 0%, rgba(33,182,168,0.15) 100%);
  border: 1px solid #e3eef6;
  box-shadow: 0 8px 24px rgba(15,104,169,0.08);
  margin-bottom: 80px;
  animation: colorFade 10s ease-in-out infinite;
}

@keyframes colorFade {
  0%, 100% {
    background: linear-gradient(180deg, rgba(15,104,169,0.15) 0%, rgba(33,182,168,0.15) 100%);
  }
  25% {
    background: linear-gradient(180deg, rgba(33,182,168,0.15) 0%, rgba(162,255,227,0.15) 100%);
  }
  50% {
    background: linear-gradient(180deg, rgba(162,255,227,0.15) 0%, rgba(15,104,169,0.15) 100%);
  }
  75% {
    background: linear-gradient(180deg, rgba(33,182,168,0.15) 0%, rgba(15,104,169,0.15) 100%);
  }
}

/* gradient glows at corners */
#roe::before, #caprate::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    radial-gradient(1200px 300px at 8% -12%, rgba(15,104,169,0.12), transparent 60%),
    radial-gradient(1000px 260px at 108% -18%, rgba(33,182,168,0.12), transparent 60%);
  pointer-events: none;
}

/* Section titles and description */
#roe h2, #caprate h2 {
  color: #0f68a9;
  text-align: center;
  font-weight: 800;
  margin-bottom: 10px;
}

#roe .section-desc, #caprate .section-desc {
  text-align: center;
  color: #334155;
  font-size: 17px;
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto 25px;
}

/* Modernized calculator cards */
#roe .card, #caprate .card {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid #e3eef6;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  padding: 35px;
  max-width: 900px;
  margin: 0 auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#roe .card:hover, #caprate .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(15,104,169,0.1);
}

/* Form fields unified with dashboard tone */
#roe input, #caprate input {
  border: 1px solid #d9e3ed;
  border-radius: 8px;
  padding: 10px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#roe input:focus, #caprate input:focus {
  border-color: #21b6a8;
  box-shadow: 0 0 6px rgba(33,182,168,0.3);
  outline: none;
}

/* Buttons */
#roe button, #caprate button {
  background: linear-gradient(90deg, #0f68a9 0%, #21b6a8 100%);
  color: #fff;
  border: none;
  padding: 12px 26px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
}

#roe button:hover, #caprate button:hover {
  transform: translateY(-2px);
  background: linear-gradient(90deg, #0d5e98 0%, #1ea799 100%);
  box-shadow: 0 6px 18px rgba(33,182,168,.25);
}

/* Calculation results */
#roeResult, #capRateResult {
  color: #0f68a9;
  font-weight: 800;
  margin-top: 20px;
  text-align: center;
}

/* === Chatbot & Valuator Sections - Match Calculator Style === */
#chatbot-section {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 60px 30px;
  background: linear-gradient(180deg, rgba(15,104,169,0.15) 0%, rgba(33,182,168,0.15) 100%);
  border: 1px solid #e3eef6;
  box-shadow: 0 8px 24px rgba(15,104,169,0.08);
  margin-bottom: 80px;
  animation: colorFade 10s ease-in-out infinite;
}

/* gradient glows at corners */
#chatbot-section::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    radial-gradient(1200px 300px at 8% -12%, rgba(15,104,169,0.12), transparent 60%),
    radial-gradient(1000px 260px at 108% -18%, rgba(33,182,168,0.12), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#chatbot-section h2 {
  position: relative;
  z-index: 1;
  color: #0f68a9;
  text-align: center;
  font-weight: 800;
  margin-bottom: 10px;
}

#chatbot-section p {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #334155;
  font-size: 17px;
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto 25px;
}

#chatbot-section iframe {
  position: relative;
  z-index: 1;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 900px) {
  /* Navigation - Show hamburger on medium screens too */
  .nav-toggle {
    display: block;
  }
  
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  
  .nav-container.mobile-open {
    align-items: stretch;
    gap: 8px;
  }
  
  /* Hide nav links by default */
  .nav-container:not(.mobile-open) .nav-link {
    display: none;
  }
  
  /* Show nav links when menu is open */
  .nav-container.mobile-open .nav-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    margin: 0;
  }
  
  /* Only apply to auth forms, not all rows */
  .auth-form .input { grid-column: span 12; }
  .auth-form .btn   { grid-column: span 12; }
  
  /* Only apply to main property form, not modal forms */
  #propertyForm .input { grid-column: span 12; }
}

@media (max-width: 768px) {
  /* Navigation - Hamburger Menu */
  .nav-toggle {
    display: block;
  }
  
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  
  .nav-container.mobile-open {
    align-items: stretch;
    gap: 8px;
  }
  
  /* Hide nav links by default on mobile */
  .nav-container:not(.mobile-open) .nav-link {
    display: none;
  }
  
  /* Show nav links when menu is open */
  .nav-container.mobile-open .nav-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    margin: 0;
  }
  
  /* Hero */
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  
  /* Page header - stack on mobile */
  .page-header-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .account-widget {
    align-items: stretch;
  }
  
  .account-info {
    justify-content: space-between;
  }
  
  .account-buttons {
    justify-content: stretch;
  }
  
  .account-buttons .btn-sm {
    flex: 1;
  }
  
  /* NO MODAL STYLES - Use desktop modal styles on mobile! */
  
  /* Page cards outside modal */
  .page > .card {
    padding: 15px;
  }
  
  .page > .card .card-title {
    font-size: 18px;
  }
  
  /* Page header */
  .page-header h1 {
    font-size: 36px;
    letter-spacing: -0.01em;
  }
  
  .page-header .muted {
    font-size: 16px;
  }
  
  /* Manage Month Modal Mobile Optimization */
  #monthModal .modal-content {
    padding: 16px;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  #monthModal .card.light {
    padding: 14px;
    margin-bottom: 12px;
  }
  
  #monthModal h4 {
    font-size: 16px !important;
    margin: 0 0 12px;
  }
  
  #monthModal .row {
    gap: 10px !important;
  }
  
  /* Stack month/year selectors vertically */
  #monthModal .row > div[style*="grid-column:span 6"],
  #monthModal .row > div[style*="grid-column:span 4"],
  #monthModal .row > div[style*="grid-column:span 2"] {
    grid-column: span 12 !important;
  }
  
  /* Status pill on its own line */
  #monthModal .pill {
    margin-top: 8px;
    display: block;
    width: fit-content;
  }
  
  #monthModal label {
    font-size: 13px !important;
    margin-bottom: 4px !important;
  }
  
  #monthModal .input {
    padding: 10px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Revenue section - stack checkbox */
  #monthModal .checkbox-wrap {
    padding: 10px 0;
    margin-top: 8px;
  }
  
  /* Expense table mobile optimization */
  #monthModal .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  #monthModal .table.compact {
    font-size: 14px;
  }
  
  #monthModal .table.compact thead th,
  #monthModal .table.compact tbody td {
    padding: 6px 8px;
    font-size: 13px;
  }
  
  #monthModal .table.compact input.input {
    padding: 6px 8px;
    font-size: 14px;
  }
  
  #monthModal .table.compact .table-check {
    width: 16px;
    height: 16px;
  }
  
  /* Summary section - stack vertically */
  #monthModal .summary {
    flex-direction: column;
    gap: 8px !important;
    font-size: 15px;
    padding: 12px 0;
  }
  
  #monthModal .summary > div {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
  }
  
  /* Modal footer buttons */
  #monthModal .modal-foot {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }
  
  #monthModal .modal-foot-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  #monthModal .modal-foot-buttons button {
    width: 100%;
  }
  
  #monthModal .save-state {
    order: -1;
    justify-content: center;
    margin-bottom: 8px;
  }
  
  /* Add Expense button */
  #addExpenseRow {
    font-size: 14px;
    padding: 8px 14px;
    width: 100%;
  }
  
  /* Tenant Modal Mobile Optimization */
  #tenantModal .modal-content {
    padding: 16px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  #tenantModal .card.light {
    padding: 14px;
    margin-bottom: 12px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  #tenantModal h4 {
    font-size: 16px !important;
  }
  
  #tenantModal .row {
    gap: 10px !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  #tenantModal .row > div[style*="grid-column:span 6"] {
    grid-column: span 12 !important;
  }
  
  #tenantModal label {
    font-size: 13px !important;
    margin-bottom: 4px !important;
  }
  
  #tenantModal .input {
    padding: 10px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 44px; /* Better touch target */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  #tenantModal input[type="date"] {
    font-size: 16px !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  #tenantModal textarea.input {
    font-size: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Ensure all input containers don't overflow */
  #tenantModal .row > div {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  #addTenantBtn {
    font-size: 14px;
    padding: 10px 16px;
  }
  
  /* Make date inputs full width on mobile */
  #tenantModal input[type="date"] {
    width: 100%;
  }
  
  /* Tenant card headers */
  #tenantModal .card.light > div:first-child {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* Button containers in modal */
  #tenantModal form > div[style*="display:flex"] {
    flex-direction: column;
  }
  
  #tenantModal form > div[style*="display:flex"] button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #monthModal .modal-content,
  #tenantModal .modal-content {
    padding: 12px;
  }
  
  #monthModal .card.light,
  #tenantModal .card.light {
    padding: 12px;
  }
  
  .modal-head h3 {
    font-size: 20px;
  }
  
  #monthModal .summary {
    font-size: 14px;
  }
  
  #monthModal .table.compact {
    font-size: 13px;
  }
}

/* ===== CHECKMARK ANIMATION ===== */
@keyframes checkmarkPop {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Success button state */
.btn-success {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%) !important;
  animation: successPulse 0.5s ease;
}

@keyframes successPulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
  }
  50% {
    box-shadow: 0 6px 24px rgba(5, 150, 105, 0.5);
  }
}

/* ===== TENANT DASHBOARD STYLES ===== */
.tenant-login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}

.tenant-login-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(15, 104, 169, 0.12);
  padding: 40px;
  max-width: 450px;
  width: 100%;
}

.tenant-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.info-item {
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.info-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 16px;
  color: #1e2a44;
  font-weight: 600;
}

.payment-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.payment-item {
  padding: 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  text-align: center;
}

.payment-label {
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payment-value {
  font-size: 32px;
  color: #1e2a44;
  font-weight: 800;
}

.payment-value.balance {
  color: #0f68a9;
}

@media (max-width: 768px) {
  .tenant-login-card {
    padding: 30px 20px;
  }
  
  .tenant-info-grid,
  .payment-info-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .payment-value {
    font-size: 28px;
  }
  
  .info-item {
    padding: 14px;
  }
  
  .payment-item {
    padding: 20px;
  }
}
/* ========================================
   TENANT PORTAL STYLES
   ======================================== */

.tenant-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.info-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.info-card:hover {
  box-shadow: 0 4px 12px rgba(15,104,169,0.1);
  transform: translateY(-2px);
}

.info-card.highlight {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0f68a9;
}

.info-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f68a9;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: #64748b;
  font-size: 14px;
  flex-shrink: 0;
  margin-right: 12px;
}

.info-value {
  font-weight: 500;
  color: #1e2a44;
  font-size: 15px;
  text-align: right;
  word-break: break-word;
}

.balance-amount {
  font-size: 24px;
  font-weight: 700;
}

.info-notes {
  color: #475569;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

/* Mobile Responsive for Tenant Portal */
@media (max-width: 768px) {
  .tenant-info-grid {
    grid-template-columns: 1fr;
  }
  
  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .info-value {
    text-align: left;
  }
  
  .balance-amount {
    font-size: 20px;
  }
  
  /* Tenant page improvements for tablets */
  .tenant-hero h1 {
    font-size: 32px;
  }
  
  .tenant-hero p {
    font-size: 16px;
  }
  
  .tenant-auth-card,
  .tenant-code-card,
  .tenant-info {
    padding: 24px;
  }
}

/* ===== New Tenant Page Layout ===== */
.tenant-page {
  max-width: 960px;
  margin: 40px auto 80px;
  padding: 0 20px;
}

.tenant-hero {
  text-align: center;
  margin-bottom: 30px;
}

.tenant-hero h1 {
  font-size: 36px;
  margin-bottom: 8px;
  color: #0f172a;
}

.tenant-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(15, 104, 169, 0.08);
  color: #0f68a9;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
}

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

.tenant-auth-forms {
  display: grid;
  gap: 14px;
}

.tenant-auth-forms .auth-form {
  display: grid;
  gap: 12px;
}

.btn-full {
  width: 100%;
}

.tenant-code-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tenant-code-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tenant-code-form .input {
  flex: 1 1 260px;
  min-width: 220px;
  max-height: 48px;
  height: 48px;
}

.tenant-info {
  padding: 28px;
}

.tenant-info-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.tenant-address {
  font-size: 16px;
  font-weight: 600;
  margin: 6px 0;
}

.tenant-pill {
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(15, 104, 169, 0.12);
  color: #0f68a9;
  height: fit-content;
}
.tenant-pill.paid {
  background: rgba(5, 150, 105, 0.16);
  color: #047857;
}

.tenant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.tenant-stat {
  background: #f8fbff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid #e4e9f5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.tenant-stat span {
  font-size: 13px;
  color: #6b7280;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tenant-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 32px;
  color: #0f172a;
}

.tenant-stat small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
}

.tenant-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  color: #1e293b;
}

.tenant-meta strong {
  color: #0f68a9;
}

.status.error { color: #c92c2c; }
.status.success { color: #059669; }

@media (max-width: 640px) {
  /* Tenant page mobile improvements */
  .tenant-page {
    padding: 0 12px;
    margin: 20px auto 40px;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .tenant-hero {
    margin-bottom: 24px;
    padding: 0;
  }
  
  .tenant-hero h1 {
    font-size: 28px;
    line-height: 1.2;
  }
  
  .tenant-hero p {
    font-size: 15px;
    line-height: 1.5;
  }
  
  .tenant-auth-card,
  .tenant-code-card,
  .tenant-info {
    padding: 18px;
    box-sizing: border-box;
  }
  
  .tenant-auth-card .tenant-auth-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .account-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
  }
  
  .account-buttons .btn {
    flex: 1;
    max-width: 200px;
  }
  
  .tenant-code-card {
    padding: 20px;
  }
  
  .tenant-code-form {
    flex-direction: column;
  }
  
  .tenant-code-form .input {
    width: 100%;
    height: 48px;
    max-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .tenant-code-form .btn {
    width: 100%;
    padding: 14px 20px;
  }
  
  .tenant-info {
    padding: 20px;
  }
  
  .tenant-info-head {
    flex-direction: column;
    gap: 16px;
  }
  
  .tenant-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .tenant-stat {
    padding: 16px;
  }
  
  .tenant-stat strong {
    font-size: 28px;
  }
  
  .tenant-pill {
    width: 100%;
    text-align: center;
  }
  
  .tenant-meta {
    font-size: 14px;
  }
  
  /* Make inputs bigger on mobile to prevent zoom */
  .tenant-auth-forms .input {
    font-size: 16px;
    padding: 14px;
  }
  
  .tenant-auth-forms .btn {
    padding: 14px;
  }
}