﻿/* ============================================================
   PRIME HOLDINGS — Rental Management System
   Brand: Blue #2b7bc8 | Orange #f5a623 | White #ffffff
   ============================================================ */

/* ── CSS Variables ───────────────────────────────────────────── */
/* 60-30-10 Rule:
   - 60% Background: --bg (#f0f4f9) and --white (#ffffff)
   - 30% Content:    --blue (#2b7bc8) for secondary actions, links, active states
   - 10% Accent:     --orange (#f5a623) for primary CTAs, important highlights
*/
:root {
    --blue:        #2b7bc8;
    --blue-dark:   #1e5fa0;
    --blue-light:  #e8f1fb;
    --orange:      #f5a623;
    --orange-dark: #d4890a;
    --orange-light:#fff8ec;
    --white:       #ffffff;
    --bg:          #f0f4f9;
    --sidebar-bg:  #0f2d52;
    --sidebar-w:   230px;
    --header-h:    56px;
    --text:        #1a2b3c;
    --text-muted:  #6b7a8d;
    --border:      #d8e3ee;
    --radius:      8px;
    --shadow:      0 2px 12px rgba(43,123,200,.12);
    --shadow-sm:   0 1px 4px rgba(0,0,0,.08);
    --skeleton-bg: #e2e8f0;
    --skeleton-highlight: #f1f5f9;
    --icon-size-sm: 16px;
    --icon-size-md: 20px;
    --icon-size-lg: 24px;
}

/* ── Icon Styling (Block-style) ───────────────────────────────── */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--icon-size-md);
    height: var(--icon-size-md);
    font-size: var(--icon-size-md);
    line-height: 1;
}

.icon-sm {
    width: var(--icon-size-sm);
    height: var(--icon-size-sm);
    font-size: var(--icon-size-sm);
}

.icon-lg {
    width: var(--icon-size-lg);
    height: var(--icon-size-lg);
    font-size: var(--icon-size-lg);
}

/* Sidebar icon styling */
.sidebar-menu li i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 18px;
    line-height: 1;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Button icon styling */
.btn-primary i,
.btn-success i,
.btn-danger i,
.btn-edit i,
.btn-delete i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    width: 16px;
    height: 16px;
    font-size: 14px;
    line-height: 1;
}

/* ── Step Modal Components ────────────────────────────────────────────────────── */
.step-modal-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
}

.step-modal-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--border);
    transform: translateY(-50%);
    z-index: 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 1;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.step-indicator.active .step-number {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
}

.step-indicator.completed .step-number {
    border-color: #27ae60;
    background: #d4edda;
    color: #27ae60;
}

.step-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
}

.step-content {
    min-height: 200px;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

/* Next / Complete button inside step modals */
.btn-primary {
    display:inline-flex; align-items:center; gap:6px;
    padding:10px 22px; border:none; border-radius:8px;
    font-size:13px; font-weight:700; cursor:pointer;
    background:var(--orange); color:#fff;
    transition:background .15s, transform .1s, box-shadow .15s;
    box-shadow:0 2px 8px rgba(232,97,10,.25);
}
.btn-primary:hover:not(:disabled) {
    background:var(--orange-dark); transform:translateY(-1px);
    box-shadow:0 4px 14px rgba(232,97,10,.35);
}
.btn-primary:active:not(:disabled) { transform:translateY(0); }
.btn-primary:disabled { opacity:.5; cursor:not-allowed; box-shadow:none; }

.btn-secondary {
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 22px; border:none; border-radius:8px;
  font-size:13px; font-weight:700; cursor:pointer;
  background:var(--blue); color:#fff;
  transition:background .15s, transform .1s, box-shadow .15s;
  box-shadow:0 2px 8px rgba(43,123,200,.25);
}
.btn-secondary:hover:not(:disabled) {
  background:var(--blue-dark); transform:translateY(-1px);
  box-shadow:0 4px 14px rgba(43,123,200,.35);
}
.btn-secondary:active:not(:disabled) { transform:translateY(0); }
.btn-secondary:disabled { opacity:.5; cursor:not-allowed; box-shadow:none; }

.btn-success {
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 22px; border:none; border-radius:8px;
  font-size:13px; font-weight:700; cursor:pointer;
  background:#27ae60; color:#fff;
  transition:background .15s, transform .1s, box-shadow .15s;
  box-shadow:0 2px 8px rgba(39,174,96,.25);
}
.btn-success:hover:not(:disabled) {
  background:#219150; transform:translateY(-1px);
  box-shadow:0 4px 14px rgba(39,174,96,.35);
}
.btn-success:active:not(:disabled) { transform:translateY(0); }
.btn-success:disabled { opacity:.5; cursor:not-allowed; box-shadow:none; }

.btn-warning {
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 22px; border:none; border-radius:8px;
  font-size:13px; font-weight:700; cursor:pointer;
  background:#e74c3c; color:#fff;
  transition:background .15s, transform .1s, box-shadow .15s;
  box-shadow:0 2px 8px rgba(231,76,60,.25);
}
.btn-warning:hover:not(:disabled) {
  background:#c0392b; transform:translateY(-1px);
  box-shadow:0 4px 14px rgba(231,76,60,.35);
}
.btn-warning:active:not(:disabled) { transform:translateY(0); }
.btn-warning:disabled { opacity:.5; cursor:not-allowed; box-shadow:none; }

.btn-info {
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 22px; border:none; border-radius:8px;
  font-size:13px; font-weight:700; cursor:pointer;
  background:#27ae60; color:#fff;
  transition:background .15s, transform .1s, box-shadow .15s;
  box-shadow:0 2px 8px rgba(39,174,96,.25);
}
.btn-info:hover:not(:disabled) {
  background:#219150; transform:translateY(-1px);
  box-shadow:0 4px 14px rgba(39,174,96,.35);
}
.btn-info:active:not(:disabled) { transform:translateY(0); }
.btn-info:disabled { opacity:.5; cursor:not-allowed; box-shadow:none; }

.step-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
}

.step-hint {
    font-size: 12.5px;
    color: var(--text-muted);
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0 0 14px;
    line-height: 1.45;
}

.step-hint i {
    color: var(--blue);
    margin-right: 6px;
}

/* Modern success modal (matches the provided image) */
.modern-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.modern-modal {
    background: #ffffff;
    border-radius: 24px;
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.success-badge {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #a8e6cf, #88d8b0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(168, 230, 207, 0.4);
}
.success-badge i {
    font-size: 56px;
    color: #1b5e20;
}
.modern-modal h3 {
    margin: 0 0 0.5rem;
    color: #1a2b3c;
    font-size: 1.5rem;
    font-weight: 700;
}
.modern-modal p {
    margin: 0 0 2rem;
    color: #6b7a8d;
    font-size: 0.95rem;
    line-height: 1.5;
}
.modern-modal-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: #1a2b3c;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.modern-modal-btn:hover {
    background: #0f1d2a;
    transform: translateY(-1px);
}
.modern-modal-btn:active {
    transform: translateY(0);
}

/* Optimized button styles for tenant input popups */
.tenant-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.tenant-modal-btn-primary {
    background: #27ae60;
    color: white;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.25);
}
.tenant-modal-btn-primary:hover {
    background: #219150;
    transform: translateY(-1px);
}
.tenant-modal-btn-secondary {
    background: #ecf0f1;
    color: #34495e;
}
.tenant-modal-btn-secondary:hover {
    background: #dfe6e9;
}
.tenant-modal-btn-danger {
    background: #e74c3c;
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.25);
}
.tenant-modal-btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* ── Responsive Styles ───────────────────────────────────────── */
@media (max-width: 1024px) {
    :root {
        --sidebar-w: 200px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-w: 60px;
    }
}

/* Make dashboard cards responsive */
@media (max-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/* modal responsive — handled in Modal redesign section */

/* Make table responsive */
@media (max-width: 640px) {
    .table-wrapper {
        overflow-x: auto;
    }
    .table-wrapper table {
        min-width: 600px;
    }
    .tenants-table {
        min-width: 880px;
    }
}

/* Make buttons responsive */
@media (max-width: 480px) {
    .btn-save, .btn-cancel, .btn-edit, .btn-delete, .btn-add {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Make form fields responsive */
@media (max-width: 480px) {
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ── Global Progress Bar ───────────────────────────────────────── */
#global-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--blue), #27ae60);
  z-index: 99999;
  box-shadow: 0 0 10px rgba(43, 123, 200, 0.7);
  transition: width 0.1s ease-out, opacity 0.3s ease-out;
  opacity: 0;
}

#global-progress.active {
  opacity: 1;
}

/* ── Skeleton Loaders (Enhanced) ───────────────────────────────── */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  50% {
    background-position: calc(100% + 200px) 0;
  }
  100% {
    background-position: -200px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-bg) 0px,
    var(--skeleton-highlight) 60px,
    var(--skeleton-bg) 120px
  );
  background-size: 300px 100%;
  animation: skeleton-loading 1.8s ease-in-out infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-text.short {
  width: 45%;
}

.skeleton-text.medium {
  width: 70%;
}

.skeleton-card {
  padding: 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.skeleton-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-rect {
  width: 100%;
  height: 120px;
  border-radius: var(--radius);
}

.skeleton-dashboard-card {
  padding: 18px 16px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Optimistic UI indicators */
.optimistic-item {
  opacity: 0.7;
  border: 2px dashed var(--blue);
  border-radius: var(--radius);
  position: relative;
}

.optimistic-item::after {
  content: 'Saving...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Password Strength Indicator ─────────────────────────────────── */
.password-strength-container {
  margin-top: 8px;
  margin-bottom: 12px;
}

.password-strength-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.password-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.3s ease, background 0.3s ease;
}

.password-strength-text {
  font-size: 12px;
  color: var(--text-muted);
}

.password-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}

.password-requirement {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.password-requirement.valid {
  color: #27ae60;
}

.password-requirement .req-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 10px;
  background: var(--border);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.password-requirement.valid .req-icon {
  background: #27ae60;
  color: white;
}


/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Segoe UI',system-ui,Arial,sans-serif; background:var(--bg); color:var(--text); font-size:14px; }
a { color:var(--blue); text-decoration:none; }

/* ── Splash Screen ───────────────────────────────────────────── */
#splash-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(145deg, #0f2d52 0%, #1a4a80 60%, #2b7bc8 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease-out;
}

.splash-container {
  text-align: center;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#splash-logo {
  width: 280px;
  height: 280px;
  margin-bottom: 24px;
  display: block;
  object-fit: contain;
  border-radius: 0;
  transform-origin: center center;
  will-change: transform, opacity;
}

/*
 * Heartbeat — mimics a real cardiac lub-dub:
 *   first beat  (big)  →  0 % – 18 %
 *   second beat (small) → 28 % – 42 %
 *   long diastole      → 42 % – 100 %
 */
@keyframes heartbeat {
  0%   { transform: scale(1);    }
  9%   { transform: scale(1.28); }   /* lub  */
  18%  { transform: scale(1);    }
  28%  { transform: scale(1.15); }   /* dub  */
  40%  { transform: scale(1);    }
  100% { transform: scale(1);    }   /* rest */
}

.heartbeat {
  animation: heartbeat 1.05s ease-in-out infinite;
}

/* spinner fades in last */
.loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--orange);
  border-radius: 50%;
  margin: 0 auto;
  opacity: 0;
  animation: splashSpin 0.85s linear infinite,
             splashFadeUp 0.4s ease 0.65s forwards;
}

@keyframes splashSpin {
  to { transform: rotate(360deg); }
}

/* ── Password toggle wrapper ─────────────────────────────────── */
.pw-wrap {
  position: relative;
  margin: 8px 0;
}

/* the input inside a pw-wrap must fill the width and leave room for the eye icon */
.pw-wrap input[type="password"],
.pw-wrap input[type="text"] {
  width: 100%;
  padding-right: 42px;   /* stop text going under the button */
  margin: 0;             /* pw-wrap owns the margin */
}

.pw-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
  transition: color .15s;
  padding: 0;
}
.pw-toggle:hover { color: var(--blue); }
.pw-toggle:focus { outline: none; }
.auth-container {
  display:flex; justify-content:center; align-items:center;
  min-height:100vh;
  background: linear-gradient(145deg, var(--sidebar-bg) 0%, #1a4a80 60%, var(--blue) 100%);
}

.auth-card {
  background:var(--white); border-radius:16px;
  width:92%; max-width:520px;
  box-shadow:0 8px 40px rgba(0,0,0,.25);
  overflow:hidden;
}

/* logo banner at top of auth card */
.auth-logo-banner {
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--blue) 100%);
  padding:20px 24px 0;
  display:flex; 
  flex-direction:column; 
  align-items:center; 
  gap:0;
}

.auth-logo-banner img { 
  width:260px; 
  height:auto; 
  object-fit:contain;
  border-radius: 0;
  display:block;
  margin-bottom:0;
}

@media (max-width: 480px) {
  .auth-logo-banner img {
    width:200px;
  }
}

.auth-logo-banner .brand-name {
  font-size:1.25rem; font-weight:800; letter-spacing:.5px;
  text-transform:uppercase;
}

.auth-logo-banner .brand-tagline {
  font-size:.78rem; color:#b0c8e8; letter-spacing:1px;
}

.auth-form-body { padding:28px 28px 24px; }

.auth-form-body h2 {
  font-size:1.1rem; color:var(--text); margin-bottom:6px; font-weight:700;
}

.auth-form-body p.auth-sub {
  font-size:.82rem; color:var(--text-muted); margin-bottom:20px;
}

.auth-card input, .auth-card select {
  width:100%; padding:11px 13px; margin:8px 0;
  border:1.5px solid var(--border); border-radius:6px;
  font-size:14px; background:var(--white); color:var(--text);
  transition:border .2s;
}

.auth-card input:focus, .auth-card select:focus {
  outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(43,123,200,.15);
}

.auth-card button#authBtn,
.auth-card button#flSetBtn,
.auth-card button[type=submit] {
  width:100%; padding:12px; margin-top:14px;
  background:var(--orange); color:var(--white);
  border:none; border-radius:7px; font-size:15px; font-weight:700;
  cursor:pointer; letter-spacing:.3px;
  transition:background .2s, transform .1s;
}

.auth-card button#authBtn:hover,
.auth-card button#flSetBtn:hover,
.auth-card button[type=submit]:hover { background:var(--orange-dark); transform:translateY(-1px); }
.auth-card button#authBtn:active,
.auth-card button#flSetBtn:active,
.auth-card button[type=submit]:active { transform:translateY(0); }
.auth-card button#authBtn:disabled,
.auth-card button#flSetBtn:disabled,
.auth-card button[type=submit]:disabled { background:#bbb; cursor:not-allowed; transform:none; }

.auth-card .error {
  background:#fff0ee; border:1px solid #f5c0b0; color:#c0392b;
  padding:9px 12px; border-radius:6px; font-size:13px; margin-top:10px;
}

/* ── App Header ──────────────────────────────────────────────── */
.app-header {
  background: linear-gradient(90deg, var(--sidebar-bg) 0%, #1e5085 100%);
  color:var(--white); padding:0 20px 0 16px;
  height:var(--header-h);
  display:flex; justify-content:space-between; align-items:center;
  position:fixed; top:0; left:0; right:0; z-index:200;
  box-shadow:0 2px 10px rgba(0,0,0,.2);
  gap:16px;
}

.header-logo {
  display:flex; align-items:center; gap:12px;
  min-width:0;
  flex:1;
}

.header-logo svg { width:36px; height:36px; flex-shrink:0; }

.header-logo img {
  width:100px;
  height:58px;
  object-fit:contain;
  object-position:left center;
  border-radius:0;
  display:block;
  flex-shrink:0;
}

.header-brand {
  display:flex;
  flex-direction:column;
  line-height:1.08;
  min-width:0;
}
.header-brand .brand-name {
  font-size:1rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  white-space:nowrap;
}

/* ── Split brand colours (used in nav header + auth cards) ─── */
.brand-primme   { color: var(--orange); }
.brand-holdings { color: var(--white); }
.header-brand .brand-tagline {
  font-size:.55rem;
  color:#b8d1ec;
  letter-spacing:.14em;
  white-space:nowrap;
}

.header-right { display:flex; align-items:center; gap:12px; flex-shrink:0; }

.header-user { font-size:.8rem; color:#b0c8e8; }
.header-user strong { color:var(--white); }
.header-role-badge {
  font-size:.68rem; padding:2px 8px; border-radius:10px; font-weight:600; letter-spacing:.3px;
}
.header-role-badge.superadmin { background:var(--orange); color:#fff; }
.header-role-badge.team { background:var(--blue); color:#fff; }

.logout-btn {
  background:rgba(255,255,255,.12); color:var(--white);
  border:1px solid rgba(255,255,255,.25); padding:6px 14px;
  border-radius:6px; cursor:pointer; font-size:12px; font-weight:600;
  transition:background .2s;
  display:inline-flex; align-items:center; gap:8px;
}
.logout-btn:hover { background:rgba(232,97,10,.7); border-color:var(--orange); }

.header-install-btn {
  background:rgba(255,255,255,.12);
  color:var(--white);
  border:1px solid rgba(255,255,255,.25);
  padding:6px 14px;
  border-radius:6px;
  cursor:pointer;
  font-size:12px;
  font-weight:600;
  transition:background .2s, border-color .2s, opacity .2s;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.header-install-btn:hover { background:rgba(43,123,200,.65); border-color:#8ab0d8; }

/* ── Notification Bell ─────────────────────────────────────────────────────── */
.notif-bell-wrap {
  position:relative;
  display:flex;
  align-items:center;
}

.notif-bell-btn {
  position:relative;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.25);
  color:var(--white);
  width:36px; height:36px;
  border-radius:8px;
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-size:15px;
  transition:background .2s, transform .15s;
  flex-shrink:0;
}
.notif-bell-btn:hover { background:rgba(43,123,200,.6); transform:scale(1.05); }

.notif-bell-badge {
  position:absolute;
  top:-6px; right:-6px;
  background:#e74c3c;
  color:#fff;
  font-size:10px; font-weight:700;
  min-width:18px; height:18px;
  border-radius:9px;
  display:flex; align-items:center; justify-content:center;
  padding:0 4px;
  border:2px solid var(--primary);
  pointer-events:none;
  line-height:1;
}

/* Dropdown panel */
.notif-dropdown {
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  width:340px;
  background:#fff;
  border-radius:14px;
  box-shadow:0 12px 40px rgba(10,22,45,.22), 0 2px 8px rgba(10,22,45,.1);
  z-index:2000;
  overflow:hidden;
  animation:notifIn .18s cubic-bezier(.34,1.2,.64,1);
}
@keyframes notifIn {
  from { opacity:0; transform:translateY(-8px) scale(.97); }
  to   { opacity:1; transform:none; }
}

.notif-dropdown-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px 10px;
  border-bottom:1px solid #f0f3f8;
}
.notif-dropdown-title {
  font-weight:700;
  font-size:14px;
  color:#1a2535;
}
.notif-mark-all-btn {
  background:none;
  border:none;
  font-size:11px;
  color:#2b7bc8;
  cursor:pointer;
  font-weight:600;
  padding:3px 6px;
  border-radius:5px;
  transition:background .15s;
}
.notif-mark-all-btn:hover { background:#f0f6ff; }

.notif-dropdown-list {
  max-height:380px;
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:#dde3ec transparent;
}

.notif-empty {
  padding:32px 16px;
  text-align:center;
  color:#8896a5;
  font-size:13px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.notif-item {
  display:flex;
  align-items:flex-start;
  gap:11px;
  padding:12px 16px;
  border-bottom:1px solid #f4f7fb;
  cursor:pointer;
  transition:background .12s;
  position:relative;
}
.notif-item:last-child { border-bottom:none; }
.notif-item:hover { background:#f8fafc; }
.notif-item.notif-unread { background:#f0f6ff; }
.notif-item.notif-unread:hover { background:#e8f1fd; }

.notif-item-icon {
  width:34px; height:34px;
  border-radius:9px;
  display:flex; align-items:center; justify-content:center;
  font-size:13px;
  flex-shrink:0;
  margin-top:1px;
}

.notif-item-body { flex:1; min-width:0; }
.notif-item-title {
  font-weight:600;
  font-size:12.5px;
  color:#1a2535;
  margin-bottom:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.notif-item-msg {
  font-size:11.5px;
  color:#4a5568;
  line-height:1.45;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.notif-item-time {
  font-size:10.5px;
  color:#8896a5;
  margin-top:4px;
}

.notif-unread-dot {
  width:8px; height:8px;
  border-radius:50%;
  background:#2b7bc8;
  flex-shrink:0;
  margin-top:4px;
}

@media (max-width:480px) {
  .notif-dropdown { width:calc(100vw - 24px); right:-12px; }
}
.header-install-btn:disabled { opacity:.7; cursor:default; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.app-layout { display:flex; margin-top:var(--header-h); min-height:calc(100vh - var(--header-h)); }

.sidebar {
  width:var(--sidebar-w);
  background:var(--sidebar-bg);
  position:fixed; left:0; top:var(--header-h); bottom:0;
  overflow-y:auto; overflow-x:hidden;
  transition:transform .3s ease, width .25s ease;
  z-index:150;
  box-shadow:3px 0 15px rgba(0,0,0,.18);
}

.sidebar.collapsed { width:60px; }
.sidebar.collapsed .sidebar-menu li span,
.sidebar.collapsed .sidebar-section-label { display:none; }
.sidebar.collapsed .sidebar-menu li i { margin:0 auto; }

/* Mobile sidebar overlay */
.sidebar-overlay {
  display:none;
  position:fixed;
  top:var(--header-h); left:0; right:0; bottom:0;
  background:rgba(0,0,0,.5);
  z-index:140;
  backdrop-filter:blur(2px);
  pointer-events:none;
  transition:opacity .28s;
  opacity:0;
}

.sidebar-overlay.active {
  display:block;
  pointer-events:auto;
  opacity:1;
}

/* Hamburger button (visible on mobile only) */
.sidebar-toggle {
    position:absolute; left:16px; top:50%; transform:translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor:pointer; display:none; align-items:center; justify-content:center;
    color:var(--white); font-size:22px; z-index:210;
    padding:10px 12px;
    transition: all .2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.05);
}
.sidebar-toggle:active {
    transform: translateY(-50%) scale(0.98);
}

/* Desktop toggle (original circular button) */
.sidebar-toggle-desktop {
    position:absolute; right:-13px; top:22px;
    background:var(--orange); border:2px solid var(--white);
    border-radius:50%; width:26px; height:26px;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    color:var(--white); font-size:11px; z-index:160;
    transition:background .2s;
}
.sidebar-toggle-desktop:hover { background:var(--orange-dark); }

/* Mobile-specific styles */
@media (max-width:768px) {
    .sidebar-toggle { display:flex; }
    .sidebar-toggle-desktop { display:none; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        width: 280px;
        box-shadow: 4px 0 24px rgba(0,0,0,.35);
        /* Always start off-screen on mobile */
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        z-index: 150;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Prevent collapsed class from interfering on mobile */
    .sidebar.collapsed {
        width: 280px;
        transform: translateX(-100%);
    }
    .sidebar.collapsed.mobile-open {
        transform: translateX(0);
    }

    .main-content-area {
        margin-left: 0 !important;
    }

    .header-logo {
        margin-left: 58px;
    }

    .header-logo img {
        width: 80px;
        height: 48px;
    }

    /* hide tagline text in the header on small screens */
    .header-brand .brand-tagline {
        display: none;
    }

    /* Hide brand name entirely on mobile (phone view) */
    .header-brand .brand-name {
        display: none;
    }
    .header-brand .brand-name .brand-holdings::before {
        display: none;
    }

    /* Shrink user name and role badge */
    .header-user {
        display: none; /* hide username entirely on very small screens */
    }
    .header-role-badge {
        font-size: .58rem;
        padding: 2px 6px;
    }

    /* Install button: icon only */
    .header-install-btn .install-btn-text {
        display: none;
    }
    .header-install-btn {
        padding: 6px 9px;
        gap: 0;
    }

    /* Logout button: icon only on mobile */
    .logout-btn .logout-btn-text {
        display: none;
    }
    .logout-btn {
        padding: 6px 9px;
        gap: 0;
    }

    /* Tighten right-side gap */
    .header-right {
        gap: 6px;
    }
}

/* Phone-specific styles (very small screens) */
@media (max-width: 480px) {
    /* Even more compact header for phone view */
    .app-header {
        padding: 0 10px;
        height: 48px;
    }
    
    /* Smaller logo for phone */
    .header-logo img {
        width: 60px !important;
        height: 36px !important;
        margin-left: 0 !important;
    }
    
    /* Remove left margin for logo on very small screens */
    .header-logo {
        margin-left: 40px !important;
    }
    
    /* Even smaller role badge */
    .header-role-badge {
        font-size: 0.5rem !important;
        padding: 1px 4px !important;
    }
    
    /* Smaller install button */
    .header-install-btn {
        padding: 4px 6px !important;
        font-size: 0.6rem !important;
    }

    /* Smaller logout button */
    .logout-btn {
        padding: 4px 6px !important;
        font-size: 0.65rem !important;
    }
    
    /* Hide sidebar toggle icon text if any */
    .sidebar-toggle span {
        display: none;
    }
}

/* Desktop styles */
@media (min-width:769px) {
  .sidebar-overlay { display:none !important; }
}

.sidebar-section-label {
  font-size:.65rem; letter-spacing:1.2px; text-transform:uppercase;
  color:#4a6f9a; padding:16px 18px 4px; font-weight:700;
}

.sidebar-menu { list-style:none; padding:10px 0 20px; }

.sidebar-menu li {
  padding:11px 18px; cursor:pointer;
  display:flex; align-items:center; gap:11px;
  color:#8ab0d8; font-size:.86rem; font-weight:500;
  transition:all .18s; border-left:3px solid transparent;
  white-space:nowrap; overflow:hidden;
  position:relative;
}

.sidebar-menu li i { width:20px; font-size:1rem; text-align:center; flex-shrink:0; }

.sidebar-menu li:hover { background:rgba(43,123,200,.15); color:var(--white); border-left-color:var(--blue); }

.sidebar-menu li.active {
  background:rgba(43,123,200,.15);
  color:var(--white); border-left-color:var(--blue); font-weight:600;
}

.sidebar-menu li.active i { color:var(--blue); }


.main-content-area {
  flex:1; margin-left:var(--sidebar-w);
  padding:24px; transition:margin-left .25s ease;
  max-width:100%; overflow-x:hidden;
}

/* When sidebar is collapsed, push content to 60px */
.app-layout.sidebar-collapsed .main-content-area { margin-left:60px; }

/* Mobile: no left margin — sidebar overlays */
@media (max-width:768px) {
  .main-content-area { margin-left:0 !important; }
}

/* ── Page headings ───────────────────────────────────────────── */
.page-header {
  display:flex; justify-content:space-between; align-items:center;
  flex-wrap:wrap; gap:12px; margin-bottom:22px;
}
.page-header h2 {
  font-size:1.25rem; font-weight:700; color:var(--text);
  display:flex; align-items:center; gap:8px;
}
.page-header h2 i { color:var(--blue); font-size:1.1rem; }

/* ── Cards (dashboard stats) ─────────────────────────────────── */
.cards {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:16px; margin-bottom:24px;
}

.card {
  background:var(--white); padding:18px 16px; border-radius:var(--radius);
  border:1px solid var(--border); box-shadow:var(--shadow-sm);
  transition:transform .2s, box-shadow .2s;
}

.card.clickable { cursor:pointer; }
.card.clickable:hover { transform:translateY(-3px); box-shadow:var(--shadow); border-color:var(--blue); }

.card h4 { font-size:.72rem; color:var(--text-muted); margin-bottom:8px; font-weight:600; letter-spacing:.4px; text-transform:uppercase; }
.card .value { font-size:1.6rem; font-weight:800; color:var(--text); }
.card .card-sub { font-size:.75rem; color:var(--text-muted); margin-top:5px; }

.card.card-blue  { border-top:3px solid var(--blue); }
.card.card-orange{ border-top:3px solid var(--orange); }
.card.card-green { border-top:3px solid #27ae60; }
.card.card-red   { border-top:3px solid #e74c3c; }

/* Glassmorphism variables and background */
body {
  background: linear-gradient(135deg, #f0f4f9 0%, #e0e9f3 100%);
  background-attachment: fixed;
}

/* dashboard container */
.dashboard-container { width: 100%; max-width: none; }
.dashboard-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:20px; margin-bottom:24px; }
.dashboard-card {
  background: var(--white);
  padding:18px 16px; border-radius:16px;
  border:1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor:pointer;
  transition:transform .2s, box-shadow .2s;
}
.dashboard-card:hover { 
  transform:translateY(-3px); 
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); 
}
.dashboard-card h4 { font-size:.72rem; color:var(--text-muted); margin-bottom:8px; letter-spacing:.3px; text-transform:uppercase; }
.dashboard-card .card-value { font-size:1.5rem; font-weight:800; }
.dashboard-card .card-sub { font-size:.75rem; color:var(--text-muted); margin-top:5px; }

/* chart section */
.chart-section { 
  background: var(--white);
  border-radius:16px; 
  padding:20px; 
  border:1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.chart-section h3 { font-size:.9rem; font-weight:700; color:var(--text); margin-bottom:16px; }
.chart-wrapper { height:280px; position:relative; }

.pie-container { display:flex; align-items:center; gap:12px; margin-top:8px; }
.pie-labels { font-size:.75rem; }
.pie-label { display:flex; align-items:center; gap:6px; margin-bottom:4px; }
.pie-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.pie-dot.green { background:#27ae60; }
.pie-dot.red   { background:#e74c3c; }
.pie-dot.grey  { background:#95a5a6; }
.pie-dot.blue  { background:var(--blue); }
.pie-totals { margin-top:6px; display:flex; flex-direction:column; gap:2px; color:var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-add {
  background:var(--orange); color:var(--white);
  border:none; padding:9px 18px; border-radius:6px;
  cursor:pointer; font-size:13px; font-weight:600;
  transition:background .18s, transform .1s;
  display:inline-flex; align-items:center; gap:6px;
}
.btn-add:hover { background:var(--orange-dark); transform:translateY(-1px); }

.btn-add.secondary {
  background:var(--blue); 
}
.btn-add.secondary:hover { background:var(--blue-dark); }

.btn-add.success { background:#27ae60; }
.btn-add.success:hover { background:#219150; }

.btn-add.danger { background:#e74c3c; }
.btn-add.danger:hover { background:#c0392b; }

.btn-add.outline {
  background:transparent; color:var(--blue);
  border:1.5px solid var(--blue);
}
.btn-add.outline:hover { background:var(--blue-light); transform:none; }

/* ── Shared table-action button base ─────────────────────────── */
.btn-edit,
.btn-view,
.btn-remind {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn-edit:hover,
.btn-view:hover,
.btn-remind:hover { transform: translateY(-1px); }

.btn-edit   { background: var(--blue);  color: var(--white); }
.btn-edit:hover   { background: var(--blue-dark); }

.btn-view   { background: #27ae60; color: var(--white); }
.btn-view:hover   { background: #219150; }

.btn-remind { background: var(--orange); color: var(--white); }
.btn-remind:hover { background: var(--orange-dark); }

/* action-buttons cell — keep inline buttons neatly spaced */
.action-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* btn-danger — defined in Modal redesign section below */

/* btn-save and btn-cancel are defined in the Modal redesign section below */

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrapper { 
  overflow-x:auto; 
  width:100%; 
  margin-top:16px; 
  border-radius:12px; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

table {
  width:100%; 
  background:var(--white); 
  border-collapse:separate; 
  border-spacing:0;
  border-radius:12px; 
  overflow:hidden;
  border:none; 
  font-size:12px;
}

th, td { 
  padding:9px 11px; 
  text-align:left; 
  border-bottom:1px solid #f0f4f9; 
}

th {
  background:#f8fafc;
  color:#475569; 
  font-weight:700; 
  font-size:11px;
  letter-spacing:.4px; 
  text-transform:uppercase;
  position:sticky;
  top:0;
  z-index:10;
}

tr:hover td { 
  background:#f8fbff; 
}
tr:last-child td { 
  border-bottom:none; 
}
tr:hover {
  background:#f8fbff;
}

/* Status badges */
.badge {
  display:inline-block; padding:3px 8px; border-radius:12px;
  font-size:.65rem; font-weight:700; letter-spacing:.25px; text-transform:uppercase;
}
.badge-green  { background:#e6f8ee; color:#1a8244; }
.badge-red    { background:#fdecea; color:#c0392b; }
.badge-orange { background:#fff3e6; color:#d4890a; }
.badge-blue   { background:var(--blue-light); color:var(--blue-dark); }
.badge-grey   { background:#f0f0f0; color:#666; }

/* ── Table row / pill status classes ──────────────────────────── */
/* Used by billing, invoices, payments, messages tables */
.status-active  { display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.2px;background:#d1fae5;color:#065f46; }
.status-partial { display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.2px;background:#fef3c7;color:#92400e; }
.status-unpaid  { display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.2px;background:#fee2e2;color:#991b1b; }
.status-manual  { display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.2px;background:#ede9fe;color:#5b21b6; }
.status-pending { display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.2px;background:#dbeafe;color:#1e40af; }
.status-vacated { display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.2px;background:#f3f4f6;color:#6b7280; }

/* ── Tenants table column widths ─────────────────────────────── */
.tenants-table {
  table-layout: fixed;
  width: 100%;
}
.tenants-table thead th:nth-child(1),
.tenants-table tbody td:nth-child(1) { width: 42px;  text-align: center; }   /* # */
.tenants-table thead th:nth-child(2),
.tenants-table tbody td:nth-child(2) { width: 150px; }                         /* Name */
.tenants-table thead th:nth-child(3),
.tenants-table tbody td:nth-child(3) { width: 110px; }                         /* Phone */
.tenants-table thead th:nth-child(4),
.tenants-table tbody td:nth-child(4) { width: 160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } /* Property */
.tenants-table thead th:nth-child(5),
.tenants-table tbody td:nth-child(5) { width: 90px; }                          /* Unit */
.tenants-table thead th:nth-child(6),
.tenants-table tbody td:nth-child(6) { width: 90px;  white-space:nowrap; }     /* Move-in */
.tenants-table thead th:nth-child(7),
.tenants-table tbody td:nth-child(7) { width: 145px; }                         /* Balance */
.tenants-table thead th:nth-child(8),
.tenants-table tbody td:nth-child(8) { width: 80px;  text-align: center; }    /* Status */
.tenants-table thead th:nth-child(9),
.tenants-table tbody td:nth-child(9) { width: 80px;  text-align: center; }    /* Actions */

/* Filters bar */
.filters {
  display:flex; gap:10px; margin-bottom:16px;
  flex-wrap:wrap; align-items:flex-end;
}

.filter-input, .filter-select {
  padding:8px 11px; border:1.5px solid var(--border); border-radius:6px;
  font-size:13px; background:var(--white); color:var(--text);
  transition:border .2s; flex:1; min-width:130px;
}
.filter-input:focus, .filter-select:focus {
  outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(43,123,200,.1);
}

/* Empty state */
.empty-state {
  text-align:center; padding:48px 20px; color:var(--text-muted);
  font-size:.95rem; background:var(--white); border-radius:var(--radius);
  border:1px dashed var(--border);
}
.empty-state i { font-size:2.5rem; margin-bottom:12px; display:block; color:#c8d6e8; }

/* ── Modal ───────────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════
   MODAL OVERLAY
   ═══════════════════════════════════════════════════════════════ */
.modal {
  display:none; position:fixed;
  top:0; left:0; width:100%; height:100%;
  background:rgba(10,22,45,.62); backdrop-filter:blur(5px) saturate(1.2);
  justify-content:center; align-items:flex-start; z-index:1000;
  padding:20px 16px;
  overflow-y:auto;
}

/* Lock body scroll when any modal is open */
body.modal-open { overflow:hidden; }

/* ── Modal card ──────────────────────────────────────────────── */
.modal-content {
  background:#fff;
  border-radius:18px;
  width:100%; max-width:520px;
  box-shadow:0 32px 80px rgba(10,22,45,.32), 0 4px 20px rgba(10,22,45,.12);
  animation:modalIn .24s cubic-bezier(.34,1.2,.64,1);
  padding:28px 28px 24px;
  margin:auto;
}

/* Wide modal variant for tables (e.g. unassigned tenants) */
.modal-content.modal-wide { max-width:860px; }

@keyframes modalIn {
  from { opacity:0; transform:translateY(-16px) scale(.97); }
  to   { opacity:1; transform:none; }
}

/* ── Modal header ────────────────────────────────────────────── */
.modal-header {
  padding:0 0 16px;
  border-bottom:1px solid var(--border);
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:20px;
}
.modal-header h3, .modal-content h3 {
  font-size:1.05rem; font-weight:700; color:var(--text);
  margin:0 0 20px; display:flex; align-items:center; gap:8px;
}
.modal-header h3 { margin:0; }
.modal-close {
  background:none; border:none; cursor:pointer; color:var(--text-muted);
  width:30px; height:30px; border-radius:6px;
  display:flex; align-items:center; justify-content:center;
  font-size:1.1rem; transition:background .15s, color .15s;
}
.modal-close:hover { background:#f0f0f0; color:var(--text); }

.modal-body { padding:0; }

/* ── Form labels inside modals ───────────────────────────────── */
.modal-content label {
  display:flex; align-items:center; gap:5px;
  margin-top:16px; margin-bottom:6px;
  font-weight:600; font-size:.72rem; color:#5a6473;
  letter-spacing:.5px; text-transform:uppercase;
}
.modal-content label .req {
  color:var(--orange); font-size:.8rem; line-height:1;
}

/* ── Text / select / textarea inputs ────────────────────────── */
.modal-content input:not([type=file]),
.modal-content select,
.modal-content textarea {
  width:100%; padding:10px 13px;
  border:1.5px solid #dde3ec; border-radius:9px;
  font-size:13.5px; background:#f8fafd; color:var(--text);
  transition:border .18s, box-shadow .18s, background .18s;
  outline:none;
  appearance:none; -webkit-appearance:none;
}
.modal-content input:not([type=file]):hover,
.modal-content select:hover,
.modal-content textarea:hover {
  border-color:#b0bcce; background:#fff;
}
.modal-content input:not([type=file]):focus,
.modal-content select:focus,
.modal-content textarea:focus {
  border-color:var(--blue); background:#fff;
  box-shadow:0 0 0 3.5px rgba(43,123,200,.13);
}
.modal-content textarea { min-height:80px; resize:vertical; line-height:1.5; }

/* select arrow */
.modal-content select {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a8d' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:36px;
}

/* ── File upload — custom styled ─────────────────────────────── */
.modal-content input[type=file] { display:none; }

.file-upload-label {
  display:flex; align-items:center; gap:10px;
  border:1.5px dashed #c5cfe0; border-radius:9px;
  padding:10px 14px; cursor:pointer;
  background:#f8fafd; transition:border .18s, background .18s;
  font-size:13px; color:#6b7a8d;
}
.file-upload-label:hover {
  border-color:var(--blue); background:#f0f6ff; color:var(--blue);
}
.file-upload-label .file-icon {
  width:32px; height:32px; border-radius:7px;
  background:rgba(43,123,200,.1); color:var(--blue);
  display:flex; align-items:center; justify-content:center;
  font-size:.95rem; flex-shrink:0; transition:background .18s;
}
.file-upload-label:hover .file-icon { background:rgba(43,123,200,.2); }
.file-upload-label .file-text { display:flex; flex-direction:column; gap:1px; min-width:0; }
.file-upload-label .file-text strong {
  font-size:12.5px; font-weight:600; color:var(--text);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.file-upload-label .file-text span { font-size:11px; color:#9aa5b4; }
.file-upload-label .file-badge {
  margin-left:auto; font-size:10.5px; font-weight:700;
  padding:2px 8px; border-radius:20px;
  background:rgba(43,123,200,.12); color:var(--blue);
  white-space:nowrap; flex-shrink:0;
}

/* file chosen state */
.file-upload-label.has-file {
  border-style:solid; border-color:#27ae60; background:#f0fff5;
}
.file-upload-label.has-file .file-icon { background:rgba(39,174,96,.15); color:#27ae60; }
.file-upload-label.has-file .file-badge { background:rgba(39,174,96,.15); color:#27ae60; }

/* ── Modal action buttons ─────────────────────────────────────── */
.modal-buttons {
  display:flex; justify-content:flex-end; align-items:center; gap:10px;
  margin-top:24px; padding-top:18px; border-top:1px solid var(--border);
}

.btn-cancel {
  padding:9px 20px; border:1.5px solid #dde3ec; border-radius:8px;
  font-size:13px; font-weight:600; cursor:pointer; color:#5a6473;
  background:#fff; transition:all .15s;
}
.btn-cancel:hover { background:#f5f7fa; border-color:#b0bcce; color:var(--text); }

.btn-save, .btn-primary-modal {
  padding:9px 22px; border:none; border-radius:8px;
  font-size:13px; font-weight:700; cursor:pointer;
  background:var(--orange); color:#fff;
  transition:background .15s, transform .1s, box-shadow .15s;
  box-shadow:0 2px 8px rgba(232,97,10,.25);
}
.btn-save:hover, .btn-primary-modal:hover {
  background:var(--orange-dark); transform:translateY(-1px);
  box-shadow:0 4px 14px rgba(232,97,10,.35);
}
.btn-save:active, .btn-primary-modal:active { transform:translateY(0); }

/* When btn-danger lives inside a modal footer, give it modal-scale sizing */
.modal-buttons .btn-danger {
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(231,76,60,.25);
}
.modal-buttons .btn-danger:hover:not(:disabled) {
  box-shadow: 0 4px 14px rgba(231,76,60,.35);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: #e74c3c;
  color: #fff;
  transition: background .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(231,76,60,.2);
  white-space: nowrap;
}
.btn-danger:hover:not(:disabled) { background: #c0392b; transform: translateY(-1px); }
.btn-danger:active { transform: translateY(0); }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

/* temp-password display box */
.temp-pw-box {
  background:#f5f8ff; border:2px dashed var(--blue);
  border-radius:10px; padding:16px; margin-top:14px; text-align:center;
}
.temp-pw-box .pw-value {
  font-size:1.5rem; font-weight:800; letter-spacing:4px;
  color:var(--blue-dark); font-family:monospace; margin:6px 0;
}
.temp-pw-box small { color:var(--orange); font-size:.78rem; font-weight:600; }

/* ═══════════════════════════════════════════════════════════════
   ALERT / CONFIRM MODALS
   ═══════════════════════════════════════════════════════════════ */
.custom-modal-overlay {
  position:fixed; top:0; left:0; width:100%; height:100%;
  background:rgba(10,22,45,.55); display:flex;
  justify-content:center; align-items:center; z-index:2000;
  backdrop-filter:blur(3px); padding:16px;
}

.custom-modal {
  background:#fff; border-radius:16px; padding:32px 28px 24px;
  width:100%; max-width:390px;
  box-shadow:0 24px 64px rgba(10,22,45,.28);
  animation:modalIn .22s cubic-bezier(.34,1.3,.64,1);
  text-align:center;
}

.custom-modal-header {
  display:flex; flex-direction:column; align-items:center;
  margin-bottom:14px; gap:12px;
}

.custom-modal-icon {
  width:56px; height:56px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:1.4rem; color:#fff;
  box-shadow:0 4px 16px rgba(0,0,0,.15);
}
.custom-modal-icon.success { background:linear-gradient(135deg,#27ae60,#2ecc71); }
.custom-modal-icon.error   { background:linear-gradient(135deg,#c0392b,#e74c3c); }
.custom-modal-icon.warning { background:linear-gradient(135deg,var(--orange-dark),var(--orange)); }
.custom-modal-icon.info    { background:linear-gradient(135deg,var(--blue-dark),var(--blue)); }
.custom-modal-icon.confirm { background:linear-gradient(135deg,var(--blue-dark),var(--blue)); }
.custom-modal-icon.danger  { background:linear-gradient(135deg,var(--orange-dark),var(--orange)); }

.custom-modal-title { font-size:1.1rem; font-weight:700; color:var(--text); }

.custom-modal-body {
  color:var(--text-muted); font-size:.9rem; line-height:1.6;
  margin-bottom:22px;
}

.custom-modal-footer { display:flex; justify-content:center; gap:10px; flex-wrap:wrap; }

.custom-modal-btn {
  padding:10px 26px; border:none; border-radius:8px;
  font-size:13.5px; font-weight:700; cursor:pointer;
  transition:background .15s, transform .1s;
  min-width:100px;
}
.custom-modal-btn:active { transform:scale(.97); }
.custom-modal-btn.primary { background:var(--orange); color:#fff; box-shadow:0 2px 8px rgba(232,97,10,.3); }
.custom-modal-btn.primary:hover { background:var(--orange-dark); }
.custom-modal-btn.secondary { background:var(--blue); color:#fff; border:none; box-shadow:0 2px 8px rgba(43,123,200,.3); }
.custom-modal-btn.secondary:hover { background:var(--blue-dark); }
.custom-modal-btn.danger { background:#e74c3c; color:#fff; box-shadow:0 2px 8px rgba(231,76,60,.3); }
.custom-modal-btn.danger:hover { background:#c0392b; }

/* ═══════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════ */
.pagination {
  display:flex; justify-content:center; align-items:center;
  gap:6px; margin-top:20px; padding:12px 0;
}
.pagination button {
  background:#fff; border:1.5px solid var(--border);
  padding:7px 14px; border-radius:7px; cursor:pointer;
  font-size:13px; color:var(--text); font-weight:600; transition:all .15s;
}
.pagination button:hover:not(:disabled) {
  background:var(--blue); color:#fff; border-color:var(--blue);
}
.pagination button:disabled { opacity:.4; cursor:not-allowed; }
.pagination .page-info {
  padding:7px 14px; background:var(--blue-light); border-radius:7px;
  font-size:13px; color:var(--blue-dark); font-weight:600;
}

/* ═══════════════════════════════════════════════════════════════
   FORM GROUPS (content area forms)
   ═══════════════════════════════════════════════════════════════ */
.form-row { display:flex; gap:12px; flex-wrap:wrap; }
.form-row > * { flex:1; min-width:160px; }

.form-group { margin-bottom:16px; }
.form-group label {
  display:block; font-size:.72rem; font-weight:700;
  color:#5a6473; margin-bottom:6px;
  letter-spacing:.5px; text-transform:uppercase;
}
.form-group input,
.form-group select,
.form-group textarea {
  width:100%; padding:10px 13px;
  border:1.5px solid #dde3ec; border-radius:9px;
  font-size:13.5px; background:#f8fafd; color:var(--text);
  transition:border .18s, box-shadow .18s, background .18s;
  outline:none; appearance:none; -webkit-appearance:none;
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { border-color:#b0bcce; background:#fff; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color:var(--blue); background:#fff;
  box-shadow:0 0 0 3.5px rgba(43,123,200,.13);
}

/* ── Number input: remove spinners ───────────────────────────── */
input[type=number] { -moz-appearance:textfield; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }

/* ── Modal mobile responsive ─────────────────────────────────── */
@media (max-width: 600px) {
  .modal {
    padding:12px;
    align-items:center;      /* centered vertically — not bottom-sheet */
  }
  .modal-content {
    border-radius:16px;      /* full rounding on all four corners */
    max-height:90vh;
    padding:20px 16px 16px;
  }
  .modal-buttons { flex-wrap:wrap; }
  .modal-buttons .btn-cancel,
  .modal-buttons .btn-save,
  .modal-buttons .btn-danger { flex:1; min-width:120px; justify-content:center; }
}


/* ── Settings panel cards ────────────────────────────────────── */
.settings-card {
  background:var(--white); border-radius:var(--radius);
  border:1px solid var(--border); padding:20px; margin-bottom:16px;
  box-shadow:var(--shadow-sm);
}
.settings-card h3 { font-size:.95rem; font-weight:700; color:var(--text); margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--border); }

/* -- Settings page - card grid --------------------------------- */
.stg-grid-page {
  max-width: 900px;
}

/* Group heading */
.stg-group {
  margin-bottom: 32px;
}
.stg-group-title {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Card grid */
.stg-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

/* Individual card */
.stg-card-item {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
  cursor: default;
}
.stg-card-item:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 12px rgba(43,123,200,.1);
}
.stg-card-item.stg-card-open {
  border-color: var(--blue);
  box-shadow: 0 4px 18px rgba(43,123,200,.13);
}

/* Card face (always visible, clickable row) */
.stg-card-face {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
}

/* Icon badge */
.stg-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform .15s;
}
.stg-card-face:hover .stg-card-icon {
  transform: scale(1.08);
}

/* Text block */
.stg-card-text { flex: 1; min-width: 0; }
.stg-card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stg-card-desc {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Chevron arrow */
.stg-card-chevron {
  font-size: .72rem;
  color: #cbd5e1;
  flex-shrink: 0;
  transition: transform .22s, color .15s;
}
.stg-card-face:hover .stg-card-chevron { color: var(--blue); }
.stg-card-item.stg-card-open .stg-card-chevron {
  transform: rotate(90deg);
  color: var(--blue);
}

/* Inline panel (expands below card face) */
.stg-inline-panel {
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

/* Loading state inside panel */
.stg-panel-loading {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Content wrapper inside inline panels */
.stg-inline-content {
  padding: 18px 20px;
}

/* Toggle row (label + switch) */
.stg-inline-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.stg-inline-info { flex: 1; min-width: 160px; }
.stg-inline-label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.stg-inline-sub {
  font-size: .81rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Action row inside panels */
.stg-inline-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Notification prefs sub-sections */
.stg-notif-section {
  margin-bottom: 16px;
}
.stg-notif-section-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
}
.stg-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}

/* Checkbox label row */
.stg-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  color: var(--text);
  cursor: pointer;
  padding: 4px 0;
}
.stg-check-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  flex-shrink: 0;
  cursor: pointer;
}

/* SMS template rows */
.stg-template-row {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.stg-template-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  font-size: .9rem;
}
.stg-template-body {
  color: var(--text-muted);
  font-size: .82rem;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 6px;
  line-height: 1.5;
}

/* Notices (reused in inline panels) */
.stg-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: .82rem;
  line-height: 1.55;
  margin-bottom: 10px;
}
.stg-notice i { flex-shrink: 0; margin-top: 1px; }
.stg-notice.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.stg-notice.danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.stg-notice.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.stg-notice.info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Toggle switch */
.stg-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; }
.stg-toggle input { display: none; }
.stg-toggle-track {
  position: relative;
  width: 48px; height: 26px;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background .2s;
  flex-shrink: 0;
}
.stg-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s;
}
.stg-toggle input:checked + .stg-toggle-track { background: var(--success); }
.stg-toggle input:checked + .stg-toggle-track::after { transform: translateX(22px); }
.stg-toggle-label { font-size: .85rem; font-weight: 700; color: var(--text-muted); min-width: 56px; }

/* Responsive */
@media (max-width: 600px) {
  .stg-card-grid { grid-template-columns: 1fr; }
  .stg-check-grid { grid-template-columns: 1fr; }
  .stg-inline-content { padding: 14px 14px; }
  .stg-card-face { padding: 14px 14px; }
}


/* ── Team Member rows ────────────────────────────────────────── */
.team-member-card {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius); padding:14px 18px; margin-bottom:10px;
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  box-shadow:var(--shadow-sm); transition:border .2s;
}
.team-member-card:hover { border-color:var(--blue); }

.team-member-avatar {
  width:40px; height:40px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,var(--blue),var(--blue-dark));
  display:flex; align-items:center; justify-content:center;
  color:var(--white); font-weight:800; font-size:1rem; text-transform:uppercase;
}

.team-member-info { flex:1; min-width:140px; }
.team-member-info .name { font-weight:700; color:var(--text); font-size:.95rem; }
.team-member-info .uname { font-size:.8rem; color:var(--text-muted); }

/* Audit log highlight */
.audit-unread { background:#fffbf0 !important; border-left:3px solid var(--orange); }

/* Activity log action chips */
.action-chip {
  display:inline-block; padding:2px 9px; border-radius:10px;
  font-size:.7rem; font-weight:700; letter-spacing:.3px; text-transform:uppercase;
}
.action-chip.create  { background:#e6f8ee; color:#1a8244; }
.action-chip.update  { background:var(--blue-light); color:var(--blue-dark); }
.action-chip.delete  { background:#fdecea; color:#c0392b; }
.action-chip.generate{ background:#f3e9ff; color:#6a1fa0; }
.action-chip.assign  { background:#fff3e6; color:#d4890a; }
.action-chip.login   { background:#e8f8f5; color:#1a6644; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width:768px) {
  :root { --sidebar-w:200px; }
  .main-content-area { padding:14px; }
  .cards, .dashboard-cards { grid-template-columns:1fr 1fr; }
  .header-brand .brand-tagline { display:none; }
}

@media (max-width:480px) {
  .cards, .dashboard-cards { grid-template-columns:1fr; }
  .auth-form-body { padding:20px 16px 18px; }
  .modal-content { width:calc(100% - 16px); }
}

/* ── Print (receipts, reports) ───────────────────────────────── */
@media print {
  .app-header, .sidebar, .sidebar-toggle, .btn-add, .btn-edit, .btn-danger, .btn-cancel, .btn-save, .pagination { display:none !important; }
  .main-content-area { margin-left:0 !important; padding:0; }
  body { background:white; }
}

/* ── Offline Banner ──────────────────────────────────────────── */
#offline-banner {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 190;
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    color: #fff;
    padding: 7px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(231,76,60,.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ── Misc utilities ──────────────────────────────────────────── */
.text-blue   { color:var(--blue); }
.text-orange { color:var(--orange); }
.text-green  { color:#27ae60; }
.text-red    { color:#e74c3c; }
.text-muted  { color:var(--text-muted); }
.fw-bold { font-weight:700; }
.mt-8  { margin-top:8px; }
.mt-16 { margin-top:16px; }

/* ── Password Toggle ─────────────────────────────────────────── */
.pw-wrap { position:relative; }
.pw-wrap input { padding-right:40px !important; }
.pw-toggle { position:absolute; right:0; top:0; height:100%; width:38px; background:none; border:none; cursor:pointer; color:#6b7a8d; font-size:14px; display:flex; align-items:center; justify-content:center; padding:0; }
.pw-toggle:hover { color:#2b7bc8; }
.flex-gap { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

/* ── Add Team Member modal enhancements ──────────────────────── */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea,
.form-group.has-error .pw-wrap input {
  border-color:#e74c3c !important;
  background:#fff8f7;
  box-shadow:0 0 0 3px rgba(231,76,60,.12);
}
.field-error {
  display:none;
  font-size:12px;
  color:#e74c3c;
  margin-top:4px;
  padding-left:2px;
}

/* Info banner at top of modal */
.modal-info-banner {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12.5px;
  color:#4a6080;
  background:#eef4fb;
  border:1px solid #c7daf0;
  border-radius:8px;
  padding:9px 13px;
  margin-bottom:18px;
}
.modal-info-banner i { color:#3a7bd5; flex-shrink:0; }

/* Error banner below the form */
.modal-error-banner {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:#c0392b;
  background:#fdf2f2;
  border:1px solid #f5c6c6;
  border-radius:8px;
  padding:10px 14px;
  margin-top:10px;
}
.modal-error-banner i { flex-shrink:0; }

/* ── Action Dropdown ──────────────────────────────────────────── */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-dropdown-btn {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, transform 0.1s;
}

.action-dropdown-btn:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.action-dropdown-content {
  display: none;
  position: fixed;   /* fixed so it escapes overflow:hidden/auto parents */
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  min-width: 150px;
  z-index: 9999;
  overflow: hidden;
}

.action-dropdown-content.show {
  display: block;
}

.action-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.action-dropdown-item:hover {
  background: var(--blue-light);
}

.action-dropdown-item i {
  width: 16px;
  text-align: center;
}

.action-dropdown-item.edit {
  color: var(--blue);
}

.action-dropdown-item.view {
  color: #27ae60;
}

.action-dropdown-item.delete {
  color: #e74c3c;
}

/* ── Dropdown menu styles ──────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: #f5f7fa;
  border: 1px solid #dde3ec;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  color: #5a6473;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.dropdown-btn:hover {
  background: #eef4fb;
  border-color: var(--blue);
  color: var(--blue);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  min-width: 140px;
  z-index: 100;
  display: none;
  overflow: hidden;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  transition: background 0.1s;
}

.dropdown-item:hover {
  background: #f8fafc;
}

.dropdown-item i {
  width: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.dropdown-item-danger {
  color: #e74c3c;
}

.dropdown-item-danger:hover {
  background: #fdf2f2;
}

.dropdown-item-danger i {
  color: #e74c3c;
}

/* Success state that replaces the form */
.modal-success-state {
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  padding:12px 8px 4px;
}
.modal-success-state .success-icon {
  font-size:52px;
  color:#27ae60;
  line-height:1;
  margin-bottom:4px;
}
.modal-success-state h3 { color:var(--text); }
.modal-success-state p  { color:#4a6080; font-size:14px; margin:4px 0; }
.modal-success-state .success-note {
  font-size:12.5px;
  color:#f5a623;
  background:#fff5ee;
  border:1px solid #f9d0b0;
  border-radius:7px;
  padding:7px 12px;
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:7px;
}

/* ── Payment method info card ────────────────────────────────── */
.pm-info-row {
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:10px 12px;
  background:#f8fafd;
  border:1px solid #dde3ec;
  border-radius:8px;
}
.pm-lbl {
  font-size:.68rem;
  font-weight:700;
  color:#6b7a8d;
  text-transform:uppercase;
  letter-spacing:.4px;
}
.pm-val {
  font-size:13.5px;
  color:#1a2b3c;
  font-weight:500;
}

/* ── Tenant Profile Detail (tpd-) ────────────────────────────── */
.tpd-modal {
  width: 100%;
  max-width: 860px;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(10,22,45,.22);
  animation: modalIn .2s cubic-bezier(.34,1.3,.64,1);
  display: flex;
  flex-direction: column;
}

/* Hero */
.tpd-hero {
  position: relative;
  padding: 28px 24px 22px;
  overflow: hidden;
}
.tpd-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, #0f2d52 0%, #1e5fa0 55%, #2b7bc8 100%);
  z-index: 0;
}
.tpd-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.tpd-hero-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Avatar */
.tpd-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.tpd-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.35);
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.tpd-avatar-icon {
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(255,255,255,.7);
}
.tpd-avatar-cam {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.5);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.tpd-avatar-cam:hover { background: rgba(255,255,255,.35); }

/* Hero info */
.tpd-hero-info {
  flex: 1;
  min-width: 0;
}
.tpd-hero-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  line-height: 1.2;
  margin-bottom: 8px;
}
.tpd-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.tpd-badge-active   { background: rgba(72,199,142,.25); color: #48c78e; border: 1px solid rgba(72,199,142,.4); }
.tpd-badge-inactive { background: rgba(255,99,99,.25);  color: #ff8080; border: 1px solid rgba(255,99,99,.4); }

.tpd-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.tpd-hero-meta span {
  font-size: 12px;
  color: rgba(255,255,255,.78);
  display: flex;
  align-items: center;
  gap: 5px;
}
.tpd-hero-meta i { font-size: 11px; opacity: .8; }

/* Hero action buttons */
.tpd-hero-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}
.tpd-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .15s;
  white-space: nowrap;
}
.tpd-hero-btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,166,35,.4);
}
.tpd-hero-btn-primary:hover { background: var(--orange-dark); transform: translateY(-1px); }
.tpd-hero-btn-ghost {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
}
.tpd-hero-btn-ghost:hover { background: rgba(255,255,255,.28); }

/* Stats row */
.tpd-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.tpd-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid transparent;
  position: relative;
  transition: background .15s;
}
.tpd-stat:last-child { border-right: none; }
.tpd-stat-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
}
.tpd-stat-body { flex: 1; min-width: 0; }
.tpd-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.tpd-stat-value {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
}
.tpd-stat-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}
.tpd-stat-expand {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  font-size: 11px;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.tpd-stat-expand:hover { color: var(--blue); background: var(--blue-light); }

/* Balance breakdown panel */
.tpd-breakdown {
  margin: 0;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.tpd-breakdown-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tpd-breakdown-rows { display: flex; flex-direction: column; gap: 6px; }
.tpd-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 6px 10px;
  background: var(--white);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Tabs */
.tpd-tabs {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.tpd-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tpd-tab:hover { color: var(--blue); }
.tpd-tab.active { color: var(--blue); border-bottom-color: var(--orange); }
.tpd-tab-count {
  background: var(--blue-light);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Tab content */
.tpd-tab-content {
  display: none;
  padding: 20px;
  max-height: 380px;
  overflow-y: auto;
}
.tpd-tab-content.active { display: block; }

/* Info grid */
.tpd-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.tpd-info-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.tpd-info-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tpd-info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

/* ID docs */
.tpd-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tpd-id-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.tpd-id-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
}
.tpd-id-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.tpd-id-img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}
.tpd-id-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 12px;
}
.tpd-id-empty i { font-size: 1.6rem; opacity: .4; }

/* Payment/invoice badges */
.tpd-type-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--blue-light);
  color: var(--blue);
}
.tpd-src-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}
.tpd-badge-mpesa  { background: #e6f4ea; color: #1e7e34; }
.tpd-badge-manual { background: #fff3cd; color: #856404; }

/* Empty state */
.tpd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
}
.tpd-empty i { font-size: 2rem; opacity: .35; }
.tpd-empty p { font-size: 13px; margin: 0; }

/* Responsive */
@media (max-width: 640px) {
  .tpd-hero-body   { flex-wrap: wrap; }
  .tpd-hero-actions { width: 100%; justify-content: flex-end; }
  .tpd-stats { grid-template-columns: repeat(2, 1fr); }
  .tpd-stat:nth-child(2) { border-right: none; }
  .tpd-stat:nth-child(1),
  .tpd-stat:nth-child(2) { border-bottom: 1px solid var(--border); }
  .tpd-id-grid  { grid-template-columns: 1fr; }
  .tpd-info-grid { grid-template-columns: repeat(2, 1fr); }
  .tpd-tab-content { max-height: 320px; }
}
@media (max-width: 420px) {
  .tpd-tabs { overflow-x: auto; }
  .tpd-stats { grid-template-columns: 1fr 1fr; }
}

/* ── Invoice / Breakdown Modal (ibd-) ────────────────────── */
.ibd-modal {
  width: 100%;
  max-width: 860px;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  margin-bottom: 24px;
}

/* Header */
.ibd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  background: linear-gradient(130deg, #0f2d52 0%, #1e5fa0 60%, #2b7bc8 100%);
  gap: 14px;
}
.ibd-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ibd-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
}
.ibd-header-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.ibd-header-sub {
  font-size: 11px;
  color: rgba(255,255,255,.65);
  margin-top: 2px;
}
.ibd-close-btn {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  transition: background .15s;
}
.ibd-close-btn:hover { background: rgba(255,255,255,.28); }

/* Action buttons in ibd header (Validate, Resync, etc.) */
.ibd-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  letter-spacing: .2px;
}
.ibd-action-btn i { font-size: 11px; }
.ibd-action-btn:hover:not(:disabled) {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.55);
  transform: translateY(-1px);
}
.ibd-action-btn:active:not(:disabled) { transform: translateY(0); }
.ibd-action-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Orange variant — Resync */
.ibd-action-btn-orange {
  background: rgba(237,137,54,.25);
  border-color: rgba(237,137,54,.55);
  color: #fbd38d;
}
.ibd-action-btn-orange:hover:not(:disabled) {
  background: rgba(237,137,54,.42);
  border-color: #ed8936;
  color: #fff;
}

/* Green variant */
.ibd-action-btn-green {
  background: rgba(72,187,120,.2);
  border-color: rgba(72,187,120,.5);
  color: #9ae6b4;
}
.ibd-action-btn-green:hover:not(:disabled) {
  background: rgba(72,187,120,.38);
  border-color: #48bb78;
  color: #fff;
}

/* Summary chips */
.ibd-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.ibd-chip {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ibd-chip:last-child { border-right: none; }
.ibd-chip-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ibd-chip-value {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
}
.ibd-chip-blue  .ibd-chip-value { color: #2b6cb0; }
.ibd-chip-green .ibd-chip-value { color: #276749; }
.ibd-chip-amber .ibd-chip-value { color: #744210; }
.ibd-chip-red   .ibd-chip-value { color: #9b2335; }
.ibd-chip-grey  .ibd-chip-value { color: #4a5568; }

/* Action bar (bulk actions strip between chips and table) */
.ibd-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: #f0f6ff;
  border-bottom: 1px solid #bee3f8;
  flex-wrap: wrap;
}
.ibd-action-bar-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #2b6cb0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ibd-action-bar-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ibd-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  letter-spacing: .2px;
  border: none;
}
.ibd-bar-btn i { font-size: 11px; }
.ibd-bar-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.ibd-bar-btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.ibd-bar-btn:disabled { opacity: .45; cursor: not-allowed; }
.ibd-bar-btn-primary {
  background: linear-gradient(135deg, #1a365d 0%, #2b7bc8 100%);
  color: #fff;
}
.ibd-bar-btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #2b7bc8 0%, #3a8fd8 100%); }
.ibd-bar-btn-danger  { background: linear-gradient(135deg, #c53030 0%, #e53e3e 100%); color: #fff; }
.ibd-bar-btn-success { background: linear-gradient(135deg, #276749 0%, #38a169 100%); color: #fff; }
.ibd-bar-btn-orange  { background: linear-gradient(135deg, #c05621 0%, #ed8936 100%); color: #fff; }

/* Action bar (bulk actions strip between chips and table) */
.ibd-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: #f0f6ff;
  border-bottom: 1px solid #bee3f8;
  flex-wrap: wrap;
}
.ibd-action-bar-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #2b6cb0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ibd-action-bar-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ibd-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  letter-spacing: .2px;
  border: none;
}
.ibd-bar-btn i { font-size: 11px; }
.ibd-bar-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.ibd-bar-btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.ibd-bar-btn:disabled { opacity: .45; cursor: not-allowed; }
.ibd-bar-btn-primary {
  background: linear-gradient(135deg, #1a365d 0%, #2b7bc8 100%);
  color: #fff;
}
.ibd-bar-btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #2b7bc8 0%, #3a8fd8 100%); }
.ibd-bar-btn-danger  { background: linear-gradient(135deg, #c53030 0%, #e53e3e 100%); color: #fff; }
.ibd-bar-btn-success { background: linear-gradient(135deg, #276749 0%, #38a169 100%); color: #fff; }
.ibd-bar-btn-orange  { background: linear-gradient(135deg, #c05621 0%, #ed8936 100%); color: #fff; }

/* Chart */
.ibd-chart-wrap {
  background: #f8fafc;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.ibd-chart-wrap canvas { height: 180px; width: 100%; }

/* Table */
.ibd-table-wrap {
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.ibd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ibd-table thead tr {
  background: #1a365d;
}
.ibd-table thead th {
  background: #1a365d;
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: left;
  white-space: nowrap;
}
.ibd-table tbody tr:hover { background: #f8fafc; }
.ibd-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ibd-foot-page td {
  padding: 9px 14px;
  background: #f0f4f8;
  font-weight: 700;
  font-size: 12px;
  border-top: 2px solid var(--border);
}
.ibd-foot-grand td {
  padding: 10px 14px;
  background: #eaf4ff;
  font-size: 13px;
  border-top: 1px solid #bee3f8;
}

/* Footer */
.ibd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
  background: #fafbfc;
}
.ibd-page-info {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.ibd-pager {
  display: flex;
  gap: 8px;
}
.ibd-pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.ibd-pager-prev {
  background: var(--white);
  border: 1px solid var(--border);
  color: #1a365d;
}
.ibd-pager-prev:hover:not(:disabled) { background: #f0f6ff; border-color: #2b7bc8; }
.ibd-pager-next {
  background: #1a365d;
  border: 1px solid #1a365d;
  color: #fff;
}
.ibd-pager-next:hover:not(:disabled) { background: #2b7bc8; }
.ibd-pager-btn:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 600px) {
  .ibd-summary { grid-template-columns: repeat(2, 1fr); }
  .ibd-chip:nth-child(2) { border-right: none; }
  .ibd-chip:nth-child(1),
  .ibd-chip:nth-child(2) { border-bottom: 1px solid var(--border); }
  .ibd-footer { justify-content: center; }
}

/* ----------------------------------------------------------
   FINANCIAL SUMMARY - printable spreadsheet (sr- prefix)
   ---------------------------------------------------------- */

#summariesList {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 4px 0;
}

.sr-page {
    position: relative;
    background: #fff;
    border: 1px solid #303030;
    padding: 10px 14px 14px;
    max-width: 860px;
    margin: 0 auto;
    font-family: Arial, 'Segoe UI', sans-serif;
    font-size: 12px;
    color: #111;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    overflow: hidden;
}

.sr-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
}

.sr-watermark img {
    width: min(70%, 420px);
    height: auto;
    object-fit: contain;
    opacity: 0.07;
}

.sr-page > :not(.sr-watermark) {
    position: relative;
    z-index: 1;
}

.sr-company-name,
.sr-report-name,
.sr-section-title {
    text-transform: uppercase;
}

.sr-company-name {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 2px;
}

.sr-report-name {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.sr-rule {
    border-top: 1px solid #303030;
    margin-bottom: 10px;
}

.sr-meta-rows {
    margin-bottom: 12px;
}

.sr-meta-row {
    display: grid;
    grid-template-columns: 72px 12px 1fr;
    align-items: start;
    gap: 4px;
    font-size: 12px;
    margin-bottom: 4px;
}

.sr-meta-label {
    font-weight: 700;
}

.sr-meta-sep {
    text-align: center;
    font-weight: 700;
}

.sr-meta-value {
    font-weight: 600;
}

.sr-section {
    margin-bottom: 12px;
}

.sr-section-title {
    border: 1px solid #303030;
    border-bottom: none;
    text-align: center;
    font-weight: 700;
    padding: 4px 10px;
    background: rgba(255,255,255,.72);
}

.sr-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: rgba(255,255,255,.82);
}

.sr-table th,
.sr-table td {
    border: 1px solid #303030;
    padding: 4px 6px;
    vertical-align: middle;
}

.sr-table th {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
}

.sr-cell-left {
    text-align: left;
}

.sr-cell-center {
    text-align: center;
}

.sr-cell-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sr-empty-row {
    text-align: center;
    color: #666;
    font-style: italic;
}

.sr-strong {
    font-weight: 700;
}

.sr-total-row td {
    font-weight: 700;
}

.sr-grand-total-row td {
    font-weight: 700;
    font-size: 13px;
}

.sr-neg {
    color: #b00020;
}

.sr-footer {
    margin-top: 8px;
    font-size: 12px;
}

.sr-footer-line {
    margin-bottom: 6px;
}

.sr-footer-sep {
    font-weight: 700;
    margin: 0 6px;
}

.sr-footer-note {
    font-size: 12px;
}

.sr-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Summary report action buttons — compact variant */
.sr-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
    font-weight: 600;
}

@media print {
    .app-header, .sidebar, .sidebar-overlay,
    .sr-actions, .no-print { display: none !important; }
    .sr-page {
        box-shadow: none !important;
        page-break-after: always;
        max-width: 100%;
        margin: 0;
        padding: 8px 12px 12px;
    }
    #summariesList { gap: 0; }
}

@media (max-width: 900px) {
    .sr-page {
        padding: 10px 10px 14px;
    }
}

@media (max-width: 640px) {
    .sr-page {
        padding: 10px 8px 14px;
        font-size: 11px;
    }

    .sr-company-name {
        font-size: 16px;
    }

    .sr-meta-row {
        grid-template-columns: 62px 10px 1fr;
        font-size: 11px;
    }

    .sr-table th,
    .sr-table td {
        padding: 4px;
        font-size: 10px;
    }
}
