/* =============================================================================
   CRIBFLOW COMPONENTS
   ============================================================================= */

/* =============================================================================
   PREMIUM LOADER (T3) — shared triple loading experience (site/auth/dashboard)
   Injected by js/loader.js. Logo-agnostic (inline SVG mark, no image dep).
   ============================================================================= */
#cf-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-hero);
  overflow: hidden;
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
#cf-loader::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#cf-loader.is-hidden { opacity: 0; transform: scale(1.04); pointer-events: none; }

.cf-loader-inner { position: relative; text-align: center; animation: reveal-up 640ms var(--ease-out) both; }

.cf-loader-mark { position: relative; width: 88px; height: 88px; margin: 0 auto var(--space-6); }
.cf-loader-mark::before {
  content: ""; position: absolute; inset: -34%; border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(232,183,112,0.34) 0%, transparent 68%);
  animation: pulse 2.6s var(--ease-in-out) infinite;
}
.cf-loader-mark svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.cf-loader-mark .cf-draw {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: cf-draw 1.5s var(--ease-in-out) forwards;
}
@keyframes cf-draw { to { stroke-dashoffset: 0; } }

.cf-loader-word {
  font-family: var(--font-sans); font-size: 32px; letter-spacing: -0.5px; color: #fff; line-height: 1;
}
.cf-loader-word .w-crib { font-weight: 300; opacity: 0.9; }
.cf-loader-word .w-flow { font-weight: 800; }

.cf-loader-tag {
  margin-top: var(--space-3); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 500; color: rgba(255,255,255,0.42);
}

.cf-loader-bar {
  width: 168px; height: 3px; margin: var(--space-7) auto 0;
  border-radius: var(--radius-full); background: rgba(255,255,255,0.12); overflow: hidden;
}
.cf-loader-fill {
  height: 100%; width: 42%; border-radius: var(--radius-full);
  background: var(--gradient-gold);
  animation: cf-loader-slide 1.25s var(--ease-in-out) infinite;
}
@keyframes cf-loader-slide {
  0% { transform: translateX(-130%); } 100% { transform: translateX(370%); }
}

/* =============================================================================
   DASHBOARD CHART GRID
   ============================================================================= */
.dash-charts-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  align-items: start;
}
.dash-chart-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dash-chart-main .card-body canvas {
  display: block;
  width: 100% !important;
}
@media (max-width: 900px) {
  .dash-charts-grid { grid-template-columns: 1fr; }
}

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px 16px;
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: all var(--duration-base) var(--ease);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1A6B53 0%, #0F4C3A 100%);
  color: var(--color-text-on-primary);
  box-shadow: 0 1px 2px rgba(10, 53, 40, 0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
/* premium shine sweep on hover */
.btn-primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform var(--duration-slower) var(--ease-out);
}
.btn-primary:hover:not(:disabled)::after { transform: translateX(120%); }
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1F7D60 0%, #0A3528 100%);
  box-shadow: 0 4px 16px rgba(10, 53, 40, 0.3), 0 2px 4px rgba(10, 53, 40, 0.15);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(10, 53, 40, 0.2);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-2);
  border-color: var(--color-text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #991B1B; }

.btn-accent {
  background: var(--color-accent);
  color: white;
}
.btn-accent:hover:not(:disabled) { background: var(--color-accent-dark); }

.btn-sm {
  padding: 6px 12px;
  font-size: var(--text-sm);
}

.btn-lg {
  padding: 12px 22px;
  font-size: var(--text-md);
}

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 6px; }

.btn .icon { width: 16px; height: 16px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg .icon { width: 18px; height: 18px; }

/* =============================================================================
   CARDS
   ============================================================================= */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.card-elevated {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.card-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text);
}

.card-body { padding: var(--space-6); }
.card-body-tight { padding: var(--space-4); }

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

/* =============================================================================
   LIQUID-GLASS DASHBOARD — apartment backdrop + frosted surfaces (scoped .app-bg)
   ============================================================================= */
.app-bg .main {
  background:
    linear-gradient(rgba(250,250,246,0.90), rgba(250,250,246,0.94)),
    url('/images/site/interior-living.jpg') center / cover fixed;
}
[data-theme="dark"] .app-bg .main {
  background:
    linear-gradient(rgba(14,15,13,0.90), rgba(14,15,13,0.95)),
    url('/images/site/tower-night.jpg') center / cover fixed;
}
/* Frost the cards & stat tiles so the backdrop shows through */
.app-bg .card-elevated,
.app-bg .stat-card {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.app-bg .card-header,
.app-bg .card-footer { background: transparent; }
/* keep the M-Pesa unmatched alert + chart tiles legible over glass */
.app-bg .stat-card::before { opacity: 0.6; }

@media (max-width: 768px) {
  /* fixed backgrounds are janky on mobile — let it scroll */
  .app-bg .main { background-attachment: scroll; }
}

/* =============================================================================
   STAT CARD
   ============================================================================= */
.stat-card {
  background: linear-gradient(155deg, var(--color-surface) 0%, var(--color-surface-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-base) var(--ease);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}
.stat-card:hover {
  border-color: rgba(15, 76, 58, 0.18);
  box-shadow: 0 8px 28px rgba(15, 76, 58, 0.1), 0 2px 8px rgba(15, 76, 58, 0.06);
  transform: translateY(-2px);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stat-card-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
}

.stat-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--color-primary-100) 0%, var(--color-primary-50) 100%);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon svg { width: 17px; height: 17px; }

.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  line-height: 1.1;
  margin-bottom: var(--space-2);
}

.stat-card-meta {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.trend-up { background: var(--color-success-bg); color: var(--color-success); }
.trend-down { background: var(--color-danger-bg); color: var(--color-danger); }

/* =============================================================================
   FORMS
   ============================================================================= */
.form-group { margin-bottom: var(--space-5); }

.label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.label-required::after {
  content: ' *';
  color: var(--color-danger);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: var(--text-base);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  transition: all var(--duration-fast) var(--ease);
}

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

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--color-text-muted);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

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

.select {
  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='%23525049' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%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: 36px;
}

.input-help {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  line-height: 1.5;
}

.input-error-msg {
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
}

.input-error,
.select-error,
.textarea-error {
  border-color: var(--color-danger);
}

.input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-prefix {
  position: absolute;
  left: 14px;
  font-size: var(--text-base);
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 1;
}
.input-prefix-wrap .input { padding-left: 38px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* =============================================================================
   BADGES
   ============================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-info    { background: var(--color-info-bg); color: var(--color-info); }
.badge-primary { background: var(--color-primary-50); color: var(--color-primary); }

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* =============================================================================
   TABLES
   ============================================================================= */
.table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

@media (max-width: 768px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 600px; }
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}

.table thead {
  background: var(--color-surface-2);
}

.table th {
  padding: 10px 16px;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--duration-fast) var(--ease); }
.table tbody tr:hover { background: var(--color-surface-2); }

.table-clickable tbody tr { cursor: pointer; }
.table-clickable tbody tr:hover {
  background: var(--color-primary-50);
  box-shadow: inset 3px 0 0 var(--color-primary-light);
}

/* =============================================================================
   MODALS
   ============================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 24, 18, 0.5);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fade-in var(--duration-base) var(--ease);
}
.modal-backdrop.is-closing { animation: fade-out 180ms var(--ease) both; }
.modal-backdrop.is-closing .modal { animation: modal-out 180ms var(--ease-in-out) both; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }

.modal {
  background: var(--color-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in 420ms var(--ease-spring) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Centered branded confirm dialog */
.confirm-dialog { text-align: center; padding: var(--space-2) var(--space-1) var(--space-1); }
.confirm-icon {
  width: 58px; height: 58px; border-radius: var(--radius-full);
  margin: 0 auto var(--space-4);
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-50); color: var(--color-primary);
  animation: scale-in var(--duration-slow) var(--ease-spring) both;
}
.confirm-icon.is-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.confirm-icon svg { width: 26px; height: 26px; }
.confirm-title { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-2); letter-spacing: -0.01em; }
.confirm-message { color: var(--color-text-secondary); line-height: 1.6; font-size: var(--text-md); }

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 920px; }

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

.modal-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--duration-fast) var(--ease);
}
.modal-close:hover { background: var(--color-surface-2); color: var(--color-text); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* =============================================================================
   EMPTY STATE
   ============================================================================= */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  max-width: 420px;
  margin: 0 auto;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}
.empty-state-icon svg { width: 24px; height: 24px; }

.empty-state h3 {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.empty-state p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-5);
  line-height: 1.6;
}

/* =============================================================================
   LOADING SPINNER
   ============================================================================= */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-sm { width: 14px; height: 14px; border-width: 1.5px; }
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */
.toast-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

@media (max-width: 768px) {
  .toast-container {
    top: auto;
    bottom: 72px;
    left: var(--space-4);
    right: var(--space-4);
  }
  .toast { max-width: 100%; min-width: 0; }
}

.toast {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  box-shadow: var(--shadow-2xl);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  animation: toast-in 460ms var(--ease-spring) both;
}
.toast.is-leaving { animation: toast-out 240ms var(--ease-in-out) both; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(44px) scale(0.94); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(44px) scale(0.94); }
}

/* Icon in a tinted circle, colored by type */
.toast-icon {
  flex-shrink: 0;
  width: 36px; height: 36px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-50); color: var(--color-primary);
}
.toast-icon svg { width: 18px; height: 18px; }
.toast-success .toast-icon { background: var(--color-success-bg); color: var(--color-success); }
.toast-error   .toast-icon { background: var(--color-danger-bg);  color: var(--color-danger); }
.toast-warning .toast-icon { background: var(--color-warning-bg); color: var(--color-warning); }
.toast-info    .toast-icon { background: var(--color-primary-50); color: var(--color-primary); }

/* Auto-dismiss progress bar */
.toast-progress {
  position: absolute; left: 0; bottom: 0; height: 2.5px; width: 100%;
  transform-origin: left center;
  background: var(--color-primary); opacity: 0.55; border-radius: 0 2px 2px 0;
  animation: toast-progress linear forwards;
}
.toast-success .toast-progress { background: var(--color-success); }
.toast-error   .toast-progress { background: var(--color-danger); }
.toast-warning .toast-progress { background: var(--color-warning); }
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.toast-body { flex: 1; min-width: 0; padding-top: 1px; }
.toast-title {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--color-text);
}
.toast-message {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.toast-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.toast-close:hover { background: var(--color-surface-2); color: var(--color-text); }
.toast-close svg { width: 14px; height: 14px; }

/* =============================================================================
   ROOM GRID (property detail)
   ============================================================================= */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}

.room-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease);
  position: relative;
  overflow: hidden;
}

.room-tile::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-text-muted);
  transition: background var(--duration-base) var(--ease);
}

.room-tile:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.room-tile.status-paid::before { background: var(--color-success); }
.room-tile.status-partial::before { background: var(--color-warning); }
.room-tile.status-unpaid::before { background: var(--color-danger); }
.room-tile.status-vacant::before { background: var(--color-text-muted); }

.room-tile-name {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-1);
  color: var(--color-text);
}

.room-tile-tenant {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-tile-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.room-tile-amount {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* =============================================================================
   PROPERTY CARD
   ============================================================================= */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.property-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease);
  display: flex;
  flex-direction: column;
}

.property-card:hover {
  border-color: rgba(15, 76, 58, 0.15);
  box-shadow: 0 12px 36px rgba(15, 76, 58, 0.13), 0 4px 12px rgba(15, 76, 58, 0.07);
  transform: translateY(-3px);
}

.property-card-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  padding: var(--space-5);
  color: white;
  position: relative;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.property-card-header::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(200, 146, 74, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.property-card-name {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.property-card-address {
  font-size: var(--text-sm);
  opacity: 0.85;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

.property-card-body {
  padding: var(--space-5);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.property-card-stat {
  text-align: center;
}

.property-card-stat-value {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.property-card-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
  font-weight: 500;
}

/* =============================================================================
   AVATAR
   ============================================================================= */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.avatar-sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--text-md); }

/* =============================================================================
   TABS
   ============================================================================= */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-6);
}

.tab {
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--duration-fast) var(--ease);
  cursor: pointer;
}

.tab:hover {
  color: var(--color-text);
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* =============================================================================
   FILTER BAR
   ============================================================================= */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-5);
  align-items: center;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap .input {
  padding-left: 38px;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.filter-pills {
  display: flex;
  gap: var(--space-1);
}

.filter-pill {
  padding: 6px 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  transition: all var(--duration-fast) var(--ease);
  cursor: pointer;
}

.filter-pill:hover {
  background: var(--color-surface-3);
  color: var(--color-text);
}

.filter-pill.active {
  background: var(--color-primary);
  color: white;
}

/* =============================================================================
   TWO COLUMN GRID
   ============================================================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* =============================================================================
   STATUS LEGEND
   ============================================================================= */
.legend {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* =============================================================================
   DETAIL PAIR (label + value)
   ============================================================================= */
.detail-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.detail-value {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
