/* ── App Navigation ─────────────────────────────────────────────────────────── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 24px;
}

.app-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.app-nav-brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.app-nav-links {
  display: flex;
  gap: 4px;
}

.app-nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.app-nav-link:hover,
.app-nav-link.active {
  color: var(--fg);
  background: rgba(255,255,255,0.05);
}

/* ── App Shell ──────────────────────────────────────────────────────────────── */
.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Page Header ────────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 36px;
}

.page-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

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

.page-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 400;
  color: #fff;
  line-height: 1.15;
}

.page-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-top: 6px;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0c1220;
}
.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

.btn-danger {
  background: rgba(220, 53, 69, 0.15);
  color: #f87171;
  border: 1px solid rgba(220,53,69,0.3);
}
.btn-danger:hover { background: rgba(220,53,69,0.25); }

.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 0.9rem;
}
.alert-error {
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220,53,69,0.3);
  color: #f87171;
}

/* ── Summary Strip ──────────────────────────────────────────────────────────── */
.summary-strip {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.summary-card {
  flex: 0 0 auto;
  min-width: 120px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-card--total {
  border-color: rgba(212, 149, 42, 0.2);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(212,149,42,0.07) 100%);
  min-width: 150px;
}

.summary-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.summary-value {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--accent-light);
  line-height: 1.1;
}

.summary-count {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* ── Stage Pills ────────────────────────────────────────────────────────────── */
.stage-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.stage-pill--lg {
  padding: 6px 16px;
  font-size: 0.88rem;
}

.stage-pill--lead      { background: rgba(100,116,139,0.2); color: #94a3b8; }
.stage-pill--contacted { background: rgba(59,130,246,0.15); color: #60a5fa; }
.stage-pill--proposal  { background: rgba(168,85,247,0.15); color: #c084fc; }
.stage-pill--active    { background: rgba(34,197,94,0.15);  color: #4ade80; }
.stage-pill--closed    { background: rgba(212,149,42,0.15); color: var(--accent-light); }

/* ── Kanban Board ───────────────────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 56px;
  overflow-x: auto;
}

.kanban-col {
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 160px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kanban-stage-pill {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* reuse stage-pill colours without padding */
.kanban-stage-pill--lead      { color: #94a3b8; }
.kanban-stage-pill--contacted { color: #60a5fa; }
.kanban-stage-pill--proposal  { color: #c084fc; }
.kanban-stage-pill--active    { color: #4ade80; }
.kanban-stage-pill--closed    { color: var(--accent-light); }

.kanban-col-count {
  font-size: 0.78rem;
  color: var(--fg-muted);
  background: rgba(255,255,255,0.05);
  padding: 1px 8px;
  border-radius: 100px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  display: block;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.04);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}
.kanban-card:hover {
  border-color: rgba(212,149,42,0.25);
  transform: translateY(-1px);
}

.kanban-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 2px;
}

.kanban-card-company {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.kanban-card-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-light);
}

.kanban-empty {
  font-size: 0.8rem;
  color: rgba(139,147,167,0.4);
  text-align: center;
  padding: 20px 0;
}

/* ── Table ──────────────────────────────────────────────────────────────────── */
.table-section {
  margin-top: 16px;
}

.table-section-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 20px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-raised);
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--fg);
  vertical-align: middle;
}

.data-row {
  cursor: pointer;
  transition: background 0.15s;
}
.data-row:hover { background: rgba(255,255,255,0.025); }

.td-name  { font-weight: 600; }
.td-muted { color: var(--fg-muted); font-size: 0.875rem; }
.td-value { font-weight: 600; color: var(--accent-light); }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 24px;
}

.card-section-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--full { grid-column: 1 / -1; }

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.required { color: var(--accent); }

.form-input {
  background: var(--bg-raised);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(212,149,42,0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b93a7' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Detail Layout ──────────────────────────────────────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: flex-start;
}

/* ── Notes ──────────────────────────────────────────────────────────────────── */
.note-form {
  margin-bottom: 24px;
}

.note-input {
  min-height: 72px;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes-empty {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-align: center;
  padding: 24px 0;
}

.note-item {
  padding: 12px 16px;
  background: var(--bg-raised);
  border-radius: 8px;
  border-left: 2px solid var(--accent);
}

.note-body {
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.6;
  margin-bottom: 6px;
  white-space: pre-wrap;
}

.note-date {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* ── Empty State ────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 0;
}
.empty-state p { color: var(--fg-muted); }
.empty-state a { color: var(--accent-light); text-decoration: none; }
.empty-state a:hover { text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .kanban-board {
    grid-template-columns: repeat(3, 1fr);
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell { padding: 24px 16px 60px; }
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .page-header-inner { flex-direction: column; align-items: flex-start; }
  .summary-strip { gap: 8px; }
}
