*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f4f4f1;
  --bg-tertiary: #eeede9;
  --text-primary: #1a1a18;
  --text-secondary: #6b6b66;
  --text-tertiary: #9b9b94;
  --border: rgba(0,0,0,0.1);
  --border-md: rgba(0,0,0,0.18);
  --green-fill: #EAF3DE;
  --green-text: #3B6D11;
  --green-bar: #1D9E75;
  --amber-fill: #FAEEDA;
  --amber-text: #854F0B;
  --amber-bar: #EF9F27;
  --red-fill: #FDECEA;
  --red-text: #991B1B;
  --radius-md: 8px;
  --radius-lg: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

/* ── CARDS ── */
.card {
  background: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.card-title { font-size: 14px; font-weight: 500; }
.card-meta { font-size: 12px; color: var(--text-tertiary); }

/* ── METRICS ── */
.metric {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.metric-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; }
.metric-value { font-size: 22px; font-weight: 500; letter-spacing: -0.5px; }
.metric-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }

/* ── BADGES ── */
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  font-weight: 500;
}
.badge-green { background: var(--green-fill); color: var(--green-text); }
.badge-amber { background: var(--amber-fill); color: var(--amber-text); }
.badge-red { background: var(--red-fill); color: var(--red-text); }
.badge-neutral { background: var(--bg-secondary); color: var(--text-secondary); }
.status-badge {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-md);
  background: var(--green-fill);
  color: var(--green-text);
  font-weight: 500;
}

/* ── PHASE TRACKER ── */
.progress-bar-wrap {
  background: var(--bg-secondary);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--green-bar);
  transition: width 0.5s ease;
}
.phase-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 0.5px solid var(--border);
}
.phase-row:first-of-type { border-top: none; }
.phase-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-done { background: var(--green-bar); }
.dot-active { background: var(--amber-bar); }
.dot-pending { background: var(--bg-secondary); border: 1.5px solid var(--border-md); }
.phase-name { font-size: 13px; flex: 1; }
.phase-status { font-size: 12px; color: var(--text-tertiary); }

/* ── WEBCAM ── */
.cam-placeholder {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0.5px solid var(--border);
}
.cam-placeholder iframe { width: 100%; height: 100%; border: none; border-radius: var(--radius-md); }
.cam-dot { width: 8px; height: 8px; border-radius: 50%; background: #D85A30; }
.cam-label { font-size: 12px; color: var(--text-secondary); }
.cam-time { font-size: 11px; color: var(--text-tertiary); }

/* ── UPDATES ── */
.update-item {
  padding: 10px 0;
  border-top: 0.5px solid var(--border);
}
.update-item:first-child { border-top: none; padding-top: 0; }
.update-meta { font-size: 11px; color: var(--text-tertiary); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.update-source { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--bg-secondary); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.3px; }
.update-text { font-size: 13px; line-height: 1.5; }

/* ── PHOTOS ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.photo-thumb {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid var(--border);
  overflow: hidden;
  cursor: pointer;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb-label { font-size: 11px; color: var(--text-tertiary); text-align: center; padding: 8px; line-height: 1.4; }
.photo-thumb.add { border: 0.5px dashed var(--border-md); background: transparent; }

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.project-title { font-size: 18px; font-weight: 500; letter-spacing: -0.3px; }
.project-sub { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

/* ── TWO COL ── */
.two-col {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ── UTILS ── */
.mb-6 { margin-bottom: 1.5rem; }
.mt-auto { margin-top: auto; }

/* ── LOADING / EMPTY ── */
.loading-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-tertiary);
  font-size: 13px;
}
.empty-state {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ── BUTTON ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--text-primary); color: #fff; }
.btn-ghost { background: transparent; border: 0.5px solid var(--border-md); color: var(--text-secondary); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── INPUT ── */
.input {
  width: 100%;
  padding: 7px 10px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
}
.input:focus { border-color: var(--green-bar); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
