/* ========================================
   DBPA Shield — Project Management Dashboard
   ======================================== */

/* ── Layout ───────────────────────────── */
.dash-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.dash-container {}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.dash-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.dash-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Breadcrumb ───────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover { text-decoration: underline; }

.bc-sep { color: var(--text-muted); }

.breadcrumb span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Project Grid ─────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.project-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.project-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.project-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.project-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.project-card-stats {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.pcs strong {
  color: var(--text-primary);
}

.pcs-alert, .pcs-alert strong {
  color: var(--red) !important;
}

.project-card-footer {
  margin-top: 10px;
}

.project-card-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Sections ─────────────────────────── */
.section {
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.section-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.015);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ── Detail Grid ──────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 14px;
  color: var(--text-primary);
}

/* ── Upload Zone ──────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--brand);
  background: rgba(59, 130, 246, 0.03);
  color: var(--brand);
}

.upload-zone-sm {
  padding: 14px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── DCD Cards ────────────────────────── */
.dcd-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.dcd-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.dcd-number {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.dcd-file {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dcd-extracted {
  padding: 16px 18px;
}

.dcd-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.dcd-detail {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dcd-detail-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.dcd-detail-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.dcd-drawings-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.data-table-sm {
  font-size: 12px;
}

.data-table-sm th,
.data-table-sm td {
  padding: 6px 10px;
}

.dcd-declarations {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.dec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dec-row:last-child { border-bottom: none; }

.dec-label {
  color: var(--text-secondary);
}

.dec-value {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

.dec-yes { background: rgba(34, 197, 94, 0.1); color: #15803d; }
.dec-no { background: rgba(239, 68, 68, 0.1); color: #b91c1c; }
.dec-na { background: rgba(148, 163, 184, 0.1); color: #64748b; }

.dcd-manual {
  padding: 14px 18px;
}

/* ── Variations ───────────────────────── */
.variation-entry {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 8px;
}

.variation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 14px;
}

.variation-body {
  font-size: 13px;
  margin-bottom: 8px;
}

.variation-detail {
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.variation-detail span {
  font-weight: 600;
  color: var(--text-primary);
  display: inline-block;
  width: 70px;
}

.variation-actions {
  display: flex;
  gap: 6px;
}

/* ── Status ───────────────────────────── */
.tag-success { background: rgba(34, 197, 94, 0.1); color: #15803d; }
.tag-warning { background: rgba(245, 158, 11, 0.1); color: #b45309; }
.tag-critical { background: rgba(239, 68, 68, 0.1); color: #b91c1c; }
.stat-alert { color: var(--red) !important; }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.status-dot.green { background: var(--green); }
.status-dot.amber { background: var(--amber); }
.status-dot.red { background: var(--red); }
.status-dot.gray { background: #cbd5e1; }

/* ── Empty state ──────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state h3 {
  color: var(--text-primary);
  margin: 12px 0 4px;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ── Dev switcher ─────────────────────── */
.dev-switcher {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px;
  margin-right: 8px;
}

.dev-tab {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: all 0.15s;
}

.dev-tab:hover { color: rgba(255, 255, 255, 0.8); }
.dev-tab.active { background: rgba(255, 255, 255, 0.15); color: #fff; }

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

.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  border-radius: 12px;
  width: 520px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal .panel-header h2 { font-size: 18px; font-weight: 700; margin: 0; }

.modal .panel-body { padding: 20px 24px; }

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

/* ── Responsive ───────────────────────── */
@media (max-width: 640px) {
  .dash-main { padding: 16px; }

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

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

  .dcd-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-header {
    flex-direction: column;
    gap: 12px;
  }
}
