/* ============================================================
   RentFlow — Premium Dark-Theme Design System
   ============================================================ */

/* ----------------------------------------------------------
   1. Design Tokens (Custom Properties)
   ---------------------------------------------------------- */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-card-hover: rgba(17, 24, 39, 0.95);
  --bg-sidebar: #0d1321;
  --bg-input: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #e8eaed;
  --text-secondary: #8b95a5;
  --text-muted: #5a6577;
  --accent-primary: #00d4aa;
  --accent-primary-glow: rgba(0, 212, 170, 0.15);
  --accent-secondary: #6c63ff;
  --accent-secondary-glow: rgba(108, 99, 255, 0.15);
  --color-success: #00d4aa;
  --color-warning: #ffb84d;
  --color-danger: #ff6b6b;
  --color-info: #4da6ff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: all 0.2s ease;
  --sidebar-width: 260px;
}

/* ----------------------------------------------------------
   2. Reset & Base
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(108, 99, 255, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 212, 170, 0.05) 0px, transparent 50%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* ----------------------------------------------------------
   3. App Layout
   ---------------------------------------------------------- */
.app {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------------------------------------------------
   4. Sidebar
   ---------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo svg {
  color: var(--accent-primary);
  filter: drop-shadow(0 0 8px var(--accent-primary-glow));
  flex-shrink: 0;
}

.logo h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: var(--accent-primary);
  border-radius: 0 4px 4px 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-link:hover svg {
  color: var(--accent-primary);
}

.nav-link.active {
  background: var(--accent-primary-glow);
  color: var(--accent-primary);
}

.nav-link.active svg {
  color: var(--accent-primary);
  filter: drop-shadow(0 0 6px var(--accent-primary-glow));
}

.nav-link.active::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-link svg {
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ----------------------------------------------------------
   5. Top Bar
   ---------------------------------------------------------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10, 14, 23, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#page-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.sidebar-toggle {
  display: none;
}

/* ----------------------------------------------------------
   6. Buttons
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn:hover::after {
  opacity: 1;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #00b894);
  color: #0a0e17;
  box-shadow: 0 2px 12px rgba(0, 212, 170, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-color-hover);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), #ee5a5a);
  color: #fff;
  box-shadow: 0 2px 12px rgba(255, 107, 107, 0.25);
}

.btn-danger:hover {
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* ----------------------------------------------------------
   7. View Container
   ---------------------------------------------------------- */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.view-animate {
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ----------------------------------------------------------
   8. Cards
   ---------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: height 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-color-hover);
}

/* Stat card color variants */
.stat-card.stat-teal::before {
  background: linear-gradient(90deg, var(--accent-primary), #00e6b8);
}
.stat-card.stat-teal .stat-icon {
  background: var(--accent-primary-glow);
  color: var(--accent-primary);
}

.stat-card.stat-purple::before {
  background: linear-gradient(90deg, var(--accent-secondary), #8b83ff);
}
.stat-card.stat-purple .stat-icon {
  background: var(--accent-secondary-glow);
  color: var(--accent-secondary);
}

.stat-card.stat-warning::before {
  background: linear-gradient(90deg, var(--color-warning), #ffc966);
}
.stat-card.stat-warning .stat-icon {
  background: rgba(255, 184, 77, 0.15);
  color: var(--color-warning);
}

.stat-card.stat-info::before {
  background: linear-gradient(90deg, var(--color-info), #66b8ff);
}
.stat-card.stat-info .stat-icon {
  background: rgba(77, 166, 255, 0.15);
  color: var(--color-info);
}

/* nth-child fallback for stat cards without explicit classes */
.stats-grid .stat-card:nth-child(1):not([class*="stat-"]) { }
.stats-grid .stat-card:nth-child(1):not([class*="stat-"])::before {
  background: linear-gradient(90deg, var(--accent-primary), #00e6b8);
}
.stats-grid .stat-card:nth-child(1):not([class*="stat-"]) .stat-icon {
  background: var(--accent-primary-glow);
  color: var(--accent-primary);
}

.stats-grid .stat-card:nth-child(2):not([class*="stat-"])::before {
  background: linear-gradient(90deg, var(--accent-secondary), #8b83ff);
}
.stats-grid .stat-card:nth-child(2):not([class*="stat-"]) .stat-icon {
  background: var(--accent-secondary-glow);
  color: var(--accent-secondary);
}

.stats-grid .stat-card:nth-child(3):not([class*="stat-"])::before {
  background: linear-gradient(90deg, var(--color-warning), #ffc966);
}
.stats-grid .stat-card:nth-child(3):not([class*="stat-"]) .stat-icon {
  background: rgba(255, 184, 77, 0.15);
  color: var(--color-warning);
}

.stats-grid .stat-card:nth-child(4):not([class*="stat-"])::before {
  background: linear-gradient(90deg, var(--color-info), #66b8ff);
}
.stats-grid .stat-card:nth-child(4):not([class*="stat-"]) .stat-icon {
  background: rgba(77, 166, 255, 0.15);
  color: var(--color-info);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: var(--transition);
}

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

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 20px;
}

.stat-trend.up {
  color: var(--color-success);
  background: rgba(0, 212, 170, 0.1);
}

.stat-trend.down {
  color: var(--color-danger);
  background: rgba(255, 107, 107, 0.1);
}

/* ----------------------------------------------------------
   9. Stats Grid
   ---------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

/* ----------------------------------------------------------
   10. Tables
   ---------------------------------------------------------- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.data-table thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.data-table tbody td {
  padding: 14px 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

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

.data-table .actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ----------------------------------------------------------
   11. Badges
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-success {
  background: rgba(0, 212, 170, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(0, 212, 170, 0.2);
}

.badge-warning {
  background: rgba(255, 184, 77, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(255, 184, 77, 0.2);
}

.badge-danger {
  background: rgba(255, 107, 107, 0.12);
  color: var(--color-danger);
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.badge-info {
  background: rgba(77, 166, 255, 0.12);
  color: var(--color-info);
  border: 1px solid rgba(77, 166, 255, 0.2);
}

/* ----------------------------------------------------------
   12. Forms
   ---------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.25s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
  background: rgba(255, 255, 255, 0.07);
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95a5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-group select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

/* ----------------------------------------------------------
   13. Modal
   ---------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 540px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* ----------------------------------------------------------
   14. Toast
   ---------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
}

.toast-success {
  border-left: 3px solid var(--color-success);
}

.toast-error {
  border-left: 3px solid var(--color-danger);
}

.toast-info {
  border-left: 3px solid var(--color-info);
}

.toast-warning {
  border-left: 3px solid var(--color-warning);
}

/* ----------------------------------------------------------
   15. Donut Chart
   ---------------------------------------------------------- */
.donut-chart-container {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.donut-chart {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* conic-gradient is set inline via JS */
}

.donut-hole {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.donut-hole .donut-total {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.donut-hole .donut-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.chart-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-legend-value {
  margin-left: auto;
  font-weight: 600;
  color: var(--text-primary);
}

/* ----------------------------------------------------------
   16. Filter Bar
   ---------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-bar .form-group {
  margin-bottom: 0;
}

.filter-bar input,
.filter-bar select {
  padding: 9px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: all 0.25s ease;
  min-width: 160px;
}

.filter-bar input::placeholder {
  color: var(--text-muted);
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.filter-bar select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95a5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ----------------------------------------------------------
   17. Property Grid
   ---------------------------------------------------------- */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.property-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.property-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.property-card:hover::before {
  opacity: 1;
}

.property-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.property-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.property-card-address {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.property-card-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.property-card-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.property-card-detail .label {
  color: var(--text-muted);
}

.property-card-detail .value {
  color: var(--text-primary);
  font-weight: 600;
}

.property-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* ----------------------------------------------------------
   18. Empty State
   ---------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 360px;
}

/* ----------------------------------------------------------
   19. Section Title
   ---------------------------------------------------------- */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ----------------------------------------------------------
   20. Divider
   ---------------------------------------------------------- */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-color);
  margin: 24px 0;
  border: none;
}

/* ----------------------------------------------------------
   21. Scrollbar
   ---------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(80px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ----------------------------------------------------------
   23. Utility Classes
   ---------------------------------------------------------- */

/* Text colors */
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger  { color: var(--color-danger) !important; }
.text-info    { color: var(--color-info) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-primary { color: var(--text-primary) !important; }

/* Spacing – margin */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.ml-1 { margin-left: 8px; }
.ml-2 { margin-left: 16px; }

.mr-1 { margin-right: 8px; }
.mr-2 { margin-right: 16px; }

/* Spacing – padding */
.pt-1 { padding-top: 8px; }
.pt-2 { padding-top: 16px; }
.pb-1 { padding-bottom: 8px; }
.pb-2 { padding-bottom: 16px; }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* Text utilities */
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

/* ----------------------------------------------------------
   24. Responsive
   ---------------------------------------------------------- */

/* Tablets & smaller desktops */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .view-container {
    padding: 24px;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex;
  }

  .top-bar {
    padding: 14px 20px;
  }

  .view-container {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .property-grid {
    grid-template-columns: 1fr;
  }

  .donut-chart-container {
    flex-direction: column;
    align-items: center;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .modal {
    width: 95%;
    max-height: 90vh;
  }

  .toast-container {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  #page-title {
    font-size: 1.1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .data-table thead th,
  .data-table tbody td {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.82rem;
  }
}

/* ----------------------------------------------------------
   Additional Component Styles
   ---------------------------------------------------------- */

/* Card Header & Body */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.card-body {
  padding: 20px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Property Card Details */
.property-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.property-info {
  flex: 1;
  min-width: 0;
}

.property-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.property-card-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border-color);
}

.property-rent,
.property-tenant {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.property-rent-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Overdue List */
.overdue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.overdue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.15);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.overdue-item:hover {
  background: rgba(255, 107, 107, 0.12);
}

.overdue-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overdue-name {
  font-weight: 600;
  color: var(--text-primary);
}

.overdue-amount {
  font-weight: 700;
  color: var(--color-danger);
  white-space: nowrap;
}

.overdue-actions-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-xs {
  padding: 5px 12px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

/* Empty State Inline (smaller, within cards) */
.empty-state-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
  text-align: center;
}

/* Loading / Spinner */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Table Responsive Wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Action Buttons Row */
.action-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Filter Bar Specifics */
.filter-actions-container {
  display: flex;
  gap: 8px;
}

/* Toast Icon */
.toast-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
}

/* Utility Overrides */
.text-nowrap {
  white-space: nowrap;
}

.text-sm {
  font-size: 0.825rem;
}

.mb-2 {
  margin-bottom: 16px;
}

@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

/* Sidebar mobile overlay backdrop */
@media (max-width: 768px) {
  .sidebar.open ~ .main-content::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 90;
    animation: fadeIn 0.2s ease;
  }
}

/* ----------------------------------------------------------
   20. Login Page & Logout Styling
   ---------------------------------------------------------- */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(108, 99, 255, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 212, 170, 0.05) 0px, transparent 50%);
}

.login-card {
  width: 90%;
  max-width: 400px;
  padding: 40px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}

.login-header svg {
  color: var(--accent-primary);
  filter: drop-shadow(0 0 8px var(--accent-primary-glow));
  margin-bottom: 12px;
}

.login-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.login-header p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

.btn-logout {
  border-color: rgba(255, 107, 107, 0.15) !important;
  color: var(--color-danger) !important;
  margin-top: 12px;
}

.btn-logout:hover {
  background: rgba(255, 107, 107, 0.08) !important;
  border-color: var(--color-danger) !important;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15) !important;
}

.hidden {
  display: none !important;
}

/* ----------------------------------------------------------
   Availability Filter Bar
   ---------------------------------------------------------- */
.avail-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.avail-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.avail-chip:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.avail-chip.active {
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(108, 99, 255, 0.15));
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.avail-chip.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.2);
}
/* ============================================================
   Premium Property Cards Styling
   ============================================================ */
.premium-property-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  padding-top: 36px; /* Space for the absolute badge */
  min-height: 400px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.premium-property-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.15);
}

.card-glow-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  z-index: 10;
}

.card-glow-indicator.badge-success { background: linear-gradient(90deg, var(--color-success), #00ffcc); }
.card-glow-indicator.badge-warning { background: linear-gradient(90deg, var(--color-warning), #ffcc00); }
.card-glow-indicator.badge-danger  { background: linear-gradient(90deg, var(--color-danger), #ff8888); }
.card-glow-indicator.badge-info    { background: linear-gradient(90deg, var(--color-info), #88ccff); }

.premium-card-header {
  margin-bottom: 12px;
  position: relative;
}

.premium-card-header .title-area {
}

.premium-card-header .property-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
}

.property-location-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(0, 212, 170, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 6px;
  border: 1px solid rgba(0, 212, 170, 0.15);
  white-space: nowrap;
}

.status-pill {
  position: absolute;
  top: 0px;
  right: 0px;
  z-index: 5;
  font-size: 0.65rem !important;
  padding: 4px 10px !important;
  border-radius: 99px !important;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  white-space: nowrap;
  max-width: 135px;
  text-overflow: ellipsis;
  overflow: hidden;
}

.premium-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-top: 8px;
}

.rent-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}

.rent-amount {
  font-size: 1.45rem;
  font-weight: 850;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.rent-period {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.tenant-section-divider {
  height: 1px;
  background: var(--border-color);
  margin: 12px 0;
}

.tenant-details-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-micro-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.tenant-info-block {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  height: 52px; /* Fix height for vertical consistency */
  box-sizing: border-box;
}

.tenant-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(108, 99, 255, 0.12);
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tenant-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.tenant-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tenant-info-block.vacant {
  border-style: dashed;
  background: transparent;
  justify-content: center;
  padding: 12px;
  border-color: rgba(255, 255, 255, 0.1);
  height: 52px; /* Identical to occupied height */
}

.vacant-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.premium-card-actions {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: auto;
}

.btn-outline-danger {
  border: 1.5px solid rgba(255, 107, 107, 0.25);
  color: var(--color-danger);
  background: transparent;
}

.btn-outline-danger:hover {
  background: rgba(255, 107, 107, 0.08);
  border-color: var(--color-danger);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}
