/* ==========================================================================
   ReserveEase SG - Single Master Stylesheet
   Pieter Levels Style: Pure vanilla CSS, zero preprocessors, zero build step,
   ultra-fast, responsive, modern SaaS design for Mobile (Portrait & Landscape) & Desktop.
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-focus: #6366f1;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-text: #3730a3;

  --success: #059669;
  --success-light: #ecfdf5;
  --success-text: #065f46;
  --success-border: #a7f3d0;

  --warning: #d97706;
  --warning-light: #fffbeb;
  --warning-text: #92400e;
  --warning-border: #fde68a;

  --danger: #e11d48;
  --danger-light: #fff1f2;
  --danger-text: #9f1239;
  --danger-border: #fecdd3;

  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --purple-text: #5b21b6;

  --blue: #2563eb;
  --blue-light: #eff6ff;
  --blue-text: #1e40af;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

main.container {
  flex: 1;
  padding-top: 18px;
  padding-bottom: 48px;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text-main);
  font-weight: 800;
  letter-spacing: -0.025em;
}

h1 { font-size: 1.6rem; line-height: 1.25; }
h2 { font-size: 1.25rem; line-height: 1.3; }
h3 { font-size: 1.1rem; line-height: 1.35; }
p { color: var(--text-muted); font-size: 0.9rem; }

@media (min-width: 768px) {
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.45rem; }
  h3 { font-size: 1.2rem; }
  p { font-size: 0.95rem; }
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover {
  color: var(--primary-hover);
}

/* Top Navigation Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: relative;
}

@media (min-width: 768px) {
  .header-inner {
    height: 64px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.brand-badge {
  font-size: 0.6rem;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: 2px;
  border: 1px solid var(--border-color);
}

/* Mobile Hamburger Button */
.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
  z-index: 60;
  transition: all 0.2s ease;
}

.hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-btn.open .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.open .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.open .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Navigation Container (Desktop inline, Mobile dropdown drawer) */
.nav-container {
  display: none;
}

.nav-links {
  list-style: none;
  display: flex;
}

/* Mobile Menu Opened State */
@media (max-width: 960px) {
  .nav-container.open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    padding: 12px 16px 20px;
    z-index: 55;
    animation: slideDown 0.2s ease-out;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .nav-links {
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    border-radius: var(--radius-md);
    background: #f8fafc;
    min-height: 44px;
  }

  .nav-link.active {
    background: var(--primary-light);
    color: var(--primary-text);
    font-weight: 700;
  }

  .nav-btn-item {
    margin-top: 8px;
  }

  .btn-nav {
    display: flex !important;
    justify-content: center;
    width: 100%;
    margin-left: 0 !important;
    padding: 12px !important;
    font-size: 0.95rem !important;
    min-height: 44px;
  }
}

/* Desktop Navigation */
@media (min-width: 961px) {
  .mobile-menu-btn {
    display: none;
  }

  .nav-container {
    display: block;
  }

  .nav-links {
    align-items: center;
    gap: 6px;
  }

  .nav-link {
    padding: 7px 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.15s;
  }

  .nav-link:hover {
    background: var(--bg-card-subtle);
    color: var(--text-main);
  }

  .nav-link.active {
    background: var(--primary-light);
    color: var(--primary-text);
    font-weight: 700;
  }

  .btn-nav {
    margin-left: 8px;
    background: var(--primary);
    color: #ffffff !important;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
  }
  .btn-nav:hover {
    background: var(--primary-hover);
  }
}

/* Page Header Box */
.page-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .page-hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
  }
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: #dc2626;
  border-radius: 50%;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

/* 5th KPI card spans full row on 2-column mobile portrait */
@media (max-width: 639px) {
  .kpi-grid > .kpi-card:nth-child(5) {
    grid-column: span 2;
  }
}

@media (min-width: 640px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (min-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 24px;
  }
}

/* Landscape Mode for KPI cards (Short height screens) */
@media (orientation: landscape) and (max-height: 520px) {
  .kpi-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }
  .kpi-card {
    padding: 10px 12px !important;
  }
  .kpi-value {
    font-size: 1.25rem !important;
  }
}

/* Responsive 3-card KPI grid */
.kpi-grid-3 {
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .kpi-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .kpi-card {
    padding: 16px;
  }
}

.kpi-title {
  font-size: 0.725rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

@media (min-width: 768px) {
  .kpi-value {
    font-size: 1.65rem;
    margin-top: 6px;
  }
}

.kpi-sub {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* Alert Banners */
.alert-banner {
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
}

@media (min-width: 640px) {
  .alert-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.alert-danger {
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.alert-success {
  background: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

/* Room Grid & Filters Bar */
.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

@media (min-width: 768px) {
  .filters-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Swipeable horizontal filter pills on mobile */
.filter-pills {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 6px;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.filter-pills::-webkit-scrollbar {
  display: none;
}

@media (min-width: 768px) {
  .filter-pills {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }
}

.filter-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.search-box {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 16px; /* Prevents mobile iOS zoom */
  outline: none;
  background: #ffffff;
  min-height: 42px;
}

@media (min-width: 768px) {
  .search-box {
    width: auto;
    min-width: 240px;
    font-size: 0.85rem;
  }
}

.search-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.room-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 640px) {
  .room-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

.room-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.room-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.room-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  background: #e2e8f0;
  overflow: hidden;
}

.room-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.room-card:hover .room-image {
  transform: scale(1.03);
}

.room-image-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.room-card-content {
  padding: 16px 16px 8px 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.room-unit-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.room-address {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 2px;
}

.room-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.badge {
  font-size: 0.675rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-master { background: var(--purple-light); color: var(--purple-text); }
.badge-common { background: var(--blue-light); color: var(--blue-text); }
.badge-available { background: var(--success-light); color: var(--success-text); }
.badge-occupied { background: var(--warning-light); color: var(--warning-text); }
.badge-overdue { background: var(--danger-light); color: var(--danger-text); }

.room-amenities {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  line-height: 1.4;
}

.room-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 12px 16px 16px 16px;
  border-top: 1px solid var(--border-color);
}

.room-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}
.room-price span {
  font-size: 0.725rem;
  color: var(--text-light);
  font-weight: normal;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  min-height: 42px;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.btn-secondary:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}
.btn-success:hover {
  background: #047857;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: #be123c;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
  min-height: 34px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
  min-height: 48px;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* Forms & Inputs */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  max-width: 720px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .form-card {
    padding: 24px;
  }
}

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

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.725rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Set input/select/textarea font-size: 16px on mobile to prevent iOS zoom */
.form-control,
input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px; /* 16px eliminates iOS zoom bug */
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

@media (min-width: 768px) {
  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="date"],
  select,
  textarea {
    font-size: 0.9rem;
  }
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

/* Preset Duration Buttons */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
@media (min-width: 640px) {
  .preset-grid { grid-template-columns: repeat(4, 1fr); }
}

.preset-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 10px 8px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.preset-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-text);
  font-weight: 700;
}

/* Tables */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
  position: relative;
}

.table-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .table-header {
    padding: 16px 20px;
  }
}

/* Mobile swipe hint */
.table-hint-mobile {
  display: block;
  padding: 6px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.7rem;
  color: var(--text-light);
  font-weight: 600;
}
@media (min-width: 768px) {
  .table-hint-mobile {
    display: none;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
  min-width: 600px; /* Ensures table remains readable with touch scroll */
}

th {
  background: #f8fafc;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

@media (min-width: 768px) {
  th { padding: 12px 16px; font-size: 0.725rem; }
  td { padding: 14px 16px; }
}

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

tr:hover td {
  background-color: #f8fafc;
}

/* Responsive Modal (Portrait & Landscape Mobile) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 12px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: auto;
  box-shadow: var(--shadow-xl);
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-paynow {
  background: linear-gradient(135deg, #6b21a8, #4338ca);
  color: #ffffff;
  padding: 18px 20px;
  text-align: center;
}

.modal-body {
  padding: 18px 20px;
}

/* PayNow QR Graphic */
.paynow-qr-box {
  background: #f8fafc;
  border: 2px dashed #c084fc;
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  margin-bottom: 14px;
}

.qr-visual {
  width: 110px;
  height: 110px;
  margin: 0 auto;
  background: #0f172a;
  border-radius: 8px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.qr-row {
  display: flex;
  justify-content: space-between;
}

.qr-target {
  width: 26px;
  height: 26px;
  background: #ffffff;
  border-radius: 4px;
  padding: 3px;
}

.qr-target-inner {
  width: 100%;
  height: 100%;
  background: #7c3aed;
  border-radius: 2px;
}

.qr-center-text {
  color: #ffffff;
  font-family: monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.invoice-summary {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.8rem;
  margin-bottom: 14px;
}

.invoice-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.invoice-row.total {
  border-top: 1px solid var(--border-color);
  padding-top: 6px;
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Special Landscape Mobile Optimization for Modal */
@media (orientation: landscape) and (max-height: 520px) {
  .modal-backdrop {
    align-items: flex-start;
    padding: 8px;
  }
  .modal-box {
    max-width: 580px;
    max-height: 96vh;
  }
  .modal-header-paynow {
    padding: 10px 16px;
  }
  .modal-body {
    padding: 12px 16px;
  }
  .paynow-qr-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: left;
    padding: 8px 12px;
    margin-bottom: 10px;
  }
  .paynow-qr-box .qr-visual {
    width: 80px;
    height: 80px;
    margin: 0;
    flex-shrink: 0;
  }
  .invoice-summary {
    padding: 8px 12px;
    margin-bottom: 10px;
  }
}

/* Responsive Grid for Units & Tenants */
.responsive-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .responsive-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 20px;
  }
}

/* Footer */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 20px 0;
  font-size: 0.775rem;
  color: var(--text-light);
  text-align: center;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-mono { font-family: monospace; }
.text-emerald { color: var(--success); }
.text-rose { color: var(--danger); }
.text-indigo { color: var(--primary); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.d-none { display: none; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ==========================================================================
   HOMEPAGE REDESIGN: SEARCH WIDGET, LOAD MORE & ACCORDIONS
   ========================================================================== */

.search-widget {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 28px;
}

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

@media (min-width: 640px) {
  .search-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .search-grid {
    grid-template-columns: 1.1fr 1.6fr 1.3fr 1.4fr;
    gap: 20px;
    align-items: flex-end;
  }
}

.search-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .search-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .search-grid-3 {
    grid-template-columns: 1.2fr 1fr 1.2fr;
    gap: 20px;
    align-items: flex-end;
  }
}

.search-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

@media (max-width: 640px) {
  .search-actions {
    flex-direction: column-reverse;
  }
  .search-actions button {
    width: 100%;
    justify-content: center;
  }
}

.search-prompt-card {
  text-align: center;
  padding: 48px 20px;
  background: #ffffff;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: 10px;
  margin-bottom: 30px;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-label {
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 16px;
  background: #f8fafc;
  color: var(--text-main);
  transition: all 0.2s;
  min-height: 42px;
}

.search-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.duration-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.duration-pill {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.duration-pill:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.duration-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* Landlord Collapsible Drawer */
.landlord-drawer {
  background: #f8fafc;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
}

.landlord-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

/* Load More Section */
.load-more-section {
  text-align: center;
  margin-top: 36px;
  margin-bottom: 48px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.load-more-status {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.load-more-status strong {
  color: var(--text-main);
  font-weight: 700;
}

.btn-load-more {
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  background: #ffffff;
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-load-more:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.all-loaded-msg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
}

.no-results-card {
  text-align: center;
  padding: 48px 24px;
  background: #ffffff;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: 20px;
}

.no-results-card h3 {
  font-size: 1.25rem;
  margin-bottom: 6px;
  color: var(--text-main);
}
