/* Dashboard styles — Gridwork HUD Compliance Agent */

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

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  gap: 1rem;
}

.dash-title {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--dark);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.dash-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--dark);
  color: #fff;
}

.btn-primary:hover { background: var(--dark-mid); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid rgba(27, 61, 47, 0.2);
}

.btn-ghost:hover { background: rgba(27, 61, 47, 0.05); border-color: var(--dark); }
.btn-full { width: 100%; justify-content: center; }

/* Agent status chip */
.agent-status-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-mid);
  background: var(--offwhite);
  border: 1px solid rgba(27, 61, 47, 0.12);
  padding: 0.4rem 0.75rem;
  border-radius: 100px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.pulse-green {
  background: #5DD879;
  box-shadow: 0 0 0 0 rgba(93, 216, 121, 0.4);
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(93, 216, 121, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(93, 216, 121, 0); }
  100% { box-shadow: 0 0 0 0 rgba(93, 216, 121, 0); }
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--offwhite);
  border: 1px solid rgba(27, 61, 47, 0.1);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.stat-card-num {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 900;
  color: var(--dark);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-card-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Sections */
.dash-section {
  background: var(--offwhite);
  border: 1px solid rgba(27, 61, 47, 0.1);
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
}

/* Tables */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.dash-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(27, 61, 47, 0.1);
}

.dash-table td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid rgba(27, 61, 47, 0.06);
  vertical-align: middle;
}

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

.dash-table tbody tr:hover { background: rgba(27, 61, 47, 0.03); }

.row-urgent td { background: rgba(220, 38, 38, 0.07); }
.row-warning td { background: rgba(234, 179, 8, 0.07); }
.row-amber td { background: rgba(201, 150, 59, 0.07); }

.text-muted { color: var(--text-muted); }
.text-muted.small { font-size: 0.78rem; }
.text-error { color: #DC2626; }

.small { font-size: 0.8rem; }

/* Badges */
.days-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(27, 61, 47, 0.07);
  color: var(--text-mid);
}

.days-badge.urgent { background: rgba(220, 38, 38, 0.12); color: #DC2626; }
.days-badge.warning { background: rgba(234, 179, 8, 0.12); color: #B45309; }
.days-badge.amber { background: rgba(201, 150, 59, 0.12); color: #92620A; }

.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  background: rgba(27, 61, 47, 0.08);
  color: var(--text-mid);
}

/* Alert rows */
.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(27, 61, 47, 0.06);
  gap: 1rem;
}

.alert-row:last-child { border-bottom: none; }
.alert-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.alert-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; flex-shrink: 0; }

.alert-type-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: rgba(201, 150, 59, 0.15);
  color: #92620A;
}

.alert-type-chip.type-urgent { background: rgba(220, 38, 38, 0.12); color: #DC2626; }
.alert-type-chip.type-30day { background: rgba(234, 179, 8, 0.12); color: #B45309; }
.alert-type-chip.type-60day { background: rgba(201, 150, 59, 0.12); color: #92620A; }
.alert-type-chip.type-90day { background: rgba(42, 154, 67, 0.12); color: #166534; }

/* Property rows */
.property-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(27, 61, 47, 0.06);
  gap: 1rem;
}

.property-row:last-child { border-bottom: none; }
.property-info { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.type-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: rgba(27, 61, 47, 0.08);
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(27, 61, 47, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--offwhite);
  border-radius: 18px;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.25rem;
}

.modal-close:hover { color: var(--dark); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-mid); margin-bottom: 0.35rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(27, 61, 47, 0.2);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; }

/* Empty state */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 2rem;
}

/* Responsive */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .dashboard-header { flex-direction: column; }
}

@media (max-width: 600px) {
  .dashboard-wrap { padding: 1.5rem 1rem 3rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .dash-table { font-size: 0.8rem; }
  .dash-table th, .dash-table td { padding: 0.5rem 0.4rem; }
}