@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ========================================
   RENTAL MANAGER - COMPLETE REDESIGN
   Modern Dark Sidebar + Professional RTL
   ======================================== */

:root {
  /* Sidebar - Dark Theme */
  --rm-sidebar-bg: #0f172a;
  --rm-sidebar-hover: #1e293b;
  --rm-sidebar-active: rgba(99, 102, 241, 0.15);
  --rm-sidebar-text: #94a3b8;
  --rm-sidebar-text-active: #ffffff;
  --rm-sidebar-width: 260px;
  --rm-sidebar-collapsed: 72px;

  /* Main colors */
  --rm-primary: #6366f1;
  --rm-primary-light: #818cf8;
  --rm-primary-dark: #4f46e5;
  --rm-primary-bg: rgba(99, 102, 241, 0.08);

  /* Background & Surface */
  --rm-bg: #f1f5f9;
  --rm-surface: #ffffff;
  --rm-surface-hover: #f8fafc;

  /* Text */
  --rm-text: #0f172a;
  --rm-text-secondary: #475569;
  --rm-text-muted: #94a3b8;

  /* Status Colors */
  --rm-success: #10b981;
  --rm-success-bg: rgba(16, 185, 129, 0.1);
  --rm-danger: #ef4444;
  --rm-danger-bg: rgba(239, 68, 68, 0.1);
  --rm-warning: #f59e0b;
  --rm-warning-bg: rgba(245, 158, 11, 0.1);
  --rm-info: #3b82f6;
  --rm-info-bg: rgba(59, 130, 246, 0.1);

  /* Spacing & Shape */
  --rm-radius: 12px;
  --rm-radius-sm: 8px;
  --rm-radius-lg: 16px;
  --rm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --rm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --rm-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --rm-border: #e2e8f0;

  /* Transition */
  --rm-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  direction: rtl;
  background: var(--rm-bg);
  color: var(--rm-text);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* Remove WordPress theme wrappers */
.rm-app-page .site,
.rm-app-page .site-main,
.rm-app-page .entry-content,
.rm-app-page .wp-site-blocks,
.rm-app-page .wp-block-post-content,
.rm-app-page .wp-block-group,
.rm-app-page .wp-block-cover,
.rm-app-page .page-content,
.rm-app-page .entry-content > * {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.rm-app-page .entry-content > * {
  margin-block: 0 !important;
}

.rm-app-page {
  background: var(--rm-bg);
}

/* Hide theme header/footer on app/login/portal pages */
.rm-app-page header,
.rm-app-page .site-header,
.rm-app-page .site-branding,
.rm-app-page .site-branding * ,
.rm-app-page .wp-block-template-part,
.rm-app-page .wp-block-site-title,
.rm-app-page .wp-block-site-tagline,
.rm-app-page .wp-block-site-logo,
.rm-app-page .site-footer,
.rm-app-page footer,
.rm-app-page .wp-block-template-part.footer,
.rm-app-page .wp-block-template-part.header,
.rm-app-page .site-title,
.rm-app-page .site-description,
.rm-app-page #masthead,
.rm-app-page .main-header,
.rm-app-page .page-header,
.rm-app-page .ast-header,
.rm-app-page .ast-primary-header-bar,
.rm-app-page .ast-below-header-bar,
.rm-app-page .ast-above-header-bar,
.rm-app-page .header,
.rm-app-page .header-main {
  display: none !important;
}

/* Hide theme page title to avoid duplicate headings */
.rm-app-page .entry-title,
.rm-app-page .page-title,
.rm-app-page .wp-block-post-title {
  display: none !important;
}

/* Hide theme header/footer on app pages */
.rm-app-page header,
.rm-app-page .site-header,
.rm-app-page .wp-block-template-part,
.rm-app-page .site-footer,
.rm-app-page footer,
.rm-app-page .wp-block-template-part.footer,
.rm-app-page .wp-block-template-part.header {
  display: none !important;
}

/* Hide WP admin bar on app page for clean look */
.rm-app-page #wpadminbar,
.rm-app-page .admin-bar {
  display: none !important;
}

.rm-app-page {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

html.rm-app-page,
html .rm-app-page {
  margin-top: 0 !important;
}

/* ========== APP SHELL ========== */
.rm-app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.rm-app::before {
  content: none;
}

#rm-app-root {
  width: 100%;
  display: flex;
}

/* ========== SIDEBAR ========== */
.rm-sidebar {
  width: var(--rm-sidebar-width);
  min-width: var(--rm-sidebar-width);
  background: var(--rm-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--rm-transition), min-width var(--rm-transition);
  order: 2;
}

.rm-sidebar::before {
  content: none;
}

/* Scrollbar for sidebar */
.rm-sidebar::-webkit-scrollbar {
  width: 4px;
}
.rm-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.rm-sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

/* Brand */
.rm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 8px;
  margin-bottom: 8px;
}

.rm-logo {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--rm-primary), var(--rm-primary-dark));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.rm-brand-title {
  font-weight: 600;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.rm-brand-sub {
  color: var(--rm-sidebar-text);
  font-size: 11px;
  margin-top: 1px;
}

/* Navigation */
.rm-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  flex: 1;
}

.rm-nav-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 8px;
  margin-top: 6px;
}

.rm-nav-divider span {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #475569;
  white-space: nowrap;
}

.rm-nav-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.2);
}

.rm-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 10px;
  color: var(--rm-sidebar-text);
  text-decoration: none !important;
  font-size: 16px;
  font-weight: 400;
  transition: all var(--rm-transition);
  border: none;
  position: relative;
  white-space: nowrap;
  line-height: 1.4;
}

.rm-nav-link:hover {
  background: var(--rm-sidebar-hover);
  color: #e2e8f0;
  text-decoration: none !important;
  transform: none;
}

.rm-nav-link:focus,
.rm-nav-link:visited {
  text-decoration: none !important;
}

.rm-nav-link.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.1));
  color: var(--rm-sidebar-text-active);
  font-weight: 600;
  border: none;
}

.rm-nav-link.active::before {
  content: "";
  position: absolute;
  right: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--rm-primary-light);
}

.rm-nav-link.active::after {
  content: none;
}

/* Nav Emoji */
.rm-nav-emoji {
  font-size: 22px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
  filter: grayscale(0.3);
  transition: filter var(--rm-transition), transform var(--rm-transition);
}

.rm-nav-link:hover .rm-nav-emoji {
  filter: grayscale(0);
  transform: scale(1.1);
}

.rm-nav-link.active .rm-nav-emoji {
  filter: grayscale(0);
  transform: scale(1.1);
}

.rm-nav-text {
  flex: 1;
}

/* Sidebar logout link */
.rm-nav-logout {
  margin: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  color: var(--rm-danger, #ef4444) !important;
  opacity: 0.8;
}

.rm-nav-logout:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* Side Card */
.rm-side-card {
  margin: 12px;
  padding: 14px 16px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: var(--rm-radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.rm-side-card h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--rm-primary-light);
}

.rm-side-card p {
  margin: 0;
  color: var(--rm-sidebar-text);
  font-size: 11.5px;
  line-height: 1.5;
}

/* ========== MAIN CONTENT ========== */
.rm-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-right: var(--rm-sidebar-width);
  order: 1;
  background: var(--rm-bg);
  transition: margin-right var(--rm-transition);
}

/* ========== TOP BAR ========== */
.rm-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  background: var(--rm-surface);
  border-bottom: 1px solid var(--rm-border);
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 56px;
}

.rm-topbar-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.rm-menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--rm-radius-sm);
  border: 1px solid var(--rm-border);
  background: var(--rm-surface);
  cursor: pointer;
  display: none;
  position: relative;
  transition: all var(--rm-transition);
  appearance: none;
  -webkit-appearance: none;
  color: var(--rm-text);
  padding: 0;
  outline: none;
}

.rm-menu-toggle:hover {
  background: var(--rm-bg);
  border-color: #cbd5e1;
}

.rm-hamburger {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--rm-text-secondary);
  border-radius: 2px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all var(--rm-transition);
}

.rm-hamburger::before,
.rm-hamburger::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--rm-text-secondary);
  border-radius: 2px;
  position: absolute;
  right: 0;
  transition: all var(--rm-transition);
}

.rm-hamburger::before { top: -6px; }
.rm-hamburger::after { top: 6px; }

/* Remove old pseudo-elements from toggle */
.rm-menu-toggle::before,
.rm-menu-toggle::after {
  content: none;
}

.rm-user-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rm-primary), var(--rm-primary-dark));
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.rm-user-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.3);
}

/* ========== PAGE HEADER ========== */
.rm-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 28px 0;
}

.rm-page-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--rm-text);
  letter-spacing: -0.5px;
}

.rm-page-header p {
  margin: 4px 0 0;
  color: var(--rm-text-muted);
  font-size: 13px;
}

/* ========== CONTENT AREA ========== */
.rm-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 28px 32px;
}

/* ========== CARDS ========== */
.rm-card {
  background: var(--rm-surface);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--rm-radius);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow var(--rm-transition), border-color var(--rm-transition);
}

.rm-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--rm-border);
}

/* When card directly contains a table, remove side padding for edge-to-edge */
.rm-card > .rm-table {
  margin: 0 -21px -21px;
  width: calc(100% + 42px);
  border-radius: 0;
  border-top: 1px solid var(--rm-border);
  border-left: none;
  border-right: none;
  border-bottom: none;
}

/* If card ONLY has a table (no title/form above), remove top padding too */
.rm-card > .rm-table:first-child {
  margin-top: -21px;
  border-top: none;
}

/* When card has a title (h4) then table, keep top spacing */
.rm-card > h4 + .rm-table,
.rm-card > h3 + .rm-table {
  margin-top: 12px;
}

.rm-card.form {
  animation: rm-fade 0.3s ease;
}

.rm-card.stat {
  text-align: center;
  padding: 24px 16px;
}

.rm-card h3,
.rm-card h4,
.rm-card h5 {
  margin-top: 0;
  font-weight: 600;
  color: var(--rm-text);
}

/* ========== DASHBOARD ========== */
.rm-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Stat Cards (Row 1 & 2) --- */
.rm-dash-row {
  display: grid;
  gap: 16px;
}

.rm-dash-stats-main {
  grid-template-columns: repeat(5, 1fr);
}

.rm-dash-stats-secondary {
  grid-template-columns: repeat(4, 1fr);
}

.rm-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  text-decoration: none !important;
  color: var(--rm-text);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.rm-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 4px 4px 0;
  transition: width 0.25s ease;
}

.rm-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  text-decoration: none !important;
}

.rm-stat-card:hover::before {
  width: 5px;
}

/* Color themes for stat cards */
.rm-stat-indigo::before { background: #6366f1; }
.rm-stat-green::before  { background: #10b981; }
.rm-stat-amber::before  { background: #f59e0b; }
.rm-stat-orange::before { background: #f97316; }
.rm-stat-blue::before   { background: #3b82f6; }
.rm-stat-red::before    { background: #ef4444; }
.rm-stat-cyan::before   { background: #06b6d4; }
.rm-stat-teal::before   { background: #14b8a6; }
.rm-stat-purple::before { background: #8b5cf6; }

.rm-stat-indigo .rm-stat-icon { background: rgba(99, 102, 241, 0.1); }
.rm-stat-green .rm-stat-icon  { background: rgba(16, 185, 129, 0.1); }
.rm-stat-amber .rm-stat-icon  { background: rgba(245, 158, 11, 0.1); }
.rm-stat-orange .rm-stat-icon { background: rgba(249, 115, 22, 0.1); }
.rm-stat-blue .rm-stat-icon   { background: rgba(59, 130, 246, 0.1); }
.rm-stat-red .rm-stat-icon    { background: rgba(239, 68, 68, 0.1); }
.rm-stat-cyan .rm-stat-icon   { background: rgba(6, 182, 212, 0.1); }
.rm-stat-teal .rm-stat-icon   { background: rgba(20, 184, 166, 0.1); }
.rm-stat-purple .rm-stat-icon { background: rgba(139, 92, 246, 0.1); }

.rm-stat-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  transition: transform 0.25s ease;
}

.rm-stat-card:hover .rm-stat-icon {
  transform: scale(1.1);
}

.rm-stat-body {
  flex: 1;
  min-width: 0;
}

.rm-stat-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--rm-text);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.rm-stat-lbl {
  color: var(--rm-text-muted);
  font-size: 13px;
  font-weight: 400;
  margin-top: 2px;
}

.rm-stat-sub {
  color: var(--rm-text-secondary);
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--rm-border);
}

/* --- Mini cards (Row 3) --- */
.rm-dash-stats-mini {
  grid-template-columns: repeat(4, 1fr);
}

.rm-mini-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  text-decoration: none !important;
  color: var(--rm-text);
  transition: all 0.2s ease;
}

.rm-mini-card:hover {
  border-color: var(--rm-primary);
  box-shadow: var(--rm-shadow);
  text-decoration: none !important;
}

.rm-mini-emoji {
  font-size: 20px;
}

.rm-mini-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--rm-text);
}

.rm-mini-lbl {
  font-size: 13px;
  color: var(--rm-text-muted);
}

/* --- P&L Card --- */
.rm-dash-pnl {
  display: block;
}

.rm-pnl-card {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  padding: 24px;
  box-shadow: var(--rm-shadow-sm);
}

.rm-pnl-header {
  margin-bottom: 20px;
}

.rm-pnl-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--rm-text);
}

.rm-pnl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.rm-pnl-item {
  padding: 20px;
  border-radius: var(--rm-radius-sm);
  text-align: center;
}

.rm-pnl-income {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.rm-pnl-expense {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.12);
}

.rm-pnl-net {
  border: 2px solid var(--rm-border);
}

.rm-pnl-net.positive {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
}

.rm-pnl-net.negative {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
}

.rm-pnl-item-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--rm-text-secondary);
  margin-bottom: 8px;
}

.rm-pnl-item-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--rm-text);
  letter-spacing: -0.5px;
}

.rm-pnl-income .rm-pnl-item-val { color: #059669; }
.rm-pnl-expense .rm-pnl-item-val { color: #dc2626; }
.rm-pnl-net.positive .rm-pnl-item-val { color: #059669; }
.rm-pnl-net.negative .rm-pnl-item-val { color: #dc2626; }

.rm-pnl-note {
  margin: 16px 0 0;
  color: var(--rm-text-muted);
  font-size: 12px;
  text-align: center;
}

/* --- Dashboard panels (bottom section) --- */
.rm-dash-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.rm-dash-panel-card {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  overflow: hidden;
  box-shadow: var(--rm-shadow-sm);
}

.rm-dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--rm-border);
  background: #fafbfe;
}

.rm-dash-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rm-dash-panel-emoji {
  font-size: 20px;
}

.rm-dash-panel-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--rm-text);
}

.rm-dash-panel-body {
  padding: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.rm-dash-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--rm-radius-sm);
  transition: background 0.15s ease;
}

.rm-dash-row-item:hover {
  background: var(--rm-surface-hover);
}

.rm-dash-row-item.unread {
  background: rgba(99, 102, 241, 0.04);
  border-right: 3px solid var(--rm-primary);
}

.rm-dash-row-content {
  flex: 1;
  min-width: 0;
}

.rm-dash-row-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--rm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-dash-row-meta {
  font-size: 11.5px;
  color: var(--rm-text-muted);
  margin-top: 2px;
}

.rm-dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--rm-text-muted);
}

.rm-dash-empty span {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.rm-dash-empty p {
  margin: 0;
  font-size: 13px;
}

/* --- Finance Row (P&L + Payment Methods side-by-side) --- */
.rm-dash-finance-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

/* --- Payment Methods Card --- */
.rm-payment-methods {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rm-pm-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--rm-bg);
  border-radius: var(--rm-radius-sm);
  transition: all 0.2s ease;
}

.rm-pm-item:hover {
  background: #eef2ff;
}

.rm-pm-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.rm-pm-cash { background: rgba(16, 185, 129, 0.12); }
.rm-pm-transfer { background: rgba(59, 130, 246, 0.12); }
.rm-pm-check { background: rgba(139, 92, 246, 0.12); }

.rm-pm-body {
  flex: 1;
}

.rm-pm-label {
  font-size: 13px;
  color: var(--rm-text-muted);
  font-weight: 400;
}

.rm-pm-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--rm-text);
  letter-spacing: -0.3px;
}

/* --- Payments Panel (full width) --- */
.rm-dash-payments-panel {
  width: 100%;
}

/* --- Dashboard Quick Forms --- */
.rm-hidden {
  display: none !important;
}

.rm-dash-quick-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  background: var(--rm-bg);
  border-bottom: 1px solid var(--rm-border);
  flex-wrap: wrap;
}

.rm-dash-quick-form input[type="text"],
.rm-dash-quick-form input[type="date"],
.rm-dash-quick-form select {
  padding: 8px 12px;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--rm-surface);
  color: var(--rm-text);
}

.rm-dash-quick-form input[type="text"] {
  flex: 1;
  min-width: 120px;
}

.rm-dash-quick-form input[type="text"]:focus,
.rm-dash-quick-form select:focus {
  outline: none;
  border-color: var(--rm-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Panel header with multiple actions */
.rm-dash-panel-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ========== COLLAPSE / EXPAND ========== */
.rm-collapse-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--rm-border);
  background: var(--rm-surface);
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  color: var(--rm-text-muted);
  font-size: 14px;
  padding: 0;
  margin-right: -4px;
}

.rm-collapse-toggle:hover {
  background: var(--rm-bg);
  border-color: var(--rm-primary);
  color: var(--rm-primary);
}

.rm-collapse-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(0deg);
}

.rm-dash-panel-card.collapsed .rm-collapse-toggle svg,
.rm-pnl-card.collapsed .rm-collapse-toggle svg {
  transform: rotate(-90deg);
}

/* Collapsed state: hide everything after header */
.rm-dash-panel-card.collapsed .rm-dash-panel-body,
.rm-dash-panel-card.collapsed .rm-collection-list,
.rm-dash-panel-card.collapsed #rm-alert-form,
.rm-dash-panel-card.collapsed #rm-todo-form {
  display: none !important;
}

.rm-pnl-card.collapsed .rm-payment-methods,
.rm-pnl-card.collapsed .rm-pnl-profit {
  display: none !important;
}

.rm-dash-panel-card.collapsed .rm-dash-panel-header {
  border-bottom-color: transparent;
}

/* --- Toast Notifications --- */
#rm-toast-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.rm-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--rm-radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  animation: rm-toast-in 0.4s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
  backdrop-filter: blur(10px);
}

.rm-toast-info {
  background: rgba(99, 102, 241, 0.95);
  color: #ffffff;
}

.rm-toast-danger {
  background: rgba(239, 68, 68, 0.95);
  color: #ffffff;
}

.rm-toast-msg {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.rm-toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.rm-toast-close:hover {
  opacity: 1;
}

@keyframes rm-toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Legacy compat */
.rm-dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.rm-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

/* Panels */
.rm-panel {
  padding: 20px;
}

.rm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rm-border);
}

.rm-panel-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

/* ========== LISTS ========== */
.rm-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.rm-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  background: var(--rm-surface);
  transition: all var(--rm-transition);
}

.rm-list-item:hover {
  background: var(--rm-surface-hover);
  border-color: #cbd5e1;
}

.rm-list-item.unread {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.04);
}

.rm-list-title {
  font-weight: 500;
  font-size: 13.5px;
  color: var(--rm-text);
}

.rm-list-meta {
  font-size: 11.5px;
  color: var(--rm-text-muted);
  margin-top: 3px;
}

.rm-list-empty {
  padding: 16px 4px;
  color: var(--rm-text-muted);
  font-size: 13px;
  text-align: center;
}

/* ========== MODERN TABLE 2026 ========== */
.rm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  overflow: hidden;
}

/* ---- Header ---- */
.rm-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.rm-table th {
  text-align: right;
  vertical-align: middle;
  color: #334155;
  font-weight: 800;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  background: #f1f5f9;
  white-space: nowrap;
  padding: 14px 22px;
  border-bottom: 1px solid var(--rm-border);
  border-left: 1px solid rgba(226, 232, 240, 0.6);
}

.rm-table th:first-child {
  border-left: none;
}

/* ---- Body rows ---- */
.rm-table tbody tr {
  transition: background 0.15s ease;
}

.rm-table tbody tr:nth-child(odd) {
  background: var(--rm-surface);
}

.rm-table tbody tr:nth-child(even) {
  background: #fafcff;
}

.rm-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.045);
}

.rm-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---- Cells ---- */
.rm-table td {
  text-align: right;
  vertical-align: middle;
  padding: 15px 22px;
  color: var(--rm-text-secondary);
  line-height: 1.65;
  font-size: 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  border-left: 1px solid rgba(226, 232, 240, 0.4);
}

.rm-table td:first-child {
  border-left: none;
}

.rm-table td strong {
  color: var(--rm-text);
  font-weight: 700;
  font-size: 14.5px;
}

/* First column emphasis */
.rm-table td:first-child {
  color: var(--rm-text);
  font-weight: 600;
  font-size: 14.5px;
}

/* ========== BUTTONS ========== */
.rm-btn {
  border: none;
  background: var(--rm-primary);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--rm-radius-sm);
  text-decoration: none !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  transition: all var(--rm-transition);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
  line-height: 1.4;
}

.rm-btn:hover {
  background: var(--rm-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  color: #ffffff;
  text-decoration: none !important;
}

.rm-btn.primary {
  background: var(--rm-primary);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
}

.rm-btn.primary:hover {
  background: var(--rm-primary-dark);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.rm-btn.ghost {
  background: var(--rm-surface);
  color: var(--rm-primary);
  border: 2px solid var(--rm-primary);
  box-shadow: none;
}

.rm-btn.ghost:hover {
  background: var(--rm-primary-bg);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
  color: var(--rm-primary-dark);
}

.rm-btn.success {
  background: var(--rm-success);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.rm-btn.success:hover {
  background: #059669;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.rm-btn.danger {
  background: var(--rm-danger);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
}

.rm-btn.danger:hover {
  background: #dc2626;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
}

.rm-btn.mini {
  padding: 6px 14px;
  font-size: 12.5px;
  border-radius: 6px;
  font-weight: 500;
}

/* Secondary / outline button style */
.rm-btn.secondary {
  background: var(--rm-surface);
  color: var(--rm-text);
  border: 1px solid var(--rm-border);
  box-shadow: var(--rm-shadow-sm);
}

.rm-btn.secondary:hover {
  background: var(--rm-bg);
  border-color: #cbd5e1;
  color: var(--rm-text);
  box-shadow: var(--rm-shadow);
}

/* Logout button */
.rm-btn-logout {
  background: transparent !important;
  color: var(--rm-text-muted) !important;
  border: 1px solid var(--rm-border) !important;
  box-shadow: none !important;
  padding: 6px 14px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
}

.rm-btn-logout:hover {
  background: var(--rm-danger-bg) !important;
  color: var(--rm-danger) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.rm-btn-cache {
  background: transparent !important;
  color: var(--rm-text-muted) !important;
  border: 1px solid var(--rm-border) !important;
  box-shadow: none !important;
  padding: 6px 14px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  cursor: pointer;
}

.rm-btn-cache:hover {
  background: var(--rm-info-bg) !important;
  color: var(--rm-info) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

/* ========== LINKS ========== */
.rm-link {
  background: none;
  border: none;
  color: var(--rm-primary);
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  transition: color var(--rm-transition);
}

.rm-link:hover {
  color: var(--rm-primary-dark);
}

.rm-link.danger {
  color: var(--rm-danger);
}

.rm-link.danger:hover {
  color: #dc2626;
}

/* ========== FORMS ========== */
.rm-grid.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.rm-grid.quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.rm-grid.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.rm-grid.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--rm-text-secondary);
  text-align: right;
}

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

.rm-grid.form label.inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.rm-grid.form input,
.rm-grid.form select,
.rm-grid.form textarea {
  background: var(--rm-bg);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  padding: 10px 14px;
  color: var(--rm-text);
  font-family: inherit;
  font-size: 13.5px;
  width: 100%;
  direction: rtl;
  transition: all var(--rm-transition);
}

.rm-grid.form textarea {
  min-height: 120px;
  resize: vertical;
}

.rm-grid.form input:focus,
.rm-grid.form select:focus,
.rm-grid.form textarea:focus {
  outline: none;
  background: var(--rm-surface);
  border-color: var(--rm-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.rm-grid.form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--rm-primary);
}

/* Portal form layout */
.rm-portal-card .rm-grid.form {
  gap: 16px;
}

.rm-portal-form {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  padding: 20px;
  box-shadow: var(--rm-shadow-sm);
}

.rm-portal-form .rm-btn.primary {
  width: 100%;
  margin-top: 8px;
}

.rm-inline-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rm-inline-input .rm-btn {
  white-space: nowrap;
  padding: 8px 12px;
}

/* ========== STATUS PILLS ========== */
.rm-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--rm-primary-bg);
  color: var(--rm-primary);
  letter-spacing: 0.2px;
  white-space: nowrap;
  line-height: 1.5;
}

/* Property statuses */
.status-מושכר {
  background: var(--rm-success-bg);
  color: var(--rm-success);
}

.status-פנוי {
  background: rgba(148, 163, 184, 0.15);
  color: var(--rm-text-muted);
}

.status-תחזוקה {
  background: var(--rm-warning-bg);
  color: var(--rm-warning);
}

/* Lease statuses */
.status-פעיל {
  background: var(--rm-info-bg);
  color: var(--rm-info);
}

.status-הסתיים {
  background: rgba(148, 163, 184, 0.15);
  color: var(--rm-text-muted);
}

.status-בוטל {
  background: var(--rm-danger-bg);
  color: var(--rm-danger);
}

/* Payment statuses */
.status-שולם, .status-הועבר, .status-הופקד, .status-הוחזר, .status-טופל, .status-מאושר {
  background: var(--rm-success-bg);
  color: var(--rm-success);
}

.status-ממתין {
  background: rgba(148, 163, 184, 0.15);
  color: var(--rm-text-muted);
}

.status-באיחור, .status-חזר, .status-פספס, .status-נדחה {
  background: var(--rm-danger-bg);
  color: var(--rm-danger);
}

.status-חדש {
  background: var(--rm-info-bg);
  color: var(--rm-info);
}

.status-בטיפול {
  background: var(--rm-warning-bg);
  color: var(--rm-warning);
}

/* Priority statuses */
.status-קריטית, .status-אדום {
  background: var(--rm-danger-bg);
  color: var(--rm-danger);
}

.status-גבוהה, .status-כתום {
  background: var(--rm-warning-bg);
  color: var(--rm-warning);
}

.status-בינונית, .status-צהוב {
  background: rgba(234, 179, 8, 0.12);
  color: #a16207;
}

.status-נמוכה, .status-ירוק {
  background: var(--rm-success-bg);
  color: var(--rm-success);
}

/* ========== ALERTS ========== */
.rm-alert {
  padding: 12px 16px;
  border-radius: var(--rm-radius-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rm-alert.success {
  background: var(--rm-success-bg);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.rm-alert.danger {
  background: var(--rm-danger-bg);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ========== TAGS ========== */
.rm-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 6px;
}

.rm-tag.tenant {
  background: var(--rm-info-bg);
  color: var(--rm-info);
}

/* ========== SUB CARDS ========== */
.rm-sub-card {
  margin-top: 16px;
  background: #fafbfe;
  border: 1px dashed #d1d5db;
  box-shadow: none;
}

.rm-sub-card h4 {
  margin-top: 0;
}

.rm-highlight {
  border: 2px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

/* ========== HELPER TEXT ========== */
.rm-helper {
  margin: 0 0 12px;
  color: var(--rm-text-muted);
  font-size: 12.5px;
}

/* ========== IMAGE GRID ========== */
.rm-image-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.rm-image-item {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  padding: 6px;
  transition: all var(--rm-transition);
}

.rm-image-item:hover {
  box-shadow: var(--rm-shadow);
}

.rm-image-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  cursor: pointer;
}

/* Thumbnails in service calls list */
.rm-thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rm-thumbs img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rm-border);
  cursor: zoom-in;
  transition: transform 0.2s, box-shadow 0.2s;
}
.rm-thumbs img:hover {
  transform: scale(1.15);
  box-shadow: var(--rm-shadow);
}

/* Lightbox overlay */
.rm-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: rm-lightbox-in 0.2s ease;
}
@keyframes rm-lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.rm-lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  object-fit: contain;
}
.rm-lightbox-close {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.rm-lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

.rm-thumb-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--rm-border);
  background: var(--rm-surface);
  color: var(--rm-text-secondary);
  font-size: 11px;
  text-decoration: none;
}

.rm-image-caption {
  margin-top: 6px;
  font-size: 11px;
  color: var(--rm-text-muted);
  text-align: center;
}

/* ========== QUICK LINKS ========== */
.rm-quick-link h3,
.rm-card.quick-link h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.rm-card.quick-link {
  text-decoration: none;
  color: var(--rm-text);
  transition: all var(--rm-transition);
  cursor: pointer;
}

.rm-card.quick-link:hover {
  border-color: var(--rm-primary);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
}

/* ========== ACTIONS BAR ========== */
.rm-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.rm-actions form {
  margin: 0;
}

.rm-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  min-width: 110px;
  border-radius: var(--rm-radius-sm);
  border: 1px solid var(--rm-border);
  background: var(--rm-surface);
  color: var(--rm-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--rm-transition);
}

.rm-action-btn:hover {
  border-color: var(--rm-primary);
  box-shadow: var(--rm-shadow-sm);
}

.rm-action-btn.danger {
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--rm-danger);
}

.rm-action-btn.danger:hover {
  background: var(--rm-danger-bg);
}

.rm-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.rm-inline-form {
  margin: 0;
}

/* ========== APPROVAL ROWS ========== */
.rm-row-מאושר td {
  background: rgba(16, 185, 129, 0.05);
}

.rm-row-נדחה td {
  background: rgba(239, 68, 68, 0.05);
}

.rm-row-ממתין td {
  background: rgba(15, 23, 42, 0.02);
}

.rm-approval-meta {
  grid-column: 1 / -1;
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--rm-text-muted);
}

/* ========== FILE PILL ========== */
.rm-file-pill {
  grid-column: 1 / -1;
  padding: 8px 12px;
  border-radius: var(--rm-radius-sm);
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed rgba(99, 102, 241, 0.2);
  font-size: 13px;
  color: var(--rm-text-secondary);
}

/* ========== FILTER BAR ========== */
.rm-filter-bar,
.rm-report-filter {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.rm-filter-bar label,
.rm-report-filter label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--rm-text-muted);
}

.rm-filter-bar select,
.rm-filter-bar input,
.rm-report-filter select,
.rm-report-filter input {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--rm-text);
}

/* ========== DOC LIST ========== */
.rm-doc-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
  display: grid;
  gap: 6px;
}

.rm-doc-list li {
  padding: 8px 12px;
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========== INSURANCE FIELDS ========== */
.rm-insurance-fields {
  display: none;
  grid-column: 1 / -1;
  gap: 16px;
}

.rm-insurance-fields.active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ========== COMPARE ========== */
.rm-compare {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.rm-compare img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--rm-radius-sm);
  border: 1px solid var(--rm-border);
}

.rm-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* ========== LIGHTBOX ========== */
/* Old lightbox removed - using .rm-lightbox-overlay instead */

/* ========== PORTAL (Tenant View) ========== */
.rm-portal {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
}

.rm-portal-card {
  max-width: 720px;
  width: 100%;
  background: var(--rm-surface);
  border-radius: var(--rm-radius-lg);
  padding: 32px;
  border: 1px solid var(--rm-border);
  box-shadow: var(--rm-shadow-lg);
}

.rm-portal-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.rm-portal-header h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}

.rm-portal-header p {
  margin: 0 0 20px;
  color: var(--rm-text-muted);
}

/* ========== LOGIN PAGE ========== */
.rm-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: var(--rm-bg);
}

.rm-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-lg);
  padding: 32px;
  box-shadow: var(--rm-shadow-lg);
}

.rm-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.rm-login-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--rm-primary), var(--rm-primary-dark));
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
}

.rm-login-title {
  font-weight: 700;
  font-size: 18px;
}

.rm-login-sub {
  color: var(--rm-text-muted);
  font-size: 12px;
}

.rm-login-heading {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.rm-login-copy {
  margin: 0 0 18px;
  color: var(--rm-text-secondary);
  font-size: 14px;
}

#rm-login-form p {
  margin: 0 0 12px;
}

#rm-login-form label {
  display: block;
  font-size: 13px;
  color: var(--rm-text-secondary);
  margin-bottom: 6px;
}

#rm-login-form input[type="text"],
#rm-login-form input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--rm-radius-sm);
  border: 1px solid var(--rm-border);
  background: var(--rm-surface-hover);
  color: var(--rm-text);
  direction: rtl;
}

#rm-login-form .login-remember label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--rm-text-secondary);
}

#rm-login-form .login-submit input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--rm-radius-sm);
  border: none;
  background: var(--rm-primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.rm-login-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.rm-login-actions .rm-btn {
  width: 100%;
}

.rm-login-footer {
  margin-top: 12px;
  font-size: 12px;
  color: var(--rm-text-muted);
  text-align: center;
}

/* ========== ANIMATIONS ========== */
@keyframes rm-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== PRINT ========== */
@media print {
  .rm-sidebar,
  .rm-topbar,
  .rm-toolbar,
  .rm-nav,
  .rm-btn,
  .rm-menu-toggle {
    display: none !important;
  }
  .rm-main {
    margin-right: 0 !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .rm-grid.stats,
  .rm-grid.quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rm-dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rm-dash-stats-main {
    grid-template-columns: repeat(3, 1fr);
  }
  .rm-dash-stats-secondary {
    grid-template-columns: repeat(2, 1fr);
  }
  .rm-pnl-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .rm-dash-finance-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .rm-sidebar {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
  }

  .rm-sidebar.open {
    transform: translateX(0);
    display: flex;
  }

  .rm-main {
    margin-right: 0;
  }

  .rm-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Overlay behind sidebar */
  .rm-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

  .rm-sidebar-overlay.active {
    display: block;
  }

  .rm-dash-stats-main {
    grid-template-columns: repeat(2, 1fr);
  }
  .rm-dash-stats-secondary {
    grid-template-columns: repeat(2, 1fr);
  }
  .rm-dash-stats-mini {
    grid-template-columns: repeat(2, 1fr);
  }
  .rm-dash-panels {
    grid-template-columns: 1fr;
  }

  /* Tables: horizontal scroll wrapper */
  .rm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  .rm-table {
    min-width: 600px;
  }

  /* Toolbar wraps nicely */
  .rm-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Filter bar stacks */
  .rm-filter-bar,
  .rm-report-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .rm-filter-bar label,
  .rm-report-filter label {
    width: 100%;
  }

  .rm-filter-bar select,
  .rm-filter-bar input,
  .rm-report-filter select,
  .rm-report-filter input {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .rm-content {
    padding: 12px;
  }

  .rm-page-header {
    padding: 12px 12px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .rm-page-header h1 {
    font-size: 18px;
  }

  .rm-page-header p {
    font-size: 12px;
  }

  .rm-topbar {
    padding: 8px 12px;
    min-height: 48px;
  }

  /* Hide text on topbar buttons, keep compact */
  .rm-topbar-meta {
    gap: 6px;
  }

  .rm-btn-cache {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .rm-btn-logout {
    padding: 6px 10px;
    font-size: 12px;
  }

  .rm-user-pill {
    padding: 6px 10px;
    font-size: 11px;
    gap: 5px;
  }

  .rm-grid.stats,
  .rm-grid.quick,
  .rm-grid.form {
    grid-template-columns: 1fr;
  }

  .rm-dashboard-kpis {
    grid-template-columns: 1fr;
  }

  .rm-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .rm-dash-stats-main,
  .rm-dash-stats-secondary {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .rm-dash-stats-mini {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .rm-pnl-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .rm-dash-finance-row {
    grid-template-columns: 1fr;
  }

  .rm-dash-quick-form {
    flex-direction: column;
    align-items: stretch;
  }

  #rm-toast-container {
    left: 8px;
    right: 8px;
    max-width: none;
  }

  .rm-stat-val {
    font-size: 20px;
  }

  .rm-pnl-item-val {
    font-size: 20px;
  }

  /* Cards tighter on mobile */
  .rm-card {
    padding: 14px;
    border-radius: 10px;
  }

  .rm-card > .rm-table {
    margin: 0 -15px -15px;
    width: calc(100% + 30px);
  }

  .rm-card > .rm-table:first-child {
    margin-top: -15px;
  }

  /* Dashboard panel cards */
  .rm-dash-panel-card {
    border-radius: 10px;
  }

  .rm-dash-panel-header {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .rm-dash-panel-header h3 {
    font-size: 13px;
  }

  .rm-dash-panel-body {
    padding: 6px;
  }

  .rm-dash-panel-emoji {
    font-size: 16px;
  }

  .rm-dash-row-item {
    padding: 10px 12px;
    gap: 8px;
  }

  .rm-dash-row-title {
    font-size: 13px;
  }

  .rm-dash-row-meta {
    font-size: 11px;
  }

  /* Collection rows on mobile */
  .rm-collection-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .rm-collection-amount {
    font-size: 14px;
  }

  /* Payment methods panel */
  .rm-pnl-card {
    padding: 14px;
    border-radius: 10px;
  }

  .rm-payment-methods {
    gap: 8px;
  }

  .rm-pm-item {
    padding: 10px;
  }

  /* Table action buttons stack on mobile */
  .rm-tbl-actions {
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
  }

  .rm-tbl-btn {
    justify-content: center;
    padding: 6px 10px;
    font-size: 11.5px;
  }

  /* Table cells tighter */
  .rm-table th,
  .rm-table td {
    padding: 11px 14px;
    font-size: 13px;
  }

  .rm-table th {
    font-size: 11.5px;
    padding: 10px 14px;
  }

  /* Pill badges smaller */
  .rm-pill {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* Buttons smaller */
  .rm-btn {
    padding: 8px 14px;
    font-size: 12.5px;
  }

  .rm-btn.mini {
    padding: 5px 10px;
    font-size: 11px;
  }

  /* Dashboard panel actions wrap */
  .rm-dash-panel-actions {
    gap: 4px;
  }

  /* Mini cards on dashboard */
  .rm-mini-card {
    padding: 10px 8px;
  }

  .rm-mini-emoji {
    font-size: 18px;
  }

  .rm-mini-val {
    font-size: 18px;
  }

  .rm-mini-lbl {
    font-size: 10px;
  }

  /* Action buttons */
  .rm-action-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
  }

  .rm-inline-actions {
    gap: 6px;
  }

  /* Form labels */
  .rm-grid.form label {
    font-size: 12.5px;
  }

  /* Insurance / option fields */
  .rm-insurance-fields.active,
  .rm-option-fields.active {
    grid-template-columns: 1fr;
  }

  /* Compare grid */
  .rm-compare {
    grid-template-columns: repeat(2, 1fr);
  }

  .rm-compare-grid {
    grid-template-columns: 1fr;
  }

  /* Lightbox */
  .rm-lightbox-overlay img {
    max-width: 95vw;
    max-height: 80vh;
    border-radius: 8px;
  }

  .rm-lightbox-close {
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  /* Stat cards */
  .rm-stat-card {
    padding: 14px 10px;
  }

  /* Tabs */
  .rm-tabs {
    gap: 0;
    flex-wrap: wrap;
  }

  .rm-tab {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* Collapse toggle */
  .rm-collapse-toggle {
    width: 26px;
    height: 26px;
  }

  .rm-collapse-toggle svg {
    width: 14px;
    height: 14px;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .rm-content {
    padding: 8px;
  }

  .rm-page-header {
    padding: 8px 8px 0;
  }

  .rm-topbar {
    padding: 6px 8px;
  }

  .rm-card {
    padding: 10px;
    border-radius: 8px;
  }

  .rm-card > .rm-table {
    margin: 0 -11px -11px;
    width: calc(100% + 22px);
  }

  .rm-card > .rm-table:first-child {
    margin-top: -11px;
  }

  .rm-dash-stats-main,
  .rm-dash-stats-secondary {
    grid-template-columns: 1fr;
  }

  .rm-dash-stats-mini {
    grid-template-columns: repeat(2, 1fr);
  }

  .rm-page-header h1 {
    font-size: 16px;
  }

  .rm-user-pill {
    display: none;
  }

  .rm-btn-cache span {
    display: none;
  }
}

/* ========== TABLE ACTION BUTTONS ========== */
.rm-tbl-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.rm-tbl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 6px;
  border: none;
  background: #f1f5f9;
  color: var(--rm-text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.rm-tbl-btn:hover {
  background: #e2e8f0;
  color: var(--rm-text);
  text-decoration: none !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.rm-tbl-btn-primary {
  background: rgba(99, 102, 241, 0.1);
  color: var(--rm-primary);
}

.rm-tbl-btn-primary:hover {
  background: rgba(99, 102, 241, 0.18);
  color: var(--rm-primary-dark);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.rm-tbl-btn-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.rm-tbl-btn-success:hover {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.rm-tbl-btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: var(--rm-danger);
  padding: 5px 9px;
  font-size: 11px;
}

.rm-tbl-btn-danger:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
}

/* ========== TABLE EMPTY STATE ========== */
.rm-table-empty {
  text-align: center;
  padding: 56px 20px !important;
  color: var(--rm-text-muted);
  font-size: 14px;
  background: #fafbfd !important;
  border-bottom: none !important;
  line-height: 1.8;
}

.rm-table-empty a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 8px;
  background: var(--rm-primary);
  transition: all 0.2s ease;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.rm-table-empty a:hover {
  background: var(--rm-primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* ========== TABS (Todos Page) ========== */
.rm-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius);
  margin-bottom: 16px;
}

.rm-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--rm-radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--rm-text-secondary);
  text-decoration: none !important;
  transition: all 0.2s ease;
  cursor: pointer;
  flex: 1;
  justify-content: center;
}

.rm-tab:hover {
  background: var(--rm-bg);
  color: var(--rm-text);
  text-decoration: none !important;
}

.rm-tab.active {
  background: var(--rm-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.rm-tab.active:hover {
  background: var(--rm-primary-dark);
  color: #ffffff;
}

.rm-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.rm-tab.active .rm-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* ========== COLLECTION TARGETS ========== */
.rm-collection-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rm-collection-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--rm-radius-sm);
  transition: background 0.15s ease;
}

.rm-collection-row:hover {
  background: var(--rm-surface-hover);
}

.rm-collection-row.late {
  background: rgba(239, 68, 68, 0.04);
  border-right: 3px solid var(--rm-danger);
}

.rm-collection-tenant {
  flex: 1;
  min-width: 0;
}

.rm-collection-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--rm-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-collection-meta {
  font-size: 11.5px;
  color: var(--rm-text-muted);
  margin-top: 2px;
}

.rm-collection-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--rm-text);
  white-space: nowrap;
}

.rm-collection-status {
  min-width: 70px;
  text-align: center;
}

.rm-late-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--rm-danger-bg);
  color: var(--rm-danger);
}

.rm-ok-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--rm-success-bg);
  color: var(--rm-success);
}

/* ========== DASHBOARD TODO COMPLETE BUTTON ========== */
.rm-dash-todo-done {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: 2px solid var(--rm-border);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  color: transparent;
  font-size: 14px;
  padding: 0;
}

.rm-dash-todo-done:hover {
  border-color: var(--rm-success);
  background: var(--rm-success-bg);
  color: var(--rm-success);
}

.rm-dash-todo-done.done {
  border-color: var(--rm-success);
  background: var(--rm-success);
  color: #ffffff;
}

/* ========== TOOLBAR ========== */
.rm-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ========== OPTION FIELDS (Lease Form) ========== */
.rm-option-fields {
  display: none;
  grid-column: 1 / -1;
  gap: 16px;
}

.rm-option-fields.active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rm-option-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--rm-text-secondary);
  text-align: right;
}

.rm-option-fields label.inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.rm-option-fields input,
.rm-option-fields select {
  background: var(--rm-bg);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-sm);
  padding: 10px 14px;
  color: var(--rm-text);
  font-family: inherit;
  font-size: 13.5px;
  width: 100%;
  direction: rtl;
  transition: all var(--rm-transition);
}

.rm-option-fields input:focus {
  outline: none;
  background: var(--rm-surface);
  border-color: var(--rm-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* (Responsive additions merged into main responsive blocks above) */
