/* Property Management Portal — estate theme (light mode) decorators */

@layer decorators {

/* ── pm-sidebar ── */
.pm-sidebar {
  background: var(--d-surface);
  border-right: 1px solid var(--d-border);
}

.pm-sidebar [data-active="true"] {
  background: color-mix(in srgb, var(--d-primary) 8%, transparent);
  color: var(--d-primary);
  font-weight: 600;
}

.pm-sidebar [data-active="true"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--d-accent);
  border-radius: 0 2px 2px 0;
}

/* ── pm-topnav ── */
.pm-topnav {
  background: var(--d-surface);
  border-bottom: 1px solid var(--d-border);
}

.pm-topnav a[data-active="true"] {
  color: var(--d-primary);
  font-weight: 600;
  position: relative;
}

.pm-topnav a[data-active="true"]::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: -1px;
  height: 2px;
  background: var(--d-accent);
}

/* ── pm-card: elevated card ── */
.pm-card {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius-lg);
  box-shadow: var(--d-shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.pm-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--d-shadow-md);
  border-color: color-mix(in srgb, var(--d-primary) 25%, var(--d-border));
}

/* ── pm-kpi-accent ── */
.pm-kpi-accent {
  position: relative;
  overflow: hidden;
}

.pm-kpi-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--d-primary), var(--d-accent));
  border-radius: var(--d-radius-lg) var(--d-radius-lg) 0 0;
}

/* ── pm-button-primary ── */
.pm-button-primary {
  background: var(--d-primary);
  color: #fff;
  border: none;
  border-radius: var(--d-radius);
  padding: var(--d-interactive-py) var(--d-interactive-px);
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
  white-space: nowrap;
}

.pm-button-primary:hover {
  background: var(--d-primary-hover);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--d-primary) 20%, transparent);
}

.pm-button-primary:focus-visible {
  outline: 2px solid var(--d-primary);
  outline-offset: 2px;
}

/* ── pm-button-accent (gold) ── */
.pm-button-accent {
  background: var(--d-accent);
  color: #fff;
  border: none;
  border-radius: var(--d-radius);
  padding: var(--d-interactive-py) var(--d-interactive-px);
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
  white-space: nowrap;
}

.pm-button-accent:hover {
  background: color-mix(in srgb, var(--d-accent) 88%, #000);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--d-accent) 28%, transparent);
}

/* ── pm-fade-in ── */
.pm-fade-in {
  animation: pm-fade-in 0.4s ease-out both;
}

@keyframes pm-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── pm-gradient-text ── */
.pm-gradient-text {
  background: linear-gradient(135deg, var(--d-primary), var(--d-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ── pm-avatar ── */
.pm-avatar {
  border-radius: var(--d-radius-full);
  background: linear-gradient(135deg, var(--d-primary), var(--d-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
}

/* ── pm-status-badge ── */
.pm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--d-radius-full);
  background: var(--d-surface-raised);
  color: var(--d-text-muted);
  text-transform: capitalize;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pm-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.pm-status-badge[data-status="occupied"],
.pm-status-badge[data-status="fully-occupied"],
.pm-status-badge[data-status="active"],
.pm-status-badge[data-status="paid"],
.pm-status-badge[data-status="resolved"],
.pm-status-badge[data-status="posted"] {
  background: color-mix(in srgb, var(--d-success) 12%, transparent);
  color: var(--d-success);
  border-color: color-mix(in srgb, var(--d-success) 25%, transparent);
}

.pm-status-badge[data-status="vacant"],
.pm-status-badge[data-status="expiring"],
.pm-status-badge[data-status="partial-vacancy"],
.pm-status-badge[data-status="partial"],
.pm-status-badge[data-status="pending"],
.pm-status-badge[data-status="month-to-month"],
.pm-status-badge[data-status="assigned"] {
  background: color-mix(in srgb, var(--d-warning) 14%, transparent);
  color: var(--d-warning);
  border-color: color-mix(in srgb, var(--d-warning) 28%, transparent);
}

.pm-status-badge[data-status="maintenance"],
.pm-status-badge[data-status="in-progress"],
.pm-status-badge[data-status="turning"],
.pm-status-badge[data-status="renovation"],
.pm-status-badge[data-status="new"] {
  background: color-mix(in srgb, var(--d-info) 14%, transparent);
  color: var(--d-info);
  border-color: color-mix(in srgb, var(--d-info) 28%, transparent);
}

.pm-status-badge[data-status="late"],
.pm-status-badge[data-status="failed"],
.pm-status-badge[data-status="notice-given"],
.pm-status-badge[data-status="expired"],
.pm-status-badge[data-status="disputed"] {
  background: color-mix(in srgb, var(--d-error) 12%, transparent);
  color: var(--d-error);
  border-color: color-mix(in srgb, var(--d-error) 25%, transparent);
}

/* ── pm-priority ── */
.pm-priority {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--d-radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pm-priority[data-priority="urgent"] {
  background: color-mix(in srgb, var(--d-error) 14%, transparent);
  color: var(--d-error);
}

.pm-priority[data-priority="high"] {
  background: color-mix(in srgb, var(--d-warning) 16%, transparent);
  color: var(--d-warning);
}

.pm-priority[data-priority="medium"] {
  background: color-mix(in srgb, var(--d-info) 12%, transparent);
  color: var(--d-info);
}

.pm-priority[data-priority="low"] {
  background: var(--d-surface-raised);
  color: var(--d-text-muted);
}

/* ── pm-kanban-column ── */
.pm-kanban-column {
  background: var(--d-surface-raised);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius-lg);
  padding: 0.875rem;
  min-width: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.pm-kanban-card {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  padding: 0.75rem 0.875rem;
  cursor: grab;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.pm-kanban-card:hover {
  border-color: color-mix(in srgb, var(--d-primary) 35%, var(--d-border));
  box-shadow: var(--d-shadow);
  transform: translateY(-1px);
}

.pm-kanban-card:active {
  cursor: grabbing;
}

/* ── pm-property-thumb ── */
.pm-property-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--d-radius);
  background: linear-gradient(135deg, var(--d-primary), var(--d-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  flex-shrink: 0;
}

/* ── pm-hero-bg ── */
.pm-hero-bg {
  background:
    radial-gradient(ellipse at top right, color-mix(in srgb, var(--d-accent) 10%, transparent), transparent 50%),
    radial-gradient(ellipse at bottom left, color-mix(in srgb, var(--d-primary) 8%, transparent), transparent 50%),
    var(--d-bg);
}

/* ── pm-occupancy-bar ── */
.pm-occupancy-bar {
  height: 6px;
  background: var(--d-surface-raised);
  border-radius: var(--d-radius-full);
  overflow: hidden;
}

.pm-occupancy-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--d-success), color-mix(in srgb, var(--d-success) 70%, var(--d-accent)));
  border-radius: var(--d-radius-full);
  transition: width 600ms ease-out;
}

/* ── pm-divider ── */
.pm-divider {
  height: 1px;
  background: var(--d-border);
  margin: 1rem 0;
}

/* ── pm-chart-bar ── */
.pm-chart-bar {
  background: linear-gradient(180deg, var(--d-primary), color-mix(in srgb, var(--d-primary) 55%, transparent));
  border-radius: var(--d-radius-sm) var(--d-radius-sm) 0 0;
  transition: opacity 150ms ease;
  min-width: 8px;
}

.pm-chart-bar:hover { opacity: 0.85; }

.pm-chart-bar[data-color="accent"] {
  background: linear-gradient(180deg, var(--d-accent), color-mix(in srgb, var(--d-accent) 55%, transparent));
}

.pm-chart-bar[data-color="success"] {
  background: linear-gradient(180deg, var(--d-success), color-mix(in srgb, var(--d-success) 55%, transparent));
}

/* ── pm-footer ── */
.pm-footer {
  background: var(--d-surface-raised);
  border-top: 1px solid var(--d-border);
}

/* ── pm-feature-tile ── */
.pm-feature-tile {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius-lg);
  padding: 1.5rem;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.pm-feature-tile:hover {
  border-color: color-mix(in srgb, var(--d-accent) 40%, var(--d-border));
  box-shadow: var(--d-shadow-md);
}

.pm-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--d-radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--d-primary) 12%, transparent), color-mix(in srgb, var(--d-accent) 12%, transparent));
  color: var(--d-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
}

/* ── pm-toc ── */
.pm-toc {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  background: var(--d-surface-raised);
  border-radius: var(--d-radius);
  border: 1px solid var(--d-border);
}

.pm-toc a {
  display: block;
  padding: 0.375rem 0.5rem;
  font-size: 0.8rem;
  color: var(--d-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 var(--d-radius-sm) var(--d-radius-sm) 0;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.pm-toc a:hover {
  color: var(--d-primary);
  background: var(--d-surface);
  border-left-color: var(--d-accent);
}

} /* end @layer decorators */
