:root {
  --pink: #de2277;
  --orange: #e58207;
  --teal: #7bcbd1;
  --deep-teal: #0092a3;
  --black: #1f1f1f;
  --grey: #666666;
  --light-grey: #f2f2f2;
  --border: #e2e2e2;
  --red: #d2232a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  color: var(--black);
  background: #fafafa;
}

.hidden { display: none !important; }

.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--pink); color: white; }
.btn-outline { background: white; color: var(--pink); border: 2px solid var(--pink); }
.btn-ghost { background: transparent; color: var(--grey); }
.btn-danger { background: white; color: var(--red); border: 2px solid var(--red); }

/* Gate */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(60deg, var(--pink), var(--orange), var(--teal));
}
.gate-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  width: 360px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.gate-logo {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 8px;
}
.gate-card h1 { font-size: 22px; margin: 0 0 8px; }
.gate-sub { color: var(--grey); font-size: 14px; margin-bottom: 24px; }
.gate-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 2px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 16px;
}
.gate-card .btn { width: 100%; }
.gate-error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 16px; }

/* App shell */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: white;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(60deg, var(--pink), var(--orange), var(--teal));
  display: inline-block;
}
.brand-name { font-weight: 900; font-size: 16px; }
.brand-sub { color: var(--grey); font-size: 14px; }
.version-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--deep-teal);
  background: #e8f6f7;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 4px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stakeholders { font-size: 12px; color: var(--grey); margin-right: 8px; }

.main { padding: 24px 32px 64px; max-width: 1100px; margin: 0 auto; }

.filters { display: flex; gap: 12px; margin-bottom: 20px; }
.filters input, .filters select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 2px solid var(--border);
  font-family: inherit;
  font-size: 14px;
}
.filters input { flex: 1; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--grey);
}

.project-list { display: grid; gap: 16px; }

.project-card {
  background: white;
  border: 1px solid var(--border);
  border-left: 6px solid var(--pink);
  border-radius: 12px;
  padding: 20px 24px;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}
.project-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.project-card.status-in-progress { border-left-color: var(--orange); }
.project-card.status-dormant { border-left-color: #bbbbbb; }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.card-url { color: var(--deep-teal); font-size: 13px; text-decoration: none; word-break: break-all; }
.card-url:hover { text-decoration: underline; }
.claude-link { color: #b5540d; font-weight: 700; }

.status-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill.status-live { background: #e6f6ea; color: #1f7a3d; }
.status-pill.status-in-progress { background: #fdf1de; color: #b8860b; }
.status-pill.status-dormant { background: #eeeeee; color: #888888; }

.card-owner { font-size: 13px; color: var(--grey); margin-top: 8px; }
.card-stack { font-size: 13px; color: var(--black); margin-top: 10px; line-height: 1.5; }
.card-stack strong { color: var(--deep-teal); }

.card-actions-preview { margin-top: 10px; font-size: 13px; color: var(--grey); }
.card-actions-preview strong { color: var(--pink); }

/* Editor modal */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 100;
}
.editor-card {
  background: white;
  border-radius: 14px;
  padding: 32px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.editor-card h2 { margin-top: 0; }
.editor-card label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--black);
}
.editor-card input, .editor-card select, .editor-card textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  resize: vertical;
}
.editor-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
.editor-buttons-right { display: flex; gap: 10px; }

@media (max-width: 700px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .stakeholders { display: none; }
  .main { padding: 20px 16px 48px; }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--grey);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tab-btn.active { color: var(--pink); border-bottom-color: var(--pink); }
.tab-panel.hidden { display: none; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.section-blurb { color: var(--grey); font-size: 14px; margin: 0 0 16px; }

/* Schedule list */
.schedule-list { display: grid; gap: 14px; }
.schedule-card {
  background: white;
  border: 1px solid var(--border);
  border-left: 6px solid var(--teal);
  border-radius: 12px;
  padding: 16px 22px;
  cursor: pointer;
}
.schedule-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.schedule-task { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.schedule-meta { font-size: 13px; color: var(--grey); }
.schedule-meta strong { color: var(--deep-teal); }
.schedule-notes { font-size: 13px; margin-top: 6px; color: var(--black); }

/* Instructions */
.instruction-block { margin-bottom: 18px; }
.instruction-block label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--pink);
}
.instruction-block textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 2px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
.saved-msg {
  color: #1f7a3d;
  font-weight: 700;
  font-size: 13px;
  margin-left: 12px;
}

.detail-text a { color: var(--deep-teal); }
.detail-text {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--black);
  font-size: 14px;
  margin: 0;
}
.detail-text:empty::before { content: "Not documented yet."; color: #999; font-style: italic; }

/* Project detail page */
.back-btn { margin-bottom: 16px; padding-left: 0; }
.detail-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
}
.detail-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.detail-top-right { display: flex; align-items: center; gap: 12px; }
.detail-name { margin: 0 0 6px; font-size: 24px; }
.detail-links { display: flex; flex-direction: column; gap: 2px; }
.detail-owner { color: var(--grey); font-size: 14px; margin: 10px 0 0; }
.detail-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.detail-section h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--pink); margin: 0 0 10px; }
.detail-actions { margin: 0; padding-left: 20px; }
.detail-actions li { margin-bottom: 8px; font-size: 14px; line-height: 1.5; }
.detail-updated { margin-top: 24px; font-size: 12px; color: #999; font-style: italic; }

#detail-edit-form.detail-card label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}
#detail-edit-form.detail-card input,
#detail-edit-form.detail-card select,
#detail-edit-form.detail-card textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  resize: vertical;
}
