/* ============================================================
   tuzama — Landlord dashboard
   Loaded by pages/dashboard.html after listings.css and its
   inline <style>. Listings render as compact rows (a management
   view, not a gallery); KPIs and the inquiries panel match the
   rest of the site.
   ============================================================ */

.dashboard-page {
  --db-line: rgb(43 43 43 / 0.14);
}
.dashboard-page .site-header { background-color: var(--color-background); }

.dashboard-page .dashboard-main {
  max-width: 1200px;
  padding: clamp(2rem, 4.5vw, 3.5rem) 20px var(--space-20);
}


/* ─────────────────────────────────────────────────────────────
   Header
   ─────────────────────────────────────────────────────────────*/
.dashboard-page .dashboard-header { align-items: flex-end; margin-bottom: var(--space-8); }
.dashboard-page .dashboard-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: var(--font-weight-bold);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.dashboard-page .dashboard-subtitle {
  margin-top: var(--space-3);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
}
.dashboard-page .dashboard-header-actions .btn {
  height: 44px;
  padding: 0 20px;
  border-width: 1px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
}
.dashboard-page .dashboard-header-actions .btn-outline { border-color: var(--color-text); color: var(--color-text); }
.dashboard-page .dashboard-header-actions .btn-outline:hover { background-color: var(--color-text); color: #fff; }


/* ─────────────────────────────────────────────────────────────
   KPI tiles
   ─────────────────────────────────────────────────────────────*/
.dashboard-page .db-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}
.db-kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
}
.db-kpi-label {
  font-size: 13.5px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}
.db-kpi-value {
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.db-kpi-unit {
  font-size: 0.55em;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  color: var(--color-text-secondary);
  vertical-align: 0.2em;
}
.db-kpi-sub { font-size: 13px; line-height: 1.4; color: var(--color-text-muted); }


/* ─────────────────────────────────────────────────────────────
   Toolbar: status chips + search + sort
   ─────────────────────────────────────────────────────────────*/
.dashboard-page .dashboard-toolbar {
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.dashboard-page .dashboard-filter-tabs {
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: none;
  scrollbar-width: none;
}
.dashboard-page .dashboard-filter-tabs::-webkit-scrollbar { display: none; }
.dashboard-page .filter-tab {
  flex-shrink: 0;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--db-line);
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  box-shadow: none;
}
.dashboard-page .filter-tab:hover { border-color: var(--color-text); background-color: var(--color-surface); }
.dashboard-page .filter-tab.is-active {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
  color: #fff;
  box-shadow: none;
}
.dashboard-page .filter-tab-count {
  margin-left: 4px;
  padding: 0;
  background: none;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
}
.dashboard-page .filter-tab.is-active .filter-tab-count { background: none; color: rgb(255 255 255 / 0.7); }

.dashboard-page .dashboard-search-input {
  height: 38px;
  border: 1px solid var(--db-line);
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  font-size: var(--text-sm);
}
.dashboard-page .dashboard-search-input:focus { border-color: var(--color-text); box-shadow: 0 0 0 3px rgb(43 43 43 / 0.08); }
.dashboard-page .dashboard-toolbar-controls .cselect-trigger {
  height: 38px;
  border: 1px solid var(--db-line);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
}
.dashboard-page .dashboard-toolbar-controls .cselect-trigger:hover:not(:disabled),
.dashboard-page .dashboard-toolbar-controls .cselect.is-open .cselect-trigger { border-color: var(--color-text); box-shadow: none; }
.dashboard-page .dashboard-toolbar-controls .cselect-dropdown {
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgb(22 55 41 / 0.06), 0 18px 40px -12px rgb(22 55 41 / 0.28);
}
.dashboard-page .dashboard-toolbar-controls .cselect-option { border-radius: var(--radius-md); }


/* ─────────────────────────────────────────────────────────────
   Listing rows
   ─────────────────────────────────────────────────────────────*/
.dashboard-page .listings-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }

.dashboard-page .db-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 40px;
  grid-template-areas:
    "thumb body menu"
    "notice notice notice";
  align-items: center;
  column-gap: var(--space-5);
  padding: 12px 12px 12px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
  box-shadow: none;
  transition: border-color var(--transition-fast);
}
.dashboard-page .db-row:hover { border-color: var(--color-border-strong); box-shadow: none; }

.dashboard-page .db-row .listing-card-thumb {
  grid-area: thumb;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
}
.dashboard-page .db-row:hover .listing-card-thumb img,
.dashboard-page .db-row:hover .listing-card-thumb video { transform: none; }

.dashboard-page .db-row .listing-card-body {
  grid-area: body;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-width: 0;
  padding: 0;
}

.db-row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dashboard-page .db-row .listing-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 15.5px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  color: var(--color-text);
  text-decoration: none;
}
.dashboard-page .db-row .listing-card-title:hover { color: var(--color-primary); }
.dashboard-page .db-row .listing-card-location {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--color-text-secondary);
}
.db-row-dot { margin: 0 6px; color: var(--color-text-muted); }
.dashboard-page .db-row .listing-card-stats { gap: 6px 14px; margin: 2px 0 0; }
.dashboard-page .db-row .listing-card-stat { font-size: 13px; color: var(--color-text-muted); }
.dashboard-page .db-row .listing-card-stat svg { width: 14px; height: 14px; }

.db-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  text-align: right;
}
.dashboard-page .db-row .listing-card-price {
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dashboard-page .db-row .listing-card-price small {
  margin-left: 2px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
}
.dashboard-page .status-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  text-transform: none;
}
.db-row-quick {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Row menu: plain icon button, menu opens below it */
.dashboard-page .db-row .listing-card-dropdown {
  grid-area: menu;
  position: relative;
  top: auto;
  right: auto;
  justify-self: end;
}
.dashboard-page .db-row .btn-icon-overlay {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: var(--color-text-secondary);
}
.dashboard-page .db-row .btn-icon-overlay:hover,
.dashboard-page .db-row .btn-icon-overlay:focus-visible,
.dashboard-page .db-row .btn-icon-overlay.is-active {
  background-color: var(--color-surface-alt);
  border: 0;
  box-shadow: none;
  color: var(--color-text);
  transform: none;
}

.dashboard-page .db-row .listing-card-notice {
  grid-area: notice;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

/* "Show more" */
.db-more { display: flex; justify-content: center; padding-top: var(--space-6); }
.db-more-btn {
  height: 46px;
  padding: 0 22px;
  border: 1px solid var(--color-text);
  border-radius: var(--radius-full);
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.db-more-btn:hover { background-color: var(--color-text); color: #fff; }


/* ─────────────────────────────────────────────────────────────
   Inquiries panel
   ─────────────────────────────────────────────────────────────*/
.dashboard-page .inquiries-card {
  top: calc(var(--header-height, 80px) + var(--space-6));
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.dashboard-page .inquiries-header { padding: 16px 20px; }
.dashboard-page .inquiries-header-icon { display: none; }
.dashboard-page .inquiries-title { font-size: 16px; font-weight: var(--font-weight-bold); letter-spacing: -0.01em; }
.dashboard-page .inquiries-badge {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background-color: var(--color-surface-alt);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}
.dashboard-page .inquiry-item { padding: 14px 20px; }
.dashboard-page .inquiry-channel {
  font-size: 11.5px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.01em;
  text-transform: none;
}
.dashboard-page .inquiry-unit-title { font-size: 14px; font-weight: var(--font-weight-semibold); }


/* ─────────────────────────────────────────────────────────────
   Tablets + phones
   ─────────────────────────────────────────────────────────────*/
@media (max-width: 990px) {
  .dashboard-page .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .dashboard-page .dashboard-main { padding-top: var(--space-8); }
  .dashboard-page .dashboard-header { align-items: stretch; }
  .dashboard-page .dashboard-header-actions .btn { height: 44px; font-size: 14px; }
  .dashboard-page .db-kpis { gap: 10px; margin-bottom: var(--space-6); }
  .db-kpi { padding: 16px; }
  .db-kpi-value { font-size: 1.375rem; white-space: nowrap; }
  .dashboard-page .dashboard-filter-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; }
}

@media (max-width: 600px) {
  .dashboard-page .db-row {
    grid-template-columns: 84px minmax(0, 1fr) 36px;
    column-gap: var(--space-3);
    align-items: start;
  }
  .dashboard-page .db-row .listing-card-body { flex-direction: column; align-items: stretch; gap: 8px; }
  .db-row-side { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; text-align: left; }
  .dashboard-page .db-row .listing-card-title { font-size: 15px; }
  .dashboard-page .db-row .btn-icon-overlay { width: 36px; height: 36px; }
}

/* Toast: fade as well as slide, so it never peeks out when hidden */
.dashboard-page .toast {
  border-radius: var(--radius-full);
  background-color: var(--color-text);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.2s ease, visibility 0.2s;
}
.dashboard-page .toast.is-visible { opacity: 1; visibility: visible; }
@media (max-width: 860px) {
  .dashboard-page .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
