/* ===== PROPERTYVAULT — RENTAL MANAGEMENT SYSTEM ===== */
/* style.css — v2.0 Primeways Ventures */

/* ── Offline-safe system font stack ──────────────────────────────────────────
   When Google Fonts CDN is unavailable (localhost / no internet),
   the browser falls through to these safe system fonts automatically.       */
@font-face {
  font-family: 'DM Sans';
  src: local('DM Sans'), local('DMSans'), local('Segoe UI'), local('Helvetica Neue');
}
@font-face {
  font-family: 'Playfair Display';
  src: local('Playfair Display'), local('PlayfairDisplay'), local('Georgia');
}
@font-face {
  font-family: 'DM Mono';
  src: local('DM Mono'), local('DMMono'), local('Consolas'), local('Courier New');
}

:root {
  --bg: #0f0f0f;
  --bg2: #161616;
  --bg3: #1e1e1e;
  --bg4: #252525;
  --border: #2a2a2a;
  --border2: #333;
  --gold: #c9a84c;
  --gold2: #e8c97a;
  --gold-dim: rgba(201,168,76,0.12);
  --gold-glow: rgba(201,168,76,0.25);
  --text: #f0ece3;
  --text2: #a09a8e;
  --text3: #6a6560;
  --green: #4caf7d;
  --green-dim: rgba(76,175,125,0.12);
  --red: #e05c5c;
  --red-dim: rgba(224,92,92,0.12);
  --blue: #5b9bd5;
  --blue-dim: rgba(91,155,213,0.12);
  --orange: #e0964a;
  --orange-dim: rgba(224,150,74,0.12);
  --purple: #9b7fd4;
  --purple-dim: rgba(155,127,212,0.12);
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }

/* ===== LOGIN PAGE ===== */
#login-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
#login-screen.hidden { display: none; }
.login-box {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 16px; padding: 48px 40px; width: 100%; max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-title { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-size: 28px; color: var(--gold); }
.login-logo-sub { font-size: 11px; color: var(--text3); letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; }
.login-company { font-size: 13px; color: var(--text2); margin-top: 8px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form label { font-size: 12px; color: var(--text3); font-weight: 500; margin-bottom: 4px; display: block; }
.login-form input { width: 100%; }
.login-error { color: var(--red); font-size: 12px; text-align: center; display: none; margin-top: -4px; }
.login-error.visible { display: block; }
/*.btn-login { text-align: center; width: 100%; padding: 12px; font-size: 14px; font-weight: 600; margin-top: 8px; } */
.btn-login {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;

    display: flex;
    justify-content: center;  /* horizontal center */
    align-items: center;      /* vertical center */
}
.login-hint { text-align: center; font-size: 11px; color: var(--text3); margin-top: 12px; }

/* ===== APP SHELL ===== */
#app-shell { display: none; }
#app-shell.visible { display: block; }

/* SIDEBAR */
.sidebar {
  position: fixed; left: 0; top: 0; width: 240px; height: 100vh;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100;
}
.sidebar-logo { padding: 24px 20px 20px; border-bottom: 1px solid var(--border); }
.logo-title { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-size: 20px; color: var(--gold); letter-spacing: 0.5px; }
.logo-sub { font-size: 10px; color: var(--text3); letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }
.logo-company { font-size: 11px; color: var(--text2); margin-top: 4px; }
.sidebar-nav { flex: 1; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-section { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text3); padding: 12px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 8px; cursor: pointer; transition: all 0.15s; color: var(--text2);
  font-size: 13.5px; font-weight: 400; border: 1px solid transparent;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); border-color: rgba(201,168,76,0.2); font-weight: 500; }
.nav-item .icon { width: 16px; text-align: center; font-size: 15px; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.stats-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-mini { background: var(--bg3); border-radius: 8px; padding: 10px; text-align: center; }
.stat-mini-val { font-family: 'DM Mono', Consolas, 'Courier New', monospace; font-size: 16px; color: var(--gold); font-weight: 500; }
.stat-mini-lbl { font-size: 10px; color: var(--text3); margin-top: 2px; }
.sidebar-user { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sidebar-user-name { font-size: 12px; color: var(--text2); }

/* MAIN */
.main { margin-left: 240px; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,15,15,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 60px;
}
.topbar-title { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-size: 18px; color: var(--text); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; transition: all 0.15s; font-family: 'DM Sans', sans-serif;
}
.btn-primary { background: var(--gold); color: #0f0f0f; }
.btn-primary:hover { background: var(--gold2); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(224,92,92,0.2); }
.btn-danger:hover { background: rgba(224,92,92,0.2); }
/* Download dropdown menu */
.dl-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  background: none; border: none; cursor: pointer;
  color: var(--text); transition: background .15s;
  white-space: nowrap;
}
.dl-menu-item:hover { background: var(--bg3); color: var(--blue); }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 8px; }

.content { padding: 28px; }
.page { display: none; }
.page.active { display: block; }

/* CARDS & GRIDS */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.kpi-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.kpi-card.gold::before { background: linear-gradient(90deg, var(--gold), transparent); }
.kpi-card.green::before { background: linear-gradient(90deg, var(--green), transparent); }
.kpi-card.blue::before { background: linear-gradient(90deg, var(--blue), transparent); }
.kpi-card.red::before { background: linear-gradient(90deg, var(--red), transparent); }
.kpi-card.orange::before { background: linear-gradient(90deg, var(--orange), transparent); }
.kpi-icon { font-size: 22px; margin-bottom: 10px; }
.kpi-val { font-family: 'DM Mono', Consolas, 'Courier New', monospace; font-size: 26px; font-weight: 500; color: var(--text); }
.kpi-lbl { font-size: 12px; color: var(--text3); margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }
.kpi-sub { font-size: 12px; color: var(--text2); margin-top: 6px; }

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

.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-size: 15px; color: var(--text); }
.card-body { padding: 20px; }

/* TABLES */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { padding: 10px 14px; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text3); border-bottom: 1px solid var(--border); font-weight: 500; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }
.td-main { color: var(--text); font-weight: 500; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap;
}
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-orange { background: var(--orange-dim); color: var(--orange); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-gold { background: var(--gold-dim); color: var(--gold); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-gray { background: var(--bg4); color: var(--text3); }

/* PROPERTY CARDS */
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.prop-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: all 0.2s; cursor: pointer;
}
.prop-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow); }
.prop-img {
  height: 90px; background: var(--bg3); display: flex; align-items: center; justify-content: center;
  font-size: 40px; position: relative;
}
.prop-type-badge { position: absolute; top: 10px; right: 10px; }
.prop-body { padding: 14px 16px; }
.prop-name { font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.prop-addr { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.prop-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.prop-stat { font-size: 11.5px; color: var(--text2); background: var(--bg3); padding: 3px 8px; border-radius: 6px; }
.prop-footer { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.prop-rent { font-family: 'DM Mono', Consolas, 'Courier New', monospace; font-size: 14px; color: var(--gold); font-weight: 500; }

/* LANDLORD CARDS */
.landlord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.landlord-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: all 0.2s;
}
.landlord-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.landlord-avatar { width: 48px; height: 48px; background: var(--gold-dim); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; color: var(--gold); font-weight: 700; font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; }
.landlord-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.landlord-detail { font-size: 12.5px; color: var(--text3); margin-bottom: 2px; }
.landlord-actions { display: flex; gap: 8px; margin-top: 14px; }

/* MODALS */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 14px;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1100px; }
@keyframes modalIn { from { opacity:0; transform: scale(0.96) translateY(10px); } to { opacity:1; transform: none; } }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--bg2); z-index: 2;
}
.modal-title { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-size: 17px; color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* FORMS */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12px; color: var(--text3); letter-spacing: 0.5px; font-weight: 500; }
input, select, textarea {
  background: var(--bg3); border: 1px solid var(--border2); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font-size: 13.5px; font-family: 'DM Sans', sans-serif;
  transition: border-color 0.15s; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
textarea { resize: vertical; min-height: 80px; }
select option { background: var(--bg3); }
input[type="checkbox"] { width: auto; margin-right: 6px; accent-color: var(--gold); }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-item { display: flex; align-items: center; background: var(--bg3); border: 1px solid var(--border2); border-radius: 6px; padding: 6px 12px; font-size: 13px; color: var(--text2); cursor: pointer; }
.checkbox-item input { cursor: pointer; }
.info-box {
  background: var(--blue-dim); border: 1px solid var(--blue); border-radius: 8px;
  padding: 10px 14px; font-size: 13px; color: var(--blue); margin-top: 8px;
}
.balance-box {
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-top: 8px; font-weight: 500;
}
.balance-box.due { background: var(--red-dim); border: 1px solid var(--red); color: var(--red); }
.balance-box.over { background: var(--green-dim); border: 1px solid var(--green); color: var(--green); }

/* SEARCH BAR */
.search-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.search-input-wrap { position: relative; flex: 1; max-width: 340px; }
.search-input-wrap input { padding-left: 36px; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 14px; pointer-events: none; }

/* INVOICE PREVIEW */
.invoice-preview {
  background: white; color: #1a1a1a; border-radius: 10px;
  padding: 40px; font-family: 'DM Sans', sans-serif; max-width: 680px; margin: 0 auto;
}
.inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.inv-company-name { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-size: 24px; color: #1a1a1a; font-weight: 700; }
.inv-company-sub { font-size: 12px; color: #888; margin-top: 2px; }
.inv-badge { background: #1a1a1a; color: white; padding: 6px 16px; border-radius: 6px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; }
.inv-num { font-size: 11px; color: #888; margin-top: 4px; text-align: right; }
.inv-divider { height: 1px; background: #e5e5e5; margin: 20px 0; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.inv-party-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: #aaa; margin-bottom: 6px; font-weight: 600; }
.inv-party-name { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.inv-party-detail { font-size: 12.5px; color: #666; margin-top: 2px; line-height: 1.5; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.inv-table th { padding: 10px 12px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #888; border-bottom: 2px solid #e5e5e5; text-align: left; }
.inv-table td { padding: 12px 12px; font-size: 13px; color: #333; border-bottom: 1px solid #f0f0f0; }
.inv-table tr:last-child td { border-bottom: none; }
.inv-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.inv-total-row { display: flex; gap: 60px; font-size: 13px; color: #666; }
.inv-total-row.final { font-size: 16px; font-weight: 700; color: #1a1a1a; padding-top: 8px; border-top: 2px solid #1a1a1a; }
.inv-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid #e5e5e5; font-size: 11px; color: #aaa; text-align: center; }
.inv-status { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; margin-top: 6px; }
.inv-status.paid { background: #e8f7ef; color: #2e7d52; }
.inv-status.unpaid { background: #ffeaea; color: #c0392b; }
.inv-status.pending { background: #fff3e0; color: #b25d00; }
.inv-balance-row { background: #fff3f3; border-left: 4px solid #c0392b; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #c0392b; border-radius: 0 6px 6px 0; }
.inv-balance-row.credit { background: #f0fff6; border-left-color: #2e7d52; color: #2e7d52; }

/* STATEMENT PREVIEW */
.statement-preview {
  background: white; color: #1a1a1a; padding: 40px;
  font-family: 'DM Sans', sans-serif; max-width: 780px; margin: 0 auto;
}
.stmt-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; border-bottom: 2px solid #1a1a1a; padding-bottom: 20px; }
.stmt-company { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 700; color: #1a1a1a; }
.stmt-title { font-size: 16px; font-weight: 600; color: #333; margin-top: 4px; }
.stmt-meta { font-size: 12px; color: #888; margin-top: 4px; }
.stmt-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 13px; }
.stmt-table th { background: #f5f5f5; padding: 9px 12px; text-align: left; font-weight: 600; border-bottom: 1px solid #ddd; }
.stmt-table td { padding: 9px 12px; border-bottom: 1px solid #eee; }
.stmt-table tr:last-child td { border-bottom: none; }
.stmt-total-section { background: #f5f5f5; padding: 16px; border-radius: 8px; margin-top: 20px; }
.stmt-total-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; color: #444; }
.stmt-total-row.grand { font-size: 16px; font-weight: 700; color: #1a1a1a; border-top: 2px solid #1a1a1a; margin-top: 8px; padding-top: 10px; }
.stmt-footer { margin-top: 28px; border-top: 1px solid #ddd; padding-top: 16px; font-size: 11px; color: #aaa; text-align: center; }

/* TIMELINE / ACTIVITY */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-content { flex: 1; }
.activity-text { font-size: 13px; color: var(--text2); }
.activity-text strong { color: var(--text); }
.activity-time { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* PROGRESS */
.progress-bar { height: 6px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }

/* TABS */
.tabs { display: flex; gap: 2px; background: var(--bg3); padding: 4px; border-radius: 10px; margin-bottom: 20px; width: fit-content; }
.tab { padding: 7px 16px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text2); transition: all 0.15s; font-weight: 400; }
.tab.active { background: var(--bg2); color: var(--text); font-weight: 500; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* TOGGLE SWITCH */
.toggle-group { display: flex; gap: 0; background: var(--bg3); border-radius: 8px; padding: 4px; margin-bottom: 16px; width: fit-content; }
.toggle-opt { padding: 7px 20px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text3); transition: all 0.15s; font-weight: 400; user-select: none; }
.toggle-opt.active { background: var(--gold); color: #0f0f0f; font-weight: 600; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text3); }
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-text { font-size: 14px; }

/* NOTIFICATIONS */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px;
  padding: 12px 16px; font-size: 13px; color: var(--text);
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.25s ease; max-width: 320px;
}
@keyframes toastIn { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: none; } }
.toast-icon { font-size: 16px; }

/* DETAIL PANELS */
.detail-section { margin-bottom: 24px; }
.detail-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text3); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.detail-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-lbl { color: var(--text3); }
.detail-val { color: var(--text); font-weight: 500; text-align: right; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* CLOSE BTN */
.close-btn { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 18px; padding: 4px; border-radius: 6px; line-height: 1; transition: color 0.15s; }
.close-btn:hover { color: var(--text); }

/* SECTION HEADER */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-size: 17px; color: var(--text); }

/* QUICK ACTIONS */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.qa-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: all 0.15s; text-align: center;
}
.qa-card:hover { border-color: var(--gold); background: var(--gold-dim); transform: translateY(-2px); }
.qa-icon { font-size: 24px; margin-bottom: 8px; }
.qa-label { font-size: 13px; color: var(--text2); font-weight: 500; }

/* UNIT NAMES */
.unit-names-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }

/* METER READING */
.meter-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; align-items: end; }
.meter-result { background: var(--bg4); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--gold); font-family: 'DM Mono', Consolas, 'Courier New', monospace; }

/* ARREARS TABLE */
.arrears-highlight td { color: var(--red) !important; font-weight: 500; }

@media (max-width: 900px) {
  .sidebar { width: 200px; }
  .main { margin-left: 200px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* PRINT STYLES */
@media print {
  body { background: white; }
  .modal-overlay { background: white; position: relative; display: block; padding: 0; }
  .modal { max-width: 100%; box-shadow: none; border: none; max-height: none; }
  .modal-header, .modal-footer { display: none; }
  #login-screen, .sidebar, .topbar { display: none !important; }
  .main { margin-left: 0; }
  .no-print { display: none !important; }
}

/* RELEASE TENANT */
.btn-danger { background: transparent; border: 1px solid var(--red, #e74c3c); color: var(--red, #e74c3c); }
.btn-danger:hover { background: var(--red, #e74c3c); color: #fff; }

/* CATEGORY SECTION INPUTS */
#category-sections-container input[type="text"],
#category-sections-container input[type="number"] {
  transition: border-color .2s;
}
#category-sections-container input:focus {
  border-color: var(--gold) !important;
  outline: none;
}

/* UNITS TRACKER */
#units-tracker-container { margin-bottom: 4px; }

/* ── LICENSE BADGE (topbar countdown) ─────────────────────── */
.license-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
  border: 1px solid transparent;
  white-space: nowrap;
}
.license-badge:hover { opacity: .8; }

.badge-permanent {
  background: rgba(240,192,64,.12);
  border-color: rgba(240,192,64,.3);
  color: var(--gold, #f0c040);
}
.badge-ok {
  background: rgba(46,204,113,.1);
  border-color: rgba(46,204,113,.25);
  color: #2ecc71;
}
.badge-warning {
  background: rgba(230,126,34,.12);
  border-color: rgba(230,126,34,.3);
  color: #e67e22;
  animation: pulse-warn 2s infinite;
}
.badge-critical {
  background: rgba(231,76,60,.12);
  border-color: rgba(231,76,60,.35);
  color: #e74c3c;
  animation: pulse-warn 1s infinite;
}
@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50%       { opacity: .55; }
}

/* ── RELEASE TENANT ─────────────────────────────────────────── */
.btn-danger {
  background: transparent;
  border: 1px solid var(--red, #e74c3c);
  color: var(--red, #e74c3c);
}
.btn-danger:hover { background: var(--red, #e74c3c); color: #fff; }

/* ── CATEGORY SECTION INPUTS ────────────────────────────────── */
#category-sections-container input:focus {
  border-color: var(--gold) !important;
  outline: none;
}

/* ── PROPERTY CARD ACTIONS ───────────────────────────────────── */
.prop-card-actions {
  display: flex;
  gap: 6px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
  border-radius: 0 0 12px 12px;
}
.prop-card-actions .btn { flex: 1; justify-content: center; font-size: 12px; }

/* ── RELEASE TENANT ─────────────────────────────────────────── */
.btn-danger {
  background: transparent;
  border: 1px solid var(--red, #e74c3c);
  color: var(--red, #e74c3c);
}
.btn-danger:hover { background: var(--red, #e74c3c); color: #fff; }

/* ── CATEGORY SECTION INPUTS ────────────────────────────────── */
#category-sections-container input:focus { border-color: var(--gold) !important; outline: none; }

/* ── WATER / RENT MODE TOGGLES ───────────────────────────────── */
.toggle-group { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.toggle-opt {
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text3);
  background: var(--bg3);
  transition: background .15s, color .15s;
  user-select: none;
}
.toggle-opt.active { background: var(--gold, #f0c040); color: #1a1a1a; font-weight: 600; }
.toggle-opt:hover:not(.active) { background: var(--bg4); color: var(--text); }

/* ── TENANT AGING TABLE ─────────────────────────────────────── */
#aging-content .card { margin-bottom: 20px; }
#aging-content .card-header { padding: 16px 20px; }

/* ═══════════════════════════════════════════════════════════
   TENANT AGING MODULE — redesigned layout
   ═══════════════════════════════════════════════════════════ */

/* ── Summary banner at top ───────────────────────────────── */
.aging-summary-banner {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.aging-summary-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 16px;
}
.aging-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.aging-sum-cell {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}
.aging-sum-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.aging-sum-val {
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ── Per-tenant card ─────────────────────────────────────── */
.aging-tenant-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
.aging-tenant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.aging-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold, #f0c040) 0%, #c89a20 100%);
  color: #0d0d0d;
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aging-summary-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.aging-pill {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  text-align: center;
  min-width: 90px;
}
.aging-pill-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.aging-pill-val {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.aging-pill-red  { border-color: rgba(231,76,60,.3); background: rgba(231,76,60,.06); }
.aging-pill-red .aging-pill-val  { color: #e74c3c; }
.aging-pill-green { border-color: rgba(46,204,113,.3); background: rgba(46,204,113,.06); }
.aging-pill-green .aging-pill-val { color: #2ecc71; }

/* ── Invoice rows inside each card ──────────────────────── */
.aging-table-wrap {
  overflow-x: auto;
  padding: 0 4px 4px;
}
.aging-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.aging-table-wrap thead tr {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.aging-table-wrap th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  padding: 10px 14px;
  font-weight: 600;
  white-space: nowrap;
}
.aging-table-wrap td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.aging-table-wrap tbody tr:last-child td { border-bottom: none; }
.aging-table-wrap tbody tr:hover { background: var(--bg3); }

/* ═══════════════════════════════════════════════════════════
   LANDLORD STATEMENT — full-width unit table
   ═══════════════════════════════════════════════════════════ */
.stmt-table-full { font-size: 12px; min-width: 900px; }
.stmt-table-full th {
  background: #f0f0f0;
  padding: 9px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  border-bottom: 2px solid #ccc;
  white-space: nowrap;
  color: #333;
}
.stmt-table-full td {
  padding: 9px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  color: #1a1a1a;
}
.stmt-table-full tbody tr:hover { background: #fafafa; }
.stmt-vacant-row td { background: #f9f9f9; color: #bbb; }
.stmt-totals-row td {
  background: #f0f0f0;
  font-weight: 700;
  border-top: 2px solid #999;
  border-bottom: none;
  padding: 10px 10px;
}

/* ── Landlord Statement: Edit Mode ─────────────────────────── */
.stmt-manual-row td { background: #f3f8ff; }
.stmt-edited-row td { background: #fffdf2; }
.stmt-edit-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(26,110,168,0.25); }
.btn-stmt-row-del:hover { color: #fff !important; background: #c0392b !important; border-radius: 4px; }

/* ── Credit / overpaid pill in aging ─── */
.aging-pill-credit {
  border-color: rgba(142,68,173,.3);
  background: rgba(142,68,173,.07);
}
.aging-pill-credit .aging-pill-val { color: #8e44ad; }

/* ── Receipt preview (in-app) ─── */
.receipt-preview {
  background: #fff;
  color: #1a1a1a;
  border-radius: 10px;
  padding: 24px 28px;
  font-family: 'DM Sans', sans-serif;
}
.receipt-preview .rec-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.rec-badge {
  background: #2e7d52;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
  display: inline-block;
}
.rec-stamp {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  background: #e8f7ef;
  color: #2e7d52;
  border: 1px solid #2e7d52;
  margin-top: 4px;
}
.inv-total-row.receipt-paid  { color: #2e7d52; font-weight: 600; padding-top: 4px; border-top: 1px solid #e5e5e5; }
.inv-total-row.receipt-arrears { color: #c0392b; font-weight: 700; padding-top: 3px; }
.inv-total-row.receipt-credit  { color: #8e44ad; font-weight: 700; padding-top: 3px; }

/* ── Searchable tenant dropdown in invoice modal ─── */
#inv-tenant-dropdown div:first-child { border-radius: 8px 8px 0 0; }
#inv-tenant-dropdown div:last-child  { border-radius: 0 0 8px 8px; border-bottom: none; }
