﻿@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

.dashboard-shell {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #f8fafc;
  color: #0f172a;
  min-height: calc(100vh - 110px);
  padding: 36px 24px 40px;
}

.dashboard-inner {
  max-width: 1600px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card,
.panel-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 28px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.stat-circle {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-label {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.stat-value {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.stat-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.dashboard-shell .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 24px;
}

.dashboard-shell .panel-actions-row {
  padding: 0 24px 24px;
}

.dashboard-shell .panel-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.dashboard-shell .panel-subtitle {
  margin: 8px 0 0;
  color: #3b82f6;
  font-weight: 700;
}

.dashboard-shell .panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-shell .search-block {
  position: relative;
  width: min(320px, 100%);
}

.dashboard-shell .search-block svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #94a3b8;
}

.dashboard-shell .icon-inline {
  display: block;
}

.dashboard-shell .dashboard-input,
.dashboard-shell .dashboard-select {
  appearance: none;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #0f172a;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  box-sizing: border-box;
}

.dashboard-shell .dashboard-input {
  padding-left: 44px;
}

.dashboard-input {
  width: 100%;
  padding-left: 44px;
  min-width: 0;
}

.dashboard-select {
  width: auto;
  min-width: 180px;
  max-width: 240px;
}

.dashboard-input:focus,
.dashboard-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.dashboard-input + svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.sort-dropdown-wrapper {
  position: relative;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
}

.sort-btn:hover {
  background: #f1f5f9;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.sort-popup {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  padding: 8px;
  z-index: 100;
}

.sort-popup.open {
  display: block;
}

.sort-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #334155;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sort-option:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sort-option.selected {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.dashboard-shell .table-card {
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  margin: 0 24px 24px;
}

.dashboard-shell .table-head {
  display: grid;
  grid-template-columns: 3.5fr repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  font-weight: 700;
}

.table-heading {
  font-size: 0.95rem;
}

.table-center {
  justify-self: center;
}

.table-body {
  display: grid;
  gap: 1px;
  background: #e2e8f0;
}

.listing-row {
  display: grid;
  grid-template-columns: 3.5fr 1fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  background: #ffffff;
  transition: background 0.2s ease;
}

.listing-row:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.listing-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.listing-image {
  width: 110px;
  height: 70px;
  border-radius: 18px;
  overflow: hidden;
  background: #cbd5e1;
}

.listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-info h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #0f172a;
}

.listing-info p {
  margin: 0;
  font-size: 0.92rem;
  color: #64748b;
}

.price-text {
  margin-top: 6px;
  color: #3b82f6;
  font-weight: 700;
}

.listing-status,
.listing-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge.pending {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

.table-action {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #ffffff;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.table-action:hover {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.table-action.success {
  color: #16a34a;
}

.table-action.danger {
  color: #dc2626;
}

.pagination-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 24px 24px;
}

.pagination-info {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

.pagination-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
}

.page-button.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: transparent;
}

.messages-panel {
  position: sticky;
  top: 26px;
  padding: 24px;
}

.messages-header {
  padding: 24px 24px 0;
}

.message-list {
  display: grid;
  gap: 18px;
  padding: 0 24px 24px;
}

.message-bubble {
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 4px solid #3b82f6;
}

.message-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.message-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.message-time {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 0.82rem;
}

.message-text {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.7;
}

.view-all-button {
  width: 100%;
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.arrow {
  font-size: 1rem;
}

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

@media (max-width: 860px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-header,
  .panel-actions,
  .pagination-row {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-header {
    padding: 20px;
  }

  .table-card,
  .message-list,
  .messages-panel {
    margin: 0;
  }
}

@media (max-width: 640px) {
  .dashboard-shell {
    padding: 20px 16px 28px;
  }

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

  .panel-actions {
    gap: 10px;
  }

  .icon-button,
  .dashboard-input,
  .dashboard-select,
  .page-button {
    width: 100%;
  }

  .listing-row {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .listing-status,
  .listing-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════
   Dashboard Property Cards  (db-prop-* prefix)
══════════════════════════════════════════════ */
.db-listings-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 24px 24px;
}

.db-prop-card {
  background: rgba(255,255,255,0.95);
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15,23,42,0.07);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.db-prop-card:hover {
  box-shadow: 0 10px 36px rgba(15,23,42,0.13);
  transform: translateY(-2px);
}

.db-prop-layout {
  display: flex;
  gap: 0;
}

/* Image column */
.db-prop-img-col {
  flex-shrink: 0;
  width: 260px;
}

.db-prop-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 190px;
}

.db-prop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.db-prop-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 190px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #94a3b8;
}

.db-badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.04em;
}

.db-status-pill {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.db-status-pill.active { background: linear-gradient(135deg, #22c55e, #16a34a); }
.db-status-pill.sold   { background: linear-gradient(135deg, #64748b, #334155); }
.db-status-pill.pending { background: linear-gradient(135deg, #f59e0b, #ea580c); }

/* Details column */
.db-prop-details {
  flex: 1;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.db-prop-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.db-prop-title-block { flex: 1; min-width: 0; }

.db-prop-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.db-prop-title a {
  color: inherit;
  text-decoration: none;
}

.db-prop-title a:hover { color: #3b82f6; }

.db-prop-location {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
}

.db-prop-location i { color: #94a3b8; font-size: 0.75rem; }

.db-prop-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: #3b82f6;
  white-space: nowrap;
}

.db-prop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.db-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  border-radius: 99px;
}

.db-meta-item i { color: #94a3b8; font-size: 0.75rem; }

.db-prop-desc {
  margin: 0;
  font-size: 0.83rem;
  color: #64748b;
  line-height: 1.6;
}

.db-prop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.db-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 10px;
  border-radius: 99px;
}

/* Action buttons */
.db-prop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.db-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: #334155;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  font-family: inherit;
}

.db-action-btn:hover {
  box-shadow: 0 4px 14px rgba(15,23,42,0.1);
  transform: translateY(-1px);
}

.db-btn-view  { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.db-btn-view:hover  { background: #dbeafe; }

.db-btn-edit  { border-color: #e2e8f0; color: #475569; }
.db-btn-edit:hover  { background: #f8fafc; color: #0f172a; }

.db-btn-sold  { border-color: #bbf7d0; color: #16a34a; background: #f0fdf4; }
.db-btn-sold:hover  { background: #dcfce7; }

.db-btn-relist { border-color: #fed7aa; color: #c2410c; background: #fff7ed; }
.db-btn-relist:hover { background: #ffedd5; }

.db-btn-delete { border-color: #fecaca; color: #dc2626; background: #fff5f5; }
.db-btn-delete:hover { background: #fee2e2; }

.db-btn-delete:disabled,
.db-btn-sold:disabled,
.db-btn-relist:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Empty state */
.db-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.db-empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.db-empty-state p {
  margin: 0 0 20px;
  font-size: 1rem;
  color: #64748b;
}

/* Responsive */
@media (max-width: 700px) {
  .db-prop-layout { flex-direction: column; }
  .db-prop-img-col { width: 100%; }
  .db-prop-img-wrap,
  .db-prop-img-placeholder { min-height: 200px; }
  .db-prop-img { max-height: 220px; }
  .db-listings-wrap { padding: 0 16px 20px; }
}

/* Agent info in property cards */
.db-prop-agent {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.db-agent-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.db-agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #475569;
}

.db-agent-details {
  flex: 1;
  min-width: 0;
}

.db-agent-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.db-agent-location,
.db-agent-rating {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 1px;
}

.db-agent-location i,
.db-agent-rating i {
  color: #94a3b8;
  margin-right: 4px;
}

.db-agent-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.db-status-pill.favorite {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

@media (max-width: 500px) {
  .db-prop-details { padding: 16px; }
  .db-action-btn { padding: 7px 12px; font-size: 0.78rem; }
}
