/**
 * app.css — v4venue Rent Management System
 * Single stylesheet for all pages
 */

/* ══════════════════════════════════════
   FONTS & RESET
══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manjari:wght@100;400;700&display=swap');

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-size: var(--fs-base);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-body);
  color: var(--text-primary);
}

:lang(ml) {
  font-family: 'Manjari', sans-serif;
}

/* ══════════════════════════════════════
   CSS CUSTOM PROPERTIES
══════════════════════════════════════ */

:root {
  --brand-50:  #eef6fc;
  --brand-100: #d0e9f7;
  --brand-200: #a1d3ef;
  --brand-300: #62b5e3;
  --brand-400: #2b93cc;
  --brand-500: #1e7fb8;
  --brand-600: #17679a;
  --brand-700: #12527c;
  --brand-800: #0d3d5e;
  --brand-900: #082840;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);

  /* Theme-aware tokens (light defaults) */
  --bg-body:     #f1f5f9;
  --bg-surface:  #ffffff;
  --bg-sidebar:  #ffffff;
  --bg-header:   #ffffff;
  --bg-input:    #ffffff;
  --border:      #e2e8f0;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  /* Font-size scale */
  --fs-base: 0.8125rem;
  --fs-lg:   calc(var(--fs-base) * 1.154);
  --fs-md:   calc(var(--fs-base) * 1.077);
  --fs-sm:   calc(var(--fs-base) * 0.846);
  --fs-xs:   calc(var(--fs-base) * 0.769);
}

/* ── Font-size modifiers ── */
html[data-font-size="small"]  { --fs-base: 0.75rem; }
html[data-font-size="medium"] { --fs-base: 0.8125rem; }
html[data-font-size="large"]  { --fs-base: 0.9375rem; }

/* ── Sidebar collapse toggle button (desktop only) ── */
.btn-sidebar-collapse {
  display: none;
  padding: 0.375rem;
  border-radius: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.btn-sidebar-collapse svg { width: 1.125rem; height: 1.125rem; transition: transform 0.2s; }
.btn-sidebar-collapse:hover { color: var(--brand-500); background: var(--brand-50); }
@media (min-width: 1024px) { .btn-sidebar-collapse { display: flex; } }

/* ── Compact sidebar (desktop only) ── */
@media (min-width: 1024px) {
  html[data-sidebar-compact="1"] #sidebar {
    width: 4.25rem;
    overflow: visible;
  }

  html[data-sidebar-compact="1"] .btn-sidebar-collapse svg {
    transform: rotate(180deg);
  }

  html[data-sidebar-compact="1"] .sidebar-brand-text,
  html[data-sidebar-compact="1"] .nav-section-label,
  html[data-sidebar-compact="1"] .sidebar-powered {
    display: none;
  }

  html[data-sidebar-compact="1"] .sidebar-header {
    justify-content: center;
    padding: 0.75rem 0.5rem;
    gap: 0;
  }

  html[data-sidebar-compact="1"] .sidebar-header .btn-sidebar-collapse {
    position: absolute;
    right: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  html[data-sidebar-compact="1"] .sidebar-header .btn-sidebar-collapse svg {
    width: 0.75rem;
    height: 0.75rem;
    transform: rotate(180deg);
  }
  html[data-sidebar-compact="1"] .sidebar-header {
    position: relative;
  }

  html[data-sidebar-compact="1"] #sidebarNav {
    padding: 0.5rem;
  }

  html[data-sidebar-compact="1"] .nav-link {
    justify-content: center;
    padding: 0.625rem;
    gap: 0;
    font-size: 0;
    color: transparent;
    position: relative;
  }
  html[data-sidebar-compact="1"] .nav-link svg {
    flex-shrink: 0;
    color: #64748b;
  }
  html[data-sidebar-compact="1"] .nav-link:hover svg,
  html[data-sidebar-compact="1"] .nav-link.active svg {
    color: var(--brand-500);
  }

  /* Tooltip on hover */
  html[data-sidebar-compact="1"] .nav-link::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: calc(var(--fs-base) * 0.923);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 100;
  }
  html[data-sidebar-compact="1"] .nav-link:hover::after {
    opacity: 1;
  }

  /* Hide chevrons in compact mode */
  html[data-sidebar-compact="1"] .nav-chevron {
    display: none;
  }

  /* Submenus in compact mode: hide inline, show as flyout on hover */
  html[data-sidebar-compact="1"] .sub-menu {
    display: none !important;
    position: fixed;
    min-width: 12rem;
    padding: 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 200;
  }

  /* Fix sub-item styling in flyout */
  html[data-sidebar-compact="1"] .sub-menu .sub-item {
    padding-left: 0.75rem;
    font-size: var(--fs-base);
    color: var(--text-secondary);
    white-space: nowrap;
  }

  /* Hide tooltip for parent items with submenus */
  html[data-sidebar-compact="1"] .nav-link[data-submenu]::after {
    display: none;
  }

  /* Footer compact */
  html[data-sidebar-compact="1"] .sidebar-footer {
    padding: 0.5rem;
  }
  html[data-sidebar-compact="1"] .sidebar-user {
    justify-content: center;
    gap: 0;
    padding: 0.375rem;
  }
  html[data-sidebar-compact="1"] .sidebar-user > div:not(.sidebar-avatar),
  html[data-sidebar-compact="1"] .sidebar-user > a,
  html[data-sidebar-compact="1"] .sidebar-user > form {
    display: none;
  }
}

/* ── Dark theme ── */
html[data-theme="dark"] {
  --bg-body:     #0f172a;
  --bg-surface:  #1e293b;
  --bg-sidebar:  #1e293b;
  --bg-header:   #1e293b;
  --bg-input:    #334155;
  --border:      #334155;
  --text-primary:   #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted:     #64748b;
}

.app-shell .main-col { background: var(--bg-body); }


html[data-theme="dark"] .sidebar-header p { color: var(--text-primary) !important; }
html[data-theme="dark"] .sidebar-header p + p { color: var(--text-muted) !important; }

html[data-theme="dark"] .nav-section-label { color: var(--text-muted) !important; }

html[data-theme="dark"] .nav-link {
  color: var(--text-secondary) !important;
}
html[data-theme="dark"] .nav-link:hover {
  background: rgba(255,255,255,0.05) !important;
  color: var(--text-primary) !important;
}
html[data-theme="dark"] .nav-link.active {
  background: rgba(30,127,184,0.15) !important;
  color: var(--brand-400) !important;
}

html[data-theme="dark"] .sidebar-user p { color: var(--text-primary) !important; }
html[data-theme="dark"] .sidebar-user p + p { color: var(--text-muted) !important; }

html[data-theme="dark"] .top-header h1 { color: var(--text-primary) !important; }
html[data-theme="dark"] .top-header p { color: var(--text-muted) !important; }

html[data-theme="dark"] .breadcrumb a,
html[data-theme="dark"] .breadcrumb span { color: var(--text-secondary) !important; }

/* Cards, tables, forms in dark */
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"] {
  background: var(--bg-surface) !important;
}

html[data-theme="dark"] [style*="border:1px solid #e2e8f0"],
html[data-theme="dark"] [style*="border-bottom:1px solid #e2e8f0"],
html[data-theme="dark"] [style*="border-top:1px solid #e2e8f0"] {
  border-color: var(--border) !important;
}

html[data-theme="dark"] [style*="color:#0f172a"] { color: var(--text-primary) !important; }
html[data-theme="dark"] [style*="color:#475569"] { color: var(--text-secondary) !important; }
html[data-theme="dark"] [style*="color:#94a3b8"] { color: var(--text-muted) !important; }
html[data-theme="dark"] [style*="color:#64748b"] { color: var(--text-muted) !important; }

html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--text-muted) !important;
}

html[data-theme="dark"] table th {
  background: rgba(255,255,255,0.03) !important;
  color: var(--text-secondary) !important;
}
html[data-theme="dark"] table td {
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] table tr:hover td {
  background: rgba(255,255,255,0.02) !important;
}

html[data-theme="dark"] [style*="background:#f8fafc"] {
  background: rgba(255,255,255,0.03) !important;
}

/* ══════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════ */

::-webkit-scrollbar         { width: 4px; height: 4px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ══════════════════════════════════════
   SHARED UTILITIES
══════════════════════════════════════ */

/* Small coloured dot used in legends, stat footers */
.ldot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════ */

/* ── Fixed decorative background layer ── */
.login-bg-fixed {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #082840 0%, #0d3d5e 40%, #12527c 70%, #17679a 100%);
}

/* ── Scrollable content layer ── */
.login-scroll {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 1rem;
}

/* ── Background decorations ── */
.login-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(43,147,204,0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(14,61,94,0.25)   0%, transparent 50%),
    radial-gradient(circle at 60% 60%, rgba(30,127,184,0.12) 0%, transparent 40%);
}

.login-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.login-streak {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(98,181,227,0.2), transparent);
}

/* ── Animated blob ── */
@keyframes blob {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50%       { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
  75%       { border-radius: 60% 40% 60% 30% / 60% 40% 30% 70%; }
}
.blob {
  position: absolute;
  pointer-events: none;
  animation: blob 8s ease-in-out infinite;
}
.blob-delay { animation-delay: -4s; }

/* ── Floating icons (desktop only) ── */
@keyframes float {
  0%, 100% { transform: translateY(0);    }
  50%       { transform: translateY(-12px); }
}
.float-icon {
  position: absolute;
  pointer-events: none;
  animation: float 5s ease-in-out infinite;
  opacity: 0.1;
  display: none;
}
@media (min-width: 1024px) { .float-icon { display: block; } }

/* ── Login card wrapper ── */
.login-card {
  width: 100%;
  max-width: 400px;
}

/* ── Glass panel ── */
.glass-panel {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1);
  overflow: hidden;
}

.card-accent-bar {
  height: 3px;
  background: linear-gradient(90deg, #1e7fb8, #62b5e3, #1e7fb8);
}

.card-body { padding: 1.75rem 1.75rem 2rem; }

/* ── Logo area ── */
.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.login-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 1.125rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff 0%, #e0f0fa 100%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* ── Form field ── */
.field-wrap { position: relative; }

.field-icon {
  position: absolute;
  inset-block: 0;
  left: 0.875rem;
  display: flex;
  align-items: center;
  color: #94a3b8;
  pointer-events: none;
}
.field-icon svg { width: 1rem; height: 1rem; }

.field-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border-radius: 0.875rem;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: var(--fs-md);
  font-family: inherit;
  color: #1e293b;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
}
.field-input::placeholder { color: #94a3b8; }
.field-input:focus {
  border-color: var(--brand-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30,127,184,0.1);
}
.field-input-pr { padding-right: 3rem; }

.field-suffix {
  position: absolute;
  inset-block: 0;
  right: 0.875rem;
  display: flex;
  align-items: center;
}
.field-suffix button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: #94a3b8;
  transition: color 0.15s;
}
.field-suffix button:hover { color: var(--brand-500); }
.field-suffix button svg { width: 1rem; height: 1rem; display: block; }

/* ── Toggle switch ── */
.toggle-track {
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 99px;
  background: #e2e8f0;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  flex-shrink: 0;
}
.toggle-track.on { background: var(--brand-500); }
.toggle-knob {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.toggle-track.on .toggle-knob { transform: translateX(1rem); }

/* ── Login submit button ── */
.btn-login {
  width: 100%;
  padding: 0.875rem 1.5rem;
  border-radius: 0.875rem;
  border: none;
  font-family: inherit;
  font-size: calc(var(--fs-base) * 1.108);
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
  box-shadow: 0 4px 15px rgba(30,127,184,0.35);
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-login:hover  { opacity: 0.92; box-shadow: 0 6px 20px rgba(30,127,184,0.4); }
.btn-login:active { transform: scale(0.99); }
.btn-login svg { width: 1rem; height: 1rem; transition: transform 0.15s; }
.btn-login:hover svg { transform: translateX(2px); }

/* ── Tenant portal link ── */
.btn-portal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  border-radius: 0.875rem;
  border: 1.5px solid #e8eef4;
  background: transparent;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-portal:hover {
  border-color: var(--brand-300);
  color: var(--brand-600);
  background: var(--brand-50);
}
.btn-portal svg { width: 1rem; height: 1rem; transition: transform 0.15s; }
.btn-portal:hover svg:last-child { transform: translateX(2px); }

/* ── Form divider ── */
.form-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.form-divider span { font-size: var(--fs-xs); color: #cbd5e1; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.form-divider::before,
.form-divider::after { content: ''; flex: 1; height: 1px; background: #f1f5f9; }

/* ── Powered by ── */
.powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.powered-by:hover { opacity: 0.75; }
.powered-by span  { font-size: var(--fs-xs); color: #d0e9f7; }
.powered-by img   { height: 0.875rem; filter: brightness(0) invert(1); }

/* ── Login footer ── */
.login-footer {
  text-align: center;
  margin-top: 0.75rem;
  font-size: var(--fs-xs);
  color: rgba(160,210,240,0.35);
}
.login-footer a { color: inherit; text-decoration: none; transition: color 0.15s; }
.login-footer a:hover { color: rgba(160,210,240,0.75); }

/* ── Stagger fade-up animations ── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-1 { animation: fade-up 0.4s 0.05s ease both; }
.anim-2 { animation: fade-up 0.4s 0.12s ease both; }
.anim-3 { animation: fade-up 0.4s 0.19s ease both; }
.anim-4 { animation: fade-up 0.4s 0.26s ease both; }
.anim-5 { animation: fade-up 0.4s 0.33s ease both; }
.anim-6 { animation: fade-up 0.4s 0.40s ease both; }

/* ══════════════════════════════════════
   DASHBOARD — APP SHELL LAYOUT
══════════════════════════════════════ */

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-body);
}

/* ── Sidebar ── */
#sidebar {
  width: 16rem;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease, transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
}

@media (max-width: 1023px) {
  #sidebar {
    position: fixed;
    inset-block: 0;
    left: 0;
    height: 100%;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    transform: translateX(-100%);
  }
  #sidebar.open { transform: translateX(0); }
}

/* ── Mobile overlay ── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  backdrop-filter: blur(2px);
}
#sidebar-overlay.show { display: block; }

/* ── Main content column ── */
.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Top header ── */
.top-header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .top-header { background: rgba(255,255,255,0.92); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
}
@media (min-width: 640px) { .header-inner { padding: 0.875rem 1.5rem; } }

/* ── Page scroll area ── */
.page-body {
  flex: 1;
}
.page-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (min-width: 640px) { .page-content { padding: 1.5rem; gap: 1.5rem; } }

/* ══════════════════════════════════════
   DASHBOARD — SIDEBAR NAV
══════════════════════════════════════ */

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-900));
}
.sidebar-brand-icon svg { width: 1.125rem; height: 1.125rem; color: #fff; }

.nav-section-label {
  padding: 1rem 0.75rem 0.25rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 0.75rem;
  border-radius: 0.625rem;
  font-size: var(--fs-base);
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
}
.nav-link:hover  { background: #f8fafc; color: #1e293b; }
.nav-link.active { background: linear-gradient(135deg, #eef6fc, #d8eefa); color: var(--brand-600); font-weight: 600; }
.nav-link svg    { width: 1rem; height: 1rem; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 0.0625rem 0.375rem;
  border-radius: 99px;
  background: #fef3c7;
  color: #b45309;
}
.nav-badge.danger { background: #fee2e2; color: #b91c1c; }

.nav-chevron {
  width: 0.875rem;
  height: 0.875rem;
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: #94a3b8;
}
.nav-chevron.rotated { transform: rotate(180deg); }

.sub-menu { display: none; margin-top: 0.125rem; }
.sub-menu.open { display: block; }

.sub-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.75rem 0.4375rem 2.25rem;
  border-radius: 0.5rem;
  font-size: var(--fs-base);
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.sub-item::before {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.sub-item:hover { color: var(--brand-600); background: #f8fafc; }
a.sub-item { text-decoration: none; }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.12s;
}
.sidebar-user:hover { background: #f8fafc; }

.sidebar-avatar {
  width: 2rem; height: 2rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--fs-base) * 0.923);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-900));
}

.sidebar-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  opacity: 0.35;
}
.sidebar-powered span { font-size: calc(var(--fs-base) * 0.692); color: #64748b; }
.sidebar-powered img  { height: 0.6875rem; filter: grayscale(1); }

/* ══════════════════════════════════════
   DASHBOARD — HEADER COMPONENTS
══════════════════════════════════════ */

.header-period-tabs {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  background: #f1f5f9;
  border-radius: 0.75rem;
  padding: 0.25rem;
}
.period-tab {
  padding: 0.3125rem 0.75rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: #64748b;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.period-tab:hover { background: #fff; }
.period-tab.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
  color: #fff;
  font-weight: 600;
}

.header-search {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  border-radius: 0.75rem;
  padding: 0.5rem 0.875rem;
  width: 14rem;
}
@media (min-width: 768px) { .header-search { display: flex; } }
.header-search svg { width: 0.875rem; height: 0.875rem; color: #94a3b8; flex-shrink: 0; }
.header-search input {
  background: none; border: none; outline: none;
  font-size: var(--fs-base); color: #334155; font-family: inherit; flex: 1; min-width: 0;
}
.header-search input::placeholder { color: #94a3b8; }

.btn-export {
  display: none;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: calc(var(--fs-base) * 0.923);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
  transition: opacity 0.15s;
}
.btn-export:hover { opacity: 0.88; }
.btn-export svg { width: 0.875rem; height: 0.875rem; }
@media (min-width: 640px) { .btn-export { display: flex; } }

.header-avatar {
  width: 2rem; height: 2rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--fs-base) * 0.923);
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-900));
}

.action-buttons { display: flex; align-items: center; gap: 0.25rem; flex-wrap: nowrap; }

.btn-icon {
  position: relative;
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: none;
  background: none;
  cursor: pointer;
  color: #64748b;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.btn-icon:hover { background: #f1f5f9; color: #1e293b; }
.btn-icon svg { width: 1.25rem; height: 1.25rem; display: block; }
.btn-icon .dot-badge {
  position: absolute;
  top: 0.375rem; right: 0.375rem;
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}

.btn-hamburger {
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: none;
  background: none;
  cursor: pointer;
  color: #64748b;
  margin-left: -0.25rem;
  transition: background 0.12s;
  display: flex;
}
.btn-hamburger:hover { background: #f1f5f9; }
.btn-hamburger svg { width: 1.25rem; height: 1.25rem; }
@media (min-width: 1024px) { .btn-hamburger { display: none; } }

/* ══════════════════════════════════════
   DASHBOARD — WELCOME BANNER
══════════════════════════════════════ */

.welcome-banner {
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #082840 0%, #0d3d5e 40%, var(--brand-500) 100%);
}
.welcome-banner-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.banner-circle     { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.05); }

.welcome-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 640px) {
  .welcome-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

.welcome-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.btn-banner {
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: calc(var(--fs-base) * 0.923);
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-banner-primary { background: #fff; color: var(--brand-700); }
.btn-banner-primary:hover { background: #f0f9ff; }
.btn-banner-ghost {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-banner-ghost:hover { background: rgba(255,255,255,0.25); }

/* ══════════════════════════════════════
   DASHBOARD — KPI CARDS
══════════════════════════════════════ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 640px)  { .kpi-grid { gap: 1rem; } }
@media (min-width: 1280px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  background: #fff;
  border-radius: 0.875rem;
  padding: 0.75rem 1rem;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
@media (min-width: 640px) { .stat-card { padding: 0.875rem 1.125rem; } }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }

.stat-icon {
  width: 2rem; height: 2rem;
  border-radius: 0.625rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 1rem; height: 1rem; }

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 0.25rem;
  line-height: 1;
}
@media (min-width: 640px) { .stat-value { font-size: 1.5rem; } }

.stat-trend { display: flex; align-items: center; gap: 0.25rem; margin-top: 0.375rem; }
.stat-trend svg { width: 0.75rem; height: 0.75rem; flex-shrink: 0; }
.trend-up   { color: #16a34a; }
.trend-down { color: #dc2626; }
.stat-trend span { font-size: calc(var(--fs-base) * 0.923); font-weight: 600; }
.stat-trend .muted { font-size: var(--fs-xs); color: #94a3b8; font-weight: 400; }
@media (max-width: 639px) { .stat-trend .muted { display: none; } }

.stat-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.625rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f8fafc;
}
.stat-footer span { display: flex; align-items: center; gap: 0.375rem; font-size: var(--fs-sm); color: #64748b; }

.stat-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: #94a3b8;
  margin-top: 0.5rem;
  padding-top: 0.875rem;
  border-top: 1px solid #f8fafc;
  margin-bottom: 0.375rem;
}
.stat-progress-label strong { color: var(--brand-600); font-size: calc(var(--fs-base) * 0.923); }

.progress-track { width: 100%; height: 5px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #10b981, #34d399); }

/* ══════════════════════════════════════
   DASHBOARD — CHART PANELS
══════════════════════════════════════ */

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px)  { .chart-grid { gap: 1.25rem; } }
@media (min-width: 1280px) { .chart-grid { grid-template-columns: 1fr 1fr 1fr; } }

.chart-card {
  background: #fff;
  border-radius: 1.125rem;
  padding: 1.125rem;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
}
@media (min-width: 640px)  { .chart-card { padding: 1.25rem; } }
@media (min-width: 1280px) { .chart-card-wide { grid-column: span 2; } }

.chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-size: calc(var(--fs-base) * 0.923); color: #64748b; }
.legend-item  { display: flex; align-items: center; gap: 0.375rem; }

.chart-canvas-wrap { height: 13rem; }
@media (min-width: 640px) { .chart-canvas-wrap { height: 15rem; } }

.donut-wrap   { display: flex; align-items: center; gap: 1.25rem; }
.donut-canvas { position: relative; width: 5rem; height: 5rem; flex-shrink: 0; }
.donut-label  {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-lg); font-weight: 800; color: #0f172a;
}

.renewals-list { display: flex; flex-direction: column; }
.renewal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f8fafc;
}
.renewal-row:last-child { border-bottom: none; }
.renewal-row p:first-child { font-size: calc(var(--fs-base) * 0.923); font-weight: 600; color: #0f172a; }
.renewal-row p:last-child  { font-size: var(--fs-xs); color: #94a3b8; margin-top: 0.125rem; }

/* ══════════════════════════════════════
   DASHBOARD — QUICK ACTIONS
══════════════════════════════════════ */

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
@media (min-width: 640px) { .quick-actions-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .quick-actions-grid { grid-template-columns: repeat(8, 1fr); } }

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 0.5rem;
  border-radius: 1rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:active { transform: scale(0.95); }

.action-icon {
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.action-btn:hover .action-icon { transform: scale(1.08); }
.action-icon svg { width: 1.125rem; height: 1.125rem; color: #fff; }

.action-label { font-size: var(--fs-xs); font-weight: 600; text-align: center; line-height: 1.3; }

/* ══════════════════════════════════════
   DASHBOARD — TRANSACTIONS TABLE
══════════════════════════════════════ */

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px)  { .bottom-grid { gap: 1.25rem; } }
@media (min-width: 1280px) { .bottom-grid { grid-template-columns: 1fr 1fr 1fr; } }

.table-card {
  background: #fff;
  border-radius: 1.125rem;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
@media (min-width: 1280px) { .table-card { grid-column: span 2; } }

.table-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid #f8fafc;
}
@media (min-width: 640px) { .table-header { padding: 1rem 1.25rem; } }

.table-controls { display: flex; align-items: center; gap: 0.5rem; }

.table-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border-radius: 0.625rem;
  padding: 0.375rem 0.75rem;
}
.table-search svg { width: 0.875rem; height: 0.875rem; color: #94a3b8; flex-shrink: 0; }
.table-search input {
  background: none; border: none; outline: none;
  font-size: calc(var(--fs-base) * 0.923); color: #334155; font-family: inherit; width: 6rem;
}
@media (min-width: 640px) { .table-search input { width: 8rem; } }

.table-filter-select {
  font-size: calc(var(--fs-base) * 0.923);
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  padding: 0.375rem 0.625rem;
  outline: none;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
}

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 36rem; }
.data-table thead tr { background: rgba(248,250,252,0.8); }
.data-table th {
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table th:first-child { padding-left: 1.125rem; }
@media (min-width: 640px) { .data-table th:first-child { padding-left: 1.25rem; } }

.data-table tbody tr { border-top: 1px solid #f8fafc; transition: background 0.1s; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr.row-overdue { background: rgba(254,226,226,0.15); }
.data-table tbody tr.row-overdue:hover { background: rgba(254,226,226,0.3); }
.data-table td { padding: 0.75rem 0.875rem; vertical-align: middle; }
.data-table td:first-child { padding-left: 1.125rem; }
@media (min-width: 640px) { .data-table td:first-child { padding-left: 1.25rem; } }

.tenant-cell { display: flex; align-items: center; gap: 0.625rem; }
.tenant-avatar {
  width: 1.75rem; height: 1.75rem;
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700; flex-shrink: 0;
}

.table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.125rem;
  background: rgba(248,250,252,0.5);
  border-top: 1px solid #f8fafc;
}
@media (min-width: 640px) { .table-footer { padding: 0.75rem 1.25rem; } }
.table-footer p { font-size: var(--fs-sm); color: #94a3b8; }

.btn-view-all {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-500);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s;
}
.btn-view-all:hover { color: var(--brand-700); }
.btn-view-all svg { width: 0.75rem; height: 0.75rem; transition: transform 0.12s; }
.btn-view-all:hover svg { transform: translateX(2px); }

/* ── Status badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5625rem;
  border-radius: 99px;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.badge-paid       { background: #f0fdf4; color: #15803d; }
.badge-pending    { background: #fff7ed; color: #c2410c; }
.badge-overdue    { background: #fef2f2; color: #b91c1c; }
.badge-processing { background: #eff6ff; color: #1d4ed8; }
.badge-cancelled  { background: #f8fafc; color: #64748b; }

.btn-print {
  padding: 0.375rem;
  border-radius: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.12s, background 0.12s;
}
.btn-print:hover { color: var(--brand-500); background: var(--brand-50); }
.btn-print svg   { width: 1rem; height: 1rem; display: block; }

/* ══════════════════════════════════════
   DASHBOARD — ZONE COLLECTION
══════════════════════════════════════ */

.zone-card {
  background: #fff;
  border-radius: 1.125rem;
  padding: 1.125rem;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
}
@media (min-width: 640px) { .zone-card { padding: 1.25rem; } }

.zone-list { display: flex; flex-direction: column; gap: 1rem; }

.zone-row .zone-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: calc(var(--fs-base) * 0.923);
  margin-bottom: 0.375rem;
}
.zone-row .zone-labels span:first-child { color: #475569; font-weight: 500; }
.zone-row .zone-labels span:last-child  { font-weight: 700; color: #0f172a; }
.zone-pct { font-size: var(--fs-sm); font-weight: 400; margin-left: 0.25rem; }

.zone-bar  { width: 100%; height: 6px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.zone-fill { height: 100%; border-radius: 99px; }

.zone-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: calc(var(--fs-base) * 0.923);
  padding-top: 0.75rem;
  border-top: 1px solid #f8fafc;
  margin-top: 0.25rem;
}
.zone-total span:first-child { color: #64748b; }
.zone-total span:last-child  { font-weight: 800; color: #0f172a; }
.zone-total em { font-style: normal; color: #16a34a; font-weight: 400; }

/* ══════════════════════════════════════
   SHARED PANEL HELPERS
══════════════════════════════════════ */

.panel-title { font-size: var(--fs-md); font-weight: 700; color: #0f172a; }
.panel-sub   { font-size: var(--fs-sm); color: #94a3b8; margin-top: 0.125rem; }

.btn-link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-500);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s;
  padding: 0;
}
.btn-link:hover { color: var(--brand-700); text-decoration: underline; }

/* ══════════════════════════════════════
   SHARED — PAGE TITLE ROW & BUTTONS
══════════════════════════════════════ */

.page-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.page-title-row h2 { font-size: 1.0625rem; font-weight: 800; color: #0f172a; margin: 0; }
.page-title-row p  { font-size: calc(var(--fs-base) * 0.923); color: #94a3b8; margin-top: 0.125rem; }
.page-title-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 0.875rem;
  border: none;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
  box-shadow: 0 3px 12px rgba(30,127,184,0.3);
  transition: opacity 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 5px 16px rgba(30,127,184,0.4); }
.btn-primary svg { width: 0.875rem; height: 0.875rem; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.875rem;
  border: 1.5px solid #e2e8f0;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--brand-300); color: var(--brand-600); }
.btn-secondary svg { width: 0.875rem; height: 0.875rem; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 0.875rem;
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  color: #fff;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  box-shadow: 0 3px 12px rgba(220,38,38,0.3);
  transition: opacity 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn-danger:hover { opacity: 0.9; box-shadow: 0 5px 16px rgba(220,38,38,0.4); }
.btn-danger svg { width: 0.875rem; height: 0.875rem; }

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 0.875rem;
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  color: #dc2626;
  border: 1px solid #fca5a5;
  background: #fff;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  text-decoration: none;
}
.btn-danger-outline:hover { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }
.btn-danger-outline svg { width: 0.875rem; height: 0.875rem; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 0.875rem;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  background: transparent;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  text-decoration: none;
}
.btn-ghost:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn-ghost svg { width: 0.875rem; height: 0.875rem; }

/* ══════════════════════════════════════
   TENANTS — FILTER BAR
══════════════════════════════════════ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.filter-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.875rem;
  padding: 0.5rem 1rem;
  flex: 1;
  min-width: 12rem;
  max-width: 22rem;
  transition: border-color 0.15s;
}
.filter-search:focus-within { border-color: var(--brand-400); }
.filter-search svg { width: 0.875rem; height: 0.875rem; color: #94a3b8; flex-shrink: 0; }
.filter-search input {
  background: none; border: none !important; outline: none !important;
  box-shadow: none !important;
  font-size: var(--fs-base); color: #334155; font-family: inherit; flex: 1; min-width: 0;
}
.filter-search input::placeholder { color: #94a3b8; }

.status-chips { display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.status-chip {
  padding: 0.375rem 0.75rem;
  border-radius: 99px;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  transition: all 0.12s;
  white-space: nowrap;
  font-family: inherit;
}
.status-chip:hover { border-color: var(--brand-300); color: var(--brand-600); }
.status-chip.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.filter-select {
  font-size: var(--fs-base);
  color: #475569;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.875rem;
  padding: 0.5rem 0.875rem;
  outline: none;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: var(--brand-400); }

.btn-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: var(--fs-base);
  font-weight: 600;
  color: #fff;
  background: var(--brand-500);
  border: none;
  border-radius: 0.875rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-filter:hover { background: var(--brand-600); }
.btn-filter svg { width: 0.875rem; height: 0.875rem; }

/* ══════════════════════════════════════
   TENANTS — FULL-PAGE TABLE CARD
══════════════════════════════════════ */

.full-table-card {
  background: #fff;
  border-radius: 1.125rem;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.badge-active   { background: #f0fdf4; color: #15803d; }
.badge-inactive { background: #f8fafc; color: #64748b; }
.badge-expiring { background: #fff7ed; color: #c2410c; }
.badge-expired  { background: #f8fafc; color: #64748b; }

.btn-tbl {
  padding: 0.3125rem 0.625rem;
  border-radius: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.btn-tbl-view  { color: var(--brand-600); }
.btn-tbl-view:hover  { background: var(--brand-50); }
.btn-tbl-edit  { color: #64748b; }
.btn-tbl-edit:hover  { background: #f1f5f9; color: #334155; }
.btn-tbl svg { width: 0.8125rem; height: 0.8125rem; }

.sub-item.active { color: var(--brand-600); font-weight: 600; background: linear-gradient(135deg, #eef6fc, #d8eefa); border-left: 3px solid var(--brand-600); padding-left: calc(2.25rem - 3px); }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 0.25rem; }
.page-btn {
  min-width: 1.875rem;
  height: 1.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1.5px solid transparent;
  font-size: calc(var(--fs-base) * 0.923);
  font-weight: 500;
  cursor: pointer;
  background: none;
  color: #64748b;
  font-family: inherit;
  transition: all 0.12s;
}
.page-btn:hover { background: #f1f5f9; color: #1e293b; }
.page-btn.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800));
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-ellipsis { font-size: calc(var(--fs-base) * 0.923); color: #94a3b8; padding: 0 0.25rem; }

/* ══════════════════════════════════════
   TENANT VIEW — BREADCRUMB
══════════════════════════════════════ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: calc(var(--fs-base) * 0.923);
  color: #94a3b8;
}
.breadcrumb a { color: inherit; text-decoration: none; transition: color 0.12s; }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb svg { width: 0.75rem; height: 0.75rem; flex-shrink: 0; }
.breadcrumb span { color: #475569; font-weight: 500; }

/* ══════════════════════════════════════
   TENANT VIEW — PROFILE HERO
══════════════════════════════════════ */

.tenant-hero {
  background: linear-gradient(135deg, #082840 0%, #0d3d5e 40%, var(--brand-500) 100%);
  border-radius: 1.25rem;
  padding: 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.tenant-hero::before {
  content: '';
  position: absolute;
  width: 14rem; height: 14rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -5rem; right: -4rem;
  pointer-events: none;
}
.tenant-hero::after {
  content: '';
  position: absolute;
  width: 9rem; height: 9rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -3rem; right: 9rem;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .hero-inner { flex-direction: row; align-items: flex-start; justify-content: space-between; }
}

.tenant-avatar-xl {
  width: 3.5rem; height: 3.5rem;
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem; font-weight: 800; color: #fff; flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.2);
}

.hero-photo-frame {
  width: 5rem; height: 5rem;
  border-radius: 50%; flex-shrink: 0;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.25);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
@media (min-width: 640px) {
  .hero-photo-frame { width: 5.5rem; height: 5.5rem; }
}
.hero-photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.hero-name { font-size: 1.125rem; font-weight: 800; line-height: 1.25; }
.hero-id   { font-size: calc(var(--fs-base) * 0.923); color: rgba(255,255,255,0.6); margin-top: 0.25rem; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 0.625rem; }
.hero-meta-item {
  display: flex; align-items: center; gap: 0.375rem;
  font-size: calc(var(--fs-base) * 0.923); color: rgba(255,255,255,0.7);
}
.hero-meta-item svg { width: 0.8125rem; height: 0.8125rem; flex-shrink: 0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-hero {
  display: flex; align-items: center; gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: calc(var(--fs-base) * 0.923);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-hero:hover { background: rgba(255,255,255,0.2); }
.btn-hero svg { width: 0.8125rem; height: 0.8125rem; }
.btn-hero-danger { border-color: rgba(239,68,68,0.5); }
.btn-hero-danger:hover { background: rgba(239,68,68,0.15); }

.hero-stats-strip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
@media (min-width: 480px) { .hero-stats-strip { grid-template-columns: repeat(4, 1fr); } }

.hero-stat-item p:first-child {
  font-size: calc(var(--fs-base) * 0.723);
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.hero-stat-item p:last-child { font-size: 1rem; font-weight: 800; margin-top: 0.25rem; }
.hero-stat-item p:last-child small { font-size: var(--fs-xs); font-weight: 400; opacity: 0.7; }

/* ══════════════════════════════════════
   TENANT VIEW — INFO CARDS
══════════════════════════════════════ */

.info-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px)  { .info-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { .info-grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

.info-card {
  background: #fff;
  border-radius: 1.125rem;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.125rem 0.75rem;
  border-bottom: 1px solid #f8fafc;
}
@media (min-width: 640px) { .info-card-header { padding: 1rem 1.25rem 0.75rem; } }

.info-card-icon {
  width: 2rem; height: 2rem;
  border-radius: 0.625rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.info-card-icon svg { width: 1rem; height: 1rem; }

.info-rows { padding: 0.75rem 1.125rem 1rem; display: flex; flex-direction: column; }
@media (min-width: 640px) { .info-rows { padding: 0.875rem 1.25rem 1.125rem; } }

.info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f8fafc;
}
.info-row:last-child { border-bottom: none; }
.info-row dt { font-size: var(--fs-sm); color: #94a3b8; font-weight: 500; flex-shrink: 0; padding-top: 0.0625rem; }
.info-row dd { font-size: var(--fs-base); color: #0f172a; font-weight: 600; text-align: right; margin: 0; word-break: break-word; }
.info-row dd.muted { color: #64748b; font-weight: 400; }

/* ══════════════════════════════════════
   TENANT VIEW — DOCUMENTS
══════════════════════════════════════ */

.doc-list { display: flex; flex-direction: column; }

.doc-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f8fafc;
}
.doc-row:last-child { border-bottom: none; }

.doc-icon {
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.625rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.doc-icon svg { width: 1rem; height: 1rem; }

.doc-info { flex: 1; min-width: 0; }
.doc-info p:first-child { font-size: var(--fs-base); font-weight: 600; color: #0f172a; }
.doc-info p:last-child  { font-size: var(--fs-sm); color: #94a3b8; margin-top: 0.125rem; }

.btn-doc {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  white-space: nowrap;
  display: flex; align-items: center; gap: 0.25rem;
  text-decoration: none;
}
.btn-doc:hover { border-color: var(--brand-300); color: var(--brand-600); }
.btn-doc svg { width: 0.75rem; height: 0.75rem; }

/* ══════════════════════════════════════
   ADMIN FORMS
══════════════════════════════════════ */

.form-card {
  background: #fff;
  border-radius: 1.125rem;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.form-card-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 1.25rem 0.875rem;
  border-bottom: 1px solid #f8fafc;
}

.form-card-icon {
  width: 2rem; height: 2rem;
  border-radius: 0.625rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.form-card-icon svg { width: 1rem; height: 1rem; }

.form-body { padding: 1.25rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px)  { .form-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .form-grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

.form-col-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 0.375rem; }

.form-label {
  font-size: calc(var(--fs-base) * 0.923);
  font-weight: 600;
  color: #475569;
}
.form-label .req { color: #ef4444; margin-left: 0.125rem; }

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: var(--fs-base);
  font-family: inherit;
  color: #1e293b;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  outline: none;
  box-sizing: border-box;
}
.form-control::placeholder { color: #94a3b8; }
.form-control:focus {
  border-color: var(--brand-400);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30,127,184,0.08);
}
.form-control:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}
textarea.form-control { resize: vertical; min-height: 5rem; }

.form-hint { font-size: var(--fs-sm); color: #94a3b8; }

.form-error {
  color: #dc2626;
  font-size: calc(var(--fs-base) * 0.923);
  margin-top: 0.25rem;
}
.form-control.is-invalid {
  border-color: #dc2626;
}

.form-section-divider {
  height: 1px;
  background: #f1f5f9;
  grid-column: 1 / -1;
  margin: 0.25rem 0;
}

/* ── Step indicator ── */
.form-steps {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f8fafc;
  gap: 0;
}
.form-step { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.step-connector { width: 2.5rem; height: 2px; background: #e2e8f0; margin: 0 0.25rem; flex-shrink: 0; border-radius: 1px; }
.step-connector.done { background: #bbf7d0; }

.step-num {
  width: 1.875rem; height: 1.875rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--fs-base) * 0.923);
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s;
}
.step-num.done    { background: #f0fdf4; color: #16a34a; }
.step-num.active  { background: linear-gradient(135deg, var(--brand-500), var(--brand-800)); color: #fff; box-shadow: 0 3px 10px rgba(30,127,184,0.35); }
.step-num.pending { background: #f1f5f9; color: #94a3b8; }

.step-label { font-size: calc(var(--fs-base) * 0.923); font-weight: 500; white-space: nowrap; }
.step-label.active  { color: var(--brand-600); font-weight: 700; }
.step-label.pending { color: #94a3b8; }
.step-label.done    { color: #16a34a; }

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed #e2e8f0;
  border-radius: 0.875rem;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #f8fafc;
}
.upload-zone:hover { border-color: var(--brand-300); background: var(--brand-50); }
.upload-zone input[type="file"] { display: none; }
.upload-zone-icon {
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--brand-50);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.625rem;
}
.upload-zone-icon svg { width: 1.25rem; height: 1.25rem; color: var(--brand-500); }
.upload-zone-title { font-size: var(--fs-base); font-weight: 600; color: #334155; }
.upload-zone-sub   { font-size: var(--fs-sm); color: #94a3b8; margin-top: 0.25rem; }

/* ── Doc upload cards ── */
.doc-upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px)  { .doc-upload-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .doc-upload-grid { grid-template-columns: 1fr 1fr; } }

.doc-upload-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 0.875rem;
  padding: 1rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s;
}
.doc-upload-card:hover { border-color: var(--brand-200); }
.doc-upload-card-icon {
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.625rem;
  display: flex; align-items: center; justify-content: center;
}
.doc-upload-card-icon svg { width: 1.125rem; height: 1.125rem; }
.doc-upload-card p:first-of-type { font-size: var(--fs-base); font-weight: 600; color: #334155; }
.doc-upload-card p:last-of-type  { font-size: var(--fs-sm); color: #94a3b8; margin-top: 0.125rem; }

.btn-upload-file {
  display: flex; align-items: center; justify-content: center; gap: 0.375rem;
  padding: 0.5rem;
  border-radius: 0.625rem;
  border: 1.5px dashed #cbd5e1;
  background: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  width: 100%;
}
.btn-upload-file:hover { border-color: var(--brand-300); color: var(--brand-600); background: var(--brand-50); }
.btn-upload-file svg { width: 0.875rem; height: 0.875rem; }

/* ── Form action bar ── */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}
.form-actions-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ══════════════════════════════════════
   TENANT CATEGORIES
══════════════════════════════════════ */

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px)  { .category-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { .category-grid { grid-template-columns: 1fr 1fr 1fr; } }

.category-card {
  background: #fff;
  border-radius: 1.125rem;
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.category-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

.category-card-icon {
  width: 3rem; height: 3rem;
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.category-card-icon svg { width: 1.5rem; height: 1.5rem; }

.category-count { font-size: 1.75rem; font-weight: 800; color: #0f172a; line-height: 1; margin-top: 0.375rem; }
.category-sub   { font-size: var(--fs-sm); color: #94a3b8; margin-top: 0.25rem; }

.category-rules {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid #f8fafc;
}
.category-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
}
.category-rule span:first-child { color: #64748b; }
.category-rule span:last-child  { font-weight: 600; color: #334155; }

.category-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid #f8fafc;
}

/* ── Category card — enhanced layout ── */
.category-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.category-icon {
  width: 2.75rem; height: 2.75rem;
  border-radius: 0.875rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.category-icon svg { width: 1.375rem; height: 1.375rem; }
.category-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-subtitle {
  font-size: var(--fs-sm);
  color: #94a3b8;
  margin-top: 0.125rem;
}
.category-stats-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}
.category-stat {
  flex: 1;
  background: #f8fafc;
  border-radius: 0.625rem;
  padding: 0.5rem 0.375rem;
  text-align: center;
}
.category-stat-val {
  display: block;
  font-size: var(--fs-base);
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-stat-lbl {
  display: block;
  font-size: calc(var(--fs-base) * 0.692);
  color: #94a3b8;
  margin-top: 0.125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.category-rule-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  color: #475569;
}
.category-rule-row svg { width: 0.875rem; height: 0.875rem; color: #94a3b8; flex-shrink: 0; }
.category-rule-row strong { color: #334155; }
.category-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid #f1f5f9;
}

/* ══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 22rem;
  width: calc(100% - 3rem);
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: #fff;
  border-radius: 0.875rem;
  box-shadow: 0 8px 28px rgba(0,0,0,0.14);
  padding: 0.75rem 0.875rem;
  width: 100%;
  pointer-events: auto;
  transform: translateX(calc(100% + 2rem));
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34,1.3,0.64,1), opacity 0.25s;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-icon { flex-shrink: 0; display: flex; }
.toast-icon svg { width: 1.125rem; height: 1.125rem; }
.toast-msg { flex: 1; font-size: var(--fs-base); color: #334155; font-weight: 500; line-height: 1.4; }
.toast-close {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  padding: 0.25rem; color: #94a3b8; display: flex; border-radius: 0.375rem;
  transition: background 0.15s, color 0.15s;
}
.toast-close:hover { background: #f1f5f9; color: #475569; }
.toast-close svg { width: 0.875rem; height: 0.875rem; }
.toast-success { border-left: 3px solid #16a34a; }
.toast-success .toast-icon svg { color: #16a34a; }
.toast-error   { border-left: 3px solid #dc2626; }
.toast-error .toast-icon svg   { color: #dc2626; }
.toast-warning { border-left: 3px solid #d97706; }
.toast-warning .toast-icon svg { color: #d97706; }
.toast-info    { border-left: 3px solid #1e7fb8; }
.toast-info .toast-icon svg    { color: #1e7fb8; }

/* ══════════════════════════════════════════════════════════
   MODAL OVERLAY & STRUCTURE
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 32rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.34,1.2,0.64,1);
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-lg  { max-width: 48rem; }
.modal-sm  { max-width: 24rem; }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.375rem 1.5rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.modal-title    { font-size: 1rem; font-weight: 700; color: #0f172a; line-height: 1.3; }
.modal-subtitle { font-size: calc(var(--fs-base) * 0.923); color: #94a3b8; margin-top: 0.25rem; }
.modal-close {
  flex-shrink: 0; background: #f8fafc; border: none; border-radius: 0.625rem;
  width: 2rem; height: 2rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  color: #64748b; transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: #f1f5f9; color: #0f172a; }
.modal-close svg { width: 1rem; height: 1rem; }
.modal-body   { padding: 1.25rem 1.5rem; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.5rem; padding: 0 1.5rem 1.375rem;
}
.modal-footer-split { justify-content: space-between; }

/* Modal form elements */
.modal-row   { display: grid; gap: 0.75rem; margin-bottom: 0.875rem; }
.modal-row-2 { grid-template-columns: 1fr 1fr; }
.modal-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.modal-row:last-child { margin-bottom: 0; }
.modal-label { display: block; font-size: calc(var(--fs-base) * 0.923); font-weight: 600; color: #475569; margin-bottom: 0.3125rem; }
.modal-input, .modal-select, .modal-textarea {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1.5px solid #e2e8f0; border-radius: 0.625rem;
  font-size: var(--fs-base); color: #0f172a; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s; outline: none; font-family: inherit;
}
.modal-input:focus, .modal-select:focus, .modal-textarea:focus {
  border-color: #1e7fb8; box-shadow: 0 0 0 3px rgba(30,127,184,0.1);
}
.modal-textarea { resize: vertical; min-height: 5rem; }
.modal-section-label {
  font-size: var(--fs-xs); font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.625rem;
}
.modal-hr { height: 1px; background: #f1f5f9; margin: 0.75rem -1.5rem 1rem; }

/* Inline alert box inside modal */
.modal-alert {
  display: flex; align-items: flex-start; gap: 0.625rem;
  padding: 0.75rem 0.875rem; border-radius: 0.75rem; margin-bottom: 1rem;
}
.modal-alert svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.05rem; }
.modal-alert p   { font-size: calc(var(--fs-base) * 0.923); font-weight: 500; line-height: 1.5; }
.modal-alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.modal-alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.modal-alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.modal-alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* Modal buttons */
.btn-modal-primary {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.5625rem 1.125rem; border-radius: 0.625rem; border: none;
  background: #1e7fb8; font-size: var(--fs-base); font-weight: 600; color: #fff;
  cursor: pointer; transition: background 0.15s; font-family: inherit;
}
.btn-modal-primary:hover { background: #1a6fa0; }
.btn-modal-secondary {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.5625rem 1.125rem; border-radius: 0.625rem;
  border: 1.5px solid #e2e8f0; background: #fff;
  font-size: var(--fs-base); font-weight: 600; color: #475569;
  cursor: pointer; transition: background 0.15s, border-color 0.15s; font-family: inherit;
}
.btn-modal-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-modal-danger {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.5625rem 1.125rem; border-radius: 0.625rem; border: none;
  background: #dc2626; font-size: var(--fs-base); font-weight: 600; color: #fff;
  cursor: pointer; transition: background 0.15s; font-family: inherit;
}
.btn-modal-danger:hover { background: #b91c1c; }
.btn-modal-success {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.5625rem 1.125rem; border-radius: 0.625rem; border: none;
  background: #16a34a; font-size: var(--fs-base); font-weight: 600; color: #fff;
  cursor: pointer; transition: background 0.15s; font-family: inherit;
}
.btn-modal-success:hover { background: #15803d; }
.btn-modal-primary svg, .btn-modal-secondary svg,
.btn-modal-danger svg, .btn-modal-success svg { width: 0.875rem; height: 0.875rem; }

/* File upload zone inside modal */
.modal-upload-zone {
  border: 2px dashed #cbd5e1; border-radius: 0.875rem;
  padding: 2rem 1rem; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s; background: #f8fafc;
}
.modal-upload-zone:hover { border-color: #1e7fb8; background: #eff6ff; }
.modal-upload-zone svg  { width: 2.25rem; height: 2.25rem; color: #94a3b8; margin: 0 auto 0.625rem; display: block; }
.modal-upload-zone p    { font-size: var(--fs-base); color: #475569; font-weight: 500; }
.modal-upload-zone span { font-size: var(--fs-sm); color: #94a3b8; display: block; margin-top: 0.25rem; }

/* Doc preview card inside verify modal */
.doc-preview-card {
  background: #f8fafc; border-radius: 0.875rem; overflow: hidden;
  border: 1px solid #e2e8f0; margin-bottom: 1rem;
}
.doc-preview-ph {
  height: 8rem; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#e2e8f0,#f1f5f9);
}
.doc-preview-ph svg { width: 2.5rem; height: 2.5rem; color: #94a3b8; }
.doc-preview-info { padding: 0.75rem 0.875rem; }
.doc-preview-name { font-size: var(--fs-base); font-weight: 600; color: #0f172a; }
.doc-preview-meta { font-size: var(--fs-sm); color: #94a3b8; margin-top: 0.125rem; }

/* Rules matrix table */
.rules-matrix { width: 100%; border-collapse: collapse; font-size: calc(var(--fs-base) * 0.923); }
.rules-matrix th {
  padding: 0.5rem 0.75rem; background: #f8fafc; color: #475569; font-weight: 700;
  border: 1px solid #e2e8f0; text-align: left; white-space: nowrap;
}
.rules-matrix td {
  padding: 0.5rem 0.75rem; border: 1px solid #f1f5f9;
  color: #334155; vertical-align: top;
}
.rules-matrix tr:nth-child(even) td { background: #fafafa; }

/* ══════════════════════════════════════════════════════════
   BULK ACTION BAR
══════════════════════════════════════════════════════════ */
.bulk-bar {
  display: none; align-items: center; gap: 0.75rem;
  background: #0f172a; color: #fff;
  padding: 0.75rem 1.125rem; border-radius: 0.875rem; margin-bottom: 0.875rem;
}
.bulk-bar.show { display: flex; }
.bulk-count { font-size: var(--fs-base); font-weight: 700; white-space: nowrap; }
.bulk-count span { color: #93c5fd; }
.bulk-sep { width: 1px; height: 1.25rem; background: rgba(255,255,255,0.15); flex-shrink: 0; }
.btn-bulk {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.4375rem 0.875rem; border-radius: 0.5rem; border: none;
  font-size: calc(var(--fs-base) * 0.923); font-weight: 600; color: #fff; cursor: pointer;
  background: rgba(255,255,255,0.1); transition: background 0.15s; font-family: inherit;
}
.btn-bulk:hover { background: rgba(255,255,255,0.18); }
.btn-bulk-danger { background: rgba(239,68,68,0.2); }
.btn-bulk-danger:hover { background: rgba(239,68,68,0.38); }
.btn-bulk svg { width: 0.875rem; height: 0.875rem; }
.bulk-dismiss {
  margin-left: auto; background: none; border: none;
  color: rgba(255,255,255,0.45); cursor: pointer;
  display: flex; padding: 0.25rem; border-radius: 0.375rem;
  transition: color 0.15s, background 0.15s;
}
.bulk-dismiss:hover { color: #fff; background: rgba(255,255,255,0.1); }
.bulk-dismiss svg { width: 1rem; height: 1rem; }

/* Checkbox column */
.th-check, .td-check { width: 2.75rem; text-align: center; padding-left: 0.75rem !important; }
.row-chk { width: 1rem; height: 1rem; accent-color: #1e7fb8; cursor: pointer; }

/* ══════════════════════════════════════════════════════════
   FILTER DRAWER (slide-in from right)
══════════════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.35);
  z-index: 700; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.drawer-overlay.show { opacity: 1; pointer-events: auto; }
.filter-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(22rem, 100vw);
  background: #fff; box-shadow: -8px 0 40px rgba(0,0,0,0.12);
  z-index: 750; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.filter-drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid #f1f5f9;
}
.drawer-title { font-size: var(--fs-lg); font-weight: 700; color: #0f172a; }
.btn-drawer-close {
  background: #f8fafc; border: none; border-radius: 0.625rem;
  width: 2rem; height: 2rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: #64748b;
  transition: background 0.15s;
}
.btn-drawer-close:hover { background: #f1f5f9; color: #0f172a; }
.btn-drawer-close svg { width: 1rem; height: 1rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.drawer-section-label {
  font-size: var(--fs-sm); font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem;
}
.drawer-footer {
  display: flex; gap: 0.625rem; padding: 1rem 1.5rem;
  border-top: 1px solid #f1f5f9;
}
/* Checkbox group inside drawer */
.check-group { display: flex; flex-direction: column; gap: 0.5rem; }
.check-row   { display: flex; align-items: center; gap: 0.5rem; font-size: var(--fs-base); color: #334155; cursor: pointer; }
.check-row input { width: 1rem; height: 1rem; accent-color: #1e7fb8; cursor: pointer; }
/* Range inputs inside drawer */
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

/* ══════════════════════════════════════════════════════════
   INLINE ALERT BANNERS
══════════════════════════════════════════════════════════ */
.alert-banner {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 1rem; border-radius: 0.875rem; margin-bottom: 1rem;
}
.alert-banner > svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; margin-top: 0.0625rem; }
.alert-banner-title { font-size: var(--fs-base); font-weight: 700; }
.alert-banner-msg   { font-size: calc(var(--fs-base) * 0.923); margin-top: 0.125rem; opacity: 0.85; line-height: 1.5; }
.alert-banner-body  { flex: 1; min-width: 0; }
.alert-banner-close {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  opacity: 0.45; padding: 0.125rem; display: flex; transition: opacity 0.15s;
}
.alert-banner-close:hover { opacity: 1; }
.alert-banner-close svg { width: 1rem; height: 1rem; }
.alert {
  padding: 0.75rem 1rem; border-radius: 0.75rem; border: 1px solid transparent;
  font-size: var(--fs-base); line-height: 1.6; margin-bottom: 1rem;
}
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }

/* Tenant checklist (bulk generate) */
.tenant-select-section { margin-top: 1.25rem; }
.tenant-select-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
}
.tenant-select-actions { display: flex; gap: 0.375rem; }
.btn-xs { font-size: calc(var(--fs-base) * 0.923); padding: 0.25rem 0.625rem; }
.tenant-checklist {
  max-height: 20rem; overflow-y: auto;
  border: 1px solid #e2e8f0; border-radius: 0.5rem;
  padding: 0.375rem;
}
.tenant-check-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 0.5rem; border-radius: 0.375rem;
  font-size: var(--fs-base); cursor: pointer;
  transition: background 0.1s;
}
.tenant-check-item:hover { background: #f8fafc; }
.tenant-check-item input[type="checkbox"] { flex-shrink: 0; }
.tenant-check-name { font-weight: 600; color: #0f172a; flex: 1; min-width: 0; }
.tenant-check-code { color: #94a3b8; font-size: calc(var(--fs-base) * 0.923); white-space: nowrap; }

/* Payment method toggle in collect-rent modal */
.pay-method-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pay-method-btn {
  padding: 0.4375rem 0.875rem; border-radius: 0.625rem;
  border: 1.5px solid #e2e8f0; background: #fff;
  font-size: calc(var(--fs-base) * 0.923); font-weight: 600; color: #475569;
  cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-family: inherit;
}
.pay-method-btn.active { border-color: #1e7fb8; background: #eff6ff; color: #1e7fb8; }
.pay-method-btn:hover:not(.active) { border-color: #cbd5e1; background: #f8fafc; }

/* ══════════════════════════════════════════════════════════
   3-DOT ACTION MENU
══════════════════════════════════════════════════════════ */
.action-menu-wrap { position: relative; display: inline-flex; }
.btn-3dot {
  width: 2rem; height: 2rem; border-radius: 0.5rem; border: none;
  background: none; cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: #94a3b8; transition: background 0.15s, color 0.15s;
}
.btn-3dot:hover { background: #f1f5f9; color: #334155; }
.btn-3dot svg  { width: 1.125rem; height: 1.125rem; }
.action-menu {
  position: absolute; top: calc(100% + 0.25rem); right: 0;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 0.875rem; box-shadow: 0 8px 28px rgba(0,0,0,0.1);
  min-width: 11rem; z-index: 200; overflow: hidden;
  opacity: 0; pointer-events: none; transform: scale(0.96) translateY(-4px);
  transition: opacity 0.15s, transform 0.15s; transform-origin: top right;
}
.action-menu.open { opacity: 1; pointer-events: auto; transform: scale(1) translateY(0); }
.action-menu-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.625rem 0.875rem; font-size: var(--fs-base); color: #334155;
  cursor: pointer; transition: background 0.1s; border: none; background: none;
  width: 100%; text-align: left; font-family: inherit; text-decoration: none;
}
.action-menu-item:hover { background: #f8fafc; }
.action-menu-item svg { width: 1rem; height: 1rem; color: #64748b; flex-shrink: 0; }
.action-menu-item.danger { color: #dc2626; }
.action-menu-item.danger svg { color: #dc2626; }
.action-menu-item.danger:hover { background: #fef2f2; }
.action-menu-divider { height: 1px; background: #f1f5f9; margin: 0.25rem 0; }

/* ══════════════════════════════════════════════════════════
   COUNTER COLLECTION (POS interface)
══════════════════════════════════════════════════════════ */
.counter-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) { .counter-grid { grid-template-columns: 1fr; } }
.counter-panel {
  background: #fff; border-radius: 1.125rem;
  border: 1px solid #f1f5f9; box-shadow: var(--shadow-card);
  overflow: hidden;
}
.counter-panel-hd {
  padding: 1rem 1.25rem; border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between;
}
.counter-panel-hd-title { font-size: var(--fs-md); font-weight: 700; color: #0f172a; }
.counter-panel-hd-sub   { font-size: var(--fs-sm); color: #94a3b8; margin-top: 0.0625rem; }
.counter-panel-body { padding: 1.25rem; }

/* Tenant card in counter */
.counter-tenant-card {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 0.875rem; border-radius: 0.875rem;
  border: 2px solid #1e7fb8; background: #eff6ff; margin-bottom: 1rem;
}
.counter-tenant-info h4 { font-size: var(--fs-md); font-weight: 700; color: #0f172a; }
.counter-tenant-info p  { font-size: var(--fs-sm); color: #64748b; margin-top: 0.125rem; }

/* Due breakdown */
.due-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5625rem 0; border-bottom: 1px solid #f8fafc;
  font-size: var(--fs-base);
}
.due-row:last-child { border-bottom: none; }
.due-row-label  { color: #475569; }
.due-row-amount { font-weight: 700; color: #0f172a; }
.due-row-amount.text-danger { color: #dc2626; }
.due-row-amount.text-muted  { color: #94a3b8; font-weight: 500; }
.due-total-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 1rem; background: #0f172a; border-radius: 0.875rem;
  margin-top: 0.875rem;
}
.due-total-bar .lbl { font-size: var(--fs-base); font-weight: 600; color: #94a3b8; }
.due-total-bar .amt { font-size: 1.375rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }

/* Amount display */
.amount-display {
  background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 1rem;
  padding: 1rem 1.25rem; margin-bottom: 1rem; text-align: right;
  transition: border-color 0.15s;
}
.amount-display.active-input { border-color: #1e7fb8; background: #fff; }
.amount-display-label { font-size: var(--fs-sm); color: #94a3b8; margin-bottom: 0.25rem; }
.amount-display-value { font-size: 2.25rem; font-weight: 800; color: #0f172a; line-height: 1; font-variant-numeric: tabular-nums; }
.amount-display-value .currency { font-size: 1.5rem; color: #64748b; }

/* Numpad */
.numpad { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
.numpad-key {
  padding: 0.875rem 0.5rem; border-radius: 0.75rem; border: 1.5px solid #e2e8f0;
  background: #fff; font-size: 1.0625rem; font-weight: 700; color: #0f172a;
  cursor: pointer; text-align: center; transition: all 0.1s; font-family: inherit;
  user-select: none;
}
.numpad-key:hover  { background: #f8fafc; border-color: #cbd5e1; }
.numpad-key:active { background: #e2e8f0; transform: scale(0.97); }
.numpad-wide   { grid-column: span 2; }
.numpad-full   { grid-column: span 3; }
.numpad-accent { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.numpad-accent:hover { background: #dbeafe; border-color: #93c5fd; }
.numpad-del    { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.numpad-del:hover { background: #fee2e2; border-color: #fca5a5; }
.numpad-confirm { background: #1e7fb8; border-color: #1e7fb8; color: #fff; font-size: 1rem; }
.numpad-confirm:hover { background: #1a6fa0; }

/* Recent collections row */
.collection-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0; border-bottom: 1px solid #f8fafc; font-size: var(--fs-base);
}
.collection-row:last-child { border-bottom: none; }
.collection-avatar {
  width: 2rem; height: 2rem; border-radius: 0.625rem;
  background: #eff6ff; color: #1e7fb8; font-size: var(--fs-xs);
  font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   PROPERTY DETAIL
══════════════════════════════════════════════════════════ */
.prop-info-section { margin-bottom: 1.5rem; }
.prop-info-section-title {
  font-size: var(--fs-sm); font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.875rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid #f1f5f9;
}
.prop-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}
@media (max-width: 640px) { .prop-info-grid { grid-template-columns: 1fr; } }
.prop-info-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0.5625rem 0; border-bottom: 1px solid #f8fafc; gap: 1rem;
}
.prop-info-row:last-child { border-bottom: none; }
.prop-info-key   { font-size: calc(var(--fs-base) * 0.923); color: #94a3b8; font-weight: 500; flex-shrink: 0; }
.prop-info-val   { font-size: var(--fs-base); color: #0f172a; font-weight: 600; text-align: right; }
.prop-gallery    { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.75rem; }
.prop-gallery-img {
  width: 9rem; height: 6.5rem; object-fit: cover;
  border-radius: 0.75rem; border: 1px solid #e2e8f0; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.prop-gallery-img:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.prop-gallery-add {
  width: 9rem; height: 6.5rem; border-radius: 0.75rem;
  border: 2px dashed #cbd5e1; background: #f8fafc; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.25rem; color: #94a3b8; font-size: var(--fs-sm); font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.prop-gallery-add:hover { border-color: #1e7fb8; background: #eff6ff; color: #1e7fb8; }
.prop-gallery-add svg { width: 1.25rem; height: 1.25rem; }

/* Occupancy bar for property */
.occ-bar-wrap { margin-top: 0.75rem; }
.occ-bar-label { display: flex; justify-content: space-between; font-size: calc(var(--fs-base) * 0.923); margin-bottom: 0.375rem; }
.occ-bar-label span:first-child { color: #475569; font-weight: 600; }
.occ-bar-label span:last-child  { color: #1e7fb8; font-weight: 700; }
.occ-bar-track { height: 0.5rem; background: #f1f5f9; border-radius: 9999px; overflow: hidden; }
.occ-bar-fill  { height: 100%; background: linear-gradient(90deg, #1e7fb8, #3b9fd4); border-radius: 9999px; transition: width 0.6s ease; }

/* ══════════════════════════════════════════════════════════
   AGREEMENT DAYS-LEFT BADGE
══════════════════════════════════════════════════════════ */
.days-pill {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.1875rem 0.5rem; border-radius: 9999px;
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap;
}
.days-ok      { background: #f0fdf4; color: #15803d; }
.days-warn    { background: #fffbeb; color: #b45309; }
.days-danger  { background: #fef2f2; color: #b91c1c; }
.days-expired { background: #f1f5f9; color: #64748b; }

/* ══════════════════════════════════════════════════════════
   OVERDUE PAGE — penalty breakdown
══════════════════════════════════════════════════════════ */
.overdue-row-detail {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 0.5rem;
  background: #fef9f9; padding: 0.75rem 1rem;
  border-top: 1px solid #fecaca; font-size: calc(var(--fs-base) * 0.923);
}
.overdue-detail-item .k { color: #94a3b8; margin-bottom: 0.125rem; }
.overdue-detail-item .v { font-weight: 700; color: #991b1b; }

/* ══════════════════════════════════════════════════════════
   QUICK-VIEW SLIDE-OUT PANEL
══════════════════════════════════════════════════════════ */
.qv-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 900;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.qv-overlay.show { opacity: 1; pointer-events: auto; }

.qv-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 26rem; max-width: 92vw;
    background: #fff;
    box-shadow: -8px 0 30px rgba(0,0,0,0.12);
    z-index: 910;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.qv-panel.show { transform: translateX(0); }

.qv-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}
.qv-panel-title { font-size: var(--fs-md); font-weight: 700; color: #0f172a; }
.qv-panel-close {
    width: 2rem; height: 2rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 0.5rem; border: none; background: none;
    cursor: pointer; color: #94a3b8;
    transition: background 0.15s, color 0.15s;
}
.qv-panel-close:hover { background: #f1f5f9; color: #334155; }
.qv-panel-close svg { width: 1.125rem; height: 1.125rem; }

.qv-loading {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 0.75rem;
    color: #94a3b8; font-size: var(--fs-base);
}
.qv-spinner {
    width: 2rem; height: 2rem;
    border: 3px solid #e2e8f0;
    border-top-color: var(--brand-500, #1e7fb8);
    border-radius: 50%;
    animation: qvSpin 0.6s linear infinite;
}
@keyframes qvSpin { to { transform: rotate(360deg); } }

.qv-body {
    flex: 1; overflow-y: auto;
    padding: 0; display: flex; flex-direction: column;
}

.qv-identity {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1.125rem 1.25rem;
    background: linear-gradient(135deg, #082840 0%, #0d3d5e 40%, var(--brand-500, #1e7fb8) 100%);
    color: #fff;
}
.qv-avatar {
    width: 3.25rem; height: 3.25rem;
    border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 800;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.2);
    overflow: hidden;
    color: #fff;
}
.qv-name { font-size: var(--fs-lg); font-weight: 700; line-height: 1.25; }
.qv-code { font-size: var(--fs-sm); color: rgba(255,255,255,0.6); margin-top: 0.125rem; }

.qv-section {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}
.qv-section-label {
    font-size: var(--fs-xs); font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 0.625rem;
}
.qv-rows { display: flex; flex-direction: column; }
.qv-row {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 0.75rem; padding: 0.375rem 0;
    border-bottom: 1px solid #f8fafc;
}
.qv-row:last-child { border-bottom: none; }
.qv-row dt { font-size: var(--fs-sm); color: #94a3b8; font-weight: 500; flex-shrink: 0; }
.qv-row dd {
    font-size: var(--fs-base); color: #0f172a; font-weight: 600;
    text-align: right; margin: 0; word-break: break-word;
}

.qv-actions {
    display: flex; gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    margin-top: auto; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   PRINT STYLES (for invoice-view / receipt-view)
══════════════════════════════════════════════════════════ */
@media print {
  /* Hide app shell chrome */
  #sidebar, #sidebar-overlay, .top-header, .btn-hamburger,
  .modal-overlay, .no-print, .pagination,
  .qv-overlay, .qv-panel,
  form[onsubmit], .sidebar-footer { display: none !important; }

  /* Reset layout to full width */
  body { margin: 0; padding: 0; background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .app-shell { display: block !important; }
  .main-col { width: 100% !important; margin: 0 !important; min-height: auto !important; }
  .main-content { padding: 0.5rem !important; }

  /* Print header (hidden on screen) */
  .print-header { display: block !important; }

  /* Clean cards & sections */
  .print-doc { box-shadow: none !important; margin: 0 !important; border-radius: 0 !important; }

  /* Table printing */
  table { width: 100% !important; font-size: 10px !important; }
  thead { display: table-header-group; }
  tr { page-break-inside: avoid; page-break-after: auto; }
  th, td { padding: 4px 6px !important; }

  /* Status badges - preserve colors */
  [style*="background:#dcfce7"], [style*="background:#fee2e2"],
  [style*="background:#dbeafe"], [style*="background:#fef3c7"] {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  /* Page setup — orientation controlled by body class */
  @page portraitPage  { margin: 1cm; size: A4 portrait; }
  @page landscapePage { margin: 1cm; size: A4 landscape; }
  body.print-portrait  { page: portraitPage; }
  body.print-landscape { page: landscapePage; }

  /* Links - don't show URL */
  a { text-decoration: none !important; color: inherit !important; }
  a[href]:after { content: none !important; }
}

/* ══════════════════════════════════════
   CUSTOM DATE PICKER — v4v Brand
══════════════════════════════════════ */

.v4v-dp {
  position: absolute;
  width: 286px;
  background: #fff;
  border-radius: 0.875rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
  font-family: 'Inter', system-ui, sans-serif;
  padding: 1rem;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
}
.v4v-dp.v4v-dp-above { transform: translateY(-6px); }
.v4v-dp.v4v-dp-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Header */
.v4v-dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.v4v-dp-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  user-select: none;
}
.v4v-dp-selectors {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  justify-content: center;
}
.v4v-dp-month-sel, .v4v-dp-year-sel {
  font-size: var(--fs-base);
  font-weight: 700;
  color: #0f172a;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.5rem;
  padding: 0.25rem 0.375rem;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  box-shadow: none !important;
  appearance: auto;
}
.v4v-dp-month-sel:focus, .v4v-dp-year-sel:focus {
  border-color: var(--brand-400) !important;
}
.v4v-dp-month-sel { min-width: 6.5rem; }
.v4v-dp-year-sel { min-width: 4.5rem; }

.v4v-dp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid #f1f5f9;
}
.v4v-dp-today-btn, .v4v-dp-clear-btn {
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
}
.v4v-dp-today-btn {
  background: var(--brand-50);
  color: var(--brand-600);
}
.v4v-dp-today-btn:hover {
  background: var(--brand-100);
}
.v4v-dp-clear-btn {
  background: #f8fafc;
  color: #64748b;
}
.v4v-dp-clear-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}
.v4v-dp-arr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.v4v-dp-arr:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e7fb8;
}
.v4v-dp-arr:active { transform: scale(0.92); }

/* Weekday labels */
.v4v-dp-wk {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 0.375rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid #f1f5f9;
}
.v4v-dp-wk span {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  user-select: none;
}

/* Day grid */
.v4v-dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  justify-items: center;
}

/* Day cell */
.v4v-dp-d {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: var(--fs-base);
  font-weight: 500;
  color: #334155;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.1s;
  padding: 0;
  font-family: inherit;
  line-height: 1;
  outline: none;
}
.v4v-dp-d:hover:not([disabled]) {
  background: #eff6ff;
  color: #1e7fb8;
}

/* Today */
.v4v-dp-d.v4v-dp-today {
  background: #eff6ff;
  color: #1e7fb8;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px #1e7fb8;
}
.v4v-dp-d.v4v-dp-today:hover:not([disabled]) {
  background: #1e7fb8;
  color: #fff;
  box-shadow: none;
}

/* Selected */
.v4v-dp-d.v4v-dp-sel {
  background: #1e7fb8;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(30,127,184,0.35);
}
.v4v-dp-d.v4v-dp-sel:hover { background: #176a9c; }

/* Outside month */
.v4v-dp-d.v4v-dp-out {
  color: #d1d5db;
  cursor: default;
}

/* Disabled */
.v4v-dp-d.v4v-dp-dis {
  color: #e5e7eb;
  cursor: not-allowed;
}

/* ── Month Picker Grid ── */
.v4v-mp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.v4v-mp-btn {
  padding: 0.625rem 0;
  border-radius: 0.5rem;
  font-size: var(--fs-base);
  font-weight: 500;
  color: #334155;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.1s;
  font-family: inherit;
  outline: none;
}
.v4v-mp-btn:hover {
  background: #eff6ff;
  color: #1e7fb8;
}
.v4v-mp-btn.v4v-dp-today {
  background: #eff6ff;
  color: #1e7fb8;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px #1e7fb8;
}
.v4v-mp-btn.v4v-dp-today:hover {
  background: #1e7fb8;
  color: #fff;
  box-shadow: none;
}
.v4v-mp-btn.v4v-dp-sel {
  background: #1e7fb8;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(30,127,184,0.35);
}
.v4v-mp-btn.v4v-dp-sel:hover {
  background: #176a9c;
}

/* Display input */
input[readonly].form-control,
input[readonly].modal-input {
  cursor: pointer;
  background: #fff;
}

/* ── Lease Profile Dashboard ── */
.lease-profile {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}

.lease-sidebar {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lease-sidebar-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
}

.lease-sidebar-card .sidebar-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.625rem;
}

.lease-sidebar-card dl {
  display: grid;
  gap: 0.375rem;
}

.lease-sidebar-card .sidebar-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-base);
}

.lease-sidebar-card .sidebar-row dt {
  color: #64748b;
}

.lease-sidebar-card .sidebar-row dd {
  font-weight: 600;
  color: #0f172a;
  text-align: right;
}

.lease-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lease-quick-actions a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.625rem;
  font-size: var(--fs-base);
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background 0.15s, color 0.15s;
}

.lease-quick-actions a:hover {
  background: #f1f5f9;
  color: var(--brand-600);
}

.lease-quick-actions a svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.lease-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.lease-tab {
  padding: 0.5rem 1rem;
  font-size: var(--fs-base);
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.lease-tab:hover {
  color: #334155;
}

.lease-tab.active {
  color: var(--brand-600);
  border-bottom-color: var(--brand-500);
}

.lease-tab svg {
  width: 0.875rem;
  height: 0.875rem;
}

.lease-tab .tab-count {
  font-size: var(--fs-sm);
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  padding: 0.0625rem 0.375rem;
  border-radius: 9999px;
  min-width: 1.25rem;
  text-align: center;
}

.lease-tab.active .tab-count {
  background: var(--brand-50, #eff6ff);
  color: var(--brand-600);
}

@media (max-width: 768px) {
  .lease-profile {
    grid-template-columns: 1fr;
  }
  .lease-sidebar {
    position: static;
  }
}
