/* ─── Reset & Base ───────────────────────────────────────────────────────────── */
:root {
  --sidebar-width: 230px;
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-hover: #334155;
  --sidebar-active-bg: #3b82f6;
  --sidebar-active-text: #ffffff;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── App Layout ─────────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #334155;
}
.brand-icon { font-size: 22px; }
.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.3px;
}

.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav ul { list-style: none; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  font-size: 13.5px;
  border-radius: 0;
}
.nav-link:hover { background: var(--sidebar-hover); color: #f1f5f9; }
.nav-link.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); }
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #334155;
  font-size: 12px;
}
.user-name { display: block; color: #f1f5f9; font-weight: 600; }
.user-role { color: var(--sidebar-text); text-transform: capitalize; font-size: 11px; }
.logout-link { color: #64748b; text-decoration: none; font-size: 11px; margin-top: 6px; display: inline-block; }
.logout-link:hover { color: #f1f5f9; }

/* ─── Main Content ───────────────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 28px 32px;
  max-width: calc(100vw - var(--sidebar-width));
  min-height: 100vh;
}

/* ─── Page Header ────────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; display: block; }
.back-link { color: var(--accent); text-decoration: none; font-size: 13px; display: block; margin-bottom: 4px; }
.back-link:hover { text-decoration: underline; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ─── Stat Cards ─────────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-card-success { border-left: 3px solid var(--success); }
.stat-card-danger { border-left: 3px solid var(--danger); }
.stat-card-warning { border-left: 3px solid var(--warning); }

/* ─── Property Grid ──────────────────────────────────────────────────────────── */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.property-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, border-color 0.15s;
  display: block;
  position: relative;
}
.property-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }
.property-card-inner { display: block; text-decoration: none; color: inherit; }
.property-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.property-type-icon { font-size: 20px; }
.property-address { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.property-tenant { color: var(--text-muted); font-size: 12px; margin-bottom: 6px; }
.property-tenant .tenant-link { color: var(--accent); text-decoration: none; }
.property-tenant .tenant-link:hover { text-decoration: underline; }
.property-rent { font-weight: 700; color: var(--accent); font-size: 14px; }
.property-card-add {
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  background: transparent;
  min-height: 120px;
}
.property-card-add:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.add-icon { font-size: 24px; font-weight: 300; }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.data-table thead { background: #f8fafc; }
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.data-table th:hover { color: var(--text); background: #f1f5f9; }
.data-table th::after { content: ''; display: inline-block; width: 10px; margin-left: 4px; opacity: 0.3; }
.data-table th.sort-asc::after { content: '▲'; opacity: 1; color: var(--accent); }
.data-table th.sort-desc::after { content: '▼'; opacity: 1; color: var(--accent); }
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table a { color: var(--accent); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.data-table tfoot tr { background: #f8fafc; }
.data-table tfoot td { border-top: 2px solid var(--border); padding: 12px 14px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.income { color: #166534; }
.loss { color: #991b1b; }
.expense { color: #7c3aed; }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 760px;
  box-shadow: var(--shadow);
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.form-group small { color: var(--text-muted); font-size: 12px; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 0; }
.form-card > .form-group { margin-bottom: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; align-items: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.align-end { align-items: flex-end; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s;
  line-height: 1.4;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); color: white; }
.btn-sm {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  text-decoration: none;
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s;
}
.btn-sm:hover { background: #f1f5f9; }
.btn-full { width: 100%; justify-content: center; padding: 10px 16px; font-size: 15px; }

/* ─── Section titles ─────────────────────────────────────────────────────────── */
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-header h2 { font-size: 16px; font-weight: 700; color: var(--text); }
.detail-section { margin-bottom: 32px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ─── Info Grid ──────────────────────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.info-grid > div { display: flex; flex-direction: column; gap: 3px; }
.label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.etransfer-email { color: var(--accent); font-weight: 700; }

/* ─── Misc ───────────────────────────────────────────────────────────────────── */
.muted { color: var(--text-muted); font-size: 13px; }
.total-line { text-align: right; padding: 10px 14px; font-size: 13px; color: var(--text-muted); }
.property-notes { background: #fefce8; border: 1px solid #fde047; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: 13px; color: #713f12; }
.lease-actions { display: flex; gap: 8px; margin-top: 12px; }
.lease-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto auto; gap: 12px; align-items: center; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; box-shadow: var(--shadow); font-size: 13px; }
.link-sm { font-size: 12px; color: var(--accent); text-decoration: none; }
.link-sm:hover { text-decoration: underline; }

/* ─── Alerts ─────────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; font-weight: 500; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ─── Login ──────────────────────────────────────────────────────────────────── */
.login-body { background: var(--bg); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: var(--shadow-md); }
.login-brand { text-align: center; margin-bottom: 28px; }
.brand-icon-lg { font-size: 40px; display: block; margin-bottom: 8px; }
.login-brand h1 { font-size: 24px; font-weight: 800; color: var(--text); }
.login-brand p { color: var(--text-muted); font-size: 13px; }
.login-form .form-group { margin-bottom: 16px; }

/* ─── Reports ────────────────────────────────────────────────────────────────── */
.report-filter-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; box-shadow: var(--shadow); }
.report-period { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; font-weight: 600; }
.report-table { font-size: 13px; }
.report-summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.totals-row { background: #f8fafc; }
.totals-row td { font-size: 13px; }

/* ─── HTMX Loading ───────────────────────────────────────────────────────────── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.page-loading { position: fixed; top: 0; left: var(--sidebar-width); right: 0; height: 3px; background: var(--accent); z-index: 999; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .report-summary-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .brand-name, .nav-label, .sidebar-footer .user-name, .sidebar-footer .user-role, .logout-link { display: none; }
  .main-content { margin-left: 60px; max-width: calc(100vw - 60px); padding: 16px; }
  .sidebar-brand { padding: 16px; justify-content: center; }
  .nav-link { padding: 12px; justify-content: center; }
}

/* ─── Walkthrough Gallery ────────────────────────────────────────────────────── */
.walkthrough-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.walkthrough-col-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); margin-bottom: 12px; }
.walkthrough-event { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.walkthrough-event-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.walkthrough-event-date { font-size: 13px; font-weight: 600; }
.walkthrough-event-notes { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }
.walkthrough-thumb-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.walkthrough-thumb-sm { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); display: block; transition: opacity 0.15s; }
.walkthrough-thumb-sm:hover { opacity: 0.8; }
.walkthrough-more { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.walkthrough-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.walkthrough-thumb-link { display: block; }
.walkthrough-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); display: block; transition: opacity 0.15s; }
.walkthrough-thumb:hover { opacity: 0.8; }
.btn-danger { color: var(--danger, #ef4444); border-color: var(--danger, #ef4444); }
.btn-danger:hover { background: var(--danger, #ef4444); color: #fff; }
@media (max-width: 768px) {
  .walkthrough-comparison { grid-template-columns: 1fr; }
  .walkthrough-gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ─── Deposit Balance ────────────────────────────────────────────────────────── */
.deposit-balance-hero { font-size: 28px; font-weight: 800; color: var(--accent); }
.deposit-balance-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.deposit-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.deposit-summary-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.balance-zero { color: var(--success, #22c55e); }

/* ─── Property Card Arrears ─────────────────────────────────────────────────── */
.property-card-arrears {
  border: 2px solid var(--danger, #ef4444) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}
.property-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  background: var(--surface);
  position: relative;
  z-index: 1;
}
.payment-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.payment-pill-paid    { background: rgba(34,197,94,0.15); color: #16a34a; }
.payment-pill-partial { background: rgba(234,179,8,0.15);  color: #a16207; }
.payment-pill-arrears { background: rgba(239,68,68,0.15);  color: #dc2626; }

/* ─── Search + Pagination ─────────────────────────────────────────────────── */
.list-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.search-input { border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; font-size: 13px; width: 280px; background: var(--surface); color: var(--text); }
.search-input:focus { outline: none; border-color: var(--accent); }
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; cursor: pointer; text-decoration: none; color: var(--text); background: var(--surface); }
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn-active { background: var(--accent); color: #fff !important; border-color: var(--accent); cursor: default; pointer-events: none; }
.page-btn-disabled { color: var(--text-muted); cursor: default; pointer-events: none; }
.page-ellipsis { padding: 0 4px; color: var(--text-muted); font-size: 13px; line-height: 30px; }
.page-count { margin-left: 8px; font-size: 12px; color: var(--text-muted); }

/* ─── Property Card Overlap (handover pending) ──────────────────────────────── */
.property-card-overlap {
  border: 2px solid var(--warning, #f59e0b) !important;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.property-overlap-banner {
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  background: rgba(245,158,11,0.15);
  border-radius: 4px;
  padding: 5px 8px;
  margin: 6px 0 2px;
  line-height: 1.4;
}
.tenant-outgoing {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Arrears Breakdown ─────────────────────────────────────────────────────── */
.arrears-breakdown { margin-bottom: 28px; }
.arrears-title { color: var(--danger, #ef4444); }
.arrears-row td { vertical-align: middle; }
.text-danger { color: var(--danger, #ef4444); }
.text-partial { color: #a16207; }

/* ─── Lease Chain Timeline ───────────────────────────────────────────────────── */
.lease-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2, #f8f9fa);
  border-radius: 6px;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 0.82rem;
}
.chain-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--surface-1, #fff);
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  color: var(--primary, #2563eb);
}
.chain-node:hover { background: var(--primary-hover-bg, #eff6ff); }
.chain-node-current {
  border-color: var(--primary, #2563eb);
  background: var(--primary, #2563eb);
  color: #fff;
  font-weight: 600;
  cursor: default;
}
.chain-arrow {
  color: var(--text-muted, #94a3b8);
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}

/* Charts */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.chart-card-wide { grid-column: 1 / -1; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.chart-title { font-size: 14px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 16px; }
@media (max-width: 700px) { .charts-grid { grid-template-columns: 1fr; } .chart-card-wide { grid-column: auto; } }

/* Late payment badge */
.badge-late { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: var(--danger, #c0392b); color: #fff; border-radius: 3px; padding: 1px 5px; vertical-align: middle; margin-left: 4px; }

/* Month-to-month rollover badge (fixed term expired but lease still active) */
.badge-mtm { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: 0.03em; background: #ede9fe; color: #6d28d9; border-radius: 3px; padding: 1px 5px; vertical-align: middle; margin-left: 4px; white-space: nowrap; }

/* Section header with inline action */
.section-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.section-header-row h2 { margin: 0; }

/* Filter toggle (show expired/terminated) */
.filter-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; user-select: none; }
.filter-toggle input[type="checkbox"] { cursor: pointer; accent-color: var(--primary); width: 14px; height: 14px; }

/* Receipt attachments */
.receipt-col { width: 60px; text-align: center; padding: 6px 8px !important; }
.receipt-cell { display: flex; align-items: center; gap: 4px; }
.receipt-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; transition: opacity 0.15s; }
.receipt-thumb:hover { opacity: 0.8; }
.receipt-delete-btn { background: none; border: none; color: var(--text-muted); font-size: 14px; cursor: pointer; padding: 0 2px; line-height: 1; }
.receipt-delete-btn:hover { color: var(--danger); }
.receipt-upload-label { cursor: pointer; font-size: 16px; opacity: 0.4; transition: opacity 0.15s; display: inline-block; padding: 2px; }
.receipt-upload-label:hover { opacity: 1; }

/* Lease defaults form section */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.checkbox-label input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; flex-shrink: 0; }
.form-section-details { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1rem; background: var(--surface); }
.form-section-details summary { cursor: pointer; user-select: none; font-size: 14px; padding: 2px 0; }
.form-section-details summary::-webkit-details-marker { color: var(--text-muted); }

/* ── Incoming e-Transfer banner (dashboard) ─────────────────────────────────── */
.pending-email-banner { display: flex; align-items: center; gap: 12px; background: #fffbeb; border: 1px solid #fcd34d; border-radius: var(--radius); padding: 10px 16px; margin-bottom: 1.25rem; text-decoration: none; color: inherit; transition: background 0.15s; }
.pending-email-banner:hover { background: #fef3c7; }
.pending-email-icon { font-size: 20px; flex-shrink: 0; }
.pending-email-banner span:nth-child(2) { flex: 1; font-size: 14px; }
.pending-email-cta { font-size: 13px; font-weight: 600; color: #92400e; white-space: nowrap; }

/* ── Pending payments review page ────────────────────────────────────────────── */
.pending-payment-list { display: flex; flex-direction: column; gap: 1rem; max-width: 720px; }
.pending-payment-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.pending-payment-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.pending-sender { font-weight: 600; font-size: 15px; margin-right: 10px; }
.pending-amount { font-size: 17px; font-weight: 700; color: var(--success, #16a34a); }
.pending-meta { font-size: 12px; text-align: right; }
.pending-subject { font-size: 12px; margin-bottom: 12px; border-left: 3px solid var(--border); padding-left: 8px; }
.pending-confirm-form { display: flex; flex-direction: column; gap: 8px; }
.pending-form-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pending-label { font-size: 13px; width: 130px; flex-shrink: 0; color: var(--text-muted); }
.pending-select, .pending-input { font-size: 13px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); flex: 1; }
.period-cell { white-space: nowrap; }
.period-arrow { background: none; border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 11px; cursor: pointer; color: var(--text-muted); line-height: 1; transition: border-color 0.12s, color 0.12s; vertical-align: middle; }
.period-arrow:hover { border-color: var(--accent); color: var(--accent); }
.period-hint { font-size: 11px; color: var(--text-muted); flex-basis: 100%; padding-left: 138px; }
.period-hint-next { color: #16a34a; font-weight: 600; }
.pending-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-confirm { background: var(--success, #16a34a); color: #fff; border: none; border-radius: 4px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-confirm:hover { opacity: 0.88; }
.btn-dismiss { background: none; border: 1px solid var(--border); border-radius: 4px; padding: 6px 14px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.btn-dismiss:hover { border-color: var(--danger); color: var(--danger); }
.pending-match { margin-top: 8px; }
.match-pill { font-size: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; border-radius: 99px; padding: 2px 10px; display: inline-block; }
.match-unmatched { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }

/* ── Property lease timeline ─────────────────────────────────────────────────── */
.lease-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-card { display: block; border-left: 4px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; background: var(--surface); text-decoration: none; color: inherit; margin-bottom: 2px; transition: background 0.12s; }
.timeline-card:hover { background: var(--surface-hover, #f1f5f9); }
.timeline-card.active  { border-left-color: #16a34a; }
.timeline-card.expired { border-left-color: var(--border); }
.timeline-card.terminated { border-left-color: #dc2626; }
.timeline-card-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.timeline-card-meta  { font-size: 12px; color: var(--text-muted); }
.timeline-vacant { font-size: 11px; color: var(--text-muted); padding: 6px 0 6px 16px; border-left: 2px dashed var(--border); margin: 2px 0 2px 1px; }

/* ── Reports Gantt timeline ──────────────────────────────────────────────────── */
.gantt-section { margin-top: 1.75rem; }
.gantt-scroll  { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.gantt-table { border-collapse: separate; border-spacing: 0; font-size: 11px; white-space: nowrap; }
.gantt-month-th { width: 26px; min-width: 26px; max-width: 26px; padding: 2px 0; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; font-weight: 500; text-align: left; color: var(--text-muted); border-left: 1px solid var(--border); height: 72px; vertical-align: bottom; }
.gantt-year-marker { border-left: 2px solid var(--primary) !important; }
.gantt-table thead tr th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 2; }
.gantt-label-cell { padding: 4px 10px; white-space: nowrap; font-size: 12px; min-width: 130px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); position: sticky; left: 0; background: var(--surface); z-index: 1; }
.gantt-label-cell a { text-decoration: none; color: inherit; font-weight: 500; }
.gantt-label-cell a:hover { color: var(--primary); }
/* Segment cells (each lease = one td with colspan, each gap = one td) */
.gantt-seg { height: 28px; padding: 3px 0; vertical-align: middle; }
.gantt-seg-vacant { /* empty space between leases */ }
.gantt-seg-active          { background: rgba(34,197,94,0.32);   border: 1px solid rgba(34,197,94,0.6);   border-radius: 4px; }
.gantt-seg-expired         { background: rgba(100,116,139,0.22); border: 1px solid rgba(100,116,139,0.45); border-radius: 4px; }
.gantt-seg-terminated-body { background: rgba(100,116,139,0.22); border: 1px solid rgba(100,116,139,0.45); border-right: none; border-radius: 4px 0 0 4px; }
.gantt-seg-terminated-end  { background: rgba(220,38,38,0.30);   border: 1px solid rgba(220,38,38,0.55);  border-left: none;  border-radius: 0 4px 4px 0; }
.gantt-bar-link { display: block; width: 100%; height: 100%; min-height: 22px; }
.gantt-bar-link:hover { opacity: 0.72; }

/* ── Maintenance open-request badge ─────────────────────────────────────────── */
.maint-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; border-radius: 99px; padding: 2px 8px; text-decoration: none; white-space: nowrap; transition: background 0.12s; }
.maint-badge:hover { background: #ffedd5; }
.maint-badge-lg { font-size: 13px; padding: 4px 12px; }
.maint-badge-card { position: absolute; top: 8px; left: 8px; z-index: 2; }

/* ── Property cover photo ────────────────────────────────────────────────────── */
.property-card-photo-wrap { position: relative; height: 110px; margin: -16px -16px 12px -16px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.property-card-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-photo-panel { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.cover-photo-img { width: 220px; height: 150px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); flex-shrink: 0; }
.cover-photo-placeholder { width: 220px; height: 150px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius); font-size: 2.5rem; color: var(--text-muted); flex-shrink: 0; }
.cover-photo-actions { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.cover-photo-btn { cursor: pointer; display: inline-block; }
.btn-danger-sm { background: none; border: 1px solid var(--danger, #dc2626); color: var(--danger, #dc2626); border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.btn-danger-sm:hover { background: var(--danger, #dc2626); color: #fff; }

/* ── Maintenance filter tabs ─────────────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filter-tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); text-decoration: none; transition: all 0.15s; }
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-count { font-size: 11px; font-weight: 700; background: rgba(0,0,0,0.12); border-radius: 99px; padding: 1px 7px; line-height: 1.5; }
.filter-tab.active .tab-count { background: rgba(255,255,255,0.25); }
