/* ============================================
   FrameFlip — Portal Styles
   Warm, editorial feel — minimal, functional
   ============================================ */

:root {
  --bg: #faf8f4;
  --bg-2: #f2ede6;
  --surface: #fff;
  --border: #e8e0d4;
  --fg: #1c1917;
  --fg-muted: #78716c;
  --accent: #b45309;
  --accent-dim: rgba(180, 83, 9, 0.08);
  --yellow: #d97706;
  --amber: #f59e0b;
  --warm-red: #c2410c;
  --green: #059669;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --max-w: 900px;
  --pad-x: clamp(20px, 5vw, 64px);
  --radius: 12px;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---- NAV ---- */
.portal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px var(--pad-x);
  background: rgba(250, 248, 244, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.portal-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
  color: var(--fg);
  font-style: italic;
}
.portal-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  font-size: 14px;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--fg); background: var(--bg-2); }
.nav-link.active { color: var(--fg); background: var(--bg-2); }

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-block;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-primary-sm {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.btn-primary-sm:hover { opacity: 0.88; }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--fg); color: var(--fg); }

/* ---- MAIN ---- */
.portal-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px var(--pad-x) 80px;
}

.portal-header { margin-bottom: 40px; }

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

.portal-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--fg);
  margin-bottom: 8px;
}
.portal-subtitle {
  font-size: 15px;
  color: var(--fg-muted);
  font-weight: 300;
}

/* ---- PIPELINE BOARD ---- */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .pipeline-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .pipeline-board { grid-template-columns: 1fr; }
}

.pipeline-col { display: flex; flex-direction: column; gap: 0; }

.pipeline-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 1px;
}
.pipeline-col-header.new     { background: rgba(217, 119, 6, 0.1); }
.pipeline-col-header.briefed { background: rgba(180, 83, 9, 0.1); }
.pipeline-col-header.in_production { background: rgba(194, 65, 12, 0.1); }
.pipeline-col-header.delivered { background: rgba(5, 150, 105, 0.1); }

.pipeline-col-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}
.pipeline-col-count {
  font-size: 12px;
  font-weight: 700;
  background: rgba(28, 25, 23, 0.07);
  color: var(--fg-muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pipeline-col-cards {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.pipeline-empty {
  font-size: 13px;
  color: var(--fg-muted);
  font-style: italic;
  text-align: center;
  padding: 20px 0;
  opacity: 0.6;
}

/* ---- CLIENT CARDS ---- */
.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.client-card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(180, 83, 9, 0.08); }

.client-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.client-card-name {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}
.client-card-name:hover { color: var(--accent); }

.client-card-delete { flex-shrink: 0; }
.delete-btn {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.2s;
}
.delete-btn:hover { color: var(--warm-red); }

.client-card-brand {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 500;
}
.client-card-email {
  font-size: 12px;
  color: var(--fg-muted);
  opacity: 0.7;
}
.client-card-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.client-card-action {
  font-size: 12px;
  color: var(--warm-red);
  text-decoration: none;
  margin-top: 4px;
  font-weight: 500;
}
.client-card-action:hover { text-decoration: underline; }

/* ---- PLATFORM TAGS ---- */
.platform-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--bg-2);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* ---- STATUS SELECTS ---- */
.status-select {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  appearance: none;
}
.status-select.new     { border-color: rgba(217,119,6,0.4); color: var(--yellow); }
.status-select.briefed { border-color: rgba(180,83,9,0.4); color: var(--accent); }
.status-select.in_production { border-color: rgba(194,65,12,0.4); color: var(--warm-red); }
.status-select.delivered { border-color: rgba(5,150,105,0.4); color: var(--green); }

/* ---- FORMS ---- */
.form-error {
  background: rgba(194, 65, 12, 0.06);
  border: 1px solid rgba(194, 65, 12, 0.2);
  color: var(--warm-red);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 24px;
}

.intake-form, .brief-form {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 12px 14px;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group select { cursor: pointer; }

.platform-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--fg);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

/* ---- CLIENT DETAIL ---- */
.client-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.client-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.meta-item {
  font-size: 14px;
  color: var(--fg-muted);
}
.meta-item.goals {
  font-style: italic;
  font-size: 13px;
  max-width: 500px;
  white-space: pre-wrap;
}

/* ---- BRIEFS ---- */
.briefs-section { margin-top: 40px; }
.briefs-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.section-heading {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
}
.briefs-empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.briefs-empty p { font-size: 14px; color: var(--fg-muted); }
.briefs-empty a { color: var(--accent); text-decoration: none; }
.briefs-empty a:hover { text-decoration: underline; }

.briefs-list { display: flex; flex-direction: column; gap: 12px; }
.brief-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brief-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brief-date {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 300;
}
.brief-description {
  font-size: 14px;
  color: var(--fg);
  line-height: 1.65;
  white-space: pre-wrap;
}
.brief-status-form .status-select {
  font-size: 13px;
  padding: 5px 10px;
}