/* Operations Dashboard — matches Ophelia Safe Haven theme.css */

.dashboard-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
}

/* ── Page Header ────────────────────────────── */
.dash-header {
  margin-bottom: 3rem;
}

.dash-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.dash-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.dash-subtitle {
  font-size: 1rem;
  color: var(--fg-muted);
}

/* ── Sections ───────────────────────────────── */
.dash-section {
  margin-bottom: 3.5rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

/* ── Home Cards Grid ─────────────────────────── */
.homes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.home-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: box-shadow 0.2s ease;
}

.home-card:hover {
  box-shadow: 0 4px 16px rgba(44, 74, 58, 0.08);
}

.home-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
}

.home-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
}

.home-status-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 2rem;
  letter-spacing: 0.04em;
}

.home-status-badge.available {
  background: rgba(90, 122, 96, 0.12);
  color: var(--fg-muted);
}

.home-status-badge.high {
  background: rgba(184, 131, 90, 0.15);
  color: var(--accent);
}

.home-status-badge.full {
  background: rgba(44, 74, 58, 0.1);
  color: var(--fg);
}

.home-address {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
}

.home-occupancy {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.occupancy-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
}

.occupancy-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.occupancy-bar-fill.available { background: var(--fg-muted); }
.occupancy-bar-fill.high     { background: var(--accent); }
.occupancy-bar-fill.full     { background: var(--fg); }

.occupancy-label {
  font-size: 0.825rem;
  color: var(--fg-muted);
}

/* ── Residents Table ─────────────────────────── */
.residents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.residents-table th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-align: left;
  padding: 0.85rem 1.25rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.residents-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  vertical-align: top;
}

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

.residents-table tbody tr:hover td {
  background: var(--bg);
}

.resident-name {
  font-weight: 500;
  color: var(--fg);
}

.resident-home {
  color: var(--fg-muted);
}

.resident-date {
  color: var(--fg-muted);
  white-space: nowrap;
}

.resident-care {
  color: var(--fg-muted);
  max-width: 280px;
}

/* ── Nav extras ──────────────────────────────── */
.nav-actions {
  margin-left: auto;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--fg);
}

/* ── Footer ─────────────────────────────────── */
.dash-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--fg-muted);
  padding: 2rem 2rem 3rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

/* ── States ─────────────────────────────────── */
.error-msg {
  color: var(--accent);
  font-size: 0.9rem;
  grid-column: 1 / -1;
}

.empty-msg {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* ── Skeleton loaders ────────────────────────── */
.skeleton-card,
.skeleton-row {
  background: var(--bg-alt);
  border-radius: var(--radius);
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-card {
  height: 140px;
}

.skeleton-row {
  height: 48px;
  margin-bottom: 0.75rem;
}

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

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 5rem 1.25rem 3rem;
  }

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

  .residents-table {
    display: block;
    overflow-x: auto;
  }

  .resident-care {
    max-width: 180px;
  }
}

@media (max-width: 480px) {
  .home-card-header {
    flex-direction: column;
    gap: 0.4rem;
  }
}