/* ============================================================
   RentVault — Complete Stylesheet v2
   Modern, clean, mobile-first design
   ============================================================ */

:root {
  --primary:       #085041;
  --primary-dark:  #053328;
  --primary-mid:   #0a6652;
  --primary-light: #e8f5f1;
  --accent:        #25d187;

  --success:    #1a7f4b;
  --success-bg: #e6f7ee;
  --warning:    #b45309;
  --warning-bg: #fff8ed;
  --danger:     #c0392b;
  --danger-bg:  #fef2f2;
  --info:       #1d6fa4;
  --info-bg:    #e8f4fc;

  --bg:          #f0f4f3;
  --surface:     #ffffff;
  --surface-2:   #f7faf9;
  --border:      #e2e8e6;
  --border-mid:  #ccd5d2;

  --text-primary:   #111b19;
  --text-secondary: #6b7c79;
  --text-tertiary:  #b0bcba;

  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius-md:  14px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 6px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

  --nav-height:  62px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button { cursor: pointer; font-family: inherit; border: none; -webkit-tap-highlight-color: transparent; }
input, select, textarea {
  font-family: inherit; font-size: 15px; color: var(--text-primary);
  -webkit-appearance: none; outline: none;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  display: none;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}
.screen.active { display: block; }
.screen-content {
  padding: 16px 16px calc(var(--nav-height) + 24px + var(--safe-bottom));
}

/* ── Screen header ── */
.screen-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.screen-header h2 {
  font-size: 17px; font-weight: 600; color: var(--text-primary);
  flex: 1; text-align: center; margin: 0 8px;
}
.back-btn {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 7px 12px; font-size: 14px; color: var(--primary);
  font-weight: 500; min-width: 44px;
}
.icon-btn {
  background: none; border: none; font-size: 20px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.icon-btn:active { background: var(--surface-2); }

/* ============================================================
   LOCK SCREEN
   ============================================================ */
.screen-lock {
  background: linear-gradient(160deg, #053328 0%, #085041 50%, #0a6652 100%);
  min-height: 100vh;
}
/* Lock screen uses flex layout only when it's the active screen */
.screen.active.screen-lock {
  display: flex; align-items: center; justify-content: center;
}
.lock-container {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 32px 60px; width: 100%; max-width: 360px;
  gap: 28px;
}
.lock-logo { text-align: center; }
.lock-icon {
  width: 88px; height: 88px; border-radius: 22px;
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
}
.lock-icon img { width: 56px; height: 56px; border-radius: 14px; }
.lock-app-name { font-size: 30px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.lock-subtitle { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 4px; }
.lock-prompt { font-size: 16px; font-weight: 500; color: rgba(255,255,255,0.85); }
.setup-hint { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: -14px; }

/* PIN dots */
.pin-dots { display: flex; gap: 14px; justify-content: center; }
.dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  background: transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.dot.filled {
  background: #fff; border-color: #fff;
  transform: scale(1.1);
}
.lock-error {
  font-size: 13px; color: #ff8a80;
  background: rgba(255,80,80,0.12);
  padding: 8px 16px; border-radius: var(--radius-full);
  text-align: center;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}
.shake { animation: shake 0.4s ease; }

/* PIN pad */
.pin-pad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; width: 100%; max-width: 280px;
}
.pin-key {
  height: 68px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff; font-size: 22px; font-weight: 300;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, transform 0.1s;
}
.pin-key:active { background: rgba(255,255,255,0.25); transform: scale(0.92); }
.pin-key--del, .pin-key--ok { font-size: 18px; }
.pin-key--ok { background: rgba(37,209,135,0.25); border-color: rgba(37,209,135,0.3); }
.pin-key--ok:active { background: rgba(37,209,135,0.4); }

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 8px 4px;
  background: none; color: var(--text-tertiary);
  font-size: 10px; font-weight: 400;
  transition: color 0.15s;
}
.nav-btn--active { color: var(--primary); }
.nav-btn--active .nav-icon { background: var(--primary-light); border-radius: 10px; }
.nav-icon { font-size: 22px; width: 44px; height: 28px; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.nav-label { font-size: 10px; font-weight: 500; }

/* ============================================================
   DASHBOARD
   ============================================================ */
#screen-dashboard .screen-content {
  padding: 0 0 calc(var(--nav-height) + 20px + var(--safe-bottom));
}

.dashboard-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 20px 20px 20px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.app-name { font-size: 26px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.property-name { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 3px; }
.dashboard-month {
  font-size: 13px; color: rgba(255,255,255,0.7);
  padding: 0 20px 16px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

/* Stat grid */
.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 12px 16px 4px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.stat-card--green .stat-value { color: var(--success); }
.stat-card--amber .stat-value { color: var(--warning); }
.stat-card--red   .stat-value { color: var(--danger);  }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.4px; }

/* Quick actions */
.quick-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 12px 16px 8px;
}
.action-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 12px;
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  text-align: center; box-shadow: var(--shadow-xs);
  transition: background 0.15s, transform 0.1s;
}
.action-btn:active { background: var(--surface-2); transform: scale(0.97); }
.action-btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.action-btn--primary:active { background: var(--primary-dark); }
.action-btn--danger { background: var(--danger-bg); color: var(--danger); border-color: #f5c6c6; }

/* Alert cards */
.alert-card {
  background: var(--warning-bg); border: 1px solid #f5c690;
  border-radius: var(--radius-md); padding: 12px 14px;
  margin: 0 16px 10px; font-size: 13px; color: var(--warning);
}

/* ============================================================
   ROOMS LIST
   ============================================================ */
#screen-rooms .screen-content { padding-top: 0; }

.search-bar-wrap { padding: 12px 16px 8px; }
.search-bar {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 11px 14px; font-size: 14px; color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}
.search-bar::placeholder { color: var(--text-tertiary); }

.filter-chips {
  display: flex; gap: 8px; padding: 4px 16px 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); transition: all 0.15s;
}
.chip--active { background: var(--primary); color: #fff; border-color: var(--primary); }

.rooms-grid {
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 16px;
}
.room-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 14px 16px; border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  cursor: pointer; transition: transform 0.1s, box-shadow 0.1s;
}
.room-card:active { transform: scale(0.98); box-shadow: none; }
.room-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.room-number { font-size: 13px; font-weight: 700; color: var(--primary); letter-spacing: 0.3px; }
.room-card-body { display: flex; align-items: center; justify-content: space-between; }
.tenant-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.rent-amount { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.room-due { font-size: 12px; color: var(--danger); font-weight: 500; margin-top: 6px; }

/* FAB */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px + var(--safe-bottom));
  right: 18px; z-index: 25;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(8,80,65,0.45);
  transition: transform 0.15s;
}
.fab:active { transform: scale(0.92); }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-full);
  letter-spacing: 0.2px; white-space: nowrap;
}
.badge-paid     { background: var(--success-bg); color: var(--success); }
.badge-partial  { background: var(--info-bg);    color: var(--info); }
.badge-due      { background: var(--warning-bg); color: var(--warning); }
.badge-overdue  { background: var(--danger-bg);  color: var(--danger); }
.badge-vacant   { background: var(--border);     color: var(--text-secondary); }

/* ============================================================
   ROOM DETAIL
   ============================================================ */
.tenant-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-mid));
  padding: 20px 16px 24px;
  display: flex; align-items: flex-start; gap: 14px;
}
.avatar {
  width: 60px; height: 60px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}
.avatar-initials {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.tenant-info { flex: 1; }
.tenant-info .tenant-name { font-size: 18px; font-weight: 700; color: #fff; }
.tenant-info .tenant-phone { font-size: 13px; color: rgba(255,255,255,0.75); margin-top: 3px; }
.tenant-info .tenant-id { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.tenant-info .tenant-since { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* Detail section */
.detail-section {
  background: var(--surface); border-radius: var(--radius-md);
  margin: 12px 16px 0; padding: 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.detail-section h4 { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-header h4 { margin-bottom: 0; }
.link-btn { font-size: 13px; color: var(--primary); font-weight: 500; background: none; }

/* Action bar */
.action-bar {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 14px 16px 0;
}

/* Family & vehicle rows */
.family-row, .vehicle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.family-row:last-child, .vehicle-row:last-child { border-bottom: none; }
.family-row small, .vehicle-row small { color: var(--text-secondary); font-size: 12px; margin-left: 6px; }
.icon-btn-sm { background: none; font-size: 16px; padding: 4px 8px; border-radius: var(--radius-xs); }
.icon-btn-sm.danger { color: var(--danger); }
.empty-small { font-size: 13px; color: var(--text-tertiary); text-align: center; padding: 8px 0; }

/* Vacant room */
.vacant-section { text-align: center; padding: 48px 32px; }
.vacant-icon { font-size: 56px; margin-bottom: 12px; opacity: 0.3; }
.vacant-label { font-size: 16px; color: var(--text-secondary); margin-bottom: 20px; }

/* ============================================================
   PAYMENT LEDGER
   ============================================================ */
.ledger-row {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 13px 14px; margin-bottom: 8px;
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  cursor: pointer;
}
.ledger-row:active { background: var(--surface-2); }
.ledger-month { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.ledger-amounts { display: flex; gap: 14px; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.ledger-right { display: flex; align-items: center; justify-content: space-between; }
.ledger-total { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* ============================================================
   PAYMENT FORM
   ============================================================ */
.payment-month-header {
  background: var(--primary); color: #fff;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 600;
}

/* Amount rows */
.amount-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.amount-row:last-child { border-bottom: none; }
.amount-row--total { font-weight: 700; font-size: 15px; color: var(--primary); border-top: 2px solid var(--border); padding-top: 12px; }
.amount-row--paid { color: var(--success); font-weight: 500; }
.amount-row--due  { color: var(--danger);  font-weight: 600; font-size: 15px; }

/* Electricity calc */
.meter-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.electricity-calc {
  background: var(--primary-light); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px; color: var(--primary-mid);
  margin-bottom: 4px;
}
.input-readonly { background: var(--surface-2); color: var(--text-secondary); }

/* Payment mode */
.payment-mode-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.mode-btn {
  padding: 10px 8px; border-radius: var(--radius-sm); text-align: center;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  background: var(--surface-2); border: 1px solid var(--border);
  transition: all 0.15s;
}
.mode-btn--active {
  background: var(--primary-light); color: var(--primary);
  border-color: var(--primary); font-weight: 600;
}

/* Receipt card */
.receipt-card {
  background: var(--success-bg); border: 1px solid #b7e4ca;
  border-radius: var(--radius-md); padding: 16px;
  text-align: center;
}
.receipt-number { font-size: 16px; font-weight: 700; color: var(--success); margin-bottom: 6px; }
.receipt-ref { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }

/* Payment detail */
.payment-detail { font-size: 14px; }
.partial-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}

/* ============================================================
   METER SCREEN
   ============================================================ */
.last-reading-banner {
  background: var(--primary-light); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px; color: var(--primary-mid);
  margin-bottom: 4px;
}
.meter-card {
  background: var(--surface-2); border-radius: var(--radius-md);
  padding: 14px; border: 1px solid var(--border);
}
.meter-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.meter-value small { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.meter-date { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.meter-consumed { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.photo-thumb-link { display: inline-block; margin-top: 8px; }
.photo-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: var(--radius-xs); }
.photo-preview { background: var(--surface-2); border: 2px dashed var(--border-mid); border-radius: var(--radius-md); padding: 20px; text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; min-height: 80px; display: flex; align-items: center; justify-content: center; }
.photo-preview--lg { min-height: 140px; }
.photo-captured { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius-sm); }
.photo-capture-wrap { margin-bottom: 12px; }
.ocr-result {
  background: var(--info-bg); border: 1px solid #b3d7f0;
  border-radius: var(--radius-sm); padding: 12px; margin: 8px 0;
  font-size: 13px; color: var(--info);
}

/* ============================================================
   FORMS (universal)
   ============================================================ */
.form-section {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 12px;
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.form-section h3 {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px;
}

/* Labels and inputs */
.screen-content label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 5px; margin-top: 12px;
}
.screen-content label:first-child { margin-top: 0; }
.screen-content input,
.screen-content select,
.screen-content textarea {
  width: 100%; padding: 11px 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
  color: var(--text-primary); transition: border-color 0.15s, box-shadow 0.15s;
}
.screen-content input:focus,
.screen-content select:focus,
.screen-content textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,80,65,0.08);
  background: var(--surface);
}
.screen-content textarea { resize: none; line-height: 1.5; }
.screen-content select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7c79' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}

/* Sheet inputs */
.sheet-input {
  width: 100%; padding: 11px 13px; margin-bottom: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text-primary);
  display: block;
}
.sheet-input:focus { border-color: var(--primary); outline: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-md); padding: 13px 18px;
  font-size: 15px; font-weight: 600; border: none;
  transition: transform 0.1s, opacity 0.15s;
  cursor: pointer;
}
.btn:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-outline  { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-full     { width: 100%; }
.btn-sm       { padding: 7px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-add      { margin-bottom: 14px; }

/* ============================================================
   MAINTENANCE
   ============================================================ */
.maintenance-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 8px;
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.maintenance-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.maintenance-category {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: var(--primary-light); padding: 3px 10px;
  border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.3px;
}
.maintenance-amount-lg { font-size: 16px; font-weight: 700; color: var(--danger); }
.maintenance-desc { font-size: 14px; color: var(--text-primary); margin-bottom: 6px; }
.maintenance-meta { font-size: 12px; color: var(--text-secondary); display: flex; gap: 10px; flex-wrap: wrap; }

/* Maintenance summary row */
.maintenance-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.maintenance-row:last-child { border-bottom: none; }
.maintenance-amount { font-weight: 600; color: var(--danger); }
.maintenance-date   { color: var(--text-secondary); font-size: 12px; }

/* ============================================================
   COMPLAINTS
   ============================================================ */
.complaint-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 8px;
  border: 1px solid var(--border); border-left: 4px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.complaint-card--open        { border-left-color: var(--danger); }
.complaint-card--in_progress { border-left-color: var(--warning); }
.complaint-card--resolved    { border-left-color: var(--success); }
.complaint-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.complaint-category { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; }
.complaint-status { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-secondary); }
.complaint-desc { font-size: 14px; color: var(--text-primary); margin-bottom: 8px; }
.complaint-meta { font-size: 12px; color: var(--text-secondary); display: flex; gap: 10px; margin-bottom: 10px; }
.resolved-date { font-size: 12px; color: var(--success); font-weight: 500; }

/* ============================================================
   REPORTS
   ============================================================ */
.year-nav { display: flex; align-items: center; gap: 16px; }
.year-nav button { background: rgba(255,255,255,0.2); border: none; color: #fff; font-size: 18px; width: 32px; height: 32px; border-radius: 50%; }
.year-nav span { font-size: 16px; font-weight: 600; color: #fff; }
.report-table-wrap { overflow-x: auto; margin-top: 12px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { background: var(--primary); color: #fff; padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px; }
.report-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.report-table tr:last-child td { border-bottom: none; }
.report-table tr:nth-child(even) td { background: var(--surface-2); }

/* ============================================================
   SETTINGS
   ============================================================ */
#settings-form .form-section { padding: 0; overflow: hidden; }
#settings-form .form-section h3 { padding: 14px 16px 10px; margin: 0; border-bottom: 1px solid var(--border); }
#settings-form label { padding: 0 16px; }
#settings-form input, #settings-form select { margin: 0 16px 14px; width: calc(100% - 32px); }
#settings-form .btn { margin: 0 16px 16px; width: calc(100% - 32px); }

/* ============================================================
   MOVE-OUT
   ============================================================ */
.warning-banner {
  background: var(--danger-bg); border: 1px solid #f5c6c6;
  border-radius: var(--radius-md); padding: 12px 16px;
  font-size: 13px; color: var(--danger); font-weight: 500;
  margin-bottom: 12px;
}
.settlement-calc {
  background: var(--primary-light); border-radius: var(--radius-md);
  padding: 14px; margin: 12px 0;
}

/* ============================================================
   HISTORY
   ============================================================ */
.history-card {
  background: var(--surface); border-radius: var(--radius-md);
  padding: 14px; margin-bottom: 8px; border: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-xs);
}
.history-info strong { display: block; font-size: 15px; font-weight: 600; }
.history-info span   { font-size: 12px; color: var(--text-secondary); margin-top: 2px; display: block; }

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-results {
  position: absolute; z-index: 50; left: 16px; right: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  max-height: 280px; overflow-y: auto;
}
.search-result {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 14px;
}
.search-result:last-child { border-bottom: none; }
.search-result:active { background: var(--surface-2); }

/* ============================================================
   BOTTOM SHEET
   ============================================================ */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.45);
}
.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 101;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 8px 16px calc(24px + var(--safe-bottom));
  max-height: 92vh; overflow-y: auto;
  animation: slideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sheet-handle {
  width: 36px; height: 4px; background: var(--border-mid);
  border-radius: 2px; margin: 0 auto 16px;
}
.sheet-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 18px; }
.sheet-body { margin-bottom: 16px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,51,40,0.6);
  backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
  width: calc(100% - 32px); max-width: 380px; pointer-events: none;
}
.toast {
  background: #1c2b28; color: #fff;
  padding: 12px 18px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--info); }

/* ============================================================
   OFFLINE BANNER
   ============================================================ */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: var(--warning); color: #fff;
  text-align: center; font-size: 12px; font-weight: 500;
  padding: 8px 16px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 32px; text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.photo-capture-wrap { margin-bottom: 12px; }
.btn-add { margin-bottom: 12px; }
.input-readonly { background: var(--surface-2) !important; color: var(--text-secondary) !important; }

/* Report screen header tweak */
#screen-reports .screen-header { background: var(--primary); }
#screen-reports .screen-header h2 { color: #fff; }
#screen-reports .back-btn { background: rgba(255,255,255,0.15); color: #fff; }
