@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400&display=swap');

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

:root {
  --green:        #009aa5;
  --green-dark:   #007a84;
  --green-light:  #cceef1;
  --green-faint:  #f0f8f9;
  --text:         #1a2332;
  --text-muted:   #64748b;
  --border:       #e2e8f0;
  --bg:           #f7f9fb;
  --white:        #ffffff;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.07);
  --shadow:       0 4px 16px rgba(0,0,0,.09);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.11);
  --radius:       12px;
  --radius-sm:    8px;
  --transition:   all .2s ease;
}

html, body {
  height: 100%;
  font-family: 'Lato', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ── */
.screen {
  display: none;
  min-height: 100vh;
  animation: fadeIn .3s ease;
}
.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Auth layout ── */
.auth-layout {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f8f9 0%, #d9eef1 50%, #f0f8f9 100%);
  padding: 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 48px;
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.auth-logo .logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-logo .logo-mark img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.auth-logo .logo-text {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.5px;
}

.auth-logo .logo-text span {
  color: var(--green);
}

.auth-card h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-card .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── App layout ── */
.app-layout {
  flex-direction: column;
}

.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.navbar-brand .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.navbar-brand .logo-mark img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.navbar-brand .logo-text {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.5px;
}

.navbar-brand .logo-text span { color: var(--green); }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar-link {
  background: none;
  border: none;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: .01em;
}

.navbar-link:hover {
  color: var(--text);
  background: var(--bg);
}

.navbar-link--active {
  color: var(--green-dark);
  background: var(--green-faint);
}

.navbar-link--active:hover {
  background: var(--green-light);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-user {
  font-size: 14px;
  color: var(--text-muted);
}

.navbar-user strong {
  color: var(--text);
  font-weight: 700;
}

.page-content {
  flex: 1;
  padding: 40px 32px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 7px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,204,113,.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #c0c7d0;
}

.form-group textarea {
  resize: vertical;
  min-height: 96px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green);
  color: white;
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46,204,113,.35);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-faint);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 14px;
  font-size: 14px;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--border);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ── Links ── */
.link {
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.link:hover { color: var(--green-dark); text-decoration: underline; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Alert / Error ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}

.alert.show { display: block; }

.alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-success {
  background: var(--green-light);
  color: var(--green-dark);
  border: 1px solid #a7f3d0;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.5px;
}

.page-header .page-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fadeOverlay .2s ease;
}

@keyframes fadeOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  animation: slideUp .25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.modal-body { padding: 24px 28px; }

.modal-footer {
  padding: 0 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ── Project cards ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.project-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

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

.project-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.project-card h3:hover { color: var(--green); }

.project-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
}

.project-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-dates {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.project-dates span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-dates .date-icon {
  width: 14px;
  height: 14px;
  color: var(--green);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  grid-column: 1 / -1;
}

.empty-icon {
  width: 72px;
  height: 72px;
  background: var(--green-faint);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.empty-icon svg {
  width: 32px;
  height: 32px;
  color: var(--green);
  stroke: var(--green);
  fill: none;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── Progress tracker ── */
.progress-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.progress-card-top {
  margin-bottom: 20px;
}

.progress-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-dark);
}

.progress-fraction {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--green-light);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  width: 0%;
  transition: width .4s ease, background-color .4s ease;
  background: #e74c3c;
}

.progress-bar-fill.mid   { background: #f39c12; }
.progress-bar-fill.good  { background: var(--green); }
.progress-bar-fill.full  { background: var(--green-dark); }

.progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px 6px 10px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.progress-step:hover {
  border-color: var(--green);
  background: var(--green-faint);
}

.progress-step.checked {
  background: var(--green-light);
  border-color: var(--green);
}

.progress-step input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  position: relative;
}

.progress-step input[type="checkbox"]:checked {
  background: var(--green);
  border-color: var(--green);
}

.progress-step input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.progress-step-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
}

.progress-step.checked .progress-step-label {
  color: var(--green-dark);
}

/* ── Field history ── */
.field-meta {
  margin-top: 12px;
  border-top: 1px solid var(--green-light);
  padding-top: 10px;
}

.field-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.field-last-updated {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.field-last-updated svg {
  width: 12px;
  height: 12px;
  color: var(--green);
  flex-shrink: 0;
}

.field-history-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  background: none;
  border: 1px solid var(--green-light);
  border-radius: 99px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: 'Lato', sans-serif;
  transition: var(--transition);
}

.field-history-toggle:hover,
.field-history-toggle.open {
  background: var(--green-light);
  border-color: var(--green);
}

.field-history-toggle svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.field-history-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-entry {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.history-entry-latest {
  border-color: var(--green-light);
  background: var(--green-faint);
}

.history-entry-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}

.history-tag-input {
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  width: 100%;
  transition: var(--transition);
  outline: none;
}

.history-tag-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
}

.history-tag-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(46,204,113,.12);
}

.history-entry-latest .history-tag-input {
  background: var(--green-faint);
  border-color: var(--green-light);
}

.history-entry-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-entry-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.history-stat {
  background: var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 99px;
}

.history-badge {
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 99px;
}

.history-entry-value {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Share button & popup ── */
.share-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* Push share button to the far right of the meta bar */
.field-meta-bar .share-wrap {
  margin-left: auto;
}

/* Meta bar with only share button — align right */
.field-meta-bar--share-only {
  justify-content: flex-end;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Lato', sans-serif;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 10px 3px 8px;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.share-btn svg { flex-shrink: 0; }

.share-btn:hover,
.share-btn.active {
  color: var(--green-dark);
  border-color: var(--green);
  background: var(--green-faint);
}

/* Compact variant used inside history entries */
.share-btn--sm {
  font-size: 10px;
  padding: 2px 8px 2px 6px;
  opacity: 0;
  transition: var(--transition), opacity .15s ease;
}

.history-entry:hover .share-btn--sm,
.share-btn--sm.active {
  opacity: 1;
}

.share-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 160px;
  overflow: hidden;
  z-index: 200;
  opacity: 0;
  transform: translateY(-4px) scale(.97);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}

.share-popup.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.share-option:hover {
  background: var(--green-faint);
  color: var(--green-dark);
}

.share-option svg {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}

.share-option:hover svg { color: var(--green); }

.share-option + .share-option {
  border-top: 1px solid var(--border);
}

.share-popup-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.share-option--post {
  color: var(--green-dark);
}

.share-option--post svg {
  color: var(--green);
}

.share-option--post:hover {
  background: var(--green-faint);
  color: var(--green-dark);
}

/* Share dialog */
.share-modal { max-width: 420px; }

/* Toast */
.share-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: white;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 99px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 999;
  white-space: nowrap;
}

.share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Detail page ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 28px;
  border: none;
  background: none;
  font-family: 'Lato', sans-serif;
  transition: var(--transition);
  padding: 0;
}

.back-btn:hover { color: var(--green); }

.back-btn svg {
  width: 16px;
  height: 16px;
  transition: var(--transition);
}

.back-btn:hover svg { transform: translateX(-3px); }

.detail-header {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}

.detail-title {
  font-size: 30px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.5px;
  margin-bottom: 16px;
}

.detail-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.detail-meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--green);
  flex-shrink: 0;
}

.detail-meta-item strong {
  color: var(--text);
  font-weight: 700;
}

.detail-fields {
  display: grid;
  gap: 16px;
}

.detail-field {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.detail-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,204,113,.10);
}

.detail-field-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-field-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--green-light);
}

.detail-field textarea {
  width: 100%;
  border: none;
  outline: none;
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  color: var(--text);
  resize: vertical;
  background: transparent;
  line-height: 1.7;
  min-height: 80px;
}

.detail-field.logline textarea { min-height: 56px; font-size: 17px; font-weight: 400; }
.detail-field.long-desc textarea { min-height: 200px; }

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* ── Saved indicator ── */
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--green-dark);
  background: var(--green-light);
  padding: 6px 12px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity .4s ease;
}

.save-indicator.show { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .auth-card { padding: 32px 24px; }
  .page-content { padding: 24px 16px; }
  .navbar { padding: 0 16px; }
  .form-row { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .detail-meta { flex-direction: column; gap: 12px; }
  .navbar-links { display: none; }
  .social-feed { max-width: 100%; }
}

/* ══════════════════════════════════════════════════
   SOCIAL PAGE
══════════════════════════════════════════════════ */

/* ── Feed container ── */
.social-feed {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Compose box ── */
.social-compose {
  max-width: 680px;
  margin: 0 auto 8px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.social-compose-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .02em;
}

.social-compose-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-compose-input {
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  resize: none;
  width: 100%;
  transition: var(--transition);
  outline: none;
  line-height: 1.5;
}

.social-compose-input::placeholder { color: var(--text-muted); }

.social-compose-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,204,113,.12);
  background: var(--white);
}

.social-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.social-char-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}

.social-char-count.over {
  color: #dc2626;
}

/* ── Post card ── */
.social-post {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: var(--transition);
  opacity: 1;
}

.social-post:hover {
  box-shadow: var(--shadow);
}

.social-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.social-post-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-post-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.social-post-author {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}

.social-post-time {
  font-size: 12px;
  color: var(--text-muted);
}

.social-post-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: var(--transition);
  opacity: 0;
}

.social-post:hover .social-post-delete { opacity: 1; }

.social-post-delete:hover {
  color: #dc2626;
  background: #fef2f2;
}

.social-post-content {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
}

/* ── Action bar ── */
.social-post-actions {
  display: flex;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.social-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: var(--transition);
}

.social-action-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.like-btn.liked {
  color: #e74c3c;
}

.like-btn.liked svg {
  stroke: #e74c3c;
  fill: #e74c3c;
}

.like-btn.liked:hover {
  background: #fef2f2;
}

.comment-btn:hover {
  color: var(--green-dark);
  background: var(--green-faint);
}

.like-count, [data-comment-count] {
  min-width: 10px;
  font-variant-numeric: tabular-nums;
}

/* ── Comment section ── */
.social-comment-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, margin-top .3s ease;
}

.social-comment-section.open {
  max-height: 2000px;
  margin-top: 14px;
}

.social-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}

.social-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.social-comment-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-comment-avatar--sm {
  width: 30px;
  height: 30px;
  min-width: 30px;
  font-size: 11px;
}

.social-comment-body {
  flex: 1;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.social-comment-author {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  margin-right: 8px;
}

.social-comment-time {
  font-size: 11px;
  color: var(--text-muted);
}

.social-comment-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-top: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

.social-comment-compose {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
}

.social-comment-compose-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.social-comment-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
  transition: var(--transition);
}

.social-comment-input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(46,204,113,.12);
}

.social-comment-input {
  flex: 1;
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  padding: 7px 14px;
}

.social-comment-input::placeholder { color: var(--text-muted); }

.social-comment-send {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.social-comment-send:hover {
  color: var(--green-dark);
}

/* ── Empty state ── */
.social-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

.social-empty svg {
  margin-bottom: 16px;
  opacity: .35;
}

.social-empty h3 {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}

.social-empty p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Attach artifact button (compose) ── */
.social-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 11px;
  cursor: pointer;
  transition: var(--transition);
}

.social-attach-btn:hover {
  color: var(--green-dark);
  border-color: var(--green-light);
  background: var(--green-faint);
}

/* ── Attach button inside comment input ── */
.social-comment-attach-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 7px 8px 7px 12px;
  display: flex;
  align-items: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.social-comment-attach-btn:hover {
  color: var(--green-dark);
}

/* ── Pending attachment preview (compose + comment) ── */
.attachment-pending {
  width: 100%;
}

.attachment-pending--sm {
  margin-bottom: 0;
}

.attachment-pending-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green-faint);
  border: 1px solid var(--green-light);
  border-radius: 8px;
  padding: 7px 10px;
}

.attachment-pending-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}

.attachment-pending-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.attachment-pending-tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 99px;
  padding: 1px 7px;
}

.attachment-pending-stat {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}

.attachment-pending-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.attachment-pending-clear:hover {
  color: #dc2626;
  background: rgba(220,38,38,.08);
}

/* ── Artifact card (in feed / comments) ── */
.artifact-card {
  display: block;
  margin-top: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.artifact-card:hover {
  background: var(--green-faint);
  border-color: var(--green-light);
  border-left-color: var(--green);
  box-shadow: var(--shadow-sm);
}

.artifact-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.artifact-card-project {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}

.artifact-card-field {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
}

.artifact-card-tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 99px;
  padding: 1px 7px;
}

.artifact-card-stat {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--border);
  border-radius: 99px;
  padding: 1px 7px;
}

.artifact-card-snippet {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.artifact-card-cta {
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: .02em;
}

/* ══════════════════════════════════════════════════
   ARTIFACT PICKER MODAL
══════════════════════════════════════════════════ */

.artifact-picker-modal {
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.artifact-picker-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
}

.picker-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.picker-empty {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 32px 0;
  line-height: 1.6;
}

.picker-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 14px 0;
  transition: var(--transition);
}

.picker-back:hover {
  color: var(--green-dark);
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  cursor: pointer;
  font-family: 'Lato', sans-serif;
  text-align: left;
  transition: var(--transition);
}

.picker-row:hover {
  background: var(--green-faint);
  border-color: var(--green-light);
}

.picker-row-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.picker-row-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.picker-row-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.picker-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

.picker-field-icon {
  color: var(--green-dark);
  flex-shrink: 0;
}

/* Version rows */
.picker-version-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 12px 14px;
}

.picker-version-row .picker-row-main {
  width: 100%;
  gap: 4px;
}

.picker-version-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.picker-latest-badge {
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 99px;
}

.picker-stat-badge {
  background: var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 99px;
}

.picker-snippet {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}

.picker-select-label {
  display: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  margin-top: 6px;
  text-align: right;
}

.picker-version-row:hover .picker-select-label {
  display: block;
}


/* ═══════════════════════════════════════════════
   TIMELINE
═══════════════════════════════════════════════ */

.timeline-feed {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 60px;
}

/* ── Empty state ── */
.tl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 24px;
  text-align: center;
  color: var(--text-muted);
}
.tl-empty svg { opacity: .35; }
.tl-empty h3 { font-size: 17px; font-weight: 700; color: var(--text); margin: 0; }
.tl-empty p  { font-size: 14px; margin: 0; line-height: 1.5; max-width: 340px; }

/* ── Date group ── */
.tl-group { margin-bottom: 8px; }

.tl-group-date {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 24px 0 10px 56px;
}
.tl-group:first-child .tl-group-date { padding-top: 4px; }

/* ── Events list ── */
.tl-events { display: flex; flex-direction: column; }

/* ── Single event row ── */
.tl-event {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
}

/* Left column: icon + vertical line */
.tl-event-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 40px;
  margin-right: 16px;
}

.tl-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1.5px var(--border);
  z-index: 1;
}
.tl-icon svg { display: block; }

.tl-icon--save    { background: var(--green-faint);  color: var(--green-dark);  box-shadow: 0 0 0 1.5px var(--green-light); }
.tl-icon--share   { background: #e0f2fe; color: #0369a1; box-shadow: 0 0 0 1.5px #bae6fd; }
.tl-icon--project { background: #f5f3ff; color: #6d28d9; box-shadow: 0 0 0 1.5px #ddd6fe; }

/* Vertical connector line between events */
.tl-connector {
  width: 2px;
  flex: 1;
  min-height: 24px;
  background: var(--border);
  margin: 2px 0;
}
.tl-event:last-child .tl-connector { display: none; }

/* Right column: card */
.tl-event-card {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.tl-event-card:hover {
  border-color: var(--green-light);
  box-shadow: 0 2px 8px rgba(46,204,113,.08);
}

.tl-event-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
}
.tl-event-title strong { font-weight: 800; }

.tl-event-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.tl-project-link {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}
.tl-project-link:hover { color: var(--green); text-decoration: underline; }

.tl-dot { color: var(--border); font-size: 14px; line-height: 1; }
.tl-time { font-size: 12px; color: var(--text-muted); }

.tl-badge {
  background: var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 99px;
}

.tl-version {
  display: inline-block;
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 1px 7px;
  border-radius: 99px;
}

.tl-tag {
  display: inline-block;
  background: var(--green-faint);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  border: 1px solid var(--green-light);
}

/* ── Admin ── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.admin-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
}

.admin-stat-num {
  font-size: 36px;
  font-weight: 900;
  color: var(--green);
  line-height: 1;
  margin-bottom: 6px;
}

.admin-stat-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.admin-tab {
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.admin-tab:hover { color: var(--text); }
.admin-tab--active { color: var(--green-dark); border-bottom-color: var(--green); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
}

.admin-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }
.admin-muted { color: var(--text-muted) !important; font-size: 12px; }

.admin-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--border);
  color: var(--text-muted);
}

.admin-badge--admin {
  background: var(--green-faint);
  color: var(--green-dark);
  border: 1px solid var(--green-light);
}

.admin-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.admin-delete-btn:hover {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

.admin-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.loading-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-table { font-size: 12px; }
}

/* ── Director / Producer profile cards ── */
.detail-profiles {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  font-family: inherit;
}
.profile-card:hover {
  border-color: var(--green);
  background: var(--green-faint);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--green-dark);
  border: 2px solid var(--green-light);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.profile-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--green-dark);
}
.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-name--empty {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
}

/* Profile modal */
.profile-modal-inner { max-width: 500px; width: 100%; }

.profile-modal-photo-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.profile-modal-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--green-dark);
  border: 3px solid var(--green-light);
}
.profile-modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-modal-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-photo-hint {
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .detail-profiles { flex-direction: column; }
}

/* ── Field label bar (label + attach button) ── */
.detail-field-label-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.detail-field-label-bar .detail-field-label { margin-bottom: 0; }

.field-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  transition: var(--transition);
  user-select: none;
}
.field-attach-btn:hover { border-color: var(--green); color: var(--green); }

/* ── Attached files list ── */
.field-attachments { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }

.field-attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  opacity: .8;
}
.field-attachment-item--latest {
  background: var(--green-faint);
  border-color: var(--green-light);
  opacity: 1;
}

.field-attachment-version {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 22px;
  flex-shrink: 0;
}
.field-attachment-item--latest .field-attachment-version { color: var(--green-dark); }

.field-attachment-latest-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 5px;
  background: var(--green);
  color: #fff;
  border-radius: 3px;
  flex-shrink: 0;
}

.field-attachment-ext {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 4px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.field-attachment-item:not(.field-attachment-item--latest) .field-attachment-ext {
  background: #e9ecef;
  color: var(--text-muted);
}

.field-attachment-name {
  flex: 1;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.field-attachment-name:hover { color: var(--green); text-decoration: underline; }
.field-attachment-item:not(.field-attachment-item--latest) .field-attachment-name { color: var(--text-muted); }

.field-attachment-size { color: var(--text-muted); font-size: 11px; white-space: nowrap; flex-shrink: 0; }
.field-attachment-date { color: var(--text-muted); font-size: 11px; white-space: nowrap; flex-shrink: 0; }

.field-attachment-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--border);
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color .12s;
}
.field-attachment-del:hover { color: #dc2626; }

/* ── Field tabs (Notes | Sheet) ── */
.field-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.field-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s;
}
.field-tab:hover { color: var(--text); }
.field-tab--active { color: var(--green); border-bottom-color: var(--green); }
.field-tab-panel { padding-top: 12px; }

/* ── Budget / Finance spreadsheet ── */
.budget-sheet { display: flex; flex-direction: column; gap: 12px; }

.budget-sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.budget-sheet-info { font-size: 12px; color: var(--text-muted); }
.budget-sheet-actions { display: flex; gap: 8px; }

.budget-btn {
  padding: 5px 13px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  transition: var(--transition);
}
.budget-btn:hover { background: var(--bg); }
.budget-btn--save { background: var(--green); color: #fff; border-color: var(--green); }
.budget-btn--save:hover { background: var(--green-dark); border-color: var(--green-dark); }

.budget-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.budget-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 680px;
}

.budget-table thead th {
  background: #f3f4f6;
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.bt-desc  { width: 30%; }
.bt-units { width: 7%;  }
.bt-type  { width: 9%;  }
.bt-rate  { width: 10%; }
.bt-total { width: 10%; text-align: right !important; }
.bt-notes { width: 28%; }
.bt-del   { width: 4%;  }

.budget-table td {
  padding: 3px 6px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

/* Header rows */
.bt-row-header td { background: #f3f4f6; }
.bt-header-cell { padding: 6px 10px !important; }

.bt-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  padding: 3px 4px;
  border-radius: 3px;
  min-width: 0;
}
.bt-input:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px var(--green-light);
}
.bt-input-header {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.bt-input-num { text-align: right; }

.bt-select {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 0;
}
.bt-select:focus { outline: none; }

/* Subtotal rows */
.bt-row-subtotal td { background: var(--green-faint); font-weight: 600; }
.bt-input-subtotal { color: var(--green-dark); font-size: 12px; font-weight: 600; }
.bt-subtotal-label { padding-left: 24px !important; }
.bt-subtotal-value { text-align: right; color: var(--green-dark); font-variant-numeric: tabular-nums; }

.bt-total-cell { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }

.bt-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0.35;
  transition: opacity .15s;
}
.bt-del-btn:hover { opacity: 1; color: #dc2626; }

/* Grand total */
.budget-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--green-faint);
  border: 1px solid var(--green-light);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.budget-grand-total-value {
  font-size: 20px;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}

/* ── Pitch Deck Editor ───────────────────────────────────────────────────────── */

.deck-editor {
  display: flex;
  gap: 16px;
  min-height: 440px;
  padding-top: 4px;
}

.deck-sidebar {
  width: 164px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding-right: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deck-slide-thumb {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s;
}
.deck-slide-thumb:hover { background: var(--green-faint); }
.deck-slide-thumb--active {
  background: var(--green-faint);
  border-color: var(--green-light);
}

.deck-thumb-num {
  background: var(--green);
  color: #fff;
  border-radius: 3px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.deck-slide-thumb--active .deck-thumb-num { background: var(--green-dark); }

.deck-thumb-label {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.deck-slide-thumb--active .deck-thumb-label { color: var(--text); font-weight: 500; }

.deck-add-slide-btn {
  margin-top: 6px;
  padding: 7px 8px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  width: 100%;
  transition: border-color .12s, color .12s;
}
.deck-add-slide-btn:hover { border-color: var(--green); color: var(--green); }

/* Main editor area */
.deck-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deck-slide-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.deck-slide-type-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--green);
}
.deck-type-select {
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text-muted);
  padding: 2px 6px;
  cursor: pointer;
  font-family: inherit;
}
.deck-type-select:focus { outline: none; border-color: var(--green); }

.deck-slide-actions { display: flex; gap: 4px; }
.deck-slide-action-btn {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.deck-slide-action-btn:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.deck-slide-action-btn:disabled { opacity: .35; cursor: default; }
.deck-slide-action-btn--danger:hover:not(:disabled) { border-color: #e53e3e; color: #e53e3e; }

/* Slide canvas */
.deck-slide-canvas {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 14px rgba(0,0,0,.06);
  padding: 32px 40px 28px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.deck-slide-canvas::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: var(--green);
}
.deck-slide-canvas--title { text-align: center; align-items: center; }
.deck-slide-canvas--title::before { display: none; }
.deck-slide-canvas--title { background: linear-gradient(135deg, var(--green-faint) 0%, #fff 60%); }
.deck-slide-canvas--financials::before { background: var(--green-dark); }

.deck-field-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  border: none;
  outline: none;
  border-bottom: 2px solid transparent;
  padding: 2px 0;
  width: 100%;
  font-family: inherit;
  background: transparent;
  line-height: 1.2;
  transition: border-color .15s;
}
.deck-field-heading:focus { border-bottom-color: var(--green); }
.deck-slide-canvas--title .deck-field-heading { font-size: 28px; text-align: center; color: var(--green-dark); }

.deck-field-subheading {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  outline: none;
  border-bottom: 1px dashed transparent;
  padding: 2px 0;
  width: 100%;
  font-family: inherit;
  background: transparent;
  transition: border-color .15s;
}
.deck-field-subheading:focus { border-bottom-color: var(--green-light); }
.deck-slide-canvas--title .deck-field-subheading { text-align: center; font-size: 17px; }

.deck-field-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  border: none;
  outline: none;
  padding: 2px 0;
  width: 100%;
  font-family: inherit;
  background: transparent;
  resize: none;
  min-height: 52px;
}
.deck-slide-canvas--title .deck-field-body { text-align: center; color: var(--text-muted); font-style: italic; }

/* Bullets */
.deck-bullets-section { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.deck-bullet-row { display: flex; align-items: flex-start; gap: 8px; }
.deck-bullet-dot {
  color: var(--green);
  font-size: 16px;
  line-height: 1.5;
  flex-shrink: 0;
  user-select: none;
}
.deck-bullet-input {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  line-height: 1.5;
  padding: 2px 0;
  border-bottom: 1px dashed transparent;
  min-width: 0;
  transition: border-color .15s;
}
.deck-bullet-input:focus { border-bottom-color: var(--green-light); }
.deck-bullet-del {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--border);
  font-size: 16px;
  line-height: 1;
  padding: 0;
  opacity: 0;
  transition: opacity .12s, color .12s;
}
.deck-bullet-row:hover .deck-bullet-del { opacity: 1; }
.deck-bullet-del:hover { color: #e53e3e; }
.deck-add-bullet-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 0 0 24px;
  text-align: left;
  transition: color .12s;
}
.deck-add-bullet-btn:hover { color: var(--green); }

/* Save bar */
.deck-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 2px;
}
.deck-slide-count { font-size: 12px; color: var(--text-muted); }
.deck-save-btn {
  padding: 8px 22px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.deck-save-btn:hover { background: var(--green-dark); }

/* Currency toggle */
.currency-toggle {
  display: flex;
  gap: 4px;
  align-items: center;
}
.currency-btn {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.currency-btn:hover { border-color: var(--green); color: var(--green); }
.currency-btn--active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* Finance sheet column widths */
.bt-col-source { width: 38%; }
.bt-col-amount { width: 18%; }
.bt-col-status { width: 22%; }
.bt-col-notes  { width: 22%; }

.bt-amount {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  text-align: right;
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
}
.bt-amount:focus { outline: none; }

.bt-status-select {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-muted);
  padding: 3px 0;
  cursor: pointer;
}
.bt-status-select:focus { outline: none; }
.bt-status-select option { color: var(--text); }
